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

Description

API methods related to the friends and so on of one gamer.

You may also want to subscribe to related events (see CotcSdk.GamerCommunity.OnFriendStatusChange).

Properties

Action< FriendStatusChangeEventOnFriendStatusChange
 Event triggered when someone adds this gamer as a friend or changes his friendship status. More...
 

Public Member Functions

Promise< DoneAddFriend (string gamerId, PushNotification notification=null)
 Easy way to add a friend knowing his gamer ID inside the CotC community. More...
 
Promise< DoneChangeRelationshipStatus (string gamerId, FriendRelationshipStatus state, PushNotification notification=null)
 Allows to change the relation of a friendship inside the application. More...
 
void DiscardEventHandlers ()
 Clears all event handlers subscribed, ensuring that a match object can be dismissed without causing further actions in the background. More...
 
GamerCommunity Domain (string domain)
 Changes the domain affected by the next operations. You should typically use it this way: gamer.Community.Domain("private").ListFriends(...); More...
 
Promise< NonpagedList< GamerInfo > > ListFriends (bool filterBlacklisted=false)
 Method used to retrieve the application's friends of the currently logged in profile. More...
 
Promise< SocialNetworkFriendResponseListNetworkFriends (LoginNetwork network, List< SocialNetworkFriend > friends, bool automatching=false)
 When you have data about friends from another social network, you can post them to CotC servers using these function. This will automatically add them as a friend on CotC as they get recognized on our servers. The friends get associated to the domain of this object. Note: this function was once called PostSocialNetworkFriends but renamed due to it being misleading. More...
 
Promise< DoneSendEvent (string gamerId, Bundle eventData, PushNotification notification=null)
 Use this method to send a message to another user from your game. More...
 

Property Documentation

◆ OnFriendStatusChange

Action<FriendStatusChangeEvent> CotcSdk.GamerCommunity.OnFriendStatusChange
addremove

Event triggered when someone adds this gamer as a friend or changes his friendship status.

Member Function Documentation

◆ AddFriend()

Promise<Done> CotcSdk.GamerCommunity.AddFriend ( string  gamerId,
PushNotification  notification = null 
)

Easy way to add a friend knowing his gamer ID inside the CotC community.

Returns
Promise resolved when the operation has completed.
Parameters
gamerIdID of the gamer to add as a friend (fetched using ListFriends for instance).
notificationOptional OS notification to be sent to indicate the player that the status has changed.

◆ ChangeRelationshipStatus()

Promise<Done> CotcSdk.GamerCommunity.ChangeRelationshipStatus ( string  gamerId,
FriendRelationshipStatus  state,
PushNotification  notification = null 
)

Allows to change the relation of a friendship inside the application.

Returns
Promise resolved when the operation has completed.
Parameters
gamerIdID of the gamer to change the relationship (fetched using ListFriends for instance).
stateThe new state to set.
notificationOptional OS notification to be sent to indicate the player that the status has changed.

◆ DiscardEventHandlers()

void CotcSdk.GamerCommunity.DiscardEventHandlers ( )

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

◆ Domain()

GamerCommunity CotcSdk.GamerCommunity.Domain ( string  domain)

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

Parameters
domainDomain on which to scope the next operations.
Returns
This object for operation chaining.

◆ ListFriends()

Promise<NonpagedList<GamerInfo> > CotcSdk.GamerCommunity.ListFriends ( bool  filterBlacklisted = false)

Method used to retrieve the application's friends of the currently logged in profile.

Returns
Promise resolved when the operation has completed, with the fetched list of friends.
Parameters
filterBlacklistedWhen set to true, restricts to blacklisted friends.

◆ ListNetworkFriends()

Promise<SocialNetworkFriendResponse> CotcSdk.GamerCommunity.ListNetworkFriends ( LoginNetwork  network,
List< SocialNetworkFriend friends,
bool  automatching = false 
)

When you have data about friends from another social network, you can post them to CotC servers using these function. This will automatically add them as a friend on CotC as they get recognized on our servers. The friends get associated to the domain of this object. Note: this function was once called PostSocialNetworkFriends but renamed due to it being misleading.

Returns
Promise resolved when the operation has completed. The attached value is the same list as passed, enriched with potential information about the gamer (member CotcSdk.SocialNetworkFriend.ClanInfo) for gamers who are already registered on CotC servers.
Parameters
networkThe network with which these friends are associated.
friendsA list of data about the friends fetched on the social network.
automatchingIf true, synchronizes the CotC friends with the list. That is, the provided social network friends become your friends on CotC as well (reported on ListFriends and such).

◆ SendEvent()

Promise<Done> CotcSdk.GamerCommunity.SendEvent ( string  gamerId,
Bundle  eventData,
PushNotification  notification = null 
)

Use this method to send a message to another user from your game.

Messages are sent to a specific user, in a specific domain. You can use domains to send messages across games (or use private for messages sent to your game only).

Returns
Promise resolved when the operation has completed.
Parameters
gamerIdID of the recipient gamer.
eventDataJSON object representing the event to be sent. The recipient will receive it as is when subscribed to a CotcSdk.DomainEventLoop (ReceivedEvent property). If the application is not active, the message will be queued and transmitted the next time the domain event loop is started.
notificationPush notification to send to the recipient player if not currently active.