2023-09-23 13:33:23 +00:00
|
|
|
using Tiger.Communication.Messages.Interfaces;
|
|
|
|
using Tiger.Communication.Messages.Outgoing.Notifications;
|
|
|
|
using Tiger.Communication.Messages.Outgoing.Users;
|
|
|
|
using Tiger.Communication.Messages.Types;
|
|
|
|
using Tiger.Networking.Game.Sessions;
|
|
|
|
|
|
|
|
namespace Tiger.Communication.Messages.Incoming.Inventory.Purse;
|
|
|
|
|
|
|
|
public class GetCreditsInfoEvent : IMessageEvent
|
|
|
|
{
|
|
|
|
private readonly IGameSessionManager _gameSessionManager;
|
|
|
|
|
|
|
|
public GetCreditsInfoEvent(IGameSessionManager gameSessionManager)
|
|
|
|
{
|
|
|
|
_gameSessionManager = gameSessionManager;
|
|
|
|
}
|
|
|
|
|
|
|
|
public IncomingHeaders Header => IncomingHeaders.GetCreditsInfoEvent;
|
|
|
|
public async Task HandleAsync(GameSession gameSession, ClientMessage request)
|
|
|
|
{
|
|
|
|
if (gameSession.Habbo == null)
|
|
|
|
{
|
|
|
|
await _gameSessionManager.CloseAsync("Not logged in", gameSession);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
await gameSession.SendComposerAsync(new CreditBalanceComposer(gameSession.Habbo.Credits));
|
2023-10-07 13:32:19 +00:00
|
|
|
await gameSession.SendComposerAsync(new ActivityPointsComposer(gameSession.Habbo.Activitypoints.Values));
|
2023-09-23 13:33:23 +00:00
|
|
|
}
|
|
|
|
}
|