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

using Atom.Core.Networking.Messages;
using Atom.WorldManagerServer.Logic;

namespace Atom.WorldManagerServer.Networking.Messages.Handlers
{
    public static class AvatarHandlers
    {
        [MessageHandler(MessageProtocol.NC_AVATAR_CREATE_REQ)]
        public static void NC_AVATAR_CREATE_REQ(NetworkMessage Msg)
        {
            var Slot = Msg.ReadByte();
            var Name = Msg.ReadString(20);
            var ClassGenderRace = Msg.ReadByte();
            var Hair = Msg.ReadByte();
            var HairColor = Msg.ReadByte();
            var Face = Msg.ReadByte();
            
            CharacterLogic.CreateCharacter(Msg.Client, Slot, Name, ClassGenderRace, Hair, HairColor, Face);
        }
    }
}
