Exemplo n.º 1
0
 public bool hasAgentDroppedGroupChatSession(string agentID, UUID groupID)
 {
     // If we're tracking drops for this group,
     // and we find them, well... then they've dropped
     return(m_groupsAgentsDroppedFromChatSession.ContainsKey(groupID) &&
            m_groupsAgentsDroppedFromChatSession[groupID].Contains(agentID));
 }
Exemplo n.º 2
0
        private Hashtable HandleHttpSessionCommand(Hashtable request)
        {
            DoExpire();

            Hashtable post  = DecodePostString(request["body"].ToString());
            Hashtable reply = new Hashtable();

            reply["str_response_string"] = "";
            reply["int_response_code"]   = 404;
            reply["content_type"]        = "text/plain";

            if (post["ID"] == null)
            {
                return(reply);
            }

            UUID id;

            if (!UUID.TryParse(post["ID"].ToString(), out id))
            {
                return(reply);
            }

            if (!m_Connections.ContainsKey(id))
            {
                return(reply);
            }

            if (post["COMMAND"] == null)
            {
                return(reply);
            }

            m_InputData.Enqueue(post["COMMAND"].ToString());

            XmlDocument xmldoc  = new XmlDocument();
            XmlNode     xmlnode = xmldoc.CreateNode(XmlNodeType.XmlDeclaration,
                                                    "", "");

            xmldoc.AppendChild(xmlnode);
            XmlElement rootElement = xmldoc.CreateElement("", "ConsoleSession",
                                                          "");

            xmldoc.AppendChild(rootElement);

            XmlElement res = xmldoc.CreateElement("", "Result", "");

            res.AppendChild(xmldoc.CreateTextNode("OK"));

            rootElement.AppendChild(res);

            reply["str_response_string"] = xmldoc.InnerXml;
            reply["int_response_code"]   = 200;
            reply["content_type"]        = "text/xml";
            reply = CheckOrigin(reply);

            return(reply);
        }
Exemplo n.º 3
0
        // -----------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        // -----------------------------------------------------------------
        public bool TestStore(UUID storeID)
        {
            if (!m_enabled)
            {
                return(false);
            }

            return(m_JsonValueStore.ContainsKey(storeID));
        }
Exemplo n.º 4
0
        public IScene GetScene(UUID regionId)
        {
            if (m_scenes.ContainsKey(regionId))
            {
                return(m_scenes[regionId]);
            }
            else
            {
                // FIXME: This was pre-existing behaviour but possibly not a good idea, since it hides an error rather
                // than making it obvious and fixable.  Need to see if the error message comes up in practice.
                Scene s = m_scenes.Values.ToArray()[0];

                m_log.ErrorFormat(
                    "[LOCAL SIMULATION CONNECTOR]: Region with id {0} not found.  Returning {1} {2} instead",
                    regionId, s.RegionInfo.RegionName, s.RegionInfo.RegionID);

                return(s);
            }
        }
Exemplo n.º 5
0
        public void Add(UUID itemID, UUID assetID)
        {
            if (itemID == UUID.Zero)
            {
                return;
            }
            if (m_items.ContainsKey(itemID))
            {
                m_items[itemID] = assetID;
                return;
            }
            if (m_ids.Count >= 5)
            {
                return;
            }

            m_ids.Add(itemID);
            m_items[itemID] = assetID;
        }
Exemplo n.º 6
0
 /// <summary>
 /// Does this collection of servers contain one with the given port?
 /// </summary>
 /// <remarks>
 /// Unlike GetHttpServer, this will not instantiate a server if one does not exist on that port.
 /// </remarks>
 /// <param name='port'></param>
 /// <returns>true if a server with the given port is registered, false otherwise.</returns>
 public static bool ContainsHttpServer(uint port)
 {
     return(m_Servers.ContainsKey(port));
 }
 /// <summary>
 /// Does this folder contain the given child folder?
 /// </summary>
 /// <param name="folderID"></param>
 /// <returns></returns>
 public bool ContainsChildFolder(UUID folderID)
 {
     return(m_childFolders.ContainsKey(folderID));
 }
