/// <summary>
        /// Create a Protocol given a Game Data object (which contains the version.
        /// </summary>
        /// <param name="data"></param>
        public TibiaGameProtocol(TibiaGameData data)
        {
            Stream f = Assembly.GetExecutingAssembly().GetManifestResourceStream("CTC.TibiaProtocolMap.xml");
            Factory = new TibiaGamePacketParserFactory(f, data);

            AddPacketHandler("ErrorMessage", ErrorMessage);
            AddPacketHandler("MOTD", MOTD);
            AddPacketHandler("Ping", Ping);

            AddPacketHandler("CanReport", CanReport);
            AddPacketHandler("Death", Death);

            AddPacketHandler("UpdateInventory", UpdateInventory);
            AddPacketHandler("ClearInventory", ClearInventory);
            AddPacketHandler("OpenContainer", OpenContainer);
            AddPacketHandler("CloseContainer", CloseContainer);
            AddPacketHandler("ContainerAddItem", ContainerAddItem);
            AddPacketHandler("ContainerTransformItem", ContainerTransformItem);
            AddPacketHandler("ContainerRemoveItem", ContainerRemoveItem);

            AddPacketHandler("PlayerLogin", PlayerLogin);
            AddPacketHandler("UpdateStats", UpdateStats);
            AddPacketHandler("UpdateSkills", UpdateSkills);
            AddPacketHandler("PlayerIcons", PlayerIcons);
            AddPacketHandler("CancelAttack", CancelAttack);
            AddPacketHandler("CancelWalk", CancelWalk);

            AddPacketHandler("CreatureMove", CreatureMove);
            AddPacketHandler("CreatureHealth", CreatureHealth);
            AddPacketHandler("CreatureLight", CreatureLight);
            AddPacketHandler("CreatureRefresh", CreatureRefresh);
            AddPacketHandler("CreatureSpeed", CreatureSpeed);
            AddPacketHandler("CreatureSkull", CreatureSkull);
            AddPacketHandler("CreatureShield", CreatureShield);

            AddPacketHandler("CreatureSpeak", CreatureSpeak);
            AddPacketHandler("ChannelList", ChannelList);
            AddPacketHandler("OpenChannel", OpenChannel);
            AddPacketHandler("OpenPrivateChat", OpenPrivateChat);
            AddPacketHandler("TextMessage", TextMessage);

            AddPacketHandler("VIPState", VIPState);
            AddPacketHandler("VIPLogin", VIPLogin);
            AddPacketHandler("VIPLogout", VIPLogout);

            AddPacketHandler("WorldLight", WorldLight);
            AddPacketHandler("Effect", Effect);
            AddPacketHandler("AnimatedText", AnimatedText);
            AddPacketHandler("ShootEffect", ShootEffect);
            AddPacketHandler("SquareEffect", SquareEffect);

            AddPacketHandler("MoveNorth", MoveNorth);
            AddPacketHandler("MoveSouth", MoveSouth);
            AddPacketHandler("MoveEast", MoveEast);
            AddPacketHandler("MoveWest", MoveWest);
            AddPacketHandler("FloorUp", FloorUp);
            AddPacketHandler("FloorDown", FloorDown);

            AddPacketHandler("MapDescription", MapDescription);
            AddPacketHandler("RefreshTile", RefreshTile);
            AddPacketHandler("AddThing", AddThing);
            AddPacketHandler("TransformThing", TransformThing);
            AddPacketHandler("RemoveThing", RemoveThing);

            AddPacketHandler("RuleViolationChannel", RuleViolationChannel);
            AddPacketHandler("RuleViolationRemove", RuleViolationRemove);
            AddPacketHandler("RuleViolationCancel", RuleViolationCancel);
            AddPacketHandler("RuleViolationLock", RuleViolationLock);
        }
        /// <summary>
        /// Create a Protocol given a Game Data object (which contains the version.
        /// </summary>
        /// <param name="data"></param>
        public TibiaGameProtocol(TibiaGameData data)
        {
            Stream f = Assembly.GetExecutingAssembly().GetManifestResourceStream("CTC.TibiaProtocolMap.xml");

            Factory = new TibiaGamePacketParserFactory(f, data);

            AddPacketHandler("ErrorMessage", ErrorMessage);
            AddPacketHandler("MOTD", MOTD);
            AddPacketHandler("Ping", Ping);

            AddPacketHandler("CanReport", CanReport);
            AddPacketHandler("Death", Death);

            AddPacketHandler("UpdateInventory", UpdateInventory);
            AddPacketHandler("ClearInventory", ClearInventory);
            AddPacketHandler("OpenContainer", OpenContainer);
            AddPacketHandler("CloseContainer", CloseContainer);
            AddPacketHandler("ContainerAddItem", ContainerAddItem);
            AddPacketHandler("ContainerTransformItem", ContainerTransformItem);
            AddPacketHandler("ContainerRemoveItem", ContainerRemoveItem);

            AddPacketHandler("PlayerLogin", PlayerLogin);
            AddPacketHandler("UpdateStats", UpdateStats);
            AddPacketHandler("UpdateSkills", UpdateSkills);
            AddPacketHandler("PlayerIcons", PlayerIcons);
            AddPacketHandler("CancelAttack", CancelAttack);
            AddPacketHandler("CancelWalk", CancelWalk);

            AddPacketHandler("CreatureMove", CreatureMove);
            AddPacketHandler("CreatureHealth", CreatureHealth);
            AddPacketHandler("CreatureLight", CreatureLight);
            AddPacketHandler("CreatureRefresh", CreatureRefresh);
            AddPacketHandler("CreatureSpeed", CreatureSpeed);
            AddPacketHandler("CreatureSkull", CreatureSkull);
            AddPacketHandler("CreatureShield", CreatureShield);

            AddPacketHandler("CreatureSpeak", CreatureSpeak);
            AddPacketHandler("ChannelList", ChannelList);
            AddPacketHandler("OpenChannel", OpenChannel);
            AddPacketHandler("OpenPrivateChat", OpenPrivateChat);
            AddPacketHandler("TextMessage", TextMessage);

            AddPacketHandler("VIPState", VIPState);
            AddPacketHandler("VIPLogin", VIPLogin);
            AddPacketHandler("VIPLogout", VIPLogout);

            AddPacketHandler("WorldLight", WorldLight);
            AddPacketHandler("Effect", Effect);
            AddPacketHandler("AnimatedText", AnimatedText);
            AddPacketHandler("ShootEffect", ShootEffect);
            AddPacketHandler("SquareEffect", SquareEffect);

            AddPacketHandler("MoveNorth", MoveNorth);
            AddPacketHandler("MoveSouth", MoveSouth);
            AddPacketHandler("MoveEast", MoveEast);
            AddPacketHandler("MoveWest", MoveWest);
            AddPacketHandler("FloorUp", FloorUp);
            AddPacketHandler("FloorDown", FloorDown);

            AddPacketHandler("MapDescription", MapDescription);
            AddPacketHandler("RefreshTile", RefreshTile);
            AddPacketHandler("AddThing", AddThing);
            AddPacketHandler("TransformThing", TransformThing);
            AddPacketHandler("RemoveThing", RemoveThing);

            AddPacketHandler("RuleViolationChannel", RuleViolationChannel);
            AddPacketHandler("RuleViolationRemove", RuleViolationRemove);
            AddPacketHandler("RuleViolationCancel", RuleViolationCancel);
            AddPacketHandler("RuleViolationLock", RuleViolationLock);
        }