mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-20 02:16:29 +03:00
sync with DayZ 1.7.4 CE
This commit is contained in:
@@ -19,6 +19,13 @@ if (_playerID == "") exitWith {
|
||||
diag_log ("SETUP INIT FAILED: Exiting, no player ID: " + str(_playerObj));
|
||||
};
|
||||
|
||||
private["_dummy"];
|
||||
_dummy = getPlayerUID _playerObj;
|
||||
if ( _playerID != _dummy ) then {
|
||||
diag_log format["DEBUG: _playerID miscompare with UID! _playerID:%1",_playerID];
|
||||
_playerID = _dummy;
|
||||
};
|
||||
|
||||
//Variables
|
||||
_worldspace = [];
|
||||
_survival = [0,0,0];
|
||||
@@ -244,22 +251,6 @@ _playerObj setVariable ["lastTime",time];
|
||||
|
||||
diag_log ("LOGIN PUBLISHING: " + str(_playerObj) + " Type: " + (typeOf _playerObj));
|
||||
|
||||
myObj = objNull;
|
||||
call compile format["myObj = player%1",_playerID];
|
||||
|
||||
if (!(isNull myObj)) then {
|
||||
if (alive myObj) then {
|
||||
deleteVehicle myObj;
|
||||
diag_log ("LOGIN DUPLICATE PLAYER: " + str(_playerObj) + " DELETED ORIGINAL");
|
||||
};
|
||||
};
|
||||
|
||||
//Record player for management
|
||||
myObj = _playerObj;
|
||||
call compile format["player%1 = myObj;",_playerID];
|
||||
//diag_log (format["player%1 = myObj",_playerID]);
|
||||
//dayz_players set [count dayz_players,_playerObj];
|
||||
|
||||
dayzLogin = null;
|
||||
dayzLogin2 = null;
|
||||
|
||||
|
||||
33
dayz_server/compile/server_publishBank.sqf
Normal file
33
dayz_server/compile/server_publishBank.sqf
Normal file
@@ -0,0 +1,33 @@
|
||||
private["_type","_mUID","_deposit","_key","_result","_outcome","_balance","_uid"];
|
||||
//[UID,_deposit,]
|
||||
_mUID = _this select 0;
|
||||
_deposit = _this select 1;
|
||||
_type = _this select 2;
|
||||
_player = _this select 3;
|
||||
|
||||
|
||||
//GET DB ID
|
||||
_key = format["CHILD:111:%1:%2:%3:",_mUID,_deposit,_type];
|
||||
|
||||
diag_log ("HIVE: WRITE: "+ str(_key));
|
||||
|
||||
_result = [_key] call server_hiveReadWrite;
|
||||
|
||||
_outcome = _result select 0;
|
||||
|
||||
if (_outcome == "PASS") then {
|
||||
|
||||
_msg = _result select 1;
|
||||
_balance = _result select 2;
|
||||
|
||||
diag_log("BANK: Action msg:" + str(_msg) + " Balance:" + str(_player));
|
||||
|
||||
_clientID = owner _player;
|
||||
|
||||
dayzBankBalance = _balance;
|
||||
_clientID publicVariableClient "dayzBankBalance";
|
||||
|
||||
diag_log ("PUBLISH BANK: Deposit " + str(_clientID) + " with " + str(_deposit));
|
||||
|
||||
};
|
||||
|
||||
41
dayz_server/compile/server_traders.sqf
Normal file
41
dayz_server/compile/server_traders.sqf
Normal file
@@ -0,0 +1,41 @@
|
||||
private["_type","_location","_clientID","_character","_tent","_traderid","_id","_outcome","_retrader"];
|
||||
//[dayz_characterID,_tent,[_dir,_location],"TentStorage"]
|
||||
_character = _this select 0;
|
||||
_traderid = _this select 1;
|
||||
|
||||
_retrader = [];
|
||||
|
||||
_clientID = owner _character;
|
||||
diag_log ("HIVE: Menu Request by ClientID: "+ str(_clientID));
|
||||
|
||||
_key = format["CHILD:399:%1:",_traderid];
|
||||
_data = "HiveEXT" callExtension _key;
|
||||
|
||||
diag_log "HIVE: Request sent";
|
||||
|
||||
//Process result
|
||||
_result = call compile format ["%1",_data];
|
||||
_status = _result select 0;
|
||||
|
||||
_myArray = [];
|
||||
if (_status == "ObjectStreamStart") then {
|
||||
_val = _result select 1;
|
||||
//Stream Objects
|
||||
diag_log ("HIVE: Commence Object Streaming...");
|
||||
for "_i" from 1 to _val do {
|
||||
_data = "HiveEXT" callExtension _key;
|
||||
_result = call compile format ["%1",_data];
|
||||
_status = _result select 0;
|
||||
if (_status == "TRD") then {
|
||||
_retrader set [count _retrader,_result];
|
||||
};
|
||||
//diag_log ("HIVE: Loop ");
|
||||
};
|
||||
//diag_log ("HIVE: Streamed " + str(_val) + " objects");
|
||||
};
|
||||
|
||||
|
||||
diag_log(_retrader);
|
||||
dayzTraderMenuResult = _retrader;
|
||||
_clientID publicVariableClient "dayzTraderMenuResult";
|
||||
_retrader
|
||||
@@ -12,6 +12,8 @@ server_updatePlayer = compile preprocessFileLineNumbers "\z\addons\dayz_server\
|
||||
server_playerStat = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerStat.sqf";
|
||||
server_publishObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishObject.sqf";
|
||||
server_publishVeh = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishVehicle.sqf"; // Custom to add vehicles
|
||||
server_publishBank = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishBank.sqf";
|
||||
server_traders = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_traders.sqf";
|
||||
local_publishObj = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_publishObj.sqf"; //Creates the object in DB
|
||||
local_deleteObj = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_deleteObj.sqf"; //Creates the object in DB
|
||||
local_createObj = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_createObj.sqf"; //Creates the object in DB
|
||||
|
||||
@@ -49,15 +49,33 @@ diag_log "HIVE: Starting";
|
||||
_idKey = _x select 1;
|
||||
_type = _x select 2;
|
||||
_ownerID = _x select 3;
|
||||
_dir = (_x select 4) select 0;
|
||||
_pos = (_x select 4) select 1;
|
||||
|
||||
_worldspace = _x select 4;
|
||||
_dir = 0;
|
||||
_pos = [0,0,0];
|
||||
_wsDone = false;
|
||||
if (count _worldspace >= 2) then
|
||||
{
|
||||
_dir = _worldspace select 0;
|
||||
if (count (_worldspace select 1) == 3) then {
|
||||
_pos = _worldspace select 1;
|
||||
_wsDone = true;
|
||||
}
|
||||
};
|
||||
if (!_wsDone) then {
|
||||
if (count _worldspace >= 1) then { _dir = _worldspace select 0; };
|
||||
_pos = [getMarkerPos "center",0,4000,10,0,2000,0] call BIS_fnc_findSafePos;
|
||||
if (count _pos < 3) then { _pos = [_pos select 0,_pos select 1,0]; };
|
||||
diag_log ("MOVED OBJ: " + str(_idKey) + " of class " + _type + " to pos: " + str(_pos));
|
||||
};
|
||||
|
||||
_intentory= _x select 5;
|
||||
_hitPoints= _x select 6;
|
||||
_fuel = _x select 7;
|
||||
_damage = _x select 8;
|
||||
|
||||
if (_damage < 1) then {
|
||||
diag_log ("OBJ: " + str(_idKey) + _type);
|
||||
diag_log format["OBJ: %1 - %2", _idKey,_type];
|
||||
|
||||
//Create it
|
||||
_object = createVehicle [_type, _pos, [], 0, "CAN_COLLIDE"];
|
||||
@@ -135,7 +153,7 @@ diag_log "HIVE: Starting";
|
||||
_position = ([(getPosATL _object),0,100,10,0,500,0] call BIS_fnc_findSafePos);
|
||||
_object setPosATL _position;
|
||||
};
|
||||
_id = _object spawn fnc_vehicleEventHandler;
|
||||
_object call fnc_vehicleEventHandler;
|
||||
_totalvehicles = _totalvehicles + 1;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user