mirror of
https://github.com/tiennm99/gomoku.git
synced 2026-06-01 08:13:00 +00:00
1b9eec5f7d
- Module: github.com/ratel-online/server → github.com/tiennm99/gomoku/server
- Copied core/{log,util/async,util/json,util/strings,model,network,protocol,consts}
into server/pkg/* (temporary shims until phase-05 replaces protocol/network)
- Rewrote all ratel-online import paths across server/**/*.go
- Trimmed main.go: single -p flag, WS-only on :1999, no TCP/bot/static
- Trimmed network/wss.go: endpoint /gomoku, no static file serving
- Updated Makefile: removed TCP/bot references, port 1999
60 lines
1.1 KiB
Go
60 lines
1.1 KiB
Go
package model
|
|
|
|
// AuthInfo is sent by the client on first connection to identify itself.
|
|
type AuthInfo struct {
|
|
ID int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Score int64 `json:"score"`
|
|
}
|
|
|
|
type Data struct {
|
|
Code int `json:"code"`
|
|
Msg string `json:"msg"`
|
|
}
|
|
|
|
type Option struct {
|
|
ID int `json:"id"`
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
type Player struct {
|
|
ID int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Score int64 `json:"score"`
|
|
Group int `json:"group"`
|
|
Pokers int `json:"pokers"`
|
|
}
|
|
|
|
type Room struct {
|
|
ID int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Type int `json:"type"`
|
|
TypeDesc string `json:"typeDesc"`
|
|
Players int `json:"players"`
|
|
State int `json:"state"`
|
|
StateDesc string `json:"stateDesc"`
|
|
Creator int64 `json:"creator"`
|
|
}
|
|
|
|
type Options struct {
|
|
Data
|
|
Options []Option `json:"options"`
|
|
}
|
|
|
|
type RoomList struct {
|
|
Data
|
|
Rooms []Room `json:"rooms"`
|
|
}
|
|
|
|
type RoomInfo struct {
|
|
Data
|
|
Room Room `json:"room"`
|
|
Players []Player `json:"players"`
|
|
}
|
|
|
|
type RoomEvent struct {
|
|
Data
|
|
Room Room `json:"room"`
|
|
Player Player `json:"player"`
|
|
}
|