reuse makeChan - after #9451
parent
d7048d1910
commit
e0a6fc8920
|
@ -9,7 +9,7 @@ import scala.concurrent.duration._
|
|||
import lila.chat.Chat
|
||||
import lila.chat.UserLine
|
||||
import lila.common.Bus
|
||||
import lila.game.actorApi.{ AbortedBy, FinishGame, MoveGameEvent }
|
||||
import lila.game.actorApi.{ AbortedBy, BoardDrawOffer, BoardTakeback, FinishGame, MoveGameEvent }
|
||||
import lila.game.{ Game, Pov }
|
||||
import lila.hub.actorApi.map.Tell
|
||||
import lila.round.actorApi.BotConnected
|
||||
|
@ -61,8 +61,8 @@ final class GameStateStream(
|
|||
|
||||
private val classifiers = List(
|
||||
MoveGameEvent makeChan id,
|
||||
s"boardDrawOffer:$id",
|
||||
s"boardTakeback:$id",
|
||||
BoardDrawOffer makeChan id,
|
||||
BoardTakeback makeChan id,
|
||||
"finishGame",
|
||||
"abortGame",
|
||||
uniqChan(init.game pov as),
|
||||
|
@ -100,10 +100,10 @@ final class GameStateStream(
|
|||
case MoveGameEvent(g, _, _) if g.id == id && !g.finished => pushState(g).unit
|
||||
case lila.chat.actorApi.ChatLine(chatId, UserLine(username, _, _, text, false, false)) =>
|
||||
pushChatLine(username, text, chatId.value.lengthIs == Game.gameIdSize).unit
|
||||
case FinishGame(g, _, _) if g.id == id => onGameOver(g.some).unit
|
||||
case AbortedBy(pov) if pov.gameId == id => onGameOver(pov.game.some).unit
|
||||
case lila.game.actorApi.BoardDrawOffer(pov) if pov.gameId == id => pushState(pov.game).unit
|
||||
case lila.game.actorApi.BoardTakeback(pov) if pov.gameId == id => pushState(pov.game).unit
|
||||
case FinishGame(g, _, _) if g.id == id => onGameOver(g.some).unit
|
||||
case AbortedBy(pov) if pov.gameId == id => onGameOver(pov.game.some).unit
|
||||
case BoardDrawOffer(pov) if pov.gameId == id => pushState(pov.game).unit
|
||||
case BoardTakeback(pov) if pov.gameId == id => pushState(pov.game).unit
|
||||
case SetOnline =>
|
||||
onlineApiUsers.setOnline(user.id)
|
||||
context.system.scheduler
|
||||
|
|
Loading…
Reference in New Issue