Skip to content
Guilherme Souza edited this page Oct 21, 2013 · 4 revisions

Status: Draft, RFC

Ideas

  • A simple interface to control kicking during the game
  • Since the server won't take control over any logic (except matching), it's up to the devices to disconnect a lazy player

Interface

A simple object (KickCenter) and a delegate that conforms to a protocol (KickCenterDelegate). In this plage, "device player" represents the human player in control of the current device (more specifically, the user that thinks he has control over Apple stuff).

Messages

  • -(void)initWithInterval:(int)interval numPlayers:(int)numPlayers: initialize the object with the given number of human players and the interval (in seconds) to enable kicking.
  • -(void)restartInYourTurn:(BOOL)yourTurn: restart the timer. yourTurn indicates whether is the device player's turn.
  • -(void)kick: inform the kick center the device player wants to kick the current player. The request will be ignored if throw against the device player itself, before kicking is enabled or more than once in the same turn.
  • -(void)receivedKickMessage: inform the kick center another device has sent a kick message.

Delegate messages

  • -(void)kickCenterCanKick:(KickCenter*)kc: indicate the device player can ask to kick the current player. This won't be sent if the current player is the device player.
  • -(void)kickCenterCanBeKicked:(KickCenter*)kc: indicate the device player can be kicked by other players. Sent only when it's the device player's turn.
  • -(void)kickCenterKickedPlayer:(KickCenter*)kc: indicate the current player was kicked. The current player can be the device player (sad but true...), in this case the kicked device should close the connection with the server and all others should ignore this player from this point forward.
Clone this wiki locally