Index

The game launched on a computer is a Client. Match is the server that manages the game rooms. Data is the server that manages player, economy, and game data.

Creating a room - Client creates a new room, PostRoomNew to Match - Contains room object - Match validates request - Match sends PostRoomNew to Data - Match stores new room in local memory ACTIVE_ROOMS - ROOM_OWNER - ROOM_NAME - PLAYERS_MAX - PLAYERS_CURRENT = 1 (Was just created, so only the owner is in the room) - HOST_IP - LAST_UPDATE

Joining a room - Client opens room browser - GetActiveRooms is sent to Match - optional filterFullRooms - Match selects rooms with most players from ACTIVE_ROOMS - Match returns active rooms to Client - list of room objects. - No IP addresses are returned yet - Client sees overview of active rooms - Client joins a room - Client sends PostRoomJoin to Match - Match validates request - If player count is not at max, Match updates PLAYERS_CURRENT in ACTIVE_ROOMS - If player is owner, update host IP in ACTIVE_ROOMS to client IP - Match returns new host IP to all clients in the room - Joining client loads room - Current clients are notified of new character at position 0,0 -

Searching for specific room

Joining an empty room - If client joins an empty room, they are automatically assigned as host - Client sends PostRoomJoin to Match - Match validates request - Match requests room data from Data - Data returns room data to Match - Match updates ACTIVE_ROOMS - Match returns room data to Client - Client is now host

Leaving a room - Client disconnects from the room - Client checks whether they are host - If they are host, they send PostRoomHostLeft to Match - If they are not host, they send PostRoomClientLeft to Match - Both contain room object, including players_current - If PLAYERS_CURRENT is 0, Match will remove this room from ACTIVE_ROOMS - Else if PLAYERS_CURRENT is not 0, Match will update PLAYERS_CURRENT in ACTIVE_ROOMS - If host left, Match will assign a new host - New host IP will be returned to all clients in the room

What is Host? - Host is the authority in the room for - Authorizing client pathfinding - relaying chat messages - updating character positions - relaying room updates

Cleaning up inactive rooms - With each room update, Match will set LAST_UPDATE to current date time - Match will check if any rooms have not been updated in the last 5 minutes - Match will remove these rooms from ACTIVE_ROOMS

Room object: - required name: string - required owner: GUID - required players_max: int - optional players_current: int - optional host_ip: string

Character object: - required name: string - required position: Vector3 - required rotation: Quaternion - required playerId: GUID - required