public virtual void handleMsg(ByteBuffer msg) { byte byCmd = 0; msg.readUnsignedInt8(ref byCmd); byte byParam = 0; msg.readUnsignedInt8(ref byParam); msg.setPos(0); if (m_id2DispDic.ContainsKey(byCmd)) { Ctx.m_instance.m_logSys.log(string.Format("处理消息: byCmd = {0}, byParam = {1}", byCmd, byParam)); m_id2DispDic[byCmd].handleMsg(msg, byCmd, byParam); } else { Ctx.m_instance.m_logSys.log(string.Format("消息没有处理: byCmd = {0}, byParam = {1}", byCmd, byParam)); } if (m_luaCSBridgeNetDispHandle != null) { m_luaCSBridgeNetDispHandle.handleMsg(msg, byCmd, byParam); } }
// 加载一个表完成 public void onLoadEventHandle(IDispatchObject dispObj) { m_res = dispObj as ResItem; if (m_res.refCountResLoadResultNotify.resLoadState.hasSuccessLoaded()) { Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem0, m_res.GetPath()); byte[] bytes = m_res.getBytes(""); if (bytes != null) { m_byteArray = Ctx.m_instance.m_factoryBuild.buildByteBuffer(); m_byteArray.clear(); m_byteArray.writeBytes(bytes, 0, (uint)bytes.Length); m_byteArray.setPos(0); readTable(getTableIDByPath(m_res.GetPath()), m_byteArray); } } else if (m_res.refCountResLoadResultNotify.resLoadState.hasFailed()) { Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem1, m_res.GetPath()); } // 卸载资源 Ctx.m_instance.m_resLoadMgr.unload(m_res.GetPath(), onLoadEventHandle); }
public virtual void handleMsg(ByteBuffer msg) { byte byCmd = 0; msg.readUnsignedInt8(ref byCmd); byte byParam = 0; msg.readUnsignedInt8(ref byParam); msg.setPos(0); if(m_id2DispDic.ContainsKey(byCmd)) { Ctx.m_instance.m_logSys.log(string.Format("处理消息: byCmd = {0}, byParam = {1}", byCmd, byParam)); m_id2DispDic[byCmd].handleMsg(msg, byCmd, byParam); } else { Ctx.m_instance.m_logSys.log(string.Format("消息没有处理: byCmd = {0}, byParam = {1}", byCmd, byParam)); } if(m_luaCSBridgeNetDispHandle != null) { m_luaCSBridgeNetDispHandle.handleMsg(msg, byCmd, byParam); } }