using Fiesta.Login.Worlds.Networking.PacketTypes;
using Fiesta.Networking;
using Fiesta.Networking.Packets;
using Fiesta.Players.Networking;
using Fiesta.Worlds;
using Fiesta.Worlds.Networking;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Villain.Networking.Packets;

namespace World.Login.Networking.Packets.Misc.In
{
	public static class AuthenticationError
	{
		[PacketHandler("Login", MISC.AUTHENTICATION_ERROR)]
		public static void Handle(Client client, InPacket packet)
		{
			try
			{
				byte reasonCode = packet.ReadByte();

				switch (reasonCode)
				{
					case 0x01:
						Console.WriteLine("The Login server already has a connection to this world ID", ConsoleColor.Red);
						break;
				}
			}
			catch
			{
				Console.WriteLine("The Login server refused the connection for an unknown reason", ConsoleColor.Red);
			}

			Program.Shutdown();
		}
	}
}