TigerEmu/Communication/Messages/Outgoing/User/Data/UserInfoComposer.cs

35 lines
1.2 KiB
C#
Raw Normal View History

2023-09-23 11:11:07 +00:00
using System.Globalization;
using Tiger.Communication.Messages.Interfaces;
using Tiger.Communication.Messages.Types;
using Tiger.Game.Habbos;
namespace Tiger.Communication.Messages.Outgoing.User.Data;
2023-09-23 11:11:07 +00:00
public class UserInfoComposer : IMessageComposer
2023-09-23 11:11:07 +00:00
{
private readonly Habbo _habbo;
public UserInfoComposer(Habbo habbo)
2023-09-23 11:11:07 +00:00
{
_habbo = habbo;
}
public OutgoingHeaders Header => OutgoingHeaders.UserInfo;
2023-09-23 11:11:07 +00:00
public void Compose(ServerMessage message)
{
message.AppendInt32(_habbo.Id);
2023-09-23 11:11:07 +00:00
message.AppendString(_habbo.Username);
message.AppendString(_habbo.Figure);
message.AppendString(_habbo.Gender);
message.AppendString(_habbo.Motto);
message.AppendString(string.Empty);
message.AppendBoolean(false);
message.AppendInt32(0); // respect received
message.AppendInt32(0); // respect points to give
message.AppendInt32(0); // scratch to give
message.AppendBoolean(false);
2023-09-23 12:20:45 +00:00
message.AppendString(_habbo.LastLogin?.ToString(CultureInfo.CurrentCulture) ?? string.Empty);
2023-09-23 11:11:07 +00:00
message.AppendBoolean(false); // can change name
message.AppendBoolean(false); // safety locked
}
}