Stub player replacement
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
21c257a0b1
commit
98ccf5fe8a
1 changed files with 16 additions and 0 deletions
|
@ -112,6 +112,22 @@ func (d *DraftBot) handleEvent(roomid string, evt room.Event) {
|
|||
Owner: evt.Room.Creator,
|
||||
}
|
||||
|
||||
// Someone left
|
||||
case room.EvtLeft:
|
||||
// Check if room has a running session
|
||||
sess, ok := d.Sessions[roomid]
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
// Check if player is in that session
|
||||
player, ok := sess.Players[evt.PlayerName]
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
// Replace player with bot
|
||||
//TODO
|
||||
_ = player
|
||||
|
||||
// A room got closed
|
||||
case room.EvtRoomClosed:
|
||||
// Check if there's a session there
|
||||
|
|
Loading…
Reference in a new issue