using Microsoft.Extensions.Logging; using Supercell.GUT.Logic.Message.Account; using Supercell.GUT.Server.Network.Connection; using Supercell.GUT.Server.Protocol.Attributes; namespace Supercell.GUT.Server.Protocol.Handlers; [ServiceNode(1)] internal class AccountMessageHandler : MessageHandlerBase { private readonly ILogger _logger; private readonly ClientConnection _connection; public AccountMessageHandler(ClientConnection connection, ILogger logger) { _logger = logger; _connection = connection; } [MessageHandler(10105)] public async Task OnStartSecureConnection(StartSecureConnectionMessage startSecureConnectionMessage) { string nonce = "nonce"; await _connection.SendMessage(new SecureConnectionOkMessage() { Nonce = nonce }); _connection.SetNonce(nonce); } [MessageHandler(10103)] public async Task OnCreateAccount(CreateAccountMessage createAccountMessage) { _logger.LogInformation("Creating account! FacebookId: {fid} | GameCenterId: {gcid}", createAccountMessage.FacebookId, createAccountMessage.GameCenterId); await _connection.SendMessage(new CreateAccountOkMessage() { AccountIdHigherInt = 0, AccountIdLowerInt = 1, SessionKey = "telegram_is_@BL4D3_BR43D" }); } }