bgammon/command.go

46 lines
1.7 KiB
Go
Raw Normal View History

2023-07-31 23:46:28 +00:00
package bgammon
// commands are always sent TO the server
2023-08-04 05:29:54 +00:00
type Command string
const (
2023-08-21 04:21:49 +00:00
CommandLogin = "login" // Log in with username and password, or as a guest.
2023-08-27 02:47:12 +00:00
CommandLoginJSON = "loginjson" // Log in with username and password, or as a guest, and enable JSON messages.
2023-08-21 04:21:49 +00:00
CommandHelp = "help" // Print help information.
2023-08-23 00:05:35 +00:00
CommandJSON = "json" // Enable or disable JSON formatted messages.
2023-08-21 04:21:49 +00:00
CommandSay = "say" // Send chat message.
CommandList = "list" // List available games.
CommandCreate = "create" // Create game.
CommandJoin = "join" // Join game.
CommandLeave = "leave" // Leave game.
CommandRoll = "roll" // Roll dice.
CommandMove = "move" // Move checkers.
CommandReset = "reset" // Reset checker movement.
CommandOk = "ok" // Confirm checker movement and pass turn to next player.
2023-08-23 00:05:35 +00:00
CommandBoard = "board" // Print current board state in human-readable form.
2023-08-27 06:44:41 +00:00
CommandPong = "pong" // Response to server ping.
2023-08-21 04:21:49 +00:00
CommandDisconnect = "disconnect" // Disconnect from server.
2023-08-04 05:29:54 +00:00
)
2023-08-27 02:47:12 +00:00
type EventType string
const (
2023-08-27 06:44:41 +00:00
EventTypeWelcome = "welcome"
2023-08-27 21:10:18 +00:00
EventTypeHelp = "help"
2023-08-27 06:44:41 +00:00
EventTypePing = "ping"
EventTypeNotice = "notice"
EventTypeSay = "say"
EventTypeList = "list"
EventTypeJoined = "joined"
EventTypeFailedJoin = "failedjoin"
2023-08-27 21:10:18 +00:00
EventTypeLeft = "left"
2023-08-27 06:44:41 +00:00
EventTypeBoard = "board"
EventTypeRolled = "rolled"
2023-08-27 21:10:18 +00:00
EventTypeFailedRoll = "failedroll"
2023-08-27 06:44:41 +00:00
EventTypeMoved = "moved"
2023-08-27 21:10:18 +00:00
EventTypeFailedMove = "failedmove"
EventTypeFailedOk = "failedok"
2023-09-08 06:35:27 +00:00
EventTypeWin = "win"
2023-08-27 02:47:12 +00:00
)