class MAGES::Networking::MAGESNetworking¶
Overview¶
The MAGES networking module. More…
class MAGESNetworking: public MAGES::NetworkingModule { public: // properties GameObject MessageHandlerPrefab; SerializableDictionaryPathReferences; SerializableDictionary PathToGameObject; SerializableDictionary PathToPrefabID; // methods override bool EstablishConnectionToMainServer(string args); override void DisconnectFromMainServer(); override bool CreateRoom(string roomName); override bool JoinRoom(string roomName = null); override bool ExitCurrentRoom(); override List GetAvailableRooms(); override string GetCurrentConnectedRoom(); override void OnDisconnected(string cause); override void OnConnected(string info); override bool OwnershipRequest(MAGESObject obj); override bool LinkNetworkObject(GameObject remotePrefab, GameObject localPrefab); override GameObject NetworkSpawn( GameObject prefab, Transform prefabParent = null, bool isUnique = true ); override void RemoteDestroyComponent( GameObject gameObject, string componentType ); override void RequestChangeState(byte changeState, string actionID); override int GetConnectedUsersToRoom(string roomName); override int GetConnectedUsersToCurrentRoom(); override void AddSyncTransform(GameObject objectToBeSynchronized); override bool HasAuthority(GameObject networkObject); override void RegisterActivatedObject( GameObject grabbableObject, bool isActivated ); override bool IsRemoteActivated(GameObject grabbableObject); override void Startup(); override int GetPrefabIDFromNetwork(GameObject prefab, out bool isUnique); override void Shutdown(); override int GetLocalPlayerID(); override IEnumerable<PlayerDescription> GetConnectedPlayers(); override void SyncMessage(GameObject netObject, string message); override void AddMessageRemoteAction( GameObject netObject, UnityAction action ); override void NetworkButtonAction( GameObject networkObject, UnityAction action, int index ); override void InvokeButtonRemoteCalls(GameObject networkObject, int index); override void AddInteractableNetworkingEvents(GameObject interactable); };
Inherited Members¶
public: // classes class PlayerDescription; // properties int Version; bool AutomaticSceneSetup; Type NetworkIdType; IMAGESNetworkIntegration Integration; bool IsInitialized; bool IsHost; UnityEventOnUserConnected; UnityEvent OnUserDisconnected; UnityEvent OnUserOwnedGameObjectSpawned; UnityEvent OnConnectedToRoom; // methods void Startup(); void Shutdown(); virtual void UpdateModule(UpdatePhase updatePhase); bool EstablishConnectionToMainServer(string args); void DisconnectFromMainServer(); bool CreateRoom(string roomName); bool JoinRoom(string roomName = null); bool ExitCurrentRoom(); List GetAvailableRooms(); string GetCurrentConnectedRoom(); void OnDisconnected(string cause); void OnConnected(string info); bool OwnershipRequest(MAGESObject obj); int GetPrefabIDFromNetwork(GameObject prefab, out bool isUnique); bool LinkNetworkObject(GameObject networkPrefab, GameObject localPrefab); GameObject NetworkSpawn( GameObject prefab, Transform prefabParent = null, bool spawnedByHost = true ); void RemoteDestroyComponent(GameObject gameObject, string componentType); void RequestChangeState(byte changeState, string actionID); int GetConnectedUsersToRoom(string roomName); int GetConnectedUsersToCurrentRoom(); void AddSyncTransform(GameObject objectToBeSynchronized); void SyncMessage(GameObject netObject, string message); void AddMessageRemoteAction(GameObject netObject, UnityAction action); void RegisterActivatedObject(GameObject grabbableObject, bool isActivated); bool IsRemoteActivated(GameObject grabbableObject); bool HasAuthority(GameObject networkObject); int GetLocalPlayerID(); void NetworkButtonAction( GameObject networkObject, UnityAction action, int index ); void InvokeButtonRemoteCalls(GameObject networkObject, int index); void AddInteractableNetworkingEvents(GameObject interactable); IEnumerable<PlayerDescription> GetConnectedPlayers();
Detailed Documentation¶
The MAGES networking module.
Properties¶
GameObject MessageHandlerPrefab
Gets the network prefab responsible for synchronizing the game state and exchanging messages between users.
SerializableDictionaryPathReferences
Gets the map of gameobject references to prefab paths.
SerializableDictionaryPathToGameObject
Gets the map of gameobject references to prefab paths.
SerializableDictionaryPathToPrefabID
Gets the map of prefab paths to local prefab IDs.