Example #1
0
        public static CastTargetedSpell read(BinaryReader binaryReader)
        {
            CastTargetedSpell newObj = new CastTargetedSpell();

            newObj.i_target   = binaryReader.ReadUInt32();
            newObj.i_spell_id = binaryReader.ReadUInt32();
            return(newObj);
        }
Example #2
0
    public override bool acceptMessageData(BinaryReader messageDataReader, TreeView outputTreeView)
    {
        bool handled = true;

        PacketOpcode opcode = Util.readOpcode(messageDataReader);

        switch (opcode)
        {
        case PacketOpcode.Evt_Magic__PurgeEnchantments_ID:
        case PacketOpcode.Evt_Magic__PurgeBadEnchantments_ID: {
            EmptyMessage message = new EmptyMessage(opcode);
            message.contributeToTreeView(outputTreeView);
            ContextInfo.AddToList(new ContextInfo {
                    DataType = DataType.ServerToClientHeader
                });
            break;
        }

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

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

        // TODO: Evt_Magic__ResearchSpell_ID
        //case PacketOpcode.UPDATE_SPELL_EVENT: {
        //        UpdateSpell message = UpdateSpell.read(messageDataReader);
        //        message.contributeToTreeView(outputTreeView);
        //        break;
        //    }
        //case PacketOpcode.REMOVE_SPELL_EVENT: {
        //        RemoveSpell message = RemoveSpell.read(messageDataReader);
        //        message.contributeToTreeView(outputTreeView);
        //        break;
        //    }
        //case PacketOpcode.UPDATE_ENCHANTMENT_EVENT: {
        //        UpdateEnchantment message = UpdateEnchantment.read(messageDataReader);
        //        message.contributeToTreeView(outputTreeView);
        //        break;
        //    }
        //case PacketOpcode.REMOVE_ENCHANTMENT_EVENT: {
        //        RemoveEnchantment message = RemoveEnchantment.read(messageDataReader);
        //        message.contributeToTreeView(outputTreeView);
        //        break;
        //    }
        case PacketOpcode.Evt_Magic__RemoveSpell_ID:
        {
            RemoveSpell message = RemoveSpell.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

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

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

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

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

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

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

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

        default: {
            handled = false;
            break;
        }
        }

        return(handled);
    }