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;
@@ -36,21 +36,23 @@ if (_ComboMatch || (_ownerID == dayz_playerUID)) then {
dayz_lastCodeFail = 0;
[_unlockedClass,objNull] call fn_waitForObject;
if (_unlockedClass == "LockboxStorage") then {
[player,"lockboxopen",0,false] call dayz_zombieSpeak;
} else {
[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;