TigerEmu/Communication/Messages/Incoming/Purse/GetCreditsEvent.cs

21 lines
657 B
C#
Raw Permalink Normal View History

2023-11-10 13:55:42 +00:00
using Tiger.Communication.Messages.Interfaces;
using Tiger.Communication.Messages.Outgoing.Purse;
using Tiger.Communication.Messages.Types;
using Tiger.Networking.Game.Sessions;
namespace Tiger.Communication.Messages.Incoming.Purse;
public class GetCreditsEvent : IMessageEvent
{
public IncomingHeaders Header => IncomingHeaders.GetCredits;
public async Task HandleAsync(GameSession gameSession, ClientMessage request)
{
if (gameSession.Habbo == null)
{
await gameSession.CloseAsync();
return;
}
await gameSession.SendComposerAsync(new PurseComposer(gameSession.Habbo.Credits));
}
}