Supercell.GUT/Supercell.GUT.Logic/Message/Account/ChangeAccountSettingsMessage.cs
2024-03-06 22:52:53 +07:00

68 lines
1.9 KiB
C#

using Supercell.GUT.Logic.Message.Attributes;
using Supercell.GUT.Titan.Logic.Message;
namespace Supercell.GUT.Logic.Message.Account;
[VersionedMessage(10104)]
public class ChangeAccountSettingsMessage : VersionedMessage
{
public int SettingsMap { get; set; }
public string? FacebookId { get; set; }
public string? GameCenterId { get; set; }
public string? AvatarName { get; set; }
public byte[]? DeviceToken { get; set; }
public ChangeAccountSettingsMessage() : base(0)
{
this.SettingsMap = 0;
this.FacebookId = null;
this.GameCenterId = null;
this.AvatarName = null;
this.DeviceToken = null;
}
public override void Destruct()
{
base.Destruct();
this.SettingsMap = 0;
this.FacebookId = null;
this.GameCenterId = null;
this.AvatarName = null;
this.DeviceToken = null;
}
public override int GetMessageType()
{
return 10104;
}
public override int GetServiceNodeType()
{
return 1;
}
public override void Encode()
{
base.Encode();
this.ByteStream.WriteInt(this.SettingsMap);
this.ByteStream.WriteString(this.FacebookId);
this.ByteStream.WriteString(this.GameCenterId);
this.ByteStream.WriteString(null);
this.ByteStream.WriteString(this.AvatarName);
this.ByteStream.WriteBytes(this.DeviceToken, this.DeviceToken.Length);
}
public override void Decode()
{
base.Decode();
this.SettingsMap = this.ByteStream.ReadInt();
this.FacebookId = this.ByteStream.ReadString();
this.GameCenterId = this.ByteStream.ReadString();
this.ByteStream.ReadString();
this.AvatarName = this.ByteStream.ReadString();
this.DeviceToken = this.ByteStream.ReadBytes(this.ByteStream.ReadBytesLength());
}
}