Пример #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);        
        }
Пример #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);
            }
        }
Пример #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);
            }
        }
Пример #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);
            }
        }
Пример #5
0
 public LobbyStatsPublisher(LobbyFactory lobbyFactory, int publishIntervalSeconds, int maxLobbyStatsCount)
     : this(new PoolFiber(), lobbyFactory, publishIntervalSeconds, maxLobbyStatsCount)
 {
 }