bgammon/command.go

48 lines
1.8 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.
2023-09-12 03:56:25 +00:00
CommandList = "list" // List available matches.
CommandCreate = "create" // Create match.
CommandJoin = "join" // Join match.
CommandLeave = "leave" // Leave match.
2023-08-21 04:21:49 +00:00
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-09-10 22:27:33 +00:00
CommandRematch = "rematch" // 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-09-19 07:32:01 +00:00
EventTypeWelcome = "welcome"
EventTypeHelp = "help"
EventTypePing = "ping"
EventTypeNotice = "notice"
EventTypeSay = "say"
EventTypeList = "list"
EventTypeJoined = "joined"
EventTypeFailedJoin = "failedjoin"
EventTypeLeft = "left"
EventTypeFailedLeave = "failedleave"
EventTypeBoard = "board"
EventTypeRolled = "rolled"
EventTypeFailedRoll = "failedroll"
EventTypeMoved = "moved"
EventTypeFailedMove = "failedmove"
EventTypeFailedOk = "failedok"
EventTypeWin = "win"
2023-08-27 02:47:12 +00:00
)