mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-15 13:26:39 +03:00
updates
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
private["_qty","_item","_meat"];
|
||||
private ["_qty","_item","_meat","_loop","_timer"];
|
||||
_item = _this select 0;
|
||||
_qty = _this select 1;
|
||||
_meat = 0;
|
||||
|
||||
@@ -1,11 +1,22 @@
|
||||
/*
|
||||
|
||||
*/
|
||||
private["_hasDel","_serial","_object","_objects","_updates","_myGroup","_nearVeh"];
|
||||
private ["_object","_myGroup","_id","_playerID","_playerName","_characterID","_playerIDtoarray","_timeout"];
|
||||
_playerID = _this select 0;
|
||||
_playerName = _this select 1;
|
||||
_object = call compile format["player%1",_playerID];
|
||||
_characterID = _object getVariable ["characterID","0"];
|
||||
_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];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
private["_characterID","_minutes","_newObject","_playerID","_playerName","_playerID","_myGroup","_group"];
|
||||
private ["_characterID","_minutes","_newObject","_playerID","_key"];
|
||||
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
|
||||
_characterID = _this select 0;
|
||||
_minutes = _this select 1;
|
||||
@@ -16,9 +16,12 @@ diag_log ("DW_DEBUG: _newObject: " + str(_newObject));
|
||||
};
|
||||
*/
|
||||
|
||||
_characterID = parseNumber _characterID;
|
||||
_minutes = parseNumber "_minutes";
|
||||
|
||||
if !(isnil "_characterID") then {
|
||||
|
||||
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;
|
||||
|
||||
@@ -56,6 +56,10 @@ if (isNull _playerObj or !isPlayer _playerObj) exitWith {
|
||||
diag_log ("LOGIN RESULT: Exiting, player object null: " + str(_playerObj));
|
||||
};
|
||||
|
||||
if ((_primary select 0) == "ERROR") exitWith {
|
||||
diag_log format ["LOGIN RESULT: Exiting, failed to load _primary: %1 for player: %2 ",_primary,_playerID];
|
||||
};
|
||||
|
||||
//Process request
|
||||
_newPlayer = _primary select 1;
|
||||
_isNew = count _primary < 6; //_result select 1;
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
private["_int","_characterID","_doLoop","_newModel","_wait","_playerID","_playerObj","_randomSpot","_publishTo","_primary","_secondary","_key","_result","_charID","_playerObj","_playerName","_finished","_spawnPos","_spawnDir","_items","_counter","_magazines","_weapons","_group","_backpack","_worldspace","_direction","_newUnit","_score","_position","_pos","_isIsland","_isNew","_inventory","_backpack","_medical","_survival","_stats","_state","_lastinstance"];
|
||||
//Set Variables
|
||||
private ["_characterID","_doLoop","_playerID","_playerObj","_randomSpot","_primary","_key","_worldspace","_score","_position","_pos","_isIsland","_medical","_stats","_state","_dummy","_debug","_distance","_hit","_fractures","_w","_findSpot","_humanity","_clientID","_lastinstance"];
|
||||
//Wait for HIVE to be free
|
||||
//diag_log ("SETUP: attempted with " + str(_this));
|
||||
|
||||
_characterID = _this select 0;
|
||||
_playerObj = _this select 1;
|
||||
_playerID = _this select 2;
|
||||
_playerID = getPlayerUID _playerObj;
|
||||
|
||||
if (isNull _playerObj) exitWith {
|
||||
diag_log ("SETUP INIT FAILED: Exiting, player object null: " + str(_playerObj));
|
||||
@@ -28,8 +27,7 @@ if ( _playerID != _dummy ) then {
|
||||
|
||||
//Variables
|
||||
_worldspace = [];
|
||||
_survival = [0,0,0];
|
||||
_tent = [];
|
||||
|
||||
_state = [];
|
||||
|
||||
//Do Connection Attempt
|
||||
@@ -65,7 +63,7 @@ _randomSpot = false;
|
||||
//diag_log ("WORLDSPACE: " + str(_worldspace));
|
||||
|
||||
if (count _worldspace > 0) then {
|
||||
_direction = _worldspace select 0;
|
||||
|
||||
_position = _worldspace select 1;
|
||||
if (count _position < 3) then {
|
||||
//prevent debug world!
|
||||
@@ -88,7 +86,6 @@ if (count _worldspace > 0) then {
|
||||
}
|
||||
|
||||
//_playerObj setPosATL _position;
|
||||
//_playerObj setDir _direction;
|
||||
} else {
|
||||
_randomSpot = true;
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
private["_characterID","_currentModelCheck","_temp","_isSync","_currentWpn","_currentMag","_magazines","_force","_qty","_qtyT","_val","_isNewPos","_isNewBackp","_humanity","_isNewGear","_doUpdate","_currentModel","_modelChk","_playerPos","_playerGear","_playerBackp","_backpack","_updates","_killsB","_killsH","_medical","_isNewMed","_character","_timeSince","_charPos","_isInVehicle","_justAte","_justDrank","_distanceFoot","_lastPos","_legs","_arms","_kills","_headShots","_killsCHK","_headShotsCHK","_timeGross","_timeLeft","_onLadder","_isTerminal"];
|
||||
private ["_characterID","_temp","_currentWpn","_magazines","_force","_isNewPos","_humanity","_isNewGear","_currentModel","_modelChk","_playerPos","_playerGear","_playerBackp","_backpack","_killsB","_killsH","_medical","_isNewMed","_character","_timeSince","_charPos","_isInVehicle","_distanceFoot","_lastPos","_kills","_headShots","_timeGross","_timeLeft","_onLadder","_isTerminal","_currentAnim","_muzzles","_array","_key","_lastTime","_config","_currentState","_pos"];
|
||||
//[player,array]
|
||||
//diag_log ("UPDATE: " + str(_this) );
|
||||
|
||||
@@ -19,7 +19,7 @@ _magazines = _this select 1;
|
||||
_force = _this select 2;
|
||||
_force = true;
|
||||
|
||||
_doUpdate = false;
|
||||
|
||||
_characterID = _character getVariable ["characterID","0"];
|
||||
_charPos = getPosATL _character;
|
||||
_isInVehicle = vehicle _character != _character;
|
||||
@@ -45,6 +45,13 @@ if (_characterID == "0") exitWith {
|
||||
diag_log ("ERROR: Cannot Sync Character " + (name _character) + " as no characterID");
|
||||
};
|
||||
|
||||
private["_debug","_distance"];
|
||||
_debug = getMarkerpos "respawn_west";
|
||||
_distance = _debug distance _charPos;
|
||||
if (_distance < 2000) exitWith {
|
||||
diag_log format["ERROR: server_playerSync: Cannot Sync Player %1 [%2]. Position in debug! %3",name _character,_characterID,_charPos];
|
||||
};
|
||||
|
||||
//Check for server initiated updates
|
||||
_isNewMed = _character getVariable["medForceUpdate",false]; //Med Update is forced when a player receives some kind of med incident
|
||||
_isNewPos = _character getVariable["posForceUpdate",false]; //Med Update is forced when a player receives some kind of med incident
|
||||
@@ -92,7 +99,6 @@ if (_characterID != "0") then {
|
||||
};
|
||||
if (_isNewMed or _force) then {
|
||||
//diag_log ("medical..."); sleep 0.05;
|
||||
_wounds = [];
|
||||
if (!(_character getVariable["USEC_isDead",false])) then {
|
||||
//diag_log ("medical check..."); sleep 0.05;
|
||||
_medical = _character call player_sumMedical;
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
private["_type","_location","_dir","_character","_tent","_class","_id","_uid"];
|
||||
private ["_class","_uid","_charID","_object","_worldspace","_key"];
|
||||
//[dayz_characterID,_tent,[_dir,_location],"TentStorage"]
|
||||
_charID = _this select 0;
|
||||
_object = _this select 1;
|
||||
_worldspace = _this select 2;
|
||||
_class = _this select 3;
|
||||
_id = 0;
|
||||
|
||||
|
||||
if (!(_object isKindOf "Building")) exitWith {
|
||||
deleteVehicle _object;
|
||||
};
|
||||
|
||||
//diag_log ("PUBLISH: Attempt " + str(_object));
|
||||
_dir = _worldspace select 0;
|
||||
_location = _worldspace select 1;
|
||||
|
||||
//get UID
|
||||
_uid = _worldspace call dayz_objectUID2;
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
private["_object","_worldspace","_location","_dir","_character","_tent","_class","_id","_uid","_dam","_hitpoints","_selection","_array","_damage","_randFuel","_fuel","_key","_result","_outcome","_totaldam","_parts","_retry","_done"];
|
||||
//[_veh,[_dir,_location],"V3S_Civ"]
|
||||
private["_object","_worldspace","_location","_dir","_character","_tent","_class","_id","_uid","_dam","_hitpoints","_selection","_array","_damage","_randFuel","_fuel","_key","_result","_outcome","_totaldam","_parts","_retry","_done","_spawnDMG"];
|
||||
//[_veh,[_dir,_location],"V3S_Civ",true]
|
||||
_object = _this select 0;
|
||||
_worldspace = _this select 1;
|
||||
_class = _this select 2;
|
||||
_uid = _this select 3;
|
||||
_spawnDMG = _this select 3;
|
||||
_characterID = _this select 4;
|
||||
|
||||
_fuel = 0;
|
||||
_fuel = 1;
|
||||
_damage = 0;
|
||||
_array = [];
|
||||
|
||||
@@ -17,64 +18,65 @@ _location = _worldspace select 1;
|
||||
_uid = _worldspace call dayz_objectUID2;
|
||||
// _uid = format["%1%2",dayZ_instance,_uid];
|
||||
|
||||
if (getNumber(configFile >> "CfgVehicles" >> _class >> "isBicycle") != 1) then {
|
||||
if (_spawnDMG) then {
|
||||
_fuel = 0;
|
||||
if (getNumber(configFile >> "CfgVehicles" >> _class >> "isBicycle") != 1) then {
|
||||
|
||||
// Create randomly damaged parts
|
||||
// Create randomly damaged parts
|
||||
|
||||
_totaldam = 0;
|
||||
_hitpoints = _object call vehicle_getHitpoints;
|
||||
{
|
||||
_dam = 0;
|
||||
if(["Body",_x,false] call fnc_inString) then {
|
||||
_dam = call generate_new_damage;
|
||||
};
|
||||
if(["Engine",_x,false] call fnc_inString) then {
|
||||
_dam = call generate_exp_damage;
|
||||
};
|
||||
if(["HRotor",_x,false] call fnc_inString) then {
|
||||
_dam = call generate_new_damage;
|
||||
};
|
||||
if(["Fuel",_x,false] call fnc_inString) then {
|
||||
_dam = call generate_exp_damage;
|
||||
};
|
||||
if(["Wheel",_x,false] call fnc_inString) then {
|
||||
_dam = call generate_new_damage;
|
||||
};
|
||||
if(["Glass",_x,false] call fnc_inString) then {
|
||||
_dam = call generate_new_damage;
|
||||
};
|
||||
_totaldam = 0;
|
||||
_hitpoints = _object call vehicle_getHitpoints;
|
||||
{
|
||||
_dam = 0;
|
||||
if(["Body",_x,false] call fnc_inString) then {
|
||||
_dam = call generate_new_damage;
|
||||
};
|
||||
if(["Engine",_x,false] call fnc_inString) then {
|
||||
_dam = call generate_exp_damage;
|
||||
};
|
||||
if(["HRotor",_x,false] call fnc_inString) then {
|
||||
_dam = call generate_new_damage;
|
||||
};
|
||||
if(["Fuel",_x,false] call fnc_inString) then {
|
||||
_dam = call generate_exp_damage;
|
||||
};
|
||||
if(["Wheel",_x,false] call fnc_inString) then {
|
||||
_dam = call generate_new_damage;
|
||||
};
|
||||
if(["Glass",_x,false] call fnc_inString) then {
|
||||
_dam = call generate_new_damage;
|
||||
};
|
||||
|
||||
_selection = getText(configFile >> "cfgVehicles" >> _class >> "HitPoints" >> _x >> "name");
|
||||
_selection = getText(configFile >> "cfgVehicles" >> _class >> "HitPoints" >> _x >> "name");
|
||||
|
||||
if (_dam > 0) then {
|
||||
_array set [count _array,[_selection,_dam]];
|
||||
_totaldam = _totaldam + _dam;
|
||||
if (_dam > 0) then {
|
||||
_array set [count _array,[_selection,_dam]];
|
||||
_totaldam = _totaldam + _dam;
|
||||
};
|
||||
} forEach _hitpoints;
|
||||
|
||||
|
||||
// just set low base dmg - may change later
|
||||
_damage = 0;
|
||||
|
||||
// 50% chance that vehicle will have a little gas
|
||||
_randFuel = random(1);
|
||||
if(_randFuel > 0.5) then {
|
||||
_fuel = random(0.5);
|
||||
};
|
||||
} forEach _hitpoints;
|
||||
|
||||
|
||||
// just set low base dmg - may change later
|
||||
_damage = 0;
|
||||
|
||||
// 50% chance that vehicle will have a little gas
|
||||
_randFuel = random(1);
|
||||
if(_randFuel > 0.5) then {
|
||||
_fuel = random(0.5);
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
//Send request
|
||||
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, _damage , 0, _worldspace, [], _array, _fuel,_uid]; // Change this to dynamic parts damage and fuel
|
||||
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, _damage , _characterID, _worldspace, [], _array, _fuel,_uid]; // Change this to dynamic parts damage and fuel
|
||||
diag_log ("HIVE: WRITE: "+ str(_key));
|
||||
_key call server_hiveWrite;
|
||||
|
||||
// Wait just a little
|
||||
sleep 0.1;
|
||||
|
||||
_done = false;
|
||||
_retry = 0;
|
||||
while{not _done} do {
|
||||
// TODO: Needs major overhaul
|
||||
while {_retry < 99} do {
|
||||
|
||||
// GET DB ID
|
||||
_key = format["CHILD:388:%1:",_uid];
|
||||
@@ -86,16 +88,17 @@ while{not _done} do {
|
||||
_object setVariable ["ObjectID", _oid, true];
|
||||
diag_log("CUSTOM: Selected " + str(_oid));
|
||||
_done = true;
|
||||
_retry = 100;
|
||||
|
||||
} else {
|
||||
diag_log("CUSTOM: trying again to get id for: " + str(_uid));
|
||||
_done = false;
|
||||
_retry = _retry + 1;
|
||||
sleep 0.1;
|
||||
};
|
||||
if(_retry == 5) exitWith { deleteVehicle _object; diag_log("CUSTOM: failed to get id for : " + str(_uid)); };
|
||||
};
|
||||
|
||||
if(!_done) exitWith { deleteVehicle _object; diag_log("CUSTOM: failed to get id for : " + str(_uid)); };
|
||||
|
||||
// disable marker later
|
||||
//_marker = createMarker [str(_location) , _location];
|
||||
//_marker setMarkerShape "ICON";
|
||||
@@ -107,7 +110,7 @@ while{not _done} do {
|
||||
// _object setVariable ["ObjectUID", _uid, true];
|
||||
|
||||
_object setVariable ["lastUpdate",time];
|
||||
_object setVariable ["CharacterID", "0", true];
|
||||
_object setVariable ["CharacterID", _characterID, true];
|
||||
|
||||
_object setDamage _damage;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ _myArray = [];
|
||||
if (_status == "ObjectStreamStart") then {
|
||||
_val = _result select 1;
|
||||
//Stream Objects
|
||||
diag_log ("HIVE: Commence Object Streaming...");
|
||||
diag_log ("HIVE: Commence Menu Streaming...");
|
||||
for "_i" from 1 to _val do {
|
||||
_data = "HiveEXT" callExtension _key;
|
||||
_result = call compile format ["%1",_data];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
private["_pos","_objects"];
|
||||
private["_pos"];
|
||||
_pos = _this select 0;
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user