PlayerIO

The fastest way to build online games without breaking a sweat.

Unity3D Client Reference

Multiplayer  class documentationClass PlayerIO

Namespace: PlayerIOClient
Language: C# / .NET

Entry class for the initial connection to Player.IO

Here is an example of using the class to connect to Player.IO

Properties

 
public static string
ApiServerHost

If set, API request will initially use this host.

public static QuickConnect
QuickConnect  [read-only]

Property used to access the QuickConnect service.

public static bool
UseSecureApiRequests

If true, API Requests will be encrypted using TLS/SSL. Beaware that this will cause a performance degredation by introducting secure connection negotiation latency for requests.

Methods

 
public void
Authenticate (string gameId, string connectionId, Dictionary<string, string> authenticationArguments, String[] playerInsightSegments, Callback<Client> successCallback)

Connects to Player.IO using as the given user

public void
Authenticate (string gameId, string connectionId, Dictionary<string, string> authenticationArguments, String[] playerInsightSegments, Callback<Client> successCallback, Callback<PlayerIOError> errorCallback)

Connects to Player.IO using as the given user

public string
CalcAuth (string userId, string sharedSecret)

Calculate an auth hash for use in the Connect method

public string
CalcAuth256 (string userId, string sharedSecret)

Calculate an auth hash for use in the Connect method

public void
Connect (string gameId, string connectionId, string userId, string auth, string partnerId, Callback<Client> successCallback, Callback<PlayerIOError> errorCallback)

Connects to Player.IO using as the given user

public void
Connect (string gameId, string connectionId, string userId, string auth, string partnerId, String[] playerInsightSegments, Callback<Client> successCallback)

Connects to Player.IO using as the given user

public void
Connect (string gameId, string connectionId, string userId, string auth, string partnerId, String[] playerInsightSegments, Callback<Client> successCallback, Callback<PlayerIOError> errorCallback)

Connects to Player.IO using as the given user

public void
Connect (string gameId, string connectionId, string userId, string auth, string partnerId, Callback<Client> successCallback)

Connects to Player.IO using as the given user

PlayerIO.ApiServerHost

public static string
ApiServerHost

If set, API request will initially use this host.

PlayerIO.QuickConnect

public static QuickConnect
QuickConnect  [read-only]

Property used to access the QuickConnect service.

PlayerIO.UseSecureApiRequests

public static bool
UseSecureApiRequests

If true, API Requests will be encrypted using TLS/SSL. Beaware that this will cause a performance degredation by introducting secure connection negotiation latency for requests.

PlayerIO.Authenticate

public void
Authenticate (string gameId, string connectionId, Dictionary<string, string> authenticationArguments, String[] playerInsightSegments, Callback<Client> successCallback)

Connects to Player.IO using as the given user

Arguments

string gameId
The game id of the game you wish to connect to. This value can be found in the admin panel
string connectionId
The id of the connection, as given in the settings section of the admin panel. 'public' should be used as the default
Dictionary<string, string> authenticationArguments
A dictionary of arguments for the given connection.
String[] playerInsightSegments
Custom segments for the user in PlayerInsight.
Callback<Client> successCallback
Callback with the client object when connected

PlayerIO.Authenticate

public void
Authenticate (string gameId, string connectionId, Dictionary<string, string> authenticationArguments, String[] playerInsightSegments, Callback<Client> successCallback, Callback<PlayerIOError> errorCallback)

Connects to Player.IO using as the given user

Arguments

string gameId
The game id of the game you wish to connect to. This value can be found in the admin panel
string connectionId
The id of the connection, as given in the settings section of the admin panel. 'public' should be used as the default
Dictionary<string, string> authenticationArguments
A dictionary of arguments for the given connection.
String[] playerInsightSegments
Custom segments for the user in PlayerInsight.
Callback<Client> successCallback
Callback with the client object when connected
Callback<PlayerIOError> errorCallback
Callback that will be called instead of successCallback if an error occurs during the connect.

PlayerIO.CalcAuth

public string
CalcAuth (string userId, string sharedSecret)

