protected void Deactivate() { m_awaitingReplyFrom = UUID.Zero; m_nextProcess = null; foreach (OsButton button in ButtonMap.Values) { button.OnChat -= OnChatEvent; } }
/// <summary> /// Start listening for text from the given user. This is usually as part of a dialog reply. /// </summary> /// <param name="awaitingReplyFrom"></param> /// <param name="nextProcess"></param> protected void Activate(UUID awaitingReplyFrom, NextProcessDelegate nextProcess) { m_awaitingReplyFrom = awaitingReplyFrom; m_nextProcess = nextProcess; // XXX: Is this right? Shouldn't we only listen for chat from the m_waitingReplyFrom button? foreach (OsButton button in ButtonMap.Values) { button.OnChat += OnChatEvent; } }
protected virtual void OnChatEvent(OSChatMessage chat) { if (chat.Sender.AgentId != m_awaitingReplyFrom) { return; } if (chat.Channel != ButtonMap[chat.Sender.AgentId].Channel) { return; } NextProcessDelegate nextProcess = m_nextProcess; Deactivate(); m_log.InfoFormat( "[WATER WARS]: Received chat [{0}] from {1}", chat, chat.Sender.AgentId); nextProcess(chat); }
/// <summary> /// Send a dialog to the user /// </summary> /// <param name="userId"></param> /// <param name="text"></param> /// <param name="options"></param> /// <param name="next">The process to execute once information has been received back from this dialog</param> protected void SendDialog(UUID userId, string text, string[] options, NextProcessDelegate next) { Activate(userId, next); ButtonMap[userId].SendDialog(userId, text, options); }
/// <summary> /// Send a dialog to the user /// </summary> /// <param name="userId"></param> /// <param name="text"></param> /// <param name="options"></param> /// <param name="next">The process to execute once information has been received back from this dialog</param> protected void SendDialog(UUID userId, string text, List<string> options, NextProcessDelegate next) { SendDialog(userId, text, options.ToArray(), next); }
protected void Deactivate() { m_awaitingReplyFrom = UUID.Zero; m_nextProcess = null; foreach (OsButton button in ButtonMap.Values) button.OnChat -= OnChatEvent; }
/// <summary> /// Start listening for text from the given user. This is usually as part of a dialog reply. /// </summary> /// <param name="awaitingReplyFrom"></param> /// <param name="nextProcess"></param> protected void Activate(UUID awaitingReplyFrom, NextProcessDelegate nextProcess) { m_awaitingReplyFrom = awaitingReplyFrom; m_nextProcess = nextProcess; // XXX: Is this right? Shouldn't we only listen for chat from the m_waitingReplyFrom button? foreach (OsButton button in ButtonMap.Values) button.OnChat += OnChatEvent; }
/// <summary> /// Send a dialog to the user /// </summary> /// <param name="player"></param> /// <param name="text"></param> /// <param name="options"></param> /// <param name="next">The process to execute once information has been received back from this dialog</param> protected void SendDialog(Player player, string text, string[] options, NextProcessDelegate next) { SendDialog(player.Uuid, text, options, next); }
/// <summary> /// Send a dialog to the user /// </summary> /// <param name="userId"></param> /// <param name="text"></param> /// <param name="options"></param> /// <param name="next">The process to execute once information has been received back from this dialog</param> protected void SendDialog(UUID userId, string text, List <string> options, NextProcessDelegate next) { SendDialog(userId, text, options.ToArray(), next); }