Click or drag to resize

GameLiftManagerGameController Class

An internal class used to handle data packets incoming from the GameLift Realtime Server. It should be noted that the order in which a packet is created matters. The order should be as follows so that it can be decoded here properly. Amount of data pieces (e.g., 2), the lengths in bytes of these data pieces (e.g., 4,4), and the data themselves converted to byte format (e.g., 4,4). If you follow how ASLObject functions already create these data packets then you will be following the correct formatting. The important thing to remember is that however you encode a packet, you must remember to decode in the same manner.
Inheritance Hierarchy
SystemObject
  ASLGameLiftManagerGameController

Namespace:  ASL
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
private class GameController

The GameLiftManagerGameController type exposes the following members.

Constructors
  NameDescription
Public methodGameLiftManagerGameController
Initializes a new instance of the GameLiftManagerGameController class
Top
Methods
  NameDescription
Public methodAllClientsFinishedResolvingCloudAnchor
Is called when all clients have finished resolving a cloud anchor
Private methodConvertByteArrayIntoBool
Converts a byte array into a boolean variable
Private methodConvertByteArrayIntoFloatArray
Converts a byte array into a float array
Private methodConvertByteArrayIntoInt
Converts a byte array into an int
Public methodConvertByteArrayIntoString
Converts a byte array into a string
Private methodConvertByteArrayIntoVector
Converts a byte array into a vector3 or 4 depending on the vector size sent
Private methodConvertFloatArrayIntoVector3Array
Converts a float array into a vector3 array
Public methodDataLengthsAndStartLocations
Gathers the length and start location of the data inside a byte array
Public methodDeleteObject
Destroys an ASL Object based upon its ID. This function is triggered by a packet received from the relay server.
Private methodGetDataCount
Gets the amount of data pieces in a byte array by looking at the first number in the byte array
Private methodGetDataLengths
The data lengths of each data piece in the byte array
Private methodGetPartOfByteArray
Returns the specified part of a byte array without converting it into anything else
Private methodGetStartLocations
Gets the start locations of the data pieces in the byte array
Public methodIncrementLocalPosition
Updates the local transform of an ASL Object based upon its ID by taking the value passed and adding it to the current localPosition value. This function is triggered by a packet received from the relay server.
Public methodIncrementLocalRotation
Updates the local rotation of an ASL Object based upon its ID. This function is triggered by a packet received from the relay server.
Public methodIncrementLocalScale
Updates the local scale of an ASL Object based upon its ID by taking the value passed in and adding it to the current localScale value. This function is triggered by a packet received from the relay server.
Public methodIncrementWorldPosition
Updates the world transform of an ASL Object based upon its ID by taking the value passed and adding it to the current localPosition value. This function is triggered by a packet received from the relay server.
Public methodIncrementWorldRotation
Updates the world rotation of an ASL Object based upon its ID. This function is triggered by a packet received from the relay server.
Public methodIncrementWorldScale
Updates the world scale of an ASL Object based upon its ID by taking the value passed in and adding it to the current scale value by setting its parent to null and then reassigning its parent after setting the scale you want it to have. This function is triggered by a packet received from the relay server.
Private methodInitializeStartObject
Upon game start, any ASL Objects in the scene do not have synchronized IDs. This function changes their ID to be synced with other clients
Public methodObjectClaimReceived
Get the claim to an object that was previously owned by another player. This function is triggered by a packet received from the relay server.
Public methodReceiveARPlaneAsMesh
Is called when someone sends an AR Plane's vertices. This transforms the byte[] of the float[] of vertices of the sent Mesh into a Vector3[] to create a Mesh from.
Public methodRecieveTexture2D
Is called when someone sends a Texture2D. This transforms the byte[] of the Texture2D into a Texture2D and calls the function associated with this sent Texture2D if one exists and async start is enabled. If sync start is enabled instead, then it informs the relay server that is has successfully recreated the image and is ready to execute its function.
Public methodRejectClaim
Reject a player's claim request on an ASL Object. This function is triggered by a packet received from the relay server.
Public methodReleaseClaimedObject
Releases an object so another user can claim it. This function will also call this object's release function if it exists. This function is triggered by a packet received from the relay server.
Public methodResolveAnchorId
Packet informing user to start trying to resolve a cloud anchor
Public methodSentFloats
Pass in the float value(s) from the relay server to a function of the user's choice (delegate function). The function that uses these float(s) is determined by the user by setting the ASL Object of choosing's m_FloatCallback function to their own personal function. This function is triggered by a packet received from the relay server. Remember, though the user can pass in a float array, the max size of this array is 4 because we send it via a Vector4 due to GameSpark constraints
Public methodSetAnchorID
Updates the Anchor Point of an ASL Object based upon its ID. The anchor point is used for AR applications. This function is triggered by a packet received from the relay server.
Public methodSetLocalPosition
Updates the local transform of an ASL Object based upon its ID. This function is triggered by a packet received from the relay server.
Public methodSetLocalRotation
Updates the local rotation of an ASL Object based upon its ID. This function is triggered by a packet received from the relay server.
Public methodSetLocalScale
Updates the local scale of an ASL Object based upon its ID. This function is triggered by a packet received from the relay server.
Public methodSetObjectClaim
Finds and claims a specified object and updates everybody's permission for that object. This function is triggered by a packet received from the relay server.
Public methodSetObjectColor
Sets the object specified by the id contained in _packet to the color specified in _packet. This function is triggered by a packet received from the relay server.
Public methodSetObjectID
Looks for and assigns any ASLObjects that do not have a unique ID yet. This ID is given through the relay server. This function is triggered by a packet received from the relay server. This function will keep the time scale at 0 until all ASL objects have a proper ID
Public methodSetObjectTag
Updates the tag of an ASL Object based upon its ID. Remember that this tag must be defined by all players. This function is triggered by a packet received from the relay server.
Private methodSetParent
Sets an object's parent based upon that object's ID or name. Preferably ID as it's a lot faster
Private methodSetupSynchronizingASLObjectScreen
Used to setup the canvas screen that informs users that ASL objects are syncing
Public methodSetWorldPosition
Updates the world position of an ASL Object based upon its ID. This function is triggered by a packet received from the relay server.
Public methodSetWorldRotation
Updates the world rotation of an ASL Object based upon its ID. This function is triggered by a packet received from the relay server.
Public methodSetWorldScale
Updates the world scale of an ASL Object based upon its ID by setting its parent to null and then reassigning its parent after setting the scale you want it to have. This function is triggered by a packet received from the relay server.
Public methodSpawnPrefab
This function spawns a prefab object with ASL attached as a component. This function is triggered by a packet received from the relay server.
Public methodSpawnPrimitive
This function spawns a primitive object with ASL attached as a component. This function is triggered by a packet received from the relay server.
Public methodStart
Start function that states any scene loaded will call the SyncronizeId function, ensuring all ASL objects are synced upon scene loads
Private methodSyncronizeID
Find all ASL Objects in the scene and have the relay server create a unique ID for them as well as add this object to our ASLObject dictionary This function is triggered when this script is first loaded. This function will keep the timeScale at 0 until all objects have been ID. All objects are ID in the SetObjectID(RTPacket _packet) function.
Private methodTriangulateMesh
Triangulates Mesh based on vertices.
Top
Fields
  NameDescription
Private fieldawaitingInstantiation
Private fieldm_ObjectIDAssignedCount
Used to count how many objects have been assigned an ID yet
Private fieldm_PauseCanvas
The pause canvas that is shown while waiting for objects to be synced
Private fieldm_PauseText
The pause text that is shown while waiting for objects to be synced
Private fieldReceivedTexture2Ds
Dictionary containing the received Texture2Ds that are being rebuilt as new packets come in.
Top
See Also

Reference