namespace SharpChat.SockChat.PacketsS2C { public class ChannelUpdateS2CPacket : ISockChatS2CPacket { private readonly string ChannelNamePrevious; private readonly string ChannelNameNew; private readonly bool ChannelHasPassword; private readonly bool ChannelIsTemporary; public ChannelUpdateS2CPacket( string channelNamePrevious, string channelNameNew, bool channelHasPassword, bool channelIsTemporary ) { ChannelNamePrevious = channelNamePrevious; ChannelNameNew = channelNameNew; ChannelHasPassword = channelHasPassword; ChannelIsTemporary = channelIsTemporary; } public string Pack() { return string.Format( "4\t1\t{0}\t{1}\t{2}\t{3}", SockChatUtility.SanitiseChannelName(ChannelNamePrevious), SockChatUtility.SanitiseChannelName(ChannelNameNew), ChannelHasPassword ? 1 : 0, ChannelIsTemporary ? 1 : 0 ); } } }