protected override void BuildNormalResponse() { base.BuildNormalResponse(); if (_request.RequestType == ModeRequestType.GetChannelModes) { string modes = _channel.Property.ChannelMode.GetChannelMode(); _sendingBuffer = MODEReply.BuildModeReply( _channel.Property.ChannelName, modes); } }
public void MultiCastJoin(ChatChannelUser joiner) { string joinMessage = JOINReply.BuildJoinReply( joiner, Property.ChannelName); string modes = Property.ChannelMode.GetChannelMode(); joinMessage += MODEReply.BuildModeReply( Property.ChannelName, modes); MultiCast(joinMessage); }
public void SendChannelUsersToJoiner(ChatChannelUser joiner) { string modes = Property.ChannelMode.GetChannelMode(); string buffer = MODEReply.BuildModeReply( Property.ChannelName, modes); string nicks = ""; foreach (var user in Property.ChannelUsers) { if (user.IsChannelCreator) { nicks += "@" + user.UserInfo.NickName + " "; } else { nicks += user.UserInfo.NickName + " "; } } // crysis2's nickname is * length =1 if (nicks.Length < 1) { return; } //if user equals last user in channel we do not add space after it nicks = nicks.Substring(0, nicks.Length - 1); //check the message :@<nickname> whether broadcast char @ ? buffer += NAMEReply.BuildNameReply( joiner.UserInfo.NickName, Property.ChannelName, nicks); buffer += NAMEReply.BuildEndOfNameReply( joiner.UserInfo.NickName, Property.ChannelName); joiner.Session.SendAsync(buffer); }