Question

I'm implementing a online chess for Android and I have a question about how to update the players with the other player's movements.

For example lets imagine the Player1 moves his tower from a1 to a7.

What should I do?

  • Send to the Player2: "a1 to a7" (with some kind of checksum of the full board to avoid errors)
  • Send to the Player2 the full board with the up to 32 pieces
Était-ce utile?

La solution

Support both.

  • Only send deltas during events, but
  • Allow the client to request full state, for any reason, through a separate API.
  • Include and increment a sequence number with each event so that it is trivial for a client to detect missed updates.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top