mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Update server_functions.sqf
Remove unused server_addtoFenceUpdateArray. The damagehandler for dayz mod fences got disabled.
This commit is contained in:
@@ -51,6 +51,8 @@ spawn_roadblocks = compile preprocessFileLineNumbers "\z\addons\dayz_server\comp
|
||||
spawn_vehicles = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\spawn_vehicles.sqf";
|
||||
|
||||
server_medicalSync = {
|
||||
private ["_player","_array"];
|
||||
|
||||
_player = _this select 0;
|
||||
_array = _this select 1;
|
||||
|
||||
@@ -82,47 +84,9 @@ dayz_Achievements = {
|
||||
};
|
||||
*/
|
||||
|
||||
//Send fences to this array to be synced to db, should prove to be better performaince wise rather then updaing each time they take damage.
|
||||
server_addtoFenceUpdateArray = {
|
||||
private ["_class","_clientKey","_damage","_exitReason","_index","_object","_playerUID"];
|
||||
_object = _this select 0;
|
||||
_damage = _this select 1;
|
||||
_playerUID = _this select 2;
|
||||
_clientKey = _this select 3;
|
||||
_index = dayz_serverPUIDArray find _playerUID;
|
||||
_class = typeOf _object;
|
||||
|
||||
_exitReason = switch true do {
|
||||
//Can't use owner because player may already be dead, can't use distance because player may be far from fence
|
||||
case (_clientKey == dayz_serverKey): {""};
|
||||
case (_index < 0): {
|
||||
format["Server_AddToFenceUpdateArray error: PUID NOT FOUND ON SERVER. PV ARRAY: %1",_this]
|
||||
};
|
||||
case ((dayz_serverClientKeys select _index) select 1 != _clientKey): {
|
||||
format["Server_AddToFenceUpdateArray error: CLIENT AUTH KEY INCORRECT OR UNRECOGNIZED. PV ARRAY: %1",_this]
|
||||
};
|
||||
case !(_class isKindOf "DZ_buildables"): {
|
||||
format["Server_AddToFenceUpdateArray error: setDamage request on non DZ_buildable. PV ARRAY: %1",_this]
|
||||
};
|
||||
default {""};
|
||||
};
|
||||
|
||||
if (_exitReason != "") exitWith {diag_log _exitReason};
|
||||
|
||||
_object setDamage _damage;
|
||||
|
||||
if !(_object in needUpdate_FenceObjects) then {
|
||||
needUpdate_FenceObjects set [count needUpdate_FenceObjects, _object];
|
||||
if (_playerUID != "SERVER") then {
|
||||
diag_log format["DAMAGE: PUID(%1) requested setDamage %2 on fence %3 ID:%4 UID:%5",_playerUID,_damage,_class,(_object getVariable["ObjectID","0"]),(_object getVariable["ObjectUID","0"])];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
vehicle_handleServerKilled = {
|
||||
private ["_unit","_killer"];
|
||||
private "_unit";
|
||||
_unit = _this select 0;
|
||||
_killer = _this select 1;
|
||||
|
||||
[_unit,"killed",false,false,"SERVER",dayz_serverKey] call server_updateObject;
|
||||
_unit removeAllMPEventHandlers "MPKilled";
|
||||
@@ -133,7 +97,7 @@ vehicle_handleServerKilled = {
|
||||
};
|
||||
|
||||
check_publishobject = {
|
||||
private ["_saveObject","_allowed","_allowedObjects","_object","_playername"];
|
||||
private ["_saveObject","_allowed","_object","_playername"];
|
||||
|
||||
_object = _this select 0;
|
||||
_playername = _this select 1;
|
||||
@@ -224,11 +188,11 @@ dayz_recordLogin = {
|
||||
_key = format["CHILD:103:%1:%2:%3:",_this select 0,_this select 1,_this select 2];
|
||||
_key call server_hiveWrite;
|
||||
|
||||
_status = switch (1==1) do {
|
||||
case ((_this select 2) == 0): { "CLIENT LOADED & PLAYING" };
|
||||
case ((_this select 2) == 1): { "LOGIN PUBLISHING, Location " +(_this select 4) };
|
||||
case ((_this select 2) == 2): { "LOGGING IN" };
|
||||
case ((_this select 2) == 3): { "LOGGED OUT, Location " +(_this select 4) };
|
||||
_status = call {
|
||||
if ((_this select 2) == 0) exitwith { "CLIENT LOADED & PLAYING" };
|
||||
if ((_this select 2) == 1) exitwith { "LOGIN PUBLISHING, Location " +(_this select 4) };
|
||||
if ((_this select 2) == 2) exitwith { "LOGGING IN" };
|
||||
if ((_this select 2) == 3) exitwith { "LOGGED OUT, Location " +(_this select 4) };
|
||||
};
|
||||
|
||||
_name = if (typeName (_this select 3) == "ARRAY") then { toString (_this select 3) } else { _this select 3 };
|
||||
@@ -254,8 +218,10 @@ fa_coor2str = {
|
||||
private["_pos","_res","_nearestCity","_town"];
|
||||
|
||||
_pos = +(_this);
|
||||
if (count _pos < 1) then { _pos = [0,0]; }
|
||||
else { if (count _pos < 2) then { _pos = [_pos select 0,0]; };
|
||||
if (count _pos < 1) then {
|
||||
_pos = [0,0];
|
||||
} else {
|
||||
if (count _pos < 2) then { _pos = [_pos select 0,0]; };
|
||||
};
|
||||
_nearestCity = nearestLocations [_pos, ["NameCityCapital","NameCity","NameVillage","NameLocal"],1000];
|
||||
_town = "Wilderness";
|
||||
|
||||
Reference in New Issue
Block a user