using Tiger.Communication.Messages.Interfaces; using Tiger.Communication.Messages.Outgoing.Handshake; using Tiger.Communication.Messages.Types; using Tiger.Game.Habbos; using Tiger.Networking.Game.Sessions; using Tiger.Storage; namespace Tiger.Communication.Messages.Incoming.Handshake; public class SsoEvent : IMessageEvent { private readonly IRepository _habboRepository; public SsoEvent(IRepository habboRepository) { _habboRepository = habboRepository; } public IncomingHeaders Header => IncomingHeaders.Sso; public async Task HandleAsync(GameSession gameSession, ClientMessage request) { var habbo = await _habboRepository.FindOneByAsync(h => h.SsoTicket == request.ReadString()); if (habbo == null) { await gameSession.CloseAsync(); return; } gameSession.Habbo = habbo; await gameSession.SendComposerAsync(new LoginOkComposer()); } }