bgammon/command.go

60 lines
2.7 KiB
Go
Raw Normal View History

2023-07-31 23:46:28 +00:00
package bgammon
2023-08-04 05:29:54 +00:00
type Command string
const (
2023-12-14 03:04:02 +00:00
CommandLogin = "login" // Log in with username and password, or as a guest.
CommandLoginJSON = "loginjson" // Log in with username and password, or as a guest, and enable JSON messages.
CommandRegister = "register" // Register an account.
CommandRegisterJSON = "registerjson" // Register an account and enable JSON messages.
CommandResetPassword = "resetpassword" // Request password reset link via email.
2023-12-15 07:20:50 +00:00
CommandPassword = "password" // Change password.
2023-12-15 08:23:45 +00:00
CommandSet = "set" // Change account setting.
2023-12-16 07:27:24 +00:00
CommandReplay = "replay" // Retrieve replay.
2023-12-20 00:26:05 +00:00
CommandHistory = "history" // Retrieve match history.
2023-12-14 03:04:02 +00:00
CommandHelp = "help" // Print help information.
CommandJSON = "json" // Enable or disable JSON formatted messages.
CommandSay = "say" // Send chat message.
CommandList = "list" // List available matches.
CommandCreate = "create" // Create match.
CommandJoin = "join" // Join match.
CommandLeave = "leave" // Leave match.
CommandDouble = "double" // Offer double to opponent.
CommandResign = "resign" // Decline double offer and resign 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.
CommandRematch = "rematch" // Confirm checker movement and pass turn to next player.
CommandBoard = "board" // Print current board state in human-readable form.
CommandPong = "pong" // Response to server ping.
CommandDisconnect = "disconnect" // Disconnect from server.
CommandBroadcast = "broadcast" // Send a message to all players.
CommandShutdown = "shutdown" // Prevent the creation of new matches.
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-12-15 08:23:45 +00:00
EventTypeSettings = "settings"
2023-12-16 07:27:24 +00:00
EventTypeReplay = "replay"
2023-12-20 00:26:05 +00:00
EventTypeHistory = "history"
2023-08-27 02:47:12 +00:00
)