Example #1
0
        private static void TestRequester()
        {
            Regulus.Remoting.Ghost.Photon.Agent agent = new Regulus.Remoting.Ghost.Photon.Agent(new Regulus.Remoting.Ghost.Config()
            {
                Name = "Test", Address = "127.0.0.1:5055"
            });

            agent.Launch(new Regulus.Remoting.Ghost.LinkState()
            {
                LinkSuccess = () => { }, LinkFail = (msg) => { }
            });

            var provider = agent.QueryProvider <TestRemotingCommon.ITest>();

            provider.Supply   += new Action <TestRemotingCommon.ITest>(provider_Supply);
            provider.Unsupply += new Action <TestRemotingCommon.ITest>(provider_Unsupply);

            while (agent.Update())
            {
                ;
            }

            agent.Shutdown();
        }
Example #2
0
        private static void TestRequester()
        {
            Regulus.Remoting.Ghost.Photon.Agent agent = new Regulus.Remoting.Ghost.Photon.Agent(new Regulus.Remoting.Ghost.Config() { Name = "Test", Address = "127.0.0.1:5055" });

            agent.Launch(new Regulus.Remoting.Ghost.LinkState() { LinkSuccess = () => { }, LinkFail = (msg) => { } });

            var provider = agent.QueryProvider<TestRemotingCommon.ITest>();

            provider.Supply += new Action<TestRemotingCommon.ITest>(provider_Supply);
            provider.Unsupply += new Action<TestRemotingCommon.ITest>(provider_Unsupply);

            while (agent.Update()) ;

            agent.Shutdown();
        }
Example #3
0
        public void Launch()
        {
            if (_Complex != null)
            {
                _TimeProvider.Remove(_Complex);
                _VerifyProvider.Remove(_Complex);
                _ParkingProvider.Remove(_Complex);
                _MapInfomationProvider.Remove(_Complex);
                _PlayerProvider.Remove(_Complex);
                _ObservedAbilityProvider.Remove(_Complex);
            }

            var linkStatu = new Regulus.Remoting.Ghost.LinkState();
            linkStatu.LinkSuccess += () =>
            {
                if (LinkSuccess != null)
                    LinkSuccess();
            };
            linkStatu.LinkFail += (s) =>
            {
                if(LinkFail != null)
                    LinkFail(s);
            };
            _Complex = new Regulus.Remoting.Ghost.Photon.Agent(_Config);

            _Complex.Launch(linkStatu);
            _VerifyProvider.Add(_Complex);
            _ParkingProvider.Add(_Complex);
            _MapInfomationProvider.Add(_Complex);
            _PlayerProvider.Add(_Complex);
            _ObservedAbilityProvider.Add(_Complex);
            _TimeProvider.Add(_Complex);
        }
Example #4
0
 public void Shutdown()
 {
     if (_Complex != null)
         _Complex.Shutdown();
     _Complex = null;
 }