OnMatchInGameAccess
public MatchInGameAccessEventHandler OnMatchInGameAccess;
Argument
Value | Type | Description |
---|---|---|
args | MatchInGameSessionEventArgs | Battle history of connected users |
MatchInGameSessionEventArgs
Value | Type | Description |
---|---|---|
ErrInfo | ErrorCode | Error information |
Reason | string | Error information |
GameRecord | MatchUserGameRecord | Session's information(Session ID, nickname, battle history, etc.) |
Description
This event is called whenever a user enters a game room.
- It is called to the entered user(self).
- It is called to all users who have already connected to the game room.
In order for an event to be called, the message sending/receiving method must be called.
Event calling rules
Information of the entered user is included in GameRecord.
- When there are Users A, B, and C
- If User A connects to the room, the OnMatchInGameAccess event handler that contains User A's GameRecord is called.
- If User A is connected to the room and User B connects to the room, OnMatchInGameAccess event handler that contains User B's GameRecord is called to User A and B.
- After that, if User C enters the room, OnMatchInGameAccess event handler that contains User C's GameRecord is called to User A, B, and C.
Example
Backnd.Match.OnMatchInGameAccess = (MatchInGameSessionEventArgs args) => {
// TODO
};
Argument cases
When connection to the in-game room is established
ErrInfo : ErrorCode.Success
GameRecord : "connected user's battle history"
When the user tries to connect to a room that is not the matched room
ErrInfo : ErrorCode.Match_InGame_AuthroizeFailed
Reason : Internal server error.
When the user failed to connect to the room
ErrInfo : ErrorCode.Exception
Reason : "reason for failure"