2019-03-15 04:13:42 +01:00
|
|
|
package common
|
|
|
|
|
|
|
|
type ClientDataType int
|
|
|
|
|
2019-03-22 04:01:21 +01:00
|
|
|
// Data types for communicating with the client
|
2019-03-15 04:13:42 +01:00
|
|
|
const (
|
|
|
|
CdMessage ClientDataType = iota // a normal message from the client meant to be broadcast
|
|
|
|
CdUsers // get a list of users
|
2019-03-16 19:12:25 +01:00
|
|
|
CdPing // ping the server to keep the connection alive
|
2019-03-24 14:24:57 +01:00
|
|
|
CdAuth // get the auth levels of the user
|
2019-03-29 01:01:48 +01:00
|
|
|
CdColor // get the users color
|
2019-03-30 20:23:54 +01:00
|
|
|
CdEmote // get a list of emotes
|
2019-04-13 19:12:08 +02:00
|
|
|
CdJoin // a message saying the client wants to join
|
|
|
|
CdNotify // a notify message for the client to show
|
2019-03-15 04:13:42 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
type DataType int
|
|
|
|
|
2019-03-22 04:01:21 +01:00
|
|
|
// Data types for command messages
|
2019-03-15 04:13:42 +01:00
|
|
|
const (
|
|
|
|
DTInvalid DataType = iota
|
|
|
|
DTChat // chat message
|
|
|
|
DTCommand // non-chat function
|
|
|
|
DTEvent // join/leave/kick/ban events
|
|
|
|
DTClient // a message coming from the client
|
2019-03-15 07:19:16 +01:00
|
|
|
DTHidden // a message that is purely instruction and data, not shown to user
|
2019-03-15 04:13:42 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
type CommandType int
|
|
|
|
|
|
|
|
// Command Types
|
|
|
|
const (
|
|
|
|
CmdPlaying CommandType = iota
|
|
|
|
CmdRefreshPlayer
|
|
|
|
CmdPurgeChat
|
|
|
|
CmdHelp
|
|
|
|
)
|
|
|
|
|
2019-03-16 21:15:45 +01:00
|
|
|
type CommandLevel int
|
|
|
|
|
|
|
|
// Command access levels
|
|
|
|
const (
|
2019-03-24 14:24:57 +01:00
|
|
|
CmdlUser CommandLevel = iota
|
|
|
|
CmdlMod
|
|
|
|
CmdlAdmin
|
2019-03-16 21:15:45 +01:00
|
|
|
)
|
|
|
|
|
2019-03-15 04:13:42 +01:00
|
|
|
type EventType int
|
|
|
|
|
|
|
|
// Event Types
|
|
|
|
const (
|
|
|
|
EvJoin EventType = iota
|
|
|
|
EvLeave
|
|
|
|
EvKick
|
|
|
|
EvBan
|
|
|
|
EvServerMessage
|
2019-03-19 22:03:34 +01:00
|
|
|
EvNameChange
|
|
|
|
EvNameChangeForced
|
2019-03-15 04:13:42 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
type MessageType int
|
|
|
|
|
|
|
|
// Message Types
|
|
|
|
const (
|
2019-03-16 19:37:12 +01:00
|
|
|
MsgChat MessageType = iota // standard chat
|
|
|
|
MsgAction // /me command
|
|
|
|
MsgServer // server message
|
|
|
|
MsgError // something went wrong
|
|
|
|
MsgNotice // Like MsgServer, but for mods and admins only.
|
2019-04-12 04:00:14 +02:00
|
|
|
MsgCommandResponse // The response from command
|
|
|
|
MsgCommandError // The error response from command
|
2019-03-15 04:13:42 +01:00
|
|
|
)
|