/// <summary> /// 发送数据过程 /// </summary> public DataPackage SendProcess(int actionType, ActionParameter parameter) { if (!actions.ContainsKey(actionType)) { return(null); } ActionBase handler = actions[actionType]; handler.Packet = new DataPackage(new DynamicBuffer(0), handler.ActionType); if (handler.SendProcess(parameter)) { return(handler.Packet); } handler.Clean(); return(null); }
/// <summary> /// 处理数据过程 /// </summary> public void DisposeProcess(DataPackage packet) { if (!actions.ContainsKey(packet.PacketType)) { return; } ActionBase action = actions[packet.PacketType]; HandleModule handler = handles[action.ActionType]; ActionParameter parameter = new ActionParameter(); parameter[ACTIONTYPE] = action.ActionType; action.Packet = packet; if (action.ReceiveProcess(parameter) && handler != null) { lock (invokeQueue) invokeQueue.Enqueue(parameter); } action.Clean(); }