scalafmt 2.6.1
parent
9bd270b075
commit
4ce0679757
|
@ -1,4 +1,4 @@
|
|||
version = "2.6.0"
|
||||
version = "2.6.1"
|
||||
align = more
|
||||
maxColumn = 110
|
||||
spaces.inImportCurlyBraces = true
|
||||
|
|
|
@ -80,7 +80,11 @@ final class Env(
|
|||
val swiss: lila.swiss.Env,
|
||||
val lilaCookie: lila.common.LilaCookie,
|
||||
val controllerComponents: ControllerComponents
|
||||
)(implicit val system: ActorSystem, val executionContext: ExecutionContext, val mode: play.api.Mode) {
|
||||
)(implicit
|
||||
val system: ActorSystem,
|
||||
val executionContext: ExecutionContext,
|
||||
val mode: play.api.Mode
|
||||
) {
|
||||
|
||||
def net = common.netConfig
|
||||
|
||||
|
@ -175,7 +179,11 @@ final class EnvBoot(
|
|||
controllerComponents: ControllerComponents,
|
||||
cookieBacker: SessionCookieBaker,
|
||||
shutdown: CoordinatedShutdown
|
||||
)(implicit ec: ExecutionContext, system: ActorSystem, ws: WSClient) {
|
||||
)(implicit
|
||||
ec: ExecutionContext,
|
||||
system: ActorSystem,
|
||||
ws: WSClient
|
||||
) {
|
||||
|
||||
implicit def scheduler = system.scheduler
|
||||
implicit def mode = environment.mode
|
||||
|
|
|
@ -547,11 +547,10 @@ abstract private[controllers] class LilaController(val env: Env)
|
|||
env.security.api restoreUser req dmap {
|
||||
case Some(d) if !env.isProdReally =>
|
||||
d.copy(user =
|
||||
d.user
|
||||
.addRole(lila.security.Permission.Beta.dbKey)
|
||||
.addRole(lila.security.Permission.Prismic.dbKey)
|
||||
)
|
||||
.some
|
||||
d.user
|
||||
.addRole(lila.security.Permission.Beta.dbKey)
|
||||
.addRole(lila.security.Permission.Prismic.dbKey)
|
||||
).some
|
||||
case d => d
|
||||
} flatMap {
|
||||
case None => fuccess(None -> None)
|
||||
|
|
|
@ -255,10 +255,10 @@ final class Swiss(
|
|||
|
||||
private[controllers] def canHaveChat(swiss: SwissModel.RoundInfo)(implicit ctx: Context): Fu[Boolean] =
|
||||
swiss.chatFor match {
|
||||
case ChatFor.NONE => fuFalse
|
||||
case ChatFor.NONE => fuFalse
|
||||
case _ if isGranted(_.ChatTimeout) => fuTrue
|
||||
case ChatFor.LEADERS => ctx.userId ?? { env.team.cached.isLeader(swiss.teamId, _) }
|
||||
case ChatFor.MEMBERS => ctx.userId ?? { env.team.api.belongsTo(swiss.teamId, _) }
|
||||
case _ => fuTrue
|
||||
case ChatFor.LEADERS => ctx.userId ?? { env.team.cached.isLeader(swiss.teamId, _) }
|
||||
case ChatFor.MEMBERS => ctx.userId ?? { env.team.api.belongsTo(swiss.teamId, _) }
|
||||
case _ => fuTrue
|
||||
}
|
||||
}
|
||||
|
|
|
@ -383,20 +383,19 @@ final class User(
|
|||
}
|
||||
implicit val extractor = EventSource.EventDataExtractor[Frag](_.render)
|
||||
Ok.chunked {
|
||||
Source.single(html.user.mod.menu(user)) merge
|
||||
modZoneSegment(actions, "actions", user) merge
|
||||
modZoneSegment(modLog, "modLog", user) merge
|
||||
modZoneSegment(plan, "plan", user) merge
|
||||
modZoneSegment(reportLog, "reportLog", user) merge
|
||||
modZoneSegment(prefs, "prefs", user) merge
|
||||
modZoneSegment(rageSit, "rageSit", user) merge
|
||||
modZoneSegment(others, "others", user) merge
|
||||
modZoneSegment(identification, "identification", user) merge
|
||||
modZoneSegment(irwin, "irwin", user) merge
|
||||
modZoneSegment(assess, "assess", user) via
|
||||
EventSource.flow
|
||||
}
|
||||
.as(ContentTypes.EVENT_STREAM) pipe noProxyBuffer
|
||||
Source.single(html.user.mod.menu(user)) merge
|
||||
modZoneSegment(actions, "actions", user) merge
|
||||
modZoneSegment(modLog, "modLog", user) merge
|
||||
modZoneSegment(plan, "plan", user) merge
|
||||
modZoneSegment(reportLog, "reportLog", user) merge
|
||||
modZoneSegment(prefs, "prefs", user) merge
|
||||
modZoneSegment(rageSit, "rageSit", user) merge
|
||||
modZoneSegment(others, "others", user) merge
|
||||
modZoneSegment(identification, "identification", user) merge
|
||||
modZoneSegment(irwin, "irwin", user) merge
|
||||
modZoneSegment(assess, "assess", user) via
|
||||
EventSource.flow
|
||||
}.as(ContentTypes.EVENT_STREAM) pipe noProxyBuffer
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -69,8 +69,7 @@ object admin {
|
|||
views.html.base.layout(
|
||||
title = title,
|
||||
moreCss = cssTag("team"),
|
||||
moreJs =
|
||||
embedJsUnsafe("""
|
||||
moreJs = embedJsUnsafe("""
|
||||
|$('.copy-url-button').on('click', function(e) {
|
||||
|$('#form3-message').val(function(i, x) {return x + $(e.target).data('copyurl') + '\n'})
|
||||
|})
|
||||
|
|
|
@ -17,7 +17,10 @@ final class Env(
|
|||
tourLeaderApi: lila.tournament.LeaderboardApi,
|
||||
getTourName: lila.tournament.GetTourName,
|
||||
getTeamName: lila.team.GetTeamName
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
private lazy val coll = db(CollName("activity"))
|
||||
|
||||
|
|
|
@ -43,7 +43,10 @@ final class Env(
|
|||
msgEnv: lila.msg.Env,
|
||||
ws: WSClient,
|
||||
val mode: Mode
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
val config = ApiConfig loadFrom appConfig
|
||||
import config.apiToken
|
||||
|
|
|
@ -17,7 +17,10 @@ final class EventStream(
|
|||
challengeMaker: lila.challenge.ChallengeMaker,
|
||||
onlineApiUsers: lila.bot.OnlineApiUsers,
|
||||
userRepo: UserRepo
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
private case object SetOnline
|
||||
|
||||
|
|
|
@ -25,7 +25,10 @@ final class GameApiV2(
|
|||
swissApi: lila.swiss.SwissApi,
|
||||
analysisRepo: lila.analyse.AnalysisRepo,
|
||||
getLightUser: LightUser.Getter
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
import GameApiV2._
|
||||
|
||||
|
|
|
@ -20,7 +20,10 @@ final class Env(
|
|||
appConfig: Configuration,
|
||||
db: lila.db.Db,
|
||||
gameRepo: lila.game.GameRepo
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
private val config = appConfig.get[BookmarkConfig]("bookmark")(AutoConfig.loader)
|
||||
|
||||
|
|
|
@ -16,7 +16,10 @@ final class BotPlayer(
|
|||
chatApi: lila.chat.ChatApi,
|
||||
gameRepo: GameRepo,
|
||||
isOfferingRematch: lila.round.IsOfferingRematch
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
private def clientError[A](msg: String): Fu[A] = fufail(lila.round.ClientError(msg))
|
||||
|
||||
|
|
|
@ -9,7 +9,11 @@ final class Env(
|
|||
lightUserApi: lila.user.LightUserApi,
|
||||
rematches: lila.game.Rematches,
|
||||
isOfferingRematch: lila.round.IsOfferingRematch
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem, mode: play.api.Mode) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem,
|
||||
mode: play.api.Mode
|
||||
) {
|
||||
|
||||
private def scheduler = system.scheduler
|
||||
|
||||
|
|
|
@ -19,7 +19,10 @@ import scala.concurrent.duration._
|
|||
final class GameStateStream(
|
||||
onlineApiUsers: OnlineApiUsers,
|
||||
jsonView: BotJsonView
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
private case object SetOnline
|
||||
private case class User(id: lila.user.User.ID, isBot: Boolean)
|
||||
|
|
|
@ -19,7 +19,10 @@ final class ChallengeApi(
|
|||
gameCache: lila.game.Cached,
|
||||
maxPlaying: Max,
|
||||
cacheApi: lila.memo.CacheApi
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
import Challenge._
|
||||
|
||||
|
|
|
@ -8,7 +8,10 @@ import lila.socket.RemoteSocket.{ Protocol => P, _ }
|
|||
final private class ChallengeSocket(
|
||||
api: ChallengeApi,
|
||||
remoteSocketApi: lila.socket.RemoteSocket
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, mode: play.api.Mode) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
mode: play.api.Mode
|
||||
) {
|
||||
|
||||
import ChallengeSocket._
|
||||
|
||||
|
|
|
@ -22,7 +22,11 @@ final class Env(
|
|||
relationApi: lila.relation.RelationApi,
|
||||
remoteSocketApi: lila.socket.RemoteSocket,
|
||||
baseUrl: BaseUrl
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem, mode: play.api.Mode) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem,
|
||||
mode: play.api.Mode
|
||||
) {
|
||||
|
||||
private lazy val maxPlaying = appConfig.get[Max]("setup.max_playing")
|
||||
|
||||
|
|
|
@ -28,7 +28,10 @@ final class Env(
|
|||
shutup: lila.hub.actors.Shutup,
|
||||
mod: lila.hub.actors.Mod,
|
||||
cacheApi: lila.memo.CacheApi
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
implicit private val maxPerLineLoader = intLoader(Chat.MaxLines.apply)
|
||||
private val config = appConfig.get[ChatConfig]("chat")(AutoConfig.loader)
|
||||
|
|
|
@ -48,11 +48,10 @@ object Future {
|
|||
in: M[A]
|
||||
)(f: A => Fu[B])(implicit cbf: BuildFrom[M[A], B, M[B]], ec: ExecutionContext): Fu[M[B]] = {
|
||||
in.foldLeft(fuccess(cbf.newBuilder(in))) { (fr, a) =>
|
||||
fr flatMap { r =>
|
||||
f(a).dmap(r += _)
|
||||
}
|
||||
fr flatMap { r =>
|
||||
f(a).dmap(r += _)
|
||||
}
|
||||
.dmap(_.result())
|
||||
}.dmap(_.result())
|
||||
}
|
||||
|
||||
def applySequentially[A](
|
||||
|
|
|
@ -25,9 +25,8 @@ trait CursorExt { self: dsl =>
|
|||
// like headOption, but with stopOnError defaulting to false
|
||||
def uno: Fu[Option[A]] =
|
||||
c.collect[Iterable](
|
||||
1,
|
||||
Cursor.ContOnError[Iterable[A]]()
|
||||
)
|
||||
.map(_.headOption)
|
||||
1,
|
||||
Cursor.ContOnError[Iterable[A]]()
|
||||
).map(_.headOption)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,10 @@ final class Env(
|
|||
db: lila.db.Db,
|
||||
cacheApi: lila.memo.CacheApi,
|
||||
scheduler: akka.actor.Scheduler
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, mode: play.api.Mode) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
mode: play.api.Mode
|
||||
) {
|
||||
|
||||
private lazy val coll = db(appConfig.get[CollName]("evalCache.collection.evalCache"))
|
||||
|
||||
|
|
|
@ -14,7 +14,10 @@ final class Env(
|
|||
getBotUserIds: lila.user.GetBotIds,
|
||||
settingStore: lila.memo.SettingStore.Builder,
|
||||
ws: play.api.libs.ws.WSClient
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
private lazy val internalEndpoint = InternalEndpoint {
|
||||
appConfig.get[String]("explorer.internal_endpoint")
|
||||
|
|
|
@ -18,7 +18,10 @@ final private class ExplorerIndexer(
|
|||
getBotUserIds: lila.user.GetBotIds,
|
||||
ws: play.api.libs.ws.WSClient,
|
||||
internalEndpoint: InternalEndpoint
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, mat: akka.stream.Materializer) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
mat: akka.stream.Materializer
|
||||
) {
|
||||
|
||||
private val separator = "\n\n\n"
|
||||
private val datePattern = "yyyy-MM-dd"
|
||||
|
|
|
@ -14,7 +14,10 @@ final class Analyser(
|
|||
uciMemo: UciMemo,
|
||||
evalCache: FishnetEvalCache,
|
||||
limiter: Limiter
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
val maxPlies = 200
|
||||
|
||||
|
|
|
@ -13,7 +13,10 @@ final private class Cleaner(
|
|||
repo: FishnetRepo,
|
||||
analysisColl: Coll,
|
||||
system: akka.actor.ActorSystem
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, mat: akka.stream.Materializer) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
mat: akka.stream.Materializer
|
||||
) {
|
||||
|
||||
import BSONHandlers._
|
||||
|
||||
|
|
|
@ -34,7 +34,10 @@ final class Env(
|
|||
cacheApi: lila.memo.CacheApi,
|
||||
sink: lila.analyse.Analyser,
|
||||
shutdown: akka.actor.CoordinatedShutdown
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
private val config = appConfig.get[FishnetConfig]("fishnet")(AutoConfig.loader)
|
||||
|
||||
|
|
|
@ -18,7 +18,10 @@ final class FishnetApi(
|
|||
socketExists: String => Fu[Boolean],
|
||||
clientVersion: Client.ClientVersion,
|
||||
config: FishnetApi.Config
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
import FishnetApi._
|
||||
import JsonApi.Request.{ CompleteAnalysis, PartialAnalysis }
|
||||
|
|
|
@ -5,7 +5,10 @@ import scala.concurrent.duration._
|
|||
final private class Monitor(
|
||||
repo: FishnetRepo,
|
||||
cacheApi: lila.memo.CacheApi
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
val statusCache = cacheApi.unit[Monitor.Status] {
|
||||
_.refreshAfterWrite(1 minute)
|
||||
|
|
|
@ -13,7 +13,10 @@ final class Player(
|
|||
gameRepo: GameRepo,
|
||||
uciMemo: UciMemo,
|
||||
val maxPlies: Int
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
def apply(game: Game): Funit =
|
||||
game.aiLevel ?? { level =>
|
||||
|
|
|
@ -21,7 +21,11 @@ final class Env(
|
|||
makeClient: Index => ESClient,
|
||||
postApi: lila.forum.PostApi,
|
||||
postRepo: lila.forum.PostRepo
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem, mat: akka.stream.Materializer) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem,
|
||||
mat: akka.stream.Materializer
|
||||
) {
|
||||
|
||||
private val config = appConfig.get[ForumSearchConfig]("forumSearch")(AutoConfig.loader)
|
||||
|
||||
|
|
|
@ -11,8 +11,10 @@ final class ForumSearchApi(
|
|||
client: ESClient,
|
||||
postApi: PostApi,
|
||||
postRepo: PostRepo
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, mat: akka.stream.Materializer)
|
||||
extends SearchReadApi[PostView, Query] {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
mat: akka.stream.Materializer
|
||||
) extends SearchReadApi[PostView, Query] {
|
||||
|
||||
def search(query: Query, from: From, size: Size) =
|
||||
client.search(query, from, size) flatMap { res =>
|
||||
|
|
|
@ -29,7 +29,11 @@ final class Env(
|
|||
mongoCache: lila.memo.MongoCache.Api,
|
||||
lightUserApi: lila.user.LightUserApi,
|
||||
cacheApi: lila.memo.CacheApi
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem, scheduler: Scheduler) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem,
|
||||
scheduler: Scheduler
|
||||
) {
|
||||
|
||||
private val config = appConfig.get[GameConfig]("game")(AutoConfig.loader)
|
||||
import config.paginatorMaxPerPage
|
||||
|
|
|
@ -21,7 +21,10 @@ final class Env(
|
|||
appConfig: Configuration,
|
||||
gameRepo: lila.game.GameRepo,
|
||||
makeClient: Index => ESClient
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
private val config = appConfig.get[GameSearchConfig]("gameSearch")(AutoConfig.loader)
|
||||
|
||||
|
|
|
@ -9,8 +9,10 @@ import lila.search._
|
|||
final class GameSearchApi(
|
||||
client: ESClient,
|
||||
gameRepo: GameRepo
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem)
|
||||
extends SearchReadApi[Game, Query] {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) extends SearchReadApi[Game, Query] {
|
||||
|
||||
def search(query: Query, from: From, size: Size) =
|
||||
client.search(query, from, size) flatMap { res =>
|
||||
|
|
|
@ -16,7 +16,10 @@ final class Env(
|
|||
prefApi: lila.pref.PrefApi,
|
||||
relationApi: lila.relation.RelationApi,
|
||||
mongo: lila.db.Env
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
private lazy val db = mongo.asyncDb(
|
||||
"insight",
|
||||
|
|
|
@ -17,7 +17,10 @@ final private class Indexer(
|
|||
gameRepo: GameRepo,
|
||||
userRepo: UserRepo,
|
||||
storage: Storage
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
private val workQueue =
|
||||
new lila.hub.DuctSequencer(maxSize = 64, timeout = 1 minute, name = "insightIndexer")
|
||||
|
|
|
@ -18,7 +18,10 @@ final class Env(
|
|||
analysisRepo: lila.analyse.AnalysisRepo,
|
||||
settingStore: lila.memo.SettingStore.Builder,
|
||||
db: lila.db.Db
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
private lazy val reportColl = db(CollName("irwin_report"))
|
||||
|
||||
|
|
|
@ -10,7 +10,10 @@ import lila.user.User
|
|||
final private class Biter(
|
||||
userRepo: lila.user.UserRepo,
|
||||
gameRepo: lila.game.GameRepo
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, idGenerator: lila.game.IdGenerator) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
idGenerator: lila.game.IdGenerator
|
||||
) {
|
||||
|
||||
def apply(hook: Hook, sri: Sri, user: Option[LobbyUser]): Fu[JoinHook] =
|
||||
if (canJoin(hook, user)) join(hook, sri, user)
|
||||
|
|
|
@ -45,7 +45,10 @@ final class Env(
|
|||
cacheApi: lila.memo.CacheApi,
|
||||
slackApi: lila.slack.SlackApi,
|
||||
securityStore: lila.security.Store
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
private val config = appConfig.get[ModConfig]("mod")(AutoConfig.loader)
|
||||
|
||||
|
|
|
@ -21,7 +21,10 @@ final class MsgApi(
|
|||
notifier: MsgNotify,
|
||||
security: MsgSecurity,
|
||||
shutup: lila.hub.actors.Shutup
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, mat: akka.stream.Materializer) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
mat: akka.stream.Materializer
|
||||
) {
|
||||
|
||||
val msgsPerPage = MaxPerPage(100)
|
||||
|
||||
|
|
|
@ -12,7 +12,10 @@ import lila.user.User
|
|||
final private class MsgNotify(
|
||||
colls: MsgColls,
|
||||
notifyApi: lila.notify.NotifyApi
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, scheduler: akka.actor.Scheduler) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
scheduler: akka.actor.Scheduler
|
||||
) {
|
||||
|
||||
import BsonHandlers._
|
||||
|
||||
|
|
|
@ -19,7 +19,10 @@ final private class MsgSecurity(
|
|||
relationApi: lila.relation.RelationApi,
|
||||
spam: lila.security.Spam,
|
||||
chatPanic: lila.chat.ChatPanic
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
import BsonHandlers._
|
||||
import MsgSecurity._
|
||||
|
|
|
@ -21,7 +21,10 @@ final class Env(
|
|||
getLightUser: lila.common.LightUser.Getter,
|
||||
getLightUserSync: lila.common.LightUser.GetterSync,
|
||||
cacheApi: lila.memo.CacheApi
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
private val config = appConfig.get[NotifyConfig]("notify")(AutoConfig.loader)
|
||||
|
||||
|
|
|
@ -11,7 +11,10 @@ final class Env(
|
|||
lightUser: lila.common.LightUser.GetterSync,
|
||||
gameRepo: lila.game.GameRepo,
|
||||
db: lila.db.Db
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
lazy val storage = new PerfStatStorage(
|
||||
coll = db(appConfig.get[CollName]("perfStat.collection.perf_stat"))
|
||||
|
|
|
@ -10,7 +10,10 @@ import lila.user.User
|
|||
final class PerfStatIndexer(
|
||||
gameRepo: GameRepo,
|
||||
storage: PerfStatStorage
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
private val workQueue =
|
||||
new lila.hub.DuctSequencer(maxSize = 64, timeout = 10 seconds, name = "perfStatIndexer")
|
||||
|
|
|
@ -27,7 +27,10 @@ final class Env(
|
|||
lightUserApi: lila.user.LightUserApi,
|
||||
userRepo: lila.user.UserRepo,
|
||||
settingStore: lila.memo.SettingStore.Builder
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
import StripeClient.configLoader
|
||||
private val config = appConfig.get[PlanConfig]("plan")(AutoConfig.loader)
|
||||
|
|
|
@ -11,7 +11,10 @@ import lila.user.User
|
|||
final private[plan] class PlanNotifier(
|
||||
notifyApi: NotifyApi,
|
||||
timeline: lila.hub.actors.Timeline
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
def onStart(user: User) =
|
||||
fuccess {
|
||||
|
|
|
@ -11,7 +11,10 @@ final class Env(
|
|||
gameRepo: lila.game.GameRepo,
|
||||
idGenerator: lila.game.IdGenerator,
|
||||
playbanApi: lila.playban.PlaybanApi
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
private lazy val hookThieve = wire[HookThieve]
|
||||
|
||||
|
|
|
@ -11,7 +11,10 @@ final private class GameStarter(
|
|||
gameRepo: GameRepo,
|
||||
idGenerator: IdGenerator,
|
||||
onStart: Game.Id => Unit
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
import PoolApi._
|
||||
|
||||
|
|
|
@ -27,7 +27,10 @@ final class Env(
|
|||
userRepo: lila.user.UserRepo,
|
||||
getLightUser: lila.common.LightUser.Getter,
|
||||
proxyRepo: lila.round.GameProxyRepo
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
private val config = appConfig.get[PushConfig]("push")(AutoConfig.loader)
|
||||
|
||||
|
|
|
@ -15,7 +15,10 @@ final private class FirebasePush(
|
|||
deviceApi: DeviceApi,
|
||||
ws: WSClient,
|
||||
config: FirebasePush.Config
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
private val workQueue =
|
||||
new lila.hub.DuctSequencer(maxSize = 512, timeout = 10 seconds, name = "firebasePush")
|
||||
|
|
|
@ -18,7 +18,10 @@ final private class PushApi(
|
|||
userRepo: lila.user.UserRepo,
|
||||
implicit val lightUser: LightUser.Getter,
|
||||
proxyRepo: lila.round.GameProxyRepo
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
def finish(game: Game): Funit =
|
||||
if (!game.isCorrespondence || game.hasAi) funit
|
||||
|
|
|
@ -34,7 +34,10 @@ final class Env(
|
|||
gameRepo: lila.game.GameRepo,
|
||||
userRepo: lila.user.UserRepo,
|
||||
mongo: lila.db.Env
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
private val config = appConfig.get[PuzzleConfig]("puzzle")(AutoConfig.loader)
|
||||
|
||||
|
|
|
@ -15,7 +15,10 @@ import lila.user.User
|
|||
final class PuzzleActivity(
|
||||
puzzleColl: AsyncColl,
|
||||
roundColl: AsyncColl
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
import PuzzleActivity._
|
||||
import Round.RoundBSONHandler
|
||||
|
|
|
@ -23,7 +23,10 @@ final class Env(
|
|||
userRepo: lila.user.UserRepo,
|
||||
prefApi: lila.pref.PrefApi,
|
||||
cacheApi: lila.memo.CacheApi
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
private val config = appConfig.get[RelationConfig]("relation")(AutoConfig.loader)
|
||||
|
||||
|
|
|
@ -14,7 +14,10 @@ final class Env(
|
|||
chapterRepo: lila.study.ChapterRepo,
|
||||
cacheApi: lila.memo.CacheApi,
|
||||
slackApi: lila.slack.SlackApi
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
private lazy val coll = db(CollName("relay"))
|
||||
|
||||
|
|
|
@ -8,7 +8,10 @@ import lila.game.{ Game, GameRepo }
|
|||
final class AutoAnalysis(
|
||||
gameRepo: GameRepo,
|
||||
fishnet: lila.hub.actors.Fishnet
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
def apply(candidate: Report.Candidate): Funit =
|
||||
if (candidate.isCheat) doItNow(candidate)
|
||||
|
|
|
@ -34,7 +34,10 @@ final class Env(
|
|||
fishnet: lila.hub.actors.Fishnet,
|
||||
settingStore: lila.memo.SettingStore.Builder,
|
||||
cacheApi: lila.memo.CacheApi
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
private val config = appConfig.get[ReportConfig]("report")(AutoConfig.loader)
|
||||
|
||||
|
|
|
@ -21,7 +21,10 @@ final class ReportApi(
|
|||
isOnline: lila.socket.IsOnline,
|
||||
cacheApi: lila.memo.CacheApi,
|
||||
thresholds: Thresholds
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
import BSONHandlers._
|
||||
import Report.Candidate
|
||||
|
|
|
@ -15,7 +15,10 @@ final private class CorresAlarm(
|
|||
coll: Coll,
|
||||
hasUserId: (Game, lila.user.User.ID) => Fu[Boolean],
|
||||
proxyGame: Game.ID => Fu[Option[Game]]
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
private case class Alarm(
|
||||
_id: String, // game id
|
||||
|
|
|
@ -53,7 +53,11 @@ final class Env(
|
|||
slackApi: lila.slack.SlackApi,
|
||||
ratingFactors: () => lila.rating.RatingFactors,
|
||||
shutdown: akka.actor.CoordinatedShutdown
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem, scheduler: akka.actor.Scheduler) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem,
|
||||
scheduler: akka.actor.Scheduler
|
||||
) {
|
||||
|
||||
implicit private val moretimeLoader = durationLoader(MoretimeDuration.apply)
|
||||
implicit private val animationLoader = durationLoader(AnimationDuration.apply)
|
||||
|
|
|
@ -31,8 +31,10 @@ final private[round] class RoundDuct(
|
|||
dependencies: RoundDuct.Dependencies,
|
||||
gameId: Game.ID,
|
||||
socketSend: String => Unit
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, proxy: GameProxy)
|
||||
extends Duct {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
proxy: GameProxy
|
||||
) extends Duct {
|
||||
|
||||
import RoundSocket.Protocol
|
||||
import RoundDuct._
|
||||
|
|
|
@ -32,7 +32,10 @@ final class RoundSocket(
|
|||
messenger: Messenger,
|
||||
goneWeightsFor: Game => Fu[(Float, Float)],
|
||||
shutdown: CoordinatedShutdown
|
||||
)(implicit ec: ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
import RoundSocket._
|
||||
|
||||
|
|
|
@ -15,7 +15,10 @@ final private class CheckMail(
|
|||
ws: WSClient,
|
||||
config: SecurityConfig.CheckMail,
|
||||
mongoCache: lila.memo.MongoCache.Api
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
def apply(domain: Domain.Lower): Fu[Boolean] =
|
||||
if (config.key.value.isEmpty) fuccess(true)
|
||||
|
|
|
@ -12,7 +12,10 @@ final private class DnsApi(
|
|||
ws: WSClient,
|
||||
config: SecurityConfig.DnsApi,
|
||||
mongoCache: lila.memo.MongoCache.Api
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
// only valid email domains that are not whitelisted should make it here
|
||||
def mx(domain: Domain.Lower): Fu[List[Domain]] =
|
||||
|
|
|
@ -27,7 +27,11 @@ final class Env(
|
|||
tryOAuthServer: OAuthServer.Try,
|
||||
mongoCache: lila.memo.MongoCache.Api,
|
||||
db: lila.db.Db
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem, scheduler: Scheduler) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem,
|
||||
scheduler: Scheduler
|
||||
) {
|
||||
|
||||
private val config = appConfig.get[SecurityConfig]("security")(SecurityConfig.loader)
|
||||
import net.{ baseUrl, domain }
|
||||
|
|
|
@ -14,7 +14,10 @@ final class GarbageCollector(
|
|||
slack: lila.slack.SlackApi,
|
||||
noteApi: lila.user.NoteApi,
|
||||
isArmed: () => Boolean
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
private val logger = lila.security.logger.branch("GarbageCollector")
|
||||
|
||||
|
|
|
@ -11,7 +11,10 @@ final class Ip2Proxy(
|
|||
ws: WSClient,
|
||||
cacheApi: lila.memo.CacheApi,
|
||||
checkUrl: String
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
def apply(ip: IpAddress): Fu[Boolean] =
|
||||
cache.get(ip).recover {
|
||||
|
|
|
@ -15,7 +15,10 @@ import lila.i18n.I18nKeys.{ emails => trans }
|
|||
final class Mailgun(
|
||||
ws: WSClient,
|
||||
config: Mailgun.Config
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
def send(msg: Mailgun.Message): Funit =
|
||||
if (config.apiUrl.isEmpty) {
|
||||
|
|
|
@ -25,7 +25,10 @@ final class SecurityApi(
|
|||
authenticator: lila.user.Authenticator,
|
||||
emailValidator: EmailAddressValidator,
|
||||
tryOauthServer: lila.oauth.OAuthServer.Try
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
val AccessUri = "access_uri"
|
||||
|
||||
|
|
|
@ -16,7 +16,10 @@ final class StringToken[A](
|
|||
fullHashSize: Int = 14,
|
||||
currentValueHashSize: Option[Int] = Some(6), // won't hash if None
|
||||
separator: Char = '|'
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, serializer: StringToken.Serializable[A]) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
serializer: StringToken.Serializable[A]
|
||||
) {
|
||||
|
||||
def make(payload: A) =
|
||||
hashCurrentValue(payload) map { hashedValue =>
|
||||
|
|
|
@ -21,7 +21,10 @@ final class Env(
|
|||
gameRepo: lila.game.GameRepo,
|
||||
userRepo: UserRepo,
|
||||
db: lila.db.Db
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
private val config = appConfig.get[ShutupConfig]("shutup")(AutoConfig.loader)
|
||||
|
||||
|
|
|
@ -30,7 +30,11 @@ final class Env(
|
|||
cacheApi: lila.memo.CacheApi,
|
||||
remoteSocketApi: lila.socket.RemoteSocket,
|
||||
proxyRepo: lila.round.GameProxyRepo
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem, mode: play.api.Mode) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem,
|
||||
mode: play.api.Mode
|
||||
) {
|
||||
|
||||
private val config = appConfig.get[SimulConfig]("simul")(AutoConfig.loader)
|
||||
|
||||
|
|
|
@ -24,7 +24,11 @@ final class SimulApi(
|
|||
timeline: lila.hub.actors.Timeline,
|
||||
repo: SimulRepo,
|
||||
cacheApi: lila.memo.CacheApi
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem, mode: play.api.Mode) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem,
|
||||
mode: play.api.Mode
|
||||
) {
|
||||
|
||||
private val workQueue =
|
||||
new lila.hub.DuctSequencers(
|
||||
|
|
|
@ -12,7 +12,10 @@ final private class SimulSocket(
|
|||
jsonView: JsonView,
|
||||
remoteSocketApi: lila.socket.RemoteSocket,
|
||||
chat: lila.chat.ChatApi
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, mode: play.api.Mode) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
mode: play.api.Mode
|
||||
) {
|
||||
|
||||
def hostIsOn(simulId: Simul.ID, gameId: Game.ID): Unit =
|
||||
rooms.tell(simulId, NotifyVersion("hostGame", gameId))
|
||||
|
|
|
@ -10,7 +10,10 @@ final class Env(
|
|||
appConfig: Configuration,
|
||||
shutdown: CoordinatedShutdown,
|
||||
notification: lila.hub.actors.Notification
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, akka: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
akka: ActorSystem
|
||||
) {
|
||||
|
||||
private val RedisUri = appConfig.get[String]("socket.redis.uri")
|
||||
|
||||
|
|
|
@ -24,7 +24,10 @@ final class RemoteSocket(
|
|||
redisClient: RedisClient,
|
||||
notification: lila.hub.actors.Notification,
|
||||
shutdown: CoordinatedShutdown
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
import RemoteSocket._, Protocol._
|
||||
|
||||
|
|
|
@ -30,7 +30,10 @@ final class Env(
|
|||
timeline: lila.hub.actors.Timeline,
|
||||
db: lila.db.Db,
|
||||
imageRepo: lila.db.ImageRepo
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
implicit private val keywordLoader = strLoader(Stream.Keyword.apply)
|
||||
private val config = appConfig.get[StreamerConfig]("streamer")(AutoConfig.loader)
|
||||
|
|
|
@ -27,7 +27,10 @@ final class StudyApi(
|
|||
chatApi: ChatApi,
|
||||
timeline: lila.hub.actors.Timeline,
|
||||
serverEvalRequester: ServerEval.Requester
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, mat: akka.stream.Materializer) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
mat: akka.stream.Materializer
|
||||
) {
|
||||
|
||||
import sequencer._
|
||||
|
||||
|
|
|
@ -19,7 +19,10 @@ final private class StudySocket(
|
|||
jsonView: JsonView,
|
||||
remoteSocketApi: lila.socket.RemoteSocket,
|
||||
chatApi: lila.chat.ChatApi
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, mode: play.api.Mode) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
mode: play.api.Mode
|
||||
) {
|
||||
|
||||
import StudySocket._
|
||||
|
||||
|
|
|
@ -17,7 +17,11 @@ final class Env(
|
|||
chapterRepo: lila.study.ChapterRepo,
|
||||
pager: lila.study.StudyPager,
|
||||
makeClient: Index => ESClient
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem, mat: akka.stream.Materializer) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem,
|
||||
mat: akka.stream.Materializer
|
||||
) {
|
||||
|
||||
private val client = makeClient(Index("study"))
|
||||
|
||||
|
|
|
@ -18,8 +18,11 @@ final class StudySearchApi(
|
|||
indexThrottler: ActorRef,
|
||||
studyRepo: StudyRepo,
|
||||
chapterRepo: ChapterRepo
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem, mat: akka.stream.Materializer)
|
||||
extends SearchReadApi[Study, Query] {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem,
|
||||
mat: akka.stream.Materializer
|
||||
) extends SearchReadApi[Study, Query] {
|
||||
|
||||
def search(query: Query, from: From, size: Size) =
|
||||
client.search(query, from, size) flatMap { res =>
|
||||
|
|
|
@ -46,10 +46,9 @@ final private class SwissScoring(
|
|||
newTieBreak -> newPerf
|
||||
}
|
||||
p.copy(
|
||||
tieBreak = Swiss.TieBreak(tieBreak),
|
||||
performance = playerPairings.nonEmpty option Swiss.Performance(perfSum / playerPairings.size)
|
||||
)
|
||||
.recomputeScore
|
||||
tieBreak = Swiss.TieBreak(tieBreak),
|
||||
performance = playerPairings.nonEmpty option Swiss.Performance(perfSum / playerPairings.size)
|
||||
).recomputeScore
|
||||
}
|
||||
_ <- SwissPlayer.fields { f =>
|
||||
prevPlayers
|
||||
|
|
|
@ -11,7 +11,11 @@ import lila.socket.Socket.makeMessage
|
|||
final private class SwissSocket(
|
||||
remoteSocketApi: lila.socket.RemoteSocket,
|
||||
chat: lila.chat.ChatApi
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem, mode: play.api.Mode) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem,
|
||||
mode: play.api.Mode
|
||||
) {
|
||||
|
||||
private val reloadThrottler = LateMultiThrottler(executionTimeout = none, logger = logger)
|
||||
|
||||
|
|
|
@ -20,7 +20,10 @@ final class SwissStatsApi(
|
|||
colls: SwissColls,
|
||||
sheetApi: SwissSheetApi,
|
||||
mongoCache: lila.memo.MongoCache.Api
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, mat: akka.stream.Materializer) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
mat: akka.stream.Materializer
|
||||
) {
|
||||
|
||||
import BsonHandlers._
|
||||
|
||||
|
@ -78,10 +81,7 @@ final class SwissStatsApi(
|
|||
}
|
||||
})(Keep.right)
|
||||
.run
|
||||
.dmap { s => s.copy(
|
||||
games = s.games / 2,
|
||||
averageRating = s.averageRating / swiss.nbPlayers)
|
||||
}
|
||||
.dmap { s => s.copy(games = s.games / 2, averageRating = s.averageRating / swiss.nbPlayers) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,11 @@ final class Env(
|
|||
cacheApi: lila.memo.CacheApi,
|
||||
lightUserApi: lila.user.LightUserApi,
|
||||
db: lila.db.Db
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem, mode: play.api.Mode) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem,
|
||||
mode: play.api.Mode
|
||||
) {
|
||||
|
||||
lazy val teamRepo = new TeamRepo(db(CollName("team")))
|
||||
lazy val memberRepo = new MemberRepo(db(CollName("team_member")))
|
||||
|
|
|
@ -12,7 +12,10 @@ import lila.user.{ User, UserRepo }
|
|||
final class TeamMemberStream(
|
||||
memberRepo: MemberRepo,
|
||||
userRepo: UserRepo
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, mat: akka.stream.Materializer) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
mat: akka.stream.Materializer
|
||||
) {
|
||||
|
||||
def apply(team: Team, perSecond: MaxPerSecond): Source[User, _] =
|
||||
idsBatches(team, perSecond)
|
||||
|
|
|
@ -8,7 +8,10 @@ final private class TeamSocket(
|
|||
chat: lila.chat.ChatApi,
|
||||
teamRepo: TeamRepo,
|
||||
cached: Cached
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, mode: play.api.Mode) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
mode: play.api.Mode
|
||||
) {
|
||||
|
||||
lazy val rooms = makeRoomMap(send)
|
||||
|
||||
|
|
|
@ -18,7 +18,10 @@ final class Env(
|
|||
appConfig: Configuration,
|
||||
makeClient: Index => ESClient,
|
||||
teamRepo: lila.team.TeamRepo
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
private val config = appConfig.get[TeamSearchConfig]("teamSearch")(AutoConfig.loader)
|
||||
|
||||
|
|
|
@ -9,8 +9,10 @@ import lila.team.{ Team, TeamRepo }
|
|||
final class TeamSearchApi(
|
||||
client: ESClient,
|
||||
teamRepo: TeamRepo
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, mat: akka.stream.Materializer)
|
||||
extends SearchReadApi[Team, Query] {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
mat: akka.stream.Materializer
|
||||
) extends SearchReadApi[Team, Query] {
|
||||
|
||||
def search(query: Query, from: From, size: Size) =
|
||||
client.search(query, from, size) flatMap { res =>
|
||||
|
|
|
@ -22,7 +22,10 @@ final class Env(
|
|||
userRepo: lila.user.UserRepo,
|
||||
relationApi: lila.relation.RelationApi,
|
||||
cacheApi: lila.memo.CacheApi
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem
|
||||
) {
|
||||
|
||||
private val config = appConfig.get[TimelineConfig]("timeline")(AutoConfig.loader)
|
||||
|
||||
|
|
|
@ -8,8 +8,10 @@ final private class CreatedOrganizer(
|
|||
api: TournamentApi,
|
||||
tournamentRepo: TournamentRepo,
|
||||
playerRepo: PlayerRepo
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, mat: akka.stream.Materializer)
|
||||
extends Actor {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
mat: akka.stream.Materializer
|
||||
) extends Actor {
|
||||
|
||||
override def preStart(): Unit = {
|
||||
context setReceiveTimeout 15.seconds
|
||||
|
|
|
@ -12,7 +12,10 @@ final private class LeaderboardIndexer(
|
|||
pairingRepo: PairingRepo,
|
||||
playerRepo: PlayerRepo,
|
||||
leaderboardRepo: LeaderboardRepo
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, mat: akka.stream.Materializer) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
mat: akka.stream.Materializer
|
||||
) {
|
||||
|
||||
import LeaderboardApi._
|
||||
import BSONHandlers._
|
||||
|
|
|
@ -266,18 +266,17 @@ final class TournamentRepo(val coll: Coll, playerCollName: CollName)(implicit
|
|||
_.flatMap { tour =>
|
||||
tour.schedule map (tour -> _)
|
||||
}.foldLeft(List.empty[Tournament] -> none[Schedule.Freq]) {
|
||||
case ((tours, skip), (_, sched)) if skip.contains(sched.freq) => (tours, skip)
|
||||
case ((tours, skip), (tour, sched)) =>
|
||||
(
|
||||
tour :: tours,
|
||||
sched.freq match {
|
||||
case Schedule.Freq.Daily => Schedule.Freq.Eastern.some
|
||||
case Schedule.Freq.Eastern => Schedule.Freq.Daily.some
|
||||
case _ => skip
|
||||
}
|
||||
)
|
||||
}
|
||||
._1
|
||||
case ((tours, skip), (_, sched)) if skip.contains(sched.freq) => (tours, skip)
|
||||
case ((tours, skip), (tour, sched)) =>
|
||||
(
|
||||
tour :: tours,
|
||||
sched.freq match {
|
||||
case Schedule.Freq.Daily => Schedule.Freq.Eastern.some
|
||||
case Schedule.Freq.Eastern => Schedule.Freq.Daily.some
|
||||
case _ => skip
|
||||
}
|
||||
)
|
||||
}._1
|
||||
.reverse
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,11 @@ import lila.user.User
|
|||
final private class TournamentSocket(
|
||||
remoteSocketApi: lila.socket.RemoteSocket,
|
||||
chat: lila.chat.ChatApi
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem, mode: play.api.Mode) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem,
|
||||
mode: play.api.Mode
|
||||
) {
|
||||
|
||||
private val allWaitingUsers = new ConcurrentHashMap[Tournament.ID, WaitingUsers.WithNext](64)
|
||||
|
||||
|
|
|
@ -18,7 +18,10 @@ final class TournamentStandingApi(
|
|||
cached: Cached,
|
||||
cacheApi: lila.memo.CacheApi,
|
||||
lightUserApi: lila.user.LightUserApi
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, mat: akka.stream.Materializer) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
mat: akka.stream.Materializer
|
||||
) {
|
||||
|
||||
private val workQueue = new WorkQueue(
|
||||
buffer = 256,
|
||||
|
|
|
@ -9,7 +9,10 @@ final private[tournament] class PairingSystem(
|
|||
pairingRepo: PairingRepo,
|
||||
playerRepo: PlayerRepo,
|
||||
userRepo: UserRepo
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, idGenerator: lila.game.IdGenerator) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
idGenerator: lila.game.IdGenerator
|
||||
) {
|
||||
|
||||
import PairingSystem._
|
||||
import lila.tournament.Tournament.tournamentUrl
|
||||
|
|
|
@ -15,7 +15,10 @@ final class Cached(
|
|||
mongoCache: lila.memo.MongoCache.Api,
|
||||
cacheApi: lila.memo.CacheApi,
|
||||
rankingApi: RankingApi
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: akka.actor.ActorSystem) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: akka.actor.ActorSystem
|
||||
) {
|
||||
|
||||
implicit private val LightUserBSONHandler = Macros.handler[LightUser]
|
||||
implicit private val LightPerfBSONHandler = Macros.handler[LightPerf]
|
||||
|
|
|
@ -29,7 +29,11 @@ final class Env(
|
|||
cacheApi: lila.memo.CacheApi,
|
||||
isOnline: lila.socket.IsOnline,
|
||||
onlineIds: lila.socket.OnlineIds
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, system: ActorSystem, ws: WSClient) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
system: ActorSystem,
|
||||
ws: WSClient
|
||||
) {
|
||||
|
||||
private val config = appConfig.get[UserConfig]("user")(AutoConfig.loader)
|
||||
|
||||
|
|
|
@ -21,7 +21,10 @@ case class UserNotes(user: User, notes: List[Note])
|
|||
final class NoteApi(
|
||||
userRepo: UserRepo,
|
||||
coll: Coll
|
||||
)(implicit ec: scala.concurrent.ExecutionContext, ws: play.api.libs.ws.WSClient) {
|
||||
)(implicit
|
||||
ec: scala.concurrent.ExecutionContext,
|
||||
ws: play.api.libs.ws.WSClient
|
||||
) {
|
||||
|
||||
import reactivemongo.api.bson._
|
||||
import lila.db.BSON.BSONJodaDateTimeHandler
|
||||
|
|
Loading…
Reference in New Issue