Ejemplo n.º 1
0
        public virtual void process(float tmSlice)
        {
            this._conn.onProcess();
            long tickMillisec = CCTime.getTickMillisec();

            while (this._MsgVec.Count > 0)
            {
                MsgProcesser msgProcesser = ArrayUtil.arrayPopFront <MsgProcesser>(this._MsgVec);
                msgProcesser.Process();
                msgProcesser.Dispose();
                this._netMgr.deleteMSGProcesser(msgProcesser);
                long tickMillisec2 = CCTime.getTickMillisec();
                bool flag          = tickMillisec2 - tickMillisec > 10L;
                if (flag)
                {
                    break;
                }
            }
        }
Ejemplo n.º 2
0
        public void deleteMSGProcesser(MsgProcesser mp)
        {
            uint msgId = mp.msgId;
            bool flag  = mp is RPCMsgProcesser;

            if (flag)
            {
                bool flag2 = !this._rpcMsgProcCls.ContainsKey(msgId);
                if (!flag2)
                {
                    bool flag3 = !this._rpcMsgProcPool.ContainsKey(msgId);
                    if (flag3)
                    {
                        this._rpcMsgProcPool[msgId] = new LinkedList <RPCMsgProcesser>();
                    }
                    LinkedList <RPCMsgProcesser> linkedList = this._rpcMsgProcPool[msgId];
                    mp.msgData = null;
                    mp.session = null;
                    linkedList.AddLast(mp as RPCMsgProcesser);
                }
            }
            else
            {
                bool flag4 = mp is TPKGMsgProcesser;
                if (flag4)
                {
                    bool flag5 = !this._tpkgMsgProcCls.ContainsKey(msgId);
                    if (!flag5)
                    {
                        bool flag6 = !this._tpkgMsgProcPool.ContainsKey(msgId);
                        if (flag6)
                        {
                            this._tpkgMsgProcPool[msgId] = new LinkedList <TPKGMsgProcesser>();
                        }
                        LinkedList <TPKGMsgProcesser> linkedList2 = this._tpkgMsgProcPool[msgId];
                        mp.msgData = null;
                        mp.session = null;
                        linkedList2.AddLast(mp as TPKGMsgProcesser);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public virtual void onTPKGMsgProcesser(uint cmdID, Variant par)
        {
            MsgProcesser msgProcesser = this._netMgr.createTpkgProcesser(cmdID, this, par);
            bool         flag         = msgProcesser == null;

            if (flag)
            {
                DebugTrace.add(Define.DebugTrace.DTT_ERR, "tpkg msg id[" + cmdID + "] without processer");
            }
            else
            {
                bool immiProc = msgProcesser.immiProc;
                if (immiProc)
                {
                    msgProcesser.Process();
                    msgProcesser.Dispose();
                    this._netMgr.deleteMSGProcesser(msgProcesser);
                }
                else
                {
                    this._MsgVec.Add(msgProcesser);
                }
            }
        }