synchronizing information sent by clients - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Discussion (
https://sampforum.blast.hk/forumdisplay.php?fid=84)
+---- Thread: synchronizing information sent by clients (
/showthread.php?tid=662325)
synchronizing information sent by clients -
Yashas - 29.12.2018
At IRL time T, player A shot player B. The player A sends information to the server about the shot (and other information) which is received by the server at time X. Player B keeps sending information every now and then.
In IRL time T, the player A had some state information (includes player B's state based on which B is rendered on A's screen). Player A's state at IRL time T is received at the server at IRL time X. I somehow need to find out the state of player B as seen by A.
What are the approaches to solving this problem of synchronization?
The player B continuously informs B's state to the server which is relayed to other nearby players based on which things are rendered on their screen. If I were to store the state information relayed by B in an array. How can I efficiently pick the correct state information of B that corresponds to the event that happened at T on A's screen?