Reputation: 51
I'm making a turn-based multiplayer mode in my game. The thing that I would like to know is how I can pass some match settings (if I'm an inviter) to an invitee. For example, I create the game: I set the turn time, the round time and the judgement type, how can the invitee know this information in order for game to operate with this data (show timers and count steps/letters/kills/etc.)? Thank you all! The thing that I would like to get is: The player creates the game: he sets the time for a turn and for a round, then he decides which addons to use (I have 4 of them) and then chooses how the game will choose the winner (by what criteria). Then this player sends an invitation to another player, and afterwards they both are playing on the conditions that were chosen by the first player.
Upvotes: 1
Views: 436
Reputation: 4572
The most direct way is to include the game information in the game state. When the current player calls [takeTurn(apiClient, matchId, matchData, nextParticipantId)](https://developers.google.com/android/reference/com/google/android/gms/games/multiplayer/turnbased/TurnBasedMultiplayer#takeTurn(com.google.android.gms.common.api.GoogleApiClient, java.lang.String, byte[], java.lang.String)), the match data parameter is a byte array. In there you can encode the match configuration and the current state of the game. The match data length can be up to at least 128k.
Upvotes: 1