mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-15 21:29:59 +03:00
0.69 + 1.7.5.M1D15
This commit is contained in:
@@ -284,8 +284,18 @@ if (!isDedicated) then {
|
||||
dayz_spaceInterrupt = {
|
||||
private ["_dikCode", "_handled"];
|
||||
_dikCode = _this select 1;
|
||||
_altState = _this select 4;
|
||||
_handled = false;
|
||||
if (_dikCode in (actionKeys "GetOver")) then {
|
||||
if (animationState player in ["amovpercmrunslowwrfldf","amovpercmrunsraswrfldf","amovpercmevaslowwrfldf","amovpercmevasraswrfldf"]) then {
|
||||
null = [] spawn {
|
||||
//Needed for sync with others
|
||||
[nil, player, rSWITCHMOVE,"ActsPercMrunSlowWrflDf_FlipFlopPara"] call RE;
|
||||
sleep 0.3;
|
||||
player setVelocity [(velocity player select 0) + 1.5 * sin direction player, (velocity player select 1) + 1.5 * cos direction player, (velocity player select 2) + 4];
|
||||
};
|
||||
_handled = true;
|
||||
};
|
||||
};
|
||||
//if (_dikCode == 57) then {_handled = true}; // space
|
||||
//if (_dikCode in actionKeys 'MoveForward' or _dikCode in actionKeys 'MoveBack') then {r_interrupt = true};
|
||||
if (_dikCode in actionKeys "MoveLeft") then {r_interrupt = true};
|
||||
@@ -384,6 +394,18 @@ if (!isDedicated) then {
|
||||
_vdir
|
||||
};
|
||||
|
||||
fnc_onKeyDown =
|
||||
{
|
||||
private["_key"];
|
||||
_key = _this select 1;
|
||||
if (_key == 70) then //SCROLL LOCK
|
||||
{
|
||||
_nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
|
||||
_shift = nil;
|
||||
};
|
||||
_return
|
||||
};
|
||||
|
||||
dayz_lowHumanity = {
|
||||
private["_unit","_humanity","_delay"];
|
||||
_unit = _this;
|
||||
@@ -417,21 +439,10 @@ if (!isDedicated) then {
|
||||
dayz_originalPlayer = player;
|
||||
};
|
||||
|
||||
BIS_fnc_selectRandom = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selectRandom.sqf"; //Checks which actions for nearby casualty
|
||||
|
||||
//Server Only
|
||||
if (isServer) then {
|
||||
call compile preprocessFileLineNumbers "\z\addons\dayz_server\init\server_functions.sqf";
|
||||
} else {
|
||||
eh_localCleanup = {};
|
||||
};
|
||||
|
||||
progressLoadingScreen 0.8;
|
||||
|
||||
//Both
|
||||
//Start Dynamic Weather
|
||||
execVM "\z\addons\dayz_code\external\DynamicWeatherEffects.sqf";
|
||||
|
||||
BIS_fnc_selectRandom = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selectRandom.sqf"; //Checks which actions for nearby casualty
|
||||
fnc_buildWeightedArray = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_buildWeightedArray.sqf"; //Checks which actions for nearby casualty
|
||||
fnc_usec_damageVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerVehicle.sqf"; //Event handler run on damage
|
||||
zombie_initialize = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\zombie_init.sqf";
|
||||
@@ -452,10 +463,8 @@ if (isServer) then {
|
||||
fnc_isInsideBuilding = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding;
|
||||
dayz_zombieSpeak = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_speak.sqf"; //Used to generate random speech for a unit
|
||||
vehicle_getHitpoints = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_getHitpoints.sqf";
|
||||
local_gutObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObject.sqf"; //Generated on the server (or local to unit) when gutting an object
|
||||
local_gutObjectZ = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObjectZ.sqf"; //Generated on the server (or local to unit) when gutting an object
|
||||
local_zombieDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerZ.sqf"; //Generated by the client who created a zombie to track damage
|
||||
local_sefFuel = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_setFuel.sqf"; //Generated when someone refuels a vehicle
|
||||
local_setFuel = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_setFuel.sqf"; //Generated when someone refuels a vehicle
|
||||
local_eventKill = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_eventKill.sqf"; //Generated when something is killed
|
||||
//player_weaponCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_weaponCheck.sqf"; //Run by the player or server to monitor whether they have picked up a new weapon
|
||||
curTimeStr = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_curTimeStr.sqf";
|
||||
@@ -500,4 +509,15 @@ if (isServer) then {
|
||||
_medical
|
||||
};
|
||||
|
||||
|
||||
//Server Only
|
||||
if (isServer) then {
|
||||
call compile preprocessFileLineNumbers "\z\addons\dayz_server\init\server_functions.sqf";
|
||||
} else {
|
||||
eh_localCleanup = {};
|
||||
};
|
||||
|
||||
|
||||
//Start Dynamic Weather
|
||||
execVM "\z\addons\dayz_code\external\DynamicWeatherEffects.sqf";
|
||||
initialized = true;
|
||||
@@ -1,46 +1,82 @@
|
||||
"dayzSetFuel" addPublicVariableEventHandler {(_this select 1) call local_sefFuel};
|
||||
rpcCodeVarName = { format["%1_code",_this] };
|
||||
rpcDirectCall = { call compile format["[%1,%2] call %3;",str(_this),_this,_this call rpcCodeVarName]; };
|
||||
|
||||
if (isServer) then {
|
||||
"dayzDeath" addPublicVariableEventHandler {(_this select 1) call server_playerDied};
|
||||
"dayzDiscoAdd" addPublicVariableEventHandler {dayz_disco set [count dayz_disco,(_this select 1)];};
|
||||
"dayzDiscoRem" addPublicVariableEventHandler {dayz_disco = dayz_disco - [(_this select 1)];};
|
||||
"dayzPlayerSave" addPublicVariableEventHandler {(_this select 1) call server_playerSync;};
|
||||
"dayzPublishObj" addPublicVariableEventHandler {(_this select 1) call server_publishObj};
|
||||
"dayzUpdateVehicle" addPublicVariableEventHandler {(_this select 1) call server_updateObject};
|
||||
"dayzDeleteObj" addPublicVariableEventHandler {(_this select 1) call local_deleteObj};
|
||||
"dayzPublishVeh" addPublicVariableEventHandler {(_this select 1) call server_publishVeh}; // for vehicle traders
|
||||
"dayzTradeObject" addPublicVariableEventHandler {(_this select 1) call server_tradeObj}; // for vehicle traders
|
||||
"dayzTraderMenu" addPublicVariableEventHandler {(_this select 1) call server_traders}; // for all traders
|
||||
"dayzLogin" addPublicVariableEventHandler {(_this select 1) call server_playerLogin};
|
||||
"dayzLogin2" addPublicVariableEventHandler {(_this select 1) call server_playerSetup};
|
||||
"dayzPlayerMorph" addPublicVariableEventHandler {(_this select 1) call server_playerMorph};
|
||||
"dayzLoginRecord" addPublicVariableEventHandler {(_this select 1) call dayz_recordLogin};
|
||||
"dayzCharDisco" addPublicVariableEventHandler {(_this select 1) call server_characterSync};
|
||||
"dayzSetFix" addPublicVariableEventHandler {(_this select 1) call object_setFixServer};
|
||||
"dayzGutBody" addPublicVariableEventHandler {(_this select 1) spawn local_gutObject};
|
||||
|
||||
"usecMorphine" addPublicVariableEventHandler {
|
||||
(_this select 1) select 0 setVariable["hit_legs",0];
|
||||
(_this select 1) select 0 setVariable["hit_hands",0];
|
||||
};
|
||||
//run on all clients
|
||||
broadcastRpcCallAll = {
|
||||
private["_name","_val"];
|
||||
_name = _this select 0;
|
||||
_val = _this select 1;
|
||||
call compile format["%1 = _val;",_name]; //set the value locally
|
||||
_name call rpcDirectCall; //call on this client
|
||||
publicVariable _name; //call on other clients
|
||||
};
|
||||
|
||||
if (!isDedicated) then {
|
||||
"norrnRaLW" addPublicVariableEventHandler {[_this select 1] execVM "\z\addons\dayz_code\medical\publicEH\load_wounded.sqf"};
|
||||
"norrnRLact" addPublicVariableEventHandler {[_this select 1] execVM "\z\addons\dayz_code\medical\load\load_wounded.sqf"};
|
||||
"usecMorphine" addPublicVariableEventHandler {(_this select 1) call player_medMorphine};
|
||||
"usecBleed" addPublicVariableEventHandler {_id = (_this select 1) spawn fnc_usec_damageBleed};
|
||||
"usecBandage" addPublicVariableEventHandler {(_this select 1) call player_medBandage};
|
||||
"usecEpi" addPublicVariableEventHandler {(_this select 1) call player_medEpi};
|
||||
"usecTransfuse" addPublicVariableEventHandler {(_this select 1) call player_medTransfuse};
|
||||
"usecPainK" addPublicVariableEventHandler {(_this select 1) call player_medPainkiller};
|
||||
"dayzHideBody" addPublicVariableEventHandler {hideBody (_this select 1)};
|
||||
"dayzHumanity" addPublicVariableEventHandler {(_this select 1) spawn player_humanityChange};
|
||||
"dayzHitV" addPublicVariableEventHandler {(_this select 1) call fnc_usec_damageVehicle};
|
||||
//run on client which has the object ownership
|
||||
broadcastRpcCallIfLocal = {
|
||||
private["_name","_val","_reqObj"];
|
||||
_name = _this select 0;
|
||||
_val = _this select 1;
|
||||
_reqObj = _this select 2;
|
||||
|
||||
"dayzSetDate" addPublicVariableEventHandler {setDate (_this select 1)};
|
||||
"dayzFlies" addPublicVariableEventHandler {(_this select 1) call spawn_flies};
|
||||
"dayzRoadFlare" addPublicVariableEventHandler {(_this select 1) spawn object_roadFlare};
|
||||
"norrnRaDrag" addPublicVariableEventHandler {[_this select 1] execVM "\z\addons\dayz_code\medical\publicEH\animDrag.sqf"};
|
||||
"dayzFire" addPublicVariableEventHandler {nul=(_this select 1) spawn BIS_Effects_Burn};
|
||||
call compile format["%1 = _val;",_name]; //set the value locally
|
||||
if (local _reqObj) then {
|
||||
_name call rpcDirectCall; //call on this client
|
||||
} else {
|
||||
publicVariable _name; //call on other clients
|
||||
}
|
||||
};
|
||||
|
||||
//only run on server
|
||||
callRpcProcedure = {
|
||||
private["_name","_val"];
|
||||
_name = _this select 0;
|
||||
_val = _this select 1;
|
||||
call compile format["%1 = _val;",_name]; //set the value locally
|
||||
if (isServer) then {
|
||||
_name call rpcDirectCall; //call here since we are the server
|
||||
} else {
|
||||
publicVariableServer _name; //call on the sever
|
||||
};
|
||||
};
|
||||
|
||||
//register client->client rpc
|
||||
registerBroadcastRpc = {
|
||||
private["_name","_code"];
|
||||
_name = _this select 0;
|
||||
_code = _this select 1;
|
||||
|
||||
call compile format["%1 = _code;",_name call rpcCodeVarName]; //set the global var containing the EH code
|
||||
_name addPublicVariableEventHandler _code;
|
||||
};
|
||||
|
||||
//both
|
||||
["dayzSetFuel", { (_this select 1) call local_setFuel; } ] call registerBroadcastRpc;
|
||||
["dayzSetFix", { (_this select 1) call object_setFixServer; } ] call registerBroadcastRpc;
|
||||
["dayzSetDate", { setDate (_this select 1); } ] call registerBroadcastRpc;
|
||||
//EHs that setVariable "medForceUpdate" need to run on the server too
|
||||
["usecMorphine", { (_this select 1) call player_medMorphine; } ] call registerBroadcastRpc;
|
||||
["usecBandage", { (_this select 1) call player_medBandage; } ] call registerBroadcastRpc;
|
||||
["usecEpi", { (_this select 1) call player_medEpi; } ] call registerBroadcastRpc;
|
||||
["usecTransfuse", { (_this select 1) call player_medTransfuse; } ] call registerBroadcastRpc;
|
||||
["usecPainK", { (_this select 1) call player_medPainkiller; } ] call registerBroadcastRpc;
|
||||
//BIS_Effects_Burn is empty on the server anyway, but this EH is called
|
||||
["dayzFire", { (_this select 1) spawn BIS_Effects_Burn; } ] call registerBroadcastRpc;
|
||||
|
||||
//server only
|
||||
if (isServer) then {
|
||||
call compile preprocessFileLineNumbers "\z\addons\dayz_server\init\publicEH_server.sqf";
|
||||
};
|
||||
|
||||
//clients only
|
||||
if (!isDedicated) then {
|
||||
["norrnRaLW", { [_this select 1] execVM "\z\addons\dayz_code\medical\publicEH\load_wounded.sqf"; }] call registerBroadcastRpc;
|
||||
["norrnRLact", { [_this select 1] execVM "\z\addons\dayz_code\medical\load\load_wounded.sqf"; } ] call registerBroadcastRpc;
|
||||
["usecBleed", { (_this select 1) spawn fnc_usec_damageBleed; } ] call registerBroadcastRpc;
|
||||
["dayzHideBody", { hideBody (_this select 1); } ] call registerBroadcastRpc;
|
||||
["dayzHumanity", { (_this select 1) spawn player_humanityChange; } ] call registerBroadcastRpc;
|
||||
["dayzHitV", { (_this select 1) call fnc_usec_damageVehicle; } ] call registerBroadcastRpc;
|
||||
|
||||
["dayzFlies", { (_this select 1) call spawn_flies; } ] call registerBroadcastRpc;
|
||||
["dayzRoadFlare", { (_this select 1) spawn object_roadFlare; } ] call registerBroadcastRpc;
|
||||
["norrnRaDrag", { [_this select 1] execVM "\z\addons\dayz_code\medical\publicEH\animDrag.sqf"; } ] call registerBroadcastRpc;
|
||||
};
|
||||
@@ -51,9 +51,6 @@ SleepWater = 1440; //minutes (24 hours)
|
||||
SleepTemperatur = 90 / 100; //Firs Value = Minutes untill Player reaches the coldest Point at night (without other effects! night factor expected to be -1) //TeeChange
|
||||
|
||||
//Server Variables
|
||||
dayZ_hivePipe1 = "\\.\pipe\dayz"; //The named pipe
|
||||
dayZ_hivePipeAuth = "\\.\pipe\dayzAuth"; //The named pipe
|
||||
hiveInUse = false;
|
||||
allowConnection = false;
|
||||
isSinglePlayer = false;
|
||||
dayz_serverObjectMonitor = [];
|
||||
@@ -93,6 +90,7 @@ dayz_resetSelfActions = {
|
||||
s_player_deleteBuild = -1;
|
||||
s_player_forceSave = -1;
|
||||
s_player_flipveh = -1;
|
||||
s_player_stats = -1;
|
||||
s_player_sleep = -1;
|
||||
s_player_movedog = -1;
|
||||
s_player_speeddog = -1;
|
||||
|
||||
Reference in New Issue
Block a user