...

Source file src/code.rocket9labs.com/tslocum/bgammon/command.go

Documentation: code.rocket9labs.com/tslocum/bgammon

     1  package bgammon
     2  
     3  type Command string
     4  
     5  const (
     6  	CommandLogin         = "login"         // Log in with username and password, or as a guest.
     7  	CommandLoginJSON     = "loginjson"     // Log in with username and password, or as a guest, and enable JSON messages.
     8  	CommandRegister      = "register"      // Register an account.
     9  	CommandRegisterJSON  = "registerjson"  // Register an account and enable JSON messages.
    10  	CommandResetPassword = "resetpassword" // Request password reset link via email.
    11  	CommandPassword      = "password"      // Change password.
    12  	CommandSet           = "set"           // Change account setting.
    13  	CommandReplay        = "replay"        // Retrieve replay.
    14  	CommandHistory       = "history"       // Retrieve match history.
    15  	CommandHelp          = "help"          // Print help information.
    16  	CommandJSON          = "json"          // Enable or disable JSON formatted messages.
    17  	CommandSay           = "say"           // Send chat message.
    18  	CommandList          = "list"          // List available matches.
    19  	CommandCreate        = "create"        // Create match.
    20  	CommandJoin          = "join"          // Join match.
    21  	CommandLeave         = "leave"         // Leave match.
    22  	CommandDouble        = "double"        // Offer double to opponent.
    23  	CommandResign        = "resign"        // Decline double offer and resign game.
    24  	CommandRoll          = "roll"          // Roll dice.
    25  	CommandMove          = "move"          // Move checkers.
    26  	CommandReset         = "reset"         // Reset checker movement.
    27  	CommandOk            = "ok"            // Confirm checker movement and pass turn to next player.
    28  	CommandRematch       = "rematch"       // Confirm checker movement and pass turn to next player.
    29  	CommandBoard         = "board"         // Print current board state in human-readable form.
    30  	CommandPong          = "pong"          // Response to server ping.
    31  	CommandDisconnect    = "disconnect"    // Disconnect from server.
    32  )
    33  
    34  type EventType string
    35  
    36  const (
    37  	EventTypeWelcome     = "welcome"
    38  	EventTypeHelp        = "help"
    39  	EventTypePing        = "ping"
    40  	EventTypeNotice      = "notice"
    41  	EventTypeSay         = "say"
    42  	EventTypeList        = "list"
    43  	EventTypeJoined      = "joined"
    44  	EventTypeFailedJoin  = "failedjoin"
    45  	EventTypeLeft        = "left"
    46  	EventTypeFailedLeave = "failedleave"
    47  	EventTypeBoard       = "board"
    48  	EventTypeRolled      = "rolled"
    49  	EventTypeFailedRoll  = "failedroll"
    50  	EventTypeMoved       = "moved"
    51  	EventTypeFailedMove  = "failedmove"
    52  	EventTypeFailedOk    = "failedok"
    53  	EventTypeWin         = "win"
    54  	EventTypeSettings    = "settings"
    55  	EventTypeReplay      = "replay"
    56  	EventTypeHistory     = "history"
    57  )
    58  

View as plain text