public override bool acceptMessageData(BinaryReader messageDataReader, TreeView outputTreeView) { bool handled = true; PacketOpcode opcode = Util.readOpcode(messageDataReader); switch (opcode) { case PacketOpcode.Evt_Item__Appraise_ID: { Appraise message = Appraise.read(messageDataReader); message.contributeToTreeView(outputTreeView); break; } case PacketOpcode.Evt_Item__UseDone_ID: { UseDone message = UseDone.read(messageDataReader); message.contributeToTreeView(outputTreeView); break; } case PacketOpcode.Evt_Item__AppraiseDone_ID: { AppraiseDone message = AppraiseDone.read(messageDataReader); message.contributeToTreeView(outputTreeView); break; } case PacketOpcode.Evt_Item__QueryItemMana_ID: { QueryItemMana message = QueryItemMana.read(messageDataReader); message.contributeToTreeView(outputTreeView); break; } case PacketOpcode.Evt_Item__QueryItemManaResponse_ID: { QueryItemManaResponse message = QueryItemManaResponse.read(messageDataReader); message.contributeToTreeView(outputTreeView); break; } default: { handled = false; break; } } return(handled); }
public static Order read(ByteBuffer data) { Order order = new Order(); order.id = data.ReadLong(); order.dealId = data.ReadLong(); order.buyId = data.ReadLong(); order.buyerName = data.ReadString(); order.num = data.ReadInt(); order.price = float.Parse(data.ReadString()); order.state = data.ReadByte(); order.helpflag = data.ReadByte() == 1; for (byte i = 0; i <= order.state; i++) { string time = data.ReadString(); order.times.Add(time); } order.sellerAppraise = Appraise.read(data, order); order.buyerAppraise = Appraise.read(data, order); order.revoke = data.ReadInt(); return(order); }