35 lines
1.2 KiB
C#
35 lines
1.2 KiB
C#
using System.Globalization;
|
|
using Tiger.Communication.Messages.Interfaces;
|
|
using Tiger.Communication.Messages.Types;
|
|
using Tiger.Game.Habbos;
|
|
|
|
namespace Tiger.Communication.Messages.Outgoing.Handshake;
|
|
|
|
public class UserObjectMessageComposer : IMessageComposer
|
|
{
|
|
private readonly Habbo _habbo;
|
|
|
|
public UserObjectMessageComposer(Habbo habbo)
|
|
{
|
|
_habbo = habbo;
|
|
}
|
|
|
|
public OutgoingHeaders Header => OutgoingHeaders.UserObjectComposer;
|
|
public void Compose(ServerMessage message)
|
|
{
|
|
message.AppendUInt32(_habbo.Id);
|
|
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);
|
|
message.AppendString(_habbo.LastLogin?.ToString(CultureInfo.CurrentCulture) ?? string.Empty);
|
|
message.AppendBoolean(false); // can change name
|
|
message.AppendBoolean(false); // safety locked
|
|
}
|
|
} |