mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Keep global characterID only for special cases
Only vehicles with a key and locked/lockable buildings need a global characterID. All other vehicles and buildings will have a characterID of "0".
This commit is contained in:
@@ -1212,9 +1212,6 @@ if (_canBuild) then {
|
|||||||
if (count _findNearestPole > 0) then { // is near plot
|
if (count _findNearestPole > 0) then { // is near plot
|
||||||
|
|
||||||
_nearestPole = _findNearestPole select 0; // get first entry
|
_nearestPole = _findNearestPole select 0; // get first entry
|
||||||
_ownerID = _nearestPole getVariable["CharacterID","0"];
|
|
||||||
|
|
||||||
if (dayz_characterID != _ownerID) then { // not the owner
|
|
||||||
_buildcheck = [player, _nearestPole] call FNC_check_access;
|
_buildcheck = [player, _nearestPole] call FNC_check_access;
|
||||||
_isowner = _buildcheck select 0;
|
_isowner = _buildcheck select 0;
|
||||||
_isfriendly = ((_buildcheck select 1) || (_buildcheck select 3));
|
_isfriendly = ((_buildcheck select 1) || (_buildcheck select 3));
|
||||||
@@ -1224,7 +1221,7 @@ if (_canBuild) then {
|
|||||||
if (_cancel) then {
|
if (_cancel) then {
|
||||||
_reason = localize "STR_EPOCH_PLAYER_134"; // You do not have access to build on this plot.
|
_reason = localize "STR_EPOCH_PLAYER_134"; // You do not have access to build on this plot.
|
||||||
};
|
};
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1555,8 +1552,8 @@ if (_canBuild) then {
|
|||||||
systemChat format[localize "str_epoch_player_140", _combinationDisplay, _text]; // You have setup your %2. The combination is %1
|
systemChat format[localize "str_epoch_player_140", _combinationDisplay, _text]; // You have setup your %2. The combination is %1
|
||||||
|
|
||||||
} else { // if not lockable item
|
} else { // if not lockable item
|
||||||
|
local _charID = "0";
|
||||||
_builtObject setVariable ["CharacterID", dayz_characterID, true];
|
_builtObject setVariable ["CharacterID", _charID];
|
||||||
|
|
||||||
// fireplace
|
// fireplace
|
||||||
if (_builtObject isKindOf "Land_Fire_DZ") then { // if campfire, then spawn, but do not publish to database
|
if (_builtObject isKindOf "Land_Fire_DZ") then { // if campfire, then spawn, but do not publish to database
|
||||||
@@ -1571,9 +1568,9 @@ if (_canBuild) then {
|
|||||||
_friendsArr = [[dayz_playerUID, toArray (name player)]];
|
_friendsArr = [[dayz_playerUID, toArray (name player)]];
|
||||||
_builtObject setVariable ["plotfriends", _friendsArr, true];
|
_builtObject setVariable ["plotfriends", _friendsArr, true];
|
||||||
|
|
||||||
PVDZ_obj_Publish = [dayz_characterID, _builtObject, [_dir, _position, dayz_playerUID, _vector], _friendsArr, player, dayz_authKey];
|
PVDZ_obj_Publish = [_charID, _builtObject, [_dir, _position, dayz_playerUID, _vector], _friendsArr, player, dayz_authKey];
|
||||||
} else {
|
} else {
|
||||||
PVDZ_obj_Publish = [dayz_characterID, _builtObject, [_dir, _position, dayz_playerUID, _vector], [], player, dayz_authKey];
|
PVDZ_obj_Publish = [_charID, _builtObject, [_dir, _position, dayz_playerUID, _vector], [], player, dayz_authKey];
|
||||||
};
|
};
|
||||||
publicVariableServer "PVDZ_obj_Publish";
|
publicVariableServer "PVDZ_obj_Publish";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ if (dayz_actionInProgress) exitWith {localize "str_epoch_player_48" call dayz_ro
|
|||||||
dayz_actionInProgress = true;
|
dayz_actionInProgress = true;
|
||||||
|
|
||||||
player removeAction s_player_downgrade_build;
|
player removeAction s_player_downgrade_build;
|
||||||
s_player_downgrade_build = 1;
|
s_player_downgrade_build = -1;
|
||||||
|
|
||||||
local _obj = _this select 3;
|
local _obj = _this select 3;
|
||||||
|
|
||||||
@@ -22,7 +22,6 @@ local _objectCharacterID = _obj getVariable ["CharacterID","0"];
|
|||||||
|
|
||||||
if (DZE_Lock_Door != _objectCharacterID) exitWith { // Unable to downgrade, you do not know the combination.
|
if (DZE_Lock_Door != _objectCharacterID) exitWith { // Unable to downgrade, you do not know the combination.
|
||||||
dayz_actionInProgress = false;
|
dayz_actionInProgress = false;
|
||||||
s_player_downgrade_build = -1;
|
|
||||||
localize "str_epoch_player_49" call dayz_rollingMessages;
|
localize "str_epoch_player_49" call dayz_rollingMessages;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -30,10 +29,16 @@ local _playerNear = {isPlayer _x} count (([_obj] call FNC_GetPos) nearEntities [
|
|||||||
|
|
||||||
if (_playerNear) exitWith { // Another player is nearby. Only one player can be near to perform this action.
|
if (_playerNear) exitWith { // Another player is nearby. Only one player can be near to perform this action.
|
||||||
dayz_actionInProgress = false;
|
dayz_actionInProgress = false;
|
||||||
s_player_downgrade_build = -1;
|
|
||||||
localize "str_pickup_limit_5" call dayz_rollingMessages;
|
localize "str_pickup_limit_5" call dayz_rollingMessages;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
local _ownerID = _obj getVariable["ownerPUID", "0"];
|
||||||
|
|
||||||
|
if (_ownerID == "0") exitWith { // Not setup yet.
|
||||||
|
dayz_actionInProgress = false;
|
||||||
|
localize "str_epoch_player_50" call dayz_rollingMessages;
|
||||||
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
local _classname = typeOf _obj;
|
local _classname = typeOf _obj;
|
||||||
@@ -89,9 +94,8 @@ if (count _upgrade > 0) then {
|
|||||||
local _vector = [(vectorDir _obj), (vectorUp _obj)];
|
local _vector = [(vectorDir _obj), (vectorUp _obj)];
|
||||||
|
|
||||||
if (_classname in DZE_DoorsLocked) then {
|
if (_classname in DZE_DoorsLocked) then {
|
||||||
|
_objectCharacterID = "0";
|
||||||
_obj setVariable ["CharacterID", dayz_characterID, true];
|
_obj setVariable ["CharacterID",_objectCharacterID, true];
|
||||||
_objectCharacterID = dayz_characterID;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
_classname = _newclassname;
|
_classname = _newclassname;
|
||||||
@@ -126,7 +130,6 @@ if (count _upgrade > 0) then {
|
|||||||
_object setDamage _damageNew;
|
_object setDamage _damageNew;
|
||||||
};
|
};
|
||||||
|
|
||||||
local _ownerID = _obj getVariable["ownerPUID", "0"];
|
|
||||||
_object setVariable ["ownerPUID", _ownerID, true];
|
_object setVariable ["ownerPUID", _ownerID, true];
|
||||||
PVDZE_obj_Swap = [_objectCharacterID, _object, [_dir, _position, dayz_playerUID, _vector], _classname, _obj, player, [], dayz_authKey];
|
PVDZE_obj_Swap = [_objectCharacterID, _object, [_dir, _position, dayz_playerUID, _vector], _classname, _obj, player, [], dayz_authKey];
|
||||||
publicVariableServer "PVDZE_obj_Swap";
|
publicVariableServer "PVDZE_obj_Swap";
|
||||||
|
|||||||
@@ -14,14 +14,14 @@ if (dayz_actionInProgress) exitWith {localize "str_epoch_player_52" call dayz_ro
|
|||||||
dayz_actionInProgress = true;
|
dayz_actionInProgress = true;
|
||||||
|
|
||||||
player removeAction s_player_upgrade_build;
|
player removeAction s_player_upgrade_build;
|
||||||
s_player_upgrade_build = 1;
|
s_player_upgrade_build = -1;
|
||||||
|
|
||||||
local _obj = _this select 3;
|
local _obj = _this select 3;
|
||||||
local _classname = typeOf _obj;
|
local _classname = typeOf _obj;
|
||||||
|
local _ownerID = _obj getVariable["ownerPUID","0"];
|
||||||
|
|
||||||
if (_classname in DZE_DisableUpgrade) exitWith {
|
if (_ownerID == "0" || {_classname in DZE_DisableUpgrade}) exitWith {
|
||||||
dayz_actionInProgress = false;
|
dayz_actionInProgress = false;
|
||||||
s_player_upgrade_build = -1;
|
|
||||||
localize "str_epoch_player_50" call dayz_rollingMessages; // Not setup yet.
|
localize "str_epoch_player_50" call dayz_rollingMessages; // Not setup yet.
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -208,8 +208,6 @@ if ((count _upgrade) > 0) then {
|
|||||||
_object setDamage _damageNew;
|
_object setDamage _damageNew;
|
||||||
};
|
};
|
||||||
|
|
||||||
local _ownerID = _obj getVariable["ownerPUID","0"];
|
|
||||||
|
|
||||||
if (_ownerID == "0") then {
|
if (_ownerID == "0") then {
|
||||||
_ownerID = dayz_playerUID; // APFL is on but UID is 0 so we will claim it to record the ownership.
|
_ownerID = dayz_playerUID; // APFL is on but UID is 0 so we will claim it to record the ownership.
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ if (_isPole && _isNearPlot > 0) exitWith {
|
|||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
if (_isPole && !_isAdmin && DZE_limitPlots > 0) then {
|
if (_isPole && !_isAdmin && DZE_limitPlots > 0) then {
|
||||||
{
|
{
|
||||||
if (_x getVariable["ownerPUID","0"] == dayz_playerUID || (_x getVariable["CharacterID","0"] == dayz_characterID)) then {
|
if (_x getVariable["ownerPUID","0"] == dayz_playerUID) then {
|
||||||
_plotPoles = _plotPoles + 1;
|
_plotPoles = _plotPoles + 1;
|
||||||
};
|
};
|
||||||
} count (entities "Plastic_Pole_EP1_DZ"); // all plot poles on the map owned by player
|
} count (entities "Plastic_Pole_EP1_DZ"); // all plot poles on the map owned by player
|
||||||
@@ -130,10 +130,6 @@ if (_isNearPlot == 0 && !_canBuild) exitWith {
|
|||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
if (_isNearPlot > 0) then {
|
if (_isNearPlot > 0) then {
|
||||||
local _ownerID = _nearestPole getVariable["CharacterID","0"];
|
|
||||||
if (dayz_characterID == _ownerID) then {
|
|
||||||
_canBuild = true;
|
|
||||||
} else {
|
|
||||||
local _accessCheck = [player, _nearestPole] call FNC_check_access;
|
local _accessCheck = [player, _nearestPole] call FNC_check_access;
|
||||||
local _isowner = _accessCheck select 0;
|
local _isowner = _accessCheck select 0;
|
||||||
local _isfriendly = ((_accessCheck select 1) || (_accessCheck select 3));
|
local _isfriendly = ((_accessCheck select 1) || (_accessCheck select 3));
|
||||||
@@ -141,7 +137,6 @@ if (_isNearPlot > 0) then {
|
|||||||
_canBuild = true;
|
_canBuild = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
if (_isNearPlot > 0 && !_canBuild) exitWith {
|
if (_isNearPlot > 0 && !_canBuild) exitWith {
|
||||||
dayz_actionInProgress = false;
|
dayz_actionInProgress = false;
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ private [
|
|||||||
,"_isDoorFriend" // return value - Only applicable if target is a door
|
,"_isDoorFriend" // return value - Only applicable if target is a door
|
||||||
,"_isDoorAdmin" // return value - Only applicable if target is a door
|
,"_isDoorAdmin" // return value - Only applicable if target is a door
|
||||||
,"_targetType" // return value
|
,"_targetType" // return value
|
||||||
,"_targetOwnerUID" // UID or characterID of the owner of _target
|
,"_targetOwnerUID" // UID of the owner of _target
|
||||||
,"_playerUID" // UID of the _player
|
,"_playerUID" // UID of the _player
|
||||||
,"_plotcheck" // takes return value of FNC_find_plots
|
,"_plotcheck" // takes return value of FNC_find_plots
|
||||||
,"_isNearPlot" // player is in plot's reach
|
,"_isNearPlot" // player is in plot's reach
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ if (_outcome != "PASS") then {
|
|||||||
processInitCommands;
|
processInitCommands;
|
||||||
|
|
||||||
_characterID = str(_characterID);
|
_characterID = str(_characterID);
|
||||||
_object setVariable ["CharacterID", _characterID, true];
|
_object setVariable ["CharacterID", _characterID, [true,false] select (_characterID == "0")];
|
||||||
|
|
||||||
if (_characterID != "0" && !(_object isKindOf "Bicycle")) then {_object setVehicleLock "LOCKED";};
|
if (_characterID != "0" && !(_object isKindOf "Bicycle")) then {_object setVehicleLock "LOCKED";};
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ if (_outcome != "PASS") then {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
_object setVariable ["lastUpdate",diag_tickTime];
|
_object setVariable ["lastUpdate",diag_tickTime];
|
||||||
_object setVariable ["CharacterID", _characterID, true];
|
_object setVariable ["CharacterID", _characterID]; // Non key vehicles need no global set CharacterID
|
||||||
_object setDamage _damage;
|
_object setDamage _damage;
|
||||||
|
|
||||||
[_object,_array] call server_setHitpoints;
|
[_object,_array] call server_setHitpoints;
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ if (_outcome != "PASS") then {
|
|||||||
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
|
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
|
||||||
_object setVariable ["ObjectID", _oid];
|
_object setVariable ["ObjectID", _oid];
|
||||||
_object setVariable ["lastUpdate",diag_tickTime];
|
_object setVariable ["lastUpdate",diag_tickTime];
|
||||||
_object setVariable ["CharacterID", _characterID, true];
|
_object setVariable ["CharacterID", _characterID,[true,false] select (_donotusekey)]; // Set CharacterID global only for vehicles with a key.
|
||||||
|
|
||||||
if(DZE_TRADER_SPAWNMODE) then {
|
if(DZE_TRADER_SPAWNMODE) then {
|
||||||
_object attachTo [_object_para, [0,0,-1.6]];
|
_object attachTo [_object_para, [0,0,-1.6]];
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ if (_outcome != "PASS") then {
|
|||||||
|
|
||||||
_object setVariable ["ObjectID", _oid];
|
_object setVariable ["ObjectID", _oid];
|
||||||
_object setVariable ["lastUpdate",diag_tickTime];
|
_object setVariable ["lastUpdate",diag_tickTime];
|
||||||
_object setVariable ["CharacterID", _characterID, true];
|
_object setVariable ["CharacterID", _characterID, [false,true] select (_characterID != "0")];
|
||||||
|
|
||||||
if (Z_SingleCurrency && {ZSC_VehicleMoneyStorage && (_coins > 0)}) then {
|
if (Z_SingleCurrency && {ZSC_VehicleMoneyStorage && (_coins > 0)}) then {
|
||||||
_object setVariable ["cashMoney",_coins,true];
|
_object setVariable ["cashMoney",_coins,true];
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
private ["_gearClasses","_coins","_class","_uid","_charID","_object","_worldspace","_key","_allowed","_obj","_inv","_objectID","_objectUID","_proceed","_activatingplayer","_clientKey","_exitReason","_playerUID","_weapons","_magazines","_backpacks"];
|
private ["_setGlobal","_gearClasses","_coins","_class","_uid","_charID","_object","_worldspace","_key","_allowed","_obj","_inv","_objectID","_objectUID","_proceed","_activatingplayer","_clientKey","_exitReason","_playerUID","_weapons","_magazines","_backpacks"];
|
||||||
|
|
||||||
if (count _this < 8) exitWith {diag_log format ["Server_SwapObject error: Wrong parameter format from player %1",_this select 5];};
|
if (count _this < 8) exitWith {diag_log format ["Server_SwapObject error: Wrong parameter format from player %1",_this select 5];};
|
||||||
|
|
||||||
@@ -67,7 +67,8 @@ if (!_allowed || !_proceed) exitWith {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Publish variables
|
// Publish variables
|
||||||
_object setVariable ["CharacterID",_charID,true];
|
_setGlobal = [false,true] select ((_class in DZE_isLockedStorageUpgrade) || (_class in DZE_DoorsLocked));
|
||||||
|
_object setVariable ["CharacterID",_charID,_setGlobal];
|
||||||
|
|
||||||
//diag_log ("PUBLISH: Attempt " + str(_object));
|
//diag_log ("PUBLISH: Attempt " + str(_object));
|
||||||
|
|
||||||
|
|||||||
@@ -263,7 +263,8 @@ if ((playersNumber west + playersNumber civilian) == 0) exitWith {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
_object setVariable ["CharacterID", _ownerID, true];
|
_setGlobal = [false,true] select ((_type in DZE_LockedStorage) || (_type in DZE_DoorsLocked));
|
||||||
|
_object setVariable ["CharacterID", _ownerID, _setGlobal];
|
||||||
if (_isSafeObject && !_isTrapItem) then {
|
if (_isSafeObject && !_isTrapItem) then {
|
||||||
_object setVariable["memDir",_dir,true];
|
_object setVariable["memDir",_dir,true];
|
||||||
if (DZE_GodModeBase && {!(_type in DZE_GodModeBaseExclude)}) then {
|
if (DZE_GodModeBase && {!(_type in DZE_GodModeBaseExclude)}) then {
|
||||||
@@ -363,7 +364,8 @@ if ((playersNumber west + playersNumber civilian) == 0) exitWith {
|
|||||||
{_object addBackpackCargoGlobal [_x, _backpackqty select _foreachindex];} foreach _backpackcargo;
|
{_object addBackpackCargoGlobal [_x, _backpackqty select _foreachindex];} foreach _backpackcargo;
|
||||||
};
|
};
|
||||||
|
|
||||||
_object setVariable ["CharacterID", _ownerID, true];
|
_setGlobal = [false,true] select (_ownerID != "0");
|
||||||
|
_object setVariable ["CharacterID", _ownerID, _setGlobal];
|
||||||
|
|
||||||
[_object,_hitpoints] call server_setHitpoints;
|
[_object,_hitpoints] call server_setHitpoints;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user