OnSessionListInServer
public MatchInGameSessionListEventHandler OnSessionListInServer;
Argument
Value | Type | Description |
---|---|---|
args | MatchInGameSessionListEventArgs | Information on the current game room |
MatchInGameSessionListEventArgs
Value | Type | Description |
---|---|---|
ErrInfo | ErrorCode | Error information |
Reason | string | Error information |
RoomInfo | MatchInGameRoomInfo | Information on the connected room |
GameRecords | List <MatchUserGameRecord> | Battle history list of users who are connected to the current game room (list of battle history of each session) |
Description
This event handler is called when the user connects to the game room. It is called only once to that user.
It includes the session information and matching record of users who are currently connected to the game room, including yourself.
It is also called when the user reconnects to the in-game server.
In order for an event to be called, the message sending/receiving method must be called.
Event calling rules
Information of users connected to the current room + users who just entered the room is included in GameRecords.
- Users A, B, and C are matched.
- If there was no one in the game room and User A enters the room, the OnSessionListInServer event that contains only User A's GameRecord is called to User A.
- If User B connects to the room while only A is in the room, the OnSessionListInServer event that contains the GameRecords of Users A and B is called to User B.
- Finally, if User C connects to the room, the OnSessionListInServer event that contains the GameRecords of Users A, B, and C is called to User C.
Example
Backend.Match.OnSessionListInServer = (MatchInGameSessionListEventArgs args) => {
// TODO
};
Argument cases
When a user enters the game room(called only to the entered user)
ErrInfo : ErrorCode.Success
RoomInfo : "room Information"
GameRecords : information on the currently-connected users
When a user fails to connect to the game room
It is not called.