// Copyright © 2017-2018 Atomic Software, LLC. All Rights Reserved.
// See LICENSE.md for full license information.

using Atom.Core.Networking.Messages;
using Atom.Core.Networking.Messages.Structures.Misc;
using System;

namespace Atom.WorldManagerServer.Networking.Messages.Handlers
{
    public static class MiscHandlers
    {
        [MessageHandler(MessageProtocol.NC_MISC_SEED_ACK)]
        public static void NC_MISC_SEED_ACK(NetworkMessage msg)
        {
            var Seed = msg.ReadUInt16();
            msg.Client.SetEncryptionTableIndex(Seed);
        }

        [MessageHandler(MessageProtocol.NC_MISC_GAMETIME_REQ)]
        public static void NC_MISC_GAMETIME_REQ(NetworkMessage msg)
        {
            new PROTO_NC_MISC_GAMETIME_ACK(new DateTimeOffset(DateTime.Now)).Send(msg.Client);
        }
    }
}
