Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs OpenSim/Region/Framework/Scenes/Scene.cs OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs OpenSim/Services/Interfaces/IUserAccountService.csavinationmerge
commit
a6e305063e
|
@ -240,78 +240,84 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
|
|
||||||
if (containingFolder != null)
|
if (containingFolder != null)
|
||||||
{
|
{
|
||||||
|
// m_log.DebugFormat(
|
||||||
|
// "[WEB FETCH INV DESC HANDLER]: Retrieved folder {0} {1} for agent id {2}",
|
||||||
|
// containingFolder.Name, containingFolder.ID, agentID);
|
||||||
|
|
||||||
version = containingFolder.Version;
|
version = containingFolder.Version;
|
||||||
|
//
|
||||||
if (fetchItems)
|
// if (fetchItems)
|
||||||
{
|
// {
|
||||||
/*
|
// List<InventoryItemBase> linkedItemsToAdd = new List<InventoryItemBase>();
|
||||||
List<InventoryItemBase> linkedItemsToAdd = new List<InventoryItemBase>();
|
//
|
||||||
|
// foreach (InventoryItemBase item in contents.Items)
|
||||||
foreach (InventoryItemBase item in contents.Items)
|
// {
|
||||||
{
|
// if (item.AssetType == (int)AssetType.Link)
|
||||||
if (item.AssetType == (int)AssetType.Link)
|
// {
|
||||||
{
|
// InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID));
|
||||||
InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID));
|
//
|
||||||
|
// // Take care of genuinely broken links where the target doesn't exist
|
||||||
// Take care of genuinely broken links where the target doesn't exist
|
// // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate,
|
||||||
// HACK: Also, don't follow up links that just point to other links. In theory this is legitimate,
|
// // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles
|
||||||
// but no viewer has been observed to set these up and this is the lazy way of avoiding cycles
|
// // rather than having to keep track of every folder requested in the recursion.
|
||||||
// rather than having to keep track of every folder requested in the recursion.
|
// if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link)
|
||||||
if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link && linkedItem.AssetType == (int)AssetType.Object)
|
// linkedItemsToAdd.Insert(0, linkedItem);
|
||||||
linkedItemsToAdd.Add(linkedItem);
|
// }
|
||||||
}
|
// }
|
||||||
}
|
//
|
||||||
|
// foreach (InventoryItemBase linkedItem in linkedItemsToAdd)
|
||||||
foreach (InventoryItemBase linkedItem in linkedItemsToAdd)
|
// {
|
||||||
{
|
// m_log.DebugFormat(
|
||||||
m_log.DebugFormat(
|
// "[WEB FETCH INV DESC HANDLER]: Inserted linked item {0} for link in folder {1} for agent {2}",
|
||||||
"[WEB FETCH INV DESC HANDLER]: Inserted linked item {0} for link in folder {1} for agent {2}",
|
// linkedItem.Name, folderID, agentID);
|
||||||
linkedItem.Name, folderID, agentID);
|
//
|
||||||
|
// contents.Items.Add(linkedItem);
|
||||||
contents.Items.Insert(0, linkedItem);
|
// }
|
||||||
}
|
//
|
||||||
*/
|
// // If the folder requested contains links, then we need to send those folders first, otherwise the links
|
||||||
|
// // will be broken in the viewer.
|
||||||
/*
|
// HashSet<UUID> linkedItemFolderIdsToSend = new HashSet<UUID>();
|
||||||
// If the folder requested contains links, then we need to send those folders first, otherwise the links
|
// foreach (InventoryItemBase item in contents.Items)
|
||||||
// will be broken in the viewer.
|
// {
|
||||||
HashSet<UUID> linkedItemFolderIdsToSend = new HashSet<UUID>();
|
// if (item.AssetType == (int)AssetType.Link)
|
||||||
foreach (InventoryItemBase item in contents.Items)
|
// {
|
||||||
{
|
// InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID));
|
||||||
if (item.AssetType == (int)AssetType.Link)
|
//
|
||||||
{
|
// // Take care of genuinely broken links where the target doesn't exist
|
||||||
InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID));
|
// // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate,
|
||||||
|
// // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles
|
||||||
// Take care of genuinely broken links where the target doesn't exist
|
// // rather than having to keep track of every folder requested in the recursion.
|
||||||
// HACK: Also, don't follow up links that just point to other links. In theory this is legitimate,
|
// if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link)
|
||||||
// but no viewer has been observed to set these up and this is the lazy way of avoiding cycles
|
// {
|
||||||
// rather than having to keep track of every folder requested in the recursion.
|
// // We don't need to send the folder if source and destination of the link are in the same
|
||||||
if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link)
|
// // folder.
|
||||||
{
|
// if (linkedItem.Folder != containingFolder.ID)
|
||||||
// We don't need to send the folder if source and destination of the link are in the same
|
// linkedItemFolderIdsToSend.Add(linkedItem.Folder);
|
||||||
// folder.
|
// }
|
||||||
if (linkedItem.Folder != containingFolder.ID)
|
// }
|
||||||
linkedItemFolderIdsToSend.Add(linkedItem.Folder);
|
// }
|
||||||
}
|
//
|
||||||
}
|
// foreach (UUID linkedItemFolderId in linkedItemFolderIdsToSend)
|
||||||
}
|
// {
|
||||||
|
// m_log.DebugFormat(
|
||||||
foreach (UUID linkedItemFolderId in linkedItemFolderIdsToSend)
|
// "[WEB FETCH INV DESC HANDLER]: Recursively fetching folder {0} linked by item in folder {1} for agent {2}",
|
||||||
{
|
// linkedItemFolderId, folderID, agentID);
|
||||||
m_log.DebugFormat(
|
//
|
||||||
"[WEB FETCH INV DESC HANDLER]: Recursively fetching folder {0} linked by item in folder {1} for agent {2}",
|
// int dummyVersion;
|
||||||
linkedItemFolderId, folderID, agentID);
|
// InventoryCollection linkedCollection
|
||||||
|
// = Fetch(
|
||||||
int dummyVersion;
|
// agentID, linkedItemFolderId, ownerID, fetchFolders, fetchItems, sortOrder, out dummyVersion);
|
||||||
InventoryCollection linkedCollection
|
//
|
||||||
= Fetch(
|
// InventoryFolderBase linkedFolder = new InventoryFolderBase(linkedItemFolderId);
|
||||||
agentID, linkedItemFolderId, ownerID, fetchFolders, fetchItems, sortOrder, out dummyVersion);
|
// linkedFolder.Owner = agentID;
|
||||||
|
// linkedFolder = m_InventoryService.GetFolder(linkedFolder);
|
||||||
contents.Folders.AddRange(linkedCollection.Folders);
|
//
|
||||||
contents.Items.AddRange(linkedCollection.Items);
|
//// contents.Folders.AddRange(linkedCollection.Folders);
|
||||||
}
|
//
|
||||||
*/
|
// contents.Folders.Add(linkedFolder);
|
||||||
}
|
// contents.Items.AddRange(linkedCollection.Items);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -56,9 +56,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
public IAssetService AssetService;
|
public IAssetService AssetService;
|
||||||
public UUID AgentID;
|
public UUID AgentID;
|
||||||
public IInventoryAccessModule InventoryAccessModule;
|
public IInventoryAccessModule InventoryAccessModule;
|
||||||
public OpenJPEG.J2KLayerInfo[] Layers;
|
private OpenJPEG.J2KLayerInfo[] m_layers;
|
||||||
public bool IsDecoded;
|
public bool IsDecoded { get; private set; }
|
||||||
public bool HasAsset;
|
public bool HasAsset { get; private set; }
|
||||||
public C5.IPriorityQueueHandle<J2KImage> PriorityQueueHandle;
|
public C5.IPriorityQueueHandle<J2KImage> PriorityQueueHandle;
|
||||||
|
|
||||||
private uint m_currentPacket;
|
private uint m_currentPacket;
|
||||||
|
@ -170,14 +170,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
if (DiscardLevel >= 0 || m_stopPacket == 0)
|
if (DiscardLevel >= 0 || m_stopPacket == 0)
|
||||||
{
|
{
|
||||||
// This shouldn't happen, but if it does, we really can't proceed
|
// This shouldn't happen, but if it does, we really can't proceed
|
||||||
if (Layers == null)
|
if (m_layers == null)
|
||||||
{
|
{
|
||||||
m_log.Warn("[J2KIMAGE]: RunUpdate() called with missing Layers. Canceling texture transfer");
|
m_log.Warn("[J2KIMAGE]: RunUpdate() called with missing Layers. Canceling texture transfer");
|
||||||
m_currentPacket = m_stopPacket;
|
m_currentPacket = m_stopPacket;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int maxDiscardLevel = Math.Max(0, Layers.Length - 1);
|
int maxDiscardLevel = Math.Max(0, m_layers.Length - 1);
|
||||||
|
|
||||||
// Treat initial texture downloads with a DiscardLevel of -1 a request for the highest DiscardLevel
|
// Treat initial texture downloads with a DiscardLevel of -1 a request for the highest DiscardLevel
|
||||||
if (DiscardLevel < 0 && m_stopPacket == 0)
|
if (DiscardLevel < 0 && m_stopPacket == 0)
|
||||||
|
@ -187,9 +187,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
DiscardLevel = (sbyte)Math.Min(DiscardLevel, maxDiscardLevel);
|
DiscardLevel = (sbyte)Math.Min(DiscardLevel, maxDiscardLevel);
|
||||||
|
|
||||||
//Calculate the m_stopPacket
|
//Calculate the m_stopPacket
|
||||||
if (Layers.Length > 0)
|
if (m_layers.Length > 0)
|
||||||
{
|
{
|
||||||
m_stopPacket = (uint)GetPacketForBytePosition(Layers[(Layers.Length - 1) - DiscardLevel].End);
|
m_stopPacket = (uint)GetPacketForBytePosition(m_layers[(m_layers.Length - 1) - DiscardLevel].End);
|
||||||
//I don't know why, but the viewer seems to expect the final packet if the file
|
//I don't know why, but the viewer seems to expect the final packet if the file
|
||||||
//is just one packet bigger.
|
//is just one packet bigger.
|
||||||
if (TexturePacketCount() == m_stopPacket + 1)
|
if (TexturePacketCount() == m_stopPacket + 1)
|
||||||
|
@ -203,7 +203,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
}
|
}
|
||||||
|
|
||||||
//Give them at least two packets, to play nice with some broken viewers (SL also behaves this way)
|
//Give them at least two packets, to play nice with some broken viewers (SL also behaves this way)
|
||||||
if (m_stopPacket == 1 && Layers[0].End > FIRST_PACKET_SIZE) m_stopPacket++;
|
if (m_stopPacket == 1 && m_layers[0].End > FIRST_PACKET_SIZE) m_stopPacket++;
|
||||||
|
|
||||||
m_currentPacket = StartPacket;
|
m_currentPacket = StartPacket;
|
||||||
}
|
}
|
||||||
|
@ -344,7 +344,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
private void J2KDecodedCallback(UUID AssetId, OpenJPEG.J2KLayerInfo[] layers)
|
private void J2KDecodedCallback(UUID AssetId, OpenJPEG.J2KLayerInfo[] layers)
|
||||||
{
|
{
|
||||||
Layers = layers;
|
m_layers = layers;
|
||||||
IsDecoded = true;
|
IsDecoded = true;
|
||||||
RunUpdate();
|
RunUpdate();
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,9 @@ using log4net;
|
||||||
|
|
||||||
namespace OpenSim.Region.ClientStack.LindenUDP
|
namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// This class handles UDP texture requests.
|
||||||
|
/// </summary>
|
||||||
public class LLImageManager
|
public class LLImageManager
|
||||||
{
|
{
|
||||||
private sealed class J2KImageComparer : IComparer<J2KImage>
|
private sealed class J2KImageComparer : IComparer<J2KImage>
|
||||||
|
@ -208,7 +211,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
#region Priority Queue Helpers
|
#region Priority Queue Helpers
|
||||||
|
|
||||||
J2KImage GetHighestPriorityImage()
|
private J2KImage GetHighestPriorityImage()
|
||||||
{
|
{
|
||||||
J2KImage image = null;
|
J2KImage image = null;
|
||||||
|
|
||||||
|
@ -223,23 +226,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddImageToQueue(J2KImage image)
|
private void AddImageToQueue(J2KImage image)
|
||||||
{
|
{
|
||||||
image.PriorityQueueHandle = null;
|
image.PriorityQueueHandle = null;
|
||||||
|
|
||||||
lock (m_syncRoot)
|
lock (m_syncRoot)
|
||||||
|
{
|
||||||
try { m_priorityQueue.Add(ref image.PriorityQueueHandle, image); }
|
try { m_priorityQueue.Add(ref image.PriorityQueueHandle, image); }
|
||||||
catch (Exception) { }
|
catch (Exception) { }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoveImageFromQueue(J2KImage image)
|
private void RemoveImageFromQueue(J2KImage image)
|
||||||
{
|
{
|
||||||
lock (m_syncRoot)
|
lock (m_syncRoot)
|
||||||
|
{
|
||||||
try { m_priorityQueue.Delete(image.PriorityQueueHandle); }
|
try { m_priorityQueue.Delete(image.PriorityQueueHandle); }
|
||||||
catch (Exception) { }
|
catch (Exception) { }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateImageInQueue(J2KImage image)
|
private void UpdateImageInQueue(J2KImage image)
|
||||||
{
|
{
|
||||||
lock (m_syncRoot)
|
lock (m_syncRoot)
|
||||||
{
|
{
|
||||||
|
@ -254,4 +261,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
#endregion Priority Queue Helpers
|
#endregion Priority Queue Helpers
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -152,6 +152,9 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
|
||||||
/// <param name="j2kData">JPEG2000 data</param>
|
/// <param name="j2kData">JPEG2000 data</param>
|
||||||
private void DoJ2KDecode(UUID assetID, byte[] j2kData)
|
private void DoJ2KDecode(UUID assetID, byte[] j2kData)
|
||||||
{
|
{
|
||||||
|
// m_log.DebugFormat(
|
||||||
|
// "[J2KDecoderModule]: Doing J2K decoding of {0} bytes for asset {1}", j2kData.Length, assetID);
|
||||||
|
|
||||||
//int DecodeTime = 0;
|
//int DecodeTime = 0;
|
||||||
//DecodeTime = Environment.TickCount;
|
//DecodeTime = Environment.TickCount;
|
||||||
OpenJPEG.J2KLayerInfo[] layers;
|
OpenJPEG.J2KLayerInfo[] layers;
|
||||||
|
|
|
@ -50,6 +50,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
|
IUserManagement m_uMan;
|
||||||
|
IUserManagement UserManagementModule
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (m_uMan == null)
|
||||||
|
m_uMan = m_Scenes[0].RequestModuleInterface<IUserManagement>();
|
||||||
|
return m_uMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#region ISharedRegionModule
|
#region ISharedRegionModule
|
||||||
public override string Name
|
public override string Name
|
||||||
{
|
{
|
||||||
|
@ -369,9 +380,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
protected override FriendInfo[] GetFriendsFromService(IClientAPI client)
|
protected override FriendInfo[] GetFriendsFromService(IClientAPI client)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("[HGFRIENDS MODULE]: Entering GetFriendsFromService for {0}", client.Name);
|
// m_log.DebugFormat("[HGFRIENDS MODULE]: Entering GetFriendsFromService for {0}", client.Name);
|
||||||
|
Boolean agentIsLocal = true;
|
||||||
|
if (UserManagementModule != null)
|
||||||
|
agentIsLocal = UserManagementModule.IsLocalGridUser(client.AgentId);
|
||||||
|
|
||||||
UserAccount account1 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, client.AgentId);
|
if (agentIsLocal)
|
||||||
if (account1 != null)
|
|
||||||
return base.GetFriendsFromService(client);
|
return base.GetFriendsFromService(client);
|
||||||
|
|
||||||
FriendInfo[] finfos = new FriendInfo[0];
|
FriendInfo[] finfos = new FriendInfo[0];
|
||||||
|
@ -392,16 +405,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
|
|
||||||
protected override bool StoreRights(UUID agentID, UUID friendID, int rights)
|
protected override bool StoreRights(UUID agentID, UUID friendID, int rights)
|
||||||
{
|
{
|
||||||
UserAccount account1 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, agentID);
|
Boolean agentIsLocal = true;
|
||||||
UserAccount account2 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, friendID);
|
Boolean friendIsLocal = true;
|
||||||
|
if (UserManagementModule != null)
|
||||||
|
{
|
||||||
|
agentIsLocal = UserManagementModule.IsLocalGridUser(agentID);
|
||||||
|
friendIsLocal = UserManagementModule.IsLocalGridUser(friendID);
|
||||||
|
}
|
||||||
|
|
||||||
// Are they both local users?
|
// Are they both local users?
|
||||||
if (account1 != null && account2 != null)
|
if (agentIsLocal && friendIsLocal)
|
||||||
{
|
{
|
||||||
// local grid users
|
// local grid users
|
||||||
return base.StoreRights(agentID, friendID, rights);
|
return base.StoreRights(agentID, friendID, rights);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (account1 != null) // agent is local, friend is foreigner
|
if (agentIsLocal) // agent is local, friend is foreigner
|
||||||
{
|
{
|
||||||
FriendInfo[] finfos = GetFriends(agentID);
|
FriendInfo[] finfos = GetFriends(agentID);
|
||||||
FriendInfo finfo = GetFriend(finfos, friendID);
|
FriendInfo finfo = GetFriend(finfos, friendID);
|
||||||
|
@ -412,7 +431,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (account2 != null) // agent is foreigner, friend is local
|
if (friendIsLocal) // agent is foreigner, friend is local
|
||||||
{
|
{
|
||||||
string agentUUI = GetUUI(friendID, agentID);
|
string agentUUI = GetUUI(friendID, agentID);
|
||||||
if (agentUUI != string.Empty)
|
if (agentUUI != string.Empty)
|
||||||
|
@ -427,10 +446,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
|
|
||||||
protected override void StoreBackwards(UUID friendID, UUID agentID)
|
protected override void StoreBackwards(UUID friendID, UUID agentID)
|
||||||
{
|
{
|
||||||
UserAccount account1 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, agentID);
|
Boolean agentIsLocal = true;
|
||||||
UserAccount account2 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, friendID);
|
Boolean friendIsLocal = true;
|
||||||
|
if (UserManagementModule != null)
|
||||||
|
{
|
||||||
|
agentIsLocal = UserManagementModule.IsLocalGridUser(agentID);
|
||||||
|
friendIsLocal = UserManagementModule.IsLocalGridUser(friendID);
|
||||||
|
}
|
||||||
|
|
||||||
// Are they both local users?
|
// Are they both local users?
|
||||||
if (account1 != null && account2 != null)
|
if (agentIsLocal && friendIsLocal)
|
||||||
{
|
{
|
||||||
// local grid users
|
// local grid users
|
||||||
m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local");
|
m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local");
|
||||||
|
@ -444,10 +469,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
|
|
||||||
protected override void StoreFriendships(UUID agentID, UUID friendID)
|
protected override void StoreFriendships(UUID agentID, UUID friendID)
|
||||||
{
|
{
|
||||||
UserAccount agentAccount = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, agentID);
|
Boolean agentIsLocal = true;
|
||||||
UserAccount friendAccount = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, friendID);
|
Boolean friendIsLocal = true;
|
||||||
|
if (UserManagementModule != null)
|
||||||
|
{
|
||||||
|
agentIsLocal = UserManagementModule.IsLocalGridUser(agentID);
|
||||||
|
friendIsLocal = UserManagementModule.IsLocalGridUser(friendID);
|
||||||
|
}
|
||||||
|
|
||||||
// Are they both local users?
|
// Are they both local users?
|
||||||
if (agentAccount != null && friendAccount != null)
|
if (agentIsLocal && friendIsLocal)
|
||||||
{
|
{
|
||||||
// local grid users
|
// local grid users
|
||||||
m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local");
|
m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local");
|
||||||
|
@ -465,13 +496,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
string agentFriendService = string.Empty;
|
string agentFriendService = string.Empty;
|
||||||
string friendFriendService = string.Empty;
|
string friendFriendService = string.Empty;
|
||||||
|
|
||||||
if (agentClient != null)
|
if (agentIsLocal)
|
||||||
{
|
{
|
||||||
agentClientCircuit = ((Scene)(agentClient.Scene)).AuthenticateHandler.GetAgentCircuitData(agentClient.CircuitCode);
|
agentClientCircuit = ((Scene)(agentClient.Scene)).AuthenticateHandler.GetAgentCircuitData(agentClient.CircuitCode);
|
||||||
agentUUI = Util.ProduceUserUniversalIdentifier(agentClientCircuit);
|
agentUUI = Util.ProduceUserUniversalIdentifier(agentClientCircuit);
|
||||||
agentFriendService = agentClientCircuit.ServiceURLs["FriendsServerURI"].ToString();
|
agentFriendService = agentClientCircuit.ServiceURLs["FriendsServerURI"].ToString();
|
||||||
}
|
}
|
||||||
if (friendClient != null)
|
if (friendIsLocal)
|
||||||
{
|
{
|
||||||
friendClientCircuit = ((Scene)(friendClient.Scene)).AuthenticateHandler.GetAgentCircuitData(friendClient.CircuitCode);
|
friendClientCircuit = ((Scene)(friendClient.Scene)).AuthenticateHandler.GetAgentCircuitData(friendClient.CircuitCode);
|
||||||
friendUUI = Util.ProduceUserUniversalIdentifier(friendClientCircuit);
|
friendUUI = Util.ProduceUserUniversalIdentifier(friendClientCircuit);
|
||||||
|
@ -484,7 +515,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
// Generate a random 8-character hex number that will sign this friendship
|
// Generate a random 8-character hex number that will sign this friendship
|
||||||
string secret = UUID.Random().ToString().Substring(0, 8);
|
string secret = UUID.Random().ToString().Substring(0, 8);
|
||||||
|
|
||||||
if (agentAccount != null) // agent is local, 'friend' is foreigner
|
if (agentIsLocal) // agent is local, 'friend' is foreigner
|
||||||
{
|
{
|
||||||
// This may happen when the agent returned home, in which case the friend is not there
|
// This may happen when the agent returned home, in which case the friend is not there
|
||||||
// We need to look for its information in the friends list itself
|
// We need to look for its information in the friends list itself
|
||||||
|
@ -520,7 +551,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
friendsConn.NewFriendship(friendID, agentUUI + ";" + secret);
|
friendsConn.NewFriendship(friendID, agentUUI + ";" + secret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (friendAccount != null) // 'friend' is local, agent is foreigner
|
else if (friendIsLocal) // 'friend' is local, agent is foreigner
|
||||||
{
|
{
|
||||||
// store in the local friends service a reference to the foreign agent
|
// store in the local friends service a reference to the foreign agent
|
||||||
FriendsService.StoreFriend(friendID.ToString(), agentUUI + ";" + secret, 1);
|
FriendsService.StoreFriend(friendID.ToString(), agentUUI + ";" + secret, 1);
|
||||||
|
@ -553,10 +584,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
|
|
||||||
protected override bool DeleteFriendship(UUID agentID, UUID exfriendID)
|
protected override bool DeleteFriendship(UUID agentID, UUID exfriendID)
|
||||||
{
|
{
|
||||||
UserAccount agentAccount = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, agentID);
|
Boolean agentIsLocal = true;
|
||||||
UserAccount friendAccount = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, exfriendID);
|
Boolean friendIsLocal = true;
|
||||||
|
if (UserManagementModule != null)
|
||||||
|
{
|
||||||
|
agentIsLocal = UserManagementModule.IsLocalGridUser(agentID);
|
||||||
|
friendIsLocal = UserManagementModule.IsLocalGridUser(exfriendID);
|
||||||
|
}
|
||||||
|
|
||||||
// Are they both local users?
|
// Are they both local users?
|
||||||
if (agentAccount != null && friendAccount != null)
|
if (agentIsLocal && friendIsLocal)
|
||||||
{
|
{
|
||||||
// local grid users
|
// local grid users
|
||||||
return base.DeleteFriendship(agentID, exfriendID);
|
return base.DeleteFriendship(agentID, exfriendID);
|
||||||
|
@ -566,7 +603,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
string agentUUI = string.Empty;
|
string agentUUI = string.Empty;
|
||||||
string friendUUI = string.Empty;
|
string friendUUI = string.Empty;
|
||||||
|
|
||||||
if (agentAccount != null) // agent is local, 'friend' is foreigner
|
if (agentIsLocal) // agent is local, 'friend' is foreigner
|
||||||
{
|
{
|
||||||
// We need to look for its information in the friends list itself
|
// We need to look for its information in the friends list itself
|
||||||
FriendInfo[] finfos = GetFriends(agentID);
|
FriendInfo[] finfos = GetFriends(agentID);
|
||||||
|
@ -587,7 +624,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (friendAccount != null) // agent is foreigner, 'friend' is local
|
else if (friendIsLocal) // agent is foreigner, 'friend' is local
|
||||||
{
|
{
|
||||||
agentUUI = GetUUI(exfriendID, agentID);
|
agentUUI = GetUUI(exfriendID, agentID);
|
||||||
|
|
||||||
|
|
|
@ -180,10 +180,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||||
|
|
||||||
// m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID);
|
// m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID);
|
||||||
// Is the user a local user?
|
// Is the user a local user?
|
||||||
UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, toAgentID);
|
|
||||||
string url = string.Empty;
|
string url = string.Empty;
|
||||||
bool foreigner = false;
|
bool foreigner = false;
|
||||||
if (account == null) // foreign user
|
if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(toAgentID)) // foreign user
|
||||||
{
|
{
|
||||||
url = UserManagementModule.GetUserServerURL(toAgentID, "IMServerURI");
|
url = UserManagementModule.GetUserServerURL(toAgentID, "IMServerURI");
|
||||||
foreigner = true;
|
foreigner = true;
|
||||||
|
|
|
@ -192,8 +192,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName);
|
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName);
|
||||||
|
|
||||||
// Let's find out if this is a foreign user or a local user
|
// Let's find out if this is a foreign user or a local user
|
||||||
UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, id);
|
IUserManagement uMan = m_aScene.RequestModuleInterface<IUserManagement>();
|
||||||
if (account != null)
|
if (uMan != null && uMan.IsLocalGridUser(id))
|
||||||
{
|
{
|
||||||
// local grid user
|
// local grid user
|
||||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local");
|
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local");
|
||||||
|
@ -231,8 +231,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
IEventQueue eq = sp.Scene.RequestModuleInterface<IEventQueue>();
|
IEventQueue eq = sp.Scene.RequestModuleInterface<IEventQueue>();
|
||||||
GridRegion homeGatekeeper = MakeRegion(aCircuit);
|
GridRegion homeGatekeeper = MakeRegion(aCircuit);
|
||||||
|
|
||||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: teleporting user {0} {1} home to {2} via {3}:{4}:{5}",
|
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: teleporting user {0} {1} home to {2} via {3}:{4}",
|
||||||
aCircuit.firstname, aCircuit.lastname, finalDestination.RegionName, homeGatekeeper.ExternalHostName, homeGatekeeper.HttpPort, homeGatekeeper.RegionName);
|
aCircuit.firstname, aCircuit.lastname, finalDestination.RegionName, homeGatekeeper.ServerURI, homeGatekeeper.RegionName);
|
||||||
|
|
||||||
DoTeleport(sp, homeGatekeeper, finalDestination, position, lookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome), eq);
|
DoTeleport(sp, homeGatekeeper, finalDestination, position, lookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome), eq);
|
||||||
return true;
|
return true;
|
||||||
|
@ -318,8 +318,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
}
|
}
|
||||||
|
|
||||||
// Let's find out if this is a foreign user or a local user
|
// Let's find out if this is a foreign user or a local user
|
||||||
|
IUserManagement uMan = m_aScene.RequestModuleInterface<IUserManagement>();
|
||||||
UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, obj.AgentId);
|
UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, obj.AgentId);
|
||||||
if (account != null)
|
if (uMan != null && uMan.IsLocalGridUser(obj.AgentId))
|
||||||
{
|
{
|
||||||
// local grid user
|
// local grid user
|
||||||
return;
|
return;
|
||||||
|
@ -352,6 +353,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
|
|
||||||
region.ExternalHostName = uri.Host;
|
region.ExternalHostName = uri.Host;
|
||||||
region.HttpPort = (uint)uri.Port;
|
region.HttpPort = (uint)uri.Port;
|
||||||
|
region.ServerURI = uri.ToString();
|
||||||
region.RegionName = string.Empty;
|
region.RegionName = string.Empty;
|
||||||
region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), (int)0);
|
region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), (int)0);
|
||||||
return region;
|
return region;
|
||||||
|
|
|
@ -124,8 +124,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
|
|
||||||
protected override string GenerateLandmark(ScenePresence presence, out string prefix, out string suffix)
|
protected override string GenerateLandmark(ScenePresence presence, out string prefix, out string suffix)
|
||||||
{
|
{
|
||||||
UserAccount account = m_Scene.UserAccountService.GetUserAccount(m_Scene.RegionInfo.ScopeID, presence.UUID);
|
if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(presence.UUID))
|
||||||
if (account == null)
|
|
||||||
prefix = "HG ";
|
prefix = "HG ";
|
||||||
else
|
else
|
||||||
prefix = string.Empty;
|
prefix = string.Empty;
|
||||||
|
@ -210,12 +209,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
public override bool IsForeignUser(UUID userID, out string assetServerURL)
|
public override bool IsForeignUser(UUID userID, out string assetServerURL)
|
||||||
{
|
{
|
||||||
assetServerURL = string.Empty;
|
assetServerURL = string.Empty;
|
||||||
UserAccount account = null;
|
|
||||||
if (m_Scene.UserAccountService != null)
|
|
||||||
account = m_Scene.UserAccountService.GetUserAccount(m_Scene.RegionInfo.ScopeID, userID);
|
|
||||||
|
|
||||||
if (account == null) // foreign
|
if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(userID))
|
||||||
{
|
{ // foreign
|
||||||
ScenePresence sp = null;
|
ScenePresence sp = null;
|
||||||
if (m_Scene.TryGetScenePresence(userID, out sp))
|
if (m_Scene.TryGetScenePresence(userID, out sp))
|
||||||
{
|
{
|
||||||
|
|
|
@ -425,6 +425,15 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||||
|
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
public bool IsLocalGridUser(UUID uuid)
|
||||||
|
{
|
||||||
|
UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, uuid);
|
||||||
|
if (account == null || (account != null && !account.LocalToGrid))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion IUserManagement
|
#endregion IUserManagement
|
||||||
|
|
||||||
private void HandleShowUsers(string module, string[] cmd)
|
private void HandleShowUsers(string module, string[] cmd)
|
||||||
|
|
|
@ -415,8 +415,21 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
Request.Timeout = HttpTimeout;
|
Request.Timeout = HttpTimeout;
|
||||||
// execute the request
|
try
|
||||||
response = (HttpWebResponse) Request.GetResponse();
|
{
|
||||||
|
// execute the request
|
||||||
|
response = (HttpWebResponse) Request.GetResponse();
|
||||||
|
}
|
||||||
|
catch (WebException e)
|
||||||
|
{
|
||||||
|
if (e.Status != WebExceptionStatus.ProtocolError)
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
response = (HttpWebResponse)e.Response;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = (int)response.StatusCode;
|
||||||
|
|
||||||
Stream resStream = response.GetResponseStream();
|
Stream resStream = response.GetResponseStream();
|
||||||
|
|
||||||
|
@ -473,7 +486,6 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
||||||
response.Close();
|
response.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = (int)OSHttpStatusCode.SuccessOk;
|
|
||||||
_finished = true;
|
_finished = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -382,23 +382,5 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region IHyperAssetService
|
|
||||||
|
|
||||||
public string GetUserAssetServer(UUID userID)
|
|
||||||
{
|
|
||||||
UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, userID);
|
|
||||||
|
|
||||||
if (account != null && account.ServiceURLs.ContainsKey("AssetServerURI") && account.ServiceURLs["AssetServerURI"] != null)
|
|
||||||
return account.ServiceURLs["AssetServerURI"].ToString();
|
|
||||||
|
|
||||||
return string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string GetSimAssetServer()
|
|
||||||
{
|
|
||||||
return m_LocalAssetServiceURI;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,6 +170,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||||
|
|
||||||
public AssetBase GetCached(string id)
|
public AssetBase GetCached(string id)
|
||||||
{
|
{
|
||||||
|
// m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Cache request for {0}", id);
|
||||||
|
|
||||||
if (m_Cache != null)
|
if (m_Cache != null)
|
||||||
return m_Cache.Get(id);
|
return m_Cache.Get(id);
|
||||||
|
|
||||||
|
|
|
@ -1,223 +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.Generic;
|
|
||||||
using OpenMetaverse;
|
|
||||||
using Nini.Config;
|
|
||||||
using log4net;
|
|
||||||
using OpenSim.Framework;
|
|
||||||
using OpenSim.Services.Interfaces;
|
|
||||||
|
|
||||||
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|
||||||
{
|
|
||||||
public abstract class BaseInventoryConnector : IInventoryService
|
|
||||||
{
|
|
||||||
protected static InventoryCache m_cache;
|
|
||||||
private static bool m_Initialized;
|
|
||||||
|
|
||||||
protected virtual void Init(IConfigSource source)
|
|
||||||
{
|
|
||||||
if (!m_Initialized)
|
|
||||||
{
|
|
||||||
m_cache = new InventoryCache();
|
|
||||||
m_cache.Init(source, this);
|
|
||||||
m_Initialized = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Create the entire inventory for a given user
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="user"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public abstract bool CreateUserInventory(UUID user);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the skeleton of the inventory -- folders only
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public abstract List<InventoryFolderBase> GetInventorySkeleton(UUID userId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Synchronous inventory fetch.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userID"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public abstract InventoryCollection GetUserInventory(UUID userID);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Request the inventory for a user. This is an asynchronous operation that will call the callback when the
|
|
||||||
/// inventory has been received
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userID"></param>
|
|
||||||
/// <param name="callback"></param>
|
|
||||||
public abstract void GetUserInventory(UUID userID, InventoryReceiptCallback callback);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve the root inventory folder for the given user.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userID"></param>
|
|
||||||
/// <returns>null if no root folder was found</returns>
|
|
||||||
public InventoryFolderBase GetRootFolder(UUID userID)
|
|
||||||
{
|
|
||||||
// Root folder is here as system type Folder.
|
|
||||||
return m_cache.GetFolderForType(userID, AssetType.Folder);
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the user folder for the given folder-type
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userID"></param>
|
|
||||||
/// <param name="type"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
|
|
||||||
{
|
|
||||||
return m_cache.GetFolderForType(userID, type);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets everything (folders and items) inside a folder
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userId"></param>
|
|
||||||
/// <param name="folderID"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public abstract InventoryCollection GetFolderContent(UUID userID, UUID folderID);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the items inside a folder
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userID"></param>
|
|
||||||
/// <param name="folderID"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public abstract List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add a new folder to the user's inventory
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="folder"></param>
|
|
||||||
/// <returns>true if the folder was successfully added</returns>
|
|
||||||
public abstract bool AddFolder(InventoryFolderBase folder);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Update a folder in the user's inventory
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="folder"></param>
|
|
||||||
/// <returns>true if the folder was successfully updated</returns>
|
|
||||||
public abstract bool UpdateFolder(InventoryFolderBase folder);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Move an inventory folder to a new location
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="folder">A folder containing the details of the new location</param>
|
|
||||||
/// <returns>true if the folder was successfully moved</returns>
|
|
||||||
public abstract bool MoveFolder(InventoryFolderBase folder);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Delete a list of inventory folders (from trash)
|
|
||||||
/// </summary>
|
|
||||||
public abstract bool DeleteFolders(UUID ownerID, List<UUID> folderIDs);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Purge an inventory folder of all its items and subfolders.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="folder"></param>
|
|
||||||
/// <returns>true if the folder was successfully purged</returns>
|
|
||||||
public abstract bool PurgeFolder(InventoryFolderBase folder);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add a new item to the user's inventory.
|
|
||||||
/// If the given item has to parent folder, it tries to find the most
|
|
||||||
/// suitable folder for it.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <returns>true if the item was successfully added</returns>
|
|
||||||
public bool AddItem(InventoryItemBase item)
|
|
||||||
{
|
|
||||||
if (item == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (item.Folder == UUID.Zero)
|
|
||||||
{
|
|
||||||
InventoryFolderBase f = GetFolderForType(item.Owner, (AssetType)item.AssetType);
|
|
||||||
if (f != null)
|
|
||||||
item.Folder = f.ID;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
f = GetRootFolder(item.Owner);
|
|
||||||
if (f != null)
|
|
||||||
item.Folder = f.ID;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return AddItemPlain(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract bool AddItemPlain(InventoryItemBase item);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Update an item in the user's inventory
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <returns>true if the item was successfully updated</returns>
|
|
||||||
public abstract bool UpdateItem(InventoryItemBase item);
|
|
||||||
|
|
||||||
public abstract bool MoveItems(UUID ownerID, List<InventoryItemBase> items);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Delete an item from the user's inventory
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <returns>true if the item was successfully deleted</returns>
|
|
||||||
public abstract bool DeleteItems(UUID ownerID, List<UUID> itemIDs);
|
|
||||||
|
|
||||||
public abstract InventoryItemBase GetItem(InventoryItemBase item);
|
|
||||||
|
|
||||||
public abstract InventoryFolderBase GetFolder(InventoryFolderBase folder);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Does the given user have an inventory structure?
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userID"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public abstract bool HasInventoryForUser(UUID userID);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get the active gestures of the agent.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public abstract List<InventoryItemBase> GetActiveGestures(UUID userId);
|
|
||||||
|
|
||||||
public abstract int GetAssetPermissions(UUID userID, UUID assetID);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -218,9 +218,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||||
/// <param name="userID"></param>
|
/// <param name="userID"></param>
|
||||||
private void CacheInventoryServiceURL(UUID userID)
|
private void CacheInventoryServiceURL(UUID userID)
|
||||||
{
|
{
|
||||||
if (m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, userID) == null)
|
if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(userID))
|
||||||
{
|
{
|
||||||
// The user does not have a local account; let's cache its service URL
|
// The user is not local; let's cache its service URL
|
||||||
string inventoryURL = string.Empty;
|
string inventoryURL = string.Empty;
|
||||||
ScenePresence sp = null;
|
ScenePresence sp = null;
|
||||||
foreach (Scene scene in m_Scenes)
|
foreach (Scene scene in m_Scenes)
|
||||||
|
|
|
@ -1,237 +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.Generic;
|
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
using OpenSim.Framework;
|
|
||||||
using OpenSim.Framework.Client;
|
|
||||||
using OpenSim.Region.Framework.Scenes;
|
|
||||||
|
|
||||||
using OpenMetaverse;
|
|
||||||
using Nini.Config;
|
|
||||||
using log4net;
|
|
||||||
|
|
||||||
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
|
||||||
{
|
|
||||||
public class InventoryCache
|
|
||||||
{
|
|
||||||
private static readonly ILog m_log =
|
|
||||||
LogManager.GetLogger(
|
|
||||||
MethodBase.GetCurrentMethod().DeclaringType);
|
|
||||||
|
|
||||||
protected BaseInventoryConnector m_Connector;
|
|
||||||
protected List<Scene> m_Scenes;
|
|
||||||
|
|
||||||
// The cache proper
|
|
||||||
protected Dictionary<UUID, Dictionary<AssetType, InventoryFolderBase>> m_InventoryCache;
|
|
||||||
|
|
||||||
// A cache of userIDs --> ServiceURLs, for HGBroker only
|
|
||||||
protected Dictionary<UUID, string> m_InventoryURLs =
|
|
||||||
new Dictionary<UUID, string>();
|
|
||||||
|
|
||||||
public virtual void Init(IConfigSource source, BaseInventoryConnector connector)
|
|
||||||
{
|
|
||||||
m_Scenes = new List<Scene>();
|
|
||||||
m_InventoryCache = new Dictionary<UUID, Dictionary<AssetType, InventoryFolderBase>>();
|
|
||||||
m_Connector = connector;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void AddRegion(Scene scene)
|
|
||||||
{
|
|
||||||
m_Scenes.Add(scene);
|
|
||||||
scene.EventManager.OnMakeRootAgent += OnMakeRootAgent;
|
|
||||||
scene.EventManager.OnClientClosed += OnClientClosed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void RemoveRegion(Scene scene)
|
|
||||||
{
|
|
||||||
if ((m_Scenes != null) && m_Scenes.Contains(scene))
|
|
||||||
{
|
|
||||||
m_Scenes.Remove(scene);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void OnMakeRootAgent(ScenePresence presence)
|
|
||||||
{
|
|
||||||
// Get system folders
|
|
||||||
|
|
||||||
// First check if they're here already
|
|
||||||
lock (m_InventoryCache)
|
|
||||||
{
|
|
||||||
if (m_InventoryCache.ContainsKey(presence.UUID))
|
|
||||||
{
|
|
||||||
m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent, system folders for {0} {1} already in cache", presence.Firstname, presence.Lastname);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If not, go get them and place them in the cache
|
|
||||||
Dictionary<AssetType, InventoryFolderBase> folders = CacheSystemFolders(presence.UUID);
|
|
||||||
CacheInventoryServiceURL(presence.Scene, presence.UUID);
|
|
||||||
|
|
||||||
m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent in {0}, fetched system folders for {1} {2}: count {3}",
|
|
||||||
presence.Scene.RegionInfo.RegionName, presence.Firstname, presence.Lastname, folders.Count);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void OnClientClosed(UUID clientID, Scene scene)
|
|
||||||
{
|
|
||||||
if (m_InventoryCache.ContainsKey(clientID)) // if it's still in cache
|
|
||||||
{
|
|
||||||
ScenePresence sp = null;
|
|
||||||
foreach (Scene s in m_Scenes)
|
|
||||||
{
|
|
||||||
s.TryGetScenePresence(clientID, out sp);
|
|
||||||
if ((sp != null) && !sp.IsChildAgent && (s != scene))
|
|
||||||
{
|
|
||||||
m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping system folders in cache",
|
|
||||||
scene.RegionInfo.RegionName, clientID);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_log.DebugFormat(
|
|
||||||
"[INVENTORY CACHE]: OnClientClosed in {0}, user {1} out of sim. Dropping system folders",
|
|
||||||
scene.RegionInfo.RegionName, clientID);
|
|
||||||
DropCachedSystemFolders(clientID);
|
|
||||||
DropInventoryServiceURL(clientID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Cache a user's 'system' folders.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userID"></param>
|
|
||||||
/// <returns>Folders cached</returns>
|
|
||||||
protected Dictionary<AssetType, InventoryFolderBase> CacheSystemFolders(UUID userID)
|
|
||||||
{
|
|
||||||
// If not, go get them and place them in the cache
|
|
||||||
Dictionary<AssetType, InventoryFolderBase> folders = m_Connector.GetSystemFolders(userID);
|
|
||||||
|
|
||||||
if (folders.Count > 0)
|
|
||||||
lock (m_InventoryCache)
|
|
||||||
m_InventoryCache.Add(userID, folders);
|
|
||||||
|
|
||||||
return folders;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Drop a user's cached 'system' folders
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userID"></param>
|
|
||||||
protected void DropCachedSystemFolders(UUID userID)
|
|
||||||
{
|
|
||||||
// Drop system folders
|
|
||||||
lock (m_InventoryCache)
|
|
||||||
if (m_InventoryCache.ContainsKey(userID))
|
|
||||||
m_InventoryCache.Remove(userID);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get the system folder for a particular asset type
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userID"></param>
|
|
||||||
/// <param name="type"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
|
|
||||||
{
|
|
||||||
m_log.DebugFormat("[INVENTORY CACHE]: Getting folder for asset type {0} for user {1}", type, userID);
|
|
||||||
|
|
||||||
Dictionary<AssetType, InventoryFolderBase> folders = null;
|
|
||||||
|
|
||||||
lock (m_InventoryCache)
|
|
||||||
{
|
|
||||||
m_InventoryCache.TryGetValue(userID, out folders);
|
|
||||||
|
|
||||||
// In some situations (such as non-secured standalones), system folders can be requested without
|
|
||||||
// the user being logged in. So we need to try caching them here if we don't already have them.
|
|
||||||
if (null == folders)
|
|
||||||
CacheSystemFolders(userID);
|
|
||||||
|
|
||||||
m_InventoryCache.TryGetValue(userID, out folders);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((folders != null) && folders.ContainsKey(type))
|
|
||||||
{
|
|
||||||
m_log.DebugFormat(
|
|
||||||
"[INVENTORY CACHE]: Returning folder {0} as type {1} for {2}", folders[type], type, userID);
|
|
||||||
|
|
||||||
return folders[type];
|
|
||||||
}
|
|
||||||
|
|
||||||
m_log.WarnFormat("[INVENTORY CACHE]: Could not find folder for system type {0} for {1}", type, userID);
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the user's inventory URL from its serviceURLs, if the user is foreign,
|
|
||||||
/// and sticks it in the cache
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userID"></param>
|
|
||||||
private void CacheInventoryServiceURL(Scene scene, UUID userID)
|
|
||||||
{
|
|
||||||
if (scene.UserAccountService.GetUserAccount(scene.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;
|
|
||||||
scene.TryGetScenePresence(userID, out sp);
|
|
||||||
if (sp != null)
|
|
||||||
{
|
|
||||||
AgentCircuitData aCircuit = scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
|
|
||||||
if (aCircuit.ServiceURLs.ContainsKey("InventoryServerURI"))
|
|
||||||
{
|
|
||||||
inventoryURL = aCircuit.ServiceURLs["InventoryServerURI"].ToString();
|
|
||||||
if (inventoryURL != null && inventoryURL != string.Empty)
|
|
||||||
{
|
|
||||||
inventoryURL = inventoryURL.Trim(new char[] { '/' });
|
|
||||||
m_InventoryURLs.Add(userID, inventoryURL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DropInventoryServiceURL(UUID userID)
|
|
||||||
{
|
|
||||||
lock (m_InventoryURLs)
|
|
||||||
if (m_InventoryURLs.ContainsKey(userID))
|
|
||||||
m_InventoryURLs.Remove(userID);
|
|
||||||
}
|
|
||||||
|
|
||||||
public string GetInventoryServiceURL(UUID userID)
|
|
||||||
{
|
|
||||||
if (m_InventoryURLs.ContainsKey(userID))
|
|
||||||
return m_InventoryURLs[userID];
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -48,5 +48,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
/// <param name="firstName"></param>
|
/// <param name="firstName"></param>
|
||||||
/// <param name="profileURL"></param>
|
/// <param name="profileURL"></param>
|
||||||
void AddUser(UUID uuid, string firstName, string lastName, string profileURL);
|
void AddUser(UUID uuid, string firstName, string lastName, string profileURL);
|
||||||
|
|
||||||
|
bool IsLocalGridUser(UUID uuid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -737,7 +737,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (maptileRefresh != 0)
|
if (maptileRefresh != 0)
|
||||||
{
|
{
|
||||||
m_mapGenerationTimer.Interval = maptileRefresh * 1000;
|
m_mapGenerationTimer.Interval = maptileRefresh * 1000;
|
||||||
m_mapGenerationTimer.Elapsed += RegenerateMaptile;
|
m_mapGenerationTimer.Elapsed += RegenerateMaptileAndReregister;
|
||||||
m_mapGenerationTimer.AutoReset = true;
|
m_mapGenerationTimer.AutoReset = true;
|
||||||
m_mapGenerationTimer.Start();
|
m_mapGenerationTimer.Start();
|
||||||
}
|
}
|
||||||
|
@ -1697,21 +1697,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
m_sceneGridService.SetScene(this);
|
m_sceneGridService.SetScene(this);
|
||||||
|
|
||||||
|
//// Unfortunately this needs to be here and it can't be async.
|
||||||
|
//// The map tile image is stored in RegionSettings, but it also needs to be
|
||||||
|
//// stored in the GridService, because that's what the world map module uses
|
||||||
|
//// to send the map image UUIDs (of other regions) to the viewer...
|
||||||
|
if (m_generateMaptiles)
|
||||||
|
RegenerateMaptile();
|
||||||
|
|
||||||
GridRegion region = new GridRegion(RegionInfo);
|
GridRegion region = new GridRegion(RegionInfo);
|
||||||
string error = GridService.RegisterRegion(RegionInfo.ScopeID, region);
|
string error = GridService.RegisterRegion(RegionInfo.ScopeID, region);
|
||||||
if (error != String.Empty)
|
if (error != String.Empty)
|
||||||
{
|
|
||||||
throw new Exception(error);
|
throw new Exception(error);
|
||||||
}
|
|
||||||
|
|
||||||
// Generate the maptile asynchronously, because sometimes it can be very slow and we
|
|
||||||
// don't want this to delay starting the region.
|
|
||||||
if (m_generateMaptiles)
|
|
||||||
{
|
|
||||||
Util.FireAndForget(delegate {
|
|
||||||
RegenerateMaptile(null, null);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -5251,7 +5247,7 @@ Environment.Exit(1);
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender"></param>
|
/// <param name="sender"></param>
|
||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
public void RegenerateMaptile(object sender, ElapsedEventArgs e)
|
private void RegenerateMaptile()
|
||||||
{
|
{
|
||||||
IWorldMapModule mapModule = RequestModuleInterface<IWorldMapModule>();
|
IWorldMapModule mapModule = RequestModuleInterface<IWorldMapModule>();
|
||||||
if (mapModule != null)
|
if (mapModule != null)
|
||||||
|
@ -5306,6 +5302,17 @@ Environment.Exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void RegenerateMaptileAndReregister(object sender, ElapsedEventArgs e)
|
||||||
|
{
|
||||||
|
RegenerateMaptile();
|
||||||
|
|
||||||
|
// We need to propagate the new image UUID to the grid service
|
||||||
|
// so that all simulators can retrieve it
|
||||||
|
string error = GridService.RegisterRegion(RegionInfo.ScopeID, new GridRegion(RegionInfo));
|
||||||
|
if (error != string.Empty)
|
||||||
|
throw new Exception(error);
|
||||||
|
}
|
||||||
|
|
||||||
// This method is called across the simulation connector to
|
// This method is called across the simulation connector to
|
||||||
// determine if a given agent is allowed in this region
|
// determine if a given agent is allowed in this region
|
||||||
// AS A ROOT AGENT. Returning false here will prevent them
|
// AS A ROOT AGENT. Returning false here will prevent them
|
||||||
|
|
|
@ -2822,6 +2822,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
m_global_contactcount = 0;
|
m_global_contactcount = 0;
|
||||||
|
|
||||||
d.WorldQuickStep(world, ODE_STEPSIZE);
|
d.WorldQuickStep(world, ODE_STEPSIZE);
|
||||||
|
|
||||||
d.JointGroupEmpty(contactgroup);
|
d.JointGroupEmpty(contactgroup);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
|
@ -231,7 +231,7 @@ namespace OpenSim.Server.Handlers.UserAccounts
|
||||||
|
|
||||||
int userLevel = 0;
|
int userLevel = 0;
|
||||||
if (request.ContainsKey("UserLevel") && int.TryParse(request["UserLevel"].ToString(), out userLevel))
|
if (request.ContainsKey("UserLevel") && int.TryParse(request["UserLevel"].ToString(), out userLevel))
|
||||||
existingAccount.UserFlags = userLevel;
|
existingAccount.UserLevel = userLevel;
|
||||||
|
|
||||||
int userFlags = 0;
|
int userFlags = 0;
|
||||||
if (request.ContainsKey("UserFlags") && int.TryParse(request["UserFlags"].ToString(), out userFlags))
|
if (request.ContainsKey("UserFlags") && int.TryParse(request["UserFlags"].ToString(), out userFlags))
|
||||||
|
|
|
@ -199,6 +199,8 @@ namespace OpenSim.Services.Connectors
|
||||||
|
|
||||||
public AssetBase GetCached(string id)
|
public AssetBase GetCached(string id)
|
||||||
{
|
{
|
||||||
|
// m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Cache request for {0}", id);
|
||||||
|
|
||||||
if (m_Cache != null)
|
if (m_Cache != null)
|
||||||
return m_Cache.Get(id);
|
return m_Cache.Get(id);
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ namespace OpenSim.Services.Connectors
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
serverURI = serverURI + "xxx";
|
serverURI = serverURI + "xxx";
|
||||||
m_ServerURI = serverURI.Replace("?" + uri.Query, "");
|
m_ServerURI = serverURI.Replace(uri.Query, "");
|
||||||
m_ServerURI = m_ServerURI.TrimEnd('/') + "/helo/";
|
m_ServerURI = m_ServerURI.TrimEnd('/') + "/helo/";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -332,6 +332,9 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||||
UInt32.TryParse((string)hash["http_port"], out p);
|
UInt32.TryParse((string)hash["http_port"], out p);
|
||||||
region.HttpPort = p;
|
region.HttpPort = p;
|
||||||
}
|
}
|
||||||
|
if (hash.ContainsKey("server_uri") && hash["server_uri"] != null)
|
||||||
|
region.ServerURI = (string)hash["server_uri"];
|
||||||
|
|
||||||
if (hash["internal_port"] != null)
|
if (hash["internal_port"] != null)
|
||||||
{
|
{
|
||||||
int p = 0;
|
int p = 0;
|
||||||
|
|
|
@ -292,6 +292,10 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
account.UserFlags = response["UserFlags"].AsInteger();
|
account.UserFlags = response["UserFlags"].AsInteger();
|
||||||
account.UserLevel = response["AccessLevel"].AsInteger();
|
account.UserLevel = response["AccessLevel"].AsInteger();
|
||||||
account.UserTitle = response["UserTitle"].AsString();
|
account.UserTitle = response["UserTitle"].AsString();
|
||||||
|
account.LocalToGrid = true;
|
||||||
|
if (response.ContainsKey("LocalToGrid"))
|
||||||
|
account.LocalToGrid = (response["LocalToGrid"].AsString() == "true" ? true : false);
|
||||||
|
|
||||||
GetFirstLastName(response["Name"].AsString(), out account.FirstName, out account.LastName);
|
GetFirstLastName(response["Name"].AsString(), out account.FirstName, out account.LastName);
|
||||||
|
|
||||||
// Cache the user account info
|
// Cache the user account info
|
||||||
|
|
|
@ -102,50 +102,45 @@ namespace OpenSim.Services.GridService
|
||||||
|
|
||||||
public HypergridLinker(IConfigSource config, GridService gridService, IRegionData db)
|
public HypergridLinker(IConfigSource config, GridService gridService, IRegionData db)
|
||||||
{
|
{
|
||||||
IConfig modulesConfig = config.Configs["Modules"];
|
IConfig gridConfig = config.Configs["GridService"];
|
||||||
if (modulesConfig == null)
|
if (gridConfig == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (modulesConfig.GetString("HypergridLinker", "") != "HypergridLinker")
|
if (!gridConfig.GetBoolean("HypergridLinker", false))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_log.DebugFormat("[HYPERGRID LINKER]: Starting with db {0}", db.GetType());
|
|
||||||
|
|
||||||
m_Database = db;
|
m_Database = db;
|
||||||
m_GridService = gridService;
|
m_GridService = gridService;
|
||||||
|
m_log.DebugFormat("[HYPERGRID LINKER]: Starting with db {0}", db.GetType());
|
||||||
|
|
||||||
IConfig gridConfig = config.Configs["GridService"];
|
string assetService = gridConfig.GetString("AssetService", string.Empty);
|
||||||
if (gridConfig != null)
|
|
||||||
{
|
|
||||||
string assetService = gridConfig.GetString("AssetService", string.Empty);
|
|
||||||
|
|
||||||
Object[] args = new Object[] { config };
|
Object[] args = new Object[] { config };
|
||||||
|
|
||||||
if (assetService != string.Empty)
|
if (assetService != string.Empty)
|
||||||
m_AssetService = ServerUtils.LoadPlugin<IAssetService>(assetService, args);
|
m_AssetService = ServerUtils.LoadPlugin<IAssetService>(assetService, args);
|
||||||
|
|
||||||
string scope = gridConfig.GetString("ScopeID", string.Empty);
|
string scope = gridConfig.GetString("ScopeID", string.Empty);
|
||||||
if (scope != string.Empty)
|
if (scope != string.Empty)
|
||||||
UUID.TryParse(scope, out m_ScopeID);
|
UUID.TryParse(scope, out m_ScopeID);
|
||||||
|
|
||||||
// m_Check4096 = gridConfig.GetBoolean("Check4096", true);
|
// m_Check4096 = gridConfig.GetBoolean("Check4096", true);
|
||||||
|
|
||||||
m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles");
|
m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles");
|
||||||
|
|
||||||
m_ThisGatekeeper = gridConfig.GetString("Gatekeeper", string.Empty);
|
m_ThisGatekeeper = gridConfig.GetString("Gatekeeper", string.Empty);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
m_ThisGatekeeperURI = new Uri(m_ThisGatekeeper);
|
m_ThisGatekeeperURI = new Uri(m_ThisGatekeeper);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
m_log.WarnFormat("[HYPERGRID LINKER]: Malformed URL in [GridService], variable Gatekeeper = {0}", m_ThisGatekeeper);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService);
|
|
||||||
|
|
||||||
m_log.Debug("[HYPERGRID LINKER]: Loaded all services...");
|
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
m_log.WarnFormat("[HYPERGRID LINKER]: Malformed URL in [GridService], variable Gatekeeper = {0}", m_ThisGatekeeper);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService);
|
||||||
|
|
||||||
|
m_log.Debug("[HYPERGRID LINKER]: Loaded all services...");
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(m_MapTileDirectory))
|
if (!string.IsNullOrEmpty(m_MapTileDirectory))
|
||||||
{
|
{
|
||||||
|
|
|
@ -92,6 +92,7 @@ namespace OpenSim.Services.Interfaces
|
||||||
public int UserFlags;
|
public int UserFlags;
|
||||||
public string UserTitle;
|
public string UserTitle;
|
||||||
public string UserCountry;
|
public string UserCountry;
|
||||||
|
public Boolean LocalToGrid = true;
|
||||||
|
|
||||||
public Dictionary<string, object> ServiceURLs;
|
public Dictionary<string, object> ServiceURLs;
|
||||||
|
|
||||||
|
@ -122,6 +123,8 @@ namespace OpenSim.Services.Interfaces
|
||||||
UserTitle = kvp["UserTitle"].ToString();
|
UserTitle = kvp["UserTitle"].ToString();
|
||||||
if (kvp.ContainsKey("UserCountry"))
|
if (kvp.ContainsKey("UserCountry"))
|
||||||
UserCountry = kvp["UserCountry"].ToString();
|
UserCountry = kvp["UserCountry"].ToString();
|
||||||
|
if (kvp.ContainsKey("LocalToGrid"))
|
||||||
|
Boolean.TryParse(kvp["LocalToGrid"].ToString(), out LocalToGrid);
|
||||||
|
|
||||||
if (kvp.ContainsKey("Created"))
|
if (kvp.ContainsKey("Created"))
|
||||||
Created = Convert.ToInt32(kvp["Created"].ToString());
|
Created = Convert.ToInt32(kvp["Created"].ToString());
|
||||||
|
@ -156,6 +159,7 @@ namespace OpenSim.Services.Interfaces
|
||||||
result["UserFlags"] = UserFlags.ToString();
|
result["UserFlags"] = UserFlags.ToString();
|
||||||
result["UserTitle"] = UserTitle;
|
result["UserTitle"] = UserTitle;
|
||||||
result["UserCountry"] = UserCountry;
|
result["UserCountry"] = UserCountry;
|
||||||
|
result["LocalToGrid"] = LocalToGrid.ToString();
|
||||||
|
|
||||||
string str = string.Empty;
|
string str = string.Empty;
|
||||||
foreach (KeyValuePair<string, object> kvp in ServiceURLs)
|
foreach (KeyValuePair<string, object> kvp in ServiceURLs)
|
||||||
|
|
|
@ -82,6 +82,8 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
|
||||||
; *
|
; *
|
||||||
[GridService]
|
[GridService]
|
||||||
LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
|
LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
|
||||||
|
HypergridLinker = true
|
||||||
|
|
||||||
; Realm = "regions"
|
; Realm = "regions"
|
||||||
; AllowDuplicateNames = "True"
|
; AllowDuplicateNames = "True"
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
LandServices = "RemoteLandServicesConnector"
|
LandServices = "RemoteLandServicesConnector"
|
||||||
FriendsModule = "HGFriendsModule"
|
FriendsModule = "HGFriendsModule"
|
||||||
MapImageService = "MapImageServiceModule"
|
MapImageService = "MapImageServiceModule"
|
||||||
HypergridLinker = "HypergridLinker"
|
|
||||||
|
|
||||||
LandServiceInConnector = true
|
LandServiceInConnector = true
|
||||||
NeighbourServiceInConnector = true
|
NeighbourServiceInConnector = true
|
||||||
|
@ -60,6 +59,7 @@
|
||||||
; Needed to display non-default map tile images for linked regions
|
; Needed to display non-default map tile images for linked regions
|
||||||
AssetService = "OpenSim.Services.Connectors.dll:AssetServicesConnector"
|
AssetService = "OpenSim.Services.Connectors.dll:AssetServicesConnector"
|
||||||
|
|
||||||
|
HypergridLinker = true
|
||||||
AllowHypergridMapSearch = true
|
AllowHypergridMapSearch = true
|
||||||
|
|
||||||
[LibraryService]
|
[LibraryService]
|
||||||
|
|
|
@ -40,7 +40,6 @@
|
||||||
LibraryModule = false
|
LibraryModule = false
|
||||||
|
|
||||||
AssetCaching = "FlotsamAssetCache"
|
AssetCaching = "FlotsamAssetCache"
|
||||||
HypergridLinker = "HypergridLinker"
|
|
||||||
|
|
||||||
[SimulationDataStore]
|
[SimulationDataStore]
|
||||||
LocalServiceModule = "OpenSim.Services.Connectors.dll:SimulationDataService"
|
LocalServiceModule = "OpenSim.Services.Connectors.dll:SimulationDataService"
|
||||||
|
@ -56,6 +55,7 @@
|
||||||
StorageProvider = "OpenSim.Data.Null.dll:NullRegionData"
|
StorageProvider = "OpenSim.Data.Null.dll:NullRegionData"
|
||||||
NetworkConnector = "OpenSim.Services.Connectors.dll:SimianGridServiceConnector"
|
NetworkConnector = "OpenSim.Services.Connectors.dll:SimianGridServiceConnector"
|
||||||
|
|
||||||
|
HypergridLinker = true
|
||||||
AllowHypergridMapSearch = true
|
AllowHypergridMapSearch = true
|
||||||
|
|
||||||
[LibraryService]
|
[LibraryService]
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
EntityTransferModule = "HGEntityTransferModule"
|
EntityTransferModule = "HGEntityTransferModule"
|
||||||
InventoryAccessModule = "HGInventoryAccessModule"
|
InventoryAccessModule = "HGInventoryAccessModule"
|
||||||
FriendsModule = "HGFriendsModule"
|
FriendsModule = "HGFriendsModule"
|
||||||
HypergridLinker = "HypergridLinker"
|
|
||||||
|
|
||||||
InventoryServiceInConnector = true
|
InventoryServiceInConnector = true
|
||||||
AssetServiceInConnector = true
|
AssetServiceInConnector = true
|
||||||
|
@ -84,6 +83,7 @@
|
||||||
; Needed to display non-default map tile images for remote regions
|
; Needed to display non-default map tile images for remote regions
|
||||||
AssetService = "OpenSim.Services.AssetService.dll:AssetService"
|
AssetService = "OpenSim.Services.AssetService.dll:AssetService"
|
||||||
|
|
||||||
|
HypergridLinker = true
|
||||||
AllowHypergridMapSearch = true
|
AllowHypergridMapSearch = true
|
||||||
|
|
||||||
[PresenceService]
|
[PresenceService]
|
||||||
|
|
Loading…
Reference in New Issue