Fix FailedLeave event
This commit is contained in:
parent
7b233c9c4a
commit
c4a1a3f99d
3 changed files with 21 additions and 16 deletions
|
@ -47,6 +47,8 @@ func (c *serverClient) sendEvent(e interface{}) {
|
|||
ev.Type = bgammon.EventTypeFailedJoin
|
||||
case *bgammon.EventLeft:
|
||||
ev.Type = bgammon.EventTypeLeft
|
||||
case *bgammon.EventFailedLeave:
|
||||
ev.Type = bgammon.EventTypeFailedLeave
|
||||
case *bgammon.EventBoard:
|
||||
ev.Type = bgammon.EventTypeBoard
|
||||
case *bgammon.EventRolled:
|
||||
|
|
33
command.go
33
command.go
|
@ -27,20 +27,21 @@ const (
|
|||
type EventType string
|
||||
|
||||
const (
|
||||
EventTypeWelcome = "welcome"
|
||||
EventTypeHelp = "help"
|
||||
EventTypePing = "ping"
|
||||
EventTypeNotice = "notice"
|
||||
EventTypeSay = "say"
|
||||
EventTypeList = "list"
|
||||
EventTypeJoined = "joined"
|
||||
EventTypeFailedJoin = "failedjoin"
|
||||
EventTypeLeft = "left"
|
||||
EventTypeBoard = "board"
|
||||
EventTypeRolled = "rolled"
|
||||
EventTypeFailedRoll = "failedroll"
|
||||
EventTypeMoved = "moved"
|
||||
EventTypeFailedMove = "failedmove"
|
||||
EventTypeFailedOk = "failedok"
|
||||
EventTypeWin = "win"
|
||||
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"
|
||||
)
|
||||
|
|
2
event.go
2
event.go
|
@ -137,6 +137,8 @@ func DecodeEvent(message []byte) (interface{}, error) {
|
|||
ev = &EventFailedJoin{}
|
||||
case EventTypeLeft:
|
||||
ev = &EventLeft{}
|
||||
case EventTypeFailedLeave:
|
||||
ev = &EventFailedLeave{}
|
||||
case EventTypeBoard:
|
||||
ev = &EventBoard{}
|
||||
case EventTypeRolled:
|
||||
|
|
Loading…
Reference in a new issue