using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FiestaBot.Instances.Networking;
using FiestaBot.Login.Networking;

namespace FiestaBot.Login.ClientPacket
{
    internal class LoginPacket
    {
        public static void SendWipe(LoginClient Socket)
        {
            Packet p = new Packet(2, 35);

            Socket.SendPacket(p);
        }

        public static void SendVersion(LoginClient Socket)
        {
            Packet p = new Packet(3, 1);
            p.WriteUShort(Program.Config.VersionYear);
            p.WriteUShort(Program.Config.Version);
            p.WriteByte(0);
            Socket.SendPacket(p);
        }

        public static void SendHash(LoginClient Socket)
        {
            Packet p = new Packet(3, 4);
            p.WriteByte(29);
            p.WriteString(Program.Config.Hash);
            p.WriteByte(0);
            Socket.SendPacket(p);
        }

        public static void SendToken(LoginClient Socket)
        {
            Packet p = new Packet(3, 32);
            p.WriteString(Program.Config.Token, 65);
            Socket.SendPacket(p);
        }

        public static void SendWorldSelect(LoginClient Socket, byte WorldID)
        {
            Packet p = new Packet(3, 11);
            p.WriteByte(WorldID);
            Socket.SendPacket(p);
        }
    }
}
