public GridUserInfo GetGridUserInfo(string userID) { if (m_Infos.TryGetValue(userID, KEEPTIME * 1000, out GridUserInfo info)) return info; info = m_RemoteConnector.GetGridUserInfo(userID); m_Infos.AddOrUpdate(userID, info, KEEPTIME); return info; }
public bool UpdateItem(InventoryItemBase item) { if (item.CreatorData == null) { item.CreatorData = String.Empty; } Dictionary <string, object> ret = MakeRequest( new Dictionary <string, object> { { "METHOD", "UPDATEITEM" }, { "AssetID", item.AssetID.ToString() }, { "AssetType", item.AssetType.ToString() }, { "Name", item.Name.ToString() }, { "Owner", item.Owner.ToString() }, { "ID", item.ID.ToString() }, { "InvType", item.InvType.ToString() }, { "Folder", item.Folder.ToString() }, { "CreatorId", item.CreatorId.ToString() }, { "CreatorData", item.CreatorData.ToString() }, { "Description", item.Description.ToString() }, { "NextPermissions", item.NextPermissions.ToString() }, { "CurrentPermissions", item.CurrentPermissions.ToString() }, { "BasePermissions", item.BasePermissions.ToString() }, { "EveryOnePermissions", item.EveryOnePermissions.ToString() }, { "GroupPermissions", item.GroupPermissions.ToString() }, { "GroupID", item.GroupID.ToString() }, { "GroupOwned", item.GroupOwned.ToString() }, { "SalePrice", item.SalePrice.ToString() }, { "SaleType", item.SaleType.ToString() }, { "Flags", item.Flags.ToString() }, { "CreationDate", item.CreationDate.ToString() } }); bool result = CheckReturn(ret); if (result) { m_ItemCache.AddOrUpdate(item.ID, item, CACHE_EXPIRATION_SECONDS); } return(result); }
public void Cache(UUID userID, UserAccount account) { // Cache even null accounts lock (accessLock) { if (account == null) { m_UUIDCache.AddOrUpdate(userID, null, CACHE_NULL_EXPIRATION_SECONDS); } else if (account.LocalToGrid) { m_UUIDCache.AddOrUpdate(userID, account, CACHE_EXPIRATION_SECONDS); m_NameCache.AddOrUpdate(account.Name.ToLowerInvariant(), account, CACHE_EXPIRATION_SECONDS); } else { m_UUIDCache.AddOrUpdate(userID, account, CACHE_ALIEN_EXPIRATION_SECONDS); m_NameCache.AddOrUpdate(account.Name.ToLowerInvariant(), account, CACHE_ALIEN_EXPIRATION_SECONDS); } //m_log.DebugFormat("[USER CACHE]: cached user {0}", userID); } }
bool SendIMToRegion(PresenceInfo upd, GridInstantMessage im, UUID toAgentID, bool foreigner) { bool imresult = false; GridRegion reginfo = null; if (!m_RegionCache.TryGetValue(upd.RegionID, REGIONCACHE_EXPIRATION, out reginfo)) { reginfo = m_GridService.GetRegionByUUID(UUID.Zero /*!!!*/, upd.RegionID); m_RegionCache.AddOrUpdate(upd.RegionID, reginfo, reginfo == null ? 60000 : REGIONCACHE_EXPIRATION); } if (reginfo != null) { imresult = InstantMessageServiceConnector.SendInstantMessage(reginfo.ServerURI, im, m_messageKey); } else { m_log.DebugFormat("[HG IM SERVICE]: Failed to deliver message to {0}", reginfo.ServerURI); return(false); } if (imresult) { // IM delivery successful, so store the Agent's location in our local cache. lock (m_UserLocationMap) { if (m_UserLocationMap.ContainsKey(toAgentID)) { m_UserLocationMap[toAgentID] = upd; } else { m_UserLocationMap.Add(toAgentID, upd); } } return(true); } else { // try again, but lookup user this time. // Warning, this must call the Async version // of this method or we'll be making thousands of threads // The version within the spawned thread is SendGridInstantMessageViaXMLRPCAsync // The version that spawns the thread is SendGridInstantMessageViaXMLRPC // This is recursive!!!!! return(TrySendInstantMessage(im, upd, false, foreigner)); } }
private IInventoryService GetConnector(string url) { IInventoryService connector = null; lock (m_connectors) { if (!m_connectors.TryGetValue(url, out connector)) { // Still not as flexible as I would like this to be, // but good enough for now RemoteXInventoryServicesConnector rxisc = new RemoteXInventoryServicesConnector(url); rxisc.Scene = m_Scenes[0]; connector = rxisc; } if (connector != null) { m_connectors.AddOrUpdate(url, connector, CONNECTORS_CACHE_EXPIRE); } } return(connector); }
public void Cache(UUID userID, InventoryFolderBase root) { m_RootFolders.AddOrUpdate(userID, root, CACHE_EXPIRATION); }
public void Cache(UUID userID, InventoryCollection inv) { m_Inventories.AddOrUpdate(userID, inv, 120); }
public UUID CreateGroup(UUID RequestingAgentID, GroupRecordDelegate d) { //m_log.DebugFormat("[Groups.RemoteConnector]: Creating group {0}", name); //reason = string.Empty; //ExtendedGroupRecord group = m_GroupsService.CreateGroup(RequestingAgentID.ToString(), name, charter, showInList, insigniaID, // membershipFee, openEnrollment, allowPublish, maturePublish, founderID, out reason); ExtendedGroupRecord group = d(); if (group == null) { return(UUID.Zero); } if (group.GroupID != UUID.Zero) { m_Cache.AddOrUpdate("group-" + group.GroupID.ToString(), group, GROUPS_CACHE_TIMEOUT); m_Cache.Remove("memberships-" + RequestingAgentID.ToString()); } return(group.GroupID); }