/// <summary> /// サーバからクライアントにニュメリックリプライを返します。 /// </summary> /// <param name="numReply">リプライ番号</param> /// <param name="commandParams">リプライコマンドパラメータ</param> public void SendNumericReply(NumericReply numReply, params String[] commandParams) { if (IsClosing) { return; } lock (_connections) foreach (ConnectionBase connection in _connections) { connection.SendNumericReply(numReply, commandParams); } }
/// <summary> /// サーバからクライアントにニュメリックリプライを返します。 /// </summary> /// <param name="numReply">リプライ番号</param> /// <param name="commandParams">リプライコマンドパラメータ</param> public void SendNumericReply(NumericReply numReply, params String[] commandParams) { if (commandParams.Length > 14 || commandParams.Length < 0) { throw new ArgumentOutOfRangeException("commandParams"); } NumericReplyMessage numMsg = new NumericReplyMessage(numReply); numMsg.CommandParams[0] = UserInfo.Nick; for (Int32 i = 0; i < commandParams.Length; i++) { numMsg.CommandParams[i + 1] = commandParams[i]; } SendServerMessage(numMsg); }
public async Task Execute(IContext <T> context, Func <Task> next) { if (!greeted) { if (NumericReply.TryParse <NamesReply>(context.Message, out var reply)) { var nick = context.Session.Nick; var names = reply.Names.Except(context.Session.Aliases).ToList(); var grt = RandomGreeting(); if (names.Count > 1) { await context.Client.SayAsync($"{grt} guys!"); } else if (names.Count > 0) { await context.Client.SayAsync($"{grt} {names[0]}!"); } } } await next(); }
public NumericReplyMessage(NumericReply i) { this.SetCommand(((Int32)i).ToString("000")); _replyNumber = ((Int32)i); }
NumericReplyMessage(NumericReply i) { this.SetCommand(((Int32)i).ToString("000")); _replyNumber = ((Int32)i); }
/// <summary> /// サーバからクライアントにニュメリックリプライを返します。 /// </summary> /// <param name="numReply">リプライ番号</param> /// <param name="commandParams">リプライコマンドパラメータ</param> public void SendNumericReply(NumericReply numReply, params String[] commandParams) { if (IsClosing) return; lock (_connections) foreach (ConnectionBase connection in _connections) connection.SendNumericReply(numReply, commandParams); }