public SubClient(MsgPool <IpcMsg> pool, WarInfo war) : base(war) { ClientPool = pool; poller = new Poller(); establish(); }
public RealServer(WarInfo war, Action RepBinded, Action PubBinded) { mWar = war; cached = ServerCached.Instance; cached.clear(); RepBindCompleted = RepBinded; PubBindCompleted = PubBinded; monitor = new MonitorClient(); monitor.startMonitor(mWar); EngineCfg engCfg = Core.EngCfg; cached.curServer = new ServerInfo() { IpAddr = "127.0.0.1", PubPort = engCfg.PubPort, PairPort = engCfg.PairPort, HeartBeatPort = engCfg.HeartBeatPort, ServerName = "Allen", ServerID = DeviceInfo.GUID, }; publisher = new PubServer(war, PubBindCompleted); Resper = new ResponseServer(war, HandleMQMsg, RepBindCompleted); type = GetType(); c_bf = BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.Instance; cmdMethod = new Dictionary <string, MethodInfo>(); cachedMethod(); proxyCli = new ProxyClient(-1, publisher); }
public void startMonitor(WarInfo war, Action HeartBeatDisConn) { if (war.warMo == WarMode.InLanWar) { mHeartBeatDisConn = HeartBeatDisConn; hbCli = new HeartBeatClient(war, ServerTimeOut); } }
public void startMonitor(WarInfo war) { warInfo = war; if (warInfo.warMo == WarMode.InLanWar) { hbServer = new HeartBeatServer(warInfo, this); } }
public RequestClient(WarInfo war, Action <NetMQMessage> real, Action Connected) : base(war) { handler = real; connected = false; establish(Connected); Pool = new MsgPool <NetMQMessage>(sendAndRecv); }
public HeartBeatServer(WarInfo war, MonitorClient climonitor) : base(war) { this.poller = new Poller(); monitor = climonitor; Msg = new NetMQMessage(); Msg.Append(1); establish(); //TimeOut = new t_Timer(new TimerCallback(TTimeOut), null, Timeout.Infinite, Timeout.Infinite); }
public HeartBeatClient(WarInfo war, Action disCon) : base(war) { isConnected = false; OnDisconnected = disCon; CurTimeoutCnt = 0; RepeatTimer = new t_Timer(new TimerCallback(Beat), null, Timeout.Infinite, Timeout.Infinite); TimeOut = new t_Timer(new TimerCallback(TTimeOut), null, Timeout.Infinite, Timeout.Infinite); msg = new NetMQMessage(); msg.Append(0); msg.Append(DeviceInfo.GUID); establish(); }
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); }
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; }
public ResponseServer(WarInfo war, Func <NetMQMessage, NetMQMessage> real, Action BindEd) : base(war) { handler = real; poller = new Poller(); establish(BindEd); }
public PubServer(WarInfo war, Action binded) : base(war) { isBinded = false; establish(binded); }
public ProxyServer(WarInfo war, Action connected = null) { reqCli = new RequestClient(war, HandleMQMsg, connected); FromRep = new Dictionary <string, Action <string> >(); }
public BaseSsock(WarInfo war) { warInfo = war; EngCfg = Core.EngCfg; }