The USC Multiplayer server uses JSON packets with topics.
Each packet consists of a serialized JSON object with a topic field. This topic field will direct the packet to the correct subscriber.
This documentation lists defined topics for both the server and the client as well as their fields and other information.
To see how to JSON send packets over the network see tcp_protocol.md
These are the packets the server sends to the client
| Field | Type | Label | Description |
| users | Types.gamescore | repeated |
|
Sent to users in a room when the game has started
| Field | Type | Label | Description |
| hard | bool | True if the user has excessive rate enabled |
|
| mirror | bool | True if the user has mirror enabled |
Tells the client to start the song (all players are synced)
| Field | Type | Label | Description |
| users | Types.user | repeated | Information about the players in the match |
Sent to users when a room has been changed
| Field | Type | Label | Description |
| users | Types.user | repeated | List of users in the room |
| do_rotate | bool | Whether the room rotates host or not |
|
| start_soon | bool | Set to true if the game is about to start |
|
| song | string | Folder name of the current song |
|
| diff | uint32 | Index of the current selected difficulty |
|
| level | uint32 | Level of the current selected difficulty |
|
| hash | string | Selective hash of the audio file (0x8000 bytes) *Deprecated* |
|
| audio_hash | string | Selective hash of the audio file (0x8000 bytes) |
|
| chart_hash | string | Normalized hash of chart file (see USC for more details) |
|
| host | string | The UUID of the current host If the room is currently in game, this field is not present |
|
| hard_mode | bool | Whether the current user has excessive rate enabled or not |
Sent on a fatal error. The server will most likely disconnect the user after this
| Field | Type | Label | Description |
| error | string | Description of the error |
List of the current lobby rooms
Sent when lobbies change
| Field | Type | Label | Description |
| version | string | Version of the server |
|
| userid | string | UUID of the current user |
|
| refresh_rate | int32 | The refresh rate of the scoreboard (how often to send scores) |
Sent when the wrong password was used for a room
Sent in response to server.room.join
| Field | Type | Label | Description |
| room | Types.room | The room that has been joined |
| Field | Type | Label | Description |
| rooms | Types.room | repeated | List of lobbies on the server |
These are types used by packets
Note: These are not message topics!
| Field | Type | Label | Description |
| id | string | The UUID of the user this score belongs to |
|
| name | string | The display name of the user this score belongs to |
|
| score | int32 | The value of the score |
| Field | Type | Label | Description |
| id | string | The UUID of the room |
|
| current | int32 | Number of users currently in the room |
|
| max | int32 | Max number of users for the room |
|
| name | string | Name of the room |
|
| ingame | bool | Whether the room is current in game |
|
| password | bool | Set if the room has a password |
|
| join_token | string | Token that can be used to join a room without a password |
| Field | Type | Label | Description |
| id | string | The UUID of this user |
|
| name | string | The display name of the user |
|
| ready | bool | Whether the user is ready or not |
|
| missing_map | bool | Whether the user is missing the song or not |
|
| level | int32 | User's selected level for the current song |
|
| score | int32 | User's last final score |
|
| combo | int32 | User's last max combo |
|
| clear | int32 | User's clear status |
|
| extra_data | string | Exists if the user has provided any extra data. |