Ejemplo n.º 1
0
        protected void Deactivate()
        {
            m_awaitingReplyFrom = UUID.Zero;
            m_nextProcess       = null;

            foreach (OsButton button in ButtonMap.Values)
            {
                button.OnChat -= OnChatEvent;
            }
        }
Ejemplo n.º 2
0
        /// <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;
            }
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 /// <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);
 }
Ejemplo n.º 5
0
 /// <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);
 }
Ejemplo n.º 6
0
        protected void Deactivate()
        {
            m_awaitingReplyFrom = UUID.Zero;
            m_nextProcess = null;

            foreach (OsButton button in ButtonMap.Values)
                button.OnChat -= OnChatEvent;
        }
Ejemplo n.º 7
0
        /// <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;
        }
Ejemplo n.º 8
0
 /// <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);
 }
Ejemplo n.º 9
0
 /// <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);
 }
Ejemplo n.º 10
0
 /// <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);
 }
Ejemplo n.º 11
0
 /// <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);
 }