/// <summary> /// 添加 cmd call /// </summary> /// <param name="cmd"></param> /// <param name="call"></param> /// <param name="state"></param> public virtual void AddCmdCall(int cmd, MsgDataCall call, object state = null) { MsgCmdCallModel callInfo = new MsgCmdCallModel() { Cmd = cmd, Call = call, State = state }; this.MsgCmdCallDic[cmd] = callInfo; }
private void OnMsgCmdCall(MsgData msg, MsgCmdCallModel callInfo) { if (callInfo == null || callInfo.Call == null) { return; } callInfo.Call(this, msg, callInfo.State); callInfo.State = null; }