Add dayz_authKey for safes and lockboxes

Safes and Lockboxes got updated and need dayz_authKey now. Also improved the logging of codes and who has used which codes in the logs for server admins.
This commit is contained in:
AirwavesMan
2020-09-08 20:29:23 +02:00
parent ecba701857
commit 5180223c22
5 changed files with 48 additions and 30 deletions

View File

@@ -3,11 +3,11 @@
Usage: _obj spawn player_lockVault;
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
private ["_obj","_ownerID","_text","_playerNear","_ComboMatch","_objType"];
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_code","_lockedClass","_obj","_ownerID","_text","_ComboMatch","_objType"];
player removeAction s_player_lockvault;
s_player_lockvault = 1;
@@ -37,7 +37,9 @@ if (!isNull _obj) then {
[player,"safeclose",0,false] call dayz_zombieSpeak;
};
PVDZE_handleSafeGear = [player,_obj,1];
_code = [_obj getVariable["CharacterID","0"],dayz_combination] select (_ComboMatch);
PVDZE_handleSafeGear = [player,_obj,1,_code,dayz_authKey];
publicVariableServer "PVDZE_handleSafeGear";
waitUntil {!isNil "dze_waiting"}; // wait for response from server to verify safe was logged and saved before proceeding

View File

@@ -1,11 +1,11 @@
/*
_obj spawn player_packVault;
*/
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
/*
[_obj] spawn player_packVault;
*/
private ["_obj","_ownerID","_objectID","_objectUID","_packedClass","_text","_playerNear","_finished","_ComboMatch","_typeOf"];
private ["_code","_obj","_ownerID","_objectID","_objectUID","_packedClass","_text","_playerNear","_finished","_ComboMatch","_typeOf"];
_obj = _this;
_typeOf = typeOf _obj;
@@ -49,7 +49,9 @@ dze_waiting = nil;
[_packedClass,objNull] call fn_waitForObject;
PVDZE_handleSafeGear = [player,_obj,2];
_code = [_obj getVariable["CharacterID","0"],dayz_combination] select (_ComboMatch);
PVDZE_handleSafeGear = [player,_obj,2,_code,dayz_authKey];
publicVariableServer "PVDZE_handleSafeGear";
waitUntil {!isNil "dze_waiting"}; // wait for response from server to verify pack was logged and gear added before proceeding

View File

