using System;

using FilterAPI.Networking;

using FilterBot.ZoneNetworking;

namespace FilterBot.ZoneHandlers
{
    internal class Zone2Handle
    {
        [ZonePacketHandler(2, 4)]
        public static void HandlePing(ZoneServer ServerSocket, Packet ServerPacket) { GlobalPacket.SendPong(ServerSocket); }

        [ZonePacketHandler(2, 7)]
        public static void HandleSetXor(ZoneServer ServerSocket, Packet ServerPacket)
        {
            ServerSocket.Crypto = new FiestaCrypto(Program.Auth, ServerPacket.PacketReader.ReadInt16());

            Program.SendConsoleText(ConsoleColor.Gray, "({0}) received xor {1}.", ServerSocket.Manager.sID, ServerSocket.Crypto.Xor);

            GlobalPacket.SendSHNHashes(ServerSocket);
        }
    }
}
