PlayerIO

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

Unity3D Client Reference

Multiplayer  class documentationClass PlayerInsight

Namespace: PlayerIOClient
Language: C# / .NET

PlayerInsight

Properties

 
public int
PlayersOnline  [read-only]

The numbers of players online in the entire game

Methods

 
public string
GetSegment (string segmentGroup)

Gets the segment value for the given segment group. For instance, if the player is tagged in the segment 'source:facebook' the method will return 'facebook' when called with 'source' as the argument.

public void
Refresh (Callback successCallback, Callback<PlayerIOError> errorCallback)

Refresh the players online counter and the current segments of the user.

public void
Refresh (Callback successCallback)

Refresh the players online counter and the current segments of the user.

public void
SetSegments (String[] segments, Callback successCallback)

Assign custom PlayerInsight segments to the current user

public void
SetSegments (String[] segments, Callback successCallback, Callback<PlayerIOError> errorCallback)

Assign custom PlayerInsight segments to the current user

public void
TrackEvent (string eventType, int value, Callback successCallback, Callback<PlayerIOError> errorCallback)

Track the given event for the current user in PlayerInsight

public void
TrackEvent (string eventType, int value, Callback successCallback)

Track the given event for the current user in PlayerInsight

public void
TrackExternalPayment (string currency, int amount, Callback successCallback, Callback<PlayerIOError> errorCallback)

Track a completed payment in PlayerInsight from an external non-PayVault payment method.

public void
TrackExternalPayment (string currency, int amount, Callback successCallback)

Track a completed payment in PlayerInsight from an external non-PayVault payment method.

public void
TrackInvitedBy (string invitingUserId, string invitationChannel, Callback successCallback)

Tell PlayerInsight who invited the current user in this session. Used for viral analysis.

public void
TrackInvitedBy (string invitingUserId, string invitationChannel, Callback successCallback, Callback<PlayerIOError> errorCallback)

Tell PlayerInsight who invited the current user in this session. Used for viral analysis.

PlayerInsight.PlayersOnline

public int
PlayersOnline  [read-only]

The numbers of players online in the entire game

PlayerInsight.GetSegment

public string
GetSegment (string segmentGroup)

Gets the segment value for the given segment group. For instance, if the player is tagged in the segment 'source:facebook' the method will return 'facebook' when called with 'source' as the argument.

Arguments

string segmentGroup
The segmentGroup to get the current segment value for.

PlayerInsight.Refresh

public void
Refresh (Callback successCallback, Callback<PlayerIOError> errorCallback)

Refresh the players online counter and the current segments of the user.

Arguments

Callback successCallback
Callback that will be called when the operation succeeds
Callback<PlayerIOError> errorCallback
Callback that will be called instead of successCallback if an error occurs during the operation.

PlayerInsight.Refresh

public void
Refresh (Callback successCallback)

Refresh the players online counter and the current segments of the user.

Arguments

Callback successCallback
Callback that will be called when the operation succeeds

PlayerInsight.SetSegments

public void
SetSegments (String[] segments, Callback successCallback)

Assign custom PlayerInsight segments to the current user

Arguments

String[] segments
Custom segments for the user in PlayerInsight, each string should be in the form 'segmentGroup:value', like 'adcampaign:googleads'.
Callback successCallback
Callback that will be called when the operation succeeds

PlayerInsight.SetSegments

public void
SetSegments (String[] segments, Callback successCallback, Callback<PlayerIOError> errorCallback)

Assign custom PlayerInsight segments to the current user

Arguments

String[] segments
Custom segments for the user in PlayerInsight, each string should be in the form 'segmentGroup:value', like 'adcampaign:googleads'.
Callback successCallback
Callback that will be called when the operation succeeds
Callback<PlayerIOError> errorCallback
Callback that will be called instead of successCallback if an error occurs during the operation.

PlayerInsight.TrackEvent

public void
TrackEvent (string eventType, int value, Callback successCallback, Callback<PlayerIOError> errorCallback)

Track the given event for the current user in PlayerInsight

Arguments

string eventType
The name of the event to track.
int value
The amount to add to the counter value.
Callback successCallback
Callback that will be called when the operation was completed successfully
Callback<PlayerIOError> errorCallback
Callback that will be called instead of successCallback if an error occurs during the operation.

PlayerInsight.TrackEvent

public void
TrackEvent (string eventType, int value, Callback successCallback)

Track the given event for the current user in PlayerInsight

Arguments

string eventType
The name of the event to track.
int value
The amount to add to the counter value.
Callback successCallback
Callback that will be called when the operation was completed successfully

PlayerInsight.TrackExternalPayment

public void
TrackExternalPayment (string currency, int amount, Callback successCallback, Callback<PlayerIOError> errorCallback)

Track a completed payment in PlayerInsight from an external non-PayVault payment method.

Arguments

string currency
The currency the payment was made in.
int amount
The amount of the payment in the given currency.
Callback successCallback
Callback that will be called when the operation was completed successfully
Callback<PlayerIOError> errorCallback
Callback that will be called instead of successCallback if an error occurs during the operation.

PlayerInsight.TrackExternalPayment

public void
TrackExternalPayment (string currency, int amount, Callback successCallback)

Track a completed payment in PlayerInsight from an external non-PayVault payment method.

Arguments

string currency
The currency the payment was made in.
int amount
The amount of the payment in the given currency.
Callback successCallback
Callback that will be called when the operation was completed successfully

PlayerInsight.TrackInvitedBy

public void
TrackInvitedBy (string invitingUserId, string invitationChannel, Callback successCallback)

Tell PlayerInsight who invited the current user in this session. Used for viral analysis.

Arguments

string invitingUserId
The connectUserId of the user who invited this user.
string invitationChannel
An identifier for the channel the invitation was received over, like 'email' or 'fb_invite'.
Callback successCallback
Callback that will be called when the operation was completed successfully

PlayerInsight.TrackInvitedBy

public void
TrackInvitedBy (string invitingUserId, string invitationChannel, Callback successCallback, Callback<PlayerIOError> errorCallback)

Tell PlayerInsight who invited the current user in this session. Used for viral analysis.

Arguments

string invitingUserId
The connectUserId of the user who invited this user.
string invitationChannel
An identifier for the channel the invitation was received over, like 'email' or 'fb_invite'.
Callback successCallback
Callback that will be called when the operation was completed successfully
Callback<PlayerIOError> errorCallback
Callback that will be called instead of successCallback if an error occurs during the operation.