Example #1
0
    public override bool acceptMessageData(BinaryReader messageDataReader, TreeView outputTreeView)
    {
        bool handled = true;

        PacketOpcode opcode = Util.readOpcode(messageDataReader);

        switch (opcode)
        {
        case PacketOpcode.Evt_Combat__CancelAttack_ID:
        case PacketOpcode.Evt_Combat__CommenceAttack_ID: {
            EmptyMessage message = new EmptyMessage(opcode);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        // TODO: Evt_Combat__UntargetedMeleeAttack_ID
        case PacketOpcode.Evt_Combat__TargetedMeleeAttack_ID: {
            TargetedMeleeAttack message = TargetedMeleeAttack.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

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

        // TODO: Evt_Combat__UntargetedMissileAttack_ID
        case PacketOpcode.Evt_Combat__ChangeCombatMode_ID: {
            ChangeCombatMode message = ChangeCombatMode.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

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

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

        default: {
            handled = false;
            break;
        }
        }

        return(handled);
    }
Example #2
0
    public override bool acceptMessageData(BinaryReader messageDataReader, TreeView outputTreeView)
    {
        bool handled = true;

        PacketOpcode opcode = Util.readOpcode(messageDataReader);

        switch (opcode)
        {
        case PacketOpcode.Evt_Combat__CancelAttack_ID:
        case PacketOpcode.Evt_Combat__CommenceAttack_ID: {
            EmptyMessage message = new EmptyMessage(opcode);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        // TODO: Evt_Combat__UntargetedMeleeAttack_ID
        case PacketOpcode.Evt_Combat__TargetedMeleeAttack_ID: {
            TargetedMeleeAttack message = TargetedMeleeAttack.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

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

        // TODO: Evt_Combat__UntargetedMissileAttack_ID
        case PacketOpcode.Evt_Combat__ChangeCombatMode_ID: {
            ChangeCombatMode message = ChangeCombatMode.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

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

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

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

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

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

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

        default: {
            handled = false;
            break;
        }
        }

        return(handled);
    }