21 lines
657 B
C#
21 lines
657 B
C#
|
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));
|
||
|
}
|
||
|
}
|