Room Manager Base

This abstract class provides network-based room management functionality. This class also includes the management of scenes.

Serialize Members

  • bool _dontDestroyOnLoad:

    • Specifies whether the room manager will be destroyed during scene changes.

  • LocalPhysicsMode _physicsMode:

    • Represents the native physics mode (3D or 2D).

  • string _lobbyScene:

    • The name of the lobby scene where the players enter.

  • string _roomScene:

    • The name of the room scene.

  • RoomData_SO _defaultRoomData:

    • A ScriptableObject containing the default room data.

General Members

  • public static RoomManagerBase Singleton:

    • Represents a single instance of RoomManagerBase.

  • public LocalPhysicsMode PhysicsMode:

    • Returns the native physics mode.

  • public RoomData_SO RoomData:

    • Returns room data.

  • public string LobbyScene:

    • Returns the name of the lobby scene.

  • public string RoomScene:

    • Returns the name of the room scene.

Methods

    • This method is run at wakeup time of a class inherited from MonoBehaviour. In this case, the RoomManagerBase class will run as soon as it wakes up. This method does the basic configuration of the room manager.

    • Function:

      • The InitializeSingleton() method is called. This method ensures that there is a single instance of the room manager and ensures that it is destroyed during scene changes when necessary.

      • The InitializeRoomLoader() method is called. This method launches the loader, which will provide the functionality to load or unload rooms.

    • This method checks if there is a single instance of the room manager. It also allows it to be destroyed during scene changes when necessary.

    • Function:

      • If _singleton already exists and belongs to this class, it completes the operation.

      • If _dontDestroyOnLoad is not set, it assigns the _singleton to this object.

      • If _singleton already exists and does not belong to this class, then it destroys the second instance to avoid conflict.

    • This method starts the room loader. This loader provides the functionality of loading or unloading chambers.

    • İşlevi:

      • The _roomLoader variable is determined by the room loading type specified in _defaultRoomData.

    • This method runs when the server is started.

    • Function:

      • The ConnectionManager.roomConnections.AddRegistersForServer() method is called. This method saves connections on the server side.

    • This method runs when the server is stopped.

    • Function:

      • The RemoveAllRoom(forced:true) method is called. This removes all rooms and links.

    • This method runs when the client is started.

    • İşlevi:

      • The ConnectionManager.roomConnections.AddRegistersForClient() method is called. This method saves connections on the client side.

    • Bu metod, istemci durdurulduğunda çalışır.

    • Function:

      • Bu metodun şu anki implementasyonunda herhangi bir işlev yok.

    • This method runs when a client connects to the server.

    • Function:

      • SendUpdateRoomListForClient(conn) method is called. This sends the available room list to the newly connected client.

      • SendConnectionMessageToClient(conn) method is called. This sends the connection ID to the connecting client.

    • This method runs when a client leaves the server.

    • Function:

      • The ExitRoom(conn, true) method is called. This removes the connecting client from the room and connections.

    • This method runs when a client connects to the server.

    • Bu metod, bir istemci sunucudan ayrıldığında çalışır.

    • This method returns a list of all rooms.

    • Function:

      • This method returns all available rooms by returning the list _rooms.

    • This method returns a list of all room information.

    • Function:

      • This method returns all available room information by returning the list _roomListInfos.

    • This method returns the room to which the specified network connection is connected.

    • Function:

      • Checks each room in the _rooms list.

      • If a link with this link is found within a room, it will rotate the room.

    • This method returns the room information to which the client is connected.

    • Function:

      • Checks each room information in the _roomListInfos list.

      • If this client's connection ID is included in a room information, it returns that room information.

    • This method returns the room in the specified scene.

    • Function:

      • Checks each room in the _rooms list.

      • If the room matches the specified scene, it returns the room.

    • This method sends a request to the server to create a new room.

    • Function:

      • If there is no network client, it terminates the process.

      • ServerRoomMessage is created and sent with this client's request.

    • This method sends a request to join the specified rooms.

    • Function:

      • If there is no network client, it terminates the process.

      • ServerRoomMessage is created and sent with this client's request.

    • This method sends a request to leave the room the client is in.

    • Function:

      • EIf there is no network client, it terminates the process.

      • ServerRoomMessage is created and sent with this client's request.

    • This method loads the specified room.

    • Function:

      • If _roomLoader is still not assigned it will throw an error.

      • Loads the room by calling the LoadRoom method of _roomLoader.

    • This method vacates the specified room.

    • Function:

      • If _roomLoader is still not assigned it will throw an error.

      • Frees the room by calling _roomLoader's UnLoadRoom method.

    • This abstract method creates a room.

    • Function:

      • How to implement this method is left to the subclasses. Therefore, derived classes must implement this method.

    • This abstract method performs the operations required to join a room.

    • Function:

      • How to implement this method is left to the subclasses. Therefore, derived classes must implement this method.

    • This abstract method removes all rooms and links.

    • Function:

      • How to implement this method is left to the subclasses. Therefore, derived classes must implement this method.

    • This abstract method removes a specified room and clears the connections.

    • Function:

      • How to implement this method is left to the subclasses. Therefore, derived classes must implement this method.

    • This abstract method handles a client leaving the room.

    • Function:

      • How to implement this method is left to the subclasses. Therefore, derived classes must implement this method.

    • This method retrieves the client's connection ID and assigns this information to the RoomClient.ID variable.

    • This method sends the connection ID message to the specified network connection.

    • This method sends a list of available rooms to a client.

    • This method sends a message to a client to load the scene when they join the room.

    • This method sends a message to a client to vacate the stage when they leave the room.

    • This method adds a room information to the rooms list.

    • This method updates a room information.

    • This method removes a room information from the rooms list.

Last updated