Click or drag to resize

GameLiftManager Class

The class that makes all multiplayer possible
Inheritance Hierarchy
SystemObject
  Object
    Component
      Behaviour
        MonoBehaviour
          ASLGameLiftManager

Namespace:  ASL
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
public class GameLiftManager : MonoBehaviour

The GameLiftManager type exposes the following members.

Constructors
  NameDescription
Private methodStatic memberGameLiftManager
Public methodGameLiftManager
Initializes a new instance of the GameLiftManager class
Top
Properties
  NameDescription
Public propertym_Client
The AWS client variable that allows a connection to and the ability to communicate with GameLift
Public propertym_GameSessionName
The name of the game session the user is currently in
Public propertym_GroupId
The group ID used to communicate with all users
Public propertym_NullCallbackIdInString
A value for callback id in string format when the given null as callback.
Public propertym_Packet
Public propertym_PeerId
This current user's peerId
Public propertym_ServerId
The id of the server, used to send messages to the server
Public propertym_Username
This current user's username
Top
Methods
  NameDescription
Private methodAddPlayerToList
Adds a player to the player list for this session
Private methodAddPlayerToLobbyUI
Private methodAllPlayersReady
Public methodAmHighestPeer
Returns true if the caller is the highest peer id user in the match. This is a good way to assign a "Host" player if desired. Though do keep in mind that ASL is a P2P network.
Public methodAmLowestPeer
Returns true if the caller is the lowest peer id user in the match. This is a good way to assign a "Host" player if desired. Though do keep in mind that ASL is a P2P network.
Private methodAnchorIDUpdate
Private methodAwake
The Awake function, called right after object creation. Used to communicate that this object should not be destroyed between scene loads
Private methodClaim
Private methodClaimFromPlayer
Public methodCombineByteArrays
Combines byte arrays so they can be sent as one byte array to other users. Can be called with 2 or more byte[] arguments. Note that this method supports a variable number of arguments.
Public methodCombineByteArrayWithoutLengths
Combines byte arrays so they can be sent as one byte array to other users
Public methodConvertBoolToByteArray
Converts a bool into a byte array
Public methodStatic memberConvertColorArrayToFloatArray
Converts a Color array into a float array
Public methodConvertFloatArrayToByteArray
Converts a float array into a byte array
Public methodStatic memberConvertFloatArrayToColorArray
Converts a float array into a Color array
Public methodStatic memberConvertFloatArrayToVector3Array
Converts a float array into a Vector3 array
Public methodConvertIntToByteArray
Converts an int into a byte array
Public methodConvertVector3ArrayToFloatArray
Converts a vector3 array into a float array
Public methodConvertVector3ToByteArray
Converts a vector3 variable into a byte array
Public methodConvertVector4ToByteArray
Converts a Vector4 variable into a byte array
Public methodCreateRTMessage
Creates an RealTime message to be sent to other users
Private methodDeleteObject
Private methodDestroyLobbyManager
Destroys the LobbyManager internal class to free up space after a game is started
Public methodDisconnectFromServer
Disconnects the user from the GameLift servers if they are connected
Public methodDoOpFunctionCallback(String)
Gets the corresponding callback without parameter function with the given OpCode and callback id from the dictionary. Removes the callback function after it has been invoked.
Public methodDoOpFunctionCallback(String, GameObject)
Gets the corresponding callback function with the given OpCode and callback id from the dictionary. Removes the callback function after it has been invoked.
Public methodGenerateOpFunctionCallbackKey
Generates a unique callback id for a callback function.
Public methodGetHighestPeerId
Returns the current highest peerID value out of all the currently connected players
Public methodStatic memberGetInstance
Used to get the Singleton instance of the GameLiftManager class
Public methodGetLowestPeerId
Returns the current lowest peerID value out of all the currently connected players
Private methodIncrementLocalPosition
Private methodIncrementLocalRotation
Private methodIncrementLocalScale
Private methodIncrementWorldPosition
Private methodIncrementWorldRotation
Private methodIncrementWorldScale
Private methodKeepConnectionAlive
Sends an empty packet to the server to help maintain the android socket
Private methodLaunchScene
Private methodLoadScene
Private methodLobbyTextMessage
Private methodOnApplicationPause
Used to make sure Android devices can disconnect from the GameLift servers. This function will quit the application when it loses focus e.g., when you exit the app to the home screen. Doing so is a good thing and prevents hanging connections.
Private methodOnApplicationQuit
Called when an application quits, ensuring the user cleanly exits the GameLift server
Private methodOnCloseEvent
An AWS listener function that is called when a connection is ended with GameLift
Private methodOnConnectionErrorEvent
An AWS listener function that is called when there is a connection error event
Private methodOnDataReceived
An AWS listener function that gets called every time a packet is received. Directly invokes the OpCode function corresponding to the OpCode number, determined by the OpCode enum.
Private methodOnOpenEvent
An AWS listener function that is called when a connection is opened
Private methodPlayerDisconnected
Private methodPlayerDisconnectedBeforeMatchStart
Private methodPlayerJoinedMatch
Private methodQForMainThread(Action)
Queue a function to be called on the Unity thread that contains no parameters
Private methodQForMainThreadT1(ActionT1, T1)
Queue a function to be called on the Unity thread that contains 1 parameter
Private methodQForMainThreadT1, T2(ActionT1, T2, T1, T2)
Queue a function to be called on the Unity thread that contains 2 parameters
Private methodQForMainThreadT1, T2, T3(ActionT1, T2, T3, T1, T2, T3)
Queue a function to be called on the Unity thread that contains 3 parameters
Private methodQForMainThreadT1, T2, T3, T4(ActionT1, T2, T3, T4, T1, T2, T3, T4)
Queue a function to be called on the Unity thread that contains 4 parameters
Private methodQForMainThreadT1, T2, T3, T4, T5(ActionT1, T2, T3, T4, T5, T1, T2, T3, T4, T5)
Queue a function to be called on the Unity thread that contains 5 parameters
Private methodQForMainThreadT1, T2, T3, T4, T5, T6(ActionT1, T2, T3, T4, T5, T6, T1, T2, T3, T4, T5, T6)
Queue a function to be called on the Unity thread that contains 6 parameters
Private methodRejectClaim
Private methodReleaseClaimToPlayer
Public methodRemoveOpFunctionCallbackByCallbackId
Removes the corresponding callback function by the given callback id from the dictionary.
Public methodRemoveOpFunctionCallbackNoParamByCallbackId
Removes the corresponding callback function without parameter by the given callback id from the dictionary.
Private methodRemovePlayerFromList
Removes a player from the player list for this session. Happens when a player disconnects. It calls reassign function to reassign the physics master for the game if the leaving player was the master.
Private methodResolveAnchorId
Private methodResolvedCloudAnchor
Private methodRunMainThreadQueueActions
Locks and executes any functions that have been added to the QForMainThread queue. Is continuously called from this class's Update function
Private methodSendARPlaneAsMesh
Private methodSendFloats
Private methodSendTexture2D
Private methodServerSetId
Private methodSetLocalPosition
Private methodSetLocalRotation
Private methodSetLocalScale
Private methodSetObjectColor
Public methodSetOpFunctionCallback(GameLiftManagerOpFunctionCallback)
Generate callback id with given information. save the callback with generated id as the key into dictionary
Public methodSetOpFunctionCallback(GameLiftManagerOpFunctionCallbackNoParam)
Generate callback id with given information. save the callback with generated id as the key into dictionary
Public methodSetOpFunctionCallback(GameLiftManagerOpFunctionCallback, String)
Adds the given callback function with the given OpCode as the key into the dictionary
Public methodSetOpFunctionCallback(GameLiftManagerOpFunctionCallbackNoParam, String)
Adds the given callback function without parameter with the given OpCode as the key into the dictionary
Public methodSetOpFunctionCallbackString(GameLiftManagerOpFunctionCallback)
Generate callback id with given information. save the callback with generated id as the key into dictionary
Public methodSetOpFunctionCallbackString(GameLiftManagerOpFunctionCallbackNoParam)
Generate callback id with given information. save the callback with generated id as the key into dictionary
Public methodSetPhysicsMasterId
Assigns the given peer id to physics master's id.
Private methodSetWorldPosition
Private methodSetWorldRotation
Private methodSetWorldScale
Private methodSpawnPrefab
Private methodSpawnPrimitive
Public methodSpiltByteArray
Splits up a single byte array, returning only the section requested
Private methodStart
The start function called upon object creation but after Awake, used to initialize internal classes and setup the singleton for this class
Private methodStartPacketStream
Starts the coroutine that will send an empty packet to the relay server every second to help maintain the Android connection
Private methodTagUpdate
Private methodUpdate
Update is called once per frame and in this case is used to ensure any function triggered by AWS is ran by the main Unity thread
Top
Fields
  NameDescription
