Multiplayer debugging: Recommendations? (+ taking over ownership of scene variable and possible problems)

How do I…

I am not able to reproduce localy bugs, that appears on gd.games: usualy one player after some time of playing get stucked / looses sync with other.

So I am looking for any advices / recommendations how to debug multiplayer game.

What is the expected result

Some kind of tool or tips for console debugging.

Project

In relation to this topic I have for example a question about priorities of taking over ownership of variables. How do they work?

I am curious, becouse I am using system, where I am writing into shared “actions” array changes, that should oponent process in his iterration of code.

Here is example with processing building hit:

  1. Owner of ammo is checking if building is hit by his ammo. If result is positive, owner of ammo writes into “actions” information about oponents object and damage that it should take.

  1. Oponent is checking, if there is any information in “actions”, that he should resolve. If yes, he resolves it and empties action.

So both players are re-taking ownership of “actions” array, but I am not sure if this can lead toward some collisions, that one action runs earlier then other and players are rewriting values in array under their hands - if it makes sense.