Two player matches let you find opponents and sync data between the two devices. Once you create a match, each player can get and update the match's game state. This is serialized for you into a custom class. Prizes can be awarded automatically to winners (configure on your dashboard).
Get a match and deserialize the current state. CustomState can be any class
GalaxyClientAPI.Controller.GetMatch<CustomState>(MatchId, (MyGameState, Match) => { //MyGameState is an object of type CustomState //Match is the match object described above}, error => { });
Update a match with MyNewGameState of type CustomState
GalaxyClientAPI.Controller.UpdateMatch<CustomState>(MatchId, MyNewGameState,(MyGameState, Match) => { //MyGameState is an object of type CustomState //Match is the match object described above}, error => { });
End the match with id MatchId. If you pass Score and LeaderboardId (optional), the score will be reported to the leaderboard and the winner of the match will be awarded a prize, if applicable.
GalaxyClientAPI.Controller.EndMatch(MatchId, Score?); //Score is optional