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);
            }
        }
        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();
        }
Exemple #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);
            }
        }
        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();
        }