together - TogetherGames/Public-Unity-CSharp GitHub Wiki
Together::Together
The Together class is the root class in the Together api. It contains essential configuration settings, an object representing the logged in User, and various Managers for creating, deleting, and retrieving various Together objects.
float PingInterval
How often the ping message is sent to the server.
DateTime LastPingTime
The last time a ping message was sent to the server.
string CacheUserGuid
The cached UserGuid of the last logged in User.
string ServerIP
The IP address of the together server.
string ClientPublicKey
The PublicKey of the Together Client the Game belongs to.
string ClientPrivateKey
The PrivateKey of the Together Client that Game belongs to.
string GameKey
The Key of the Together Game.
string PlatformName
The name of the platform the Game is running on. (IOS, Android, Mac OS, Unity, HTML5/JS)
string ApnsDeviceToken
The DeviceToken for Apple push notifications.
string GcmDeviceToken
The DeviceToken for Google push notifications.
string WnsDeviceToken
The DeviceToken for Windows push notifications.
bool RegisteredPushEnabledDevice
A boolean indicates whether the push enabled Device has been registered with the server.
User User
A User class instance representing the logged in User.
UserSession UserSession
A UserSession class instance representing the logged in UserSession.
GameInstanceManager GameInstanceManager
A GameInstanceManager class instance useful for storing GameInstances the logged in User is a member of.
LeaderboardManager LeaderboardManager
A LeaderboardManager class instance useful for storing Leaderboards.
UserNotificationManager UserNotificationManager
A UserNotificationManager class instance useful for storing UserNotifications.
AchievementManager AchievementManager
A AchievementManager class instance useful for storing Achievements.
ItemManager ItemManager
A ItemManager class instance useful for storing Items.
ChatRoomManager ChatRoomManager
A ChatRoomManager class instance useful for storing ChatRooms.
FriendUserManager FriendUserManager
A FriendUserManager class instance useful for storing together Friends.
UserPurchaseManager UserPurchaseManager
A UserPurchaseManager class instance useful for storing UserPurchases.
TogetherSocial Social
A TogetherSocial class instance containing various social apis.
Together constructor with thread safety option. The network processor will execute your callbacks when performing network operations tailored for either a thread safe environment (Such as Windows Desktop builds or Mac Desktop builds) or circumvent an environment that is not guaranteed to be thread safe(Such us Unity). Use the constructor to specify which kind environment you are working within. If you are unsure, use False. If the environment is set to False(Not thread safe), then Process() must be called on the Network Processor to invoke callbacks from network methods.
Returns void
Together.Together( theadSafe )
bool theadSafe
TRUE identifies that the environment is thread safe, FALSE identifies it is not
--------------------------------------------------------------------------------Initializes the Together class so it's ready for the developer to start calling network messages.
Returns void
Together.Initialize( clientPublicKey, clientPrivateKey, gameKey, platformName )
string clientPublicKey
The PublicKey of the Client whose game this is. This is accessable from the playstogether website.
[string](#) clientPrivateKeyThe PrivateKey of the Client whose game this is. This is accessable from the playstogether website.
[string](#) gameKeyThe GameKey of the game. This is accessable from the playstogether website.
[string](#) platformNameThe Name of the Platform the game is running on. Supported Platforms are: ("IOS", "Android", "Mac OS", "Unity", "HTML5/JS")
--------------------------------------------------------------------------------Sets the ServerAddress all network messages will be sent to when talking to the together servers. This defaults to the primary Together servers and does not need to be called unless you are working with a form of private/local server instance. If you are interested in private hosting and want more information, contact [email protected].
Returns void
Together.SetServerAddress( serverAddress )
string serverAddress
The server address of the together server.
--------------------------------------------------------------------------------Gets the ServerAddress all network messages will be sent to when talking to the together servers.
Returns string
Together.GetServerAddress( )
Gets the UserID of the logged in User.
Returns long
Together.GetUserID( )
Gets the Name of the logged in User.
Returns string
Together.GetNameOfUser( )
Gets the Username of the logged in User.
Returns string
Together.GetUsername( )
Gets the SessionToken of the UserSession returned when logging in.
Returns string
Together.GetSessionToken( )
Finds the TogetherFriend with the specified UserID.
Returns FriendUser
Together.FindTogetherFriendByUserID( userID )
long userID
The ID of User to retrieve.
--------------------------------------------------------------------------------Finds the FacebookFriend with the specified SocialID (FacebookID).
Returns ExternalFriend
Together.FindFacebookFriendBySocialID( socialID )
string socialID
The FacebookID of the facebook user to find.
--------------------------------------------------------------------------------Prints out the specified text to the log.
Returns void
Together.Print( text )
string text
The text to print out.
--------------------------------------------------------------------------------Loads the Together Cache from the Device. The only thing stored in the TogetherCache currently is the UserGuid of the last logged in user for the application.
Returns bool
Together.LoadTogetherCache( )
Saves the Together Cache to the Device. The only thing stored in the TogetherCache currently is the UserGuid of the last logged in user for the application.
Returns bool
Together.SaveTogetherCache( )
Erases the Together Cache from the Device. The only thing stored in the TogetherCache currently is the UserGuid of the last logged in user for the application.
Returns bool
Together.EraseTogetherCache( )
Logs in the User. This should always be the first Together network message called. If no User GUID is provided, a new user account will be created anonymously and assigned a GUID which can be used to log the user in again later or register them with Facebook or via Custom form.
Note
Currently anonymous users will NOT be deleted. However it is possible that a user cleansing system will be implemented in the future that removes unregistered accounts after 3 to 6 months of inactivity.
Returns void
Together.LoginUser( callbackFunc )
OnCompleteHandler callbackFunc
The function to call upon completion.
--------------------------------------------------------------------------------Gets the Server Timestamp(UTC+0). The timestamp will be returned in the data member of the callback as a long.
Returns void
Together.GetServerTimeUTC( callbackFunc )
OnCompleteHandler callbackFunc
The function to call upon completion.
--------------------------------------------------------------------------------Fetches your developer global profile of data set through the portal or by atomic operations. The callback object will contain the profile in the data member as a PropertyCollection type.
Returns void
Together.GetGlobalProfile( callbackFunc )
OnCompleteHandler callbackFunc
The function to call upon completion.
--------------------------------------------------------------------------------Fetches the game's profile of data set through the portal or by atomic operations. The callback object will contain the profile in the data member as a PropertyCollection type.
Returns void
Together.GetGameProfile( callbackFunc )
OnCompleteHandler callbackFunc
The function to call upon completion.
--------------------------------------------------------------------------------Fetches the current, logged in user's profile for the game. The callback object will contain the profile in the data member as a PropertyCollection type. This is also retrieved when the User object for the local player is fetched and can be modified with the User.Modify call.
Returns void
Together.GetUserProfile( callbackFunc )
OnCompleteHandler callbackFunc
The function to call upon completion.
--------------------------------------------------------------------------------Adds an atomic field to either the game profile or the global profile. The callback object will contain a Property type in the data field.
Returns void
Together.AddAtomic( global, parentName, propertyName, propertyValue, callbackFunc )
boolean global
Pass TRUE to add the atomic entry to the global profile, FALSE to add it to the game profile
[string](#) parentNameThe name of an existing parent collection in which to add the atomic entry to
[string](#) propertyNameThe name of the atomic field to add
[string](#) propertyValueThe value of the atomic entry to apply
[OnCompleteHandler](./oncompletehandler) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Increments an existing atomic property in either the game profile or global profile without an upper limit. The callback object will contain a Property type in the data field.
Returns void
Together.IncrementAtomic( global, parentName, propertyName, callbackFunc )
boolean global
Pass TRUE to increment an entry in the global profile, FALSE to increment an entry in the game profile
[string](#) parentNameThe name of an existing parent collection containing the property
[string](#) propertyNameThe name of the property to increment
[OnCompleteHandler](./oncompletehandler) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Increments an existing atomic property in either the game profile or global profile with a passed upper limit. The callback object will contain a Property type in the data field.
Returns void
Together.IncrementAtomicWithLimit( global, parentName, propertyName, limit, callbackFunc )
boolean global
Pass TRUE to increment an entry in the global profile, FALSE to increment an entry in the game profile
[string](#) parentNameThe name of an existing parent collection containing the property
[string](#) propertyNameThe name of the property to increment
[number](#) limitThe upper limit of the atomic operation as an integer
[OnCompleteHandler](./oncompletehandler) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Increments an existing atomic property in either the game profile or global profile with a reference to a limit elsewhere in the profile. The callback object will contain a Property type in the data field.
Returns void
Together.IncrementAtomicWithLimitRef( global, parentName, propertyName, refParent, refProperty, callbackFunc )
boolean global
Pass TRUE to increment an entry in the global profile, FALSE to increment an entry in the game profile
[string](#) parentNameThe name of an existing parent collection containing the property
[string](#) propertyNameThe name of the property to increment
[string](#) refParentThe name of the parent collection containing the property to be used as the limit
[string](#) refPropertyThe name of the property in the referenced parent to be used as the limit
[OnCompleteHandler](./oncompletehandler) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Registers the User with Facebook. TogetherSocialFacebook:Login() calls this method upon successfully logging into facebook.
Returns void
Together.RegisterFacebook( facebookID, name, firstName, lastName, link, username, gender, locale, The )
string facebookID
The FacebookID of the facebook user.
[string](#) nameThe name of the facebook user.
[string](#) firstNameThe first name of the facebook user.
[string](#) lastNameThe last name of the facebook user.
[string](#) linkThe link to the facebook user.
[string](#) usernameThe username of the facebook user.
[string](#) genderThe gender of the facebook user.
[string](#) localeThe locale of the facebook user.
[OnCompleteHandler](./oncompletehandler) Thefunction to call upon completion.
--------------------------------------------------------------------------------Registers the User with the custom registration system.
Returns void
Together.RegisterCustom( email, password, name, callbackFunc )
string email
The email of the Custom user.
[string](#) passwordThe password of the Custom user. This does not automatically hash the password. Use an MD5 or SHA hash before calling this.
[string](#) nameThe name of the Custom user.
[OnCompleteHandler](./oncompletehandler) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Logs out the User. If the user did not registered, this will mark the account inactive but is reactivated at the next login with the same user GUID.
Note
Currently anonymous users will NOT be deleted. However it is possible that a user cleansing system will be implemented in the future that removes unregistered accounts after 3 to 6 months of inactivity.
Returns void
Together.Logout( callbackFunc )
OnCompleteHandler callbackFunc
The function to call upon completion.
--------------------------------------------------------------------------------Registers a push enabled Device. Use by setting ApnsDeviceToken and/or GcmDeviceToken and/or WnsDeviceToken first then calling.
Note
If you are using Unity, this registratino is handled for you via the DeviceRegistrar script
Returns void
Together.RegisterPushEnabledDevice( callbackFunc )
OnCompleteHandler callbackFunc
The function to call upon completion.
--------------------------------------------------------------------------------Unregisters a push enabled Device. Use by setting ApnsDeviceToken to "0" and/or GcmDeviceToken to "0" and/or WnsDeviceToken to "0" first then calling.
Returns void
Together.UnRegisterPushEnabledDevice( callbackFunc )
OnCompleteHandler callbackFunc
The function to call upon completion.
--------------------------------------------------------------------------------Sends a push notification message.
Note
This counts towards Push Notifications on your developer account and does not count as a System Request.
Returns void
Together.SendPushNotification[1]( destUserID, notification, callbackFunc )
long destUserID
The ID of the User to send the push notification to.
[TogetherNotification](./togethernotification) notificationThe together notification data to be sent to the Together Servers.
[OnCompleteHandler](./oncompletehandler) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Sends a push notification message.
Note
This counts towards Push Notifications on your developer account and does not count as a System Request.
Returns void
Together.SendPushNotification[2]( destUserID, notification, callbackFunc )
long destUserID
The ID of the User to send the push notification to.
[string](#) notificationThe together notification data to be sent to the Together Servers.
[OnCompleteHandler](./oncompletehandler) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Pings the Server for the User as a keep-alive.
Returns void
Together.Ping( callbackFunc )
OnCompleteHandler callbackFunc
The function to call upon completion.
--------------------------------------------------------------------------------Adds an Analytic event for the User with simple options.
Returns void
Together.AddAnalytic( eventName, propName, propValue, callbackFunc )
string eventName
The name of the event to assign to the analytic record.
[string](#) propNameThe name of the property to assign to the analytic record.
[string](#) propValueThe value of the property to assign to the analytic record.
[OnCompleteHandler](./oncompletehandler) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------Adds an Analytic event for the User with extended options.
Returns void
Together.AddAnalyticEx( eventName, propertyCollection, callbackFunc )
string eventName
The name of the event to assign to the analytic record.
[PropertyCollection](./propertycollection) propertyCollectionCollection of data to add to the event record
[OnCompleteHandler](./oncompletehandler) callbackFuncThe function to call upon completion.
--------------------------------------------------------------------------------