using Microsoft.Extensions.Logging; using Supercell.GUT.Logic.Avatar; using Supercell.GUT.Logic.Message.Avatar; using Supercell.GUT.Server.Network.Connection; using Supercell.GUT.Server.Protocol.Attributes; using Supercell.GUT.Titan.Logic.Math; namespace Supercell.GUT.Server.Protocol.Handlers; [ServiceNode(3)] internal class AvatarMessageHandler : MessageHandlerBase { private readonly ILogger _logger; private readonly ClientConnection _connection; public AvatarMessageHandler(ClientConnection connection, ILogger logger) { _logger = logger; _connection = connection; } [MessageHandler(10201)] public async Task OnSelectAvatar(SelectAvatarMessage selectAvatarMessage) { _logger.LogInformation("selecting avatar! avatar: ({h}-{l})", selectAvatarMessage.AvatarIdHigherInt, selectAvatarMessage.AvatarIdLowerInt); await _connection.SendMessage(new AvatarDataMessage() { LogicClientAvatar = new LogicClientAvatar() { Id = new LogicLong(selectAvatarMessage.AvatarIdHigherInt, selectAvatarMessage.AvatarIdLowerInt), Name = "BreadDEV", AvatarCode = "a1", TutorialFlags = 999999 } }); } }