using FiestaBot.Enums;
using FiestaBot.Instances.Networking;
using FiestaBot.Manager.Networking;
using FiestaBot.Utilities;

namespace FiestaBot.Manager.Handlers
{
    internal class Manager05Handler
    {
        [ManagerPacketHandler(5, 4)]
        public static void CharacterCreationError(ManagerClient Socket, Packet Packet)
        {
            Packet.ReadByte(out byte Error);
            Packet.Dispose();

            Logger.Log(LogType.World, "Error during character creation: {0}", (CreateCharError)Error);
        }

        [ManagerPacketHandler(5, 6)]
        public static void CharacterCreationSucces(ManagerClient Socket, Packet Packet)
        {
            Socket.InUseCharSlots.Add(Socket.LastSlot);
            Logger.Log(LogType.World, "Character creation succesful");
            Packet.Dispose();
        }

        [ManagerPacketHandler(5, 12)]
        public static void CharacterDeleteSucces(ManagerClient Socket, Packet Packet)
        {
            Packet.ReadByte(out byte Slot);
            Logger.Log(LogType.World, "Character deletion of character in slot {0} succesful", Slot);

            Socket.InUseCharSlots.Remove(Slot);

            Packet.Dispose();
        }

    }
}
