rename lobbyActor
parent
ae01daf9ba
commit
4614a3421f
|
@ -5,13 +5,13 @@ import lila.game.{ Pov, Source }
|
|||
final private class AbortListener(
|
||||
userRepo: lila.user.UserRepo,
|
||||
seekApi: SeekApi,
|
||||
lobbyTrouper: LobbySyncActor
|
||||
lobbyActor: LobbySyncActor
|
||||
)(implicit ec: scala.concurrent.ExecutionContext) {
|
||||
|
||||
def apply(pov: Pov): Funit =
|
||||
(pov.game.isCorrespondence ?? recreateSeek(pov)) >>-
|
||||
cancelColorIncrement(pov) >>-
|
||||
lobbyTrouper.registerAbortedGame(pov.game)
|
||||
lobbyActor.registerAbortedGame(pov.game)
|
||||
|
||||
private def cancelColorIncrement(pov: Pov): Unit =
|
||||
if (pov.game.source.exists(s => s == Source.Lobby || s == Source.Pool)) pov.game.userIds match {
|
||||
|
|
|
@ -209,7 +209,7 @@ private object LobbySyncActor {
|
|||
makeTrouper: () => LobbySyncActor
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) = {
|
||||
val trouper = makeTrouper()
|
||||
Bus.subscribe(trouper, "lobbyTrouper")
|
||||
Bus.subscribe(trouper, "lobbyActor")
|
||||
system.scheduler.scheduleWithFixedDelay(15 seconds, resyncIdsPeriod)(() => trouper ! actorApi.Resync)
|
||||
lila.common.ResilientScheduler(
|
||||
every = Every(broomPeriod),
|
||||
|
|
|
@ -13,13 +13,13 @@ final private class HookThieve()(implicit
|
|||
|
||||
def candidates(clock: chess.Clock.Config): Fu[PoolHooks] =
|
||||
Bus
|
||||
.ask[PoolHooks]("lobbyTrouper")(GetCandidates(clock, _))
|
||||
.ask[PoolHooks]("lobbyActor")(GetCandidates(clock, _))
|
||||
.logFailure(logger)
|
||||
.recoverDefault(PoolHooks(Vector.empty))
|
||||
|
||||
def stolen(poolHooks: Vector[PoolHook], monId: String) = {
|
||||
lila.mon.lobby.pool.thieve.stolen(monId).record(poolHooks.size)
|
||||
if (poolHooks.nonEmpty) Bus.publish(StolenHookIds(poolHooks.map(_.hookId)), "lobbyTrouper")
|
||||
if (poolHooks.nonEmpty) Bus.publish(StolenHookIds(poolHooks.map(_.hookId)), "lobbyActor")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ final private[setup] class Processor(
|
|||
config.hook(sri, ctx.me, sid, blocking) match {
|
||||
case Left(hook) =>
|
||||
fuccess {
|
||||
Bus.publish(AddHook(hook), "lobbyTrouper")
|
||||
Bus.publish(AddHook(hook), "lobbyActor")
|
||||
Created(hook.id)
|
||||
}
|
||||
case Right(Some(seek)) =>
|
||||
|
@ -57,7 +57,7 @@ final private[setup] class Processor(
|
|||
import Processor.HookResult._
|
||||
if (maxPlaying <= nbPlaying) Refused
|
||||
else {
|
||||
Bus.publish(AddSeek(seek), "lobbyTrouper")
|
||||
Bus.publish(AddSeek(seek), "lobbyActor")
|
||||
Created(seek.id)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue