Example #1
0
        public void Init()
        {
            realCli.CtorEnvironment = creator.CreateMap;
            realCli.CtorNPC         = creator.CreateNpc;
            realCli.CreatHero       = creator.CreateHero;
            //creator.CreateUnVision();
            //creator.CreateNpcCache ();

            warInfo = realCli.war;

            ///
            /// 准备Team的信息
            ///
            clientTeam = new WarClientTeam(realCli);


            UIReadyInfo uiReady = new UIReadyInfo()
            {
                ClientID   = DeviceInfo.GUID,
                ClientName = "AW_Client",
            };

            string plainJoin = JSON.Instance.ToJSON(uiReady);

            realCli.proxyServer.UIReady(plainJoin);

            if (warInfo.warMo == WarMode.NativeWar)
            {
                ///
                /// 虚拟客户端
                ///
                uiReady = new UIReadyInfo()
                {
                    ClientID   = "-1",
                    ClientName = "AWClient",
                };

                plainJoin = JSON.Instance.ToJSON(uiReady);
                realCli.proxyServer.UIReady(plainJoin);
            }

            ///
            /// 创建默认的地图
            ///
            cached = ClientCached.Instance;
            creator.CreateMap(cached.map);
        }
Example #2
0
        public RealClient(WarInfo war)
        {
            this.war = war;

            cached = ClientCached.Instance;
            cached.clear();

            pool   = new MsgPool <IpcMsg>(HandleIpcMsg);
            CliSub = new SubClient(pool, war);

            monitor = new MonitorServer();
            monitor.startMonitor(this.war, HeartBeatDisConn);

            cliMonitor = new SimpleMonitorClient();

            proxyReady = false;
        }