private void HandleChangedChannel(string ChannelName, UInt32 ChatID) { // Throw away a byte. That byte might be another string though. HoNRecv.ExtractByte(); string strTopic = HoNRecv.ExtractString(); HoNChangedChannelArgs hjc = new HoNChangedChannelArgs(ChannelName, ChatID, strTopic); uint opCount = HoNRecv.ExtractDWORD(); hjc.SetNumOpers(opCount); for (int i = 0; i < opCount; i++) { UInt32 OperID = HoNRecv.ExtractDWORD(); byte OperType = HoNRecv.ExtractByte(); hjc.AddOper(i, OperID, OperType); } string Username; UInt32 UserID; byte userStatus; byte userFlags; uint userCount = HoNRecv.ExtractDWORD(); hjc.SetNumUsers(userCount); for (int i = 0; i < userCount; i++) { Username = HoNRecv.ExtractString(); UserID = HoNRecv.ExtractDWORD(); userStatus = HoNRecv.ExtractByte(); userFlags = HoNRecv.ExtractByte(); // Hack for clan membership if (Regex.IsMatch(Username, @"\[[^]]+]")) { userFlags = Convert.ToByte(userFlags | HoNClient.USER_FLAG_CLAN_MEMBER); } hjc.AddUser(i, Username, UserID, userStatus, userFlags); } if (onChangedChannel != null) { onChangedChannel(this, hjc); } }
void hon_onChangedChannel(object sender, HoNChangedChannelArgs e) { UInt32 ChannelID = e.GetChatID(); string ChannelName = e.GetChannel(); string Topic = e.GetTopic(); HoNOper[] Operators = e.GetOpers(); HoNUser[] Users = e.GetUsers(); UInt32 UserCount = e.GetNumberOfUsers(); foreach (HoNUser user in Users) { hemUsers.AddEntity(user.Username, user.UserID, user.Flags, new List<char> { }); hemUsers.UpdateFlags(user.Username, user.Flags); } hemChannels.AddEntity(ChannelName, ChannelID, 0, new List<char> { }); if (onNewChannel != null) onNewChannel(this, new NewChannelEventArgs(ChannelID, ChannelName, Topic, Operators, Users, UserCount)); }