mirror of
https://github.com/opensim/opensim.git
synced 2026-08-13 05:05:43 +08:00
Merge branch 'master' into careminster-presence-refactor
This brings careminster on the level of master. To be tested
This commit is contained in:
@@ -33,7 +33,6 @@ using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Framework.Communications.Cache;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Services.Interfaces;
|
||||
@@ -109,7 +108,7 @@ namespace OpenSim.Region.CoreModules.World
|
||||
{
|
||||
foreach (Scene s in m_SceneList)
|
||||
{
|
||||
if(!ProcessCommand(s, cmd))
|
||||
if (!ProcessCommand(s, cmd))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,10 +38,11 @@ using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Serialization;
|
||||
using OpenSim.Framework.Serialization.External;
|
||||
using OpenSim.Framework.Communications.Cache;
|
||||
|
||||
using OpenSim.Region.CoreModules.World.Terrain;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
{
|
||||
@@ -73,7 +74,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
public ArchiveReadRequest(Scene scene, string loadPath, bool merge, Guid requestId)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_loadStream = new GZipStream(GetStream(loadPath), CompressionMode.Decompress);
|
||||
|
||||
try
|
||||
{
|
||||
m_loadStream = new GZipStream(GetStream(loadPath), CompressionMode.Decompress);
|
||||
}
|
||||
catch (EntryPointNotFoundException e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[ARCHIVER]: Mismatch between Mono and zlib1g library version when trying to create compression stream."
|
||||
+ "If you've manually installed Mono, have you appropriately updated zlib1g as well?");
|
||||
m_log.Error(e);
|
||||
}
|
||||
|
||||
m_errorMessage = String.Empty;
|
||||
m_merge = merge;
|
||||
m_requestId = requestId;
|
||||
@@ -181,10 +194,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
|
||||
// Try to retain the original creator/owner/lastowner if their uuid is present on this grid
|
||||
// otherwise, use the master avatar uuid instead
|
||||
UUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID;
|
||||
|
||||
if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero)
|
||||
masterAvatarId = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
|
||||
// Reload serialized parcels
|
||||
m_log.InfoFormat("[ARCHIVER]: Loading {0} parcels. Please wait.", serialisedParcels.Count);
|
||||
@@ -193,7 +202,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
{
|
||||
LandData parcel = LandDataSerializer.Deserialize(serialisedParcel);
|
||||
if (!ResolveUserUuid(parcel.OwnerID))
|
||||
parcel.OwnerID = masterAvatarId;
|
||||
parcel.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
landData.Add(parcel);
|
||||
}
|
||||
m_scene.EventManager.TriggerIncomingLandDataFromStorage(landData);
|
||||
@@ -232,13 +241,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
foreach (SceneObjectPart part in sceneObject.Children.Values)
|
||||
{
|
||||
if (!ResolveUserUuid(part.CreatorID))
|
||||
part.CreatorID = masterAvatarId;
|
||||
part.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
|
||||
if (!ResolveUserUuid(part.OwnerID))
|
||||
part.OwnerID = masterAvatarId;
|
||||
part.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
|
||||
if (!ResolveUserUuid(part.LastOwnerID))
|
||||
part.LastOwnerID = masterAvatarId;
|
||||
part.LastOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
|
||||
// And zap any troublesome sit target information
|
||||
part.SitTargetOrientation = new Quaternion(0, 0, 0, 1);
|
||||
@@ -253,11 +262,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
{
|
||||
if (!ResolveUserUuid(kvp.Value.OwnerID))
|
||||
{
|
||||
kvp.Value.OwnerID = masterAvatarId;
|
||||
}
|
||||
if (!ResolveUserUuid(kvp.Value.CreatorID))
|
||||
{
|
||||
kvp.Value.CreatorID = masterAvatarId;
|
||||
if (!ResolveUserUuid(kvp.Value.OwnerID))
|
||||
{
|
||||
kvp.Value.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
}
|
||||
if (!ResolveUserUuid(kvp.Value.CreatorID))
|
||||
{
|
||||
kvp.Value.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
}
|
||||
}
|
||||
}
|
||||
part.TaskInventory.LockItemsForRead(false);
|
||||
@@ -291,8 +303,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
{
|
||||
if (!m_validUserUuids.ContainsKey(uuid))
|
||||
{
|
||||
CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(uuid);
|
||||
if (profile != null && profile.UserProfile != null)
|
||||
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, uuid);
|
||||
if (account != null)
|
||||
m_validUserUuids.Add(uuid, true);
|
||||
else
|
||||
m_validUserUuids.Add(uuid, false);
|
||||
@@ -337,7 +349,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
|
||||
//m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType);
|
||||
|
||||
AssetBase asset = new AssetBase(new UUID(uuid), String.Empty, assetType);
|
||||
AssetBase asset = new AssetBase(new UUID(uuid), String.Empty, assetType, UUID.Zero.ToString());
|
||||
asset.Data = data;
|
||||
|
||||
// We're relying on the asset service to do the sensible thing and not store the asset if it already
|
||||
@@ -422,6 +434,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
currentRegionSettings.TerrainTexture4 = loadedRegionSettings.TerrainTexture4;
|
||||
currentRegionSettings.UseEstateSun = loadedRegionSettings.UseEstateSun;
|
||||
currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight;
|
||||
|
||||
currentRegionSettings.Save();
|
||||
|
||||
IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>();
|
||||
|
||||
|
||||
@@ -65,7 +65,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
public ArchiveWriteRequestPreparation(Scene scene, string savePath, Guid requestId)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_saveStream = new GZipStream(new FileStream(savePath, FileMode.Create), CompressionMode.Compress);
|
||||
|
||||
try
|
||||
{
|
||||
m_saveStream = new GZipStream(new FileStream(savePath, FileMode.Create), CompressionMode.Compress);
|
||||
}
|
||||
catch (EntryPointNotFoundException e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[ARCHIVER]: Mismatch between Mono and zlib1g library version when trying to create compression stream."
|
||||
+ "If you've manually installed Mono, have you appropriately updated zlib1g as well?");
|
||||
m_log.Error(e);
|
||||
}
|
||||
|
||||
m_requestId = requestId;
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
|
||||
m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename);
|
||||
|
||||
AssetBase asset = new AssetBase(new UUID(filename), metadata.Name, metadata.AssetType);
|
||||
AssetBase asset = new AssetBase(new UUID(filename), metadata.Name, metadata.AssetType, UUID.Zero.ToString());
|
||||
asset.Description = metadata.Description;
|
||||
asset.Data = data;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ using NUnit.Framework;
|
||||
using NUnit.Framework.SyntaxHelpers;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Communications.Cache;
|
||||
|
||||
using OpenSim.Framework.Serialization;
|
||||
using OpenSim.Framework.Serialization.External;
|
||||
using OpenSim.Region.CoreModules.World.Serialiser;
|
||||
@@ -63,7 +63,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
||||
SerialiserModule serialiserModule = new SerialiserModule();
|
||||
TerrainModule terrainModule = new TerrainModule();
|
||||
|
||||
m_scene = SceneSetupHelpers.SetupScene("scene1");
|
||||
m_scene = SceneSetupHelpers.SetupScene("useraccounts");
|
||||
SceneSetupHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
||||
Quaternion rotationOffset = new Quaternion(20, 30, 40, 50);
|
||||
Vector3 offsetPosition = new Vector3(5, 10, 15);
|
||||
|
||||
return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName };
|
||||
return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName };
|
||||
}
|
||||
|
||||
protected SceneObjectPart CreateSceneObjectPart2()
|
||||
@@ -112,7 +112,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
||||
Vector3 offsetPosition = new Vector3(20, 25, 30);
|
||||
|
||||
return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName };
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test saving a V0.2 OpenSim Region Archive.
|
||||
@@ -231,7 +231,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
||||
foreach (string name in names)
|
||||
{
|
||||
if (name.EndsWith(".Resources.test-sound.wav"))
|
||||
soundDataResourceName = name;
|
||||
soundDataResourceName = name;
|
||||
}
|
||||
Assert.That(soundDataResourceName, Is.Not.Null);
|
||||
|
||||
@@ -259,7 +259,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
||||
= new TaskInventoryItem { AssetID = soundUuid, ItemID = soundItemUuid, Name = soundItemName };
|
||||
part1.Inventory.AddInventoryItem(item1, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_scene.AddNewSceneObject(object1, false);
|
||||
|
||||
@@ -306,15 +306,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
||||
/// Test loading the region settings of a V0.2 OpenSim Region Archive.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TestLoadOarV0_2RegionSettings()
|
||||
public void TestLoadOarV0_2RegionSettings()
|
||||
{
|
||||
TestHelper.InMethod();
|
||||
//log4net.Config.XmlConfigurator.Configure();
|
||||
//log4net.Config.XmlConfigurator.Configure();
|
||||
|
||||
MemoryStream archiveWriteStream = new MemoryStream();
|
||||
TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream);
|
||||
|
||||
tar.WriteDir(ArchiveConstants.TERRAINS_PATH);
|
||||
tar.WriteDir(ArchiveConstants.TERRAINS_PATH);
|
||||
tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile());
|
||||
|
||||
RegionSettings rs = new RegionSettings();
|
||||
@@ -329,11 +329,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
||||
rs.DisablePhysics = true;
|
||||
rs.DisableScripts = true;
|
||||
rs.Elevation1NW = 15.9;
|
||||
rs.Elevation1NE = 45.3;
|
||||
rs.Elevation1NE = 45.3;
|
||||
rs.Elevation1SE = 49;
|
||||
rs.Elevation1SW = 1.9;
|
||||
rs.Elevation2NW = 4.5;
|
||||
rs.Elevation2NE = 19.2;
|
||||
rs.Elevation2NE = 19.2;
|
||||
rs.Elevation2SE = 9.2;
|
||||
rs.Elevation2SW = 2.1;
|
||||
rs.FixedSun = true;
|
||||
@@ -411,7 +411,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
||||
// Quaternion part2RotationOffset = new Quaternion(60, 70, 80, 90);
|
||||
// Vector3 part2OffsetPosition = new Vector3(20, 25, 30);
|
||||
|
||||
SceneObjectPart part2 = CreateSceneObjectPart2();
|
||||
SceneObjectPart part2 = CreateSceneObjectPart2();
|
||||
|
||||
// Create an oar file that we can use for the merge
|
||||
{
|
||||
@@ -420,9 +420,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
||||
TerrainModule terrainModule = new TerrainModule();
|
||||
|
||||
Scene scene = SceneSetupHelpers.SetupScene();
|
||||
SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule);
|
||||
SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule);
|
||||
|
||||
m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false);
|
||||
m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false);
|
||||
|
||||
// Write out this scene
|
||||
scene.EventManager.OnOarFileSaved += SaveCompleted;
|
||||
|
||||
@@ -57,10 +57,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
if (!m_scene.RegionInfo.EstateSettings.UseGlobalTime)
|
||||
sun=(uint)(m_scene.RegionInfo.EstateSettings.SunPosition*1024.0) + 0x1800;
|
||||
UUID estateOwner;
|
||||
if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero)
|
||||
estateOwner = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
else
|
||||
estateOwner = m_scene.RegionInfo.MasterAvatarAssignedUUID;
|
||||
estateOwner = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
|
||||
if (m_scene.Permissions.IsGod(remote_client.AgentId))
|
||||
estateOwner = remote_client.AgentId;
|
||||
@@ -241,8 +238,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
|
||||
if (user == m_scene.RegionInfo.EstateSettings.EstateOwner)
|
||||
return; // never process EO
|
||||
if (user == m_scene.RegionInfo.MasterAvatarAssignedUUID)
|
||||
return; // never process owner
|
||||
|
||||
if ((estateAccessType & 4) != 0) // User add
|
||||
{
|
||||
@@ -709,16 +704,9 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
lsri.TaskID = sog.UUID;
|
||||
lsri.TaskLocalID = sog.LocalId;
|
||||
lsri.TaskName = sog.GetPartName(obj);
|
||||
if (m_scene.CommsManager.UUIDNameCachedTest(sog.OwnerID))
|
||||
{
|
||||
lsri.OwnerName = m_scene.CommsManager.UUIDNameRequestString(sog.OwnerID);
|
||||
}
|
||||
else
|
||||
{
|
||||
lsri.OwnerName = "waiting";
|
||||
lock (uuidNameLookupList)
|
||||
uuidNameLookupList.Add(sog.OwnerID);
|
||||
}
|
||||
lsri.OwnerName = "waiting";
|
||||
lock (uuidNameLookupList)
|
||||
uuidNameLookupList.Add(sog.OwnerID);
|
||||
|
||||
if (filter.Length != 0)
|
||||
{
|
||||
@@ -769,7 +757,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
for (int i = 0; i < uuidarr.Length; i++)
|
||||
{
|
||||
// string lookupname = m_scene.CommsManager.UUIDNameRequestString(uuidarr[i]);
|
||||
m_scene.CommsManager.UUIDNameRequestString(uuidarr[i]);
|
||||
m_scene.GetUserName(uuidarr[i]);
|
||||
// we drop it. It gets cached though... so we're ready for the next request.
|
||||
}
|
||||
}
|
||||
@@ -808,14 +796,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight;
|
||||
args.regionFlags = GetRegionFlags();
|
||||
args.regionName = m_scene.RegionInfo.RegionName;
|
||||
if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero)
|
||||
args.SimOwner = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
else
|
||||
args.SimOwner = m_scene.RegionInfo.MasterAvatarAssignedUUID;
|
||||
|
||||
// Fudge estate owner
|
||||
//if (m_scene.Permissions.IsGod(remoteClient.AgentId))
|
||||
// args.SimOwner = remoteClient.AgentId;
|
||||
args.SimOwner = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
|
||||
args.terrainBase0 = UUID.Zero;
|
||||
args.terrainBase1 = UUID.Zero;
|
||||
@@ -1194,8 +1175,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
|
||||
public bool IsManager(UUID avatarID)
|
||||
{
|
||||
if (avatarID == m_scene.RegionInfo.MasterAvatarAssignedUUID)
|
||||
return true;
|
||||
if (avatarID == m_scene.RegionInfo.EstateSettings.EstateOwner)
|
||||
return true;
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
|
||||
public EstateTerrainXferHandler(IClientAPI pRemoteClient, string pClientFilename)
|
||||
{
|
||||
m_asset = new AssetBase(UUID.Zero, pClientFilename, type);
|
||||
m_asset = new AssetBase(UUID.Zero, pClientFilename, type, pRemoteClient.AgentId.ToString());
|
||||
m_asset.Data = new byte[0];
|
||||
m_asset.Description = "empty";
|
||||
m_asset.Local = true;
|
||||
|
||||
@@ -239,10 +239,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
ILandObject fullSimParcel = new LandObject(UUID.Zero, false, m_scene);
|
||||
|
||||
fullSimParcel.SetLandBitmap(fullSimParcel.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize));
|
||||
if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero)
|
||||
fullSimParcel.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
else
|
||||
fullSimParcel.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;
|
||||
fullSimParcel.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
fullSimParcel.LandData.ClaimDate = Util.UnixTimeSinceEpoch();
|
||||
AddLandObject(fullSimParcel);
|
||||
}
|
||||
@@ -1214,10 +1211,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
{
|
||||
if (m_scene.Permissions.CanAbandonParcel(remote_client.AgentId, land))
|
||||
{
|
||||
if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero)
|
||||
land.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
else
|
||||
land.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;
|
||||
land.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
land.LandData.GroupID = UUID.Zero;
|
||||
land.LandData.IsGroupOwned = false;
|
||||
m_scene.ForEachClient(SendParcelOverlay);
|
||||
@@ -1238,10 +1232,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
{
|
||||
if (m_scene.Permissions.CanReclaimParcel(remote_client.AgentId, land))
|
||||
{
|
||||
if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero)
|
||||
land.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
else
|
||||
land.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;
|
||||
land.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
land.LandData.ClaimDate = Util.UnixTimeSinceEpoch();
|
||||
land.LandData.GroupID = UUID.Zero;
|
||||
land.LandData.IsGroupOwned = false;
|
||||
|
||||
@@ -32,7 +32,7 @@ using log4net;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Communications.Cache;
|
||||
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Services.Interfaces;
|
||||
@@ -95,6 +95,23 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
|
||||
protected Scene m_scene;
|
||||
|
||||
private InventoryFolderImpl m_libraryRootFolder;
|
||||
protected InventoryFolderImpl LibraryRootFolder
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_libraryRootFolder != null)
|
||||
return m_libraryRootFolder;
|
||||
|
||||
ILibraryService lib = m_scene.RequestModuleInterface<ILibraryService>();
|
||||
if (lib != null)
|
||||
{
|
||||
m_libraryRootFolder = lib.LibraryRootFolder;
|
||||
}
|
||||
return m_libraryRootFolder;
|
||||
}
|
||||
}
|
||||
|
||||
#region Constants
|
||||
// These are here for testing. They will be taken out
|
||||
|
||||
@@ -462,12 +479,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
{
|
||||
if (user == UUID.Zero) return false;
|
||||
|
||||
if (m_scene.RegionInfo.MasterAvatarAssignedUUID != UUID.Zero)
|
||||
{
|
||||
if (m_RegionOwnerIsGod && (m_scene.RegionInfo.MasterAvatarAssignedUUID == user))
|
||||
return true;
|
||||
}
|
||||
|
||||
if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero)
|
||||
{
|
||||
if (m_scene.RegionInfo.EstateSettings.EstateOwner == user && m_RegionOwnerIsGod)
|
||||
@@ -479,10 +490,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
|
||||
if (m_allowGridGods)
|
||||
{
|
||||
CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(user);
|
||||
if (profile != null && profile.UserProfile != null)
|
||||
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, user);
|
||||
if (account != null)
|
||||
{
|
||||
if (profile.UserProfile.GodLevel >= 200)
|
||||
if (account.UserLevel >= 200)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -499,13 +510,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
if (m_friendsModule == null)
|
||||
return false;
|
||||
|
||||
List<FriendListItem> profile = m_friendsModule.GetUserFriends(user);
|
||||
uint friendPerms = m_friendsModule.GetFriendPerms(user, objectOwner);
|
||||
if ((friendPerms & (uint)FriendRights.CanModifyObjects) != 0)
|
||||
return true;
|
||||
|
||||
foreach (FriendListItem item in profile)
|
||||
{
|
||||
if (item.Friend == objectOwner && (item.FriendPerms & (uint)FriendRights.CanModifyObjects) != 0)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1011,9 +1019,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
IInventoryService invService = m_scene.InventoryService;
|
||||
InventoryItemBase assetRequestItem = new InventoryItemBase(notecard, user);
|
||||
assetRequestItem = invService.GetItem(assetRequestItem);
|
||||
if (assetRequestItem == null) // Library item
|
||||
if (assetRequestItem == null && LibraryRootFolder != null) // Library item
|
||||
{
|
||||
assetRequestItem = scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard);
|
||||
assetRequestItem = LibraryRootFolder.FindItem(notecard);
|
||||
|
||||
if (assetRequestItem != null) // Implicitly readable
|
||||
return true;
|
||||
@@ -1431,9 +1439,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
IInventoryService invService = m_scene.InventoryService;
|
||||
InventoryItemBase assetRequestItem = new InventoryItemBase(script, user);
|
||||
assetRequestItem = invService.GetItem(assetRequestItem);
|
||||
if (assetRequestItem == null) // Library item
|
||||
if (assetRequestItem == null && LibraryRootFolder != null) // Library item
|
||||
{
|
||||
assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(script);
|
||||
assetRequestItem = LibraryRootFolder.FindItem(script);
|
||||
|
||||
if (assetRequestItem != null) // Implicitly readable
|
||||
return true;
|
||||
@@ -1526,9 +1534,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
IInventoryService invService = m_scene.InventoryService;
|
||||
InventoryItemBase assetRequestItem = new InventoryItemBase(notecard, user);
|
||||
assetRequestItem = invService.GetItem(assetRequestItem);
|
||||
if (assetRequestItem == null) // Library item
|
||||
if (assetRequestItem == null && LibraryRootFolder != null) // Library item
|
||||
{
|
||||
assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard);
|
||||
assetRequestItem = LibraryRootFolder.FindItem(notecard);
|
||||
|
||||
if (assetRequestItem != null) // Implicitly readable
|
||||
return true;
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace OpenSim.Region.CoreModules.World.Sound
|
||||
}
|
||||
|
||||
public virtual void PlayAttachedSound(
|
||||
UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags)
|
||||
UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags, float radius)
|
||||
{
|
||||
foreach (ScenePresence p in m_scene.GetAvatars())
|
||||
{
|
||||
@@ -69,14 +69,17 @@ namespace OpenSim.Region.CoreModules.World.Sound
|
||||
continue;
|
||||
|
||||
// Scale by distance
|
||||
gain = (float)((double)gain*((100.0 - dis) / 100.0));
|
||||
if (radius == 0)
|
||||
gain = (float)((double)gain * ((100.0 - dis) / 100.0));
|
||||
else
|
||||
gain = (float)((double)gain * ((radius - dis) / radius));
|
||||
|
||||
p.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void TriggerSound(
|
||||
UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle)
|
||||
UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle, float radius)
|
||||
{
|
||||
foreach (ScenePresence p in m_scene.GetAvatars())
|
||||
{
|
||||
@@ -85,7 +88,10 @@ namespace OpenSim.Region.CoreModules.World.Sound
|
||||
continue;
|
||||
|
||||
// Scale by distance
|
||||
gain = (float)((double)gain*((100.0 - dis) / 100.0));
|
||||
if (radius == 0)
|
||||
gain = (float)((double)gain * ((100.0 - dis) / 100.0));
|
||||
else
|
||||
gain = (float)((double)gain * ((radius - dis) / radius));
|
||||
|
||||
p.ControllingClient.SendTriggeredSound(
|
||||
soundId, ownerID, objectID, parentID, handle, position, (float)gain);
|
||||
|
||||
@@ -84,6 +84,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
private ITerrainChannel m_revert;
|
||||
private Scene m_scene;
|
||||
private volatile bool m_tainted;
|
||||
private readonly UndoStack<LandUndoState> m_undo = new UndoStack<LandUndoState>(5);
|
||||
|
||||
#region ICommandableModule Members
|
||||
|
||||
@@ -174,6 +175,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
|
||||
#region ITerrainModule Members
|
||||
|
||||
public void UndoTerrain(ITerrainChannel channel)
|
||||
{
|
||||
m_channel = channel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads a terrain file from disk and installs it in the scene.
|
||||
/// </summary>
|
||||
@@ -574,6 +580,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
{
|
||||
client.OnModifyTerrain += client_OnModifyTerrain;
|
||||
client.OnBakeTerrain += client_OnBakeTerrain;
|
||||
client.OnLandUndo += client_OnLandUndo;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -664,6 +671,19 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
return changesLimited;
|
||||
}
|
||||
|
||||
private void client_OnLandUndo(IClientAPI client)
|
||||
{
|
||||
lock (m_undo)
|
||||
{
|
||||
if (m_undo.Count > 0)
|
||||
{
|
||||
LandUndoState goback = m_undo.Pop();
|
||||
if (goback != null)
|
||||
goback.PlaybackState();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a copy of the current terrain to the scenes clients
|
||||
/// </summary>
|
||||
@@ -718,6 +738,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
}
|
||||
if (allowed)
|
||||
{
|
||||
StoreUndoState();
|
||||
m_painteffects[(StandardTerrainEffects) action].PaintEffect(
|
||||
m_channel, allowMask, west, south, height, size, seconds);
|
||||
|
||||
@@ -758,6 +779,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
|
||||
if (allowed)
|
||||
{
|
||||
StoreUndoState();
|
||||
m_floodeffects[(StandardTerrainEffects) action].FloodEffect(
|
||||
m_channel, fillArea, size);
|
||||
|
||||
@@ -782,6 +804,25 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
}
|
||||
}
|
||||
|
||||
private void StoreUndoState()
|
||||
{
|
||||
lock (m_undo)
|
||||
{
|
||||
if (m_undo.Count > 0)
|
||||
{
|
||||
LandUndoState last = m_undo.Peek();
|
||||
if (last != null)
|
||||
{
|
||||
if (last.Compare(m_channel))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
LandUndoState nUndo = new LandUndoState(this, m_channel);
|
||||
m_undo.Push(nUndo);
|
||||
}
|
||||
}
|
||||
|
||||
#region Console Commands
|
||||
|
||||
private void InterfaceLoadFile(Object[] args)
|
||||
|
||||
@@ -32,7 +32,6 @@ using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Region.Framework.Scenes.Hypergrid;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
||||
|
||||
@@ -104,25 +103,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
if (info != null) regionInfos.Add(info);
|
||||
}
|
||||
|
||||
if ((regionInfos.Count == 0) && IsHypergridOn())
|
||||
{
|
||||
// OK, we tried but there are no regions matching that name.
|
||||
// Let's check quickly if this is a domain name, and if so link to it
|
||||
if (mapName.Contains("."))
|
||||
{
|
||||
// It probably is a domain name. Try to link to it.
|
||||
GridRegion regInfo;
|
||||
Scene cScene = GetClientScene(remoteClient);
|
||||
IHyperlinkService hyperService = cScene.RequestModuleInterface<IHyperlinkService>();
|
||||
if (hyperService != null)
|
||||
{
|
||||
regInfo = hyperService.TryLinkRegion(remoteClient, mapName);
|
||||
if (regInfo != null)
|
||||
regionInfos.Add(regInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<MapBlockData> blocks = new List<MapBlockData>();
|
||||
|
||||
MapBlockData data;
|
||||
@@ -158,11 +138,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
remoteClient.SendMapBlock(blocks, 0);
|
||||
}
|
||||
|
||||
private bool IsHypergridOn()
|
||||
{
|
||||
return (m_scene.SceneGridService is HGSceneCommunicationService);
|
||||
}
|
||||
|
||||
private Scene GetClientScene(IClientAPI client)
|
||||
{
|
||||
foreach (Scene s in m_scenes)
|
||||
|
||||
@@ -1080,7 +1080,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
AssetBase asset = new AssetBase(
|
||||
m_scene.RegionInfo.RegionSettings.TerrainImageID,
|
||||
"terrainImage_" + m_scene.RegionInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString(),
|
||||
(sbyte)AssetType.Texture);
|
||||
(sbyte)AssetType.Texture,
|
||||
m_scene.RegionInfo.RegionID.ToString());
|
||||
asset.Data = data;
|
||||
asset.Description = m_scene.RegionInfo.RegionName;
|
||||
asset.Temporary = temporary;
|
||||
|
||||
Reference in New Issue
Block a user