コード例 #1
0
        public MasterClientPeer(InitRequest initRequest, GameApplication application)
            : base(initRequest.Protocol, initRequest.PhotonPeer)
        {
            this.application = application;

            if (MasterApplication.AppStats != null)
            {
                MasterApplication.AppStats.IncrementMasterPeerCount();
                MasterApplication.AppStats.AddSubscriber(this);
            }
        }
コード例 #2
0
        protected virtual void Initialize()
        {
            this.GameServers  = new GameServerCollection();
            this.LoadBalancer = new LoadBalancer <IncomingGameServerPeer>(Path.Combine(this.ApplicationRootPath, "LoadBalancer.config"));

            this.DefaultApplication = new GameApplication("{Default}", this.LoadBalancer);

            if (MasterServerSettings.Default.AppStatsPublishInterval > 0)
            {
                AppStats = new ApplicationStats(MasterServerSettings.Default.AppStatsPublishInterval);
            }

            this.InitResolver();
        }
コード例 #3
0
        private void SetApplication(GameApplication value)
        {
            if (this.application == value)
            {
                return;
            }

            var oldApp = Interlocked.Exchange(ref this.application, value);

            if (oldApp != null)
            {
                oldApp.OnClientDisconnected(this);
            }

            if (value != null)
            {
                value.OnClientConnected(this);
            }
        }
コード例 #4
0
        protected virtual void Initialize()
        {
            this.GameServers = new GameServerCollection();
            this.LoadBalancer = new LoadBalancer<IncomingGameServerPeer>(Path.Combine(this.ApplicationRootPath, "LoadBalancer.config"));

            this.DefaultApplication = new GameApplication("{Default}", this.LoadBalancer);

            if (MasterServerSettings.Default.AppStatsPublishInterval > 0)
            {
                AppStats = new ApplicationStats(MasterServerSettings.Default.AppStatsPublishInterval);
            }

            this.InitResolver();
        }