show the bot as online while event stream is open

This commit is contained in:
Thibault Duplessis 2018-04-17 17:35:05 +02:00
parent 8731133646
commit c1b409a489
2 changed files with 4 additions and 3 deletions

View file

@ -1,9 +1,9 @@
package lila.api
import scala.concurrent.duration._
import akka.actor._
import play.api.libs.iteratee._
import play.api.libs.json._
import scala.concurrent.duration._
import lila.challenge.Challenge
import lila.game.actorApi.UserStartGame
@ -33,9 +33,10 @@ final class EventStream(
def receive = {
case SetOnline =>
println(nowSeconds, s"set online ${me.id}")
setOnline(me.id)
context.system.scheduler.scheduleOnce(6 second, self, SetOnline)
// gotta send a message to check if the client has disconnected
channel push Json.obj("up" -> true)
case UserStartGame(userId, game) if userId == me.id => pushGameStart(game)

View file

@ -55,7 +55,7 @@ object OAuthServer {
type AuthResult = Either[AuthError, OAuthScope.Scoped]
sealed abstract class AuthError(val message: String) extends lila.base.LilaException
case object ServerOffline extends AuthError("OAuth server is offline")
case object ServerOffline extends AuthError("OAuth server is offline! Try again soon.")
case object MissingAuthorizationHeader extends AuthError("Missing authorization header")
case object InvalidAuthorizationHeader extends AuthError("Invalid authorization header")
case object NoSuchToken extends AuthError("No such token")