Fix FailedLeave event

This commit is contained in:
Trevor Slocum 2023-09-19 00:32:01 -07:00
parent 7b233c9c4a
commit c4a1a3f99d
3 changed files with 21 additions and 16 deletions

View file

@ -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:

View file

@ -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"
)

View file

@ -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: