2019-03-15 04:13:42 +01:00
|
|
|
package common
|
|
|
|
|
|
|
|
type ClientDataType int
|
|
|
|
|
|
|
|
const (
|
|
|
|
CdMessage ClientDataType = iota // a normal message from the client meant to be broadcast
|
|
|
|
CdUsers // get a list of users
|
|
|
|
)
|
|
|
|
|
|
|
|
type DataType int
|
|
|
|
|
|
|
|
// Data Types
|
|
|
|
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
|
|
|
|
)
|
|
|
|
|
|
|
|
type EventType int
|
|
|
|
|
|
|
|
// Event Types
|
|
|
|
const (
|
|
|
|
EvJoin EventType = iota
|
|
|
|
EvLeave
|
|
|
|
EvKick
|
|
|
|
EvBan
|
|
|
|
EvServerMessage
|
|
|
|
)
|
|
|
|
|
|
|
|
type MessageType int
|
|
|
|
|
|
|
|
// Message Types
|
|
|
|
const (
|
|
|
|
MsgChat MessageType = iota // standard chat
|
|
|
|
MsgAction // /me command
|
|
|
|
MsgServer // server message
|
2019-03-15 22:28:29 +01:00
|
|
|
MsgError // something went wrong
|
|
|
|
MsgNotice // Like MsgServer, but for mods and admins only.
|
2019-03-15 04:13:42 +01:00
|
|
|
)
|