f3cuk / WICKED-AI

Wicked AI missions for your server
30 stars 59 forks source link

customRemoteMessage wastes resources #116

Closed TeaObvious closed 10 years ago

TeaObvious commented 10 years ago

The current solution for the new remote message has some problems that wasts a lot of resources, because you send a lot of publicVariables, which causes a lot of desyncs etc...

Two solutions: 1. { if((isPlayer _x) && (_x hasWeapon "ItemRadio")) then { customRemoteMessage = ["systemChat","[RADIO] " + _msgstart,_x]; publicVariable "customRemoteMessage"; }; } count playableUnits;

Change this code to use publicVariableClient: _clientID = owner _x; _clientID publicVariableClient "customRemoteMessage";

2. Guess the best solution would be to place the check: if(player hasWeapon "ItemRadio") then {

clientside to this place: if (_player == player) then {

best regards Legodev

f3cuk commented 10 years ago

Hi Legodev,

Didnt know about the publicVariableClient, will use that! Thanks.

Cheers,

f3cuk

TeaObvious commented 10 years ago

Just want to mention, that solution 2 would be the best, since it produces the least amount of messages send throu the network what improves the server performance. :)

f3cuk commented 10 years ago

Ah yes, i didnt quite understand what you meant by option 2, but think i got it. Will implement that one :)