Exemplo n.º 8
0
 public bool ContainsCap(string cap)
 {
     return(m_capsHandlers.ContainsKey(cap));
 }
Exemplo n.º 9
0
 public bool hasAgentBeenInvitedToGroupChatSession(string agentID, UUID groupID)
 {
     // If we're  tracking this group, and we can find them in the tracking, then they've been invited
     return(m_groupsAgentsInvitedToChatSession.ContainsKey(groupID) &&
            m_groupsAgentsInvitedToChatSession[groupID].Contains(agentID));
 }
Exemplo n.º 10
0
 public bool ContainsKey(string key)
 {
     return(m_map.ContainsKey(key));
 }
Exemplo n.º 11
0
 public bool HasActor(string name)
 {
     return(m_actors.ContainsKey(name));
 }
Exemplo n.º 12
0
            public PollServiceInventoryEventArgs(WebFetchInvDescModule module, string url, UUID pId) :
                base(null, url, null, null, null, pId, int.MaxValue)
            {
                m_module = module;

                HasEvents = (x, y) => { return(responses.ContainsKey(x)); };
                GetEvents = (x, y) =>
                {
                    Hashtable val;
                    responses.Remove(x, out val);
                    return(val);
                };

                Request = (x, y) =>
                {
                    ScenePresence sp = m_module.Scene.GetScenePresence(Id);
                    if (sp == null)
                    {
                        m_log.ErrorFormat("[INVENTORY]: Unable to find ScenePresence for {0}", Id);
                        return;
                    }

                    aPollRequest reqinfo = new aPollRequest();
                    reqinfo.thepoll  = this;
                    reqinfo.reqID    = x;
                    reqinfo.request  = y;
                    reqinfo.presence = sp;
                    reqinfo.folders  = new List <UUID>();

                    // Decode the request here
                    string request = y["body"].ToString();

                    request = request.Replace("<string>00000000-0000-0000-0000-000000000000</string>", "<uuid>00000000-0000-0000-0000-000000000000</uuid>");

                    request = request.Replace("<key>fetch_folders</key><integer>0</integer>", "<key>fetch_folders</key><boolean>0</boolean>");
                    request = request.Replace("<key>fetch_folders</key><integer>1</integer>", "<key>fetch_folders</key><boolean>1</boolean>");

                    Hashtable hash = new Hashtable();
                    try
                    {
                        hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request));
                    }
                    catch (LLSD.LLSDParseException e)
                    {
                        m_log.ErrorFormat("[INVENTORY]: Fetch error: {0}{1}" + e.Message, e.StackTrace);
                        m_log.Error("Request: " + request);
                        return;
                    }
                    catch (System.Xml.XmlException)
                    {
                        m_log.ErrorFormat("[INVENTORY]: XML Format error");
                    }

                    ArrayList foldersrequested = (ArrayList)hash["folders"];

                    for (int i = 0; i < foldersrequested.Count; i++)
                    {
                        Hashtable inventoryhash = (Hashtable)foldersrequested[i];
                        string    folder        = inventoryhash["folder_id"].ToString();
                        UUID      folderID;
                        if (UUID.TryParse(folder, out folderID))
                        {
                            if (!reqinfo.folders.Contains(folderID))
                            {
                                //TODO: Port COF handling from Avination
                                reqinfo.folders.Add(folderID);
                            }
                        }
                    }

                    m_queue.Enqueue(reqinfo);
                };

                NoEvents = (x, y) =>
                {
/*
 *                  lock (requests)
 *                  {
 *                      Hashtable request = requests.Find(id => id["RequestID"].ToString() == x.ToString());
 *                      requests.Remove(request);
 *                  }
 */
                    Hashtable response = new Hashtable();

                    response["int_response_code"]   = 500;
                    response["str_response_string"] = "Script timeout";
                    response["content_type"]        = "text/plain";
                    response["keepalive"]           = false;
                    response["reusecontext"]        = false;

                    return(response);
                };
            }
Exemplo n.º 13
0
 public bool AreFriendsCached(UUID userID)
 {
     return(m_Friends.ContainsKey(userID));
 }