Merge branch 'master' of ssh://justincc@opensimulator.org/var/git/opensim
commit
f1164161b3
|
@ -365,6 +365,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
|||
List<UUID> GetOnlineFriends(UUID userID)
|
||||
{
|
||||
List<string> friendList = new List<string>();
|
||||
List<UUID> online = new List<UUID>();
|
||||
|
||||
foreach (FriendInfo fi in m_Friends[userID].Friends)
|
||||
{
|
||||
|
@ -372,9 +373,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
|||
friendList.Add(fi.Friend);
|
||||
}
|
||||
|
||||
PresenceInfo[] presence = PresenceService.GetAgents(friendList.ToArray());
|
||||
if (friendList.Count == 0)
|
||||
// no friends whatsoever
|
||||
return online;
|
||||
|
||||
List<UUID> online = new List<UUID>();
|
||||
PresenceInfo[] presence = PresenceService.GetAgents(friendList.ToArray());
|
||||
|
||||
foreach (PresenceInfo pi in presence)
|
||||
{
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
<RegionModule id="RemoteInventoryServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory.RemoteInventoryServicesConnector" />
|
||||
<RegionModule id="RemoteXInventoryServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory.RemoteXInventoryServicesConnector" />
|
||||
<RegionModule id="HGInventoryBroker" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory.HGInventoryBroker" />
|
||||
<RegionModule id="HGInventoryBroker2" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory.HGInventoryBroker2" />
|
||||
<RegionModule id="LocalNeighbourServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour.LocalNeighbourServicesConnector" />
|
||||
<RegionModule id="RemoteNeighbourServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour.RemoteNeighbourServicesConnector" />
|
||||
<RegionModule id="LocalLandServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Land.LocalLandServicesConnector" />
|
||||
|
|
|
@ -41,27 +41,22 @@ using OpenMetaverse;
|
|||
|
||||
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||
{
|
||||
public class HGInventoryBroker2 : INonSharedRegionModule, IInventoryService
|
||||
public class HGInventoryBroker2 : ISharedRegionModule, IInventoryService
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private static bool m_Initialized = false;
|
||||
private static bool m_Enabled = false;
|
||||
|
||||
private static IInventoryService m_LocalGridInventoryService;
|
||||
private static ISessionAuthInventoryService m_HGService; // obsolete
|
||||
private Dictionary<string, IInventoryService> m_connectors = new Dictionary<string, IInventoryService>();
|
||||
|
||||
// A cache of userIDs --> ServiceURLs, for HGBroker only
|
||||
protected Dictionary<UUID, string> m_InventoryURLs;
|
||||
protected Dictionary<UUID, string> m_InventoryURLs = new Dictionary<UUID,string>();
|
||||
|
||||
private Scene m_Scene;
|
||||
private List<Scene> m_Scenes = new List<Scene>();
|
||||
|
||||
private IUserAccountService m_UserAccountService;
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
|
@ -73,8 +68,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
}
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
if (!m_Initialized)
|
||||
{
|
||||
IConfig moduleConfig = source.Configs["Modules"];
|
||||
if (moduleConfig != null)
|
||||
|
@ -91,8 +84,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
|
||||
string localDll = inventoryConfig.GetString("LocalGridInventoryService",
|
||||
String.Empty);
|
||||
string HGDll = inventoryConfig.GetString("HypergridInventoryService",
|
||||
String.Empty);
|
||||
//string HGDll = inventoryConfig.GetString("HypergridInventoryService",
|
||||
// String.Empty);
|
||||
|
||||
if (localDll == String.Empty)
|
||||
{
|
||||
|
@ -101,39 +94,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's");
|
||||
}
|
||||
|
||||
if (HGDll == String.Empty)
|
||||
{
|
||||
m_log.Error("[HG INVENTORY CONNECTOR]: No HypergridInventoryService named in section InventoryService");
|
||||
//return;
|
||||
throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's");
|
||||
}
|
||||
|
||||
Object[] args = new Object[] { source };
|
||||
m_LocalGridInventoryService =
|
||||
ServerUtils.LoadPlugin<IInventoryService>(localDll,
|
||||
args);
|
||||
|
||||
m_HGService =
|
||||
ServerUtils.LoadPlugin<ISessionAuthInventoryService>(HGDll,
|
||||
args);
|
||||
|
||||
if (m_LocalGridInventoryService == null)
|
||||
{
|
||||
m_log.Error("[HG INVENTORY CONNECTOR]: Can't load local inventory service");
|
||||
return;
|
||||
}
|
||||
if (m_HGService == null)
|
||||
{
|
||||
m_log.Error("[HG INVENTORY CONNECTOR]: Can't load hypergrid inventory service");
|
||||
return;
|
||||
}
|
||||
|
||||
m_Enabled = true;
|
||||
m_log.Info("[HG INVENTORY CONNECTOR]: HG inventory broker enabled");
|
||||
m_log.InfoFormat("[HG INVENTORY CONNECTOR]: HG inventory broker enabled with inner connector of type {0}", m_LocalGridInventoryService.GetType());
|
||||
}
|
||||
}
|
||||
m_Initialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
|
@ -149,13 +124,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
m_Scene = scene;
|
||||
m_Scenes.Add(scene);
|
||||
m_UserAccountService = m_Scene.UserAccountService;
|
||||
|
||||
scene.RegisterModuleInterface<IInventoryService>(this);
|
||||
|
||||
scene.EventManager.OnMakeRootAgent += OnMakeRootAgent;
|
||||
scene.EventManager.OnClientClosed += OnClientClosed;
|
||||
|
||||
}
|
||||
|
@ -177,13 +149,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
|
||||
}
|
||||
|
||||
#region Cache
|
||||
|
||||
void OnMakeRootAgent(ScenePresence presence)
|
||||
{
|
||||
if (!m_InventoryURLs.ContainsKey(presence.UUID))
|
||||
CacheInventoryServiceURL(presence.Scene, presence.UUID);
|
||||
}
|
||||
#region URL Cache
|
||||
|
||||
void OnClientClosed(UUID clientID, Scene scene)
|
||||
{
|
||||
|
@ -200,10 +166,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[INVENTORY CACHE]: OnClientClosed in {0}, user {1} out of sim. Dropping inventory URL",
|
||||
scene.RegionInfo.RegionName, clientID);
|
||||
DropInventoryServiceURL(clientID);
|
||||
}
|
||||
}
|
||||
|
@ -213,13 +175,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
/// and sticks it in the cache
|
||||
/// </summary>
|
||||
/// <param name="userID"></param>
|
||||
private void CacheInventoryServiceURL(Scene scene, UUID userID)
|
||||
private void CacheInventoryServiceURL(UUID userID)
|
||||
{
|
||||
if (scene.UserAccountService.GetUserAccount(scene.RegionInfo.ScopeID, userID) == null)
|
||||
if (m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, userID) == null)
|
||||
{
|
||||
// The user does not have a local account; let's cache its service URL
|
||||
string inventoryURL = string.Empty;
|
||||
ScenePresence sp = null;
|
||||
foreach (Scene scene in m_Scenes)
|
||||
{
|
||||
scene.TryGetScenePresence(userID, out sp);
|
||||
if (sp != null)
|
||||
{
|
||||
|
@ -231,17 +195,27 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
{
|
||||
inventoryURL = inventoryURL.Trim(new char[] { '/' });
|
||||
m_InventoryURLs.Add(userID, inventoryURL);
|
||||
m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Added {0} to the cache of inventory URLs", inventoryURL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// else put a null; it means that the methods should forward to local grid's inventory
|
||||
m_InventoryURLs.Add(userID, null);
|
||||
}
|
||||
|
||||
private void DropInventoryServiceURL(UUID userID)
|
||||
{
|
||||
lock (m_InventoryURLs)
|
||||
if (m_InventoryURLs.ContainsKey(userID))
|
||||
{
|
||||
string url = m_InventoryURLs[userID];
|
||||
m_InventoryURLs.Remove(userID);
|
||||
m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Removed {0} from the cache of inventory URLs", url);
|
||||
}
|
||||
}
|
||||
|
||||
public string GetInventoryServiceURL(UUID userID)
|
||||
|
@ -249,7 +223,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
if (m_InventoryURLs.ContainsKey(userID))
|
||||
return m_InventoryURLs[userID];
|
||||
|
||||
return null;
|
||||
else
|
||||
CacheInventoryServiceURL(userID);
|
||||
|
||||
return m_InventoryURLs[userID];
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -276,7 +253,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
|
||||
public InventoryFolderBase GetRootFolder(UUID userID)
|
||||
{
|
||||
m_log.DebugFormat("[HGInventory]: GetRootFolder for {0}", userID);
|
||||
m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetRootFolder for {0}", userID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(userID);
|
||||
|
||||
|
@ -290,7 +267,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
|
||||
public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
|
||||
{
|
||||
m_log.DebugFormat("[HGInventory]: GetFolderForType {0} type {1}", userID, type);
|
||||
m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetFolderForType {0} type {1}", userID, type);
|
||||
|
||||
string invURL = GetInventoryServiceURL(userID);
|
||||
|
||||
|
@ -304,7 +281,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
|
||||
public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
|
||||
{
|
||||
m_log.Debug("[HGInventory]: GetFolderContent " + folderID);
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderContent " + folderID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(userID);
|
||||
|
||||
|
@ -319,7 +296,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
|
||||
public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
|
||||
{
|
||||
m_log.Debug("[HGInventory]: GetFolderItems " + folderID);
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderItems " + folderID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(userID);
|
||||
|
||||
|
@ -337,7 +314,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
if (folder == null)
|
||||
return false;
|
||||
|
||||
m_log.Debug("[HGInventory]: AddFolder " + folder.ID);
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: AddFolder " + folder.ID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(folder.Owner);
|
||||
|
||||
|
@ -354,7 +331,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
if (folder == null)
|
||||
return false;
|
||||
|
||||
m_log.Debug("[HGInventory]: UpdateFolder " + folder.ID);
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateFolder " + folder.ID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(folder.Owner);
|
||||
|
||||
|
@ -373,7 +350,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
if (folderIDs.Count == 0)
|
||||
return false;
|
||||
|
||||
m_log.Debug("[HGInventory]: DeleteFolders for " + ownerID);
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteFolders for " + ownerID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(ownerID);
|
||||
|
||||
|
@ -390,7 +367,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
if (folder == null)
|
||||
return false;
|
||||
|
||||
m_log.Debug("[HGInventory]: MoveFolder for " + folder.Owner);
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: MoveFolder for " + folder.Owner);
|
||||
|
||||
string invURL = GetInventoryServiceURL(folder.Owner);
|
||||
|
||||
|
@ -407,7 +384,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
if (folder == null)
|
||||
return false;
|
||||
|
||||
m_log.Debug("[HGInventory]: PurgeFolder for " + folder.Owner);
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: PurgeFolder for " + folder.Owner);
|
||||
|
||||
string invURL = GetInventoryServiceURL(folder.Owner);
|
||||
|
||||
|
@ -424,7 +401,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
if (item == null)
|
||||
return false;
|
||||
|
||||
m_log.Debug("[HGInventory]: AddItem " + item.ID);
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: AddItem " + item.ID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(item.Owner);
|
||||
|
||||
|
@ -441,7 +418,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
if (item == null)
|
||||
return false;
|
||||
|
||||
m_log.Debug("[HGInventory]: UpdateItem " + item.ID);
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateItem " + item.ID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(item.Owner);
|
||||
|
||||
|
@ -460,7 +437,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
if (items.Count == 0)
|
||||
return true;
|
||||
|
||||
m_log.Debug("[HGInventory]: MoveItems for " + ownerID);
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: MoveItems for " + ownerID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(ownerID);
|
||||
|
||||
|
@ -481,7 +458,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
if (itemIDs.Count == 0)
|
||||
return true;
|
||||
|
||||
m_log.Debug("[HGInventory]: DeleteItems for " + ownerID);
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteItems for " + ownerID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(ownerID);
|
||||
|
||||
|
@ -497,7 +474,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
{
|
||||
if (item == null)
|
||||
return null;
|
||||
m_log.Debug("[HGInventory]: GetItem " + item.ID);
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: GetItem " + item.ID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(item.Owner);
|
||||
|
||||
|
@ -514,7 +491,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
if (folder == null)
|
||||
return null;
|
||||
|
||||
m_log.Debug("[HGInventory]: GetFolder " + folder.ID);
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolder " + folder.ID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(folder.Owner);
|
||||
|
||||
|
@ -538,7 +515,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
|
||||
public int GetAssetPermissions(UUID userID, UUID assetID)
|
||||
{
|
||||
m_log.Debug("[HGInventory]: GetAssetPermissions " + assetID);
|
||||
m_log.Debug("[HG INVENTORY CONNECTOR]: GetAssetPermissions " + assetID);
|
||||
|
||||
string invURL = GetInventoryServiceURL(userID);
|
||||
|
||||
|
@ -575,44 +552,5 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
return connector;
|
||||
}
|
||||
|
||||
|
||||
private UUID GetSessionID(UUID userID)
|
||||
{
|
||||
ScenePresence sp = null;
|
||||
if (m_Scene.TryGetScenePresence(userID, out sp))
|
||||
{
|
||||
return sp.ControllingClient.SessionId;
|
||||
}
|
||||
|
||||
m_log.DebugFormat("[HG INVENTORY CONNECTOR]: scene presence for {0} not found", userID);
|
||||
return UUID.Zero;
|
||||
}
|
||||
|
||||
private bool IsForeignUser(UUID userID, out string inventoryURL)
|
||||
{
|
||||
inventoryURL = string.Empty;
|
||||
UserAccount account = null;
|
||||
if (m_Scene.UserAccountService != null)
|
||||
account = m_Scene.UserAccountService.GetUserAccount(m_Scene.RegionInfo.ScopeID, userID);
|
||||
|
||||
if (account == null) // foreign user
|
||||
{
|
||||
ScenePresence sp = null;
|
||||
m_Scene.TryGetScenePresence(userID, out sp);
|
||||
if (sp != null)
|
||||
{
|
||||
AgentCircuitData aCircuit = m_Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
|
||||
if (aCircuit.ServiceURLs.ContainsKey("InventoryServerURI"))
|
||||
{
|
||||
inventoryURL = aCircuit.ServiceURLs["InventoryServerURI"].ToString();
|
||||
inventoryURL = inventoryURL.Trim(new char[] { '/' });
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
protected Dictionary<UUID, Dictionary<AssetType, InventoryFolderBase>> m_InventoryCache;
|
||||
|
||||
// A cache of userIDs --> ServiceURLs, for HGBroker only
|
||||
protected Dictionary<UUID, string> m_InventoryURLs;
|
||||
protected Dictionary<UUID, string> m_InventoryURLs =
|
||||
new Dictionary<UUID, string>();
|
||||
|
||||
public virtual void Init(IConfigSource source, BaseInventoryConnector connector)
|
||||
{
|
||||
|
|
|
@ -172,11 +172,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
return m_RemoteConnector.GetFolderForType(userID, type);
|
||||
}
|
||||
|
||||
public Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID)
|
||||
{
|
||||
return m_RemoteConnector.GetSystemFolders(userID);
|
||||
}
|
||||
|
||||
public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
|
||||
{
|
||||
return m_RemoteConnector.GetFolderContent(userID, folderID);
|
||||
|
@ -267,9 +262,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|||
|
||||
public InventoryItemBase GetItem(InventoryItemBase item)
|
||||
{
|
||||
m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetItem {0}", item.ID);
|
||||
if (item == null)
|
||||
return null;
|
||||
|
||||
if (m_RemoteConnector == null)
|
||||
m_log.DebugFormat("[XINVENTORY CONNECTOR]: connector stub is null!!!");
|
||||
return m_RemoteConnector.GetItem(item);
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
|
|||
|
||||
m_PresenceDetector = new PresenceDetector(this);
|
||||
|
||||
m_log.Info("[INVENTORY CONNECTOR]: Remote presence enabled");
|
||||
m_log.Info("[REMOTE PRESENCE CONNECTOR]: Remote presence enabled");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1967,8 +1967,17 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
List<SceneObjectPart> children = new List<SceneObjectPart>();
|
||||
SceneObjectPart root = GetSceneObjectPart(parentPrimId);
|
||||
|
||||
if (Permissions.CanLinkObject(client.AgentId, root.ParentGroup.RootPart.UUID))
|
||||
if (root == null)
|
||||
{
|
||||
m_log.DebugFormat("[LINK]: Can't find linkset root prim {0{", parentPrimId);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Permissions.CanLinkObject(client.AgentId, root.ParentGroup.RootPart.UUID))
|
||||
{
|
||||
m_log.DebugFormat("[LINK]: Refusing link. No permissions on root prim");
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (uint localID in childPrimIds)
|
||||
{
|
||||
|
@ -1987,7 +1996,16 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// Must be all one owner
|
||||
//
|
||||
if (owners.Count > 1)
|
||||
{
|
||||
m_log.DebugFormat("[LINK]: Refusing link. Too many owners");
|
||||
return;
|
||||
}
|
||||
|
||||
if (children.Count == 0)
|
||||
{
|
||||
m_log.DebugFormat("[LINK]: Refusing link. No permissions to link any of the children");
|
||||
return;
|
||||
}
|
||||
|
||||
m_sceneGraph.LinkObjects(root, children);
|
||||
}
|
||||
|
|
|
@ -1,104 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
using Nwc.XmlRpc;
|
||||
using OpenSim.Server.Base;
|
||||
using OpenSim.Server.Handlers.Inventory;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using OpenSim.Server.Handlers.Base;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Server.Handlers.Hypergrid
|
||||
{
|
||||
public class HGInventoryServiceInConnector : InventoryServiceInConnector
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
//private static readonly int INVENTORY_DEFAULT_SESSION_TIME = 30; // secs
|
||||
//private AuthedSessionCache m_session_cache = new AuthedSessionCache(INVENTORY_DEFAULT_SESSION_TIME);
|
||||
|
||||
private IUserAgentService m_UserAgentService;
|
||||
|
||||
public HGInventoryServiceInConnector(IConfigSource config, IHttpServer server, string configName) :
|
||||
base(config, server, configName)
|
||||
{
|
||||
IConfig serverConfig = config.Configs[m_ConfigName];
|
||||
if (serverConfig == null)
|
||||
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
|
||||
|
||||
string userAgentService = serverConfig.GetString("UserAgentService", string.Empty);
|
||||
string m_userserver_url = serverConfig.GetString("UserAgentURI", String.Empty);
|
||||
if (m_userserver_url != string.Empty)
|
||||
{
|
||||
Object[] args = new Object[] { m_userserver_url };
|
||||
m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(userAgentService, args);
|
||||
}
|
||||
|
||||
AddHttpHandlers(server);
|
||||
m_log.Debug("[HG INVENTORY HANDLER]: handlers initialized");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check that the source of an inventory request for a particular agent is a current session belonging to
|
||||
/// that agent.
|
||||
/// </summary>
|
||||
/// <param name="session_id"></param>
|
||||
/// <param name="avatar_id"></param>
|
||||
/// <returns></returns>
|
||||
public override bool CheckAuthSession(string session_id, string avatar_id)
|
||||
{
|
||||
//m_log.InfoFormat("[HG INVENTORY IN CONNECTOR]: checking authed session {0} {1}", session_id, avatar_id);
|
||||
// This doesn't work
|
||||
|
||||
// if (m_session_cache.getCachedSession(session_id, avatar_id) == null)
|
||||
// {
|
||||
// //cache miss, ask userserver
|
||||
// m_UserAgentService.VerifyAgent(session_id, ???);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // cache hits
|
||||
// m_log.Info("[HG INVENTORY IN CONNECTOR]: got authed session from cache");
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// m_log.Warn("[HG INVENTORY IN CONNECTOR]: unknown session_id, request rejected");
|
||||
// return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -144,8 +144,6 @@ namespace OpenSim.Server.Handlers.Asset
|
|||
return HandleGetActiveGestures(request);
|
||||
case "GETASSETPERMISSIONS":
|
||||
return HandleGetAssetPermissions(request);
|
||||
case "GETSYSTEMFOLDERS":
|
||||
return HandleGetSystemFolders(request);
|
||||
}
|
||||
m_log.DebugFormat("[XINVENTORY HANDLER]: unknown method request: {0}", method);
|
||||
}
|
||||
|
@ -575,29 +573,6 @@ namespace OpenSim.Server.Handlers.Asset
|
|||
return encoding.GetBytes(xmlString);
|
||||
}
|
||||
|
||||
byte[] HandleGetSystemFolders(Dictionary<string, object> request)
|
||||
{
|
||||
Dictionary<string, object> result = new Dictionary<string, object>();
|
||||
UUID principal = UUID.Zero;
|
||||
UUID.TryParse(request["PRINCIPAL"].ToString(), out principal);
|
||||
|
||||
Dictionary<AssetType, InventoryFolderBase> sfolders = GetSystemFolders(principal);
|
||||
//m_log.DebugFormat("[XXX]: SystemFolders got {0} folders", sfolders.Count);
|
||||
|
||||
Dictionary<string, object> folders = new Dictionary<string, object>();
|
||||
int i = 0;
|
||||
foreach (KeyValuePair<AssetType, InventoryFolderBase> kvp in sfolders)
|
||||
{
|
||||
folders["folder_" + i.ToString()] = EncodeFolder(kvp.Value);
|
||||
i++;
|
||||
}
|
||||
result["FOLDERS"] = folders;
|
||||
|
||||
string xmlString = ServerUtils.BuildXmlResponse(result);
|
||||
//m_log.DebugFormat("[XXX]: resp string: {0}", xmlString);
|
||||
UTF8Encoding encoding = new UTF8Encoding();
|
||||
return encoding.GetBytes(xmlString);
|
||||
}
|
||||
|
||||
private Dictionary<string, object> EncodeFolder(InventoryFolderBase f)
|
||||
{
|
||||
|
@ -683,30 +658,5 @@ namespace OpenSim.Server.Handlers.Asset
|
|||
return item;
|
||||
}
|
||||
|
||||
#region Extra
|
||||
private Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID)
|
||||
{
|
||||
InventoryFolderBase root = m_InventoryService.GetRootFolder(userID);
|
||||
if (root != null)
|
||||
{
|
||||
InventoryCollection content = m_InventoryService.GetFolderContent(userID, root.ID);
|
||||
if (content != null)
|
||||
{
|
||||
Dictionary<AssetType, InventoryFolderBase> folders = new Dictionary<AssetType, InventoryFolderBase>();
|
||||
foreach (InventoryFolderBase folder in content.Folders)
|
||||
{
|
||||
if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown))
|
||||
folders[(AssetType)folder.Type] = folder;
|
||||
}
|
||||
// Put the root folder there, as type Folder
|
||||
folders[AssetType.Folder] = root;
|
||||
return folders;
|
||||
}
|
||||
}
|
||||
m_log.WarnFormat("[XINVENTORY SERVICE]: System folders for {0} not found", userID);
|
||||
return new Dictionary<AssetType, InventoryFolderBase>();
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -157,6 +157,10 @@ namespace OpenSim.Services.Connectors
|
|||
}
|
||||
|
||||
public InventoryCollection GetFolderContent(UUID principalID, UUID folderID)
|
||||
{
|
||||
InventoryCollection inventory = new InventoryCollection();
|
||||
|
||||
try
|
||||
{
|
||||
Dictionary<string,object> ret = MakeRequest("GETFOLDERCONTENT",
|
||||
new Dictionary<string,object> {
|
||||
|
@ -170,7 +174,6 @@ namespace OpenSim.Services.Connectors
|
|||
return null;
|
||||
|
||||
|
||||
InventoryCollection inventory = new InventoryCollection();
|
||||
inventory.Folders = new List<InventoryFolderBase>();
|
||||
inventory.Items = new List<InventoryItemBase>();
|
||||
inventory.UserID = principalID;
|
||||
|
@ -180,8 +183,6 @@ namespace OpenSim.Services.Connectors
|
|||
Dictionary<string,object> items =
|
||||
(Dictionary<string,object>)ret["ITEMS"];
|
||||
|
||||
try
|
||||
{
|
||||
foreach (Object o in folders.Values) // getting the values directly, we don't care about the keys folder_i
|
||||
inventory.Folders.Add(BuildFolder((Dictionary<string, object>)o));
|
||||
foreach (Object o in items.Values) // getting the values directly, we don't care about the keys item_i
|
||||
|
@ -189,7 +190,7 @@ namespace OpenSim.Services.Connectors
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.DebugFormat("[XINVENTORY CONNECTOR STUB]: Exception unwrapping content list: {0}", e.Message);
|
||||
m_log.DebugFormat("[XINVENTORY CONNECTOR STUB]: Exception in GetFolderContent: {0}", e.Message);
|
||||
}
|
||||
|
||||
return inventory;
|
||||
|
@ -407,6 +408,8 @@ namespace OpenSim.Services.Connectors
|
|||
}
|
||||
|
||||
public InventoryItemBase GetItem(InventoryItemBase item)
|
||||
{
|
||||
try
|
||||
{
|
||||
Dictionary<string, object> ret = MakeRequest("GETITEM",
|
||||
new Dictionary<string, object> {
|
||||
|
@ -420,8 +423,17 @@ namespace OpenSim.Services.Connectors
|
|||
|
||||
return BuildItem((Dictionary<string, object>)ret["item"]);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.DebugFormat("[XINVENTORY CONNECTOR STUB]: Exception in GetItem: {0}", e.Message);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public InventoryFolderBase GetFolder(InventoryFolderBase folder)
|
||||
{
|
||||
try
|
||||
{
|
||||
Dictionary<string, object> ret = MakeRequest("GETFOLDER",
|
||||
new Dictionary<string, object> {
|
||||
|
@ -435,6 +447,13 @@ namespace OpenSim.Services.Connectors
|
|||
|
||||
return BuildFolder((Dictionary<string, object>)ret["folder"]);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.DebugFormat("[XINVENTORY CONNECTOR STUB]: Exception in GetFolder: {0}", e.Message);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<InventoryItemBase> GetActiveGestures(UUID principalID)
|
||||
{
|
||||
|
@ -468,36 +487,6 @@ namespace OpenSim.Services.Connectors
|
|||
return int.Parse(ret["RESULT"].ToString());
|
||||
}
|
||||
|
||||
public Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID)
|
||||
{
|
||||
Dictionary<string, object> ret = MakeRequest("GETSYSTEMFOLDERS",
|
||||
new Dictionary<string, object> {
|
||||
{ "PRINCIPAL", userID.ToString() },
|
||||
});
|
||||
|
||||
if (ret == null)
|
||||
return new Dictionary<AssetType,InventoryFolderBase>();
|
||||
|
||||
Dictionary<AssetType, InventoryFolderBase> sfolders = new Dictionary<AssetType, InventoryFolderBase>();
|
||||
|
||||
try
|
||||
{
|
||||
Dictionary<string, object> folders = (Dictionary<string, object>)ret["FOLDERS"];
|
||||
|
||||
foreach (Object o in folders.Values) // getting the values directly, we don't care about the keys folder_i
|
||||
{
|
||||
InventoryFolderBase folder = BuildFolder((Dictionary<string, object>)o);
|
||||
sfolders.Add((AssetType)folder.Type, folder);
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.DebugFormat("[XINVENTORY CONNECTOR STUB]: exception {0}", e.Message);
|
||||
}
|
||||
|
||||
return sfolders;
|
||||
}
|
||||
|
||||
// These are either obsolete or unused
|
||||
//
|
||||
|
|
|
@ -329,7 +329,7 @@ namespace OpenSim.Services.Connectors
|
|||
reqString);
|
||||
if (reply == null || (reply != null && reply == string.Empty))
|
||||
{
|
||||
m_log.DebugFormat("[PRESENCE CONNECTOR]: GetAgent received null or empty reply");
|
||||
m_log.DebugFormat("[PRESENCE CONNECTOR]: GetAgents received null or empty reply");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue