Exemplo n.º 1
0
        public static Recv_ResetTrade read(BinaryReader binaryReader)
        {
            Recv_ResetTrade newObj = new Recv_ResetTrade();

            newObj.source = binaryReader.ReadUInt32();
            return(newObj);
        }
Exemplo n.º 2
0
    public override bool acceptMessageData(BinaryReader messageDataReader, TreeView outputTreeView)
    {
        bool handled = true;

        PacketOpcode opcode = Util.readOpcode(messageDataReader);

        switch (opcode)
        {
        case PacketOpcode.Evt_Trade__CloseTradeNegotiations_ID:
        case PacketOpcode.Evt_Trade__DeclineTrade_ID:
        case PacketOpcode.Evt_Trade__ResetTrade_ID:
        case PacketOpcode.Evt_Trade__Recv_ClearTradeAcceptance_ID: {
            EmptyMessage message = new EmptyMessage(opcode);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.Evt_Trade__OpenTradeNegotiations_ID: {
            OpenTradeNegotiations message = OpenTradeNegotiations.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.Evt_Trade__AddToTrade_ID: {
            AddToTrade message = AddToTrade.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        // TODO: PacketOpcode.Evt_Trade__RemoveFromTrade_ID
        case PacketOpcode.Evt_Trade__AcceptTrade_ID: {
            AcceptTrade message = AcceptTrade.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        // TODO: PacketOpcode.Evt_Trade__DumpTrade_ID
        case PacketOpcode.Evt_Trade__Recv_RegisterTrade_ID: {
            Recv_RegisterTrade message = Recv_RegisterTrade.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.Evt_Trade__Recv_OpenTrade_ID: {
            Recv_OpenTrade message = Recv_OpenTrade.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.Evt_Trade__Recv_CloseTrade_ID: {
            Recv_CloseTrade message = Recv_CloseTrade.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.Evt_Trade__Recv_AddToTrade_ID: {
            Recv_AddToTrade message = Recv_AddToTrade.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.Evt_Trade__Recv_RemoveFromTrade_ID: {
            Recv_RemoveFromTrade message = Recv_RemoveFromTrade.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.Evt_Trade__Recv_AcceptTrade_ID: {
            Recv_AcceptTrade message = Recv_AcceptTrade.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.Evt_Trade__Recv_DeclineTrade_ID: {
            Recv_DeclineTrade message = Recv_DeclineTrade.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.Evt_Trade__Recv_ResetTrade_ID: {
            Recv_ResetTrade message = Recv_ResetTrade.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.Evt_Trade__Recv_TradeFailure_ID: {
            Recv_TradeFailure message = Recv_TradeFailure.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        default: {
            handled = false;
            break;
        }
        }

        return(handled);
    }