@@ -7,7 +7,7 @@
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_21" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_display","_displayCombo","_displayEye","_doorMethod","_hasAccess","_notNearestPlayer","_obj","_objectCharacterID"];
private ["_display","_displayCombo","_displayEye","_doorMethod","_hasAccess","_notNearestPlayer","_obj","_objectCharacterID","_code"];
_doorMethod = "";
_displayCombo = findDisplay 41144;
@@ -46,6 +46,8 @@ if (!isNull dayz_selectedDoor) then {
if (DZE_Lock_Door == _objectCharacterID) then {
_display closeDisplay 2;
_code = [DZE_Lock_Door,format ["%1 - EYESCAN",_objectCharacterID]] select (_doorMethod == "EYE");
if !(typeof _obj in ["WoodenGate_1_DZ","WoodenGate_2_DZ","WoodenGate_3_DZ","WoodenGate_4_DZ"]) then {
[player,"combo_unlock",0,false] call dayz_zombieSpeak;
@@ -56,10 +58,10 @@ if (!isNull dayz_selectedDoor) then {
_obj animate ["Open_latch", 1];
};
PVDZE_handleSafeGear = [player,_obj,5,if (_doorMethod == "EYE") then {"EYESCAN"} else {DZE_Lock_Door}];
PVDZE_handleSafeGear = [player,_obj,5,_code];
publicVariableServer "PVDZE_handleSafeGear";
} else {
GateMethod = [DZE_Lock_Door,"EYESCAN"] select (_doorMethod == "EYE");
GateMethod = _code;
};
if (_doorMethod == "Eye") then {

View File

@@ -3,11 +3,11 @@
Usage: _obj spawn player_unlockVault;
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
private ["_obj","_ownerID","_playerNear","_text","_objType","_ComboMatch"];
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_code","_unlockedClass","_obj","_ownerID","_text","_objType","_ComboMatch"];
{player removeAction _x} count s_player_combi;
s_player_combi = [];
s_player_unlockvault = 1;
@@ -43,14 +43,16 @@ if (_ComboMatch || (_ownerID == dayz_playerUID)) then {
[player,"safeopen",0,false] call dayz_zombieSpeak;
};
PVDZE_handleSafeGear = [player,_obj,0];
_code = [_obj getVariable["CharacterID","0"],dayz_combination] select (_ComboMatch);
PVDZE_handleSafeGear = [player,_obj,0,_code,dayz_authKey];
publicVariableServer "PVDZE_handleSafeGear";
waitUntil {!isNil "dze_waiting"}; // wait for response from server to verify safe was logged before proceeding
format[localize "STR_BLD_UNLOCKED",_text] call dayz_rollingMessages;
} else {
PVDZE_handleSafeGear = [player,_obj,3,dayz_combination];
PVDZE_handleSafeGear = [player,_obj,3,dayz_combination,dayz_authKey];
publicVariableServer "PVDZE_handleSafeGear";
[player,"repair",0,false] call dayz_zombieSpeak;

View File

@@ -1,4 +1,4 @@
private ["_backpacks","_charID","_clientID","_dir","_holder","_lockCode","_lockedClass","_magazines","_name","_obj","_objectID","_objectUID","_ownerID","_packedClass","_player","_playerUID","_pos","_status","_statusText","_type","_unlockedClass","_vector","_weapons","_message","_suppliedCode","_damage","_coins","_wealth"];
private ["_exitReason","_clientKey","_backpacks","_charID","_clientID","_dir","_holder","_lockCode","_lockedClass","_magazines","_name","_obj","_objectID","_objectUID","_ownerID","_packedClass","_player","_playerUID","_pos","_status","_statusText","_type","_unlockedClass","_vector","_weapons","_message","_suppliedCode","_damage","_coins","_wealth"];
_player = _this select 0;
_obj = _this select 1;
@@ -14,11 +14,10 @@ _objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
_ownerID = _obj getVariable ["ownerPUID","0"];
_lockCode = _charID;
_suppliedCode = [_charID,_this select 3] select (count _this > 3);
_exitReason = "";
if (count _this > 3) then {
_suppliedCode = _this select 3;
if (_status != 3 && {_status != 6}) then {_lockCode = _suppliedCode;};
};
if (_status != 3 && {_status != 6}) then {_lockCode = _suppliedCode;};
// Player may have disconnected or died before message send. Attempt lock/unlock/pack/save procedure anyway
if (isNull _player) then {diag_log "ERROR: server_handleSafeGear called with Null player object";};
@@ -30,7 +29,7 @@ _statusText = call {
if (_status == 0) exitwith {"UNLOCKED"}; // unlock safe/lockbox
if (_status == 1) exitwith {"LOCKED"}; // lock safe/lockbox
if (_status == 5) exitwith {"UNLOCKED"}; // unlock door
if (_status == 4) exitwith {"LOCKED"}; // lock door
if (_status == 4) exitwith {_lockCode = _charID; "LOCKED"}; // lock door
if (_status == 3) exitwith {"FAILED unlocking"}; // failed unlock safe/lockbox
if (_status == 6) exitwith {"FAILED unlocking"}; // failed unlocking door
if (_status == 2) exitwith {"PACKED"}; // pack safe/lockbox
@@ -44,6 +43,13 @@ if (isNull _obj) exitWith {
};
};
if !(_type in DZE_DoorsLocked) then {
_clientKey = _this select 4;
_exitReason = [_this,_statusText,(getPosATL _obj),_clientKey,_playerUID,_player] call server_verifySender;
};
if (_exitReason != "") exitWith {diag_log _exitReason};
call {
if (_status == 0) exitwith { //Unlocking
_unlockedClass = getText (configFile >> "CfgVehicles" >> _type >> "unlockedClass");
@@ -131,14 +137,18 @@ call {
if (_status < 4) then {
_type = call {
if (_type == "VaultStorageLocked" || {_type == "VaultStorage"}) exitwith {
if (_type == "VaultStorageLocked" || _type == "VaultStorage") exitwith {
if (_ownerID == _playerUID) then {_lockCode = format["%1 - Owner",_lockCode];};
"Safe"
};
if (_type == "LockboxStorage") exitwith {
"LockBox"
};
if (_type == "LockboxStorageLocked") exitwith {
_lockCode = _charID call fnc_lockCode;
if (_type == "LockboxStorage" || _type == "LockboxStorageLocked") exitwith {
if (_ownerID == _playerUID) then {
_lockCode = _charID call fnc_lockCode;
_lockCode = format["%1 - Owner",_lockCode];
} else {
_lockCode = _charID call fnc_lockCode;
};
if (_status == 3) then {_suppliedCode = _suppliedCode call fnc_lockCode;};
"LockBox"
};