protected virtual void InitApplications()
        {
            var codebase    = Assembly.GetExecutingAssembly().CodeBase;
            var approotPath = codebase.Substring(0, codebase.IndexOf("LoadBalancing.UnitTests/bin/Debug/"));

            if (approotPath.StartsWith("file:///"))
            {
                approotPath = approotPath.Substring("file:///".Length);
            }

            this.nameServer = this.photonHost.AddApplication <PhotonApp>(
                NameServerAppName, "127.0.0.1", 4533, "Photon.NameServer.dll.config", approotPath + "../NameServer/");

            this.masterServer = this.photonHost.AddApplication <TestMasterApplication>(
                MasterServerAppName, "127.0.0.1", 4530, this.configFileName, approotPath);
            this.photonHost.AddListenerToApplication(this.MasterServer, "127.0.0.1", 4520);

            this.gameServer = this.photonHost.AddApplication <TestApplication>(
                GameServerAppName, "127.0.0.1", 4531, this.configFileName, approotPath);

            this.gameServer2 = this.photonHost.AddApplication <TestApplication>(
                GameServer2AppName, "127.0.0.1", 4532, this.configFileName, approotPath);
            ((TestApplication)this.GameServer2.Application).SetGamingTcpPort(4532);

            this.nameServer.Start();
            this.masterServer.Start();
            this.gameServer.Start();
            this.gameServer2.Start();

            // give the applications some time to connect to other servers
            Thread.Sleep(100);
        }
 protected static void StopServer <T>(ref PhotonApplicationProxy <T> server) where T : ApplicationBase
 {
     if (server != null)
     {
         server.Stop();
         server = null;
     }
 }
        public new bool Connect(PhotonApplicationProxy serverAppProxy)
        {
            Assert.IsNotNull(serverAppProxy);

            if (base.Connect(serverAppProxy))
            {
                this.ServerAppProxy = serverAppProxy;
                return true;
            }
            return false;
        }
Esempio n. 4
0
        public new bool Connect(PhotonApplicationProxy serverAppProxy)
        {
            Assert.IsNotNull(serverAppProxy);

            if (base.Connect(serverAppProxy))
            {
                this.ServerAppProxy = serverAppProxy;
                return(true);
            }
            return(false);
        }
        public override bool Connect(PhotonApplicationProxy serverAppProxy, object custom = null)
        {
            Assert.IsNotNull(serverAppProxy);

            if (base.Connect(serverAppProxy, custom))
            {
                this.ServerAppProxy = serverAppProxy;
                return(true);
            }
            return(false);
        }