def lobby_server(request, loop, db_pool, player_service, game_service): ctx = run_lobby_server(("127.0.0.1", None), player_service, game_service, loop) def fin(): ctx.close() loop.run_until_complete(ctx.wait_closed()) request.addfinalizer(fin) return ctx
def lobby_server(request, loop, db_pool, player_service, game_service): ctx = run_lobby_server(('127.0.0.1', None), player_service, game_service, loop) def fin(): ctx.close() loop.run_until_complete(ctx.wait_closed()) request.addfinalizer(fin) return ctx
def lobby_server(request, loop, db_pool, player_service, game_service): ctx = run_lobby_server(('127.0.0.1', None), player_service, game_service, loop) player_service.is_uniqueid_exempt = lambda id: True def fin(): ctx.close() loop.run_until_complete(ctx.wait_closed()) request.addfinalizer(fin) return ctx
def lobby_server(request, loop, player_service, game_service, geoip_service, ladder_service): ctx = run_lobby_server( address=('127.0.0.1', None), geoip_service=geoip_service, player_service=player_service, games=game_service, ladder_service=ladder_service, nts_client=None, loop=loop ) player_service.is_uniqueid_exempt = lambda id: True def fin(): ctx.close() ladder_service.shutdown_queues() loop.run_until_complete(ctx.wait_closed()) request.addfinalizer(fin) return ctx
players_online = PlayerService(db_pool) api_accessor = ApiAccessor() event_service = EventService(api_accessor) achievement_service = AchievementService(api_accessor) game_stats_service = GameStatsService(event_service, achievement_service) natpacket_server = NatPacketServer( addresses=config.LOBBY_NAT_ADDRESSES, loop=loop) loop.run_until_complete(natpacket_server.listen()) server.NatPacketServer.instance = natpacket_server games = GameService(players_online, game_stats_service) matchmaker_queue = MatchmakerQueue('ladder1v1', players_online, games) players_online.ladder_queue = matchmaker_queue ctrl_server = loop.run_until_complete( server.run_control_server(loop, players_online, games)) lobby_server = server.run_lobby_server(('', 8001), players_online, games, loop) for sock in lobby_server.sockets: sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) loop.run_until_complete(done) loop.close() except Exception as ex: logger.exception("Failure booting server {}".format(ex))
players_online = PlayerService(db_pool) api_accessor = ApiAccessor() event_service = EventService(api_accessor) achievement_service = AchievementService(api_accessor) game_stats_service = GameStatsService(event_service, achievement_service) natpacket_server = NatPacketServer(addresses=config.LOBBY_NAT_ADDRESSES, loop=loop) loop.run_until_complete(natpacket_server.listen()) server.NatPacketServer.instance = natpacket_server games = GameService(players_online, game_stats_service) matchmaker_queue = MatchmakerQueue('ladder1v1', players_online, games) players_online.ladder_queue = matchmaker_queue ctrl_server = loop.run_until_complete(server.run_control_server(loop, players_online, games)) lobby_server = server.run_lobby_server(('', 8001), players_online, games, loop) for sock in lobby_server.sockets: sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) loop.run_until_complete(done) loop.close() except Exception as ex: logger.exception("Failure booting server {}".format(ex))
event_service = EventService(api_accessor) achievement_service = AchievementService(api_accessor) game_stats_service = GameStatsService(event_service, achievement_service) games = GameService(players_online, game_stats_service) ladder_service = LadderService(games) ctrl_server = loop.run_until_complete( server.run_control_server(loop, players_online, games)) lobby_server = server.run_lobby_server(address=('', 8001), geoip_service=GeoIpService(), player_service=players_online, games=games, nts_client=twilio_nts, ladder_service=ladder_service, loop=loop) for sock in lobby_server.sockets: sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) loop.run_until_complete(done) players_online.broadcast_shutdown() ladder_service.shutdown_queues() # Close DB connections engine.close() loop.run_until_complete(engine.wait_closed())