Public fieldStatic memberm_callbackIdIndex
The index value for callback id in data payload.
Private fieldm_GameController
Internal class used to decoded packets received from the AWS
Private fieldStatic memberm_Instance
The singleton instance for this class
Private fieldm_LobbyManager
Internal class used to setup and connect users to each other
Private fieldm_MainThreadQueue
The queue that will hold all of the functions to be triggered by AWS events
Public fieldStatic memberm_NullCallbackId
A value for callback id when the given null as callback.
Private fieldm_PhysicsMasterId
The peer id of the current selected physics master
Public fieldm_Players
Dictionary containing the all users that are connected peerIds and usernames
Private fieldm_SceneLoader
Internal class used to load scenes for all users
Private fieldm_StreamActive
Flag indicating whether or not we have activated the KeepConnectionAlive() coroutine so it doesn't get activated more than once
Public fieldOpCodeFunctions
Array of OpCode function references executed when a packet is received with the corresponding OpCode. null entries in the array are OpCodes that currently have no action within this script when received, but may have other action elsewhere or are automatically sent.
Public fieldOpFunctionCallbacks
Dictionary containing the all callbacks that are connected OpFunction's OpCode
Public fieldOpFunctionCallbacksNoParam
Dictionary containing the all callbacks without parameter that are connected OpFunction's OpCode
Top
See Also

Reference