24 lines
700 B
Go
24 lines
700 B
Go
package model
|
|
|
|
type Message struct {
|
|
Type string `json:"type"`
|
|
Seq int `json:"seq,omitempty"`
|
|
Timestamp int64 `json:"timestamp,omitempty"`
|
|
Payload map[string]interface{} `json:"payload,omitempty"`
|
|
}
|
|
|
|
type PlayerInfo struct {
|
|
PlayerID string `json:"player_id"`
|
|
Nickname string `json:"nickname"`
|
|
IsReady bool `json:"is_ready"`
|
|
IsHost bool `json:"is_host"`
|
|
}
|
|
|
|
type RoomState struct {
|
|
RoomID string `json:"room_id"`
|
|
State string `json:"state"`
|
|
HarmonyTarget int `json:"harmony_target"`
|
|
Players []PlayerInfo `json:"players"`
|
|
YourPlayerID string `json:"your_player_id"`
|
|
}
|