skip games without registered users

This commit is contained in:
Thibault Duplessis 2019-12-22 18:31:57 -05:00
parent 7f1d699bd5
commit 1bc54f7141

View file

@ -64,14 +64,16 @@ final private[relation] class RelationActor(
} mon (_.relation.actor.reloadFriends)
case lila.game.actorApi.FinishGame(game, _, _) if game.hasClock =>
val usersPlaying = game.userIds
online.playing removeAll usersPlaying
notifyFollowersGameStateChanged(usersPlaying, "following_stopped_playing")
game.userIds.some.filter(_.nonEmpty) foreach { usersPlaying =>
online.playing removeAll usersPlaying
notifyFollowersGameStateChanged(usersPlaying, "following_stopped_playing")
}
case lila.game.actorApi.StartGame(game) if game.hasClock =>
val usersPlaying = game.userIds
online.playing putAll usersPlaying
notifyFollowersGameStateChanged(usersPlaying, "following_playing")
game.userIds.some.filter(_.nonEmpty) foreach { usersPlaying =>
online.playing putAll usersPlaying
notifyFollowersGameStateChanged(usersPlaying, "following_playing")
}
case lila.hub.actorApi.study.StudyDoor(userId, studyId, contributor, public, true) =>
online.studyingAll.put(userId, studyId)