Exemplo n.º 1
0
        public GameApplication(string applicationId, LoadBalancer<IncomingGameServerPeer> loadBalancer)
        {
            if (log.IsDebugEnabled)
            {
                log.DebugFormat("Creating application: appId={0}", applicationId);
            }

            this.ApplicationId = applicationId;
            this.LoadBalancer = loadBalancer;
            this.PlayerOnlineCache = new PlayerCache();
            this.LobbyFactory = new LobbyFactory(this);        
        }
Exemplo n.º 2
0
        public LobbyStatsPublisher(PoolFiber fiber, LobbyFactory lobbyFactory, int publishIntervalSeconds, int maxLobbyStatsCount)
        {
            this.lobbyFactory       = lobbyFactory;
            this.maxLobbyStatsCount = maxLobbyStatsCount;

            this.fiber = fiber;
            this.fiber.Start();

            if (publishIntervalSeconds > 0)
            {
                this.schedule = this.fiber.ScheduleOnInterval(this.BroadcastStatisticEvent, 0, publishIntervalSeconds * 1000);
            }
        }
Exemplo n.º 3
0
        public LobbyStatsPublisher(LobbyFactory lobbyFactory, int publishIntervalSeconds, int maxLobbyStatsCount)
        {
            this.lobbyFactory = lobbyFactory;
            this.maxLobbyStatsCount = maxLobbyStatsCount;
            this.subscriber = new HashSet<PeerBase>();

            this.fiber = new PoolFiber();
            this.fiber.Start();

            if (publishIntervalSeconds > 0)
            {
                this.schedule = this.fiber.ScheduleOnInterval(this.BroadcastStatisticEvent, 0, publishIntervalSeconds * 1000);
            }
        }
Exemplo n.º 4
0
        public LobbyStatsPublisher(LobbyFactory lobbyFactory, int publishIntervalSeconds, int maxLobbyStatsCount)
        {
            this.lobbyFactory       = lobbyFactory;
            this.maxLobbyStatsCount = maxLobbyStatsCount;
            this.subscriber         = new HashSet <PeerBase>();

            this.fiber = new PoolFiber();
            this.fiber.Start();

            if (publishIntervalSeconds > 0)
            {
                this.schedule = this.fiber.ScheduleOnInterval(this.BroadcastStatisticEvent, 0, publishIntervalSeconds * 1000);
            }
        }
Exemplo n.º 5
0
 public LobbyStatsPublisher(LobbyFactory lobbyFactory, int publishIntervalSeconds, int maxLobbyStatsCount)
     : this(new PoolFiber(), lobbyFactory, publishIntervalSeconds, maxLobbyStatsCount)
 {
 }