sharp-chat/SharpChat/Packet/ChannelUpdatePacket.cs

27 lines
734 B
C#

using System.Text;
namespace SharpChat.Packet {
public class ChannelUpdatePacket : ServerPacket {
public string PreviousName { get; private set; }
public ChatChannel Channel { get; private set; }
public ChannelUpdatePacket(string previousName, ChatChannel channel) {
PreviousName = previousName;
Channel = channel;
}
public override string Pack() {
StringBuilder sb = new();
sb.Append('4');
sb.Append('\t');
sb.Append('1');
sb.Append('\t');
sb.Append(PreviousName);
sb.Append('\t');
sb.Append(Channel.Pack());
return sb.ToString();
}
}
}