Stub player replacement
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Hamcha 2019-06-28 21:56:47 +02:00
parent 21c257a0b1
commit 98ccf5fe8a
Signed by: hamcha
GPG Key ID: A40413D21021EAEE
1 changed files with 16 additions and 0 deletions

View File

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