mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
updates
local antagonists killed by non-local entity needed to be handled. Local and Non-Local stat changes are now sent to server first then back to the appropriate client after pToken check is verified.
This commit is contained in:
parent
a2a3b7e3bd
commit
c19847b156
@ -57,7 +57,9 @@ switch _unitClass do {
|
||||
_units pushBack _unit;
|
||||
_unit call _disableAI;
|
||||
[_unit,_trgt] execFSM "\x\addons\a3_epoch_code\System\cloak.fsm";
|
||||
_unit addEventHandler ["Killed", {["AntagonistKills",1,true] call EPOCH_client_updatePlayerStat;}];
|
||||
_unit addEventHandler ["Killed", {
|
||||
[player, _this select 1, "AntagonistKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2];
|
||||
}];
|
||||
};
|
||||
};
|
||||
case "GreatWhite_F": {
|
||||
@ -68,7 +70,9 @@ switch _unitClass do {
|
||||
_units pushBack _unit;
|
||||
_unit call _disableAI;
|
||||
[_unit] execFSM "\x\addons\a3_epoch_code\System\Shark_Brain.fsm";
|
||||
_unit addEventHandler ["Killed", {["AntagonistKills",1,true] call EPOCH_client_updatePlayerStat;}];
|
||||
_unit addEventHandler ["Killed", {
|
||||
[player, _this select 1, "AntagonistKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2];
|
||||
}];
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -92,7 +96,9 @@ switch _unitClass do {
|
||||
_unit setVariable ["sapperHndl",_sapperHndl];
|
||||
_unit addEventHandler ["FiredNear", format ["%1 setFSMVariable [""_sFiredNear"",[_this select 1, _this select 2]];",_sapperHndl]];
|
||||
_unit addEventHandler ["Hit", format ["%1 setFSMVariable [""_sHit"",[_this select 1, _this select 2]];",_sapperHndl]];
|
||||
_unit addEventHandler ["Killed", {["AntagonistKills",1,true] call EPOCH_client_updatePlayerStat;}];
|
||||
_unit addEventHandler ["Killed", {
|
||||
[player, _this select 1, "AntagonistKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2];
|
||||
}];
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -107,7 +113,9 @@ switch _unitClass do {
|
||||
_unit setVariable ["sapperHndl",_sapperHndl];
|
||||
_unit addEventHandler ["FiredNear", format ["%1 setFSMVariable [""_sFiredNear"",[_this select 1, _this select 2]];",_sapperHndl]];
|
||||
_unit addEventHandler ["Hit", format ["%1 setFSMVariable [""_sHit"",[_this select 1, _this select 2]];",_sapperHndl]];
|
||||
_unit addEventHandler ["Killed", {["AntagonistKills",1,true] call EPOCH_client_updatePlayerStat;}];
|
||||
_unit addEventHandler ["Killed", {
|
||||
[player, _this select 1, "AntagonistKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2];
|
||||
}];
|
||||
};
|
||||
};
|
||||
case "Epoch_SapperB_F": {
|
||||
@ -121,7 +129,9 @@ switch _unitClass do {
|
||||
_unit setVariable ["sapperHndl",_sapperHndl];
|
||||
_unit addEventHandler ["FiredNear", format ["%1 setFSMVariable [""_sFiredNear"",[_this select 1, _this select 2]];",_sapperHndl]];
|
||||
_unit addEventHandler ["Hit", format ["%1 setFSMVariable [""_sHit"",[_this select 1, _this select 2]];",_sapperHndl]];
|
||||
_unit addEventHandler ["Killed", {["AntagonistKills",1,true] call EPOCH_client_updatePlayerStat;}];
|
||||
_unit addEventHandler ["Killed", {
|
||||
[player, _this select 1, "AntagonistKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2];
|
||||
}];
|
||||
};
|
||||
};
|
||||
case "I_UAV_01_F": {
|
||||
@ -137,7 +147,9 @@ switch _unitClass do {
|
||||
_driver = _grp createUnit["I_UAV_AI", position _unit, [], 0, "CAN_COLLIDE"];
|
||||
_driver moveInAny _unit;
|
||||
[_unit, _trgt] execFSM "\x\addons\a3_epoch_code\System\Copter_brain.fsm";
|
||||
_unit addEventHandler ["Killed", {["AIKills",1,true] call EPOCH_client_updatePlayerStat;}];
|
||||
_unit addEventHandler ["Killed", {
|
||||
[player, _this select 1, "AIKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2];
|
||||
}];
|
||||
};
|
||||
};
|
||||
case "PHANTOM": {
|
||||
@ -186,7 +198,9 @@ switch _unitClass do {
|
||||
_unit enableAI "MOVE";
|
||||
_unit enableAI "ANIM";
|
||||
_unit disableAI "FSM";
|
||||
_unit addEventHandler ["Killed", {["AIKills",1,true] call EPOCH_client_updatePlayerStat;}];
|
||||
_unit addEventHandler ["Killed", {
|
||||
[player, _this select 1, "AIKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2];
|
||||
}];
|
||||
// randomize skill
|
||||
for "_i" from 0 to ((count _arrSkills)-1) do {
|
||||
_aiskill = floor random (_arrVals select _i);
|
||||
|
@ -47,6 +47,8 @@ removegoggles _unit;
|
||||
_zedHandle = [_unit,true] execFSM "epoch_code\system\EPOCH_zombie_brain.fsm";
|
||||
_unit addEventHandler ["FiredNear", "(_this select 0) setVariable [""zFiredNear"",[_this select 1, _this select 2]];"];
|
||||
_unit addEventHandler ["Hit", "(_this select 0) setVariable [""zHit"",[_this select 1, _this select 2]];"];
|
||||
_unit addEventHandler ["Killed", {["ZombieKills",1,true] call EPOCH_client_updatePlayerStat;}];
|
||||
_unit addEventHandler ["Killed", {
|
||||
[player, _this select 1, "ZombieKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2];
|
||||
}];
|
||||
|
||||
_unit
|
||||
|
@ -12,7 +12,15 @@
|
||||
Github:
|
||||
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_player/EPOCH_fnc_updatePlayerStats.sqf
|
||||
*/
|
||||
params ["_player","","","",["_token","",[""]]];
|
||||
if([_player,_token] call EPOCH_server_getPToken)then{
|
||||
_this call EPOCH_server_updatePlayerStats;
|
||||
params ["_player","_killer","_statType","_adjust","_toClient",["_token","",[""]]];
|
||||
|
||||
if(isNull _player)exitWith{
|
||||
diag_log "EPOCHDebug: fnc_updatePlayerStats -1a- player is Null";
|
||||
};
|
||||
if(isNull _killer)exitWith{
|
||||
diag_log "EPOCHDebug: fnc_updatePlayerStats -1b- non local killer is Null";
|
||||
};
|
||||
|
||||
if([_player,_token] call EPOCH_server_getPToken)then{
|
||||
[_killer, _statType, _adjust, _toClient] call EPOCH_server_updatePlayerStats;
|
||||
};
|
Loading…
Reference in New Issue
Block a user