コード例 #1
0
        public bool initialize()
        {
            TCPCmdDispatcher.getInstance().registerProcessor(10138, ZhanMengShiJianCmdProcessor.getInstance());
            TCPCmdDispatcher.getInstance().registerProcessor(10139, ZhanMengShiJianDetailCmdProcessor.getInstance());
            List <ZhanMengShiJianData> dataList = ZhanMengShiJianDBController.getInstance().getZhanMengShiJianDataList();
            bool result;

            if (null == dataList)
            {
                result = true;
            }
            else
            {
                foreach (ZhanMengShiJianData data in dataList)
                {
                    List <ZhanMengShiJianData> _dataList = null;
                    if (!this.dataCache.TryGetValue(data.BHID, out _dataList))
                    {
                        _dataList = new List <ZhanMengShiJianData>();
                        this.dataCache.Add(data.BHID, _dataList);
                    }
                    if (_dataList.Count < ZhanMengShiJianConstants.MaxCacheNum)
                    {
                        _dataList.Add(data);
                    }
                }
                result = true;
            }
            return(result);
        }
コード例 #2
0
 public bool initialize()
 {
     //注册战盟事件指令处理器
     TCPCmdDispatcher.getInstance().registerProcessor((int)TCPGameServerCmds.CMD_SPR_ZHANMENGSHIJIAN_DETAIL, 2, ZhanMengShiJianDetailCmdProcessor.getInstance());
     //向事件源注册监听器
     GlobalEventSource.getInstance().registerListener((int)EventTypes.ZhanMengShiJian, ZhanMengShiJianEventListener.getInstance());
     return(true);
 }
コード例 #3
0
 public bool initialize()
 {
     TCPCmdDispatcher.getInstance().registerProcessor(566, 2, ZhanMengShiJianDetailCmdProcessor.getInstance());
     GlobalEventSource.getInstance().registerListener(0, ZhanMengShiJianEventListener.getInstance());
     return(true);
 }
コード例 #4
0
        public bool initialize()
        {
            //战盟事件指令处理器
            TCPCmdDispatcher.getInstance().registerProcessor((int)TCPGameServerCmds.CMD_DB_ADD_ZHANMENGSHIJIAN, ZhanMengShiJianCmdProcessor.getInstance());
            //战盟事件详情指令处理器
            TCPCmdDispatcher.getInstance().registerProcessor((int)TCPGameServerCmds.CMD_DB_ZHANMENGSHIJIAN_DETAIL, ZhanMengShiJianDetailCmdProcessor.getInstance());

            List <ZhanMengShiJianData> dataList = ZhanMengShiJianDBController.getInstance().getZhanMengShiJianDataList();

            if (null == dataList)
            {
                return(true);
            }

            foreach (ZhanMengShiJianData data in dataList)
            {
                List <ZhanMengShiJianData> _dataList = null;
                if (!dataCache.TryGetValue(data.BHID, out _dataList))
                {
                    _dataList = new List <ZhanMengShiJianData>();
                    dataCache.Add(data.BHID, _dataList);
                }

                if (_dataList.Count >= MaxCacheNum)
                {
                    continue;
                }

                _dataList.Add(data);
            }

            return(true);
        }