CotC C# SDK for Unity  v1.4.0.1
Making social games is easy !
Properties | Public Member Functions | List of all members

Description

Some methods accept a PushNotification parameter. This parameter can be used to forward a push notification to the users who are not active at the moment.

Properties

Action< MatchInviteEventOnMatchInvitation
 

Public Member Functions

Promise< MatchCreate (int maxPlayers, string description=null, Bundle customProperties=null, Bundle shoe=null, Bundle globalState=null)
 Creates a match, available for join by other players. If you would like to make your match private, please read the general documentation about matches. More...
 
Promise< DoneDelete (string matchId)
 Deletes a match. Only works if you are the one who created it and it is already finished. More...
 
Promise< DoneDismissInvitation (string matchId)
 Dismisses an invitation to a match. More...
 
void DiscardEventHandlers ()
 Clears all event handlers subscribed, ensuring that a match object can be dismissed without causing further actions in the background. More...
 
GamerMatches Domain (string domain)
 Changes the domain affected by the next operations. You should typically use it this way: gamer.Matches.Domain("private").List(...); More...
 
Promise< MatchFetch (string matchId)
 Fetches a Match object corresponding to a match which the player already belongs to. It can be used either to obtain additional information about a running match (by inspecting the resulting match object), or to continue an existing match (by keeping the match object which corresponds to the one that was returned by the Create method). This call is not scoped by domain (it uses the Match ID directly). More...
 
Promise< MatchJoin (string matchId, PushNotification notification=null)
 Asks to join the match with a given ID. Do not use this if you are already part of the match. This call is not scoped by domain (it uses the Match ID directly). More...
 
Promise< PagedList< MatchListResult > > List (bool participating=false, bool invited=false, bool finished=false, bool full=false, int limit=30, int offset=0)
 Can be used to list the active matches for this game. In general, it is not recommended to proceed this way if your goal is to display the games that may be joined. The indexing API is better suited to this use case (index the match along with properties and look for matches matching the desired properties). More...
 

Member Function Documentation

◆ Create()

Promise<Match> CotcSdk.GamerMatches.Create ( int  maxPlayers,
string  description = null,
Bundle  customProperties = null,
Bundle  shoe = null,
Bundle  globalState = null 
)

Creates a match, available for join by other players. If you would like to make your match private, please read the general documentation about matches.

Returns
Promise resolved when the operation has completed. The attached Match object allows to operate with the match.
Parameters
maxPlayersThe maximum number of players who may be in the game at a time.
descriptionString describing the match (available for other who want to join).
customPropertiesFreeform object containing the properties of the match, which may be used by other players to search for a suited match.
shoeFreeform object containing a list of objects which will be shuffled upon match creation. This offers an easy way to make a random generator that is safe, unbiased (since made on the server) and can be verified by all players once the game is finished. This bundle needs to be an array (use Bundle.CreateArray).
globalStateGlobal state you want to attach to the match.

◆ Delete()

Promise<Done> CotcSdk.GamerMatches.Delete ( string  matchId)

Deletes a match. Only works if you are the one who created it and it is already finished.

Returns
Promise resolved when the operation has completed.
Parameters
matchIdID of the match to delete.

◆ DiscardEventHandlers()

void CotcSdk.GamerMatches.DiscardEventHandlers ( )

Clears all event handlers subscribed, ensuring that a match object can be dismissed without causing further actions in the background.

◆ DismissInvitation()

Promise<Done> CotcSdk.GamerMatches.DismissInvitation ( string  matchId)

Dismisses an invitation to a match.

Returns
Promise resolved when the operation has completed.
Parameters
matchIdID of the match where invitation is dismissed.

◆ Domain()

GamerMatches CotcSdk.GamerMatches.Domain ( string  domain)

Changes the domain affected by the next operations. You should typically use it this way: gamer.Matches.Domain("private").List(...);

Parameters
domainDomain on which to scope the matches. Default to private if unmodified.
Returns
This object for operation chaining.

◆ Fetch()

Promise<Match> CotcSdk.GamerMatches.Fetch ( string  matchId)

Fetches a Match object corresponding to a match which the player already belongs to. It can be used either to obtain additional information about a running match (by inspecting the resulting match object), or to continue an existing match (by keeping the match object which corresponds to the one that was returned by the Create method). This call is not scoped by domain (it uses the Match ID directly).

Returns
Promise resolved when the operation has completed. The attached Match object allows to operate with the match.
Parameters
matchIdThe ID of an existing match to resume. It can be fetched from the Match object (MatchId).

◆ Join()

Promise<Match> CotcSdk.GamerMatches.Join ( string  matchId,
PushNotification  notification = null 
)

Asks to join the match with a given ID. Do not use this if you are already part of the match. This call is not scoped by domain (it uses the Match ID directly).

Returns
Promise resolved when the operation has completed. In case of success, you get the exact same match object that would be returned by a call to Create or Fetch. It can be used to interact with the match as the user who just joined.
Parameters
matchIdThe ID of an existing match to join. It can be fetched from the Match object (MatchId).
notificationOptional push notification to be sent to inactive players (see class definition).

◆ List()

Promise<PagedList<MatchListResult> > CotcSdk.GamerMatches.List ( bool  participating = false,
bool  invited = false,
bool  finished = false,
bool  full = false,
int  limit = 30,
int  offset = 0 
)

Can be used to list the active matches for this game. In general, it is not recommended to proceed this way if your goal is to display the games that may be joined. The indexing API is better suited to this use case (index the match along with properties and look for matches matching the desired properties).

Returns
Promise resolved when the operation has completed. The list of matches filtered according to the following parameters is provided.
Parameters
participatingSet to true to only list matches to which this user is participating.
invitedSet to true to filter by matches you are invited to (only include them).
finishedSet to true to also include finished matchs (which are filtered out by default).
fullSet to true to also include games where the maximum number of players has been reached.
limitFor pagination, allows to set a greater or smaller page size than the default 30.
offsetFor pagination, avoid using it explicitly.