void MessageReceived_TIGIMDISABLE(object sender, MessageReceivedEventArgs e) { if (String.Compare(e.Message.Command, "TIGIMDISABLE", true) != 0) return; _config.IMServiceServerName = _config.IMServerName = _config.IMUserName = _config.IMEncryptoPassword = ""; SaveConfig(); DisconnectToIMService(false); }
void MessageReceived_TIGIMENABLE(object sender, MessageReceivedEventArgs e) { if (String.Compare(e.Message.Command, "TIGIMENABLE", true) != 0) return; if (String.IsNullOrEmpty(e.Message.CommandParams[3])) { SendTwitterGatewayServerMessage("TIGIMENABLE コマンドは4つの引数(ServiceServerName, ServerName, UserName, Password)が必要です。"); return; } _config.IMServiceServerName = e.Message.CommandParams[0]; _config.IMServerName = e.Message.CommandParams[1]; _config.IMUserName = e.Message.CommandParams[2]; _config.SetIMPassword(_password, e.Message.CommandParams[3]); SaveConfig(); ConnectToIMService(true); }
private void MessageReceived(object sender, MessageReceivedEventArgs e) { // クライアントからきた PRIVMSG/NOTICE は他のクライアントにも投げる if (e.Message is PrivMsgMessage || e.Message is NoticeMessage) { lock (_connections) { foreach (ConnectionBase connection in _connections) { // 送信元には送らない if (connection != sender) connection.SendServer(e.Message); } } } // セッションの方で処理する OnMessageReceivedFromClient(e); }
/// <summary> /// クライアントからIRCメッセージを受け取ったときの処理です。 /// </summary> /// <param name="e"></param> protected abstract void OnMessageReceivedFromClient(MessageReceivedEventArgs e);