From 8d407973a04bc998739e0aefcd58d133bade5d83 Mon Sep 17 00:00:00 2001 From: vbawol Date: Thu, 28 Apr 2016 15:08:06 -0500 Subject: [PATCH] don't use owner for RE targets http://epochmod.com/forum/topic/41959-be-carefull-with-remoteexec-and-owner/#comment-275436 --- .../compile/epoch_bases/EPOCH_server_maintBUILD.sqf | 2 +- .../compile/epoch_group/EPOCH_server_upgradeGroup.sqf | 2 +- .../compile/epoch_trading/EPOCH_server_makeNPCTrade.sqf | 2 +- .../compile/epoch_trading/EPOCH_server_makeTrade.sqf | 4 ++-- .../compile/epoch_trading/EPOCH_server_takeCrypto.sqf | 2 +- .../compile/epoch_vehicle/EPOCH_server_lockVehicle.sqf | 4 ++-- .../compile/epoch_vehicle/EPOCH_server_repairVehicle.sqf | 2 +- Sources/epoch_server/init/server_securityfunctions.sqf | 2 +- Sources/epoch_server_settings/EpochEvents/EarthQuake.sqf | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_maintBUILD.sqf b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_maintBUILD.sqf index 822052bb..c4192878 100644 --- a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_maintBUILD.sqf +++ b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_maintBUILD.sqf @@ -81,7 +81,7 @@ if (typeOf _object == "PlotPole_EPOCH") then { _playerCryptoLimit params ["_playerCryptoLimitMax","_playerCryptoLimitMin"]; _current_crypto = ((_current_crypto - _counter) min _playerCryptoLimitMax) max _playerCryptoLimitMin; - _current_crypto remoteExec ['EPOCH_effectCrypto',(owner _player)]; + _current_crypto remoteExec ['EPOCH_effectCrypto',_player]; _vars set[_cIndex, _current_crypto]; _player setVariable["VARS", _vars]; diff --git a/Sources/epoch_server/compile/epoch_group/EPOCH_server_upgradeGroup.sqf b/Sources/epoch_server/compile/epoch_group/EPOCH_server_upgradeGroup.sqf index 22ca5f50..d20a7db9 100644 --- a/Sources/epoch_server/compile/epoch_group/EPOCH_server_upgradeGroup.sqf +++ b/Sources/epoch_server/compile/epoch_group/EPOCH_server_upgradeGroup.sqf @@ -40,7 +40,7 @@ if ((_response select 0) == 1 && (_response select 1) isEqualType []) then { _playerCryptoLimit params ["_playerCryptoLimitMax","_playerCryptoLimitMin"]; _current_crypto = ((_current_crypto - _upgradePrice) min _playerCryptoLimitMax) max _playerCryptoLimitMin; // send to player - _current_crypto remoteExec ['EPOCH_effectCrypto',(owner _player)]; + _current_crypto remoteExec ['EPOCH_effectCrypto',_player]; _vars set[_cIndex, _current_crypto]; _player setVariable["VARS", _vars]; diff --git a/Sources/epoch_server/compile/epoch_trading/EPOCH_server_makeNPCTrade.sqf b/Sources/epoch_server/compile/epoch_trading/EPOCH_server_makeNPCTrade.sqf index 21765b07..7350567c 100644 --- a/Sources/epoch_server/compile/epoch_trading/EPOCH_server_makeNPCTrade.sqf +++ b/Sources/epoch_server/compile/epoch_trading/EPOCH_server_makeNPCTrade.sqf @@ -267,7 +267,7 @@ if (_slot != -1) then { _playerCryptoLimit params ["_playerCryptoLimitMax","_playerCryptoLimitMin"]; _current_crypto = ((_current_cryptoRaw + _tradeTotal) min _playerCryptoLimitMax) max _playerCryptoLimitMin; // send to player - _current_crypto remoteExec ['EPOCH_effectCrypto',(owner _player)]; + _current_crypto remoteExec ['EPOCH_effectCrypto',_player]; _vars set[_cIndex, _current_crypto]; _player setVariable["VARS", _vars]; }; diff --git a/Sources/epoch_server/compile/epoch_trading/EPOCH_server_makeTrade.sqf b/Sources/epoch_server/compile/epoch_trading/EPOCH_server_makeTrade.sqf index a44a59b2..beb43e11 100644 --- a/Sources/epoch_server/compile/epoch_trading/EPOCH_server_makeTrade.sqf +++ b/Sources/epoch_server/compile/epoch_trading/EPOCH_server_makeTrade.sqf @@ -44,7 +44,7 @@ if ((_player1 getVariable["currentTradeKey", -1]) isEqualto (_player2 getVariabl _current_crypto1 = ((_current_crypto1 - _tradeCryptoOffer1) min _playerCryptoLimitMax) max _playerCryptoLimitMin; // send to player - _current_crypto1 remoteExec ['EPOCH_effectCrypto',(owner _player1)]; + _current_crypto1 remoteExec ['EPOCH_effectCrypto',_player1]; _player1_vars set[_cIndex, _current_crypto1]; _player1 setVariable["VARS", _player1_vars]; }; @@ -64,7 +64,7 @@ if ((_player1 getVariable["currentTradeKey", -1]) isEqualto (_player2 getVariabl _current_crypto1 = ((_current_crypto1 + _tradeCryptoOffer2) min _playerCryptoLimitMax) max _playerCryptoLimitMin; // send to player - _current_crypto1 remoteExec ['EPOCH_effectCrypto',(owner _player1)]; + _current_crypto1 remoteExec ['EPOCH_effectCrypto',_player1]; _player1_vars set[_cIndex, _current_crypto1]; _player1 setVariable["VARS", _player1_vars]; }; diff --git a/Sources/epoch_server/compile/epoch_trading/EPOCH_server_takeCrypto.sqf b/Sources/epoch_server/compile/epoch_trading/EPOCH_server_takeCrypto.sqf index b0e1caab..031efecb 100644 --- a/Sources/epoch_server/compile/epoch_trading/EPOCH_server_takeCrypto.sqf +++ b/Sources/epoch_server/compile/epoch_trading/EPOCH_server_takeCrypto.sqf @@ -33,7 +33,7 @@ if (_getCrypto > 0) then { _playerCryptoLimit params ["_playerCryptoLimitMax","_playerCryptoLimitMin"]; _current_crypto = ((_current_crypto + _getCrypto) min _playerCryptoLimitMax) max _playerCryptoLimitMin; // send to player - _current_crypto remoteExec ['EPOCH_effectCrypto',(owner _player)]; + _current_crypto remoteExec ['EPOCH_effectCrypto',_player]; _vars set[_cIndex, _current_crypto]; _player setVariable["VARS", _vars]; }; diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_server_lockVehicle.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_server_lockVehicle.sqf index ef9fccce..41359fd8 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_server_lockVehicle.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_server_lockVehicle.sqf @@ -76,10 +76,10 @@ if (_logic) then { } else { if (_value) then { // send to player - [_vehicle, true] remoteExec ['EPOCH_client_lockVehicle',(owner _vehicle)]; + [_vehicle, true] remoteExec ['EPOCH_client_lockVehicle',_vehicle]; } else { // send to player - [_vehicle, false] remoteExec ['EPOCH_client_lockVehicle',(owner _vehicle)]; + [_vehicle, false] remoteExec ['EPOCH_client_lockVehicle',_vehicle]; }; }; }; diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_server_repairVehicle.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_server_repairVehicle.sqf index a23a8caa..a7090d8a 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_server_repairVehicle.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_server_repairVehicle.sqf @@ -23,7 +23,7 @@ if ((_value select 0) isEqualTo "ALL") then { if (local _vehicle) then { _vehicle setHitIndex _value; } else { - [_vehicle, _value] remoteExec ['EPOCH_client_repairVehicle',(owner _vehicle)]; + [_vehicle, _value] remoteExec ['EPOCH_client_repairVehicle',_vehicle]; }; }; _vehicle call EPOCH_server_save_vehicle; diff --git a/Sources/epoch_server/init/server_securityfunctions.sqf b/Sources/epoch_server/init/server_securityfunctions.sqf index ea6ab4a5..35516563 100644 --- a/Sources/epoch_server/init/server_securityfunctions.sqf +++ b/Sources/epoch_server/init/server_securityfunctions.sqf @@ -1041,7 +1041,7 @@ call compile ("'"+_skn_doAdminRequest+"' addPublicVariableEventHandler { _cIndex = EPOCH_customVars find 'Crypto'; _vars = _player getVariable['VARS', call EPOCH_defaultVars_SEPXVar]; _current_crypto = (((_vars select _cIndex) + (_content select 1)) min "+str _skn_playerCryptoLimit+") max 0; - _current_crypto remoteExec ['EPOCH_effectCrypto',(owner _player)]; + _current_crypto remoteExec ['EPOCH_effectCrypto',_player]; _vars set[_cIndex, _current_crypto]; _player setVariable['VARS', _vars]; if (_player == _admin) then { diff --git a/Sources/epoch_server_settings/EpochEvents/EarthQuake.sqf b/Sources/epoch_server_settings/EpochEvents/EarthQuake.sqf index 54df9f4f..eae1ba3e 100644 --- a/Sources/epoch_server_settings/EpochEvents/EarthQuake.sqf +++ b/Sources/epoch_server_settings/EpochEvents/EarthQuake.sqf @@ -17,7 +17,7 @@ if ((count _position) == 2) then{ if ((random 1) > _chance) then { // send earthquake to each player in zone { - [_position] remoteExec ['EPOCH_client_earthQuake',(owner _x)]; + [_position] remoteExec ['EPOCH_client_earthQuake',_x]; }forEach _playersNearEpicenter; // todo configize