문제

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
도움이 되었습니까?

해결책

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.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top