- Safe inventory arrays are no longer sent over network to all machines
on server startup and on each lock/unlock
- Disabled user input then closed gear dialog during safe
lock/unlock/pack to block various duping methods.
- Moved safe creation, deletion and gear handling to server. This cuts
down on add[Magazine/Weapon/Backpack]Cargo, createVehicle and
deleteVehicle BE logs.
I forgot numbers greater than 1 million are truncated when converted to
string:
http://killzonekid.com/arma-scripting-tutorials-float-to-string-position-to-string/
KeyStartNumber exceeded 6 digits which is why it was being truncated to
"1e+011" and getting stuck on loop (as that string was already in
currentObjectUIDs) as mentioned in 2df7279.
Starting at 10, there should never be more than a couple duplicates
generated, so keyStartNumber will never exceed about 100 max. Added an
exit just for a fail safe.
A Plot For Life also includes Precise Base Building by Mikeeeyy. Precise
base building has no variable to switch it on or off, I don't think it
should.
Seems to work well enough, this may conflict with the duplicate object
uid fix, it appears to spam my server rpt.
The hive call in server_publishObject is the same between vanilla and
Epoch. The only difference is vanilla uses the _inventory area for
owner, lock code, etc. variables where as modular Epoch items just store
an empty array there.
The object classname does not need to be sent in the PV because it can
be obtained on the server.
PVDZE_veh_Publish was not used.
The protective box is not needed on Chernarus.
If other maps need it we are better off spawning a permanent box around
the debug area once, instead of constantly creating new boxes every time
a player logs in.
MPHit does not always fire when a player is killed:
https://community.bistudio.com/wiki/ArmA_2:_Event_Handlers#MPHit
Using either MPHit or MPKilled is not a good idea here. There is already
a local 'killed' event handler which fires on player death
(player_death.sqf). That script sends a PV (priority message) to the
server which triggers server_playerDied. That means fnc_plyrHit needed
to finish sending its data to the server via public setVariables
(non-priority messages) before server_playerDied executed. Triggering
both these scripts at the same time was a bad idea.
Instead of sending the data to the server via setVariable I just
included it in PVDZ_plr_Death. This also lets us pass extra information
from the damage handler like ammo type, cause of death, etc. Still need
to test, but it should be more reliable and performant than
fnc_playerHit called from MPHit or MPKilled.
Wait for response from server to verify safe was saved and logged before
proceeding with deleting safe object.
Tested and confirmed this solves #1413. Most likely helps with #1503
too.