sharp-chat/SharpChat/Packet/ChannelCreatePacket.cs

26 lines
840 B
C#

namespace SharpChat.Packet {
public class ChannelCreatePacket : ServerPacket {
private readonly string ChannelName;
private readonly bool ChannelHasPassword;
private readonly bool ChannelIsTemporary;
public ChannelCreatePacket(
string channelName,
bool channelHasPassword,
bool channelIsTemporary
) {
ChannelName = channelName;
ChannelHasPassword = channelHasPassword;
ChannelIsTemporary = channelIsTemporary;
}
public override string Pack() {
return string.Format(
"4\t0\t{0}\t{1}\t{2}",
SockChatUtility.SanitiseChannelName(ChannelName),
ChannelHasPassword ? 1 : 0,
ChannelIsTemporary ? 1 : 0
);
}
}
}