another sync with trader fixes

This commit is contained in:
A Clark
2012-11-22 09:37:02 -06:00
parent da5766e46b
commit 638ceee5c6
152 changed files with 786 additions and 1579 deletions

View File

@@ -11,24 +11,28 @@ _timeout = _object getVariable["combattimeout",0];
_playerIDtoarray = [];
_playerIDtoarray = toArray _playerID;
if (59 in _playerIDtoarray) exitWith {};
if ((_timeout - time) > 0) then {
diag_log("DEBUG: COMBAT LOG TIMER: " + str(_timeout));
_playerName call player_combatLogged;
};
if (vehicle _object != _object) then {
_object action ["eject", vehicle _object];
};
if (59 in _playerIDtoarray) exitWith { diag_log ("Exited"); };
if ((_timeout - time) > 0) then {
//_playerName call player_combatLogged;
private["_playerName","_center","_group"];
_playerName = name player;
_timeout = _object getVariable["combattimeout",0];
diag_log format["COMBAT LOGGED: %1 (%2)", _playerName,_timeout];
};
diag_log format["DISCONNECT: %1 (%2) Object: %3, _characterID: %4", _playerName,_playerID,_object,_characterID];
dayz_disco = dayz_disco - [_playerID];
if (!isNull _object) then {
//Update Vehicle
{ [_x,"gear"] call server_updateObject } foreach
(nearestObjects [getPosATL _object, ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage"], 10]);
(nearestObjects [getPosATL _object, ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage", "VaultStorage"], 10]);
if (alive _object) then {
[_object,[],true] call server_playerSync;
_id = [_playerID,_characterID,2] spawn dayz_recordLogin;

View File

@@ -16,20 +16,19 @@ diag_log ("DW_DEBUG: _newObject: " + str(_newObject));
};
*/
_characterID = parseNumber _characterID;
_minutes = parseNumber "_minutes";
if !(isnil "_characterID") then {
if (typeName _minutes == "STRING") then
{
_minutes = parseNumber _minutes;
};
if (_characterID != 0) then {
if (_characterID != "0") then
{
_key = format["CHILD:202:%1:%2:",_characterID,_minutes];
//diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
} else {
deleteVehicle _newObject;
};
} else {
}
else
{
deleteVehicle _newObject;
};

View File

@@ -12,7 +12,7 @@ if (count _this > 2) then {
dayz_players = dayz_players - [_this select 2];
};
waitUntil{allowConnection};
//waitUntil{allowConnection};
//Variables
_inventory = [];

View File

@@ -202,7 +202,7 @@ if (_characterID != "0") then {
_pos = _this select 0;
{
[_x, "gear"] call server_updateObject;
} forEach nearestObjects [_pos, ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage"], 10];
} forEach nearestObjects [_pos, ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage", "VaultStorage"], 10];
//[_charPos] call server_updateNearbyObjects;
//Reset timer

View File

@@ -3,4 +3,4 @@ _pos = _this select 0;
{
[_x, "gear"] call server_updateObject;
} forEach nearestObjects [_pos, ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage"], 10];
} forEach nearestObjects [_pos, ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage", "VaultStorage"], 10];

View File

@@ -1,14 +1,37 @@
/*
[_object,_type] spawn server_updateObject;
*/
private["_object","_type","_objectID","_uid","_lastUpdate","_needUpdate"];
private ["_object","_type","_objectID","_uid","_lastUpdate","_needUpdate","_object_position","_object_inventory","_object_damage","_isNotOk"];
_object = _this select 0;
_type = _this select 1;
_parachuteWest = typeOf _object == "ParachuteWest";
_isNotOk = false;
_objectID = _object getVariable ["ObjectID","0"];
_uid = _object getVariable ["ObjectUID","0"];
if (_objectID == "0" && _uid == "0") then { _uid = _object call dayz_objectUID; }; //seems never been call
if ((typeName _objectID != "string") || (typeName _uid != "string")) then
{
diag_log(format["Non-string Object: ID %1 UID %2", _objectID, _uid]);
//force fail
_objectID = "0";
_uid = "0";
};
if (!_parachuteWest) then {
if (_objectID == "0" && _uid == "0") then
{
_object_position = getPosATL _object;
diag_log(format["Deleting object %1 with invalid ID at pos [%2,%3,%4]",
typeOf _object,
_object_position select 0,
_object_position select 1,
_object_position select 2]);
_isNotOk = true;
};
};
if (_isNotOk) exitWith { deleteVehicle _object; };
_lastUpdate = _object getVariable ["lastUpdate",time];
_needUpdate = _object in needUpdate_objects;

View File

@@ -1,46 +1,5 @@
private["_unit","_potential","_newOwner","_client"];
private["_unit"];
_unit = _this select 0;
diag_log ("CLEANUP: DELETE UNCONTROLLED ZOMBIE: " + (typeOf _unit) + " OF: " + str(_unit) );
deleteVehicle _unit;
/*
//Not server then exit
if(!isServer) exitWith {
diag_log ("DW_DEBUG: #findOwner exits as not server: " + str(isServer));
};
//Not local then exit
if(!local _unit) exitWith {
diag_log ("DW_DEBUG: #findOwner exits _unit not local: " + str(local _unit));
};
//Find a new owner
_potential = (getposATL _unit) nearEntities [["CAManBase"],300];
_newOwner = objNull;
{
if (isPlayer _x) then {
_newOwner = _x;
};
if (!isNull _newOwner) exitWith {
//diag_log ("DW_DEBUG: #findOwner potencial _newOwner: " + str(_newOwner));
};
} forEach _potential;
//If no nearby player, delete the agent
//diag_log ("DW_DEBUG: #findOwner isNull _newOwner: " + str(isNull _newOwner));
if(isNull _newOwner) exitWith {
diag_log ("CLEANUP: NOTHING TO TRANSFER OWNERSHIP OF TYPE: " + (typeOf _unit) + " OF: " + str(_unit) );
deleteVehicle _unit;
};
//set client as controller
_client = owner _newOwner;
_unit setOwner _client;
diag_log ("CLEANUP: TRANSFERRED OWNERSHIP OF TYPE: " + (typeOf _unit) + " OF _unit: " + str(_unit) + " TO _client: " + str(_client) );
*/
deleteVehicle _unit;