mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-15 21:29:59 +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;
|
||||
|
||||
{
|
||||
|
||||
@@ -150,71 +150,19 @@ BuildingList = MarkerPosition nearObjects ["House",DynamicVehicleArea];
|
||||
spawn_vehicles = {
|
||||
private["_vehicle","_isAir","_isShip","_position","_roadlist","_buildinglist","_istoomany","_marker","_veh","_objPosition","_weights","_index","_uid"];
|
||||
|
||||
// TODO: change this part either to DB or mission config.
|
||||
|
||||
// 1 : Motocycles
|
||||
// 2 : Bicycles, ATV's
|
||||
// 3 : Trucks Unarmed
|
||||
// 4 : Trucks
|
||||
// 5 : Cars
|
||||
// 6 : Jeeps
|
||||
// 7 : Bus, Tractor, SUV, Vans
|
||||
// 8 : Helicopters
|
||||
// 9 : Helicopters Unarmed
|
||||
// 10: Military Unarmed
|
||||
// 11: Military
|
||||
// 12: Boat Unarmed
|
||||
// 13: Boat
|
||||
// 14: Heavy Armor Unarmed
|
||||
// 15: Fuel Trucks
|
||||
|
||||
_AllowedVehiclesList = ["M1030_US_DES_EP1","TT650_TK_CIV_EP1","Old_moto_TK_Civ_EP1","TT650_Civ","TT650_Ins",
|
||||
"MMT_Civ","Old_bike_TK_INS_EP1","ATV_US_EP1","BAF_ATV_D","ATV_CZ_EP1",
|
||||
"hilux1_civil_3_open_EP1","hilux1_civil_2_covered","hilux1_civil_1_open","datsun1_civil_3_open","datsun1_civil_2_covered","datsun1_civil_1_open",
|
||||
"Pickup_PK_TK_GUE_EP1","Offroad_DSHKM_TK_GUE_EP1","Offroad_SPG9_TK_GUE_EP1","Pickup_PK_GUE","Pickup_PK_INS",
|
||||
"policecar","Octavia_ACR","Lada1","Lada2","LadaLM","Skoda","SkodaBlue","SkodaGreen","SkodaRed","VWGolf","car_hatchback","car_sedan","Lada1_TK_CIV_EP1","Lada2_TK_CIV_EP1","VolhaLimo_TK_CIV_EP1","Volha_1_TK_CIV_EP1","Volha_2_TK_CIV_EP1",
|
||||
"UAZ_CDF","UAZ_INS","UAZ_RU","UAZ_Unarmed_TK_CIV_EP1","UAZ_Unarmed_TK_EP1","UAZ_Unarmed_UN_EP1",
|
||||
"Ikarus","Ikarus_TK_CIV_EP1","tractor","TowingTractor","SUV_TK_CIV_EP1","S1203_TK_CIV_EP1","S1203_ambulance_EP1",
|
||||
"UH1H_DZ","UH1H_TK_EP1","CH_47F_EP1","Mi17_TK_EP1","Mi17_UN_CDF_EP1","Mi171Sh_CZ_EP1","UH60M_EP1","Mi17_CDF","MH60S","UH1Y",
|
||||
"Mi17_Civilian","MH6J_EP1","UH60M_MEV_EP1","MV22",
|
||||
"LandRover_ACR","LandRover_CZ_EP1","LandRover_TK_CIV_EP1","HMMWV","HMMWV_DES_EP1","HMMWV_M1035_DES_EP1","HMMWV_Ambulance","HMMWV_Ambulance_CZ_DES_EP1","GAZ_Vodnik_MedEvac","Ural_TK_CIV_EP1","Ural_UN_EP1","V3S_Open_TK_CIV_EP1","V3S_Open_TK_EP1","MTVR_DES_EP1","Kamaz",
|
||||
"HMMWV_M998A2_SOV_DES_EP1","HMMWV_M1151_M2_CZ_DES_EP1","LandRover_Special_CZ_EP1","LandRover_MG_TK_EP1","ArmoredSUV_PMC",
|
||||
"Fishing_Boat","PBX","PBX_ACR","Smallboat_1","Smallboat_2","Zodiac",
|
||||
"RHIB","RHIB2Turret",
|
||||
"M113Ambul_UN_EP1","M113Ambul_TK_EP1","BMP2_Ambul_CDF","BMP2_Ambul_INS",
|
||||
"KamazRefuel","MtvrRefuel_DES_EP1","UralRefuel_TK_EP1","V3S_Refuel_TK_GUE_EP1","T810Refuel_Des_ACR","T810Refuel_ACR"];
|
||||
|
||||
|
||||
_AllowedVehiclesChance = [0.55,0.65,0.25,0.35,0.45,
|
||||
0.25,0.75,0.45,0.45,0.45,
|
||||
0.40,0.35,0.35,0.25,0.20,0.25,
|
||||
0.25,0.75,0.45,0.45,0.45,
|
||||
0.2,0.25,0.45,0.45,0.45,0.45,0.45,0.45,0.45,0.35,0.40,0.40,0.40,0.25,0.45,0.45,0.45,
|
||||
0.30,0.30,0.30,0.30,0.30,0.30,
|
||||
0.15,0.15,0.15,0.05,0.05,0.30,0.15,
|
||||
0.05,0.05,0.01,0.025,0.025,0.025,0.025,0.02,0.02,0.02,
|
||||
0.09,0.08,0.07,0.01,
|
||||
0.11,0.11,0.11,0.10,0.10,0.10,0.05,0.05,0.05,0.05,0.10,0.10,0.10,0.10,0.10,
|
||||
0.05,0.05,0.01,0.05,0.01,
|
||||
0.15,0.15,0.15,0.15,0.15,0.15,
|
||||
0.01,0.01,
|
||||
0.001,0.001,0.001,0.001,
|
||||
0.001,0.001,0.001,0.001,0.001,0.001];
|
||||
|
||||
|
||||
if (isDedicated) then {
|
||||
|
||||
waituntil {!isnil "fnc_buildWeightedArray"};
|
||||
|
||||
_weights = [];
|
||||
_weights = [_AllowedVehiclesList,_AllowedVehiclesChance] call fnc_buildWeightedArray;
|
||||
_weights = [AllowedVehiclesList,AllowedVehiclesChance] call fnc_buildWeightedArray;
|
||||
|
||||
waitUntil{!isNil "BIS_fnc_selectRandom"};
|
||||
// get index from fnc_buildWeightedArray
|
||||
_index = _weights call BIS_fnc_selectRandom;
|
||||
|
||||
// select vehicle
|
||||
_vehicle = _AllowedVehiclesList select _index;
|
||||
_vehicle = AllowedVehiclesList select _index;
|
||||
|
||||
// Find Vehicle Type to better control spawns
|
||||
_isAir = _vehicle isKindOf "Air";
|
||||
@@ -287,7 +235,7 @@ spawn_vehicles = {
|
||||
clearWeaponCargoGlobal _veh;
|
||||
clearMagazineCargoGlobal _veh;
|
||||
|
||||
[_veh,[_dir,_objPosition],_vehicle,_uid] call server_publishVeh;
|
||||
[_veh,[_dir,_objPosition],_vehicle,true,"0"] call server_publishVeh;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user