Calculate an auth hash for use in the Connect method

Arguments

string userId
The userid to use when generating the hash
string sharedSecret
The shared secret to use when generating the hash. This must be the same value as the one given to a connection in the admin panel.

PlayerIO.CalcAuth256

public string
CalcAuth256 (string userId, string sharedSecret)

Calculate an auth hash for use in the Connect method

Arguments

string userId
The userid to use when generating the hash
string sharedSecret
The shared secret to use when generating the hash. This must be the same value as the one given to a connection in the admin panel.

PlayerIO.Connect

public void
Connect (string gameId, string connectionId, string userId, string auth, string partnerId, Callback<Client> successCallback, Callback<PlayerIOError> errorCallback)

Connects to Player.IO using as the given user

Arguments

string gameId
The game id of the game you wish to connect to. This value can be found in the admin panel
string connectionId
The id of the connection, as given in the settings section of the admin panel. 'public' should be used as the default
string userId
The id of the user connecting. This can be any string you like.
string auth
If the connection identified by ConnectionIdentifier only accepts authenticated requests, the auth value generated based on UserId is added here. You can generate an auth value using the CalcAuth() method.
string partnerId
The PartnerPay partner id this user should be tagged with, if you are using the PartnerPay system.
Callback<Client> successCallback
Callback with the client object when connected
Callback<PlayerIOError> errorCallback
Callback that will be called instead of successCallback if an error occurs during the connect.

PlayerIO.Connect

public void
Connect (string gameId, string connectionId, string userId, string auth, string partnerId, String[] playerInsightSegments, Callback<Client> successCallback)

Connects to Player.IO using as the given user

Arguments

string gameId
The game id of the game you wish to connect to. This value can be found in the admin panel
string connectionId
The id of the connection, as given in the settings section of the admin panel. 'public' should be used as the default
string userId
The id of the user connecting. This can be any string you like.
string auth
If the connection identified by ConnectionIdentifier only accepts authenticated requests, the auth value generated based on UserId is added here. You can generate an auth value using the CalcAuth() method.
string partnerId
The PartnerPay partner id this user should be tagged with, if you are using the PartnerPay system.
String[] playerInsightSegments
Custom segments for the user in PlayerInsight.
Callback<Client> successCallback
Callback with the client object when connected

PlayerIO.Connect

public void
Connect (string gameId, string connectionId, string userId, string auth, string partnerId, String[] playerInsightSegments, Callback<Client> successCallback, Callback<PlayerIOError> errorCallback)

Connects to Player.IO using as the given user

Arguments

string gameId
The game id of the game you wish to connect to. This value can be found in the admin panel
string connectionId
The id of the connection, as given in the settings section of the admin panel. 'public' should be used as the default
string userId
The id of the user connecting. This can be any string you like.
string auth
If the connection identified by ConnectionIdentifier only accepts authenticated requests, the auth value generated based on UserId is added here. You can generate an auth value using the CalcAuth() method.
string partnerId
The PartnerPay partner id this user should be tagged with, if you are using the PartnerPay system.
String[] playerInsightSegments
Custom segments for the user in PlayerInsight.
Callback<Client> successCallback
Callback with the client object when connected
Callback<PlayerIOError> errorCallback
Callback that will be called instead of successCallback if an error occurs during the connect.

PlayerIO.Connect

public void
Connect (string gameId, string connectionId, string userId, string auth, string partnerId, Callback<Client> successCallback)

Connects to Player.IO using as the given user

Arguments

string gameId
The game id of the game you wish to connect to. This value can be found in the admin panel
string connectionId
The id of the connection, as given in the settings section of the admin panel. 'public' should be used as the default
string userId
The id of the user connecting. This can be any string you like.
string auth
If the connection identified by ConnectionIdentifier only accepts authenticated requests, the auth value generated based on UserId is added here. You can generate an auth value using the CalcAuth() method.
string partnerId
The PartnerPay partner id this user should be tagged with, if you are using the PartnerPay system.
Callback<Client> successCallback
Callback with the client object when connected