sharp-chat/SharpChat/Packet/UserUpdatePacket.cs

22 lines
529 B
C#

using System;
using System.Text;
namespace SharpChat.Packet {
public class UserUpdatePacket : ServerPacket {
public ChatUser User { get; private set; }
public UserUpdatePacket(ChatUser user) {
User = user ?? throw new ArgumentNullException(nameof(user));
}
public override string Pack() {
StringBuilder sb = new();
sb.Append("10");
sb.Append('\t');
sb.Append(User.Pack());
return sb.ToString();
}
}
}