API Reference
Controllers
Models
GK_Player
public class GK_Player {
public void LoadPhoto(GK_PhotoSize size)
public string Id {get;}
public string Alias {get;}
public string DisplayName {get;}
public Texture2D SmallPhoto{get;}
public Texture2D BigPhoto{get;}
public event Action<GK_UserPhotoLoadResult> OnPlayerPhotoLoaded = delegate {};
}
ISN_Error
public class ISN_Error {
public int Code {get;}
public string Description {get;}
}
GK_RTM_Match
public class GK_RTM_Match {
public int ExpectedPlayerCount {get;}
public List<GK_Player> Players {get;}
}
GK_TBM_Match
public class GK_TBM_Match {
//A string that uniquely identifies the match. If you want to store match-specific data elsewhere, use this string as a key. Your game could also save this ID and use it later to load this specific match. To load a specific match, call the GameCenter_TBM.Instance.LoadMatch(matchId);
public string Id {get;}
//A text string your game sets to provide a human-readable status for the match. Typically, you update this property before changing the current player. The message is displayed by the standard user interface. If you display a custom interface, you should also display the message.
public string Message {get;}
//The participant object for the next player expected to act in the match. This object is always one of the objects stored in the participants array.
public GK_TBM_Participant CurrentParticipant {get;}
//Match creation time
public DateTime CreationTimestamp {get;}
//States whether the match is still in progress.
public GK_TurnBasedMatchStatus Status {get;}
//An array of GK_TBM_Participant objects. The objects in the array are always stored in the same order. You read the properties of participant objects to build your user interface. These objects are also used as inputs to certain methods on the match object.
public List<GK_TBM_Participant> Participants {get;}
//Current match data
public byte[] Data {get;}
//Match data representation as UTF8 string, usfeul if you JSON format for your match data
public string UTF8StringData {get;}
//Methods allow to get partisipant by his id
public GK_TBM_Participant GetParticipantByPlayerId(string playerId);
}
GK_TBM_Participant
public class GK_TBM_Participant {
//The player identifier for the player, assuming this seat is filled. Use it to load display names and photos for the player.
public string PlayerId {get;}
//GK_Player object, if seat is filled.
public GK_Player Player {get;}
//Id of the match associated with the current participant
public string MatchId {get;}
//The time at which the player must act before forfeiting a turn. Your game decides what happens when a turn is forfeited. For some games, a forfeited turn might end the match. For other games, you might choose a reasonable set of default actions for the player, or simply do nothing.
public DateTime TimeoutDate {get;}
//Last turn date of this participant
public DateTime LastTurnDate {get;}
//Declares whether or not this seat is filled and, if it is, declares whether the player is still active in the match.
public GK_TurnBasedParticipantStatus Status {get;}
//When a player leaves a match, this property describes what happened to the player. The player may have won or lost the match
public GK_TurnBasedMatchOutcome MatchOutcome {get;}
//Set's Outcome for this participant
public void SetOutcome(GK_TurnBasedMatchOutcome outcome);
}
GK_Invite
public class GK_Invite {
public string Id {get;}
public GK_Player {get;}
public int PlayerGroup {get;}
public int PlayerAttributes {get;}
}
Results
ISN_Result
public class ISN_Result {
public bool IsSucceeded {get;}
public bool IsFailed {get;}
public ISN_Error Error {get;}
}
GK_PlayerSignatureResult
public class GK_PlayerSignatureResult : SA.Common.Models.Result {
//The URL for the public encryption key.
public string PublicKeyUrl {get;}
//The verification signature data generated.
public byte[] Signature {get;}
//A random string used to compute the hash and keep it randomized.
public byte[] Salt {get;}
//The date and time that the signature was created.
public long Timestamp {get;}
}
GK_UserPhotoLoadResult
public class GK_UserPhotoLoadResult : SA.Common.Models.Result {
public Texture2D Photo {get;}
public GK_PhotoSize Size {get;}
}
GK_RTM_MatchStartedResult
public class GK_RTM_MatchStartedResult : SA.Common.Models.Result {
//null, if result is failed
private GK_RTM_Match Match {get;}
}
GK_RTM_QueryActivityResult
public class GK_RTM_QueryActivityResult : SA.Common.Models.Result {
private int Activity {get;}
}
GK_TBM_LoadMatchResult
public class GK_TBM_LoadMatchResult : SA.Common.Models.Result {
public GK_TBM_Match Match {get;}
}
GK_TBM_LoadMatchesResult
public class GK_TBM_LoadMatchesResult : SA.Common.Models.Result {
public Dictionary<string, GK_TBM_Match> LoadedMatches {get;}
}
GK_TBM_MatchDataUpdateResult
public class GK_TBM_MatchDataUpdateResult : SA.Common.Models.Result {
public GK_TBM_Match Match {get;}
}
GK_TBM_MatchInitResult
public class GK_TBM_MatchInitResult : SA.Common.Models.Result {
public GK_TBM_Match Match {get;}
}
GK_TBM_MatchQuitResult
public class GK_TBM_MatchQuitResult : SA.Common.Models.Result {
public string MatchId {get;}
}
GK_TBM_EndTrunResult
public class GK_TBM_EndTrunResult : SA.Common.Models.Result {
public GK_TBM_Match Match {get;}
}
GK_TBM_MatchEndResult
public class GK_TBM_MatchEndResult : SA.Common.Models.Result {
public GK_TBM_Match Match {get;}
}
GK_TBM_RematchResult
public class GK_TBM_RematchResult : SA.Common.Models.Result {
public GK_TBM_Match Match {get;}
}
GK_TBM_MatchRemovedResult
public class GK_TBM_MatchRemovedResult : SA.Common.Models.Result {
public string MatchId {get;}
}
Enums
GK_PhotoSize
public enum GK_PhotoSize {
GKPhotoSizeSmall = 0,
GKPhotoSizeNormal = 1
}
GK_MatchSendDataMode
public enum GK_MatchSendDataMode {
RELIABLE = 0,
UNRELIABLE = 1
}
GK_PlayerConnectionState
public enum GK_PlayerConnectionState {
Unknown = 0,
Connected = 1,
Disconnected = 2
}
GK_TurnBasedMatchStatus
public enum GK_TurnBasedMatchStatus {
Unknown = 0,
Open = 1,
Ended = 2,
Matching = 3
}
GK_TurnBasedParticipantStatus
public enum GK_TurnBasedParticipantStatus {
Unknown = 0,
Invited = 1, // a participant has been invited but not yet responded
Declined = 2, // a participant that has declined an invite to this match
Matching = 3, // a participant that is waiting to be matched
Active = 4, // a participant that is active in this match
Done = 5, // a participant is done with this session
}
GK_TurnBasedMatchOutcome
public enum GK_TurnBasedMatchOutcome {
None = 0, // Participants who are not done with a match have this state
Quit = 1, // Participant quit
Won = 2, // Participant won
Lost = 3, // Participant lost
Tied = 4, // Participant tied
TimeExpired = 5, // Game ended due to time running out
First = 6,
Second = 7,
Third = 8,
Fourth = 9
}