flatten hub.actor

roundTrouper
Thibault Duplessis 2018-12-09 08:11:28 +07:00
parent b76951abf8
commit c1a67637c6
30 changed files with 73 additions and 75 deletions

View File

@ -16,7 +16,7 @@ object Game extends LilaController {
def delete(gameId: String) = Auth { implicit ctx => me =>
OptionFuResult(GameRepo game gameId) { game =>
if (game.pgnImport.flatMap(_.user) ?? (me.id==)) {
Env.hub.actor.bookmark ! lila.hub.actorApi.bookmark.Remove(game.id)
Env.hub.bookmark ! lila.hub.actorApi.bookmark.Remove(game.id)
(GameRepo remove game.id) >>
(lila.analyse.AnalysisRepo remove game.id) >>
Env.game.cached.clearNbImportedByCache(me.id) inject

View File

@ -47,7 +47,7 @@ object Main extends LilaController {
}
def captchaCheck(id: String) = Open { implicit ctx =>
Env.hub.actor.captcher ? ValidCaptcha(id, ~get("solution")) map {
Env.hub.captcher ? ValidCaptcha(id, ~get("solution")) map {
case valid: Boolean => Ok(if (valid) 1 else 0)
}
}

View File

@ -24,7 +24,7 @@ final class Env(
lazy val analyser = new Analyser(
indexer = indexer,
requesterApi = requesterApi,
studyActor = hub.actor.study,
studyActor = hub.study,
bus = system.lilaBus
)
@ -43,6 +43,6 @@ object Env {
system = lila.common.PlayApp.system,
evalCacheHandler = lila.evalCache.Env.current.socketHandler,
hub = lila.hub.Env.current,
indexer = lila.hub.Env.current.actor.gameSearch
indexer = lila.hub.Env.current.gameSearch
)
}

View File

@ -155,7 +155,7 @@ object Env {
lazy val current = "api" boot new Env(
config = lila.common.PlayApp.loadConfig,
settingStore = lila.memo.Env.current.settingStore,
renderer = lila.hub.Env.current.actor.renderer,
renderer = lila.hub.Env.current.renderer,
userEnv = lila.user.Env.current,
annotator = lila.analyse.Env.current.annotator,
lobbyEnv = lila.lobby.Env.current,

View File

@ -13,7 +13,7 @@ final class Env(
lazy val gameStateStream = new GameStateStream(system, jsonView)
lazy val player = new BotPlayer(hub.actor.chat)(system)
lazy val player = new BotPlayer(hub.chat)(system)
val form = BotForm
}

View File

@ -62,8 +62,8 @@ object Env {
db = lila.db.Env.current,
flood = lila.security.Env.current.flood,
spam = lila.security.Env.current.spam,
shutup = lila.hub.Env.current.actor.shutup,
modLog = lila.hub.Env.current.actor.mod,
shutup = lila.hub.Env.current.shutup,
modLog = lila.hub.Env.current.mod,
asyncCache = lila.memo.Env.current.asyncCache,
system = lila.common.PlayApp.system
)

View File

@ -43,12 +43,12 @@ final class Env(
lazy val topicApi = new TopicApi(
env = this,
indexer = hub.actor.forumSearch,
indexer = hub.forumSearch,
maxPerPage = MaxPerPage(TopicMaxPerPage),
modLog = modLog,
spam = spam,
shutup = shutup,
timeline = hub.actor.timeline,
timeline = hub.timeline,
detectLanguage = detectLanguage,
mentionNotifier = mentionNotifier,
bus = system.lilaBus
@ -56,18 +56,18 @@ final class Env(
lazy val postApi = new PostApi(
env = this,
indexer = hub.actor.forumSearch,
indexer = hub.forumSearch,
maxPerPage = MaxPerPage(PostMaxPerPage),
modLog = modLog,
spam = spam,
shutup = shutup,
timeline = hub.actor.timeline,
timeline = hub.timeline,
detectLanguage = detectLanguage,
mentionNotifier = mentionNotifier,
bus = system.lilaBus
)
lazy val forms = new DataForm(hub.actor.captcher)
lazy val forms = new DataForm(hub.captcher)
lazy val recent = new Recent(postApi, RecentTtl, RecentNb, asyncCache, PublicCategIds)
system.lilaBus.subscribeFun('team, 'gdprErase) {
@ -87,7 +87,7 @@ object Env {
db = lila.db.Env.current,
modLog = lila.mod.Env.current.logApi,
spam = lila.security.Env.current.spam,
shutup = lila.hub.Env.current.actor.shutup,
shutup = lila.hub.Env.current.shutup,
hub = lila.hub.Env.current,
detectLanguage = DetectLanguage(lila.common.PlayApp loadConfig "detectlanguage"),
notifyApi = lila.notify.Env.current.api,

View File

@ -5,25 +5,23 @@ import com.typesafe.config.Config
final class Env(config: Config, system: ActorSystem) {
object actor {
val gameSearch = select("actor.game.search")
val renderer = select("actor.renderer")
val captcher = select("actor.captcher")
val forumSearch = select("actor.forum.search")
val teamSearch = select("actor.team.search")
val fishnet = select("actor.fishnet")
val tournamentApi = select("actor.tournament.api")
val timeline = select("actor.timeline.user")
val bookmark = select("actor.bookmark")
val lobby = select("actor.lobby")
val relation = select("actor.relation")
val report = select("actor.report")
val shutup = select("actor.shutup")
val mod = select("actor.mod")
val chat = select("actor.chat")
val notification = select("actor.notify")
val study = select("actor.study")
}
val gameSearch = select("actor.game.search")
val renderer = select("actor.renderer")
val captcher = select("actor.captcher")
val forumSearch = select("actor.forum.search")
val teamSearch = select("actor.team.search")
val fishnet = select("actor.fishnet")
val tournamentApi = select("actor.tournament.api")
val timeline = select("actor.timeline.user")
val bookmark = select("actor.bookmark")
val lobby = select("actor.lobby")
val relation = select("actor.relation")
val report = select("actor.report")
val shutup = select("actor.shutup")
val mod = select("actor.mod")
val chat = select("actor.chat")
val notification = select("actor.notify")
val study = select("actor.study")
val bus = system.lilaBus

View File

@ -58,7 +58,7 @@ object Env {
lazy val current = "message" boot new Env(
config = lila.common.PlayApp loadConfig "message",
db = lila.db.Env.current,
shutup = lila.hub.Env.current.actor.shutup,
shutup = lila.hub.Env.current.shutup,
notifyApi = lila.notify.Env.current.api,
blocks = lila.relation.Env.current.api.fetchBlocks,
follows = lila.relation.Env.current.api.fetchFollows,

View File

@ -61,7 +61,7 @@ final class Env(
logApi = logApi,
userSpy = userSpy,
firewall = firewall,
reporter = hub.actor.report,
reporter = hub.report,
reportApi = reportApi,
lightUserApi = lightUserApi,
notifier = notifier,
@ -80,8 +80,8 @@ final class Env(
collAssessments = db(CollectionPlayerAssessment),
logApi = logApi,
modApi = api,
reporter = hub.actor.report,
fishnet = hub.actor.fishnet
reporter = hub.report,
fishnet = hub.fishnet
)
lazy val gamify = new Gamify(

View File

@ -32,7 +32,7 @@ final class Env(
private lazy val notifier = new PlanNotifier(
notifyApi = notifyApi,
scheduler = scheduler,
timeline = hub.actor.timeline
timeline = hub.timeline
)
private lazy val monthlyGoalApi = new MonthlyGoalApi(

View File

@ -35,7 +35,7 @@ final class Env(
object Env {
lazy val current: Env = "pool" boot new Env(
lobbyActor = lila.hub.Env.current.actor.lobby,
lobbyActor = lila.hub.Env.current.lobby,
playbanApi = lila.playban.Env.current.api,
system = lila.common.PlayApp.system,
onStart = lila.game.Env.current.onStart

View File

@ -93,7 +93,7 @@ object Env {
lazy val current: Env = "puzzle" boot new Env(
config = lila.common.PlayApp loadConfig "puzzle",
renderer = lila.hub.Env.current.actor.renderer,
renderer = lila.hub.Env.current.renderer,
lightUserApi = lila.user.Env.current.lightUserApi,
asyncCache = lila.memo.Env.current.asyncCache,
system = lila.common.PlayApp.system,

View File

@ -30,12 +30,12 @@ final class Env(
private lazy val notifier = new Notifier(
notifyApi = notifyApi,
timeline = hub.actor.timeline
timeline = hub.timeline
)
lazy val search = new Search(questionColl)
lazy val forms = new DataForm(hub.actor.captcher, detectLanguage)
lazy val forms = new DataForm(hub.captcher, detectLanguage)
system.lilaBus.subscribeFun('gdprErase) {
case lila.user.User.GDPRErase(user) =>

View File

@ -29,10 +29,10 @@ final class Env(
lazy val api = new RelationApi(
coll = coll,
actor = hub.actor.relation,
actor = hub.relation,
bus = system.lilaBus,
timeline = hub.actor.timeline,
reporter = hub.actor.report,
timeline = hub.timeline,
reporter = hub.report,
followable = followable,
asyncCache = asyncCache,
maxFollow = MaxFollow,

View File

@ -27,10 +27,10 @@ final class Env(
text = "Report score threshold. Reports with lower scores are concealed to moderators".some
)
lazy val forms = new DataForm(hub.actor.captcher, NetDomain)
lazy val forms = new DataForm(hub.captcher, NetDomain)
private lazy val autoAnalysis = new AutoAnalysis(
fishnet = hub.actor.fishnet,
fishnet = hub.fishnet,
system = system
)

View File

@ -160,7 +160,7 @@ final class Env(
)
private lazy val notifier = new RoundNotifier(
timeline = hub.actor.timeline,
timeline = hub.timeline,
isUserPresent = isUserPresent,
notifyApi = notifyApi
)
@ -200,7 +200,7 @@ final class Env(
)
lazy val messenger = new Messenger(
chat = hub.actor.chat
chat = hub.chat
)
def getSocketStatus(gameId: Game.ID): Fu[SocketStatus] =
@ -225,7 +225,7 @@ final class Env(
MoveMonitor.start(system, moveTimeChannel)
system.actorOf(
Props(new Titivate(roundMap, hub.actor.bookmark, hub.actor.chat)),
Props(new Titivate(roundMap, hub.bookmark, hub.chat)),
name = "titivate"
)

View File

@ -100,7 +100,7 @@ private[round] final class SocketHandler(
sd d int "sd"
} send(HoldAlert(playerId, mean, sd, member.ip))
case ("berserk", o) => member.userId foreach { userId =>
hub.actor.tournamentApi ! Berserk(gameId, userId)
hub.tournamentApi ! Berserk(gameId, userId)
member.push(ackMessage((o \ "d" \ "a").asOpt[AckId]))
}
case ("rep", o) => for {

View File

@ -216,7 +216,7 @@ object Env {
},
system = system,
scheduler = lila.common.PlayApp.scheduler,
captcher = lila.hub.Env.current.actor.captcher,
captcher = lila.hub.Env.current.captcher,
lifecycle = lila.common.PlayApp.lifecycle
)
}

View File

@ -27,7 +27,7 @@ final class Env(
ctx.me.fold(AnonConfigRepo filter ctx.req)(UserConfigRepo.filter)
lazy val processor = new Processor(
lobby = hub.actor.lobby,
lobby = hub.lobby,
gameCache = gameCache,
maxPlaying = MaxPlaying,
fishnetPlayer = fishnetPlayer,

View File

@ -44,7 +44,7 @@ object Env {
lazy val current: Env = "shutup" boot new Env(
config = lila.common.PlayApp loadConfig "shutup",
reporter = lila.hub.Env.current.actor.report,
reporter = lila.hub.Env.current.report,
system = lila.common.PlayApp.system,
follows = lila.relation.Env.current.api.fetchFollows _,
db = lila.db.Env.current

View File

@ -38,8 +38,8 @@ final class Env(
repo = repo,
system = system,
socketMap = socketMap,
renderer = hub.actor.renderer,
timeline = hub.actor.timeline,
renderer = hub.renderer,
timeline = hub.timeline,
onGameStart = onGameStart,
sequencers = sequencerMap,
asyncCache = asyncCache
@ -72,7 +72,7 @@ final class Env(
lazy val socketHandler = new SocketHandler(
hub = hub,
socketMap = socketMap,
chat = hub.actor.chat,
chat = hub.chat,
exists = repo.exists
)

View File

@ -64,7 +64,7 @@ object Handler {
private def baseController(hub: lila.hub.Env, member: SocketMember, uid: Socket.Uid): Controller = {
case ("following_onlines", _) => member.userId foreach { u =>
hub.actor.relation ! ReloadOnlineFriends(u)
hub.relation ! ReloadOnlineFriends(u)
}
case ("startWatching", o) => o str "d" foreach { ids =>
hub.bus.publish(StartWatching(uid, member, ids.split(' ').toSet), 'socketMoveBroadcast)
@ -107,7 +107,7 @@ object Handler {
}
}
case ("notified", _) => member.userId foreach { userId =>
hub.actor.notification ! lila.hub.actorApi.notify.Notified(userId)
hub.notification ! lila.hub.actorApi.notify.Notified(userId)
}
case _ => // logwarn("Unhandled msg: " + msg)
}

View File

@ -55,7 +55,7 @@ final class Env(
renderer = renderer,
api = api,
isOnline = isOnline,
timeline = hub.actor.timeline,
timeline = hub.timeline,
keyword = Stream.Keyword(Keyword),
alwaysFeatured = alwaysFeaturedSetting.get,
googleApiKey = GoogleApiKey,
@ -77,7 +77,7 @@ object Env {
config = lila.common.PlayApp loadConfig "streamer",
system = lila.common.PlayApp.system,
settingStore = lila.memo.Env.current.settingStore,
renderer = lila.hub.Env.current.actor.renderer,
renderer = lila.hub.Env.current.renderer,
isOnline = lila.user.Env.current.isOnline,
asyncCache = lila.memo.Env.current.asyncCache,
notifyApi = lila.notify.Env.current.api,

View File

@ -71,7 +71,7 @@ final class Env(
lazy val socketHandler = new SocketHandler(
hub = hub,
socketMap = socketMap,
chat = hub.actor.chat,
chat = hub.chat,
api = api,
evalCacheHandler = evalCacheHandler
)
@ -90,7 +90,7 @@ final class Env(
importer = importer,
pgnFetch = new PgnFetch,
lightUser = lightUserApi,
chat = hub.actor.chat,
chat = hub.chat,
domain = NetDomain
)
@ -122,7 +122,7 @@ final class Env(
)
private lazy val serverEvalRequester = new ServerEval.Requester(
fishnetActor = hub.actor.fishnet,
fishnetActor = hub.fishnet,
chapterRepo = chapterRepo
)
@ -152,9 +152,9 @@ final class Env(
explorerGameHandler = explorerGame,
lightUser = lightUserApi.sync,
scheduler = system.scheduler,
chat = hub.actor.chat,
chat = hub.chat,
bus = system.lilaBus,
timeline = hub.actor.timeline,
timeline = hub.timeline,
socketMap = socketMap,
serverEvalRequester = serverEvalRequester,
lightStudyCache = lightStudyCache

View File

@ -32,7 +32,7 @@ final class Env(
member = db(CollectionMember)
)
lazy val forms = new DataForm(colls.team, hub.actor.captcher)
lazy val forms = new DataForm(colls.team, hub.captcher)
lazy val memberStream = new TeamMemberStream(colls.member)(system)
@ -41,8 +41,8 @@ final class Env(
cached = cached,
notifier = notifier,
bus = system.lilaBus,
indexer = hub.actor.teamSearch,
timeline = hub.actor.timeline,
indexer = hub.teamSearch,
timeline = hub.timeline,
modLog = modLog
)

View File

@ -60,7 +60,7 @@ object Env {
hub = lila.hub.Env.current,
getFriendIds = lila.relation.Env.current.api.fetchFriends,
getFollowerIds = lila.relation.Env.current.api.fetchFollowersFromSecondary,
renderer = lila.hub.Env.current.actor.renderer,
renderer = lila.hub.Env.current.renderer,
asyncCache = lila.memo.Env.current.asyncCache,
system = lila.common.PlayApp.system
)

View File

@ -97,8 +97,8 @@ final class Env(
if (tour.isShield) scheduler.once(10 seconds)(shieldApi.clear)
else if (Revolution is tour) scheduler.once(10 seconds)(revolutionApi.clear)
},
renderer = hub.actor.renderer,
timeline = hub.actor.timeline,
renderer = hub.renderer,
timeline = hub.timeline,
socketMap = socketMap,
trophyApi = trophyApi,
verify = verify,
@ -117,7 +117,7 @@ final class Env(
lazy val socketHandler = new SocketHandler(
hub = hub,
socketMap = socketMap,
chat = hub.actor.chat,
chat = hub.chat,
flood = flood
)

View File

@ -26,7 +26,7 @@ final class Env(
private val tvTrouper = new TvTrouper(
system,
hub.actor.renderer,
hub.renderer,
selectChannel,
lightUser,
onSelect

View File

@ -111,7 +111,7 @@ object Env {
mongoCache = lila.memo.Env.current.mongoCache,
asyncCache = lila.memo.Env.current.asyncCache,
scheduler = lila.common.PlayApp.scheduler,
timeline = lila.hub.Env.current.actor.timeline,
timeline = lila.hub.Env.current.timeline,
system = lila.common.PlayApp.system
)
}