Closed Dystopian closed 4 weeks ago
On unit InitPost event unit is (can be?) local for both server and client. In the next frame unit became local only for client in my tests.
I have a hard time believing that - not because it's impossible, but because a lot of code within ACE wouldn't be executing as expected. We definitely need to investigate that further.
I have a hard time believing that - not because it's impossible, but because a lot of code within ACE wouldn't be executing as expected. We definitely need to investigate that further.
I can believe it, CSW used to duplicate mags because of similar behavior.
I have a hard time believing that - not because it's impossible, but because a lot of code within ACE wouldn't be executing as expected. We definitely need to investigate that further.
I can believe it, CSW used to duplicate mags because of similar behavior.
True. I just want to be sure, so we can implement mitigations properly (e.g. in CSW you added 1 second delay, whereas here it's only a frame later - is one frame enough? Is there a standard delay that we'd want to implement?).
The fix looks bad I know. Any suggestions are welcomed.
Wrap the original code in a CBA_fnc_execNextFrame
- should do the trick, no?
I tried to replicate the issue, but I just don't have the setup to do so. Can anyone else please try to replicate?
Wrap the original code in a
CBA_fnc_execNextFrame
You mean just do setUnitTrait
in the next frame instead of current one? I can try testing this for some days but for now let it run twice just in case.
The fix doesn't work. I found reliable repro steps for me:
Mehland
map (it is not cached in ACE Refuel positions)Mission will start for some seconds. Player is not local neither in current frame nor in the next frame for InitPost
.
Now it works. Local
EH is enough.
For me in the worst case delay for locality pass is about 12 seconds. Just need to make server doing something long at postInit
.
So it looks like JIP but it's not JIP. And now we know that player is not always local to client machine.
When merged this pull request will:
I met this bug only once in multiplayer when made Repair
enable
setting. Since then I played hundred of times as engineer withDEBUG_MODE_FULL
but bug disappeared. And when I tested 3.18.0 RC1 I met it again.getUnitTrait "engineer"
can returnnil
(e.g. forace_dragging_clone
) so I added nil check.InitPost
event unit is (can be?) local for both server and client. In the next frame unit became local only for client in my tests. I used this code:client:
server:
The fix looks bad I know. Any suggestions are welcomed.