You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
825 B
53 lines
825 B
1 year ago
|
package gameServer
|
||
|
|
||
|
const (
|
||
|
Auth string = "Auth"
|
||
|
Message string = "Message"
|
||
|
PlayerAction string = "PlayerAction"
|
||
|
System string = "System"
|
||
|
Lobby string = "Lobby"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
OK int = 200
|
||
|
|
||
|
LobbyListRequest int = 201
|
||
|
LobbyListAnswer int = 202
|
||
|
|
||
|
BadRequest int = 400
|
||
|
Forbidden int = 403
|
||
|
Unauthorized = 401
|
||
|
|
||
|
InternalServerError int = 500
|
||
|
)
|
||
|
|
||
|
/*
|
||
|
Status:
|
||
|
200 - OK
|
||
|
201 - Lobby List Request
|
||
|
202 - Lobby List Answer
|
||
|
|
||
|
|
||
|
400 - Bad request
|
||
|
403 - Forbidden
|
||
|
401 - Unauthorized
|
||
|
|
||
|
500 - Internal server error
|
||
|
|
||
|
*/
|
||
|
|
||
|
type Packet struct {
|
||
|
Type string "json:`Type`"
|
||
|
Status int "json:`Status`"
|
||
|
Message interface{} "json:`Message`"
|
||
|
}
|
||
|
|
||
|
type AuthMsg struct {
|
||
|
Login string "json:`Login`"
|
||
|
Password string "json:`Password`"
|
||
|
}
|
||
|
|
||
|
type LobbyList struct {
|
||
|
Lobbies []Room "json:`Lobbies`"
|
||
|
}
|