예제 #1
0
        public void FloaterControl(ScenePresence sp, FloaterData d, string msg)
        {
            string sendData = String.Format("># floater {0} {1}", d.FloaterName, msg);
            SendToClient(sp, sendData);

        }
예제 #2
0
        public void DoUserFloater(UUID agentID, FloaterData dialogData, string configuration)
        {
            ScenePresence sp = m_scene.GetScenePresence(agentID);
            if (sp == null || sp.IsChildAgent)
                return;

            if (!m_floaters.ContainsKey(agentID))
                m_floaters[agentID] = new Dictionary<int, FloaterData>();

            if (m_floaters[agentID].ContainsKey(dialogData.Channel))
                return;

            m_floaters[agentID].Add(dialogData.Channel, dialogData);

            string xml;
            if (dialogData.XmlText != null && dialogData.XmlText != String.Empty)
            {
                xml = dialogData.XmlText;
            }
            else
            {
                using (FileStream fs = File.Open(dialogData.XmlName + ".xml", FileMode.Open))
                {
                    using (StreamReader sr = new StreamReader(fs))
                        xml = sr.ReadToEnd().Replace("\n", "");
                }
            }

            List<string> xparts = new List<string>();

            while (xml.Length > 0)
            {
                string x = xml;
                if (x.Length > 600)
                {
                    x = x.Substring(0, 600);
                    xml = xml.Substring(600);
                }
                else
                {
                    xml = String.Empty;
                }

                xparts.Add(x);
            }

            for (int i = 0 ; i < xparts.Count ; i++)
                SendToClient(sp, String.Format("># floater {2} create {0}/{1} " + xparts[i], i + 1, xparts.Count, dialogData.FloaterName));

            SendToClient(sp, String.Format("># floater {0} {{notify:1}} {{channel: {1}}} {{node:cancel {{notify:1}}}} {{node:ok {{notify:1}}}} {2}", dialogData.FloaterName, (uint)dialogData.Channel, configuration));
        }