sharp-chat/SharpChat.Protocol.SockChat/Packets/ChannelCreatePacket.cs

26 lines
737 B
C#
Raw Normal View History

2022-08-30 15:05:29 +00:00
using SharpChat.Channels;
using SharpChat.Protocol.SockChat.Channels;
using System.Text;
namespace SharpChat.Protocol.SockChat.Packets {
public class ChannelCreatePacket : ServerPacket {
public IChannel Channel { get; private set; }
public ChannelCreatePacket(IChannel channel) {
Channel = channel;
}
protected override string DoPack() {
StringBuilder sb = new();
sb.Append((int)ServerPacketId.ChannelEvent);
sb.Append(IServerPacket.SEPARATOR);
sb.Append((int)ServerChannelSubPacketId.Create);
sb.Append(IServerPacket.SEPARATOR);
sb.Append(Channel.Pack());
return sb.ToString();
}
}
}