RoomConnections

This code defines a class called RoomConnections. This class is used to handle events related to network connections. In particular, it handles events such as room creation, joining, and leaving.

Members

  1. Server Side Events: This section defines events that may occur on the server side.

    • OnServerCreateRoom: The room creation process is triggered on the server.

    • OnServerJoinRoom: The process of joining the room is triggered on the server.

    • OnServerExitRoom: Triggered on the server to exit the room.

  2. Client Side Events: This section defines events that may occur on the client side.

    • OnClientRoomListAdd: It is called from the client to add it to the room list.

    • OnClientRoomListUpdate: Called from the client to update the room list

    • OnClientRoomListRemove: Called from the client to delete from the room list

    • OnClientConnectionMessage: Called from the client to return the connection id

    • OnClientCreatedRoom: It is called from the client when the room is created

    • OnClientJoinedRoom: It is called from the client when it joins the room.

    • OnClientRemovedRoom: Called from the client when the room is deleted

    • OnClientExitedRoom: Called from the client when leaving the room

    • OnClientFailedRoom: It is called from the client when there is an error regarding the room.

Methods

  1. AddRegistersForServer()
    1. This method records events to be used on the server side.

    2. For example, it causes the OnReceivedRoomMessageViaServer method to be run when the server creates a room.

  2. AddRegistersForClient()
    1. This method records events to be used on the client side.

    2. For example, it causes the OnReceivedRoomMessageViaClient method to be invoked when a client joins a room.

  3. OnRoomListChangeForClient()
    1. This method works when the room list changes on the client side.

    2. It triggers the OnClientRoomListAdd event if a new room is added, the OnClientRoomListUpdate event if the room is updated, and the OnClientRoomListRemove event if the room is removed.

  4. OnReceivedRoomIDViaClient()
    1. This method works when a connection message is received on the client side.

    2. Triggers the OnClientRoomIDMessage event.

  5. OnReceivedConnectionMessageViaClient()
    1. This method works when a connection message is received on the client side.

    2. Triggers the OnClientConnectionMessage event.

  6. OnReceivedRoomMessageViaServer()
    1. This method works when a room message is received on the server side.

    2. Triggers the relevant event based on the type of message.

  7. OnReceivedRoomMessageViaClient()
    1. This method works when a room message is received on the client side.

    2. Triggers the relevant event based on the type of message.

Last updated