using Tiger.Communication.Messages.Interfaces; using Tiger.Communication.Messages.Outgoing.User.Data; using Tiger.Communication.Messages.Types; using Tiger.Game.Habbos; using Tiger.Networking.Game.Sessions; using Tiger.Storage; namespace Tiger.Communication.Messages.Incoming.User.Data; public class UserProfileEvent : IMessageEvent { private readonly IGameSessionManager _gameSessionManager; private readonly IRepository _habboRepository; public UserProfileEvent(IGameSessionManager gameSessionManager, IRepository habboRepository) { _gameSessionManager = gameSessionManager; _habboRepository = habboRepository; } public IncomingHeaders Header => IncomingHeaders.UserProfile; public async Task HandleAsync(GameSession gameSession, ClientMessage request) { var habbo = await _habboRepository.FindAsync(request.ReadInt32()); if (habbo == null) return; await gameSession.SendComposerAsync(new UserProfileComposer(habbo)); } }