mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs OpenSim/Region/Framework/Scenes/Scene.cs OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs OpenSim/Region/Framework/Scenes/SceneObjectPart.cs OpenSim/Region/Framework/Scenes/ScenePresence.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs OpenSim/Server/Handlers/Simulation/AgentHandlers.cs OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs OpenSim/Services/HypergridService/UserAgentService.cs
This commit is contained in:
@@ -498,7 +498,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
|
||||
protected virtual void StatusNotify(List<FriendInfo> friendList, UUID userID, bool online)
|
||||
{
|
||||
m_log.DebugFormat("[FRIENDS]: Entering StatusNotify for {0}", userID);
|
||||
//m_log.DebugFormat("[FRIENDS]: Entering StatusNotify for {0}", userID);
|
||||
|
||||
List<string> friendStringIds = friendList.ConvertAll<string>(friend => friend.Friend);
|
||||
List<string> remoteFriendStringIds = new List<string>();
|
||||
@@ -527,15 +527,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
// let's guard against sessions-gone-bad
|
||||
if (friendSession != null && friendSession.RegionID != UUID.Zero)
|
||||
{
|
||||
m_log.DebugFormat("[FRIENDS]: Get region {0}", friendSession.RegionID);
|
||||
//m_log.DebugFormat("[FRIENDS]: Get region {0}", friendSession.RegionID);
|
||||
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
|
||||
if (region != null)
|
||||
{
|
||||
m_FriendsSimConnector.StatusNotify(region, userID, friendSession.UserID, online);
|
||||
}
|
||||
}
|
||||
else
|
||||
m_log.DebugFormat("[FRIENDS]: friend session is null or the region is UUID.Zero");
|
||||
//else
|
||||
// m_log.DebugFormat("[FRIENDS]: friend session is null or the region is UUID.Zero");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
m_FriendsModule = fmodule;
|
||||
}
|
||||
|
||||
public override byte[] Handle(
|
||||
protected override byte[] ProcessRequest(
|
||||
string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
StreamReader sr = new StreamReader(requestData);
|
||||
|
||||
@@ -252,7 +252,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
|
||||
protected override void StatusNotify(List<FriendInfo> friendList, UUID userID, bool online)
|
||||
{
|
||||
m_log.DebugFormat("[HGFRIENDS MODULE]: Entering StatusNotify for {0}", userID);
|
||||
//m_log.DebugFormat("[HGFRIENDS MODULE]: Entering StatusNotify for {0}", userID);
|
||||
|
||||
// First, let's divide the friends on a per-domain basis
|
||||
Dictionary<string, List<FriendInfo>> friendsPerDomain = new Dictionary<string, List<FriendInfo>>();
|
||||
|
||||
@@ -125,9 +125,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
|
||||
{
|
||||
string uri = "/CAPS/" + UUID.Random();
|
||||
|
||||
caps.RegisterHandler("UntrustedSimulatorMessage",
|
||||
new RestStreamHandler("POST", uri,
|
||||
HandleUntrustedSimulatorMessage));
|
||||
caps.RegisterHandler(
|
||||
"UntrustedSimulatorMessage",
|
||||
new RestStreamHandler("POST", uri, HandleUntrustedSimulatorMessage, "UntrustedSimulatorMessage", null));
|
||||
}
|
||||
|
||||
private string HandleUntrustedSimulatorMessage(string request,
|
||||
|
||||
@@ -67,10 +67,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
/// </summary>
|
||||
protected bool m_merge;
|
||||
|
||||
/// <value>
|
||||
/// We only use this to request modules
|
||||
/// </value>
|
||||
protected Scene m_scene;
|
||||
protected IInventoryService m_InventoryService;
|
||||
protected IAssetService m_AssetService;
|
||||
protected IUserAccountService m_UserAccountService;
|
||||
|
||||
/// <value>
|
||||
/// The stream from which the inventory archive will be loaded.
|
||||
@@ -118,9 +117,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
protected Dictionary<UUID, UUID> m_creatorIdForAssetId = new Dictionary<UUID, UUID>();
|
||||
|
||||
public InventoryArchiveReadRequest(
|
||||
Scene scene, UserAccount userInfo, string invPath, string loadPath, bool merge)
|
||||
IInventoryService inv, IAssetService assets, IUserAccountService uacc, UserAccount userInfo, string invPath, string loadPath, bool merge)
|
||||
: this(
|
||||
scene,
|
||||
inv,
|
||||
assets,
|
||||
uacc,
|
||||
userInfo,
|
||||
invPath,
|
||||
new GZipStream(ArchiveHelpers.GetStream(loadPath), CompressionMode.Decompress),
|
||||
@@ -129,9 +130,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
}
|
||||
|
||||
public InventoryArchiveReadRequest(
|
||||
Scene scene, UserAccount userInfo, string invPath, Stream loadStream, bool merge)
|
||||
IInventoryService inv, IAssetService assets, IUserAccountService uacc, UserAccount userInfo, string invPath, Stream loadStream, bool merge)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_InventoryService = inv;
|
||||
m_AssetService = assets;
|
||||
m_UserAccountService = uacc;
|
||||
m_merge = merge;
|
||||
m_userInfo = userInfo;
|
||||
m_invPath = invPath;
|
||||
@@ -162,7 +165,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
|
||||
List<InventoryFolderBase> folderCandidates
|
||||
= InventoryArchiveUtils.FindFoldersByPath(
|
||||
m_scene.InventoryService, m_userInfo.PrincipalID, m_invPath);
|
||||
m_InventoryService, m_userInfo.PrincipalID, m_invPath);
|
||||
|
||||
if (folderCandidates.Count == 0)
|
||||
{
|
||||
@@ -297,7 +300,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
string plainPath = ArchiveConstants.ExtractPlainPathFromIarPath(archivePath);
|
||||
List<InventoryFolderBase> folderCandidates
|
||||
= InventoryArchiveUtils.FindFoldersByPath(
|
||||
m_scene.InventoryService, m_userInfo.PrincipalID, plainPath);
|
||||
m_InventoryService, m_userInfo.PrincipalID, plainPath);
|
||||
|
||||
if (folderCandidates.Count != 0)
|
||||
{
|
||||
@@ -380,7 +383,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
= new InventoryFolderBase(
|
||||
newFolderId, newFolderName, m_userInfo.PrincipalID,
|
||||
(short)AssetType.Unknown, destFolder.ID, 1);
|
||||
m_scene.InventoryService.AddFolder(destFolder);
|
||||
m_InventoryService.AddFolder(destFolder);
|
||||
|
||||
// Record that we have now created this folder
|
||||
iarPathExisting += rawDirsToCreate[i] + "/";
|
||||
@@ -406,7 +409,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
// Don't use the item ID that's in the file
|
||||
item.ID = UUID.Random();
|
||||
|
||||
UUID ospResolvedId = OspResolver.ResolveOspa(item.CreatorId, m_scene.UserAccountService);
|
||||
UUID ospResolvedId = OspResolver.ResolveOspa(item.CreatorId, m_UserAccountService);
|
||||
if (UUID.Zero != ospResolvedId) // The user exists in this grid
|
||||
{
|
||||
// m_log.DebugFormat("[INVENTORY ARCHIVER]: Found creator {0} via OSPA resolution", ospResolvedId);
|
||||
@@ -436,7 +439,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
// relying on native tar tools.
|
||||
m_creatorIdForAssetId[item.AssetID] = item.CreatorIdAsUuid;
|
||||
|
||||
m_scene.AddInventoryItem(item);
|
||||
if (!m_InventoryService.AddItem(item))
|
||||
m_log.WarnFormat("[INVENTORY ARCHIVER]: Unable to save item {0} in folder {1}", item.Name, item.Folder);
|
||||
|
||||
return item;
|
||||
}
|
||||
@@ -533,7 +537,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
AssetBase asset = new AssetBase(assetId, "From IAR", assetType, UUID.Zero.ToString());
|
||||
asset.Data = data;
|
||||
|
||||
m_scene.AssetService.Store(asset);
|
||||
m_AssetService.Store(asset);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
|
||||
try
|
||||
{
|
||||
request = new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadStream, merge);
|
||||
request = new InventoryArchiveReadRequest(m_aScene.InventoryService, m_aScene.AssetService, m_aScene.UserAccountService, userInfo, invPath, loadStream, merge);
|
||||
}
|
||||
catch (EntryPointNotFoundException e)
|
||||
{
|
||||
@@ -342,7 +342,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
|
||||
try
|
||||
{
|
||||
request = new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadPath, merge);
|
||||
request = new InventoryArchiveReadRequest(m_aScene.InventoryService, m_aScene.AssetService, m_aScene.UserAccountService, userInfo, invPath, loadPath, merge);
|
||||
}
|
||||
catch (EntryPointNotFoundException e)
|
||||
{
|
||||
|
||||
@@ -229,7 +229,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||
|
||||
{
|
||||
// Test replication of path1
|
||||
new InventoryArchiveReadRequest(scene, ua1, null, (Stream)null, false)
|
||||
new InventoryArchiveReadRequest(scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false)
|
||||
.ReplicateArchivePathToUserInventory(
|
||||
iarPath1, scene.InventoryService.GetRootFolder(ua1.PrincipalID),
|
||||
foldersCreated, nodesLoaded);
|
||||
@@ -246,7 +246,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||
|
||||
{
|
||||
// Test replication of path2
|
||||
new InventoryArchiveReadRequest(scene, ua1, null, (Stream)null, false)
|
||||
new InventoryArchiveReadRequest(scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false)
|
||||
.ReplicateArchivePathToUserInventory(
|
||||
iarPath2, scene.InventoryService.GetRootFolder(ua1.PrincipalID),
|
||||
foldersCreated, nodesLoaded);
|
||||
@@ -291,8 +291,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||
string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random());
|
||||
|
||||
string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName });
|
||||
|
||||
new InventoryArchiveReadRequest(scene, ua1, null, (Stream)null, false)
|
||||
|
||||
new InventoryArchiveReadRequest(scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false)
|
||||
.ReplicateArchivePathToUserInventory(
|
||||
itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID),
|
||||
new Dictionary<string, InventoryFolderBase>(), new HashSet<InventoryNodeBase>());
|
||||
@@ -342,8 +342,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||
string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random());
|
||||
|
||||
string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName });
|
||||
|
||||
new InventoryArchiveReadRequest(scene, ua1, folder1ExistingName, (Stream)null, true)
|
||||
|
||||
new InventoryArchiveReadRequest(scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, folder1ExistingName, (Stream)null, true)
|
||||
.ReplicateArchivePathToUserInventory(
|
||||
itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID),
|
||||
new Dictionary<string, InventoryFolderBase>(), new HashSet<InventoryNodeBase>());
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||
Assert.That(filePath, Is.EqualTo(ArchiveConstants.CONTROL_FILE_PATH));
|
||||
|
||||
InventoryArchiveReadRequest iarr
|
||||
= new InventoryArchiveReadRequest(null, null, null, (Stream)null, false);
|
||||
= new InventoryArchiveReadRequest(null, null, null, null, null, (Stream)null, false);
|
||||
iarr.LoadControlFile(filePath, data);
|
||||
|
||||
Assert.That(iarr.ControlFileLoaded, Is.True);
|
||||
|
||||
@@ -173,7 +173,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||
if(obj.PresenceType == PresenceType.Npc)
|
||||
return;
|
||||
|
||||
GetImageAssets(((IScenePresence)obj).UUID);
|
||||
Util.FireAndForget(delegate
|
||||
{
|
||||
GetImageAssets(((IScenePresence)obj).UUID);
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1044,12 +1047,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||
{
|
||||
OSDString assetId = (OSDString)asset;
|
||||
|
||||
Scene.AssetService.Get(string.Format("{0}/{1}",assetServerURI, assetId.AsString()), this,
|
||||
delegate (string assetID, Object s, AssetBase a)
|
||||
{
|
||||
// m_log.DebugFormat("[PROFILES]: Getting Image Assets {0}", assetID);
|
||||
return;
|
||||
});
|
||||
Scene.AssetService.Get(string.Format("{0}/{1}",assetServerURI, assetId.AsString()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user