diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
52 files changed, 888 insertions, 888 deletions
diff --git a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs index f567cab..081439a 100644 --- a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs +++ b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs | |||
@@ -44,7 +44,7 @@ namespace OpenSim.Region.CoreModules.World | |||
44 | public class AccessModule : ISharedRegionModule | 44 | public class AccessModule : ISharedRegionModule |
45 | { | 45 | { |
46 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | 47 | ||
48 | private List<Scene> m_SceneList = new List<Scene>(); | 48 | private List<Scene> m_SceneList = new List<Scene>(); |
49 | 49 | ||
50 | public void Initialise(IConfigSource config) | 50 | public void Initialise(IConfigSource config) |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index f523af1..6ba8cec 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -77,14 +77,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
77 | SceneObjects = new List<SceneObjectGroup>(); | 77 | SceneObjects = new List<SceneObjectGroup>(); |
78 | } | 78 | } |
79 | } | 79 | } |
80 | 80 | ||
81 | 81 | ||
82 | /// <summary> | 82 | /// <summary> |
83 | /// The maximum major version of OAR that we can read. Minor versions shouldn't need a max number since version | 83 | /// The maximum major version of OAR that we can read. Minor versions shouldn't need a max number since version |
84 | /// bumps here should be compatible. | 84 | /// bumps here should be compatible. |
85 | /// </summary> | 85 | /// </summary> |
86 | public static int MAX_MAJOR_VERSION = 1; | 86 | public static int MAX_MAJOR_VERSION = 1; |
87 | 87 | ||
88 | /// <summary> | 88 | /// <summary> |
89 | /// Has the control file been loaded for this archive? | 89 | /// Has the control file been loaded for this archive? |
90 | /// </summary> | 90 | /// </summary> |
@@ -220,7 +220,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
220 | 220 | ||
221 | m_boundingOrigin = Vector3.Zero; | 221 | m_boundingOrigin = Vector3.Zero; |
222 | m_boundingSize = new Vector3(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY, float.MaxValue); | 222 | m_boundingSize = new Vector3(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY, float.MaxValue); |
223 | 223 | ||
224 | if (options.ContainsKey("bounding-origin")) | 224 | if (options.ContainsKey("bounding-origin")) |
225 | { | 225 | { |
226 | Vector3 boOption = (Vector3)options["bounding-origin"]; | 226 | Vector3 boOption = (Vector3)options["bounding-origin"]; |
@@ -308,7 +308,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
308 | { | 308 | { |
309 | //m_log.DebugFormat( | 309 | //m_log.DebugFormat( |
310 | // "[ARCHIVER]: Successfully read {0} ({1} bytes)", filePath, data.Length); | 310 | // "[ARCHIVER]: Successfully read {0} ({1} bytes)", filePath, data.Length); |
311 | 311 | ||
312 | if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY == entryType) | 312 | if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY == entryType) |
313 | continue; | 313 | continue; |
314 | 314 | ||
@@ -354,11 +354,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
354 | else if (!m_merge && filePath.StartsWith(ArchiveConstants.SETTINGS_PATH)) | 354 | else if (!m_merge && filePath.StartsWith(ArchiveConstants.SETTINGS_PATH)) |
355 | { | 355 | { |
356 | LoadRegionSettings(scene, filePath, data, dearchivedScenes); | 356 | LoadRegionSettings(scene, filePath, data, dearchivedScenes); |
357 | } | 357 | } |
358 | else if (filePath.StartsWith(ArchiveConstants.LANDDATA_PATH) && (!m_merge || m_forceParcels)) | 358 | else if (filePath.StartsWith(ArchiveConstants.LANDDATA_PATH) && (!m_merge || m_forceParcels)) |
359 | { | 359 | { |
360 | sceneContext.SerialisedParcels.Add(Encoding.UTF8.GetString(data)); | 360 | sceneContext.SerialisedParcels.Add(Encoding.UTF8.GetString(data)); |
361 | } | 361 | } |
362 | else if (filePath == ArchiveConstants.CONTROL_FILE_PATH) | 362 | else if (filePath == ArchiveConstants.CONTROL_FILE_PATH) |
363 | { | 363 | { |
364 | // Ignore, because we already read the control file | 364 | // Ignore, because we already read the control file |
@@ -406,7 +406,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
406 | { | 406 | { |
407 | LoadParcels(sceneContext.Scene, sceneContext.SerialisedParcels); | 407 | LoadParcels(sceneContext.Scene, sceneContext.SerialisedParcels); |
408 | LoadObjects(sceneContext.Scene, sceneContext.SerialisedSceneObjects, sceneContext.SceneObjects); | 408 | LoadObjects(sceneContext.Scene, sceneContext.SerialisedSceneObjects, sceneContext.SceneObjects); |
409 | 409 | ||
410 | // Inform any interested parties that the region has changed. We waited until now so that all | 410 | // Inform any interested parties that the region has changed. We waited until now so that all |
411 | // of the region's objects will be loaded when we send this notification. | 411 | // of the region's objects will be loaded when we send this notification. |
412 | IEstateModule estateModule = sceneContext.Scene.RequestModuleInterface<IEstateModule>(); | 412 | IEstateModule estateModule = sceneContext.Scene.RequestModuleInterface<IEstateModule>(); |
@@ -471,7 +471,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
471 | { | 471 | { |
472 | if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY == entryType) | 472 | if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY == entryType) |
473 | continue; | 473 | continue; |
474 | 474 | ||
475 | if (filePath == ArchiveConstants.CONTROL_FILE_PATH) | 475 | if (filePath == ArchiveConstants.CONTROL_FILE_PATH) |
476 | { | 476 | { |
477 | LoadControlFile(filePath, data, dearchivedScenes); | 477 | LoadControlFile(filePath, data, dearchivedScenes); |
@@ -517,7 +517,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
517 | 517 | ||
518 | throw new Exception("[ARCHIVER]: Control file not found"); | 518 | throw new Exception("[ARCHIVER]: Control file not found"); |
519 | } | 519 | } |
520 | 520 | ||
521 | /// <summary> | 521 | /// <summary> |
522 | /// Load serialized scene objects. | 522 | /// Load serialized scene objects. |
523 | /// </summary> | 523 | /// </summary> |
@@ -545,7 +545,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
545 | // Really large xml files (multi megabyte) appear to cause | 545 | // Really large xml files (multi megabyte) appear to cause |
546 | // memory problems | 546 | // memory problems |
547 | // when loading the xml. But don't enable this check yet | 547 | // when loading the xml. But don't enable this check yet |
548 | 548 | ||
549 | if (serialisedSceneObject.Length > 5000000) | 549 | if (serialisedSceneObject.Length > 5000000) |
550 | { | 550 | { |
551 | m_log.Error("[ARCHIVER]: Ignoring xml since size > 5000000);"); | 551 | m_log.Error("[ARCHIVER]: Ignoring xml since size > 5000000);"); |
@@ -745,7 +745,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
745 | Vector3 AABBMax; | 745 | Vector3 AABBMax; |
746 | 746 | ||
747 | // create a new LandObject that we can use to manipulate the incoming source parcel data | 747 | // create a new LandObject that we can use to manipulate the incoming source parcel data |
748 | // this is ok, but just beware that some of the LandObject functions (that we haven't used here) still | 748 | // this is ok, but just beware that some of the LandObject functions (that we haven't used here) still |
749 | // assume we're always using the destination region size | 749 | // assume we're always using the destination region size |
750 | LandData ld = new LandData(); | 750 | LandData ld = new LandData(); |
751 | landObject = new LandObject(ld, scene); | 751 | landObject = new LandObject(ld, scene); |
@@ -839,7 +839,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
839 | } | 839 | } |
840 | parcel.ParcelAccessList = accessList; | 840 | parcel.ParcelAccessList = accessList; |
841 | 841 | ||
842 | if (m_debug) m_log.DebugFormat("[ARCHIVER]: Adding parcel {0}, local id {1}, owner {2}, group {3}, isGroupOwned {4}, area {5}", | 842 | if (m_debug) m_log.DebugFormat("[ARCHIVER]: Adding parcel {0}, local id {1}, owner {2}, group {3}, isGroupOwned {4}, area {5}", |
843 | parcel.Name, parcel.LocalID, parcel.OwnerID, parcel.GroupID, parcel.IsGroupOwned, parcel.Area); | 843 | parcel.Name, parcel.LocalID, parcel.OwnerID, parcel.GroupID, parcel.IsGroupOwned, parcel.Area); |
844 | 844 | ||
845 | landData.Add(parcel); | 845 | landData.Add(parcel); |
@@ -939,20 +939,20 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
939 | sbyte asype = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; | 939 | sbyte asype = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; |
940 | if(asype == -2) | 940 | if(asype == -2) |
941 | { | 941 | { |
942 | 942 | ||
943 | } | 943 | } |
944 | 944 | ||
945 | // m_log.DebugFormat("[ARCHIVER]: found existing asset {0}",uuid); | 945 | // m_log.DebugFormat("[ARCHIVER]: found existing asset {0}",uuid); |
946 | return true; | 946 | return true; |
947 | } | 947 | } |
948 | 948 | ||
949 | if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension)) | 949 | if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension)) |
950 | { | 950 | { |
951 | sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; | 951 | sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; |
952 | 952 | ||
953 | if(assetType == -2) | 953 | if(assetType == -2) |
954 | { | 954 | { |
955 | 955 | ||
956 | } | 956 | } |
957 | if (assetType == (sbyte)AssetType.Unknown) | 957 | if (assetType == (sbyte)AssetType.Unknown) |
958 | { | 958 | { |
@@ -966,7 +966,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
966 | ModifySceneObject(m_rootScene, sog); | 966 | ModifySceneObject(m_rootScene, sog); |
967 | return true; | 967 | return true; |
968 | }); | 968 | }); |
969 | 969 | ||
970 | if (data == null) | 970 | if (data == null) |
971 | return false; | 971 | return false; |
972 | } | 972 | } |
@@ -1072,7 +1072,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
1072 | currentRegionSettings.Save(); | 1072 | currentRegionSettings.Save(); |
1073 | 1073 | ||
1074 | scene.TriggerEstateSunUpdate(); | 1074 | scene.TriggerEstateSunUpdate(); |
1075 | 1075 | ||
1076 | IEstateModule estateModule = scene.RequestModuleInterface<IEstateModule>(); | 1076 | IEstateModule estateModule = scene.RequestModuleInterface<IEstateModule>(); |
1077 | if (estateModule != null) | 1077 | if (estateModule != null) |
1078 | estateModule.sendRegionHandshakeToAll(); | 1078 | estateModule.sendRegionHandshakeToAll(); |
@@ -1129,16 +1129,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
1129 | 1129 | ||
1130 | bool multiRegion = false; | 1130 | bool multiRegion = false; |
1131 | 1131 | ||
1132 | while (xtr.Read()) | 1132 | while (xtr.Read()) |
1133 | { | 1133 | { |
1134 | if (xtr.NodeType == XmlNodeType.Element) | 1134 | if (xtr.NodeType == XmlNodeType.Element) |
1135 | { | 1135 | { |
1136 | if (xtr.Name.ToString() == "archive") | 1136 | if (xtr.Name.ToString() == "archive") |
1137 | { | 1137 | { |
1138 | int majorVersion = int.Parse(xtr["major_version"]); | 1138 | int majorVersion = int.Parse(xtr["major_version"]); |
1139 | int minorVersion = int.Parse(xtr["minor_version"]); | 1139 | int minorVersion = int.Parse(xtr["minor_version"]); |
1140 | string version = string.Format("{0}.{1}", majorVersion, minorVersion); | 1140 | string version = string.Format("{0}.{1}", majorVersion, minorVersion); |
1141 | 1141 | ||
1142 | if (majorVersion > MAX_MAJOR_VERSION) | 1142 | if (majorVersion > MAX_MAJOR_VERSION) |
1143 | { | 1143 | { |
1144 | throw new Exception( | 1144 | throw new Exception( |
@@ -1146,15 +1146,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
1146 | "The OAR you are trying to load has major version number of {0} but this version of OpenSim can only load OARs with major version number {1} and below", | 1146 | "The OAR you are trying to load has major version number of {0} but this version of OpenSim can only load OARs with major version number {1} and below", |
1147 | majorVersion, MAX_MAJOR_VERSION)); | 1147 | majorVersion, MAX_MAJOR_VERSION)); |
1148 | } | 1148 | } |
1149 | 1149 | ||
1150 | m_log.InfoFormat("[ARCHIVER]: Loading OAR with version {0}", version); | 1150 | m_log.InfoFormat("[ARCHIVER]: Loading OAR with version {0}", version); |
1151 | } | 1151 | } |
1152 | else if (xtr.Name.ToString() == "datetime") | 1152 | else if (xtr.Name.ToString() == "datetime") |
1153 | { | 1153 | { |
1154 | int value; | 1154 | int value; |
1155 | if (Int32.TryParse(xtr.ReadElementContentAsString(), out value)) | 1155 | if (Int32.TryParse(xtr.ReadElementContentAsString(), out value)) |
1156 | dearchivedScenes.LoadedCreationDateTime = value; | 1156 | dearchivedScenes.LoadedCreationDateTime = value; |
1157 | } | 1157 | } |
1158 | else if (xtr.Name.ToString() == "row") | 1158 | else if (xtr.Name.ToString() == "row") |
1159 | { | 1159 | { |
1160 | multiRegion = true; | 1160 | multiRegion = true; |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveScenesGroup.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveScenesGroup.cs index d8dace2..2fb4426 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveScenesGroup.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveScenesGroup.cs | |||
@@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
50 | /// The inner dictionaries contain each row's regions (key: X coordinate). | 50 | /// The inner dictionaries contain each row's regions (key: X coordinate). |
51 | /// </summary> | 51 | /// </summary> |
52 | public SortedDictionary<uint, SortedDictionary<uint, Scene>> Regions { get; set; } | 52 | public SortedDictionary<uint, SortedDictionary<uint, Scene>> Regions { get; set; } |
53 | 53 | ||
54 | /// <summary> | 54 | /// <summary> |
55 | /// The subdirectory where each region is stored in the archive. | 55 | /// The subdirectory where each region is stored in the archive. |
56 | /// </summary> | 56 | /// </summary> |
@@ -152,7 +152,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
152 | } | 152 | } |
153 | } | 153 | } |
154 | } | 154 | } |
155 | 155 | ||
156 | /// <summary> | 156 | /// <summary> |
157 | /// Returns the scene at position 'location'. | 157 | /// Returns the scene at position 'location'. |
158 | /// </summary> | 158 | /// </summary> |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs index 6c8f37b..8dabcee 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs | |||
@@ -60,8 +60,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
60 | /// <summary> | 60 | /// <summary> |
61 | /// The minimum major version of OAR that we can write. | 61 | /// The minimum major version of OAR that we can write. |
62 | /// </summary> | 62 | /// </summary> |
63 | public static int MIN_MAJOR_VERSION = 0; | 63 | public static int MIN_MAJOR_VERSION = 0; |
64 | 64 | ||
65 | /// <summary> | 65 | /// <summary> |
66 | /// The maximum major version of OAR that we can write. | 66 | /// The maximum major version of OAR that we can write. |
67 | /// </summary> | 67 | /// </summary> |
@@ -112,7 +112,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
112 | m_log.ErrorFormat("{0} {1}", e.Message, e.StackTrace); | 112 | m_log.ErrorFormat("{0} {1}", e.Message, e.StackTrace); |
113 | } | 113 | } |
114 | } | 114 | } |
115 | 115 | ||
116 | /// <summary> | 116 | /// <summary> |
117 | /// Constructor. | 117 | /// Constructor. |
118 | /// </summary> | 118 | /// </summary> |
@@ -226,7 +226,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
226 | List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); | 226 | List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); |
227 | 227 | ||
228 | int numObjectsSkippedPermissions = 0; | 228 | int numObjectsSkippedPermissions = 0; |
229 | 229 | ||
230 | // Filter entities so that we only have scene objects. | 230 | // Filter entities so that we only have scene objects. |
231 | // FIXME: Would be nicer to have this as a proper list in SceneGraph, since lots of methods | 231 | // FIXME: Would be nicer to have this as a proper list in SceneGraph, since lots of methods |
232 | // end up having to do this | 232 | // end up having to do this |
@@ -256,7 +256,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
256 | { | 256 | { |
257 | UuidGatherer assetGatherer = new UuidGatherer(scene.AssetService, assetUuids); | 257 | UuidGatherer assetGatherer = new UuidGatherer(scene.AssetService, assetUuids); |
258 | int prevAssets = assetUuids.Count; | 258 | int prevAssets = assetUuids.Count; |
259 | 259 | ||
260 | foreach (SceneObjectGroup sceneObject in sceneObjects) | 260 | foreach (SceneObjectGroup sceneObject in sceneObjects) |
261 | assetGatherer.AddForInspection(sceneObject); | 261 | assetGatherer.AddForInspection(sceneObject); |
262 | 262 | ||
@@ -276,16 +276,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
276 | 276 | ||
277 | // Make sure that we also request terrain texture assets | 277 | // Make sure that we also request terrain texture assets |
278 | RegionSettings regionSettings = scene.RegionInfo.RegionSettings; | 278 | RegionSettings regionSettings = scene.RegionInfo.RegionSettings; |
279 | 279 | ||
280 | if (regionSettings.TerrainTexture1 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_1) | 280 | if (regionSettings.TerrainTexture1 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_1) |
281 | assetUuids[regionSettings.TerrainTexture1] = (sbyte)AssetType.Texture; | 281 | assetUuids[regionSettings.TerrainTexture1] = (sbyte)AssetType.Texture; |
282 | 282 | ||
283 | if (regionSettings.TerrainTexture2 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_2) | 283 | if (regionSettings.TerrainTexture2 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_2) |
284 | assetUuids[regionSettings.TerrainTexture2] = (sbyte)AssetType.Texture; | 284 | assetUuids[regionSettings.TerrainTexture2] = (sbyte)AssetType.Texture; |
285 | 285 | ||
286 | if (regionSettings.TerrainTexture3 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_3) | 286 | if (regionSettings.TerrainTexture3 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_3) |
287 | assetUuids[regionSettings.TerrainTexture3] = (sbyte)AssetType.Texture; | 287 | assetUuids[regionSettings.TerrainTexture3] = (sbyte)AssetType.Texture; |
288 | 288 | ||
289 | if (regionSettings.TerrainTexture4 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_4) | 289 | if (regionSettings.TerrainTexture4 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_4) |
290 | assetUuids[regionSettings.TerrainTexture4] = (sbyte)AssetType.Texture; | 290 | assetUuids[regionSettings.TerrainTexture4] = (sbyte)AssetType.Texture; |
291 | 291 | ||
@@ -398,18 +398,18 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
398 | // string[] parts = m_options["version"].ToString().Split('.'); | 398 | // string[] parts = m_options["version"].ToString().Split('.'); |
399 | // if (parts.Length >= 1) | 399 | // if (parts.Length >= 1) |
400 | // { | 400 | // { |
401 | // majorVersion = Int32.Parse(parts[0]); | 401 | // majorVersion = Int32.Parse(parts[0]); |
402 | // | 402 | // |
403 | // if (parts.Length >= 2) | 403 | // if (parts.Length >= 2) |
404 | // minorVersion = Int32.Parse(parts[1]); | 404 | // minorVersion = Int32.Parse(parts[1]); |
405 | // } | 405 | // } |
406 | // } | 406 | // } |
407 | // | 407 | // |
408 | // if (majorVersion < MIN_MAJOR_VERSION || majorVersion > MAX_MAJOR_VERSION) | 408 | // if (majorVersion < MIN_MAJOR_VERSION || majorVersion > MAX_MAJOR_VERSION) |
409 | // { | 409 | // { |
410 | // throw new Exception( | 410 | // throw new Exception( |
411 | // string.Format( | 411 | // string.Format( |
412 | // "OAR version number for save must be between {0} and {1}", | 412 | // "OAR version number for save must be between {0} and {1}", |
413 | // MIN_MAJOR_VERSION, MAX_MAJOR_VERSION)); | 413 | // MIN_MAJOR_VERSION, MAX_MAJOR_VERSION)); |
414 | // } | 414 | // } |
415 | // else if (majorVersion == MAX_MAJOR_VERSION) | 415 | // else if (majorVersion == MAX_MAJOR_VERSION) |
@@ -420,9 +420,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
420 | // else if (majorVersion == MIN_MAJOR_VERSION) | 420 | // else if (majorVersion == MIN_MAJOR_VERSION) |
421 | // { | 421 | // { |
422 | // // Force 0.4 | 422 | // // Force 0.4 |
423 | // minorVersion = 4; | 423 | // minorVersion = 4; |
424 | // } | 424 | // } |
425 | 425 | ||
426 | m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion); | 426 | m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion); |
427 | if (majorVersion == 1) | 427 | if (majorVersion == 1) |
428 | { | 428 | { |
@@ -430,7 +430,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
430 | } | 430 | } |
431 | 431 | ||
432 | String s; | 432 | String s; |
433 | 433 | ||
434 | using (StringWriter sw = new StringWriter()) | 434 | using (StringWriter sw = new StringWriter()) |
435 | { | 435 | { |
436 | using (XmlTextWriter xtw = new XmlTextWriter(sw)) | 436 | using (XmlTextWriter xtw = new XmlTextWriter(sw)) |
@@ -440,7 +440,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
440 | xtw.WriteStartElement("archive"); | 440 | xtw.WriteStartElement("archive"); |
441 | xtw.WriteAttributeString("major_version", majorVersion.ToString()); | 441 | xtw.WriteAttributeString("major_version", majorVersion.ToString()); |
442 | xtw.WriteAttributeString("minor_version", minorVersion.ToString()); | 442 | xtw.WriteAttributeString("minor_version", minorVersion.ToString()); |
443 | 443 | ||
444 | xtw.WriteStartElement("creation_info"); | 444 | xtw.WriteStartElement("creation_info"); |
445 | DateTime now = DateTime.UtcNow; | 445 | DateTime now = DateTime.UtcNow; |
446 | TimeSpan t = now - new DateTime(1970, 1, 1); | 446 | TimeSpan t = now - new DateTime(1970, 1, 1); |
@@ -448,7 +448,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
448 | if (!MultiRegionFormat) | 448 | if (!MultiRegionFormat) |
449 | xtw.WriteElementString("id", m_rootScene.RegionInfo.RegionID.ToString()); | 449 | xtw.WriteElementString("id", m_rootScene.RegionInfo.RegionID.ToString()); |
450 | xtw.WriteEndElement(); | 450 | xtw.WriteEndElement(); |
451 | 451 | ||
452 | xtw.WriteElementString("assets_included", SaveAssets.ToString()); | 452 | xtw.WriteElementString("assets_included", SaveAssets.ToString()); |
453 | 453 | ||
454 | if (MultiRegionFormat) | 454 | if (MultiRegionFormat) |
@@ -463,7 +463,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
463 | } | 463 | } |
464 | 464 | ||
465 | xtw.WriteEndElement(); | 465 | xtw.WriteEndElement(); |
466 | 466 | ||
467 | xtw.Flush(); | 467 | xtw.Flush(); |
468 | } | 468 | } |
469 | 469 | ||
@@ -525,7 +525,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
525 | Vector2 size; | 525 | Vector2 size; |
526 | 526 | ||
527 | size = new Vector2((float)scene.RegionInfo.RegionSizeX, (float)scene.RegionInfo.RegionSizeY); | 527 | size = new Vector2((float)scene.RegionInfo.RegionSizeX, (float)scene.RegionInfo.RegionSizeY); |
528 | 528 | ||
529 | xtw.WriteElementString("size_in_meters", string.Format("{0},{1}", size.X, size.Y)); | 529 | xtw.WriteElementString("size_in_meters", string.Format("{0},{1}", size.X, size.Y)); |
530 | } | 530 | } |
531 | 531 | ||
@@ -548,7 +548,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
548 | foreach (ILandObject lo in landObjects) | 548 | foreach (ILandObject lo in landObjects) |
549 | { | 549 | { |
550 | LandData landData = lo.LandData; | 550 | LandData landData = lo.LandData; |
551 | string landDataPath | 551 | string landDataPath |
552 | = String.Format("{0}{1}", regionDir, ArchiveConstants.CreateOarLandDataPath(landData)); | 552 | = String.Format("{0}{1}", regionDir, ArchiveConstants.CreateOarLandDataPath(landData)); |
553 | m_archiveWriter.WriteFile(landDataPath, LandDataSerializer.Serialize(landData, m_options)); | 553 | m_archiveWriter.WriteFile(landDataPath, LandDataSerializer.Serialize(landData, m_options)); |
554 | } | 554 | } |
@@ -578,11 +578,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
578 | m_archiveWriter.WriteFile(objectPath, serializedObject); | 578 | m_archiveWriter.WriteFile(objectPath, serializedObject); |
579 | } | 579 | } |
580 | } | 580 | } |
581 | 581 | ||
582 | protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids, bool timedOut) | 582 | protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids, bool timedOut) |
583 | { | 583 | { |
584 | string errorMessage; | 584 | string errorMessage; |
585 | 585 | ||
586 | if (timedOut) | 586 | if (timedOut) |
587 | { | 587 | { |
588 | errorMessage = "Loading assets timed out"; | 588 | errorMessage = "Loading assets timed out"; |
@@ -600,10 +600,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
600 | 600 | ||
601 | errorMessage = String.Empty; | 601 | errorMessage = String.Empty; |
602 | } | 602 | } |
603 | 603 | ||
604 | CloseArchive(errorMessage); | 604 | CloseArchive(errorMessage); |
605 | } | 605 | } |
606 | 606 | ||
607 | /// <summary> | 607 | /// <summary> |
608 | /// Closes the archive and notifies that we're done. | 608 | /// Closes the archive and notifies that we're done. |
609 | /// </summary> | 609 | /// </summary> |
@@ -622,7 +622,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
622 | if (errorMessage == string.Empty) | 622 | if (errorMessage == string.Empty) |
623 | errorMessage = e.Message; | 623 | errorMessage = e.Message; |
624 | } | 624 | } |
625 | 625 | ||
626 | m_log.InfoFormat("[ARCHIVER]: Finished writing out OAR for {0}", m_rootScene.RegionInfo.RegionName); | 626 | m_log.InfoFormat("[ARCHIVER]: Finished writing out OAR for {0}", m_rootScene.RegionInfo.RegionName); |
627 | 627 | ||
628 | m_rootScene.EventManager.TriggerOarFileSaved(m_requestId, errorMessage); | 628 | m_rootScene.EventManager.TriggerOarFileSaved(m_requestId, errorMessage); |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index 150d4ec..1305545 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs | |||
@@ -49,7 +49,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
49 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "ArchiverModule")] | 49 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "ArchiverModule")] |
50 | public class ArchiverModule : INonSharedRegionModule, IRegionArchiverModule | 50 | public class ArchiverModule : INonSharedRegionModule, IRegionArchiverModule |
51 | { | 51 | { |
52 | private static readonly ILog m_log = | 52 | private static readonly ILog m_log = |
53 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 53 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
54 | 54 | ||
55 | public Scene Scene { get; private set; } | 55 | public Scene Scene { get; private set; } |
@@ -59,13 +59,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
59 | /// </value> | 59 | /// </value> |
60 | protected const string DEFAULT_OAR_BACKUP_FILENAME = "region.oar"; | 60 | protected const string DEFAULT_OAR_BACKUP_FILENAME = "region.oar"; |
61 | 61 | ||
62 | public string Name | 62 | public string Name |
63 | { | 63 | { |
64 | get { return "RegionArchiverModule"; } | 64 | get { return "RegionArchiverModule"; } |
65 | } | 65 | } |
66 | 66 | ||
67 | public Type ReplaceableInterface | 67 | public Type ReplaceableInterface |
68 | { | 68 | { |
69 | get { return null; } | 69 | get { return null; } |
70 | } | 70 | } |
71 | 71 | ||
@@ -201,9 +201,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
201 | rready.OarLoadingAlert("load"); | 201 | rready.OarLoadingAlert("load"); |
202 | } | 202 | } |
203 | */ | 203 | */ |
204 | 204 | ||
205 | List<string> mainParams = options.Parse(cmdparams); | 205 | List<string> mainParams = options.Parse(cmdparams); |
206 | 206 | ||
207 | // m_log.DebugFormat("MERGE OAR IS [{0}]", mergeOar); | 207 | // m_log.DebugFormat("MERGE OAR IS [{0}]", mergeOar); |
208 | // | 208 | // |
209 | // foreach (string param in mainParams) | 209 | // foreach (string param in mainParams) |
@@ -288,7 +288,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
288 | 288 | ||
289 | ArchiveRegion(path, options); | 289 | ArchiveRegion(path, options); |
290 | } | 290 | } |
291 | 291 | ||
292 | public void ArchiveRegion(string savePath, Dictionary<string, object> options) | 292 | public void ArchiveRegion(string savePath, Dictionary<string, object> options) |
293 | { | 293 | { |
294 | ArchiveRegion(savePath, Guid.Empty, options); | 294 | ArchiveRegion(savePath, Guid.Empty, options); |
@@ -298,7 +298,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
298 | { | 298 | { |
299 | m_log.InfoFormat( | 299 | m_log.InfoFormat( |
300 | "[ARCHIVER]: Writing archive for region {0} to {1}", Scene.RegionInfo.RegionName, savePath); | 300 | "[ARCHIVER]: Writing archive for region {0} to {1}", Scene.RegionInfo.RegionName, savePath); |
301 | 301 | ||
302 | new ArchiveWriteRequest(Scene, savePath, requestId).ArchiveRegion(options); | 302 | new ArchiveWriteRequest(Scene, savePath, requestId).ArchiveRegion(options); |
303 | } | 303 | } |
304 | 304 | ||
@@ -330,7 +330,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
330 | 330 | ||
331 | new ArchiveReadRequest(Scene, loadPath, requestId, options).DearchiveRegion(); | 331 | new ArchiveReadRequest(Scene, loadPath, requestId, options).DearchiveRegion(); |
332 | } | 332 | } |
333 | 333 | ||
334 | public void DearchiveRegion(Stream loadStream) | 334 | public void DearchiveRegion(Stream loadStream) |
335 | { | 335 | { |
336 | Dictionary<string, object> archiveOptions = new Dictionary<string, object>(); | 336 | Dictionary<string, object> archiveOptions = new Dictionary<string, object>(); |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs index c1ff94d..efacae3 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs | |||
@@ -51,8 +51,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
51 | /// <value> | 51 | /// <value> |
52 | /// Keep a count of the number of assets written so that we can provide status updates | 52 | /// Keep a count of the number of assets written so that we can provide status updates |
53 | /// </value> | 53 | /// </value> |
54 | protected int m_assetsWritten; | 54 | protected int m_assetsWritten; |
55 | 55 | ||
56 | protected TarArchiveWriter m_archiveWriter; | 56 | protected TarArchiveWriter m_archiveWriter; |
57 | 57 | ||
58 | public AssetsArchiver(TarArchiveWriter archiveWriter) | 58 | public AssetsArchiver(TarArchiveWriter archiveWriter) |
@@ -145,7 +145,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
145 | m_assetsWritten++; | 145 | m_assetsWritten++; |
146 | 146 | ||
147 | //m_log.DebugFormat("[ARCHIVER]: Added asset {0}", m_assetsWritten); | 147 | //m_log.DebugFormat("[ARCHIVER]: Added asset {0}", m_assetsWritten); |
148 | 148 | ||
149 | if (m_assetsWritten % LOG_ASSET_LOAD_NOTIFICATION_INTERVAL == 0) | 149 | if (m_assetsWritten % LOG_ASSET_LOAD_NOTIFICATION_INTERVAL == 0) |
150 | m_log.InfoFormat("[ARCHIVER]: Added {0} assets to archive", m_assetsWritten); | 150 | m_log.InfoFormat("[ARCHIVER]: Added {0} assets to archive", m_assetsWritten); |
151 | } | 151 | } |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs index 1526b1c..d380da8 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs | |||
@@ -60,7 +60,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
60 | Completed, | 60 | Completed, |
61 | Aborted | 61 | Aborted |
62 | }; | 62 | }; |
63 | 63 | ||
64 | /// <value> | 64 | /// <value> |
65 | /// Timeout threshold if we still need assets or missing asset notifications but have stopped receiving them | 65 | /// Timeout threshold if we still need assets or missing asset notifications but have stopped receiving them |
66 | /// from the asset service | 66 | /// from the asset service |
@@ -71,14 +71,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
71 | /// If a timeout does occur, limit the amount of UUID information put to the console. | 71 | /// If a timeout does occur, limit the amount of UUID information put to the console. |
72 | /// </value> | 72 | /// </value> |
73 | protected const int MAX_UUID_DISPLAY_ON_TIMEOUT = 3; | 73 | protected const int MAX_UUID_DISPLAY_ON_TIMEOUT = 3; |
74 | 74 | ||
75 | protected System.Timers.Timer m_requestCallbackTimer; | 75 | protected System.Timers.Timer m_requestCallbackTimer; |
76 | 76 | ||
77 | /// <value> | 77 | /// <value> |
78 | /// State of this request | 78 | /// State of this request |
79 | /// </value> | 79 | /// </value> |
80 | private RequestState m_requestState = RequestState.Initial; | 80 | private RequestState m_requestState = RequestState.Initial; |
81 | 81 | ||
82 | /// <value> | 82 | /// <value> |
83 | /// uuids to request | 83 | /// uuids to request |
84 | /// </value> | 84 | /// </value> |
@@ -93,7 +93,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
93 | /// List of assets that were found. This will be passed back to the requester. | 93 | /// List of assets that were found. This will be passed back to the requester. |
94 | /// </value> | 94 | /// </value> |
95 | protected List<UUID> m_foundAssetUuids = new List<UUID>(); | 95 | protected List<UUID> m_foundAssetUuids = new List<UUID>(); |
96 | 96 | ||
97 | /// <value> | 97 | /// <value> |
98 | /// Maintain a list of assets that could not be found. This will be passed back to the requester. | 98 | /// Maintain a list of assets that could not be found. This will be passed back to the requester. |
99 | /// </value> | 99 | /// </value> |
@@ -109,16 +109,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
109 | /// </value> | 109 | /// </value> |
110 | protected IAssetService m_assetService; | 110 | protected IAssetService m_assetService; |
111 | protected IUserAccountService m_userAccountService; | 111 | protected IUserAccountService m_userAccountService; |
112 | protected UUID m_scopeID; // the grid ID | 112 | protected UUID m_scopeID; // the grid ID |
113 | 113 | ||
114 | protected AssetsArchiver m_assetsArchiver; | 114 | protected AssetsArchiver m_assetsArchiver; |
115 | 115 | ||
116 | protected Dictionary<string, object> m_options; | 116 | protected Dictionary<string, object> m_options; |
117 | 117 | ||
118 | protected internal AssetsRequest( | 118 | protected internal AssetsRequest( |
119 | AssetsArchiver assetsArchiver, IDictionary<UUID, sbyte> uuids, | 119 | AssetsArchiver assetsArchiver, IDictionary<UUID, sbyte> uuids, |
120 | IAssetService assetService, IUserAccountService userService, | 120 | IAssetService assetService, IUserAccountService userService, |
121 | UUID scope, Dictionary<string, object> options, | 121 | UUID scope, Dictionary<string, object> options, |
122 | AssetsRequestCallback assetsRequestCallback) | 122 | AssetsRequestCallback assetsRequestCallback) |
123 | { | 123 | { |
124 | m_assetsArchiver = assetsArchiver; | 124 | m_assetsArchiver = assetsArchiver; |
@@ -142,7 +142,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
142 | protected internal void Execute() | 142 | protected internal void Execute() |
143 | { | 143 | { |
144 | m_requestState = RequestState.Running; | 144 | m_requestState = RequestState.Running; |
145 | 145 | ||
146 | m_log.DebugFormat("[ARCHIVER]: AssetsRequest executed looking for {0} possible assets", m_repliesRequired); | 146 | m_log.DebugFormat("[ARCHIVER]: AssetsRequest executed looking for {0} possible assets", m_repliesRequired); |
147 | 147 | ||
148 | // We can stop here if there are no assets to fetch | 148 | // We can stop here if there are no assets to fetch |
@@ -180,7 +180,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
180 | timedOut = false; | 180 | timedOut = false; |
181 | return; | 181 | return; |
182 | } | 182 | } |
183 | 183 | ||
184 | m_requestState = RequestState.Aborted; | 184 | m_requestState = RequestState.Aborted; |
185 | } | 185 | } |
186 | 186 | ||
@@ -196,24 +196,24 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
196 | { | 196 | { |
197 | uuids.Remove(uuid); | 197 | uuids.Remove(uuid); |
198 | } | 198 | } |
199 | 199 | ||
200 | foreach (UUID uuid in m_notFoundAssetUuids) | 200 | foreach (UUID uuid in m_notFoundAssetUuids) |
201 | { | 201 | { |
202 | uuids.Remove(uuid); | 202 | uuids.Remove(uuid); |
203 | } | 203 | } |
204 | 204 | ||
205 | m_log.ErrorFormat( | 205 | m_log.ErrorFormat( |
206 | "[ARCHIVER]: Asset service failed to return information about {0} requested assets", uuids.Count); | 206 | "[ARCHIVER]: Asset service failed to return information about {0} requested assets", uuids.Count); |
207 | 207 | ||
208 | int i = 0; | 208 | int i = 0; |
209 | foreach (UUID uuid in uuids) | 209 | foreach (UUID uuid in uuids) |
210 | { | 210 | { |
211 | m_log.ErrorFormat("[ARCHIVER]: No information about asset {0} received", uuid); | 211 | m_log.ErrorFormat("[ARCHIVER]: No information about asset {0} received", uuid); |
212 | 212 | ||
213 | if (++i >= MAX_UUID_DISPLAY_ON_TIMEOUT) | 213 | if (++i >= MAX_UUID_DISPLAY_ON_TIMEOUT) |
214 | break; | 214 | break; |
215 | } | 215 | } |
216 | 216 | ||
217 | if (uuids.Count > MAX_UUID_DISPLAY_ON_TIMEOUT) | 217 | if (uuids.Count > MAX_UUID_DISPLAY_ON_TIMEOUT) |
218 | m_log.ErrorFormat( | 218 | m_log.ErrorFormat( |
219 | "[ARCHIVER]: (... {0} more not shown)", uuids.Count - MAX_UUID_DISPLAY_ON_TIMEOUT); | 219 | "[ARCHIVER]: (... {0} more not shown)", uuids.Count - MAX_UUID_DISPLAY_ON_TIMEOUT); |
@@ -251,24 +251,24 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
251 | public void AssetRequestCallback(string id, object sender, AssetBase asset) | 251 | public void AssetRequestCallback(string id, object sender, AssetBase asset) |
252 | { | 252 | { |
253 | Culture.SetCurrentCulture(); | 253 | Culture.SetCurrentCulture(); |
254 | 254 | ||
255 | try | 255 | try |
256 | { | 256 | { |
257 | lock (this) | 257 | lock (this) |
258 | { | 258 | { |
259 | //m_log.DebugFormat("[ARCHIVER]: Received callback for asset {0}", id); | 259 | //m_log.DebugFormat("[ARCHIVER]: Received callback for asset {0}", id); |
260 | 260 | ||
261 | m_requestCallbackTimer.Stop(); | 261 | m_requestCallbackTimer.Stop(); |
262 | 262 | ||
263 | if ((m_requestState == RequestState.Aborted) || (m_requestState == RequestState.Completed)) | 263 | if ((m_requestState == RequestState.Aborted) || (m_requestState == RequestState.Completed)) |
264 | { | 264 | { |
265 | m_log.WarnFormat( | 265 | m_log.WarnFormat( |
266 | "[ARCHIVER]: Received information about asset {0} while in state {1}. Ignoring.", | 266 | "[ARCHIVER]: Received information about asset {0} while in state {1}. Ignoring.", |
267 | id, m_requestState); | 267 | id, m_requestState); |
268 | 268 | ||
269 | return; | 269 | return; |
270 | } | 270 | } |
271 | 271 | ||
272 | if (asset != null) | 272 | if (asset != null) |
273 | { | 273 | { |
274 | // m_log.DebugFormat("[ARCHIVER]: Writing asset {0}", id); | 274 | // m_log.DebugFormat("[ARCHIVER]: Writing asset {0}", id); |
@@ -281,7 +281,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
281 | // m_log.DebugFormat("[ARCHIVER]: Recording asset {0} as not found", id); | 281 | // m_log.DebugFormat("[ARCHIVER]: Recording asset {0} as not found", id); |
282 | m_notFoundAssetUuids.Add(new UUID(id)); | 282 | m_notFoundAssetUuids.Add(new UUID(id)); |
283 | } | 283 | } |
284 | 284 | ||
285 | if (m_foundAssetUuids.Count + m_notFoundAssetUuids.Count >= m_repliesRequired) | 285 | if (m_foundAssetUuids.Count + m_notFoundAssetUuids.Count >= m_repliesRequired) |
286 | { | 286 | { |
287 | m_requestState = RequestState.Completed; | 287 | m_requestState = RequestState.Completed; |
@@ -294,8 +294,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
294 | "[ARCHIVER]: Successfully added {0} assets ({1} assets not found but these may be expected invalid references)", | 294 | "[ARCHIVER]: Successfully added {0} assets ({1} assets not found but these may be expected invalid references)", |
295 | m_foundAssetUuids.Count, m_notFoundAssetUuids.Count); | 295 | m_foundAssetUuids.Count, m_notFoundAssetUuids.Count); |
296 | 296 | ||
297 | 297 | ||
298 | // We want to stop using the asset cache thread asap | 298 | // We want to stop using the asset cache thread asap |
299 | // as we now need to do the work of producing the rest of the archive | 299 | // as we now need to do the work of producing the rest of the archive |
300 | WorkManager.RunInThread(PerformAssetsRequestCallback, false, "Archive Assets Request Callback"); | 300 | WorkManager.RunInThread(PerformAssetsRequestCallback, false, "Archive Assets Request Callback"); |
301 | } | 301 | } |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/DearchiveScenesGroup.cs b/OpenSim/Region/CoreModules/World/Archiver/DearchiveScenesGroup.cs index e2222fe..809d863 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/DearchiveScenesGroup.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/DearchiveScenesGroup.cs | |||
@@ -214,7 +214,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
214 | return false; | 214 | return false; |
215 | string regionDirectory = parts[1]; | 215 | string regionDirectory = parts[1]; |
216 | relativePath = parts[2]; | 216 | relativePath = parts[2]; |
217 | 217 | ||
218 | RegionInfo region; | 218 | RegionInfo region; |
219 | if (m_directory2region.TryGetValue(regionDirectory, out region)) | 219 | if (m_directory2region.TryGetValue(regionDirectory, out region)) |
220 | { | 220 | { |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index caa22f7..6885299 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | |||
@@ -65,9 +65,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
65 | protected SerialiserModule m_serialiserModule; | 65 | protected SerialiserModule m_serialiserModule; |
66 | 66 | ||
67 | protected TaskInventoryItem m_soundItem; | 67 | protected TaskInventoryItem m_soundItem; |
68 | 68 | ||
69 | private AutoResetEvent m_oarEvent = new AutoResetEvent(false); | 69 | private AutoResetEvent m_oarEvent = new AutoResetEvent(false); |
70 | 70 | ||
71 | [SetUp] | 71 | [SetUp] |
72 | public override void SetUp() | 72 | public override void SetUp() |
73 | { | 73 | { |
@@ -89,10 +89,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
89 | m_lastRequestId = requestId; | 89 | m_lastRequestId = requestId; |
90 | m_lastErrorMessage = errorMessage; | 90 | m_lastErrorMessage = errorMessage; |
91 | Console.WriteLine("About to pulse ArchiverTests on LoadCompleted"); | 91 | Console.WriteLine("About to pulse ArchiverTests on LoadCompleted"); |
92 | m_oarEvent.Set(); | 92 | m_oarEvent.Set(); |
93 | } | 93 | } |
94 | } | 94 | } |
95 | 95 | ||
96 | private void SaveCompleted(Guid requestId, string errorMessage) | 96 | private void SaveCompleted(Guid requestId, string errorMessage) |
97 | { | 97 | { |
98 | lock (this) | 98 | lock (this) |
@@ -100,7 +100,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
100 | m_lastRequestId = requestId; | 100 | m_lastRequestId = requestId; |
101 | m_lastErrorMessage = errorMessage; | 101 | m_lastErrorMessage = errorMessage; |
102 | Console.WriteLine("About to pulse ArchiverTests on SaveCompleted"); | 102 | Console.WriteLine("About to pulse ArchiverTests on SaveCompleted"); |
103 | m_oarEvent.Set(); | 103 | m_oarEvent.Set(); |
104 | } | 104 | } |
105 | } | 105 | } |
106 | 106 | ||
@@ -129,7 +129,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
129 | 129 | ||
130 | return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; | 130 | return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; |
131 | } | 131 | } |
132 | 132 | ||
133 | private void CreateTestObjects(Scene scene, out SceneObjectGroup sog1, out SceneObjectGroup sog2, out UUID ncAssetUuid) | 133 | private void CreateTestObjects(Scene scene, out SceneObjectGroup sog1, out SceneObjectGroup sog2, out UUID ncAssetUuid) |
134 | { | 134 | { |
135 | SceneObjectPart part1 = CreateSceneObjectPart1(); | 135 | SceneObjectPart part1 = CreateSceneObjectPart1(); |
@@ -200,10 +200,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
200 | m_archiverModule.ArchiveRegion(archiveWriteStream, requestId); | 200 | m_archiverModule.ArchiveRegion(archiveWriteStream, requestId); |
201 | //AssetServerBase assetServer = (AssetServerBase)scene.CommsManager.AssetCache.AssetServer; | 201 | //AssetServerBase assetServer = (AssetServerBase)scene.CommsManager.AssetCache.AssetServer; |
202 | //while (assetServer.HasWaitingRequests()) | 202 | //while (assetServer.HasWaitingRequests()) |
203 | // assetServer.ProcessNextRequest(); | 203 | // assetServer.ProcessNextRequest(); |
204 | 204 | ||
205 | m_oarEvent.WaitOne(60000); | 205 | m_oarEvent.WaitOne(60000); |
206 | 206 | ||
207 | Assert.That(m_lastRequestId, Is.EqualTo(requestId)); | 207 | Assert.That(m_lastRequestId, Is.EqualTo(requestId)); |
208 | 208 | ||
209 | byte[] archive = archiveWriteStream.ToArray(); | 209 | byte[] archive = archiveWriteStream.ToArray(); |
@@ -211,7 +211,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
211 | TarArchiveReader tar = new TarArchiveReader(archiveReadStream); | 211 | TarArchiveReader tar = new TarArchiveReader(archiveReadStream); |
212 | 212 | ||
213 | bool gotNcAssetFile = false; | 213 | bool gotNcAssetFile = false; |
214 | 214 | ||
215 | string expectedNcAssetFileName = string.Format("{0}_{1}", ncAssetUuid, "notecard.txt"); | 215 | string expectedNcAssetFileName = string.Format("{0}_{1}", ncAssetUuid, "notecard.txt"); |
216 | 216 | ||
217 | List<string> foundPaths = new List<string>(); | 217 | List<string> foundPaths = new List<string>(); |
@@ -220,7 +220,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
220 | expectedPaths.Add(ArchiveHelpers.CreateObjectPath(sog2)); | 220 | expectedPaths.Add(ArchiveHelpers.CreateObjectPath(sog2)); |
221 | 221 | ||
222 | string filePath; | 222 | string filePath; |
223 | TarArchiveReader.TarEntryType tarEntryType; | 223 | TarArchiveReader.TarEntryType tarEntryType; |
224 | 224 | ||
225 | byte[] data = tar.ReadEntry(out filePath, out tarEntryType); | 225 | byte[] data = tar.ReadEntry(out filePath, out tarEntryType); |
226 | Assert.That(filePath, Is.EqualTo(ArchiveConstants.CONTROL_FILE_PATH)); | 226 | Assert.That(filePath, Is.EqualTo(ArchiveConstants.CONTROL_FILE_PATH)); |
@@ -228,9 +228,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
228 | Dictionary<string, object> archiveOptions = new Dictionary<string, object>(); | 228 | Dictionary<string, object> archiveOptions = new Dictionary<string, object>(); |
229 | ArchiveReadRequest arr = new ArchiveReadRequest(m_scene, (Stream)null, Guid.Empty, archiveOptions); | 229 | ArchiveReadRequest arr = new ArchiveReadRequest(m_scene, (Stream)null, Guid.Empty, archiveOptions); |
230 | arr.LoadControlFile(filePath, data, new DearchiveScenesInfo()); | 230 | arr.LoadControlFile(filePath, data, new DearchiveScenesInfo()); |
231 | 231 | ||
232 | Assert.That(arr.ControlFileLoaded, Is.True); | 232 | Assert.That(arr.ControlFileLoaded, Is.True); |
233 | 233 | ||
234 | while (tar.ReadEntry(out filePath, out tarEntryType) != null) | 234 | while (tar.ReadEntry(out filePath, out tarEntryType) != null) |
235 | { | 235 | { |
236 | if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) | 236 | if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) |
@@ -266,7 +266,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
266 | m_scene.AddNewSceneObject(sog1, false); | 266 | m_scene.AddNewSceneObject(sog1, false); |
267 | 267 | ||
268 | SceneObjectPart part2 = CreateSceneObjectPart2(); | 268 | SceneObjectPart part2 = CreateSceneObjectPart2(); |
269 | 269 | ||
270 | AssetNotecard nc = new AssetNotecard(); | 270 | AssetNotecard nc = new AssetNotecard(); |
271 | nc.BodyText = "Hello World!"; | 271 | nc.BodyText = "Hello World!"; |
272 | nc.Encode(); | 272 | nc.Encode(); |
@@ -276,10 +276,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
276 | = AssetHelpers.CreateAsset(ncAssetUuid, AssetType.Notecard, nc.AssetData, UUID.Zero); | 276 | = AssetHelpers.CreateAsset(ncAssetUuid, AssetType.Notecard, nc.AssetData, UUID.Zero); |
277 | m_scene.AssetService.Store(ncAsset); | 277 | m_scene.AssetService.Store(ncAsset); |
278 | SceneObjectGroup sog2 = new SceneObjectGroup(part2); | 278 | SceneObjectGroup sog2 = new SceneObjectGroup(part2); |
279 | TaskInventoryItem ncItem | 279 | TaskInventoryItem ncItem |
280 | = new TaskInventoryItem { Name = "ncItem", AssetID = ncAssetUuid, ItemID = ncItemUuid }; | 280 | = new TaskInventoryItem { Name = "ncItem", AssetID = ncAssetUuid, ItemID = ncItemUuid }; |
281 | part2.Inventory.AddInventoryItem(ncItem, true); | 281 | part2.Inventory.AddInventoryItem(ncItem, true); |
282 | 282 | ||
283 | m_scene.AddNewSceneObject(sog2, false); | 283 | m_scene.AddNewSceneObject(sog2, false); |
284 | 284 | ||
285 | MemoryStream archiveWriteStream = new MemoryStream(); | 285 | MemoryStream archiveWriteStream = new MemoryStream(); |
@@ -306,7 +306,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
306 | expectedPaths.Add(ArchiveHelpers.CreateObjectPath(sog2)); | 306 | expectedPaths.Add(ArchiveHelpers.CreateObjectPath(sog2)); |
307 | 307 | ||
308 | string filePath; | 308 | string filePath; |
309 | TarArchiveReader.TarEntryType tarEntryType; | 309 | TarArchiveReader.TarEntryType tarEntryType; |
310 | 310 | ||
311 | byte[] data = tar.ReadEntry(out filePath, out tarEntryType); | 311 | byte[] data = tar.ReadEntry(out filePath, out tarEntryType); |
312 | Assert.That(filePath, Is.EqualTo(ArchiveConstants.CONTROL_FILE_PATH)); | 312 | Assert.That(filePath, Is.EqualTo(ArchiveConstants.CONTROL_FILE_PATH)); |
@@ -314,9 +314,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
314 | Dictionary<string, object> archiveOptions = new Dictionary<string, object>(); | 314 | Dictionary<string, object> archiveOptions = new Dictionary<string, object>(); |
315 | ArchiveReadRequest arr = new ArchiveReadRequest(m_scene, (Stream)null, Guid.Empty, archiveOptions); | 315 | ArchiveReadRequest arr = new ArchiveReadRequest(m_scene, (Stream)null, Guid.Empty, archiveOptions); |
316 | arr.LoadControlFile(filePath, data, new DearchiveScenesInfo()); | 316 | arr.LoadControlFile(filePath, data, new DearchiveScenesInfo()); |
317 | 317 | ||
318 | Assert.That(arr.ControlFileLoaded, Is.True); | 318 | Assert.That(arr.ControlFileLoaded, Is.True); |
319 | 319 | ||
320 | while (tar.ReadEntry(out filePath, out tarEntryType) != null) | 320 | while (tar.ReadEntry(out filePath, out tarEntryType) != null) |
321 | { | 321 | { |
322 | if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) | 322 | if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) |
@@ -345,11 +345,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
345 | 345 | ||
346 | MemoryStream archiveWriteStream = new MemoryStream(); | 346 | MemoryStream archiveWriteStream = new MemoryStream(); |
347 | TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); | 347 | TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); |
348 | 348 | ||
349 | // Put in a random blank directory to check that this doesn't upset the load process | 349 | // Put in a random blank directory to check that this doesn't upset the load process |
350 | tar.WriteDir("ignoreme"); | 350 | tar.WriteDir("ignoreme"); |
351 | 351 | ||
352 | // Also check that direct entries which will also have a file entry containing that directory doesn't | 352 | // Also check that direct entries which will also have a file entry containing that directory doesn't |
353 | // upset load | 353 | // upset load |
354 | tar.WriteDir(ArchiveConstants.TERRAINS_PATH); | 354 | tar.WriteDir(ArchiveConstants.TERRAINS_PATH); |
355 | 355 | ||
@@ -392,7 +392,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
392 | Math.Round(part1.GroupPosition.X), Math.Round(part1.GroupPosition.Y), Math.Round(part1.GroupPosition.Z), | 392 | Math.Round(part1.GroupPosition.X), Math.Round(part1.GroupPosition.Y), Math.Round(part1.GroupPosition.Z), |
393 | part1.UUID); | 393 | part1.UUID); |
394 | tar.WriteFile(ArchiveConstants.OBJECTS_PATH + object1FileName, SceneObjectSerializer.ToXml2Format(object1)); | 394 | tar.WriteFile(ArchiveConstants.OBJECTS_PATH + object1FileName, SceneObjectSerializer.ToXml2Format(object1)); |
395 | 395 | ||
396 | tar.Close(); | 396 | tar.Close(); |
397 | 397 | ||
398 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); | 398 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); |
@@ -400,9 +400,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
400 | m_scene.EventManager.OnOarFileLoaded += LoadCompleted; | 400 | m_scene.EventManager.OnOarFileLoaded += LoadCompleted; |
401 | m_oarEvent.Reset(); | 401 | m_oarEvent.Reset(); |
402 | m_archiverModule.DearchiveRegion(archiveReadStream); | 402 | m_archiverModule.DearchiveRegion(archiveReadStream); |
403 | 403 | ||
404 | m_oarEvent.WaitOne(60000); | 404 | m_oarEvent.WaitOne(60000); |
405 | 405 | ||
406 | Assert.That(m_lastErrorMessage, Is.Null); | 406 | Assert.That(m_lastErrorMessage, Is.Null); |
407 | 407 | ||
408 | TestLoadedRegion(part1, soundItemName, soundData); | 408 | TestLoadedRegion(part1, soundItemName, soundData); |
@@ -475,31 +475,31 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
475 | m_scene.AddNewSceneObject(sog1, false); | 475 | m_scene.AddNewSceneObject(sog1, false); |
476 | 476 | ||
477 | SceneObjectPart part2 = CreateSceneObjectPart2(); | 477 | SceneObjectPart part2 = CreateSceneObjectPart2(); |
478 | 478 | ||
479 | AssetNotecard nc = new AssetNotecard(); | 479 | AssetNotecard nc = new AssetNotecard(); |
480 | nc.BodyText = "Hello World!"; | 480 | nc.BodyText = "Hello World!"; |
481 | nc.Encode(); | 481 | nc.Encode(); |
482 | UUID ncAssetUuid = new UUID("00000000-0000-0000-1000-000000000000"); | 482 | UUID ncAssetUuid = new UUID("00000000-0000-0000-1000-000000000000"); |
483 | UUID ncItemUuid = new UUID("00000000-0000-0000-1100-000000000000"); | 483 | UUID ncItemUuid = new UUID("00000000-0000-0000-1100-000000000000"); |
484 | AssetBase ncAsset | 484 | AssetBase ncAsset |
485 | = AssetHelpers.CreateAsset(ncAssetUuid, AssetType.Notecard, nc.AssetData, UUID.Zero); | 485 | = AssetHelpers.CreateAsset(ncAssetUuid, AssetType.Notecard, nc.AssetData, UUID.Zero); |
486 | m_scene.AssetService.Store(ncAsset); | 486 | m_scene.AssetService.Store(ncAsset); |
487 | SceneObjectGroup sog2 = new SceneObjectGroup(part2); | 487 | SceneObjectGroup sog2 = new SceneObjectGroup(part2); |
488 | TaskInventoryItem ncItem | 488 | TaskInventoryItem ncItem |
489 | = new TaskInventoryItem { Name = "ncItem", AssetID = ncAssetUuid, ItemID = ncItemUuid }; | 489 | = new TaskInventoryItem { Name = "ncItem", AssetID = ncAssetUuid, ItemID = ncItemUuid }; |
490 | part2.Inventory.AddInventoryItem(ncItem, true); | 490 | part2.Inventory.AddInventoryItem(ncItem, true); |
491 | 491 | ||
492 | m_scene.AddNewSceneObject(sog2, false); | 492 | m_scene.AddNewSceneObject(sog2, false); |
493 | 493 | ||
494 | MemoryStream archiveWriteStream = new MemoryStream(); | 494 | MemoryStream archiveWriteStream = new MemoryStream(); |
495 | m_scene.EventManager.OnOarFileSaved += SaveCompleted; | 495 | m_scene.EventManager.OnOarFileSaved += SaveCompleted; |
496 | 496 | ||
497 | Guid requestId = new Guid("00000000-0000-0000-0000-808080808080"); | 497 | Guid requestId = new Guid("00000000-0000-0000-0000-808080808080"); |
498 | 498 | ||
499 | m_oarEvent.Reset(); | 499 | m_oarEvent.Reset(); |
500 | m_archiverModule.ArchiveRegion( | 500 | m_archiverModule.ArchiveRegion( |
501 | archiveWriteStream, requestId, new Dictionary<string, Object>() { { "wipe-owners", Boolean.TrueString } }); | 501 | archiveWriteStream, requestId, new Dictionary<string, Object>() { { "wipe-owners", Boolean.TrueString } }); |
502 | 502 | ||
503 | m_oarEvent.WaitOne(60000); | 503 | m_oarEvent.WaitOne(60000); |
504 | 504 | ||
505 | Assert.That(m_lastRequestId, Is.EqualTo(requestId)); | 505 | Assert.That(m_lastRequestId, Is.EqualTo(requestId)); |
@@ -529,7 +529,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
529 | scene2.EventManager.OnOarFileLoaded += LoadCompleted; | 529 | scene2.EventManager.OnOarFileLoaded += LoadCompleted; |
530 | m_oarEvent.Reset(); | 530 | m_oarEvent.Reset(); |
531 | archiverModule.DearchiveRegion(archiveReadStream); | 531 | archiverModule.DearchiveRegion(archiveReadStream); |
532 | 532 | ||
533 | m_oarEvent.WaitOne(60000); | 533 | m_oarEvent.WaitOne(60000); |
534 | 534 | ||
535 | Assert.That(m_lastErrorMessage, Is.Null); | 535 | Assert.That(m_lastErrorMessage, Is.Null); |
@@ -557,16 +557,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
557 | MockGroupsServicesConnector groupsService = new MockGroupsServicesConnector(); | 557 | MockGroupsServicesConnector groupsService = new MockGroupsServicesConnector(); |
558 | 558 | ||
559 | IConfigSource configSource = new IniConfigSource(); | 559 | IConfigSource configSource = new IniConfigSource(); |
560 | IConfig config = configSource.AddConfig("Groups"); | 560 | IConfig config = configSource.AddConfig("Groups"); |
561 | config.Set("Enabled", true); | 561 | config.Set("Enabled", true); |
562 | config.Set("Module", "GroupsModule"); | 562 | config.Set("Module", "GroupsModule"); |
563 | config.Set("DebugEnabled", true); | 563 | config.Set("DebugEnabled", true); |
564 | SceneHelpers.SetupSceneModules( | 564 | SceneHelpers.SetupSceneModules( |
565 | m_scene, configSource, new object[] { new GroupsModule(), groupsService, new LandManagementModule() }); | 565 | m_scene, configSource, new object[] { new GroupsModule(), groupsService, new LandManagementModule() }); |
566 | 566 | ||
567 | // Create group in scene for loading | 567 | // Create group in scene for loading |
568 | // FIXME: For now we'll put up with the issue that we'll get a group ID that varies across tests. | 568 | // FIXME: For now we'll put up with the issue that we'll get a group ID that varies across tests. |
569 | UUID groupID | 569 | UUID groupID |
570 | = groupsService.CreateGroup(UUID.Zero, "group1", "", true, UUID.Zero, 3, true, true, true, UUID.Zero); | 570 | = groupsService.CreateGroup(UUID.Zero, "group1", "", true, UUID.Zero, 3, true, true, true, UUID.Zero); |
571 | 571 | ||
572 | // Construct OAR | 572 | // Construct OAR |
@@ -594,7 +594,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
594 | m_scene.EventManager.OnOarFileLoaded += LoadCompleted; | 594 | m_scene.EventManager.OnOarFileLoaded += LoadCompleted; |
595 | m_oarEvent.Reset(); | 595 | m_oarEvent.Reset(); |
596 | m_archiverModule.DearchiveRegion(oarStream); | 596 | m_archiverModule.DearchiveRegion(oarStream); |
597 | 597 | ||
598 | m_oarEvent.WaitOne(60000); | 598 | m_oarEvent.WaitOne(60000); |
599 | 599 | ||
600 | ILandObject rLo = m_scene.LandChannel.GetLandObject(16, 16); | 600 | ILandObject rLo = m_scene.LandChannel.GetLandObject(16, 16); |
@@ -617,7 +617,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
617 | 617 | ||
618 | MemoryStream archiveWriteStream = new MemoryStream(); | 618 | MemoryStream archiveWriteStream = new MemoryStream(); |
619 | TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); | 619 | TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); |
620 | 620 | ||
621 | tar.WriteDir(ArchiveConstants.TERRAINS_PATH); | 621 | tar.WriteDir(ArchiveConstants.TERRAINS_PATH); |
622 | tar.WriteFile( | 622 | tar.WriteFile( |
623 | ArchiveConstants.CONTROL_FILE_PATH, | 623 | ArchiveConstants.CONTROL_FILE_PATH, |
@@ -658,7 +658,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
658 | rs.AddSpawnPoint(SpawnPoint.Parse("1,-2,0.33")); | 658 | rs.AddSpawnPoint(SpawnPoint.Parse("1,-2,0.33")); |
659 | 659 | ||
660 | tar.WriteFile(ArchiveConstants.SETTINGS_PATH + "region1.xml", RegionSettingsSerializer.Serialize(rs)); | 660 | tar.WriteFile(ArchiveConstants.SETTINGS_PATH + "region1.xml", RegionSettingsSerializer.Serialize(rs)); |
661 | 661 | ||
662 | tar.Close(); | 662 | tar.Close(); |
663 | 663 | ||
664 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); | 664 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); |
@@ -666,9 +666,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
666 | m_scene.EventManager.OnOarFileLoaded += LoadCompleted; | 666 | m_scene.EventManager.OnOarFileLoaded += LoadCompleted; |
667 | m_oarEvent.Reset(); | 667 | m_oarEvent.Reset(); |
668 | m_archiverModule.DearchiveRegion(archiveReadStream); | 668 | m_archiverModule.DearchiveRegion(archiveReadStream); |
669 | 669 | ||
670 | m_oarEvent.WaitOne(60000); | 670 | m_oarEvent.WaitOne(60000); |
671 | 671 | ||
672 | Assert.That(m_lastErrorMessage, Is.Null); | 672 | Assert.That(m_lastErrorMessage, Is.Null); |
673 | RegionSettings loadedRs = m_scene.RegionInfo.RegionSettings; | 673 | RegionSettings loadedRs = m_scene.RegionInfo.RegionSettings; |
674 | 674 | ||
@@ -705,7 +705,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
705 | Assert.AreEqual(UUID.Zero, loadedRs.TelehubObject); // because no object was found with the original UUID | 705 | Assert.AreEqual(UUID.Zero, loadedRs.TelehubObject); // because no object was found with the original UUID |
706 | Assert.AreEqual(0, loadedRs.SpawnPoints().Count); | 706 | Assert.AreEqual(0, loadedRs.SpawnPoints().Count); |
707 | } | 707 | } |
708 | 708 | ||
709 | /// <summary> | 709 | /// <summary> |
710 | /// Test merging an OpenSim Region Archive into an existing scene | 710 | /// Test merging an OpenSim Region Archive into an existing scene |
711 | /// </summary> | 711 | /// </summary> |
@@ -741,7 +741,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
741 | scene.EventManager.OnOarFileSaved += SaveCompleted; | 741 | scene.EventManager.OnOarFileSaved += SaveCompleted; |
742 | m_oarEvent.Reset(); | 742 | m_oarEvent.Reset(); |
743 | m_archiverModule.ArchiveRegion(archiveWriteStream); | 743 | m_archiverModule.ArchiveRegion(archiveWriteStream); |
744 | 744 | ||
745 | m_oarEvent.WaitOne(60000); | 745 | m_oarEvent.WaitOne(60000); |
746 | } | 746 | } |
747 | 747 | ||
@@ -758,7 +758,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
758 | archiveOptions.Add("merge", null); | 758 | archiveOptions.Add("merge", null); |
759 | m_oarEvent.Reset(); | 759 | m_oarEvent.Reset(); |
760 | m_archiverModule.DearchiveRegion(archiveReadStream, Guid.Empty, archiveOptions); | 760 | m_archiverModule.DearchiveRegion(archiveReadStream, Guid.Empty, archiveOptions); |
761 | 761 | ||
762 | m_oarEvent.WaitOne(60000); | 762 | m_oarEvent.WaitOne(60000); |
763 | 763 | ||
764 | SceneObjectPart object1Existing = m_scene.GetSceneObjectPart(part1.Name); | 764 | SceneObjectPart object1Existing = m_scene.GetSceneObjectPart(part1.Name); |
@@ -819,7 +819,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
819 | SceneObjectGroup sog1; | 819 | SceneObjectGroup sog1; |
820 | SceneObjectGroup sog2; | 820 | SceneObjectGroup sog2; |
821 | UUID ncAssetUuid; | 821 | UUID ncAssetUuid; |
822 | 822 | ||
823 | CreateTestObjects(scene, out sog1, out sog2, out ncAssetUuid); | 823 | CreateTestObjects(scene, out sog1, out sog2, out ncAssetUuid); |
824 | 824 | ||
825 | expectedPaths[scene.RegionInfo.RegionID] = new List<string>(); | 825 | expectedPaths[scene.RegionInfo.RegionID] = new List<string>(); |
@@ -841,7 +841,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
841 | m_scene.EventManager.OnOarFileSaved += SaveCompleted; | 841 | m_scene.EventManager.OnOarFileSaved += SaveCompleted; |
842 | m_oarEvent.Reset(); | 842 | m_oarEvent.Reset(); |
843 | m_archiverModule.ArchiveRegion(archiveWriteStream, requestId, options); | 843 | m_archiverModule.ArchiveRegion(archiveWriteStream, requestId, options); |
844 | 844 | ||
845 | m_oarEvent.WaitOne(60000); | 845 | m_oarEvent.WaitOne(60000); |
846 | 846 | ||
847 | 847 | ||
@@ -993,7 +993,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
993 | 993 | ||
994 | tar.Close(); | 994 | tar.Close(); |
995 | 995 | ||
996 | 996 | ||
997 | // Delete the current objects, to test that they're loaded from the OAR and didn't | 997 | // Delete the current objects, to test that they're loaded from the OAR and didn't |
998 | // just remain in the scene. | 998 | // just remain in the scene. |
999 | m_sceneHelpers.SceneManager.ForEachScene(delegate(Scene scene) | 999 | m_sceneHelpers.SceneManager.ForEachScene(delegate(Scene scene) |
@@ -1012,7 +1012,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
1012 | m_scene.EventManager.OnOarFileLoaded += LoadCompleted; | 1012 | m_scene.EventManager.OnOarFileLoaded += LoadCompleted; |
1013 | m_oarEvent.Reset(); | 1013 | m_oarEvent.Reset(); |
1014 | m_archiverModule.DearchiveRegion(archiveReadStream); | 1014 | m_archiverModule.DearchiveRegion(archiveReadStream); |
1015 | 1015 | ||
1016 | m_oarEvent.WaitOne(60000); | 1016 | m_oarEvent.WaitOne(60000); |
1017 | 1017 | ||
1018 | Assert.That(m_lastErrorMessage, Is.Null); | 1018 | Assert.That(m_lastErrorMessage, Is.Null); |
diff --git a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs index 617c348..a450dd6 100644 --- a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs +++ b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Region.CoreModules.World | |||
40 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "CloudModule")] | 40 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "CloudModule")] |
41 | public class CloudModule : ICloudModule, INonSharedRegionModule | 41 | public class CloudModule : ICloudModule, INonSharedRegionModule |
42 | { | 42 | { |
43 | // private static readonly log4net.ILog m_log | 43 | // private static readonly log4net.ILog m_log |
44 | // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 44 | // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
45 | private uint m_frame = 0; | 45 | private uint m_frame = 0; |
46 | private int m_frameUpdateRate = 1000; | 46 | private int m_frameUpdateRate = 1000; |
@@ -163,7 +163,7 @@ namespace OpenSim.Region.CoreModules.World | |||
163 | columnRight = 0; | 163 | columnRight = 0; |
164 | columnLeft = x - 1; | 164 | columnLeft = x - 1; |
165 | } | 165 | } |
166 | else | 166 | else |
167 | { | 167 | { |
168 | columnRight = x + 1; | 168 | columnRight = x + 1; |
169 | columnLeft = x - 1; | 169 | columnLeft = x - 1; |
@@ -185,14 +185,14 @@ namespace OpenSim.Region.CoreModules.World | |||
185 | rowAbove = y + 1; | 185 | rowAbove = y + 1; |
186 | rowBelow = y - 1; | 186 | rowBelow = y - 1; |
187 | } | 187 | } |
188 | float neighborAverage = (cloudCover[rowBelow * 16 + columnLeft] + | 188 | float neighborAverage = (cloudCover[rowBelow * 16 + columnLeft] + |
189 | cloudCover[y * 16 + columnLeft] + | 189 | cloudCover[y * 16 + columnLeft] + |
190 | cloudCover[rowAbove * 16 + columnLeft] + | 190 | cloudCover[rowAbove * 16 + columnLeft] + |
191 | cloudCover[rowBelow * 16 + x] + | 191 | cloudCover[rowBelow * 16 + x] + |
192 | cloudCover[rowAbove * 16 + x] + | 192 | cloudCover[rowAbove * 16 + x] + |
193 | cloudCover[rowBelow * 16 + columnRight] + | 193 | cloudCover[rowBelow * 16 + columnRight] + |
194 | cloudCover[y * 16 + columnRight] + | 194 | cloudCover[y * 16 + columnRight] + |
195 | cloudCover[rowAbove * 16 + columnRight] + | 195 | cloudCover[rowAbove * 16 + columnRight] + |
196 | cloudCover[y * 16 + x]) / 9; | 196 | cloudCover[y * 16 + x]) / 9; |
197 | newCover[y * 16 + x] = ((neighborAverage / m_cloudDensity) + 0.175f) % 1.0f; | 197 | newCover[y * 16 + x] = ((neighborAverage / m_cloudDensity) + 0.175f) % 1.0f; |
198 | newCover[y * 16 + x] *= m_cloudDensity; | 198 | newCover[y * 16 + x] *= m_cloudDensity; |
@@ -201,7 +201,7 @@ namespace OpenSim.Region.CoreModules.World | |||
201 | Array.Copy(newCover, cloudCover, 16 * 16); | 201 | Array.Copy(newCover, cloudCover, 16 * 16); |
202 | m_dataVersion++; | 202 | m_dataVersion++; |
203 | } | 203 | } |
204 | 204 | ||
205 | private void CloudUpdate() | 205 | private void CloudUpdate() |
206 | { | 206 | { |
207 | if ((!m_ready || m_busy || m_cloudDensity == 0 || | 207 | if ((!m_ready || m_busy || m_cloudDensity == 0 || |
@@ -243,7 +243,7 @@ namespace OpenSim.Region.CoreModules.World | |||
243 | } | 243 | } |
244 | } | 244 | } |
245 | 245 | ||
246 | 246 | ||
247 | /// <summary> | 247 | /// <summary> |
248 | /// Calculate the cloud cover over the region. | 248 | /// Calculate the cloud cover over the region. |
249 | /// </summary> | 249 | /// </summary> |
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateConnector.cs b/OpenSim/Region/CoreModules/World/Estate/EstateConnector.cs index ad561fd..051ff71 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateConnector.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateConnector.cs | |||
@@ -149,7 +149,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
149 | { | 149 | { |
150 | foreach (Scene s in m_EstateModule.Scenes) | 150 | foreach (Scene s in m_EstateModule.Scenes) |
151 | { | 151 | { |
152 | RegionInfo sreg = s.RegionInfo; | 152 | RegionInfo sreg = s.RegionInfo; |
153 | if (regions.Contains(sreg.RegionID)) | 153 | if (regions.Contains(sreg.RegionID)) |
154 | { | 154 | { |
155 | string url = sreg.ExternalHostName + ":" + sreg.HttpPort; | 155 | string url = sreg.ExternalHostName + ":" + sreg.HttpPort; |
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs index 702b503..7879f83 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs | |||
@@ -49,18 +49,18 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
49 | public class EstateManagementCommands | 49 | public class EstateManagementCommands |
50 | { | 50 | { |
51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
52 | 52 | ||
53 | protected EstateManagementModule m_module; | 53 | protected EstateManagementModule m_module; |
54 | 54 | ||
55 | public EstateManagementCommands(EstateManagementModule module) | 55 | public EstateManagementCommands(EstateManagementModule module) |
56 | { | 56 | { |
57 | m_module = module; | 57 | m_module = module; |
58 | } | 58 | } |
59 | 59 | ||
60 | public void Initialise() | 60 | public void Initialise() |
61 | { | 61 | { |
62 | // m_log.DebugFormat("[ESTATE MODULE]: Setting up estate commands for region {0}", m_module.Scene.RegionInfo.RegionName); | 62 | // m_log.DebugFormat("[ESTATE MODULE]: Setting up estate commands for region {0}", m_module.Scene.RegionInfo.RegionName); |
63 | 63 | ||
64 | m_module.Scene.AddCommand("Regions", m_module, "set terrain texture", | 64 | m_module.Scene.AddCommand("Regions", m_module, "set terrain texture", |
65 | "set terrain texture <number> <uuid> [<x>] [<y>]", | 65 | "set terrain texture <number> <uuid> [<x>] [<y>]", |
66 | "Sets the terrain <number> to <uuid>, if <x> or <y> are specified, it will only " + | 66 | "Sets the terrain <number> to <uuid>, if <x> or <y> are specified, it will only " + |
@@ -77,14 +77,14 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
77 | 77 | ||
78 | m_module.Scene.AddCommand("Regions", m_module, "set water height", | 78 | m_module.Scene.AddCommand("Regions", m_module, "set water height", |
79 | "set water height <height> [<x>] [<y>]", | 79 | "set water height <height> [<x>] [<y>]", |
80 | "Sets the water height in meters. If <x> and <y> are specified, it will only set it on regions with a matching coordinate. " + | 80 | "Sets the water height in meters. If <x> and <y> are specified, it will only set it on regions with a matching coordinate. " + |
81 | "Specify -1 in <x> or <y> to wildcard that coordinate.", | 81 | "Specify -1 in <x> or <y> to wildcard that coordinate.", |
82 | consoleSetWaterHeight); | 82 | consoleSetWaterHeight); |
83 | 83 | ||
84 | m_module.Scene.AddCommand( | 84 | m_module.Scene.AddCommand( |
85 | "Estates", m_module, "estate show", "estate show", "Shows all estates on the simulator.", ShowEstatesCommand); | 85 | "Estates", m_module, "estate show", "estate show", "Shows all estates on the simulator.", ShowEstatesCommand); |
86 | } | 86 | } |
87 | 87 | ||
88 | public void Close() {} | 88 | public void Close() {} |
89 | 89 | ||
90 | #region CommandHandlers | 90 | #region CommandHandlers |
@@ -120,7 +120,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
120 | m_module.Scene.RegionInfo.RegionSettings.TerrainTexture4 = texture; | 120 | m_module.Scene.RegionInfo.RegionSettings.TerrainTexture4 = texture; |
121 | break; | 121 | break; |
122 | } | 122 | } |
123 | 123 | ||
124 | m_module.Scene.RegionInfo.RegionSettings.Save(); | 124 | m_module.Scene.RegionInfo.RegionSettings.Save(); |
125 | m_module.TriggerRegionInfoChange(); | 125 | m_module.TriggerRegionInfoChange(); |
126 | m_module.sendRegionHandshakeToAll(); | 126 | m_module.sendRegionHandshakeToAll(); |
@@ -130,7 +130,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
130 | protected void consoleSetWaterHeight(string module, string[] args) | 130 | protected void consoleSetWaterHeight(string module, string[] args) |
131 | { | 131 | { |
132 | string heightstring = args[3]; | 132 | string heightstring = args[3]; |
133 | 133 | ||
134 | int x = (args.Length > 4 ? int.Parse(args[4]) : -1); | 134 | int x = (args.Length > 4 ? int.Parse(args[4]) : -1); |
135 | int y = (args.Length > 5 ? int.Parse(args[5]) : -1); | 135 | int y = (args.Length > 5 ? int.Parse(args[5]) : -1); |
136 | 136 | ||
@@ -143,13 +143,13 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
143 | m_log.Debug("[ESTATEMODULE]: Setting water height in " + m_module.Scene.RegionInfo.RegionName + " to " + | 143 | m_log.Debug("[ESTATEMODULE]: Setting water height in " + m_module.Scene.RegionInfo.RegionName + " to " + |
144 | string.Format(" {0}", selectedheight)); | 144 | string.Format(" {0}", selectedheight)); |
145 | m_module.Scene.RegionInfo.RegionSettings.WaterHeight = selectedheight; | 145 | m_module.Scene.RegionInfo.RegionSettings.WaterHeight = selectedheight; |
146 | 146 | ||
147 | m_module.Scene.RegionInfo.RegionSettings.Save(); | 147 | m_module.Scene.RegionInfo.RegionSettings.Save(); |
148 | m_module.TriggerRegionInfoChange(); | 148 | m_module.TriggerRegionInfoChange(); |
149 | m_module.sendRegionHandshakeToAll(); | 149 | m_module.sendRegionHandshakeToAll(); |
150 | } | 150 | } |
151 | } | 151 | } |
152 | } | 152 | } |
153 | protected void consoleSetTerrainHeights(string module, string[] args) | 153 | protected void consoleSetTerrainHeights(string module, string[] args) |
154 | { | 154 | { |
155 | string num = args[3]; | 155 | string num = args[3]; |
@@ -198,31 +198,31 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
198 | m_module.Scene.RegionInfo.RegionSettings.Elevation2NE = highValue; | 198 | m_module.Scene.RegionInfo.RegionSettings.Elevation2NE = highValue; |
199 | break; | 199 | break; |
200 | } | 200 | } |
201 | 201 | ||
202 | m_module.Scene.RegionInfo.RegionSettings.Save(); | 202 | m_module.Scene.RegionInfo.RegionSettings.Save(); |
203 | m_module.TriggerRegionInfoChange(); | 203 | m_module.TriggerRegionInfoChange(); |
204 | m_module.sendRegionHandshakeToAll(); | 204 | m_module.sendRegionHandshakeToAll(); |
205 | } | 205 | } |
206 | } | 206 | } |
207 | } | 207 | } |
208 | 208 | ||
209 | protected void ShowEstatesCommand(string module, string[] cmd) | 209 | protected void ShowEstatesCommand(string module, string[] cmd) |
210 | { | 210 | { |
211 | StringBuilder report = new StringBuilder(); | 211 | StringBuilder report = new StringBuilder(); |
212 | RegionInfo ri = m_module.Scene.RegionInfo; | 212 | RegionInfo ri = m_module.Scene.RegionInfo; |
213 | EstateSettings es = ri.EstateSettings; | 213 | EstateSettings es = ri.EstateSettings; |
214 | 214 | ||
215 | report.AppendFormat("Estate information for region {0}\n", ri.RegionName); | 215 | report.AppendFormat("Estate information for region {0}\n", ri.RegionName); |
216 | report.AppendFormat( | 216 | report.AppendFormat( |
217 | "{0,-20} {1,-7} {2,-20}\n", | 217 | "{0,-20} {1,-7} {2,-20}\n", |
218 | "Estate Name", | 218 | "Estate Name", |
219 | "ID", | 219 | "ID", |
220 | "Owner"); | 220 | "Owner"); |
221 | 221 | ||
222 | report.AppendFormat( | 222 | report.AppendFormat( |
223 | "{0,-20} {1,-7} {2,-20}\n", | 223 | "{0,-20} {1,-7} {2,-20}\n", |
224 | es.EstateName, es.EstateID, m_module.UserManager.GetUserName(es.EstateOwner)); | 224 | es.EstateName, es.EstateID, m_module.UserManager.GetUserName(es.EstateOwner)); |
225 | 225 | ||
226 | MainConsole.Instance.Output(report.ToString()); | 226 | MainConsole.Instance.Output(report.ToString()); |
227 | } | 227 | } |
228 | #endregion | 228 | #endregion |
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index efd4ca6..3c45b68 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -57,8 +57,8 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
57 | private Timer m_regionChangeTimer = new Timer(); | 57 | private Timer m_regionChangeTimer = new Timer(); |
58 | public Scene Scene { get; private set; } | 58 | public Scene Scene { get; private set; } |
59 | public IUserManagement UserManager { get; private set; } | 59 | public IUserManagement UserManager { get; private set; } |
60 | 60 | ||
61 | protected EstateManagementCommands m_commands; | 61 | protected EstateManagementCommands m_commands; |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
64 | /// If false, region restart requests from the client are blocked even if they are otherwise legitimate. | 64 | /// If false, region restart requests from the client are blocked even if they are otherwise legitimate. |
@@ -77,12 +77,12 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
77 | private int m_delayCount = 0; | 77 | private int m_delayCount = 0; |
78 | 78 | ||
79 | #region Region Module interface | 79 | #region Region Module interface |
80 | 80 | ||
81 | public string Name { get { return "EstateManagementModule"; } } | 81 | public string Name { get { return "EstateManagementModule"; } } |
82 | |||
83 | public Type ReplaceableInterface { get { return null; } } | ||
84 | 82 | ||
85 | public void Initialise(IConfigSource source) | 83 | public Type ReplaceableInterface { get { return null; } } |
84 | |||
85 | public void Initialise(IConfigSource source) | ||
86 | { | 86 | { |
87 | AllowRegionRestartFromClient = true; | 87 | AllowRegionRestartFromClient = true; |
88 | 88 | ||
@@ -91,7 +91,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
91 | if (config != null) | 91 | if (config != null) |
92 | AllowRegionRestartFromClient = config.GetBoolean("AllowRegionRestartFromClient", true); | 92 | AllowRegionRestartFromClient = config.GetBoolean("AllowRegionRestartFromClient", true); |
93 | } | 93 | } |
94 | 94 | ||
95 | public void AddRegion(Scene scene) | 95 | public void AddRegion(Scene scene) |
96 | { | 96 | { |
97 | Scene = scene; | 97 | Scene = scene; |
@@ -108,19 +108,19 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
108 | m_regionChangeTimer.Elapsed += RaiseRegionInfoChange; | 108 | m_regionChangeTimer.Elapsed += RaiseRegionInfoChange; |
109 | m_regionChangeTimer.AutoReset = false; | 109 | m_regionChangeTimer.AutoReset = false; |
110 | } | 110 | } |
111 | 111 | ||
112 | public void RemoveRegion(Scene scene) {} | 112 | public void RemoveRegion(Scene scene) {} |
113 | 113 | ||
114 | public void RegionLoaded(Scene scene) | 114 | public void RegionLoaded(Scene scene) |
115 | { | 115 | { |
116 | // Sets up the sun module based no the saved Estate and Region Settings | 116 | // Sets up the sun module based no the saved Estate and Region Settings |
117 | // DO NOT REMOVE or the sun will stop working | 117 | // DO NOT REMOVE or the sun will stop working |
118 | scene.TriggerEstateSunUpdate(); | 118 | scene.TriggerEstateSunUpdate(); |
119 | 119 | ||
120 | UserManager = scene.RequestModuleInterface<IUserManagement>(); | 120 | UserManager = scene.RequestModuleInterface<IUserManagement>(); |
121 | } | 121 | } |
122 | 122 | ||
123 | public void Close() | 123 | public void Close() |
124 | { | 124 | { |
125 | m_commands.Close(); | 125 | m_commands.Close(); |
126 | } | 126 | } |
@@ -486,7 +486,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
486 | 486 | ||
487 | if((byte)maxAgents <= Scene.RegionInfo.AgentCapacity) | 487 | if((byte)maxAgents <= Scene.RegionInfo.AgentCapacity) |
488 | Scene.RegionInfo.RegionSettings.AgentLimit = (byte) maxAgents; | 488 | Scene.RegionInfo.RegionSettings.AgentLimit = (byte) maxAgents; |
489 | else | 489 | else |
490 | Scene.RegionInfo.RegionSettings.AgentLimit = Scene.RegionInfo.AgentCapacity; | 490 | Scene.RegionInfo.RegionSettings.AgentLimit = Scene.RegionInfo.AgentCapacity; |
491 | 491 | ||
492 | Scene.RegionInfo.RegionSettings.ObjectBonus = objectBonusFactor; | 492 | Scene.RegionInfo.RegionSettings.ObjectBonus = objectBonusFactor; |
@@ -640,7 +640,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
640 | restartModule.ScheduleRestart(UUID.Zero, "Region will restart in {0}", times.ToArray(), false); | 640 | restartModule.ScheduleRestart(UUID.Zero, "Region will restart in {0}", times.ToArray(), false); |
641 | 641 | ||
642 | m_log.InfoFormat( | 642 | m_log.InfoFormat( |
643 | "User {0} requested restart of region {1} in {2} seconds", | 643 | "User {0} requested restart of region {1} in {2} seconds", |
644 | remoteClient.Name, Scene.Name, times.Count != 0 ? times[0] : 0); | 644 | remoteClient.Name, Scene.Name, times.Count != 0 ? times[0] : 0); |
645 | } | 645 | } |
646 | } | 646 | } |
@@ -648,9 +648,9 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
648 | private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, UUID estateCovenantID) | 648 | private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, UUID estateCovenantID) |
649 | { | 649 | { |
650 | // m_log.DebugFormat( | 650 | // m_log.DebugFormat( |
651 | // "[ESTATE MANAGEMENT MODULE]: Handling request from {0} to change estate covenant to {1}", | 651 | // "[ESTATE MANAGEMENT MODULE]: Handling request from {0} to change estate covenant to {1}", |
652 | // remoteClient.Name, estateCovenantID); | 652 | // remoteClient.Name, estateCovenantID); |
653 | 653 | ||
654 | Scene.RegionInfo.RegionSettings.Covenant = estateCovenantID; | 654 | Scene.RegionInfo.RegionSettings.Covenant = estateCovenantID; |
655 | Scene.RegionInfo.RegionSettings.CovenantChangedDateTime = Util.UnixTimeSinceEpoch(); | 655 | Scene.RegionInfo.RegionSettings.CovenantChangedDateTime = Util.UnixTimeSinceEpoch(); |
656 | Scene.RegionInfo.RegionSettings.Save(); | 656 | Scene.RegionInfo.RegionSettings.Save(); |
@@ -694,7 +694,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
694 | } | 694 | } |
695 | } | 695 | } |
696 | } | 696 | } |
697 | 697 | ||
698 | private void execDeltaRequests(object o) | 698 | private void execDeltaRequests(object o) |
699 | { | 699 | { |
700 | IClientAPI remote_client; | 700 | IClientAPI remote_client; |
@@ -720,23 +720,23 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
720 | if(!Scene.IsRunning) | 720 | if(!Scene.IsRunning) |
721 | break; | 721 | break; |
722 | 722 | ||
723 | if(req == null) | 723 | if(req == null) |
724 | { | 724 | { |
725 | if(changed.Count > 0) | 725 | if(changed.Count > 0) |
726 | { | 726 | { |
727 | foreach(EstateSettings est in changed.Values) | 727 | foreach(EstateSettings est in changed.Values) |
728 | Scene.EstateDataService.StoreEstateSettings(est); | 728 | Scene.EstateDataService.StoreEstateSettings(est); |
729 | 729 | ||
730 | TriggerEstateInfoChange(); | 730 | TriggerEstateInfoChange(); |
731 | } | 731 | } |
732 | 732 | ||
733 | EstateSettings es = Scene.RegionInfo.EstateSettings; | 733 | EstateSettings es = Scene.RegionInfo.EstateSettings; |
734 | foreach(KeyValuePair<IClientAPI,UUID> kvp in sendAllowedOrBanList) | 734 | foreach(KeyValuePair<IClientAPI,UUID> kvp in sendAllowedOrBanList) |
735 | { | 735 | { |
736 | IClientAPI cli = kvp.Key; | 736 | IClientAPI cli = kvp.Key; |
737 | UUID invoive = kvp.Value; | 737 | UUID invoive = kvp.Value; |
738 | cli.SendEstateList(invoive, (int)Constants.EstateAccessCodex.AllowedAccess, es.EstateAccess, es.EstateID); | 738 | cli.SendEstateList(invoive, (int)Constants.EstateAccessCodex.AllowedAccess, es.EstateAccess, es.EstateID); |
739 | cli.SendBannedUserList(invoive, es.EstateBans, es.EstateID); | 739 | cli.SendBannedUserList(invoive, es.EstateBans, es.EstateID); |
740 | } | 740 | } |
741 | sendAllowedOrBanList.Clear(); | 741 | sendAllowedOrBanList.Clear(); |
742 | 742 | ||
@@ -777,7 +777,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
777 | bool doOtherEstates = ((estateAccessType & 3) != 0); | 777 | bool doOtherEstates = ((estateAccessType & 3) != 0); |
778 | 778 | ||
779 | EstateSettings thisSettings = Scene.RegionInfo.EstateSettings; | 779 | EstateSettings thisSettings = Scene.RegionInfo.EstateSettings; |
780 | int thisEstateID =(int)thisSettings.EstateID; | 780 | int thisEstateID =(int)thisSettings.EstateID; |
781 | 781 | ||
782 | UUID agentID = remote_client.AgentId; | 782 | UUID agentID = remote_client.AgentId; |
783 | 783 | ||
@@ -811,7 +811,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
811 | } | 811 | } |
812 | estateIDs.Clear(); | 812 | estateIDs.Clear(); |
813 | } | 813 | } |
814 | 814 | ||
815 | // the commands | 815 | // the commands |
816 | // first the ones allowed for estate managers on this region | 816 | // first the ones allowed for estate managers on this region |
817 | if ((estateAccessType & 4) != 0) // User add | 817 | if ((estateAccessType & 4) != 0) // User add |
@@ -1020,7 +1020,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1020 | break; | 1020 | break; |
1021 | } | 1021 | } |
1022 | } | 1022 | } |
1023 | 1023 | ||
1024 | if (alreadyInList && listitem != null) | 1024 | if (alreadyInList && listitem != null) |
1025 | { | 1025 | { |
1026 | if (doOtherEstates) // All estates | 1026 | if (doOtherEstates) // All estates |
@@ -1072,7 +1072,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1072 | if(!isadmin && !estateSettings.IsEstateOwner(agentID)) // redundante check? | 1072 | if(!isadmin && !estateSettings.IsEstateOwner(agentID)) // redundante check? |
1073 | continue; | 1073 | continue; |
1074 | if(estateSettings.EstateManagersCount() >= (int)Constants.EstateAccessLimits.EstateManagers) | 1074 | if(estateSettings.EstateManagersCount() >= (int)Constants.EstateAccessLimits.EstateManagers) |
1075 | continue; | 1075 | continue; |
1076 | estateSettings.AddEstateManager(user); | 1076 | estateSettings.AddEstateManager(user); |
1077 | changed[(int)estateSettings.EstateID] = estateSettings; | 1077 | changed[(int)estateSettings.EstateID] = estateSettings; |
1078 | } | 1078 | } |
@@ -1158,7 +1158,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1158 | IClientAPI remote_client, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message) | 1158 | IClientAPI remote_client, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message) |
1159 | { | 1159 | { |
1160 | IDialogModule dm = Scene.RequestModuleInterface<IDialogModule>(); | 1160 | IDialogModule dm = Scene.RequestModuleInterface<IDialogModule>(); |
1161 | 1161 | ||
1162 | if (dm != null) | 1162 | if (dm != null) |
1163 | dm.SendNotificationToUsersInRegion(senderID, senderName, message); | 1163 | dm.SendNotificationToUsersInRegion(senderID, senderName, message); |
1164 | } | 1164 | } |
@@ -1249,7 +1249,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1249 | } | 1249 | } |
1250 | }); | 1250 | }); |
1251 | } | 1251 | } |
1252 | 1252 | ||
1253 | private void AbortTerrainXferHandler(IClientAPI remoteClient, ulong XferID) | 1253 | private void AbortTerrainXferHandler(IClientAPI remoteClient, ulong XferID) |
1254 | { | 1254 | { |
1255 | lock (this) | 1255 | lock (this) |
@@ -1332,7 +1332,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1332 | if (TerrainUploader == null) | 1332 | if (TerrainUploader == null) |
1333 | { | 1333 | { |
1334 | m_log.DebugFormat( | 1334 | m_log.DebugFormat( |
1335 | "[TERRAIN]: Started receiving terrain upload for region {0} from {1}", | 1335 | "[TERRAIN]: Started receiving terrain upload for region {0} from {1}", |
1336 | Scene.Name, remote_client.Name); | 1336 | Scene.Name, remote_client.Name); |
1337 | 1337 | ||
1338 | TerrainUploader = new EstateTerrainXferHandler(remote_client, clientFileName); | 1338 | TerrainUploader = new EstateTerrainXferHandler(remote_client, clientFileName); |
@@ -1352,7 +1352,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1352 | { | 1352 | { |
1353 | // Save terrain here | 1353 | // Save terrain here |
1354 | ITerrainModule terr = Scene.RequestModuleInterface<ITerrainModule>(); | 1354 | ITerrainModule terr = Scene.RequestModuleInterface<ITerrainModule>(); |
1355 | 1355 | ||
1356 | if (terr != null) | 1356 | if (terr != null) |
1357 | { | 1357 | { |
1358 | // m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + Scene.RegionInfo.RegionName); | 1358 | // m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + Scene.RegionInfo.RegionName); |
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateModule.cs index fb4d04f..f3c8aa8 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateModule.cs | |||
@@ -52,7 +52,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
52 | protected List<Scene> m_Scenes = new List<Scene>(); | 52 | protected List<Scene> m_Scenes = new List<Scene>(); |
53 | protected bool m_InInfoUpdate = false; | 53 | protected bool m_InInfoUpdate = false; |
54 | private string token = "7db8eh2gvgg45jj"; | 54 | private string token = "7db8eh2gvgg45jj"; |
55 | protected bool m_enabled = false; | 55 | protected bool m_enabled = false; |
56 | 56 | ||
57 | public bool InInfoUpdate | 57 | public bool InInfoUpdate |
58 | { | 58 | { |
@@ -74,19 +74,19 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
74 | IConfig estateConfig = config.Configs["Estates"]; | 74 | IConfig estateConfig = config.Configs["Estates"]; |
75 | if (estateConfig != null) | 75 | if (estateConfig != null) |
76 | { | 76 | { |
77 | if (estateConfig.GetString("EstateCommunicationsHandler", Name) == Name) | 77 | if (estateConfig.GetString("EstateCommunicationsHandler", Name) == Name) |
78 | m_enabled = true; | 78 | m_enabled = true; |
79 | else | 79 | else |
80 | return; | 80 | return; |
81 | 81 | ||
82 | port = (uint)estateConfig.GetInt("Port", 0); | 82 | port = (uint)estateConfig.GetInt("Port", 0); |
83 | // this will need to came from somewhere else | 83 | // this will need to came from somewhere else |
84 | token = estateConfig.GetString("Token", token); | 84 | token = estateConfig.GetString("Token", token); |
85 | } | 85 | } |
86 | else | 86 | else |
87 | { | 87 | { |
88 | m_enabled = true; | 88 | m_enabled = true; |
89 | } | 89 | } |
90 | 90 | ||
91 | m_EstateConnector = new EstateConnector(this, token, port); | 91 | m_EstateConnector = new EstateConnector(this, token, port); |
92 | 92 | ||
@@ -108,8 +108,8 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
108 | 108 | ||
109 | public void AddRegion(Scene scene) | 109 | public void AddRegion(Scene scene) |
110 | { | 110 | { |
111 | if (!m_enabled) | 111 | if (!m_enabled) |
112 | return; | 112 | return; |
113 | 113 | ||
114 | lock (m_Scenes) | 114 | lock (m_Scenes) |
115 | m_Scenes.Add(scene); | 115 | m_Scenes.Add(scene); |
@@ -117,8 +117,8 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
117 | 117 | ||
118 | public void RegionLoaded(Scene scene) | 118 | public void RegionLoaded(Scene scene) |
119 | { | 119 | { |
120 | if (!m_enabled) | 120 | if (!m_enabled) |
121 | return; | 121 | return; |
122 | 122 | ||
123 | IEstateModule em = scene.RequestModuleInterface<IEstateModule>(); | 123 | IEstateModule em = scene.RequestModuleInterface<IEstateModule>(); |
124 | 124 | ||
@@ -131,8 +131,8 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
131 | 131 | ||
132 | public void RemoveRegion(Scene scene) | 132 | public void RemoveRegion(Scene scene) |
133 | { | 133 | { |
134 | if (!m_enabled) | 134 | if (!m_enabled) |
135 | return; | 135 | return; |
136 | 136 | ||
137 | lock (m_Scenes) | 137 | lock (m_Scenes) |
138 | m_Scenes.Remove(scene); | 138 | m_Scenes.Remove(scene); |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs index 9de88d9..e4c0373 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs | |||
@@ -51,7 +51,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
51 | public const int LAND_SELECT_OBJECTS_GROUP = 4; | 51 | public const int LAND_SELECT_OBJECTS_GROUP = 4; |
52 | public const int LAND_SELECT_OBJECTS_OTHER = 8; | 52 | public const int LAND_SELECT_OBJECTS_OTHER = 8; |
53 | 53 | ||
54 | 54 | ||
55 | public const byte LAND_TYPE_PUBLIC = 0; //Equals 00000000 | 55 | public const byte LAND_TYPE_PUBLIC = 0; //Equals 00000000 |
56 | // types 1 to 7 are exclusive | 56 | // types 1 to 7 are exclusive |
57 | public const byte LAND_TYPE_OWNED_BY_OTHER = 1; //Equals 00000001 | 57 | public const byte LAND_TYPE_OWNED_BY_OTHER = 1; //Equals 00000001 |
@@ -75,7 +75,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
75 | #endregion | 75 | #endregion |
76 | 76 | ||
77 | private readonly Scene m_scene; | 77 | private readonly Scene m_scene; |
78 | private readonly LandManagementModule m_landManagementModule; | 78 | private readonly LandManagementModule m_landManagementModule; |
79 | 79 | ||
80 | public LandChannel(Scene scene, LandManagementModule landManagementMod) | 80 | public LandChannel(Scene scene, LandManagementModule landManagementMod) |
81 | { | 81 | { |
@@ -91,7 +91,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
91 | { | 91 | { |
92 | return m_landManagementModule.GetLandObject(x_float, y_float); | 92 | return m_landManagementModule.GetLandObject(x_float, y_float); |
93 | } | 93 | } |
94 | 94 | ||
95 | ILandObject obj = new LandObject(UUID.Zero, false, m_scene); | 95 | ILandObject obj = new LandObject(UUID.Zero, false, m_scene); |
96 | obj.LandData.Name = "NO LAND"; | 96 | obj.LandData.Name = "NO LAND"; |
97 | return obj; | 97 | return obj; |
@@ -117,7 +117,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
117 | { | 117 | { |
118 | return m_landManagementModule.GetLandObject(x, y); | 118 | return m_landManagementModule.GetLandObject(x, y); |
119 | } | 119 | } |
120 | 120 | ||
121 | ILandObject obj = new LandObject(UUID.Zero, false, m_scene); | 121 | ILandObject obj = new LandObject(UUID.Zero, false, m_scene); |
122 | obj.LandData.Name = "NO LAND"; | 122 | obj.LandData.Name = "NO LAND"; |
123 | return obj; | 123 | return obj; |
@@ -132,7 +132,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
132 | 132 | ||
133 | return new List<ILandObject>(); | 133 | return new List<ILandObject>(); |
134 | } | 134 | } |
135 | 135 | ||
136 | public void Clear(bool setupDefaultParcel) | 136 | public void Clear(bool setupDefaultParcel) |
137 | { | 137 | { |
138 | if (m_landManagementModule != null) | 138 | if (m_landManagementModule != null) |
@@ -182,7 +182,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
182 | m_landManagementModule.Subdivide(start_x, start_y, end_x, end_y, attempting_user_id); | 182 | m_landManagementModule.Subdivide(start_x, start_y, end_x, end_y, attempting_user_id); |
183 | } | 183 | } |
184 | } | 184 | } |
185 | 185 | ||
186 | public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) | 186 | public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) |
187 | { | 187 | { |
188 | if (m_landManagementModule != null) | 188 | if (m_landManagementModule != null) |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 22bc49e..63b8de0 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -52,7 +52,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; | |||
52 | namespace OpenSim.Region.CoreModules.World.Land | 52 | namespace OpenSim.Region.CoreModules.World.Land |
53 | { | 53 | { |
54 | // used for caching | 54 | // used for caching |
55 | internal class ExtendedLandData | 55 | internal class ExtendedLandData |
56 | { | 56 | { |
57 | public LandData LandData; | 57 | public LandData LandData; |
58 | public ulong RegionHandle; | 58 | public ulong RegionHandle; |
@@ -151,9 +151,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
151 | 151 | ||
152 | m_scene.EventManager.OnParcelPrimCountAdd += EventManagerOnParcelPrimCountAdd; | 152 | m_scene.EventManager.OnParcelPrimCountAdd += EventManagerOnParcelPrimCountAdd; |
153 | m_scene.EventManager.OnParcelPrimCountUpdate += EventManagerOnParcelPrimCountUpdate; | 153 | m_scene.EventManager.OnParcelPrimCountUpdate += EventManagerOnParcelPrimCountUpdate; |
154 | m_scene.EventManager.OnObjectBeingRemovedFromScene += EventManagerOnObjectBeingRemovedFromScene; | 154 | m_scene.EventManager.OnObjectBeingRemovedFromScene += EventManagerOnObjectBeingRemovedFromScene; |
155 | m_scene.EventManager.OnRequestParcelPrimCountUpdate += EventManagerOnRequestParcelPrimCountUpdate; | 155 | m_scene.EventManager.OnRequestParcelPrimCountUpdate += EventManagerOnRequestParcelPrimCountUpdate; |
156 | 156 | ||
157 | m_scene.EventManager.OnAvatarEnteringNewParcel += EventManagerOnAvatarEnteringNewParcel; | 157 | m_scene.EventManager.OnAvatarEnteringNewParcel += EventManagerOnAvatarEnteringNewParcel; |
158 | m_scene.EventManager.OnClientMovement += EventManagerOnClientMovement; | 158 | m_scene.EventManager.OnClientMovement += EventManagerOnClientMovement; |
159 | m_scene.EventManager.OnValidateLandBuy += EventManagerOnValidateLandBuy; | 159 | m_scene.EventManager.OnValidateLandBuy += EventManagerOnValidateLandBuy; |
@@ -163,14 +163,14 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
163 | m_scene.EventManager.OnSignificantClientMovement += EventManagerOnSignificantClientMovement; | 163 | m_scene.EventManager.OnSignificantClientMovement += EventManagerOnSignificantClientMovement; |
164 | m_scene.EventManager.OnNoticeNoLandDataFromStorage += EventManagerOnNoLandDataFromStorage; | 164 | m_scene.EventManager.OnNoticeNoLandDataFromStorage += EventManagerOnNoLandDataFromStorage; |
165 | m_scene.EventManager.OnIncomingLandDataFromStorage += EventManagerOnIncomingLandDataFromStorage; | 165 | m_scene.EventManager.OnIncomingLandDataFromStorage += EventManagerOnIncomingLandDataFromStorage; |
166 | m_scene.EventManager.OnSetAllowForcefulBan += EventManagerOnSetAllowedForcefulBan; | 166 | m_scene.EventManager.OnSetAllowForcefulBan += EventManagerOnSetAllowedForcefulBan; |
167 | m_scene.EventManager.OnRegisterCaps += EventManagerOnRegisterCaps; | 167 | m_scene.EventManager.OnRegisterCaps += EventManagerOnRegisterCaps; |
168 | 168 | ||
169 | lock (m_scene) | 169 | lock (m_scene) |
170 | { | 170 | { |
171 | m_scene.LandChannel = (ILandChannel)landChannel; | 171 | m_scene.LandChannel = (ILandChannel)landChannel; |
172 | } | 172 | } |
173 | 173 | ||
174 | RegisterCommands(); | 174 | RegisterCommands(); |
175 | } | 175 | } |
176 | 176 | ||
@@ -183,8 +183,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
183 | } | 183 | } |
184 | 184 | ||
185 | public void RemoveRegion(Scene scene) | 185 | public void RemoveRegion(Scene scene) |
186 | { | 186 | { |
187 | // TODO: Release event manager listeners here | 187 | // TODO: Release event manager listeners here |
188 | } | 188 | } |
189 | 189 | ||
190 | // private bool OnVerifyUserConnection(ScenePresence scenePresence, out string reason) | 190 | // private bool OnVerifyUserConnection(ScenePresence scenePresence, out string reason) |
@@ -192,7 +192,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
192 | // ILandObject nearestParcel = m_scene.GetNearestAllowedParcel(scenePresence.UUID, scenePresence.AbsolutePosition.X, scenePresence.AbsolutePosition.Y); | 192 | // ILandObject nearestParcel = m_scene.GetNearestAllowedParcel(scenePresence.UUID, scenePresence.AbsolutePosition.X, scenePresence.AbsolutePosition.Y); |
193 | // reason = "You are not allowed to enter this sim."; | 193 | // reason = "You are not allowed to enter this sim."; |
194 | // return nearestParcel != null; | 194 | // return nearestParcel != null; |
195 | // } | 195 | // } |
196 | 196 | ||
197 | void EventManagerOnNewClient(IClientAPI client) | 197 | void EventManagerOnNewClient(IClientAPI client) |
198 | { | 198 | { |
@@ -274,7 +274,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
274 | m_landIDList = new int[m_scene.RegionInfo.RegionSizeX / LandUnit, m_scene.RegionInfo.RegionSizeY / LandUnit]; | 274 | m_landIDList = new int[m_scene.RegionInfo.RegionSizeX / LandUnit, m_scene.RegionInfo.RegionSizeY / LandUnit]; |
275 | } | 275 | } |
276 | } | 276 | } |
277 | 277 | ||
278 | /// <summary> | 278 | /// <summary> |
279 | /// Create a default parcel that spans the entire region and is owned by the estate owner. | 279 | /// Create a default parcel that spans the entire region and is owned by the estate owner. |
280 | /// </summary> | 280 | /// </summary> |
@@ -360,7 +360,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
360 | return false; | 360 | return false; |
361 | } | 361 | } |
362 | } | 362 | } |
363 | 363 | ||
364 | if(ban) | 364 | if(ban) |
365 | { | 365 | { |
366 | if (!forcedPosition.Contains(avatar.UUID)) | 366 | if (!forcedPosition.Contains(avatar.UUID)) |
@@ -581,13 +581,13 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
581 | /// Adds a land object to the stored list and adds them to the landIDList to what they own | 581 | /// Adds a land object to the stored list and adds them to the landIDList to what they own |
582 | /// </summary> | 582 | /// </summary> |
583 | /// <param name="new_land"> | 583 | /// <param name="new_land"> |
584 | /// The land object being added. | 584 | /// The land object being added. |
585 | /// Will return null if this overlaps with an existing parcel that has not had its bitmap adjusted. | 585 | /// Will return null if this overlaps with an existing parcel that has not had its bitmap adjusted. |
586 | /// </param> | 586 | /// </param> |
587 | public ILandObject AddLandObject(ILandObject land) | 587 | public ILandObject AddLandObject(ILandObject land) |
588 | { | 588 | { |
589 | ILandObject new_land = land.Copy(); | 589 | ILandObject new_land = land.Copy(); |
590 | 590 | ||
591 | // Only now can we add the prim counts to the land object - we rely on the global ID which is generated | 591 | // Only now can we add the prim counts to the land object - we rely on the global ID which is generated |
592 | // as a random UUID inside LandData initialization | 592 | // as a random UUID inside LandData initialization |
593 | if (m_primCountModule != null) | 593 | if (m_primCountModule != null) |
@@ -607,7 +607,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
607 | } | 607 | } |
608 | else | 608 | else |
609 | { | 609 | { |
610 | // If other land objects still believe that they occupy any parts of the same space, | 610 | // If other land objects still believe that they occupy any parts of the same space, |
611 | // then do not allow the add to proceed. | 611 | // then do not allow the add to proceed. |
612 | for (int x = 0; x < landBitmap.GetLength(0); x++) | 612 | for (int x = 0; x < landBitmap.GetLength(0); x++) |
613 | { | 613 | { |
@@ -642,7 +642,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
642 | if (landBitmap[x, y]) | 642 | if (landBitmap[x, y]) |
643 | { | 643 | { |
644 | // m_log.DebugFormat( | 644 | // m_log.DebugFormat( |
645 | // "[LAND MANAGEMENT MODULE]: Registering parcel {0} for land co-ord ({1}, {2}) on {3}", | 645 | // "[LAND MANAGEMENT MODULE]: Registering parcel {0} for land co-ord ({1}, {2}) on {3}", |
646 | // new_land.LandData.Name, x, y, m_scene.RegionInfo.RegionName); | 646 | // new_land.LandData.Name, x, y, m_scene.RegionInfo.RegionName); |
647 | 647 | ||
648 | m_landIDList[x, y] = newLandLocalID; | 648 | m_landIDList[x, y] = newLandLocalID; |
@@ -690,10 +690,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
690 | 690 | ||
691 | m_scene.EventManager.TriggerLandObjectRemoved(land.LandData.GlobalID); | 691 | m_scene.EventManager.TriggerLandObjectRemoved(land.LandData.GlobalID); |
692 | } | 692 | } |
693 | 693 | ||
694 | /// <summary> | 694 | /// <summary> |
695 | /// Clear the scene of all parcels | 695 | /// Clear the scene of all parcels |
696 | /// </summary> | 696 | /// </summary> |
697 | public void Clear(bool setupDefaultParcel) | 697 | public void Clear(bool setupDefaultParcel) |
698 | { | 698 | { |
699 | Dictionary<int, ILandObject> landworkList; | 699 | Dictionary<int, ILandObject> landworkList; |
@@ -1077,7 +1077,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1077 | 1077 | ||
1078 | if(maxindex < 0 || selectedLandObjects.Count < 2) | 1078 | if(maxindex < 0 || selectedLandObjects.Count < 2) |
1079 | return; | 1079 | return; |
1080 | 1080 | ||
1081 | ILandObject masterLandObject = selectedLandObjects[maxindex]; | 1081 | ILandObject masterLandObject = selectedLandObjects[maxindex]; |
1082 | selectedLandObjects.RemoveAt(maxindex); | 1082 | selectedLandObjects.RemoveAt(maxindex); |
1083 | 1083 | ||
@@ -1146,7 +1146,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1146 | 1146 | ||
1147 | if (currentParcelBlock != null) | 1147 | if (currentParcelBlock != null) |
1148 | { | 1148 | { |
1149 | // types | 1149 | // types |
1150 | if (currentParcelBlock.LandData.OwnerID == remote_client.AgentId) | 1150 | if (currentParcelBlock.LandData.OwnerID == remote_client.AgentId) |
1151 | { | 1151 | { |
1152 | //Owner Flag | 1152 | //Owner Flag |
@@ -1165,7 +1165,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1165 | } | 1165 | } |
1166 | else if (currentParcelBlock.LandData.OwnerID == UUID.Zero) | 1166 | else if (currentParcelBlock.LandData.OwnerID == UUID.Zero) |
1167 | { | 1167 | { |
1168 | //Public type | 1168 | //Public type |
1169 | tempByte = (byte)LandChannel.LAND_TYPE_PUBLIC; // this does nothing, its zero | 1169 | tempByte = (byte)LandChannel.LAND_TYPE_PUBLIC; // this does nothing, its zero |
1170 | } | 1170 | } |
1171 | // LAND_TYPE_IS_BEING_AUCTIONED still unsuported | 1171 | // LAND_TYPE_IS_BEING_AUCTIONED still unsuported |
@@ -1402,7 +1402,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1402 | land.LandData.GroupID = UUID.Zero; | 1402 | land.LandData.GroupID = UUID.Zero; |
1403 | land.LandData.IsGroupOwned = false; | 1403 | land.LandData.IsGroupOwned = false; |
1404 | land.LandData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory); | 1404 | land.LandData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory); |
1405 | 1405 | ||
1406 | m_scene.ForEachClient(SendParcelOverlay); | 1406 | m_scene.ForEachClient(SendParcelOverlay); |
1407 | land.SendLandUpdateToClient(true, remote_client); | 1407 | land.SendLandUpdateToClient(true, remote_client); |
1408 | UpdateLandObject(land.LandData.LocalID, land.LandData); | 1408 | UpdateLandObject(land.LandData.LocalID, land.LandData); |
@@ -1584,7 +1584,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1584 | ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene); | 1584 | ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene); |
1585 | new_land.LandData = data.Copy(); | 1585 | new_land.LandData = data.Copy(); |
1586 | 1586 | ||
1587 | new_land.SetLandBitmapFromByteArray(); | 1587 | new_land.SetLandBitmapFromByteArray(); |
1588 | AddLandObject(new_land); | 1588 | AddLandObject(new_land); |
1589 | // new_land.SendLandUpdateToAvatarsOverMe(); | 1589 | // new_land.SendLandUpdateToAvatarsOverMe(); |
1590 | } | 1590 | } |
@@ -1599,7 +1599,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1599 | m_landList.TryGetValue(localID, out selectedParcel); | 1599 | m_landList.TryGetValue(localID, out selectedParcel); |
1600 | } | 1600 | } |
1601 | 1601 | ||
1602 | if (selectedParcel == null) | 1602 | if (selectedParcel == null) |
1603 | return; | 1603 | return; |
1604 | 1604 | ||
1605 | selectedParcel.ReturnLandObjects(returnType, agentIDs, taskIDs, remoteClient); | 1605 | selectedParcel.ReturnLandObjects(returnType, agentIDs, taskIDs, remoteClient); |
@@ -1706,7 +1706,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1706 | private string ProcessPropertiesUpdate(string request, string path, string param, UUID agentID, Caps caps) | 1706 | private string ProcessPropertiesUpdate(string request, string path, string param, UUID agentID, Caps caps) |
1707 | { | 1707 | { |
1708 | IClientAPI client; | 1708 | IClientAPI client; |
1709 | if (!m_scene.TryGetClient(agentID, out client)) | 1709 | if (!m_scene.TryGetClient(agentID, out client)) |
1710 | { | 1710 | { |
1711 | m_log.WarnFormat("[LAND MANAGEMENT MODULE]: Unable to retrieve IClientAPI for {0}", agentID); | 1711 | m_log.WarnFormat("[LAND MANAGEMENT MODULE]: Unable to retrieve IClientAPI for {0}", agentID); |
1712 | return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty()); | 1712 | return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty()); |
@@ -1765,7 +1765,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1765 | 1765 | ||
1766 | if (land != null) | 1766 | if (land != null) |
1767 | { | 1767 | { |
1768 | UpdateLandProperties(land,land_update, client); | 1768 | UpdateLandProperties(land,land_update, client); |
1769 | m_scene.EventManager.TriggerOnParcelPropertiesUpdateRequest(land_update, parcelID, client); | 1769 | m_scene.EventManager.TriggerOnParcelPropertiesUpdateRequest(land_update, parcelID, client); |
1770 | } | 1770 | } |
1771 | else | 1771 | else |
@@ -2103,7 +2103,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
2103 | targetAvatar.TeleportWithMomentum(pos, null); | 2103 | targetAvatar.TeleportWithMomentum(pos, null); |
2104 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname); | 2104 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname); |
2105 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected."); | 2105 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected."); |
2106 | 2106 | ||
2107 | if ((flags & 1) != 0) // Ban TODO: Remove magic number | 2107 | if ((flags & 1) != 0) // Ban TODO: Remove magic number |
2108 | { | 2108 | { |
2109 | LandAccessEntry entry = new LandAccessEntry(); | 2109 | LandAccessEntry entry = new LandAccessEntry(); |
@@ -2144,7 +2144,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
2144 | if (// Required: local user; foreign users cannot set home | 2144 | if (// Required: local user; foreign users cannot set home |
2145 | m_scene.UserManagementModule.IsLocalGridUser(remoteClient.AgentId) && | 2145 | m_scene.UserManagementModule.IsLocalGridUser(remoteClient.AgentId) && |
2146 | (// (a) gods and land managers can set home | 2146 | (// (a) gods and land managers can set home |
2147 | m_scene.Permissions.IsAdministrator(remoteClient.AgentId) || | 2147 | m_scene.Permissions.IsAdministrator(remoteClient.AgentId) || |
2148 | m_scene.Permissions.IsGod(remoteClient.AgentId) || | 2148 | m_scene.Permissions.IsGod(remoteClient.AgentId) || |
2149 | // (b) land owners can set home | 2149 | // (b) land owners can set home |
2150 | remoteClient.AgentId == land.LandData.OwnerID || | 2150 | remoteClient.AgentId == land.LandData.OwnerID || |
@@ -2196,8 +2196,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
2196 | "If no local land ID is given, then summary information about all the parcels is shown.\n" | 2196 | "If no local land ID is given, then summary information about all the parcels is shown.\n" |
2197 | + "If a local land ID is given then full information about that parcel is shown.", | 2197 | + "If a local land ID is given then full information about that parcel is shown.", |
2198 | HandleShowCommand); | 2198 | HandleShowCommand); |
2199 | } | 2199 | } |
2200 | 2200 | ||
2201 | protected void HandleClearCommand(string module, string[] args) | 2201 | protected void HandleClearCommand(string module, string[] args) |
2202 | { | 2202 | { |
2203 | if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene)) | 2203 | if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene)) |
@@ -2205,9 +2205,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
2205 | 2205 | ||
2206 | string response = MainConsole.Instance.CmdPrompt( | 2206 | string response = MainConsole.Instance.CmdPrompt( |
2207 | string.Format( | 2207 | string.Format( |
2208 | "Are you sure that you want to clear all land parcels from {0} (y or n)", m_scene.Name), | 2208 | "Are you sure that you want to clear all land parcels from {0} (y or n)", m_scene.Name), |
2209 | "n"); | 2209 | "n"); |
2210 | 2210 | ||
2211 | if (response.ToLower() == "y") | 2211 | if (response.ToLower() == "y") |
2212 | { | 2212 | { |
2213 | Clear(true); | 2213 | Clear(true); |
@@ -2217,14 +2217,14 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
2217 | { | 2217 | { |
2218 | MainConsole.Instance.OutputFormat("Aborting clear of all parcels from {0}", m_scene.Name); | 2218 | MainConsole.Instance.OutputFormat("Aborting clear of all parcels from {0}", m_scene.Name); |
2219 | } | 2219 | } |
2220 | } | 2220 | } |
2221 | 2221 | ||
2222 | protected void HandleShowCommand(string module, string[] args) | 2222 | protected void HandleShowCommand(string module, string[] args) |
2223 | { | 2223 | { |
2224 | if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene)) | 2224 | if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene)) |
2225 | return; | 2225 | return; |
2226 | 2226 | ||
2227 | StringBuilder report = new StringBuilder(); | 2227 | StringBuilder report = new StringBuilder(); |
2228 | 2228 | ||
2229 | if (args.Length <= 2) | 2229 | if (args.Length <= 2) |
2230 | { | 2230 | { |
@@ -2240,7 +2240,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
2240 | ILandObject lo; | 2240 | ILandObject lo; |
2241 | 2241 | ||
2242 | lock (m_landList) | 2242 | lock (m_landList) |
2243 | { | 2243 | { |
2244 | if (!m_landList.TryGetValue(landLocalId, out lo)) | 2244 | if (!m_landList.TryGetValue(landLocalId, out lo)) |
2245 | { | 2245 | { |
2246 | MainConsole.Instance.OutputFormat("No parcel found with local ID {0}", landLocalId); | 2246 | MainConsole.Instance.OutputFormat("No parcel found with local ID {0}", landLocalId); |
@@ -2265,7 +2265,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
2265 | cdt.AddColumn("Starts", ConsoleDisplayUtil.VectorSize); | 2265 | cdt.AddColumn("Starts", ConsoleDisplayUtil.VectorSize); |
2266 | cdt.AddColumn("Ends", ConsoleDisplayUtil.VectorSize); | 2266 | cdt.AddColumn("Ends", ConsoleDisplayUtil.VectorSize); |
2267 | cdt.AddColumn("Owner", ConsoleDisplayUtil.UserNameSize); | 2267 | cdt.AddColumn("Owner", ConsoleDisplayUtil.UserNameSize); |
2268 | 2268 | ||
2269 | lock (m_landList) | 2269 | lock (m_landList) |
2270 | { | 2270 | { |
2271 | foreach (ILandObject lo in m_landList.Values) | 2271 | foreach (ILandObject lo in m_landList.Values) |
@@ -2316,7 +2316,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
2316 | cdl.AddRow("GroupID", ld.GroupID); | 2316 | cdl.AddRow("GroupID", ld.GroupID); |
2317 | 2317 | ||
2318 | cdl.AddRow("Status", ld.Status); | 2318 | cdl.AddRow("Status", ld.Status); |
2319 | cdl.AddRow("Flags", (ParcelFlags)ld.Flags); | 2319 | cdl.AddRow("Flags", (ParcelFlags)ld.Flags); |
2320 | 2320 | ||
2321 | cdl.AddRow("Landing Type", (LandingType)ld.LandingType); | 2321 | cdl.AddRow("Landing Type", (LandingType)ld.LandingType); |
2322 | cdl.AddRow("User Location", ld.UserLocation); | 2322 | cdl.AddRow("User Location", ld.UserLocation); |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 4cbc8b8..fc2282d 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -75,7 +75,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
75 | return free; | 75 | return free; |
76 | } | 76 | } |
77 | 77 | ||
78 | protected LandData m_landData; | 78 | protected LandData m_landData; |
79 | public LandData LandData | 79 | public LandData LandData |
80 | { | 80 | { |
81 | get { return m_landData; } | 81 | get { return m_landData; } |
@@ -196,7 +196,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
196 | else if(testpos.Y >= maxy) | 196 | else if(testpos.Y >= maxy) |
197 | return null; // will never get there | 197 | return null; // will never get there |
198 | } | 198 | } |
199 | 199 | ||
200 | while(!LandBitmap[(int)testpos.X, (int)testpos.Y]) | 200 | while(!LandBitmap[(int)testpos.X, (int)testpos.Y]) |
201 | { | 201 | { |
202 | testpos += direction; | 202 | testpos += direction; |
@@ -278,14 +278,14 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
278 | else | 278 | else |
279 | LandBitmap = new bool[m_scene.RegionInfo.RegionSizeX / landUnit, m_scene.RegionInfo.RegionSizeY / landUnit]; | 279 | LandBitmap = new bool[m_scene.RegionInfo.RegionSizeX / landUnit, m_scene.RegionInfo.RegionSizeY / landUnit]; |
280 | 280 | ||
281 | LandData = new LandData(); | 281 | LandData = new LandData(); |
282 | LandData.OwnerID = owner_id; | 282 | LandData.OwnerID = owner_id; |
283 | if (is_group_owned) | 283 | if (is_group_owned) |
284 | LandData.GroupID = owner_id; | 284 | LandData.GroupID = owner_id; |
285 | else | 285 | else |
286 | LandData.GroupID = UUID.Zero; | 286 | LandData.GroupID = UUID.Zero; |
287 | LandData.IsGroupOwned = is_group_owned; | 287 | LandData.IsGroupOwned = is_group_owned; |
288 | 288 | ||
289 | m_scene.EventManager.OnFrame += OnFrame; | 289 | m_scene.EventManager.OnFrame += OnFrame; |
290 | } | 290 | } |
291 | 291 | ||
@@ -294,7 +294,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
294 | #region Member Functions | 294 | #region Member Functions |
295 | 295 | ||
296 | #region General Functions | 296 | #region General Functions |
297 | 297 | ||
298 | /// <summary> | 298 | /// <summary> |
299 | /// Checks to see if this land object contains a point | 299 | /// Checks to see if this land object contains a point |
300 | /// </summary> | 300 | /// </summary> |
@@ -373,12 +373,12 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
373 | 373 | ||
374 | if(simMax > m_scene.RegionInfo.ObjectCapacity) | 374 | if(simMax > m_scene.RegionInfo.ObjectCapacity) |
375 | simMax = m_scene.RegionInfo.ObjectCapacity; | 375 | simMax = m_scene.RegionInfo.ObjectCapacity; |
376 | //m_log.DebugFormat("Simwide Area: {0}, Capacity {1}, SimMax {2}, SimWidePrims {3}", | 376 | //m_log.DebugFormat("Simwide Area: {0}, Capacity {1}, SimMax {2}, SimWidePrims {3}", |
377 | // LandData.SimwideArea, m_scene.RegionInfo.ObjectCapacity, simMax, LandData.SimwidePrims); | 377 | // LandData.SimwideArea, m_scene.RegionInfo.ObjectCapacity, simMax, LandData.SimwidePrims); |
378 | return simMax; | 378 | return simMax; |
379 | } | 379 | } |
380 | } | 380 | } |
381 | 381 | ||
382 | #endregion | 382 | #endregion |
383 | 383 | ||
384 | #region Packet Request Handling | 384 | #region Packet Request Handling |
@@ -552,7 +552,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
552 | needOverlay = true; | 552 | needOverlay = true; |
553 | 553 | ||
554 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); | 554 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); |
555 | return true; | 555 | return true; |
556 | } | 556 | } |
557 | return false; | 557 | return false; |
558 | } | 558 | } |
@@ -720,11 +720,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
720 | 720 | ||
721 | if(sp==null || !sp.isNPC) | 721 | if(sp==null || !sp.isNPC) |
722 | return true; | 722 | return true; |
723 | 723 | ||
724 | INPC npccli = (INPC)sp.ControllingClient; | 724 | INPC npccli = (INPC)sp.ControllingClient; |
725 | if(npccli== null) | 725 | if(npccli== null) |
726 | return true; | 726 | return true; |
727 | 727 | ||
728 | UUID owner = npccli.Owner; | 728 | UUID owner = npccli.Owner; |
729 | 729 | ||
730 | if(owner == UUID.Zero) | 730 | if(owner == UUID.Zero) |
@@ -898,7 +898,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
898 | // update use lists flags | 898 | // update use lists flags |
899 | // rights already checked or we wont be here | 899 | // rights already checked or we wont be here |
900 | uint parcelflags = newData.Flags; | 900 | uint parcelflags = newData.Flags; |
901 | 901 | ||
902 | if((flags & (uint)AccessList.Access) != 0) | 902 | if((flags & (uint)AccessList.Access) != 0) |
903 | parcelflags |= (uint)ParcelFlags.UseAccessList; | 903 | parcelflags |= (uint)ParcelFlags.UseAccessList; |
904 | if((flags & (uint)AccessList.Ban) != 0) | 904 | if((flags & (uint)AccessList.Ban) != 0) |
@@ -1024,7 +1024,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1024 | LandData.AABBMin = new Vector3(tx, ty, 0f); | 1024 | LandData.AABBMin = new Vector3(tx, ty, 0f); |
1025 | else | 1025 | else |
1026 | LandData.AABBMin = new Vector3(tx, ty, (float)m_scene.Heightmap[tx, ty]); | 1026 | LandData.AABBMin = new Vector3(tx, ty, (float)m_scene.Heightmap[tx, ty]); |
1027 | 1027 | ||
1028 | max_x++; | 1028 | max_x++; |
1029 | tx = max_x * landUnit; | 1029 | tx = max_x * landUnit; |
1030 | if (tx > regionSizeX) | 1030 | if (tx > regionSizeX) |
@@ -1042,7 +1042,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1042 | LandData.AABBMax = new Vector3(tx, ty, 0f); | 1042 | LandData.AABBMax = new Vector3(tx, ty, 0f); |
1043 | else | 1043 | else |
1044 | LandData.AABBMax = new Vector3(tx, ty, (float)m_scene.Heightmap[tx - 1, ty - 1]); | 1044 | LandData.AABBMax = new Vector3(tx, ty, (float)m_scene.Heightmap[tx - 1, ty - 1]); |
1045 | 1045 | ||
1046 | LandData.Area = tempArea * landUnit * landUnit; | 1046 | LandData.Area = tempArea * landUnit * landUnit; |
1047 | } | 1047 | } |
1048 | 1048 | ||
@@ -1073,7 +1073,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1073 | { | 1073 | { |
1074 | return GetSquareLandBitmap(0, 0, (int)m_scene.RegionInfo.RegionSizeX, (int) m_scene.RegionInfo.RegionSizeY, true); | 1074 | return GetSquareLandBitmap(0, 0, (int)m_scene.RegionInfo.RegionSizeX, (int) m_scene.RegionInfo.RegionSizeY, true); |
1075 | } | 1075 | } |
1076 | 1076 | ||
1077 | public bool[,] GetSquareLandBitmap(int start_x, int start_y, int end_x, int end_y, bool set_value = true) | 1077 | public bool[,] GetSquareLandBitmap(int start_x, int start_y, int end_x, int end_y, bool set_value = true) |
1078 | { | 1078 | { |
1079 | // Empty bitmap for the whole region | 1079 | // Empty bitmap for the whole region |
@@ -1317,7 +1317,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1317 | /// <param name="isEmptyNow">out: This is set if the resultant bitmap is now empty</param> | 1317 | /// <param name="isEmptyNow">out: This is set if the resultant bitmap is now empty</param> |
1318 | /// <param name="AABBMin">out: parcel.AABBMin <x,y,0></param> | 1318 | /// <param name="AABBMin">out: parcel.AABBMin <x,y,0></param> |
1319 | /// <param name="AABBMax">out: parcel.AABBMax <x,y,0></param> | 1319 | /// <param name="AABBMax">out: parcel.AABBMax <x,y,0></param> |
1320 | /// <returns>New parcel bitmap</returns> | 1320 | /// <returns>New parcel bitmap</returns> |
1321 | public bool[,] RemoveFromLandBitmap(bool[,] bitmap_base, bool[,] bitmap_new, out bool isEmptyNow, out Vector3 AABBMin, out Vector3 AABBMax) | 1321 | public bool[,] RemoveFromLandBitmap(bool[,] bitmap_base, bool[,] bitmap_new, out bool isEmptyNow, out Vector3 AABBMin, out Vector3 AABBMax) |
1322 | { | 1322 | { |
1323 | // get the size of the incoming bitmaps | 1323 | // get the size of the incoming bitmaps |
@@ -1409,7 +1409,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1409 | // Importing land parcel data from an OAR where the source region is a different size to the dest region requires us | 1409 | // Importing land parcel data from an OAR where the source region is a different size to the dest region requires us |
1410 | // to make a LandBitmap that's not derived from the current region's size. We use the LandData.Bitmap size in bytes | 1410 | // to make a LandBitmap that's not derived from the current region's size. We use the LandData.Bitmap size in bytes |
1411 | // to figure out what the OAR's region dimensions are. (Is there a better way to get the src region x and y from the OAR?) | 1411 | // to figure out what the OAR's region dimensions are. (Is there a better way to get the src region x and y from the OAR?) |
1412 | // This method assumes we always will have square regions | 1412 | // This method assumes we always will have square regions |
1413 | 1413 | ||
1414 | bitmapLen = LandData.Bitmap.Length; | 1414 | bitmapLen = LandData.Bitmap.Length; |
1415 | xLen = (int)Math.Abs(Math.Sqrt(bitmapLen * 8)); | 1415 | xLen = (int)Math.Abs(Math.Sqrt(bitmapLen * 8)); |
@@ -1550,9 +1550,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1550 | lock (primsOverMe) | 1550 | lock (primsOverMe) |
1551 | { | 1551 | { |
1552 | // m_log.DebugFormat( | 1552 | // m_log.DebugFormat( |
1553 | // "[LAND OBJECT]: Request for SendLandObjectOwners() from {0} with {1} known prims on region", | 1553 | // "[LAND OBJECT]: Request for SendLandObjectOwners() from {0} with {1} known prims on region", |
1554 | // remote_client.Name, primsOverMe.Count); | 1554 | // remote_client.Name, primsOverMe.Count); |
1555 | 1555 | ||
1556 | try | 1556 | try |
1557 | { | 1557 | { |
1558 | foreach (SceneObjectGroup obj in primsOverMe) | 1558 | foreach (SceneObjectGroup obj in primsOverMe) |
@@ -1593,7 +1593,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1593 | public Dictionary<UUID, int> GetLandObjectOwners() | 1593 | public Dictionary<UUID, int> GetLandObjectOwners() |
1594 | { | 1594 | { |
1595 | Dictionary<UUID, int> ownersAndCount = new Dictionary<UUID, int>(); | 1595 | Dictionary<UUID, int> ownersAndCount = new Dictionary<UUID, int>(); |
1596 | 1596 | ||
1597 | lock (primsOverMe) | 1597 | lock (primsOverMe) |
1598 | { | 1598 | { |
1599 | try | 1599 | try |
@@ -1669,7 +1669,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1669 | { | 1669 | { |
1670 | // m_log.DebugFormat( | 1670 | // m_log.DebugFormat( |
1671 | // "[LAND OBJECT]: Request to return objects in {0} from {1}", LandData.Name, remote_client.Name); | 1671 | // "[LAND OBJECT]: Request to return objects in {0} from {1}", LandData.Name, remote_client.Name); |
1672 | 1672 | ||
1673 | Dictionary<UUID,List<SceneObjectGroup>> returns = new Dictionary<UUID,List<SceneObjectGroup>>(); | 1673 | Dictionary<UUID,List<SceneObjectGroup>> returns = new Dictionary<UUID,List<SceneObjectGroup>>(); |
1674 | 1674 | ||
1675 | lock (primsOverMe) | 1675 | lock (primsOverMe) |
@@ -1752,7 +1752,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1752 | public void AddPrimOverMe(SceneObjectGroup obj) | 1752 | public void AddPrimOverMe(SceneObjectGroup obj) |
1753 | { | 1753 | { |
1754 | // m_log.DebugFormat("[LAND OBJECT]: Adding scene object {0} {1} over {2}", obj.Name, obj.LocalId, LandData.Name); | 1754 | // m_log.DebugFormat("[LAND OBJECT]: Adding scene object {0} {1} over {2}", obj.Name, obj.LocalId, LandData.Name); |
1755 | 1755 | ||
1756 | lock (primsOverMe) | 1756 | lock (primsOverMe) |
1757 | primsOverMe.Add(obj); | 1757 | primsOverMe.Add(obj); |
1758 | } | 1758 | } |
@@ -1760,13 +1760,13 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1760 | public void RemovePrimFromOverMe(SceneObjectGroup obj) | 1760 | public void RemovePrimFromOverMe(SceneObjectGroup obj) |
1761 | { | 1761 | { |
1762 | // m_log.DebugFormat("[LAND OBJECT]: Removing scene object {0} {1} from over {2}", obj.Name, obj.LocalId, LandData.Name); | 1762 | // m_log.DebugFormat("[LAND OBJECT]: Removing scene object {0} {1} from over {2}", obj.Name, obj.LocalId, LandData.Name); |
1763 | 1763 | ||
1764 | lock (primsOverMe) | 1764 | lock (primsOverMe) |
1765 | primsOverMe.Remove(obj); | 1765 | primsOverMe.Remove(obj); |
1766 | } | 1766 | } |
1767 | 1767 | ||
1768 | #endregion | 1768 | #endregion |
1769 | 1769 | ||
1770 | /// <summary> | 1770 | /// <summary> |
1771 | /// Set the media url for this land parcel | 1771 | /// Set the media url for this land parcel |
1772 | /// </summary> | 1772 | /// </summary> |
@@ -1777,7 +1777,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1777 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, LandData); | 1777 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, LandData); |
1778 | SendLandUpdateToAvatarsOverMe(); | 1778 | SendLandUpdateToAvatarsOverMe(); |
1779 | } | 1779 | } |
1780 | 1780 | ||
1781 | /// <summary> | 1781 | /// <summary> |
1782 | /// Set the music url for this land parcel | 1782 | /// Set the music url for this land parcel |
1783 | /// </summary> | 1783 | /// </summary> |
@@ -1824,7 +1824,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1824 | { | 1824 | { |
1825 | LandData.ParcelAccessList.Remove(entry); | 1825 | LandData.ParcelAccessList.Remove(entry); |
1826 | ScenePresence presence; | 1826 | ScenePresence presence; |
1827 | 1827 | ||
1828 | if (m_scene.TryGetScenePresence(entry.AgentID, out presence) && (!presence.IsChildAgent)) | 1828 | if (m_scene.TryGetScenePresence(entry.AgentID, out presence) && (!presence.IsChildAgent)) |
1829 | { | 1829 | { |
1830 | ILandObject land = m_scene.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y); | 1830 | ILandObject land = m_scene.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y); |
diff --git a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs index 771fdd2..857f919 100644 --- a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs | |||
@@ -69,11 +69,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
69 | /// For now, a simple simwide taint to get this up. Later parcel based | 69 | /// For now, a simple simwide taint to get this up. Later parcel based |
70 | /// taint to allow recounting a parcel if only ownership has changed | 70 | /// taint to allow recounting a parcel if only ownership has changed |
71 | /// without recounting the whole sim. | 71 | /// without recounting the whole sim. |
72 | /// | 72 | /// |
73 | /// We start out tainted so that the first get call resets the various prim counts. | 73 | /// We start out tainted so that the first get call resets the various prim counts. |
74 | /// </value> | 74 | /// </value> |
75 | private bool m_Tainted = true; | 75 | private bool m_Tainted = true; |
76 | 76 | ||
77 | private Object m_TaintLock = new Object(); | 77 | private Object m_TaintLock = new Object(); |
78 | 78 | ||
79 | public Type ReplaceableInterface | 79 | public Type ReplaceableInterface |
@@ -88,10 +88,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
88 | public void AddRegion(Scene scene) | 88 | public void AddRegion(Scene scene) |
89 | { | 89 | { |
90 | m_Scene = scene; | 90 | m_Scene = scene; |
91 | 91 | ||
92 | m_Scene.RegisterModuleInterface<IPrimCountModule>(this); | 92 | m_Scene.RegisterModuleInterface<IPrimCountModule>(this); |
93 | 93 | ||
94 | m_Scene.EventManager.OnObjectAddedToScene += OnParcelPrimCountAdd; | 94 | m_Scene.EventManager.OnObjectAddedToScene += OnParcelPrimCountAdd; |
95 | m_Scene.EventManager.OnObjectBeingRemovedFromScene += | 95 | m_Scene.EventManager.OnObjectBeingRemovedFromScene += |
96 | OnObjectBeingRemovedFromScene; | 96 | OnObjectBeingRemovedFromScene; |
97 | m_Scene.EventManager.OnParcelPrimCountTainted += | 97 | m_Scene.EventManager.OnParcelPrimCountTainted += |
@@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
104 | } | 104 | } |
105 | 105 | ||
106 | public void RemoveRegion(Scene scene) | 106 | public void RemoveRegion(Scene scene) |
107 | { | 107 | { |
108 | } | 108 | } |
109 | 109 | ||
110 | public void Close() | 110 | public void Close() |
@@ -126,7 +126,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
126 | AddObject(obj); | 126 | AddObject(obj); |
127 | // else | 127 | // else |
128 | // m_log.DebugFormat( | 128 | // m_log.DebugFormat( |
129 | // "[PRIM COUNT MODULE]: Ignoring OnParcelPrimCountAdd() for {0} on {1} since count is tainted", | 129 | // "[PRIM COUNT MODULE]: Ignoring OnParcelPrimCountAdd() for {0} on {1} since count is tainted", |
130 | // obj.Name, m_Scene.RegionInfo.RegionName); | 130 | // obj.Name, m_Scene.RegionInfo.RegionName); |
131 | } | 131 | } |
132 | } | 132 | } |
@@ -140,16 +140,16 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
140 | RemoveObject(obj); | 140 | RemoveObject(obj); |
141 | // else | 141 | // else |
142 | // m_log.DebugFormat( | 142 | // m_log.DebugFormat( |
143 | // "[PRIM COUNT MODULE]: Ignoring OnObjectBeingRemovedFromScene() for {0} on {1} since count is tainted", | 143 | // "[PRIM COUNT MODULE]: Ignoring OnObjectBeingRemovedFromScene() for {0} on {1} since count is tainted", |
144 | // obj.Name, m_Scene.RegionInfo.RegionName); | 144 | // obj.Name, m_Scene.RegionInfo.RegionName); |
145 | } | 145 | } |
146 | } | 146 | } |
147 | 147 | ||
148 | private void OnParcelPrimCountTainted() | 148 | private void OnParcelPrimCountTainted() |
149 | { | 149 | { |
150 | // m_log.DebugFormat( | 150 | // m_log.DebugFormat( |
151 | // "[PRIM COUNT MODULE]: OnParcelPrimCountTainted() called on {0}", m_Scene.RegionInfo.RegionName); | 151 | // "[PRIM COUNT MODULE]: OnParcelPrimCountTainted() called on {0}", m_Scene.RegionInfo.RegionName); |
152 | 152 | ||
153 | lock (m_TaintLock) | 153 | lock (m_TaintLock) |
154 | m_Tainted = true; | 154 | m_Tainted = true; |
155 | } | 155 | } |
@@ -174,33 +174,33 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
174 | 174 | ||
175 | // NOTE: Call under Taint Lock | 175 | // NOTE: Call under Taint Lock |
176 | private void AddObject(SceneObjectGroup obj) | 176 | private void AddObject(SceneObjectGroup obj) |
177 | { | 177 | { |
178 | if (obj.IsAttachment) | 178 | if (obj.IsAttachment) |
179 | return; | 179 | return; |
180 | if (((obj.RootPart.Flags & PrimFlags.TemporaryOnRez) != 0)) | 180 | if (((obj.RootPart.Flags & PrimFlags.TemporaryOnRez) != 0)) |
181 | return; | 181 | return; |
182 | 182 | ||
183 | Vector3 pos = obj.AbsolutePosition; | 183 | Vector3 pos = obj.AbsolutePosition; |
184 | ILandObject landObject = m_Scene.LandChannel.GetLandObject(pos.X, pos.Y); | 184 | ILandObject landObject = m_Scene.LandChannel.GetLandObject(pos.X, pos.Y); |
185 | 185 | ||
186 | // If for some reason there is no land object (perhaps the object is out of bounds) then we can't count it | 186 | // If for some reason there is no land object (perhaps the object is out of bounds) then we can't count it |
187 | if (landObject == null) | 187 | if (landObject == null) |
188 | { | 188 | { |
189 | // m_log.WarnFormat( | 189 | // m_log.WarnFormat( |
190 | // "[PRIM COUNT MODULE]: Found no land object for {0} at position ({1}, {2}) on {3}", | 190 | // "[PRIM COUNT MODULE]: Found no land object for {0} at position ({1}, {2}) on {3}", |
191 | // obj.Name, pos.X, pos.Y, m_Scene.RegionInfo.RegionName); | 191 | // obj.Name, pos.X, pos.Y, m_Scene.RegionInfo.RegionName); |
192 | 192 | ||
193 | return; | 193 | return; |
194 | } | 194 | } |
195 | 195 | ||
196 | LandData landData = landObject.LandData; | 196 | LandData landData = landObject.LandData; |
197 | 197 | ||
198 | // m_log.DebugFormat( | 198 | // m_log.DebugFormat( |
199 | // "[PRIM COUNT MODULE]: Adding object {0} with {1} parts to prim count for parcel {2} on {3}", | 199 | // "[PRIM COUNT MODULE]: Adding object {0} with {1} parts to prim count for parcel {2} on {3}", |
200 | // obj.Name, obj.Parts.Length, landData.Name, m_Scene.RegionInfo.RegionName); | 200 | // obj.Name, obj.Parts.Length, landData.Name, m_Scene.RegionInfo.RegionName); |
201 | 201 | ||
202 | // m_log.DebugFormat( | 202 | // m_log.DebugFormat( |
203 | // "[PRIM COUNT MODULE]: Object {0} is owned by {1} over land owned by {2}", | 203 | // "[PRIM COUNT MODULE]: Object {0} is owned by {1} over land owned by {2}", |
204 | // obj.Name, obj.OwnerID, landData.OwnerID); | 204 | // obj.Name, obj.OwnerID, landData.OwnerID); |
205 | 205 | ||
206 | ParcelCounts parcelCounts; | 206 | ParcelCounts parcelCounts; |
@@ -217,7 +217,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
217 | 217 | ||
218 | if (obj.IsSelected) | 218 | if (obj.IsSelected) |
219 | { | 219 | { |
220 | parcelCounts.Selected += partCount; | 220 | parcelCounts.Selected += partCount; |
221 | } | 221 | } |
222 | else | 222 | else |
223 | { | 223 | { |
@@ -244,8 +244,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
244 | // NOTE: Call under Taint Lock | 244 | // NOTE: Call under Taint Lock |
245 | private void RemoveObject(SceneObjectGroup obj) | 245 | private void RemoveObject(SceneObjectGroup obj) |
246 | { | 246 | { |
247 | // m_log.DebugFormat("[PRIM COUNT MODULE]: Removing object {0} {1} from prim count", obj.Name, obj.UUID); | 247 | // m_log.DebugFormat("[PRIM COUNT MODULE]: Removing object {0} {1} from prim count", obj.Name, obj.UUID); |
248 | 248 | ||
249 | // Currently this is being done by tainting the count instead. | 249 | // Currently this is being done by tainting the count instead. |
250 | } | 250 | } |
251 | 251 | ||
@@ -253,7 +253,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
253 | { | 253 | { |
254 | // m_log.DebugFormat( | 254 | // m_log.DebugFormat( |
255 | // "[PRIM COUNT MODULE]: GetPrimCounts for parcel {0} in {1}", parcelID, m_Scene.RegionInfo.RegionName); | 255 | // "[PRIM COUNT MODULE]: GetPrimCounts for parcel {0} in {1}", parcelID, m_Scene.RegionInfo.RegionName); |
256 | 256 | ||
257 | PrimCounts primCounts; | 257 | PrimCounts primCounts; |
258 | 258 | ||
259 | lock (m_PrimCounts) | 259 | lock (m_PrimCounts) |
@@ -267,7 +267,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
267 | return primCounts; | 267 | return primCounts; |
268 | } | 268 | } |
269 | 269 | ||
270 | 270 | ||
271 | /// <summary> | 271 | /// <summary> |
272 | /// Get the number of prims on the parcel that are owned by the parcel owner. | 272 | /// Get the number of prims on the parcel that are owned by the parcel owner. |
273 | /// </summary> | 273 | /// </summary> |
@@ -276,7 +276,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
276 | public int GetOwnerCount(UUID parcelID) | 276 | public int GetOwnerCount(UUID parcelID) |
277 | { | 277 | { |
278 | int count = 0; | 278 | int count = 0; |
279 | 279 | ||
280 | lock (m_TaintLock) | 280 | lock (m_TaintLock) |
281 | { | 281 | { |
282 | if (m_Tainted) | 282 | if (m_Tainted) |
@@ -286,11 +286,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
286 | if (m_ParcelCounts.TryGetValue(parcelID, out counts)) | 286 | if (m_ParcelCounts.TryGetValue(parcelID, out counts)) |
287 | count = counts.Owner; | 287 | count = counts.Owner; |
288 | } | 288 | } |
289 | 289 | ||
290 | // m_log.DebugFormat( | 290 | // m_log.DebugFormat( |
291 | // "[PRIM COUNT MODULE]: GetOwnerCount for parcel {0} in {1} returning {2}", | 291 | // "[PRIM COUNT MODULE]: GetOwnerCount for parcel {0} in {1} returning {2}", |
292 | // parcelID, m_Scene.RegionInfo.RegionName, count); | 292 | // parcelID, m_Scene.RegionInfo.RegionName, count); |
293 | 293 | ||
294 | return count; | 294 | return count; |
295 | } | 295 | } |
296 | 296 | ||
@@ -298,11 +298,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
298 | /// Get the number of prims on the parcel that have been set to the group that owns the parcel. | 298 | /// Get the number of prims on the parcel that have been set to the group that owns the parcel. |
299 | /// </summary> | 299 | /// </summary> |
300 | /// <param name="parcelID"></param> | 300 | /// <param name="parcelID"></param> |
301 | /// <returns></returns> | 301 | /// <returns></returns> |
302 | public int GetGroupCount(UUID parcelID) | 302 | public int GetGroupCount(UUID parcelID) |
303 | { | 303 | { |
304 | int count = 0; | 304 | int count = 0; |
305 | 305 | ||
306 | lock (m_TaintLock) | 306 | lock (m_TaintLock) |
307 | { | 307 | { |
308 | if (m_Tainted) | 308 | if (m_Tainted) |
@@ -312,11 +312,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
312 | if (m_ParcelCounts.TryGetValue(parcelID, out counts)) | 312 | if (m_ParcelCounts.TryGetValue(parcelID, out counts)) |
313 | count = counts.Group; | 313 | count = counts.Group; |
314 | } | 314 | } |
315 | 315 | ||
316 | // m_log.DebugFormat( | 316 | // m_log.DebugFormat( |
317 | // "[PRIM COUNT MODULE]: GetGroupCount for parcel {0} in {1} returning {2}", | 317 | // "[PRIM COUNT MODULE]: GetGroupCount for parcel {0} in {1} returning {2}", |
318 | // parcelID, m_Scene.RegionInfo.RegionName, count); | 318 | // parcelID, m_Scene.RegionInfo.RegionName, count); |
319 | 319 | ||
320 | return count; | 320 | return count; |
321 | } | 321 | } |
322 | 322 | ||
@@ -324,11 +324,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
324 | /// Get the number of prims on the parcel that are not owned by the parcel owner or set to the parcel group. | 324 | /// Get the number of prims on the parcel that are not owned by the parcel owner or set to the parcel group. |
325 | /// </summary> | 325 | /// </summary> |
326 | /// <param name="parcelID"></param> | 326 | /// <param name="parcelID"></param> |
327 | /// <returns></returns> | 327 | /// <returns></returns> |
328 | public int GetOthersCount(UUID parcelID) | 328 | public int GetOthersCount(UUID parcelID) |
329 | { | 329 | { |
330 | int count = 0; | 330 | int count = 0; |
331 | 331 | ||
332 | lock (m_TaintLock) | 332 | lock (m_TaintLock) |
333 | { | 333 | { |
334 | if (m_Tainted) | 334 | if (m_Tainted) |
@@ -338,23 +338,23 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
338 | if (m_ParcelCounts.TryGetValue(parcelID, out counts)) | 338 | if (m_ParcelCounts.TryGetValue(parcelID, out counts)) |
339 | count = counts.Others; | 339 | count = counts.Others; |
340 | } | 340 | } |
341 | 341 | ||
342 | // m_log.DebugFormat( | 342 | // m_log.DebugFormat( |
343 | // "[PRIM COUNT MODULE]: GetOthersCount for parcel {0} in {1} returning {2}", | 343 | // "[PRIM COUNT MODULE]: GetOthersCount for parcel {0} in {1} returning {2}", |
344 | // parcelID, m_Scene.RegionInfo.RegionName, count); | 344 | // parcelID, m_Scene.RegionInfo.RegionName, count); |
345 | 345 | ||
346 | return count; | 346 | return count; |
347 | } | 347 | } |
348 | 348 | ||
349 | /// <summary> | 349 | /// <summary> |
350 | /// Get the number of selected prims. | 350 | /// Get the number of selected prims. |
351 | /// </summary> | 351 | /// </summary> |
352 | /// <param name="parcelID"></param> | 352 | /// <param name="parcelID"></param> |
353 | /// <returns></returns> | 353 | /// <returns></returns> |
354 | public int GetSelectedCount(UUID parcelID) | 354 | public int GetSelectedCount(UUID parcelID) |
355 | { | 355 | { |
356 | int count = 0; | 356 | int count = 0; |
357 | 357 | ||
358 | lock (m_TaintLock) | 358 | lock (m_TaintLock) |
359 | { | 359 | { |
360 | if (m_Tainted) | 360 | if (m_Tainted) |
@@ -364,24 +364,24 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
364 | if (m_ParcelCounts.TryGetValue(parcelID, out counts)) | 364 | if (m_ParcelCounts.TryGetValue(parcelID, out counts)) |
365 | count = counts.Selected; | 365 | count = counts.Selected; |
366 | } | 366 | } |
367 | 367 | ||
368 | // m_log.DebugFormat( | 368 | // m_log.DebugFormat( |
369 | // "[PRIM COUNT MODULE]: GetSelectedCount for parcel {0} in {1} returning {2}", | 369 | // "[PRIM COUNT MODULE]: GetSelectedCount for parcel {0} in {1} returning {2}", |
370 | // parcelID, m_Scene.RegionInfo.RegionName, count); | 370 | // parcelID, m_Scene.RegionInfo.RegionName, count); |
371 | 371 | ||
372 | return count; | 372 | return count; |
373 | } | 373 | } |
374 | 374 | ||
375 | /// <summary> | 375 | /// <summary> |
376 | /// Get the total count of owner, group and others prims on the parcel. | 376 | /// Get the total count of owner, group and others prims on the parcel. |
377 | /// FIXME: Need to do selected prims once this is reimplemented. | 377 | /// FIXME: Need to do selected prims once this is reimplemented. |
378 | /// </summary> | 378 | /// </summary> |
379 | /// <param name="parcelID"></param> | 379 | /// <param name="parcelID"></param> |
380 | /// <returns></returns> | 380 | /// <returns></returns> |
381 | public int GetTotalCount(UUID parcelID) | 381 | public int GetTotalCount(UUID parcelID) |
382 | { | 382 | { |
383 | int count = 0; | 383 | int count = 0; |
384 | 384 | ||
385 | lock (m_TaintLock) | 385 | lock (m_TaintLock) |
386 | { | 386 | { |
387 | if (m_Tainted) | 387 | if (m_Tainted) |
@@ -396,28 +396,28 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
396 | count += counts.Selected; | 396 | count += counts.Selected; |
397 | } | 397 | } |
398 | } | 398 | } |
399 | 399 | ||
400 | // m_log.DebugFormat( | 400 | // m_log.DebugFormat( |
401 | // "[PRIM COUNT MODULE]: GetTotalCount for parcel {0} in {1} returning {2}", | 401 | // "[PRIM COUNT MODULE]: GetTotalCount for parcel {0} in {1} returning {2}", |
402 | // parcelID, m_Scene.RegionInfo.RegionName, count); | 402 | // parcelID, m_Scene.RegionInfo.RegionName, count); |
403 | 403 | ||
404 | return count; | 404 | return count; |
405 | } | 405 | } |
406 | 406 | ||
407 | /// <summary> | 407 | /// <summary> |
408 | /// Get the number of prims that are in the entire simulator for the owner of this parcel. | 408 | /// Get the number of prims that are in the entire simulator for the owner of this parcel. |
409 | /// </summary> | 409 | /// </summary> |
410 | /// <param name="parcelID"></param> | 410 | /// <param name="parcelID"></param> |
411 | /// <returns></returns> | 411 | /// <returns></returns> |
412 | public int GetSimulatorCount(UUID parcelID) | 412 | public int GetSimulatorCount(UUID parcelID) |
413 | { | 413 | { |
414 | int count = 0; | 414 | int count = 0; |
415 | 415 | ||
416 | lock (m_TaintLock) | 416 | lock (m_TaintLock) |
417 | { | 417 | { |
418 | if (m_Tainted) | 418 | if (m_Tainted) |
419 | Recount(); | 419 | Recount(); |
420 | 420 | ||
421 | UUID owner; | 421 | UUID owner; |
422 | if (m_OwnerMap.TryGetValue(parcelID, out owner)) | 422 | if (m_OwnerMap.TryGetValue(parcelID, out owner)) |
423 | { | 423 | { |
@@ -426,11 +426,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
426 | count = val; | 426 | count = val; |
427 | } | 427 | } |
428 | } | 428 | } |
429 | 429 | ||
430 | // m_log.DebugFormat( | 430 | // m_log.DebugFormat( |
431 | // "[PRIM COUNT MODULE]: GetOthersCount for parcel {0} in {1} returning {2}", | 431 | // "[PRIM COUNT MODULE]: GetOthersCount for parcel {0} in {1} returning {2}", |
432 | // parcelID, m_Scene.RegionInfo.RegionName, count); | 432 | // parcelID, m_Scene.RegionInfo.RegionName, count); |
433 | 433 | ||
434 | return count; | 434 | return count; |
435 | } | 435 | } |
436 | 436 | ||
@@ -439,11 +439,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
439 | /// </summary> | 439 | /// </summary> |
440 | /// <param name="parcelID"></param> | 440 | /// <param name="parcelID"></param> |
441 | /// <param name="userID"></param> | 441 | /// <param name="userID"></param> |
442 | /// <returns></returns> | 442 | /// <returns></returns> |
443 | public int GetUserCount(UUID parcelID, UUID userID) | 443 | public int GetUserCount(UUID parcelID, UUID userID) |
444 | { | 444 | { |
445 | int count = 0; | 445 | int count = 0; |
446 | 446 | ||
447 | lock (m_TaintLock) | 447 | lock (m_TaintLock) |
448 | { | 448 | { |
449 | if (m_Tainted) | 449 | if (m_Tainted) |
@@ -459,9 +459,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
459 | } | 459 | } |
460 | 460 | ||
461 | // m_log.DebugFormat( | 461 | // m_log.DebugFormat( |
462 | // "[PRIM COUNT MODULE]: GetUserCount for user {0} in parcel {1} in region {2} returning {3}", | 462 | // "[PRIM COUNT MODULE]: GetUserCount for user {0} in parcel {1} in region {2} returning {3}", |
463 | // userID, parcelID, m_Scene.RegionInfo.RegionName, count); | 463 | // userID, parcelID, m_Scene.RegionInfo.RegionName, count); |
464 | 464 | ||
465 | return count; | 465 | return count; |
466 | } | 466 | } |
467 | 467 | ||
@@ -469,13 +469,13 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
469 | private void Recount() | 469 | private void Recount() |
470 | { | 470 | { |
471 | // m_log.DebugFormat("[PRIM COUNT MODULE]: Recounting prims on {0}", m_Scene.RegionInfo.RegionName); | 471 | // m_log.DebugFormat("[PRIM COUNT MODULE]: Recounting prims on {0}", m_Scene.RegionInfo.RegionName); |
472 | 472 | ||
473 | m_OwnerMap.Clear(); | 473 | m_OwnerMap.Clear(); |
474 | m_SimwideCounts.Clear(); | 474 | m_SimwideCounts.Clear(); |
475 | m_ParcelCounts.Clear(); | 475 | m_ParcelCounts.Clear(); |
476 | 476 | ||
477 | List<ILandObject> land = m_Scene.LandChannel.AllParcels(); | 477 | List<ILandObject> land = m_Scene.LandChannel.AllParcels(); |
478 | 478 | ||
479 | foreach (ILandObject l in land) | 479 | foreach (ILandObject l in land) |
480 | { | 480 | { |
481 | LandData landData = l.LandData; | 481 | LandData landData = l.LandData; |
@@ -483,7 +483,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
483 | m_OwnerMap[landData.GlobalID] = landData.OwnerID; | 483 | m_OwnerMap[landData.GlobalID] = landData.OwnerID; |
484 | m_SimwideCounts[landData.OwnerID] = 0; | 484 | m_SimwideCounts[landData.OwnerID] = 0; |
485 | // m_log.DebugFormat( | 485 | // m_log.DebugFormat( |
486 | // "[PRIM COUNT MODULE]: Initializing parcel count for {0} on {1}", | 486 | // "[PRIM COUNT MODULE]: Initializing parcel count for {0} on {1}", |
487 | // landData.Name, m_Scene.RegionInfo.RegionName); | 487 | // landData.Name, m_Scene.RegionInfo.RegionName); |
488 | m_ParcelCounts[landData.GlobalID] = new ParcelCounts(); | 488 | m_ParcelCounts[landData.GlobalID] = new ParcelCounts(); |
489 | } | 489 | } |
@@ -499,7 +499,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
499 | m_PrimCounts.Remove(k); | 499 | m_PrimCounts.Remove(k); |
500 | } | 500 | } |
501 | } | 501 | } |
502 | 502 | ||
503 | m_Tainted = false; | 503 | m_Tainted = false; |
504 | } | 504 | } |
505 | } | 505 | } |
@@ -541,7 +541,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
541 | return m_Parent.GetOthersCount(m_ParcelID); | 541 | return m_Parent.GetOthersCount(m_ParcelID); |
542 | } | 542 | } |
543 | } | 543 | } |
544 | 544 | ||
545 | public int Selected | 545 | public int Selected |
546 | { | 546 | { |
547 | get | 547 | get |
@@ -549,7 +549,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
549 | return m_Parent.GetSelectedCount(m_ParcelID); | 549 | return m_Parent.GetSelectedCount(m_ParcelID); |
550 | } | 550 | } |
551 | } | 551 | } |
552 | 552 | ||
553 | public int Total | 553 | public int Total |
554 | { | 554 | { |
555 | get | 555 | get |
diff --git a/OpenSim/Region/CoreModules/World/Land/Tests/LandManagementModuleTests.cs b/OpenSim/Region/CoreModules/World/Land/Tests/LandManagementModuleTests.cs index 4ed67f3..d6a3ded 100644 --- a/OpenSim/Region/CoreModules/World/Land/Tests/LandManagementModuleTests.cs +++ b/OpenSim/Region/CoreModules/World/Land/Tests/LandManagementModuleTests.cs | |||
@@ -45,14 +45,14 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
45 | UUID userId = TestHelpers.ParseTail(0x1); | 45 | UUID userId = TestHelpers.ParseTail(0x1); |
46 | 46 | ||
47 | LandManagementModule lmm = new LandManagementModule(); | 47 | LandManagementModule lmm = new LandManagementModule(); |
48 | Scene scene = new SceneHelpers().SetupScene(); | 48 | Scene scene = new SceneHelpers().SetupScene(); |
49 | SceneHelpers.SetupSceneModules(scene, lmm); | 49 | SceneHelpers.SetupSceneModules(scene, lmm); |
50 | 50 | ||
51 | ILandObject lo = new LandObject(userId, false, scene); | 51 | ILandObject lo = new LandObject(userId, false, scene); |
52 | lo.LandData.Name = "lo1"; | 52 | lo.LandData.Name = "lo1"; |
53 | lo.SetLandBitmap( | 53 | lo.SetLandBitmap( |
54 | lo.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); | 54 | lo.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); |
55 | lo = lmm.AddLandObject(lo); | 55 | lo = lmm.AddLandObject(lo); |
56 | 56 | ||
57 | // TODO: Should add asserts to check that land object was added properly. | 57 | // TODO: Should add asserts to check that land object was added properly. |
58 | 58 | ||
@@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
67 | { | 67 | { |
68 | ILandObject loAtCoord = lmm.GetLandObject(0, 0); | 68 | ILandObject loAtCoord = lmm.GetLandObject(0, 0); |
69 | Assert.That(loAtCoord.LandData.LocalID, Is.EqualTo(lo.LandData.LocalID)); | 69 | Assert.That(loAtCoord.LandData.LocalID, Is.EqualTo(lo.LandData.LocalID)); |
70 | Assert.That(loAtCoord.LandData.GlobalID, Is.EqualTo(lo.LandData.GlobalID)); | 70 | Assert.That(loAtCoord.LandData.GlobalID, Is.EqualTo(lo.LandData.GlobalID)); |
71 | } | 71 | } |
72 | 72 | ||
73 | { | 73 | { |
@@ -88,8 +88,8 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
88 | 88 | ||
89 | SceneHelpers sh = new SceneHelpers(); | 89 | SceneHelpers sh = new SceneHelpers(); |
90 | LandManagementModule lmm = new LandManagementModule(); | 90 | LandManagementModule lmm = new LandManagementModule(); |
91 | Scene scene = sh.SetupScene(); | 91 | Scene scene = sh.SetupScene(); |
92 | SceneHelpers.SetupSceneModules(scene, lmm); | 92 | SceneHelpers.SetupSceneModules(scene, lmm); |
93 | 93 | ||
94 | scene.loadAllLandObjectsFromStorage(scene.RegionInfo.RegionID); | 94 | scene.loadAllLandObjectsFromStorage(scene.RegionInfo.RegionID); |
95 | 95 | ||
@@ -115,8 +115,8 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
115 | 115 | ||
116 | SceneHelpers sh = new SceneHelpers(); | 116 | SceneHelpers sh = new SceneHelpers(); |
117 | LandManagementModule lmm = new LandManagementModule(); | 117 | LandManagementModule lmm = new LandManagementModule(); |
118 | Scene scene = sh.SetupScene(); | 118 | Scene scene = sh.SetupScene(); |
119 | SceneHelpers.SetupSceneModules(scene, lmm); | 119 | SceneHelpers.SetupSceneModules(scene, lmm); |
120 | 120 | ||
121 | ILandObject originalLo1 = new LandObject(userId, false, scene); | 121 | ILandObject originalLo1 = new LandObject(userId, false, scene); |
122 | originalLo1.LandData.Name = "lo1"; | 122 | originalLo1.LandData.Name = "lo1"; |
@@ -149,8 +149,8 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
149 | 149 | ||
150 | SceneHelpers sh = new SceneHelpers(); | 150 | SceneHelpers sh = new SceneHelpers(); |
151 | LandManagementModule lmm = new LandManagementModule(); | 151 | LandManagementModule lmm = new LandManagementModule(); |
152 | Scene scene = sh.SetupScene(); | 152 | Scene scene = sh.SetupScene(); |
153 | SceneHelpers.SetupSceneModules(scene, lmm); | 153 | SceneHelpers.SetupSceneModules(scene, lmm); |
154 | 154 | ||
155 | ILandObject originalLo1 = new LandObject(userId, false, scene); | 155 | ILandObject originalLo1 = new LandObject(userId, false, scene); |
156 | originalLo1.LandData.Name = "lo1"; | 156 | originalLo1.LandData.Name = "lo1"; |
@@ -173,7 +173,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
173 | Assert.That(loAtCoord1.LandData.Name, Is.EqualTo(originalLo1.LandData.Name)); | 173 | Assert.That(loAtCoord1.LandData.Name, Is.EqualTo(originalLo1.LandData.Name)); |
174 | Assert.That(loAtCoord1.LandData.GlobalID, Is.EqualTo(originalLo1.LandData.GlobalID)); | 174 | Assert.That(loAtCoord1.LandData.GlobalID, Is.EqualTo(originalLo1.LandData.GlobalID)); |
175 | 175 | ||
176 | ILandObject loAtCoord2 | 176 | ILandObject loAtCoord2 |
177 | = lmm.GetLandObject((int)Constants.RegionSize - 1, (((int)Constants.RegionSize / 4) * 3) - 1); | 177 | = lmm.GetLandObject((int)Constants.RegionSize - 1, (((int)Constants.RegionSize / 4) * 3) - 1); |
178 | Assert.That(loAtCoord2.LandData.Name, Is.EqualTo(originalLo2.LandData.Name)); | 178 | Assert.That(loAtCoord2.LandData.Name, Is.EqualTo(originalLo2.LandData.Name)); |
179 | Assert.That(loAtCoord2.LandData.GlobalID, Is.EqualTo(originalLo2.LandData.GlobalID)); | 179 | Assert.That(loAtCoord2.LandData.GlobalID, Is.EqualTo(originalLo2.LandData.GlobalID)); |
@@ -198,8 +198,8 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
198 | 198 | ||
199 | SceneHelpers sh = new SceneHelpers(); | 199 | SceneHelpers sh = new SceneHelpers(); |
200 | LandManagementModule lmm = new LandManagementModule(); | 200 | LandManagementModule lmm = new LandManagementModule(); |
201 | Scene scene = sh.SetupScene(); | 201 | Scene scene = sh.SetupScene(); |
202 | SceneHelpers.SetupSceneModules(scene, lmm); | 202 | SceneHelpers.SetupSceneModules(scene, lmm); |
203 | 203 | ||
204 | ILandObject originalLo1 = new LandObject(userId, false, scene); | 204 | ILandObject originalLo1 = new LandObject(userId, false, scene); |
205 | originalLo1.LandData.Name = "lo1"; | 205 | originalLo1.LandData.Name = "lo1"; |
@@ -220,7 +220,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
220 | { | 220 | { |
221 | ILandObject loAtCoord = lmm.GetLandObject(0, 0); | 221 | ILandObject loAtCoord = lmm.GetLandObject(0, 0); |
222 | Assert.That(loAtCoord.LandData.Name, Is.EqualTo(originalLo1.LandData.Name)); | 222 | Assert.That(loAtCoord.LandData.Name, Is.EqualTo(originalLo1.LandData.Name)); |
223 | Assert.That(loAtCoord.LandData.GlobalID, Is.EqualTo(originalLo1.LandData.GlobalID)); | 223 | Assert.That(loAtCoord.LandData.GlobalID, Is.EqualTo(originalLo1.LandData.GlobalID)); |
224 | } | 224 | } |
225 | 225 | ||
226 | { | 226 | { |
@@ -239,21 +239,21 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
239 | UUID userId = TestHelpers.ParseTail(0x1); | 239 | UUID userId = TestHelpers.ParseTail(0x1); |
240 | 240 | ||
241 | LandManagementModule lmm = new LandManagementModule(); | 241 | LandManagementModule lmm = new LandManagementModule(); |
242 | Scene scene = new SceneHelpers().SetupScene(); | 242 | Scene scene = new SceneHelpers().SetupScene(); |
243 | SceneHelpers.SetupSceneModules(scene, lmm); | 243 | SceneHelpers.SetupSceneModules(scene, lmm); |
244 | 244 | ||
245 | ILandObject lo = new LandObject(userId, false, scene); | 245 | ILandObject lo = new LandObject(userId, false, scene); |
246 | lo.LandData.Name = "lo1"; | 246 | lo.LandData.Name = "lo1"; |
247 | lo.SetLandBitmap( | 247 | lo.SetLandBitmap( |
248 | lo.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); | 248 | lo.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); |
249 | lo = lmm.AddLandObject(lo); | 249 | lo = lmm.AddLandObject(lo); |
250 | 250 | ||
251 | lmm.Subdivide(0, 0, LandManagementModule.LandUnit, LandManagementModule.LandUnit, userId); | 251 | lmm.Subdivide(0, 0, LandManagementModule.LandUnit, LandManagementModule.LandUnit, userId); |
252 | 252 | ||
253 | { | 253 | { |
254 | ILandObject loAtCoord = lmm.GetLandObject(0, 0); | 254 | ILandObject loAtCoord = lmm.GetLandObject(0, 0); |
255 | Assert.That(loAtCoord.LandData.LocalID, Is.Not.EqualTo(lo.LandData.LocalID)); | 255 | Assert.That(loAtCoord.LandData.LocalID, Is.Not.EqualTo(lo.LandData.LocalID)); |
256 | Assert.That(loAtCoord.LandData.GlobalID, Is.Not.EqualTo(lo.LandData.GlobalID)); | 256 | Assert.That(loAtCoord.LandData.GlobalID, Is.Not.EqualTo(lo.LandData.GlobalID)); |
257 | } | 257 | } |
258 | 258 | ||
259 | { | 259 | { |
diff --git a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs index 949acb6..0d8ece7 100644 --- a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs +++ b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs | |||
@@ -43,21 +43,21 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
43 | public class PrimCountModuleTests : OpenSimTestCase | 43 | public class PrimCountModuleTests : OpenSimTestCase |
44 | { | 44 | { |
45 | protected UUID m_userId = new UUID("00000000-0000-0000-0000-100000000000"); | 45 | protected UUID m_userId = new UUID("00000000-0000-0000-0000-100000000000"); |
46 | protected UUID m_groupId = new UUID("00000000-0000-0000-8888-000000000000"); | 46 | protected UUID m_groupId = new UUID("00000000-0000-0000-8888-000000000000"); |
47 | protected UUID m_otherUserId = new UUID("99999999-9999-9999-9999-999999999999"); | 47 | protected UUID m_otherUserId = new UUID("99999999-9999-9999-9999-999999999999"); |
48 | protected TestScene m_scene; | 48 | protected TestScene m_scene; |
49 | protected PrimCountModule m_pcm; | 49 | protected PrimCountModule m_pcm; |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// A parcel that covers the entire sim except for a 1 unit wide strip on the eastern side. | 52 | /// A parcel that covers the entire sim except for a 1 unit wide strip on the eastern side. |
53 | /// </summary> | 53 | /// </summary> |
54 | protected ILandObject m_lo; | 54 | protected ILandObject m_lo; |
55 | 55 | ||
56 | /// <summary> | 56 | /// <summary> |
57 | /// A parcel that covers just the eastern strip of the sim. | 57 | /// A parcel that covers just the eastern strip of the sim. |
58 | /// </summary> | 58 | /// </summary> |
59 | protected ILandObject m_lo2; | 59 | protected ILandObject m_lo2; |
60 | 60 | ||
61 | [SetUp] | 61 | [SetUp] |
62 | public override void SetUp() | 62 | public override void SetUp() |
63 | { | 63 | { |
@@ -65,24 +65,24 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
65 | 65 | ||
66 | m_pcm = new PrimCountModule(); | 66 | m_pcm = new PrimCountModule(); |
67 | LandManagementModule lmm = new LandManagementModule(); | 67 | LandManagementModule lmm = new LandManagementModule(); |
68 | m_scene = new SceneHelpers().SetupScene(); | 68 | m_scene = new SceneHelpers().SetupScene(); |
69 | SceneHelpers.SetupSceneModules(m_scene, lmm, m_pcm); | 69 | SceneHelpers.SetupSceneModules(m_scene, lmm, m_pcm); |
70 | 70 | ||
71 | int xParcelDivider = (int)Constants.RegionSize - 1; | 71 | int xParcelDivider = (int)Constants.RegionSize - 1; |
72 | 72 | ||
73 | ILandObject lo = new LandObject(m_userId, false, m_scene); | 73 | ILandObject lo = new LandObject(m_userId, false, m_scene); |
74 | lo.LandData.Name = "m_lo"; | 74 | lo.LandData.Name = "m_lo"; |
75 | lo.SetLandBitmap( | 75 | lo.SetLandBitmap( |
76 | lo.GetSquareLandBitmap(0, 0, xParcelDivider, (int)Constants.RegionSize)); | 76 | lo.GetSquareLandBitmap(0, 0, xParcelDivider, (int)Constants.RegionSize)); |
77 | m_lo = lmm.AddLandObject(lo); | 77 | m_lo = lmm.AddLandObject(lo); |
78 | 78 | ||
79 | ILandObject lo2 = new LandObject(m_userId, false, m_scene); | 79 | ILandObject lo2 = new LandObject(m_userId, false, m_scene); |
80 | lo2.SetLandBitmap( | 80 | lo2.SetLandBitmap( |
81 | lo2.GetSquareLandBitmap(xParcelDivider, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); | 81 | lo2.GetSquareLandBitmap(xParcelDivider, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); |
82 | lo2.LandData.Name = "m_lo2"; | 82 | lo2.LandData.Name = "m_lo2"; |
83 | m_lo2 = lmm.AddLandObject(lo2); | 83 | m_lo2 = lmm.AddLandObject(lo2); |
84 | } | 84 | } |
85 | 85 | ||
86 | /// <summary> | 86 | /// <summary> |
87 | /// Test that counts before we do anything are correct. | 87 | /// Test that counts before we do anything are correct. |
88 | /// </summary> | 88 | /// </summary> |
@@ -90,7 +90,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
90 | public void TestInitialCounts() | 90 | public void TestInitialCounts() |
91 | { | 91 | { |
92 | IPrimCounts pc = m_lo.PrimCounts; | 92 | IPrimCounts pc = m_lo.PrimCounts; |
93 | 93 | ||
94 | Assert.That(pc.Owner, Is.EqualTo(0)); | 94 | Assert.That(pc.Owner, Is.EqualTo(0)); |
95 | Assert.That(pc.Group, Is.EqualTo(0)); | 95 | Assert.That(pc.Group, Is.EqualTo(0)); |
96 | Assert.That(pc.Others, Is.EqualTo(0)); | 96 | Assert.That(pc.Others, Is.EqualTo(0)); |
@@ -98,9 +98,9 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
98 | Assert.That(pc.Selected, Is.EqualTo(0)); | 98 | Assert.That(pc.Selected, Is.EqualTo(0)); |
99 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); | 99 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); |
100 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 100 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
101 | Assert.That(pc.Simulator, Is.EqualTo(0)); | 101 | Assert.That(pc.Simulator, Is.EqualTo(0)); |
102 | } | 102 | } |
103 | 103 | ||
104 | /// <summary> | 104 | /// <summary> |
105 | /// Test count after a parcel owner owned object is added. | 105 | /// Test count after a parcel owner owned object is added. |
106 | /// </summary> | 106 | /// </summary> |
@@ -108,13 +108,13 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
108 | public void TestAddOwnerObject() | 108 | public void TestAddOwnerObject() |
109 | { | 109 | { |
110 | TestHelpers.InMethod(); | 110 | TestHelpers.InMethod(); |
111 | // log4net.Config.XmlConfigurator.Configure(); | 111 | // log4net.Config.XmlConfigurator.Configure(); |
112 | 112 | ||
113 | IPrimCounts pc = m_lo.PrimCounts; | 113 | IPrimCounts pc = m_lo.PrimCounts; |
114 | 114 | ||
115 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); | 115 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); |
116 | m_scene.AddNewSceneObject(sog, false); | 116 | m_scene.AddNewSceneObject(sog, false); |
117 | 117 | ||
118 | Assert.That(pc.Owner, Is.EqualTo(3)); | 118 | Assert.That(pc.Owner, Is.EqualTo(3)); |
119 | Assert.That(pc.Group, Is.EqualTo(0)); | 119 | Assert.That(pc.Group, Is.EqualTo(0)); |
120 | Assert.That(pc.Others, Is.EqualTo(0)); | 120 | Assert.That(pc.Others, Is.EqualTo(0)); |
@@ -122,12 +122,12 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
122 | Assert.That(pc.Selected, Is.EqualTo(0)); | 122 | Assert.That(pc.Selected, Is.EqualTo(0)); |
123 | Assert.That(pc.Users[m_userId], Is.EqualTo(3)); | 123 | Assert.That(pc.Users[m_userId], Is.EqualTo(3)); |
124 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 124 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
125 | Assert.That(pc.Simulator, Is.EqualTo(3)); | 125 | Assert.That(pc.Simulator, Is.EqualTo(3)); |
126 | 126 | ||
127 | // Add a second object and retest | 127 | // Add a second object and retest |
128 | SceneObjectGroup sog2 = SceneHelpers.CreateSceneObject(2, m_userId, "b", 0x10); | 128 | SceneObjectGroup sog2 = SceneHelpers.CreateSceneObject(2, m_userId, "b", 0x10); |
129 | m_scene.AddNewSceneObject(sog2, false); | 129 | m_scene.AddNewSceneObject(sog2, false); |
130 | 130 | ||
131 | Assert.That(pc.Owner, Is.EqualTo(5)); | 131 | Assert.That(pc.Owner, Is.EqualTo(5)); |
132 | Assert.That(pc.Group, Is.EqualTo(0)); | 132 | Assert.That(pc.Group, Is.EqualTo(0)); |
133 | Assert.That(pc.Others, Is.EqualTo(0)); | 133 | Assert.That(pc.Others, Is.EqualTo(0)); |
@@ -135,9 +135,9 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
135 | Assert.That(pc.Selected, Is.EqualTo(0)); | 135 | Assert.That(pc.Selected, Is.EqualTo(0)); |
136 | Assert.That(pc.Users[m_userId], Is.EqualTo(5)); | 136 | Assert.That(pc.Users[m_userId], Is.EqualTo(5)); |
137 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 137 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
138 | Assert.That(pc.Simulator, Is.EqualTo(5)); | 138 | Assert.That(pc.Simulator, Is.EqualTo(5)); |
139 | } | 139 | } |
140 | 140 | ||
141 | /// <summary> | 141 | /// <summary> |
142 | /// Test count after a parcel owner owned copied object is added. | 142 | /// Test count after a parcel owner owned copied object is added. |
143 | /// </summary> | 143 | /// </summary> |
@@ -145,14 +145,14 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
145 | public void TestCopyOwnerObject() | 145 | public void TestCopyOwnerObject() |
146 | { | 146 | { |
147 | TestHelpers.InMethod(); | 147 | TestHelpers.InMethod(); |
148 | // log4net.Config.XmlConfigurator.Configure(); | 148 | // log4net.Config.XmlConfigurator.Configure(); |
149 | 149 | ||
150 | IPrimCounts pc = m_lo.PrimCounts; | 150 | IPrimCounts pc = m_lo.PrimCounts; |
151 | 151 | ||
152 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); | 152 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); |
153 | m_scene.AddNewSceneObject(sog, false); | 153 | m_scene.AddNewSceneObject(sog, false); |
154 | m_scene.SceneGraph.DuplicateObject(sog.LocalId, Vector3.Zero, 0, m_userId, UUID.Zero, Quaternion.Identity); | 154 | m_scene.SceneGraph.DuplicateObject(sog.LocalId, Vector3.Zero, 0, m_userId, UUID.Zero, Quaternion.Identity); |
155 | 155 | ||
156 | Assert.That(pc.Owner, Is.EqualTo(6)); | 156 | Assert.That(pc.Owner, Is.EqualTo(6)); |
157 | Assert.That(pc.Group, Is.EqualTo(0)); | 157 | Assert.That(pc.Group, Is.EqualTo(0)); |
158 | Assert.That(pc.Others, Is.EqualTo(0)); | 158 | Assert.That(pc.Others, Is.EqualTo(0)); |
@@ -160,9 +160,9 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
160 | Assert.That(pc.Selected, Is.EqualTo(0)); | 160 | Assert.That(pc.Selected, Is.EqualTo(0)); |
161 | Assert.That(pc.Users[m_userId], Is.EqualTo(6)); | 161 | Assert.That(pc.Users[m_userId], Is.EqualTo(6)); |
162 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 162 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
163 | Assert.That(pc.Simulator, Is.EqualTo(6)); | 163 | Assert.That(pc.Simulator, Is.EqualTo(6)); |
164 | } | 164 | } |
165 | 165 | ||
166 | /// <summary> | 166 | /// <summary> |
167 | /// Test that parcel counts update correctly when an object is moved between parcels, where that movement | 167 | /// Test that parcel counts update correctly when an object is moved between parcels, where that movement |
168 | /// is not done directly by the user/ | 168 | /// is not done directly by the user/ |
@@ -171,18 +171,18 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
171 | public void TestMoveOwnerObject() | 171 | public void TestMoveOwnerObject() |
172 | { | 172 | { |
173 | TestHelpers.InMethod(); | 173 | TestHelpers.InMethod(); |
174 | // log4net.Config.XmlConfigurator.Configure(); | 174 | // log4net.Config.XmlConfigurator.Configure(); |
175 | 175 | ||
176 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); | 176 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); |
177 | m_scene.AddNewSceneObject(sog, false); | 177 | m_scene.AddNewSceneObject(sog, false); |
178 | SceneObjectGroup sog2 = SceneHelpers.CreateSceneObject(2, m_userId, "b", 0x10); | 178 | SceneObjectGroup sog2 = SceneHelpers.CreateSceneObject(2, m_userId, "b", 0x10); |
179 | m_scene.AddNewSceneObject(sog2, false); | 179 | m_scene.AddNewSceneObject(sog2, false); |
180 | 180 | ||
181 | // Move the first scene object to the eastern strip parcel | 181 | // Move the first scene object to the eastern strip parcel |
182 | sog.AbsolutePosition = new Vector3(254, 2, 2); | 182 | sog.AbsolutePosition = new Vector3(254, 2, 2); |
183 | 183 | ||
184 | IPrimCounts pclo1 = m_lo.PrimCounts; | 184 | IPrimCounts pclo1 = m_lo.PrimCounts; |
185 | 185 | ||
186 | Assert.That(pclo1.Owner, Is.EqualTo(2)); | 186 | Assert.That(pclo1.Owner, Is.EqualTo(2)); |
187 | Assert.That(pclo1.Group, Is.EqualTo(0)); | 187 | Assert.That(pclo1.Group, Is.EqualTo(0)); |
188 | Assert.That(pclo1.Others, Is.EqualTo(0)); | 188 | Assert.That(pclo1.Others, Is.EqualTo(0)); |
@@ -190,10 +190,10 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
190 | Assert.That(pclo1.Selected, Is.EqualTo(0)); | 190 | Assert.That(pclo1.Selected, Is.EqualTo(0)); |
191 | Assert.That(pclo1.Users[m_userId], Is.EqualTo(2)); | 191 | Assert.That(pclo1.Users[m_userId], Is.EqualTo(2)); |
192 | Assert.That(pclo1.Users[m_otherUserId], Is.EqualTo(0)); | 192 | Assert.That(pclo1.Users[m_otherUserId], Is.EqualTo(0)); |
193 | Assert.That(pclo1.Simulator, Is.EqualTo(5)); | 193 | Assert.That(pclo1.Simulator, Is.EqualTo(5)); |
194 | 194 | ||
195 | IPrimCounts pclo2 = m_lo2.PrimCounts; | 195 | IPrimCounts pclo2 = m_lo2.PrimCounts; |
196 | 196 | ||
197 | Assert.That(pclo2.Owner, Is.EqualTo(3)); | 197 | Assert.That(pclo2.Owner, Is.EqualTo(3)); |
198 | Assert.That(pclo2.Group, Is.EqualTo(0)); | 198 | Assert.That(pclo2.Group, Is.EqualTo(0)); |
199 | Assert.That(pclo2.Others, Is.EqualTo(0)); | 199 | Assert.That(pclo2.Others, Is.EqualTo(0)); |
@@ -201,11 +201,11 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
201 | Assert.That(pclo2.Selected, Is.EqualTo(0)); | 201 | Assert.That(pclo2.Selected, Is.EqualTo(0)); |
202 | Assert.That(pclo2.Users[m_userId], Is.EqualTo(3)); | 202 | Assert.That(pclo2.Users[m_userId], Is.EqualTo(3)); |
203 | Assert.That(pclo2.Users[m_otherUserId], Is.EqualTo(0)); | 203 | Assert.That(pclo2.Users[m_otherUserId], Is.EqualTo(0)); |
204 | Assert.That(pclo2.Simulator, Is.EqualTo(5)); | 204 | Assert.That(pclo2.Simulator, Is.EqualTo(5)); |
205 | 205 | ||
206 | // Now move it back again | 206 | // Now move it back again |
207 | sog.AbsolutePosition = new Vector3(2, 2, 2); | 207 | sog.AbsolutePosition = new Vector3(2, 2, 2); |
208 | 208 | ||
209 | Assert.That(pclo1.Owner, Is.EqualTo(5)); | 209 | Assert.That(pclo1.Owner, Is.EqualTo(5)); |
210 | Assert.That(pclo1.Group, Is.EqualTo(0)); | 210 | Assert.That(pclo1.Group, Is.EqualTo(0)); |
211 | Assert.That(pclo1.Others, Is.EqualTo(0)); | 211 | Assert.That(pclo1.Others, Is.EqualTo(0)); |
@@ -213,8 +213,8 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
213 | Assert.That(pclo1.Selected, Is.EqualTo(0)); | 213 | Assert.That(pclo1.Selected, Is.EqualTo(0)); |
214 | Assert.That(pclo1.Users[m_userId], Is.EqualTo(5)); | 214 | Assert.That(pclo1.Users[m_userId], Is.EqualTo(5)); |
215 | Assert.That(pclo1.Users[m_otherUserId], Is.EqualTo(0)); | 215 | Assert.That(pclo1.Users[m_otherUserId], Is.EqualTo(0)); |
216 | Assert.That(pclo1.Simulator, Is.EqualTo(5)); | 216 | Assert.That(pclo1.Simulator, Is.EqualTo(5)); |
217 | 217 | ||
218 | Assert.That(pclo2.Owner, Is.EqualTo(0)); | 218 | Assert.That(pclo2.Owner, Is.EqualTo(0)); |
219 | Assert.That(pclo2.Group, Is.EqualTo(0)); | 219 | Assert.That(pclo2.Group, Is.EqualTo(0)); |
220 | Assert.That(pclo2.Others, Is.EqualTo(0)); | 220 | Assert.That(pclo2.Others, Is.EqualTo(0)); |
@@ -222,9 +222,9 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
222 | Assert.That(pclo2.Selected, Is.EqualTo(0)); | 222 | Assert.That(pclo2.Selected, Is.EqualTo(0)); |
223 | Assert.That(pclo2.Users[m_userId], Is.EqualTo(0)); | 223 | Assert.That(pclo2.Users[m_userId], Is.EqualTo(0)); |
224 | Assert.That(pclo2.Users[m_otherUserId], Is.EqualTo(0)); | 224 | Assert.That(pclo2.Users[m_otherUserId], Is.EqualTo(0)); |
225 | Assert.That(pclo2.Simulator, Is.EqualTo(5)); | 225 | Assert.That(pclo2.Simulator, Is.EqualTo(5)); |
226 | } | 226 | } |
227 | 227 | ||
228 | /// <summary> | 228 | /// <summary> |
229 | /// Test count after a parcel owner owned object is removed. | 229 | /// Test count after a parcel owner owned object is removed. |
230 | /// </summary> | 230 | /// </summary> |
@@ -233,14 +233,14 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
233 | { | 233 | { |
234 | TestHelpers.InMethod(); | 234 | TestHelpers.InMethod(); |
235 | // log4net.Config.XmlConfigurator.Configure(); | 235 | // log4net.Config.XmlConfigurator.Configure(); |
236 | 236 | ||
237 | IPrimCounts pc = m_lo.PrimCounts; | 237 | IPrimCounts pc = m_lo.PrimCounts; |
238 | 238 | ||
239 | m_scene.AddNewSceneObject(SceneHelpers.CreateSceneObject(1, m_userId, "a", 0x1), false); | 239 | m_scene.AddNewSceneObject(SceneHelpers.CreateSceneObject(1, m_userId, "a", 0x1), false); |
240 | SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_userId, "b", 0x10); | 240 | SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_userId, "b", 0x10); |
241 | m_scene.AddNewSceneObject(sogToDelete, false); | 241 | m_scene.AddNewSceneObject(sogToDelete, false); |
242 | m_scene.DeleteSceneObject(sogToDelete, false); | 242 | m_scene.DeleteSceneObject(sogToDelete, false); |
243 | 243 | ||
244 | Assert.That(pc.Owner, Is.EqualTo(1)); | 244 | Assert.That(pc.Owner, Is.EqualTo(1)); |
245 | Assert.That(pc.Group, Is.EqualTo(0)); | 245 | Assert.That(pc.Group, Is.EqualTo(0)); |
246 | Assert.That(pc.Others, Is.EqualTo(0)); | 246 | Assert.That(pc.Others, Is.EqualTo(0)); |
@@ -248,37 +248,37 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
248 | Assert.That(pc.Selected, Is.EqualTo(0)); | 248 | Assert.That(pc.Selected, Is.EqualTo(0)); |
249 | Assert.That(pc.Users[m_userId], Is.EqualTo(1)); | 249 | Assert.That(pc.Users[m_userId], Is.EqualTo(1)); |
250 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 250 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
251 | Assert.That(pc.Simulator, Is.EqualTo(1)); | 251 | Assert.That(pc.Simulator, Is.EqualTo(1)); |
252 | } | 252 | } |
253 | 253 | ||
254 | [Test] | 254 | [Test] |
255 | public void TestAddGroupObject() | 255 | public void TestAddGroupObject() |
256 | { | 256 | { |
257 | TestHelpers.InMethod(); | 257 | TestHelpers.InMethod(); |
258 | // log4net.Config.XmlConfigurator.Configure(); | 258 | // log4net.Config.XmlConfigurator.Configure(); |
259 | 259 | ||
260 | m_lo.DeedToGroup(m_groupId); | 260 | m_lo.DeedToGroup(m_groupId); |
261 | 261 | ||
262 | IPrimCounts pc = m_lo.PrimCounts; | 262 | IPrimCounts pc = m_lo.PrimCounts; |
263 | 263 | ||
264 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01); | 264 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01); |
265 | sog.GroupID = m_groupId; | 265 | sog.GroupID = m_groupId; |
266 | m_scene.AddNewSceneObject(sog, false); | 266 | m_scene.AddNewSceneObject(sog, false); |
267 | 267 | ||
268 | Assert.That(pc.Owner, Is.EqualTo(0)); | 268 | Assert.That(pc.Owner, Is.EqualTo(0)); |
269 | Assert.That(pc.Group, Is.EqualTo(3)); | 269 | Assert.That(pc.Group, Is.EqualTo(3)); |
270 | Assert.That(pc.Others, Is.EqualTo(0)); | 270 | Assert.That(pc.Others, Is.EqualTo(0)); |
271 | Assert.That(pc.Total, Is.EqualTo(3)); | 271 | Assert.That(pc.Total, Is.EqualTo(3)); |
272 | Assert.That(pc.Selected, Is.EqualTo(0)); | 272 | Assert.That(pc.Selected, Is.EqualTo(0)); |
273 | 273 | ||
274 | // Is this desired behaviour? Not totally sure. | 274 | // Is this desired behaviour? Not totally sure. |
275 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); | 275 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); |
276 | Assert.That(pc.Users[m_groupId], Is.EqualTo(0)); | 276 | Assert.That(pc.Users[m_groupId], Is.EqualTo(0)); |
277 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(3)); | 277 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(3)); |
278 | 278 | ||
279 | Assert.That(pc.Simulator, Is.EqualTo(3)); | 279 | Assert.That(pc.Simulator, Is.EqualTo(3)); |
280 | } | 280 | } |
281 | 281 | ||
282 | /// <summary> | 282 | /// <summary> |
283 | /// Test count after a parcel owner owned object is removed. | 283 | /// Test count after a parcel owner owned object is removed. |
284 | /// </summary> | 284 | /// </summary> |
@@ -287,19 +287,19 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
287 | { | 287 | { |
288 | TestHelpers.InMethod(); | 288 | TestHelpers.InMethod(); |
289 | // log4net.Config.XmlConfigurator.Configure(); | 289 | // log4net.Config.XmlConfigurator.Configure(); |
290 | 290 | ||
291 | m_lo.DeedToGroup(m_groupId); | 291 | m_lo.DeedToGroup(m_groupId); |
292 | 292 | ||
293 | IPrimCounts pc = m_lo.PrimCounts; | 293 | IPrimCounts pc = m_lo.PrimCounts; |
294 | 294 | ||
295 | SceneObjectGroup sogToKeep = SceneHelpers.CreateSceneObject(1, m_userId, "a", 0x1); | 295 | SceneObjectGroup sogToKeep = SceneHelpers.CreateSceneObject(1, m_userId, "a", 0x1); |
296 | sogToKeep.GroupID = m_groupId; | 296 | sogToKeep.GroupID = m_groupId; |
297 | m_scene.AddNewSceneObject(sogToKeep, false); | 297 | m_scene.AddNewSceneObject(sogToKeep, false); |
298 | 298 | ||
299 | SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_userId, "b", 0x10); | 299 | SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_userId, "b", 0x10); |
300 | m_scene.AddNewSceneObject(sogToDelete, false); | 300 | m_scene.AddNewSceneObject(sogToDelete, false); |
301 | m_scene.DeleteSceneObject(sogToDelete, false); | 301 | m_scene.DeleteSceneObject(sogToDelete, false); |
302 | 302 | ||
303 | Assert.That(pc.Owner, Is.EqualTo(0)); | 303 | Assert.That(pc.Owner, Is.EqualTo(0)); |
304 | Assert.That(pc.Group, Is.EqualTo(1)); | 304 | Assert.That(pc.Group, Is.EqualTo(1)); |
305 | Assert.That(pc.Others, Is.EqualTo(0)); | 305 | Assert.That(pc.Others, Is.EqualTo(0)); |
@@ -308,20 +308,20 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
308 | Assert.That(pc.Users[m_userId], Is.EqualTo(1)); | 308 | Assert.That(pc.Users[m_userId], Is.EqualTo(1)); |
309 | Assert.That(pc.Users[m_groupId], Is.EqualTo(0)); | 309 | Assert.That(pc.Users[m_groupId], Is.EqualTo(0)); |
310 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 310 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
311 | Assert.That(pc.Simulator, Is.EqualTo(1)); | 311 | Assert.That(pc.Simulator, Is.EqualTo(1)); |
312 | } | 312 | } |
313 | 313 | ||
314 | [Test] | 314 | [Test] |
315 | public void TestAddOthersObject() | 315 | public void TestAddOthersObject() |
316 | { | 316 | { |
317 | TestHelpers.InMethod(); | 317 | TestHelpers.InMethod(); |
318 | // log4net.Config.XmlConfigurator.Configure(); | 318 | // log4net.Config.XmlConfigurator.Configure(); |
319 | 319 | ||
320 | IPrimCounts pc = m_lo.PrimCounts; | 320 | IPrimCounts pc = m_lo.PrimCounts; |
321 | 321 | ||
322 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01); | 322 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01); |
323 | m_scene.AddNewSceneObject(sog, false); | 323 | m_scene.AddNewSceneObject(sog, false); |
324 | 324 | ||
325 | Assert.That(pc.Owner, Is.EqualTo(0)); | 325 | Assert.That(pc.Owner, Is.EqualTo(0)); |
326 | Assert.That(pc.Group, Is.EqualTo(0)); | 326 | Assert.That(pc.Group, Is.EqualTo(0)); |
327 | Assert.That(pc.Others, Is.EqualTo(3)); | 327 | Assert.That(pc.Others, Is.EqualTo(3)); |
@@ -329,22 +329,22 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
329 | Assert.That(pc.Selected, Is.EqualTo(0)); | 329 | Assert.That(pc.Selected, Is.EqualTo(0)); |
330 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); | 330 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); |
331 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(3)); | 331 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(3)); |
332 | Assert.That(pc.Simulator, Is.EqualTo(3)); | 332 | Assert.That(pc.Simulator, Is.EqualTo(3)); |
333 | } | 333 | } |
334 | 334 | ||
335 | [Test] | 335 | [Test] |
336 | public void TestRemoveOthersObject() | 336 | public void TestRemoveOthersObject() |
337 | { | 337 | { |
338 | TestHelpers.InMethod(); | 338 | TestHelpers.InMethod(); |
339 | // log4net.Config.XmlConfigurator.Configure(); | 339 | // log4net.Config.XmlConfigurator.Configure(); |
340 | 340 | ||
341 | IPrimCounts pc = m_lo.PrimCounts; | 341 | IPrimCounts pc = m_lo.PrimCounts; |
342 | 342 | ||
343 | m_scene.AddNewSceneObject(SceneHelpers.CreateSceneObject(1, m_otherUserId, "a", 0x1), false); | 343 | m_scene.AddNewSceneObject(SceneHelpers.CreateSceneObject(1, m_otherUserId, "a", 0x1), false); |
344 | SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_otherUserId, "b", 0x10); | 344 | SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_otherUserId, "b", 0x10); |
345 | m_scene.AddNewSceneObject(sogToDelete, false); | 345 | m_scene.AddNewSceneObject(sogToDelete, false); |
346 | m_scene.DeleteSceneObject(sogToDelete, false); | 346 | m_scene.DeleteSceneObject(sogToDelete, false); |
347 | 347 | ||
348 | Assert.That(pc.Owner, Is.EqualTo(0)); | 348 | Assert.That(pc.Owner, Is.EqualTo(0)); |
349 | Assert.That(pc.Group, Is.EqualTo(0)); | 349 | Assert.That(pc.Group, Is.EqualTo(0)); |
350 | Assert.That(pc.Others, Is.EqualTo(1)); | 350 | Assert.That(pc.Others, Is.EqualTo(1)); |
@@ -352,9 +352,9 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
352 | Assert.That(pc.Selected, Is.EqualTo(0)); | 352 | Assert.That(pc.Selected, Is.EqualTo(0)); |
353 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); | 353 | Assert.That(pc.Users[m_userId], Is.EqualTo(0)); |
354 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(1)); | 354 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(1)); |
355 | Assert.That(pc.Simulator, Is.EqualTo(1)); | 355 | Assert.That(pc.Simulator, Is.EqualTo(1)); |
356 | } | 356 | } |
357 | 357 | ||
358 | /// <summary> | 358 | /// <summary> |
359 | /// Test the count is correct after is has been tainted. | 359 | /// Test the count is correct after is has been tainted. |
360 | /// </summary> | 360 | /// </summary> |
@@ -363,12 +363,12 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
363 | { | 363 | { |
364 | TestHelpers.InMethod(); | 364 | TestHelpers.InMethod(); |
365 | IPrimCounts pc = m_lo.PrimCounts; | 365 | IPrimCounts pc = m_lo.PrimCounts; |
366 | 366 | ||
367 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); | 367 | SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); |
368 | m_scene.AddNewSceneObject(sog, false); | 368 | m_scene.AddNewSceneObject(sog, false); |
369 | 369 | ||
370 | m_pcm.TaintPrimCount(); | 370 | m_pcm.TaintPrimCount(); |
371 | 371 | ||
372 | Assert.That(pc.Owner, Is.EqualTo(3)); | 372 | Assert.That(pc.Owner, Is.EqualTo(3)); |
373 | Assert.That(pc.Group, Is.EqualTo(0)); | 373 | Assert.That(pc.Group, Is.EqualTo(0)); |
374 | Assert.That(pc.Others, Is.EqualTo(0)); | 374 | Assert.That(pc.Others, Is.EqualTo(0)); |
@@ -376,7 +376,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests | |||
376 | Assert.That(pc.Selected, Is.EqualTo(0)); | 376 | Assert.That(pc.Selected, Is.EqualTo(0)); |
377 | Assert.That(pc.Users[m_userId], Is.EqualTo(3)); | 377 | Assert.That(pc.Users[m_userId], Is.EqualTo(3)); |
378 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); | 378 | Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); |
379 | Assert.That(pc.Simulator, Is.EqualTo(3)); | 379 | Assert.That(pc.Simulator, Is.EqualTo(3)); |
380 | } | 380 | } |
381 | } | 381 | } |
382 | } \ No newline at end of file | 382 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs index 1f2b7c4..b927cfa 100644 --- a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs +++ b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs | |||
@@ -82,11 +82,11 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap | |||
82 | 82 | ||
83 | string[] configSections = new string[] { "Map", "Startup" }; | 83 | string[] configSections = new string[] { "Map", "Startup" }; |
84 | 84 | ||
85 | drawPrimVolume | 85 | drawPrimVolume |
86 | = Util.GetConfigVarFromSections<bool>(m_config, "DrawPrimOnMapTile", configSections, drawPrimVolume); | 86 | = Util.GetConfigVarFromSections<bool>(m_config, "DrawPrimOnMapTile", configSections, drawPrimVolume); |
87 | textureTerrain | 87 | textureTerrain |
88 | = Util.GetConfigVarFromSections<bool>(m_config, "TextureOnMapTile", configSections, textureTerrain); | 88 | = Util.GetConfigVarFromSections<bool>(m_config, "TextureOnMapTile", configSections, textureTerrain); |
89 | generateMaptiles | 89 | generateMaptiles |
90 | = Util.GetConfigVarFromSections<bool>(m_config, "GenerateMaptiles", configSections, generateMaptiles); | 90 | = Util.GetConfigVarFromSections<bool>(m_config, "GenerateMaptiles", configSections, generateMaptiles); |
91 | 91 | ||
92 | if (generateMaptiles) | 92 | if (generateMaptiles) |
@@ -126,15 +126,15 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap | |||
126 | catch (Exception) | 126 | catch (Exception) |
127 | { | 127 | { |
128 | m_log.ErrorFormat( | 128 | m_log.ErrorFormat( |
129 | "[MAPTILE]: Failed to load Static map image texture file: {0} for {1}", | 129 | "[MAPTILE]: Failed to load Static map image texture file: {0} for {1}", |
130 | m_scene.RegionInfo.MaptileStaticFile, m_scene.Name); | 130 | m_scene.RegionInfo.MaptileStaticFile, m_scene.Name); |
131 | //mapbmp = new Bitmap((int)m_scene.Heightmap.Width, (int)m_scene.Heightmap.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb); | 131 | //mapbmp = new Bitmap((int)m_scene.Heightmap.Width, (int)m_scene.Heightmap.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb); |
132 | mapbmp = null; | 132 | mapbmp = null; |
133 | } | 133 | } |
134 | 134 | ||
135 | if (mapbmp != null) | 135 | if (mapbmp != null) |
136 | m_log.DebugFormat( | 136 | m_log.DebugFormat( |
137 | "[MAPTILE]: Static map image texture file {0} found for {1}", | 137 | "[MAPTILE]: Static map image texture file {0} found for {1}", |
138 | m_scene.RegionInfo.MaptileStaticFile, m_scene.Name); | 138 | m_scene.RegionInfo.MaptileStaticFile, m_scene.Name); |
139 | } | 139 | } |
140 | } | 140 | } |
@@ -308,7 +308,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap | |||
308 | List<uint> z_localIDs = new List<uint>(); | 308 | List<uint> z_localIDs = new List<uint>(); |
309 | Dictionary<uint, DrawStruct> z_sort = new Dictionary<uint, DrawStruct>(); | 309 | Dictionary<uint, DrawStruct> z_sort = new Dictionary<uint, DrawStruct>(); |
310 | 310 | ||
311 | try | 311 | try |
312 | { | 312 | { |
313 | lock (objs) | 313 | lock (objs) |
314 | { | 314 | { |
diff --git a/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs b/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs index 0ec2053..4b3ee18 100644 --- a/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs +++ b/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs | |||
@@ -180,7 +180,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap | |||
180 | 180 | ||
181 | ManagedImage managedImage; | 181 | ManagedImage managedImage; |
182 | Image image; | 182 | Image image; |
183 | 183 | ||
184 | try | 184 | try |
185 | { | 185 | { |
186 | if (OpenJPEG.DecodeToImage(asset.Data, out managedImage, out image)) | 186 | if (OpenJPEG.DecodeToImage(asset.Data, out managedImage, out image)) |
@@ -201,7 +201,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap | |||
201 | m_log.ErrorFormat("{0} OpenJpeg was unable to encode this. Asset Data is empty for {1}", LogHeader, id); | 201 | m_log.ErrorFormat("{0} OpenJpeg was unable to encode this. Asset Data is empty for {1}", LogHeader, id); |
202 | } | 202 | } |
203 | return null; | 203 | return null; |
204 | 204 | ||
205 | } | 205 | } |
206 | 206 | ||
207 | // Compute the average color of a texture. | 207 | // Compute the average color of a texture. |
diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs index 46b0470..1070ae6 100644 --- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs +++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs | |||
@@ -56,7 +56,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
56 | public class MoapModule : INonSharedRegionModule, IMoapModule | 56 | public class MoapModule : INonSharedRegionModule, IMoapModule |
57 | { | 57 | { |
58 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 58 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
59 | 59 | ||
60 | public string Name { get { return "MoapModule"; } } | 60 | public string Name { get { return "MoapModule"; } } |
61 | public Type ReplaceableInterface { get { return null; } } | 61 | public Type ReplaceableInterface { get { return null; } } |
62 | 62 | ||
@@ -64,33 +64,33 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
64 | /// Is this module enabled? | 64 | /// Is this module enabled? |
65 | /// </summary> | 65 | /// </summary> |
66 | protected bool m_isEnabled = true; | 66 | protected bool m_isEnabled = true; |
67 | 67 | ||
68 | /// <summary> | 68 | /// <summary> |
69 | /// The scene to which this module is attached | 69 | /// The scene to which this module is attached |
70 | /// </summary> | 70 | /// </summary> |
71 | protected Scene m_scene; | 71 | protected Scene m_scene; |
72 | 72 | ||
73 | /// <summary> | 73 | /// <summary> |
74 | /// Track the ObjectMedia capabilities given to users keyed by path | 74 | /// Track the ObjectMedia capabilities given to users keyed by path |
75 | /// </summary> | 75 | /// </summary> |
76 | protected Dictionary<string, UUID> m_omCapUsers = new Dictionary<string, UUID>(); | 76 | protected Dictionary<string, UUID> m_omCapUsers = new Dictionary<string, UUID>(); |
77 | 77 | ||
78 | /// <summary> | 78 | /// <summary> |
79 | /// Track the ObjectMedia capabilities given to users keyed by agent. Lock m_omCapUsers to manipulate. | 79 | /// Track the ObjectMedia capabilities given to users keyed by agent. Lock m_omCapUsers to manipulate. |
80 | /// </summary> | 80 | /// </summary> |
81 | protected Dictionary<UUID, string> m_omCapUrls = new Dictionary<UUID, string>(); | 81 | protected Dictionary<UUID, string> m_omCapUrls = new Dictionary<UUID, string>(); |
82 | 82 | ||
83 | /// <summary> | 83 | /// <summary> |
84 | /// Track the ObjectMediaUpdate capabilities given to users keyed by path | 84 | /// Track the ObjectMediaUpdate capabilities given to users keyed by path |
85 | /// </summary> | 85 | /// </summary> |
86 | protected Dictionary<string, UUID> m_omuCapUsers = new Dictionary<string, UUID>(); | 86 | protected Dictionary<string, UUID> m_omuCapUsers = new Dictionary<string, UUID>(); |
87 | 87 | ||
88 | /// <summary> | 88 | /// <summary> |
89 | /// Track the ObjectMediaUpdate capabilities given to users keyed by agent. Lock m_omuCapUsers to manipulate | 89 | /// Track the ObjectMediaUpdate capabilities given to users keyed by agent. Lock m_omuCapUsers to manipulate |
90 | /// </summary> | 90 | /// </summary> |
91 | protected Dictionary<UUID, string> m_omuCapUrls = new Dictionary<UUID, string>(); | 91 | protected Dictionary<UUID, string> m_omuCapUrls = new Dictionary<UUID, string>(); |
92 | 92 | ||
93 | public void Initialise(IConfigSource configSource) | 93 | public void Initialise(IConfigSource configSource) |
94 | { | 94 | { |
95 | IConfig config = configSource.Configs["MediaOnAPrim"]; | 95 | IConfig config = configSource.Configs["MediaOnAPrim"]; |
96 | 96 | ||
@@ -100,63 +100,63 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
100 | // m_log.Debug("[MOAP]: Initialised module.")l | 100 | // m_log.Debug("[MOAP]: Initialised module.")l |
101 | } | 101 | } |
102 | 102 | ||
103 | public void AddRegion(Scene scene) | 103 | public void AddRegion(Scene scene) |
104 | { | 104 | { |
105 | if (!m_isEnabled) | 105 | if (!m_isEnabled) |
106 | return; | 106 | return; |
107 | 107 | ||
108 | m_scene = scene; | 108 | m_scene = scene; |
109 | m_scene.RegisterModuleInterface<IMoapModule>(this); | 109 | m_scene.RegisterModuleInterface<IMoapModule>(this); |
110 | } | 110 | } |
111 | 111 | ||
112 | public void RemoveRegion(Scene scene) {} | 112 | public void RemoveRegion(Scene scene) {} |
113 | 113 | ||
114 | public void RegionLoaded(Scene scene) | 114 | public void RegionLoaded(Scene scene) |
115 | { | 115 | { |
116 | if (!m_isEnabled) | 116 | if (!m_isEnabled) |
117 | return; | 117 | return; |
118 | 118 | ||
119 | m_scene.EventManager.OnRegisterCaps += OnRegisterCaps; | 119 | m_scene.EventManager.OnRegisterCaps += OnRegisterCaps; |
120 | m_scene.EventManager.OnDeregisterCaps += OnDeregisterCaps; | 120 | m_scene.EventManager.OnDeregisterCaps += OnDeregisterCaps; |
121 | m_scene.EventManager.OnSceneObjectPartCopy += OnSceneObjectPartCopy; | 121 | m_scene.EventManager.OnSceneObjectPartCopy += OnSceneObjectPartCopy; |
122 | } | 122 | } |
123 | 123 | ||
124 | public void Close() | 124 | public void Close() |
125 | { | 125 | { |
126 | if (!m_isEnabled) | 126 | if (!m_isEnabled) |
127 | return; | 127 | return; |
128 | 128 | ||
129 | m_scene.EventManager.OnRegisterCaps -= OnRegisterCaps; | 129 | m_scene.EventManager.OnRegisterCaps -= OnRegisterCaps; |
130 | m_scene.EventManager.OnDeregisterCaps -= OnDeregisterCaps; | 130 | m_scene.EventManager.OnDeregisterCaps -= OnDeregisterCaps; |
131 | m_scene.EventManager.OnSceneObjectPartCopy -= OnSceneObjectPartCopy; | 131 | m_scene.EventManager.OnSceneObjectPartCopy -= OnSceneObjectPartCopy; |
132 | } | 132 | } |
133 | 133 | ||
134 | public void OnRegisterCaps(UUID agentID, Caps caps) | 134 | public void OnRegisterCaps(UUID agentID, Caps caps) |
135 | { | 135 | { |
136 | // m_log.DebugFormat( | 136 | // m_log.DebugFormat( |
137 | // "[MOAP]: Registering ObjectMedia and ObjectMediaNavigate capabilities for agent {0}", agentID); | 137 | // "[MOAP]: Registering ObjectMedia and ObjectMediaNavigate capabilities for agent {0}", agentID); |
138 | 138 | ||
139 | string omCapUrl = "/CAPS/" + UUID.Random(); | 139 | string omCapUrl = "/CAPS/" + UUID.Random(); |
140 | 140 | ||
141 | lock (m_omCapUsers) | 141 | lock (m_omCapUsers) |
142 | { | 142 | { |
143 | m_omCapUsers[omCapUrl] = agentID; | 143 | m_omCapUsers[omCapUrl] = agentID; |
144 | m_omCapUrls[agentID] = omCapUrl; | 144 | m_omCapUrls[agentID] = omCapUrl; |
145 | 145 | ||
146 | // Even though we're registering for POST we're going to get GETS and UPDATES too | 146 | // Even though we're registering for POST we're going to get GETS and UPDATES too |
147 | caps.RegisterHandler( | 147 | caps.RegisterHandler( |
148 | "ObjectMedia", | 148 | "ObjectMedia", |
149 | new RestStreamHandler( | 149 | new RestStreamHandler( |
150 | "POST", omCapUrl, HandleObjectMediaMessage, "ObjectMedia", agentID.ToString())); | 150 | "POST", omCapUrl, HandleObjectMediaMessage, "ObjectMedia", agentID.ToString())); |
151 | } | 151 | } |
152 | 152 | ||
153 | string omuCapUrl = "/CAPS/" + UUID.Random(); | 153 | string omuCapUrl = "/CAPS/" + UUID.Random(); |
154 | 154 | ||
155 | lock (m_omuCapUsers) | 155 | lock (m_omuCapUsers) |
156 | { | 156 | { |
157 | m_omuCapUsers[omuCapUrl] = agentID; | 157 | m_omuCapUsers[omuCapUrl] = agentID; |
158 | m_omuCapUrls[agentID] = omuCapUrl; | 158 | m_omuCapUrls[agentID] = omuCapUrl; |
159 | 159 | ||
160 | // Even though we're registering for POST we're going to get GETS and UPDATES too | 160 | // Even though we're registering for POST we're going to get GETS and UPDATES too |
161 | caps.RegisterHandler( | 161 | caps.RegisterHandler( |
162 | "ObjectMediaNavigate", | 162 | "ObjectMediaNavigate", |
@@ -164,7 +164,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
164 | "POST", omuCapUrl, HandleObjectMediaNavigateMessage, "ObjectMediaNavigate", agentID.ToString())); | 164 | "POST", omuCapUrl, HandleObjectMediaNavigateMessage, "ObjectMediaNavigate", agentID.ToString())); |
165 | } | 165 | } |
166 | } | 166 | } |
167 | 167 | ||
168 | public void OnDeregisterCaps(UUID agentID, Caps caps) | 168 | public void OnDeregisterCaps(UUID agentID, Caps caps) |
169 | { | 169 | { |
170 | lock (m_omCapUsers) | 170 | lock (m_omCapUsers) |
@@ -173,7 +173,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
173 | m_omCapUrls.Remove(agentID); | 173 | m_omCapUrls.Remove(agentID); |
174 | m_omCapUsers.Remove(path); | 174 | m_omCapUsers.Remove(path); |
175 | } | 175 | } |
176 | 176 | ||
177 | lock (m_omuCapUsers) | 177 | lock (m_omuCapUsers) |
178 | { | 178 | { |
179 | string path = m_omuCapUrls[agentID]; | 179 | string path = m_omuCapUrls[agentID]; |
@@ -181,7 +181,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
181 | m_omuCapUsers.Remove(path); | 181 | m_omuCapUsers.Remove(path); |
182 | } | 182 | } |
183 | } | 183 | } |
184 | 184 | ||
185 | protected void OnSceneObjectPartCopy(SceneObjectPart copy, SceneObjectPart original, bool userExposed) | 185 | protected void OnSceneObjectPartCopy(SceneObjectPart copy, SceneObjectPart original, bool userExposed) |
186 | { | 186 | { |
187 | if (original.Shape.Media != null) | 187 | if (original.Shape.Media != null) |
@@ -197,19 +197,19 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
197 | dupeMedia.Add(null); | 197 | dupeMedia.Add(null); |
198 | } | 198 | } |
199 | } | 199 | } |
200 | 200 | ||
201 | copy.Shape.Media = dupeMedia; | 201 | copy.Shape.Media = dupeMedia; |
202 | } | 202 | } |
203 | } | 203 | } |
204 | 204 | ||
205 | public MediaEntry GetMediaEntry(SceneObjectPart part, int face) | 205 | public MediaEntry GetMediaEntry(SceneObjectPart part, int face) |
206 | { | 206 | { |
207 | MediaEntry me = null; | 207 | MediaEntry me = null; |
208 | 208 | ||
209 | CheckFaceParam(part, face); | 209 | CheckFaceParam(part, face); |
210 | 210 | ||
211 | List<MediaEntry> media = part.Shape.Media; | 211 | List<MediaEntry> media = part.Shape.Media; |
212 | 212 | ||
213 | if (null == media) | 213 | if (null == media) |
214 | { | 214 | { |
215 | me = null; | 215 | me = null; |
@@ -218,17 +218,17 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
218 | { | 218 | { |
219 | lock (media) | 219 | lock (media) |
220 | me = media[face]; | 220 | me = media[face]; |
221 | 221 | ||
222 | // TODO: Really need a proper copy constructor down in libopenmetaverse | 222 | // TODO: Really need a proper copy constructor down in libopenmetaverse |
223 | if (me != null) | 223 | if (me != null) |
224 | me = MediaEntry.FromOSD(me.GetOSD()); | 224 | me = MediaEntry.FromOSD(me.GetOSD()); |
225 | } | 225 | } |
226 | 226 | ||
227 | // m_log.DebugFormat("[MOAP]: GetMediaEntry for {0} face {1} found {2}", part.Name, face, me); | 227 | // m_log.DebugFormat("[MOAP]: GetMediaEntry for {0} face {1} found {2}", part.Name, face, me); |
228 | 228 | ||
229 | return me; | 229 | return me; |
230 | } | 230 | } |
231 | 231 | ||
232 | /// <summary> | 232 | /// <summary> |
233 | /// Set the media entry on the face of the given part. | 233 | /// Set the media entry on the face of the given part. |
234 | /// </summary> | 234 | /// </summary> |
@@ -238,28 +238,28 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
238 | public void SetMediaEntry(SceneObjectPart part, int face, MediaEntry me) | 238 | public void SetMediaEntry(SceneObjectPart part, int face, MediaEntry me) |
239 | { | 239 | { |
240 | // m_log.DebugFormat("[MOAP]: SetMediaEntry for {0}, face {1}", part.Name, face); | 240 | // m_log.DebugFormat("[MOAP]: SetMediaEntry for {0}, face {1}", part.Name, face); |
241 | 241 | ||
242 | CheckFaceParam(part, face); | 242 | CheckFaceParam(part, face); |
243 | 243 | ||
244 | if (null == part.Shape.Media) | 244 | if (null == part.Shape.Media) |
245 | { | 245 | { |
246 | if (me == null) | 246 | if (me == null) |
247 | return; | 247 | return; |
248 | else | 248 | else |
249 | part.Shape.Media = new PrimitiveBaseShape.MediaList(new MediaEntry[part.GetNumberOfSides()]); | 249 | part.Shape.Media = new PrimitiveBaseShape.MediaList(new MediaEntry[part.GetNumberOfSides()]); |
250 | } | 250 | } |
251 | 251 | ||
252 | lock (part.Shape.Media) | 252 | lock (part.Shape.Media) |
253 | part.Shape.Media[face] = me; | 253 | part.Shape.Media[face] = me; |
254 | 254 | ||
255 | UpdateMediaUrl(part, UUID.Zero); | 255 | UpdateMediaUrl(part, UUID.Zero); |
256 | 256 | ||
257 | SetPartMediaFlags(part, face, me != null); | 257 | SetPartMediaFlags(part, face, me != null); |
258 | 258 | ||
259 | part.ScheduleFullUpdate(); | 259 | part.ScheduleFullUpdate(); |
260 | part.TriggerScriptChangedEvent(Changed.MEDIA); | 260 | part.TriggerScriptChangedEvent(Changed.MEDIA); |
261 | } | 261 | } |
262 | 262 | ||
263 | /// <summary> | 263 | /// <summary> |
264 | /// Clear the media entry from the face of the given part. | 264 | /// Clear the media entry from the face of the given part. |
265 | /// </summary> | 265 | /// </summary> |
@@ -267,9 +267,9 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
267 | /// <param name="face"></param> | 267 | /// <param name="face"></param> |
268 | public void ClearMediaEntry(SceneObjectPart part, int face) | 268 | public void ClearMediaEntry(SceneObjectPart part, int face) |
269 | { | 269 | { |
270 | SetMediaEntry(part, face, null); | 270 | SetMediaEntry(part, face, null); |
271 | } | 271 | } |
272 | 272 | ||
273 | /// <summary> | 273 | /// <summary> |
274 | /// Set the media flags on the texture face of the given part. | 274 | /// Set the media flags on the texture face of the given part. |
275 | /// </summary> | 275 | /// </summary> |
@@ -284,9 +284,9 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
284 | Primitive.TextureEntry te = part.Shape.Textures; | 284 | Primitive.TextureEntry te = part.Shape.Textures; |
285 | Primitive.TextureEntryFace teFace = te.CreateFace((uint)face); | 285 | Primitive.TextureEntryFace teFace = te.CreateFace((uint)face); |
286 | teFace.MediaFlags = flag; | 286 | teFace.MediaFlags = flag; |
287 | part.Shape.Textures = te; | 287 | part.Shape.Textures = te; |
288 | } | 288 | } |
289 | 289 | ||
290 | /// <summary> | 290 | /// <summary> |
291 | /// Sets or gets per face media textures. | 291 | /// Sets or gets per face media textures. |
292 | /// </summary> | 292 | /// </summary> |
@@ -300,11 +300,11 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
300 | string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 300 | string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
301 | { | 301 | { |
302 | // m_log.DebugFormat("[MOAP]: Got ObjectMedia path [{0}], raw request [{1}]", path, request); | 302 | // m_log.DebugFormat("[MOAP]: Got ObjectMedia path [{0}], raw request [{1}]", path, request); |
303 | 303 | ||
304 | OSDMap osd = (OSDMap)OSDParser.DeserializeLLSDXml(request); | 304 | OSDMap osd = (OSDMap)OSDParser.DeserializeLLSDXml(request); |
305 | ObjectMediaMessage omm = new ObjectMediaMessage(); | 305 | ObjectMediaMessage omm = new ObjectMediaMessage(); |
306 | omm.Deserialize(osd); | 306 | omm.Deserialize(osd); |
307 | 307 | ||
308 | if (omm.Request is ObjectMediaRequest) | 308 | if (omm.Request is ObjectMediaRequest) |
309 | return HandleObjectMediaRequest(omm.Request as ObjectMediaRequest); | 309 | return HandleObjectMediaRequest(omm.Request as ObjectMediaRequest); |
310 | else if (omm.Request is ObjectMediaUpdate) | 310 | else if (omm.Request is ObjectMediaUpdate) |
@@ -312,10 +312,10 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
312 | 312 | ||
313 | throw new Exception( | 313 | throw new Exception( |
314 | string.Format( | 314 | string.Format( |
315 | "[MOAP]: ObjectMediaMessage has unrecognized ObjectMediaBlock of {0}", | 315 | "[MOAP]: ObjectMediaMessage has unrecognized ObjectMediaBlock of {0}", |
316 | omm.Request.GetType())); | 316 | omm.Request.GetType())); |
317 | } | 317 | } |
318 | 318 | ||
319 | /// <summary> | 319 | /// <summary> |
320 | /// Handle a fetch request for media textures | 320 | /// Handle a fetch request for media textures |
321 | /// </summary> | 321 | /// </summary> |
@@ -324,36 +324,36 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
324 | protected string HandleObjectMediaRequest(ObjectMediaRequest omr) | 324 | protected string HandleObjectMediaRequest(ObjectMediaRequest omr) |
325 | { | 325 | { |
326 | UUID primId = omr.PrimID; | 326 | UUID primId = omr.PrimID; |
327 | 327 | ||
328 | SceneObjectPart part = m_scene.GetSceneObjectPart(primId); | 328 | SceneObjectPart part = m_scene.GetSceneObjectPart(primId); |
329 | 329 | ||
330 | if (null == part) | 330 | if (null == part) |
331 | { | 331 | { |
332 | m_log.WarnFormat( | 332 | m_log.WarnFormat( |
333 | "[MOAP]: Received a GET ObjectMediaRequest for prim {0} but this doesn't exist in region {1}", | 333 | "[MOAP]: Received a GET ObjectMediaRequest for prim {0} but this doesn't exist in region {1}", |
334 | primId, m_scene.RegionInfo.RegionName); | 334 | primId, m_scene.RegionInfo.RegionName); |
335 | return string.Empty; | 335 | return string.Empty; |
336 | } | 336 | } |
337 | 337 | ||
338 | if (null == part.Shape.Media) | 338 | if (null == part.Shape.Media) |
339 | return string.Empty; | 339 | return string.Empty; |
340 | 340 | ||
341 | ObjectMediaResponse resp = new ObjectMediaResponse(); | 341 | ObjectMediaResponse resp = new ObjectMediaResponse(); |
342 | 342 | ||
343 | resp.PrimID = primId; | 343 | resp.PrimID = primId; |
344 | 344 | ||
345 | lock (part.Shape.Media) | 345 | lock (part.Shape.Media) |
346 | resp.FaceMedia = part.Shape.Media.ToArray(); | 346 | resp.FaceMedia = part.Shape.Media.ToArray(); |
347 | 347 | ||
348 | resp.Version = part.MediaUrl; | 348 | resp.Version = part.MediaUrl; |
349 | 349 | ||
350 | string rawResp = OSDParser.SerializeLLSDXmlString(resp.Serialize()); | 350 | string rawResp = OSDParser.SerializeLLSDXmlString(resp.Serialize()); |
351 | 351 | ||
352 | // m_log.DebugFormat("[MOAP]: Got HandleObjectMediaRequestGet raw response is [{0}]", rawResp); | 352 | // m_log.DebugFormat("[MOAP]: Got HandleObjectMediaRequestGet raw response is [{0}]", rawResp); |
353 | 353 | ||
354 | return rawResp; | 354 | return rawResp; |
355 | } | 355 | } |
356 | 356 | ||
357 | /// <summary> | 357 | /// <summary> |
358 | /// Handle an update of media textures. | 358 | /// Handle an update of media textures. |
359 | /// </summary> | 359 | /// </summary> |
@@ -363,46 +363,46 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
363 | protected string HandleObjectMediaUpdate(string path, ObjectMediaUpdate omu) | 363 | protected string HandleObjectMediaUpdate(string path, ObjectMediaUpdate omu) |
364 | { | 364 | { |
365 | UUID primId = omu.PrimID; | 365 | UUID primId = omu.PrimID; |
366 | 366 | ||
367 | SceneObjectPart part = m_scene.GetSceneObjectPart(primId); | 367 | SceneObjectPart part = m_scene.GetSceneObjectPart(primId); |
368 | 368 | ||
369 | if (null == part) | 369 | if (null == part) |
370 | { | 370 | { |
371 | m_log.WarnFormat( | 371 | m_log.WarnFormat( |
372 | "[MOAP]: Received an UPDATE ObjectMediaRequest for prim {0} but this doesn't exist in region {1}", | 372 | "[MOAP]: Received an UPDATE ObjectMediaRequest for prim {0} but this doesn't exist in region {1}", |
373 | primId, m_scene.RegionInfo.RegionName); | 373 | primId, m_scene.RegionInfo.RegionName); |
374 | return string.Empty; | 374 | return string.Empty; |
375 | } | 375 | } |
376 | 376 | ||
377 | // m_log.DebugFormat("[MOAP]: Received {0} media entries for prim {1}", omu.FaceMedia.Length, primId); | 377 | // m_log.DebugFormat("[MOAP]: Received {0} media entries for prim {1}", omu.FaceMedia.Length, primId); |
378 | // | 378 | // |
379 | // for (int i = 0; i < omu.FaceMedia.Length; i++) | 379 | // for (int i = 0; i < omu.FaceMedia.Length; i++) |
380 | // { | 380 | // { |
381 | // MediaEntry me = omu.FaceMedia[i]; | 381 | // MediaEntry me = omu.FaceMedia[i]; |
382 | // string v = (null == me ? "null": OSDParser.SerializeLLSDXmlString(me.GetOSD())); | 382 | // string v = (null == me ? "null": OSDParser.SerializeLLSDXmlString(me.GetOSD())); |
383 | // m_log.DebugFormat("[MOAP]: Face {0} [{1}]", i, v); | 383 | // m_log.DebugFormat("[MOAP]: Face {0} [{1}]", i, v); |
384 | // } | 384 | // } |
385 | 385 | ||
386 | if (omu.FaceMedia.Length > part.GetNumberOfSides()) | 386 | if (omu.FaceMedia.Length > part.GetNumberOfSides()) |
387 | { | 387 | { |
388 | m_log.WarnFormat( | 388 | m_log.WarnFormat( |
389 | "[MOAP]: Received {0} media entries from client for prim {1} {2} but this prim has only {3} faces. Dropping request.", | 389 | "[MOAP]: Received {0} media entries from client for prim {1} {2} but this prim has only {3} faces. Dropping request.", |
390 | omu.FaceMedia.Length, part.Name, part.UUID, part.GetNumberOfSides()); | 390 | omu.FaceMedia.Length, part.Name, part.UUID, part.GetNumberOfSides()); |
391 | return string.Empty; | 391 | return string.Empty; |
392 | } | 392 | } |
393 | 393 | ||
394 | UUID agentId = default(UUID); | 394 | UUID agentId = default(UUID); |
395 | 395 | ||
396 | lock (m_omCapUsers) | 396 | lock (m_omCapUsers) |
397 | agentId = m_omCapUsers[path]; | 397 | agentId = m_omCapUsers[path]; |
398 | 398 | ||
399 | List<MediaEntry> media = part.Shape.Media; | 399 | List<MediaEntry> media = part.Shape.Media; |
400 | 400 | ||
401 | if (null == media) | 401 | if (null == media) |
402 | { | 402 | { |
403 | // m_log.DebugFormat("[MOAP]: Setting all new media list for {0}", part.Name); | 403 | // m_log.DebugFormat("[MOAP]: Setting all new media list for {0}", part.Name); |
404 | part.Shape.Media = new PrimitiveBaseShape.MediaList(omu.FaceMedia); | 404 | part.Shape.Media = new PrimitiveBaseShape.MediaList(omu.FaceMedia); |
405 | 405 | ||
406 | for (int i = 0; i < omu.FaceMedia.Length; i++) | 406 | for (int i = 0; i < omu.FaceMedia.Length; i++) |
407 | { | 407 | { |
408 | if (omu.FaceMedia[i] != null) | 408 | if (omu.FaceMedia[i] != null) |
@@ -412,7 +412,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
412 | // directly. | 412 | // directly. |
413 | SetPartMediaFlags(part, i, true); | 413 | SetPartMediaFlags(part, i, true); |
414 | // m_log.DebugFormat( | 414 | // m_log.DebugFormat( |
415 | // "[MOAP]: Media flags for face {0} is {1}", | 415 | // "[MOAP]: Media flags for face {0} is {1}", |
416 | // i, part.Shape.Textures.FaceTextures[i].MediaFlags); | 416 | // i, part.Shape.Textures.FaceTextures[i].MediaFlags); |
417 | } | 417 | } |
418 | } | 418 | } |
@@ -420,15 +420,15 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
420 | else | 420 | else |
421 | { | 421 | { |
422 | // m_log.DebugFormat("[MOAP]: Setting existing media list for {0}", part.Name); | 422 | // m_log.DebugFormat("[MOAP]: Setting existing media list for {0}", part.Name); |
423 | 423 | ||
424 | // We need to go through the media textures one at a time to make sure that we have permission | 424 | // We need to go through the media textures one at a time to make sure that we have permission |
425 | // to change them | 425 | // to change them |
426 | 426 | ||
427 | // FIXME: Race condition here since some other texture entry manipulator may overwrite/get | 427 | // FIXME: Race condition here since some other texture entry manipulator may overwrite/get |
428 | // overwritten. Unfortunately, PrimitiveBaseShape does not allow us to change texture entry | 428 | // overwritten. Unfortunately, PrimitiveBaseShape does not allow us to change texture entry |
429 | // directly. | 429 | // directly. |
430 | Primitive.TextureEntry te = part.Shape.Textures; | 430 | Primitive.TextureEntry te = part.Shape.Textures; |
431 | 431 | ||
432 | lock (media) | 432 | lock (media) |
433 | { | 433 | { |
434 | for (int i = 0; i < media.Count; i++) | 434 | for (int i = 0; i < media.Count; i++) |
@@ -436,38 +436,38 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
436 | if (m_scene.Permissions.CanControlPrimMedia(agentId, part.UUID, i)) | 436 | if (m_scene.Permissions.CanControlPrimMedia(agentId, part.UUID, i)) |
437 | { | 437 | { |
438 | media[i] = omu.FaceMedia[i]; | 438 | media[i] = omu.FaceMedia[i]; |
439 | 439 | ||
440 | // When a face is cleared this is done by setting the MediaFlags in the TextureEntry via a normal | 440 | // When a face is cleared this is done by setting the MediaFlags in the TextureEntry via a normal |
441 | // texture update, so we don't need to worry about clearing MediaFlags here. | 441 | // texture update, so we don't need to worry about clearing MediaFlags here. |
442 | if (null == media[i]) | 442 | if (null == media[i]) |
443 | continue; | 443 | continue; |
444 | 444 | ||
445 | SetPartMediaFlags(part, i, true); | 445 | SetPartMediaFlags(part, i, true); |
446 | 446 | ||
447 | // m_log.DebugFormat( | 447 | // m_log.DebugFormat( |
448 | // "[MOAP]: Media flags for face {0} is {1}", | 448 | // "[MOAP]: Media flags for face {0} is {1}", |
449 | // i, face.MediaFlags); | 449 | // i, face.MediaFlags); |
450 | // m_log.DebugFormat("[MOAP]: Set media entry for face {0} on {1}", i, part.Name); | 450 | // m_log.DebugFormat("[MOAP]: Set media entry for face {0} on {1}", i, part.Name); |
451 | } | 451 | } |
452 | } | 452 | } |
453 | } | 453 | } |
454 | 454 | ||
455 | part.Shape.Textures = te; | 455 | part.Shape.Textures = te; |
456 | 456 | ||
457 | // for (int i2 = 0; i2 < part.Shape.Textures.FaceTextures.Length; i2++) | 457 | // for (int i2 = 0; i2 < part.Shape.Textures.FaceTextures.Length; i2++) |
458 | // m_log.DebugFormat("[MOAP]: FaceTexture[{0}] is {1}", i2, part.Shape.Textures.FaceTextures[i2]); | 458 | // m_log.DebugFormat("[MOAP]: FaceTexture[{0}] is {1}", i2, part.Shape.Textures.FaceTextures[i2]); |
459 | } | 459 | } |
460 | 460 | ||
461 | UpdateMediaUrl(part, agentId); | 461 | UpdateMediaUrl(part, agentId); |
462 | 462 | ||
463 | // Arguably, we could avoid sending a full update to the avatar that just changed the texture. | 463 | // Arguably, we could avoid sending a full update to the avatar that just changed the texture. |
464 | part.ScheduleFullUpdate(); | 464 | part.ScheduleFullUpdate(); |
465 | 465 | ||
466 | part.TriggerScriptChangedEvent(Changed.MEDIA); | 466 | part.TriggerScriptChangedEvent(Changed.MEDIA); |
467 | 467 | ||
468 | return string.Empty; | 468 | return string.Empty; |
469 | } | 469 | } |
470 | 470 | ||
471 | /// <summary> | 471 | /// <summary> |
472 | /// Received from the viewer if a user has changed the url of a media texture. | 472 | /// Received from the viewer if a user has changed the url of a media texture. |
473 | /// </summary> | 473 | /// </summary> |
@@ -481,71 +481,71 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
481 | string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 481 | string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
482 | { | 482 | { |
483 | // m_log.DebugFormat("[MOAP]: Got ObjectMediaNavigate request [{0}]", request); | 483 | // m_log.DebugFormat("[MOAP]: Got ObjectMediaNavigate request [{0}]", request); |
484 | 484 | ||
485 | OSDMap osd = (OSDMap)OSDParser.DeserializeLLSDXml(request); | 485 | OSDMap osd = (OSDMap)OSDParser.DeserializeLLSDXml(request); |
486 | ObjectMediaNavigateMessage omn = new ObjectMediaNavigateMessage(); | 486 | ObjectMediaNavigateMessage omn = new ObjectMediaNavigateMessage(); |
487 | omn.Deserialize(osd); | 487 | omn.Deserialize(osd); |
488 | 488 | ||
489 | UUID primId = omn.PrimID; | 489 | UUID primId = omn.PrimID; |
490 | 490 | ||
491 | SceneObjectPart part = m_scene.GetSceneObjectPart(primId); | 491 | SceneObjectPart part = m_scene.GetSceneObjectPart(primId); |
492 | 492 | ||
493 | if (null == part) | 493 | if (null == part) |
494 | { | 494 | { |
495 | m_log.WarnFormat( | 495 | m_log.WarnFormat( |
496 | "[MOAP]: Received an ObjectMediaNavigateMessage for prim {0} but this doesn't exist in region {1}", | 496 | "[MOAP]: Received an ObjectMediaNavigateMessage for prim {0} but this doesn't exist in region {1}", |
497 | primId, m_scene.RegionInfo.RegionName); | 497 | primId, m_scene.RegionInfo.RegionName); |
498 | return string.Empty; | 498 | return string.Empty; |
499 | } | 499 | } |
500 | 500 | ||
501 | UUID agentId = default(UUID); | 501 | UUID agentId = default(UUID); |
502 | 502 | ||
503 | lock (m_omuCapUsers) | 503 | lock (m_omuCapUsers) |
504 | agentId = m_omuCapUsers[path]; | 504 | agentId = m_omuCapUsers[path]; |
505 | 505 | ||
506 | if (!m_scene.Permissions.CanInteractWithPrimMedia(agentId, part.UUID, omn.Face)) | 506 | if (!m_scene.Permissions.CanInteractWithPrimMedia(agentId, part.UUID, omn.Face)) |
507 | return string.Empty; | 507 | return string.Empty; |
508 | 508 | ||
509 | // m_log.DebugFormat( | 509 | // m_log.DebugFormat( |
510 | // "[MOAP]: Received request to update media entry for face {0} on prim {1} {2} to {3}", | 510 | // "[MOAP]: Received request to update media entry for face {0} on prim {1} {2} to {3}", |
511 | // omn.Face, part.Name, part.UUID, omn.URL); | 511 | // omn.Face, part.Name, part.UUID, omn.URL); |
512 | 512 | ||
513 | // If media has never been set for this prim, then just return. | 513 | // If media has never been set for this prim, then just return. |
514 | if (null == part.Shape.Media) | 514 | if (null == part.Shape.Media) |
515 | return string.Empty; | 515 | return string.Empty; |
516 | 516 | ||
517 | MediaEntry me = null; | 517 | MediaEntry me = null; |
518 | 518 | ||
519 | lock (part.Shape.Media) | 519 | lock (part.Shape.Media) |
520 | me = part.Shape.Media[omn.Face]; | 520 | me = part.Shape.Media[omn.Face]; |
521 | 521 | ||
522 | // Do the same if media has not been set up for a specific face | 522 | // Do the same if media has not been set up for a specific face |
523 | if (null == me) | 523 | if (null == me) |
524 | return string.Empty; | 524 | return string.Empty; |
525 | 525 | ||
526 | if (me.EnableWhiteList) | 526 | if (me.EnableWhiteList) |
527 | { | 527 | { |
528 | if (!CheckUrlAgainstWhitelist(omn.URL, me.WhiteList)) | 528 | if (!CheckUrlAgainstWhitelist(omn.URL, me.WhiteList)) |
529 | { | 529 | { |
530 | // m_log.DebugFormat( | 530 | // m_log.DebugFormat( |
531 | // "[MOAP]: Blocking change of face {0} on prim {1} {2} to {3} since it's not on the enabled whitelist", | 531 | // "[MOAP]: Blocking change of face {0} on prim {1} {2} to {3} since it's not on the enabled whitelist", |
532 | // omn.Face, part.Name, part.UUID, omn.URL); | 532 | // omn.Face, part.Name, part.UUID, omn.URL); |
533 | 533 | ||
534 | return string.Empty; | 534 | return string.Empty; |
535 | } | 535 | } |
536 | } | 536 | } |
537 | 537 | ||
538 | me.CurrentURL = omn.URL; | 538 | me.CurrentURL = omn.URL; |
539 | 539 | ||
540 | UpdateMediaUrl(part, agentId); | 540 | UpdateMediaUrl(part, agentId); |
541 | 541 | ||
542 | part.ScheduleFullUpdate(); | 542 | part.ScheduleFullUpdate(); |
543 | 543 | ||
544 | part.TriggerScriptChangedEvent(Changed.MEDIA); | 544 | part.TriggerScriptChangedEvent(Changed.MEDIA); |
545 | 545 | ||
546 | return OSDParser.SerializeLLSDXmlString(new OSD()); | 546 | return OSDParser.SerializeLLSDXmlString(new OSD()); |
547 | } | 547 | } |
548 | 548 | ||
549 | /// <summary> | 549 | /// <summary> |
550 | /// Check that the face number is valid for the given prim. | 550 | /// Check that the face number is valid for the given prim. |
551 | /// </summary> | 551 | /// </summary> |
@@ -555,13 +555,13 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
555 | { | 555 | { |
556 | if (face < 0) | 556 | if (face < 0) |
557 | throw new ArgumentException("Face cannot be less than zero"); | 557 | throw new ArgumentException("Face cannot be less than zero"); |
558 | 558 | ||
559 | int maxFaces = part.GetNumberOfSides() - 1; | 559 | int maxFaces = part.GetNumberOfSides() - 1; |
560 | if (face > maxFaces) | 560 | if (face > maxFaces) |
561 | throw new ArgumentException( | 561 | throw new ArgumentException( |
562 | string.Format("Face argument was {0} but max is {1}", face, maxFaces)); | 562 | string.Format("Face argument was {0} but max is {1}", face, maxFaces)); |
563 | } | 563 | } |
564 | 564 | ||
565 | /// <summary> | 565 | /// <summary> |
566 | /// Update the media url of the given part | 566 | /// Update the media url of the given part |
567 | /// </summary> | 567 | /// </summary> |
@@ -583,10 +583,10 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
583 | int version = int.Parse(rawVersion); | 583 | int version = int.Parse(rawVersion); |
584 | part.MediaUrl = string.Format("x-mv:{0:D10}/{1}", ++version, updateId); | 584 | part.MediaUrl = string.Format("x-mv:{0:D10}/{1}", ++version, updateId); |
585 | } | 585 | } |
586 | 586 | ||
587 | // m_log.DebugFormat("[MOAP]: Storing media url [{0}] in prim {1} {2}", part.MediaUrl, part.Name, part.UUID); | 587 | // m_log.DebugFormat("[MOAP]: Storing media url [{0}] in prim {1} {2}", part.MediaUrl, part.Name, part.UUID); |
588 | } | 588 | } |
589 | 589 | ||
590 | /// <summary> | 590 | /// <summary> |
591 | /// Check the given url against the given whitelist. | 591 | /// Check the given url against the given whitelist. |
592 | /// </summary> | 592 | /// </summary> |
@@ -599,22 +599,22 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
599 | return false; | 599 | return false; |
600 | 600 | ||
601 | Uri url = new Uri(rawUrl); | 601 | Uri url = new Uri(rawUrl); |
602 | 602 | ||
603 | foreach (string origWlUrl in whitelist) | 603 | foreach (string origWlUrl in whitelist) |
604 | { | 604 | { |
605 | string wlUrl = origWlUrl; | 605 | string wlUrl = origWlUrl; |
606 | 606 | ||
607 | // Deal with a line-ending wildcard | 607 | // Deal with a line-ending wildcard |
608 | if (wlUrl.EndsWith("*")) | 608 | if (wlUrl.EndsWith("*")) |
609 | wlUrl = wlUrl.Remove(wlUrl.Length - 1); | 609 | wlUrl = wlUrl.Remove(wlUrl.Length - 1); |
610 | 610 | ||
611 | // m_log.DebugFormat("[MOAP]: Checking whitelist URL pattern {0}", origWlUrl); | 611 | // m_log.DebugFormat("[MOAP]: Checking whitelist URL pattern {0}", origWlUrl); |
612 | 612 | ||
613 | // Handle a line starting wildcard slightly differently since this can only match the domain, not the path | 613 | // Handle a line starting wildcard slightly differently since this can only match the domain, not the path |
614 | if (wlUrl.StartsWith("*")) | 614 | if (wlUrl.StartsWith("*")) |
615 | { | 615 | { |
616 | wlUrl = wlUrl.Substring(1); | 616 | wlUrl = wlUrl.Substring(1); |
617 | 617 | ||
618 | if (url.Host.Contains(wlUrl)) | 618 | if (url.Host.Contains(wlUrl)) |
619 | { | 619 | { |
620 | // m_log.DebugFormat("[MOAP]: Whitelist URL {0} matches {1}", origWlUrl, rawUrl); | 620 | // m_log.DebugFormat("[MOAP]: Whitelist URL {0} matches {1}", origWlUrl, rawUrl); |
@@ -624,7 +624,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
624 | else | 624 | else |
625 | { | 625 | { |
626 | string urlToMatch = url.Authority + url.AbsolutePath; | 626 | string urlToMatch = url.Authority + url.AbsolutePath; |
627 | 627 | ||
628 | if (urlToMatch.StartsWith(wlUrl)) | 628 | if (urlToMatch.StartsWith(wlUrl)) |
629 | { | 629 | { |
630 | // m_log.DebugFormat("[MOAP]: Whitelist URL {0} matches {1}", origWlUrl, rawUrl); | 630 | // m_log.DebugFormat("[MOAP]: Whitelist URL {0} matches {1}", origWlUrl, rawUrl); |
@@ -632,7 +632,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
632 | } | 632 | } |
633 | } | 633 | } |
634 | } | 634 | } |
635 | 635 | ||
636 | return false; | 636 | return false; |
637 | } | 637 | } |
638 | } | 638 | } |
diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs b/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs index ee57aed..7080705 100644 --- a/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs +++ b/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap.Tests | |||
47 | { | 47 | { |
48 | protected TestScene m_scene; | 48 | protected TestScene m_scene; |
49 | protected MoapModule m_module; | 49 | protected MoapModule m_module; |
50 | 50 | ||
51 | [SetUp] | 51 | [SetUp] |
52 | public override void SetUp() | 52 | public override void SetUp() |
53 | { | 53 | { |
@@ -55,45 +55,45 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap.Tests | |||
55 | 55 | ||
56 | m_module = new MoapModule(); | 56 | m_module = new MoapModule(); |
57 | m_scene = new SceneHelpers().SetupScene(); | 57 | m_scene = new SceneHelpers().SetupScene(); |
58 | SceneHelpers.SetupSceneModules(m_scene, m_module); | 58 | SceneHelpers.SetupSceneModules(m_scene, m_module); |
59 | } | 59 | } |
60 | 60 | ||
61 | [Test] | 61 | [Test] |
62 | public void TestClearMediaUrl() | 62 | public void TestClearMediaUrl() |
63 | { | 63 | { |
64 | TestHelpers.InMethod(); | 64 | TestHelpers.InMethod(); |
65 | // log4net.Config.XmlConfigurator.Configure(); | 65 | // log4net.Config.XmlConfigurator.Configure(); |
66 | 66 | ||
67 | SceneObjectPart part = SceneHelpers.AddSceneObject(m_scene).RootPart; | 67 | SceneObjectPart part = SceneHelpers.AddSceneObject(m_scene).RootPart; |
68 | MediaEntry me = new MediaEntry(); | 68 | MediaEntry me = new MediaEntry(); |
69 | 69 | ||
70 | m_module.SetMediaEntry(part, 1, me); | 70 | m_module.SetMediaEntry(part, 1, me); |
71 | m_module.ClearMediaEntry(part, 1); | 71 | m_module.ClearMediaEntry(part, 1); |
72 | 72 | ||
73 | Assert.That(part.Shape.Media[1], Is.EqualTo(null)); | 73 | Assert.That(part.Shape.Media[1], Is.EqualTo(null)); |
74 | 74 | ||
75 | // Although we've cleared one face, other faces may still be present. So we need to check for an | 75 | // Although we've cleared one face, other faces may still be present. So we need to check for an |
76 | // update media url version | 76 | // update media url version |
77 | Assert.That(part.MediaUrl, Is.EqualTo("x-mv:0000000001/" + UUID.Zero)); | 77 | Assert.That(part.MediaUrl, Is.EqualTo("x-mv:0000000001/" + UUID.Zero)); |
78 | 78 | ||
79 | // By changing media flag to false, the face texture once again becomes identical to the DefaultTexture. | 79 | // By changing media flag to false, the face texture once again becomes identical to the DefaultTexture. |
80 | // Therefore, when libOMV reserializes it, it disappears and we are left with no face texture in this slot. | 80 | // Therefore, when libOMV reserializes it, it disappears and we are left with no face texture in this slot. |
81 | // Not at all confusing, eh? | 81 | // Not at all confusing, eh? |
82 | Assert.That(part.Shape.Textures.FaceTextures[1], Is.Null); | 82 | Assert.That(part.Shape.Textures.FaceTextures[1], Is.Null); |
83 | } | 83 | } |
84 | 84 | ||
85 | [Test] | 85 | [Test] |
86 | public void TestSetMediaUrl() | 86 | public void TestSetMediaUrl() |
87 | { | 87 | { |
88 | TestHelpers.InMethod(); | 88 | TestHelpers.InMethod(); |
89 | 89 | ||
90 | string homeUrl = "opensimulator.org"; | 90 | string homeUrl = "opensimulator.org"; |
91 | 91 | ||
92 | SceneObjectPart part = SceneHelpers.AddSceneObject(m_scene).RootPart; | 92 | SceneObjectPart part = SceneHelpers.AddSceneObject(m_scene).RootPart; |
93 | MediaEntry me = new MediaEntry() { HomeURL = homeUrl }; | 93 | MediaEntry me = new MediaEntry() { HomeURL = homeUrl }; |
94 | 94 | ||
95 | m_module.SetMediaEntry(part, 1, me); | 95 | m_module.SetMediaEntry(part, 1, me); |
96 | 96 | ||
97 | Assert.That(part.Shape.Media[1].HomeURL, Is.EqualTo(homeUrl)); | 97 | Assert.That(part.Shape.Media[1].HomeURL, Is.EqualTo(homeUrl)); |
98 | Assert.That(part.MediaUrl, Is.EqualTo("x-mv:0000000000/" + UUID.Zero)); | 98 | Assert.That(part.MediaUrl, Is.EqualTo("x-mv:0000000000/" + UUID.Zero)); |
99 | Assert.That(part.Shape.Textures.FaceTextures[1].MediaFlags, Is.True); | 99 | Assert.That(part.Shape.Textures.FaceTextures[1].MediaFlags, Is.True); |
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs index 42141e4..b7f01be 100644 --- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs | |||
@@ -49,34 +49,34 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell | |||
49 | 49 | ||
50 | protected Scene m_scene = null; | 50 | protected Scene m_scene = null; |
51 | protected IDialogModule m_dialogModule; | 51 | protected IDialogModule m_dialogModule; |
52 | 52 | ||
53 | public string Name { get { return "Object BuySell Module"; } } | 53 | public string Name { get { return "Object BuySell Module"; } } |
54 | public Type ReplaceableInterface { get { return null; } } | 54 | public Type ReplaceableInterface { get { return null; } } |
55 | 55 | ||
56 | public void Initialise(IConfigSource source) {} | 56 | public void Initialise(IConfigSource source) {} |
57 | 57 | ||
58 | public void AddRegion(Scene scene) | 58 | public void AddRegion(Scene scene) |
59 | { | 59 | { |
60 | m_scene = scene; | 60 | m_scene = scene; |
61 | m_scene.RegisterModuleInterface<IBuySellModule>(this); | 61 | m_scene.RegisterModuleInterface<IBuySellModule>(this); |
62 | m_scene.EventManager.OnNewClient += SubscribeToClientEvents; | 62 | m_scene.EventManager.OnNewClient += SubscribeToClientEvents; |
63 | } | 63 | } |
64 | 64 | ||
65 | public void RemoveRegion(Scene scene) | 65 | public void RemoveRegion(Scene scene) |
66 | { | 66 | { |
67 | m_scene.EventManager.OnNewClient -= SubscribeToClientEvents; | 67 | m_scene.EventManager.OnNewClient -= SubscribeToClientEvents; |
68 | } | 68 | } |
69 | 69 | ||
70 | public void RegionLoaded(Scene scene) | 70 | public void RegionLoaded(Scene scene) |
71 | { | 71 | { |
72 | m_dialogModule = scene.RequestModuleInterface<IDialogModule>(); | 72 | m_dialogModule = scene.RequestModuleInterface<IDialogModule>(); |
73 | } | 73 | } |
74 | 74 | ||
75 | public void Close() | 75 | public void Close() |
76 | { | 76 | { |
77 | RemoveRegion(m_scene); | 77 | RemoveRegion(m_scene); |
78 | } | 78 | } |
79 | 79 | ||
80 | public void SubscribeToClientEvents(IClientAPI client) | 80 | public void SubscribeToClientEvents(IClientAPI client) |
81 | { | 81 | { |
82 | client.OnObjectSaleInfo += ObjectSaleInfo; | 82 | client.OnObjectSaleInfo += ObjectSaleInfo; |
diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs index e53ab95..79c4713 100644 --- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs | |||
@@ -53,30 +53,30 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
53 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "ObjectCommandsModule")] | 53 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "ObjectCommandsModule")] |
54 | public class ObjectCommandsModule : INonSharedRegionModule | 54 | public class ObjectCommandsModule : INonSharedRegionModule |
55 | { | 55 | { |
56 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 56 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
57 | 57 | ||
58 | private Scene m_scene; | 58 | private Scene m_scene; |
59 | private ICommandConsole m_console; | 59 | private ICommandConsole m_console; |
60 | 60 | ||
61 | public string Name { get { return "Object Commands Module"; } } | 61 | public string Name { get { return "Object Commands Module"; } } |
62 | 62 | ||
63 | public Type ReplaceableInterface { get { return null; } } | 63 | public Type ReplaceableInterface { get { return null; } } |
64 | 64 | ||
65 | public void Initialise(IConfigSource source) | 65 | public void Initialise(IConfigSource source) |
66 | { | 66 | { |
67 | // m_log.DebugFormat("[OBJECT COMMANDS MODULE]: INITIALIZED MODULE"); | 67 | // m_log.DebugFormat("[OBJECT COMMANDS MODULE]: INITIALIZED MODULE"); |
68 | } | 68 | } |
69 | 69 | ||
70 | public void PostInitialise() | 70 | public void PostInitialise() |
71 | { | 71 | { |
72 | // m_log.DebugFormat("[OBJECT COMMANDS MODULE]: POST INITIALIZED MODULE"); | 72 | // m_log.DebugFormat("[OBJECT COMMANDS MODULE]: POST INITIALIZED MODULE"); |
73 | } | 73 | } |
74 | 74 | ||
75 | public void Close() | 75 | public void Close() |
76 | { | 76 | { |
77 | // m_log.DebugFormat("[OBJECT COMMANDS MODULE]: CLOSED MODULE"); | 77 | // m_log.DebugFormat("[OBJECT COMMANDS MODULE]: CLOSED MODULE"); |
78 | } | 78 | } |
79 | 79 | ||
80 | public void AddRegion(Scene scene) | 80 | public void AddRegion(Scene scene) |
81 | { | 81 | { |
82 | // m_log.DebugFormat("[OBJECT COMMANDS MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName); | 82 | // m_log.DebugFormat("[OBJECT COMMANDS MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName); |
@@ -539,13 +539,13 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
539 | 539 | ||
540 | if (!ConsoleUtil.CheckFileDoesNotExist(m_console, fileName)) | 540 | if (!ConsoleUtil.CheckFileDoesNotExist(m_console, fileName)) |
541 | return; | 541 | return; |
542 | 542 | ||
543 | using (XmlTextWriter xtw = new XmlTextWriter(fileName, Encoding.UTF8)) | 543 | using (XmlTextWriter xtw = new XmlTextWriter(fileName, Encoding.UTF8)) |
544 | { | 544 | { |
545 | xtw.Formatting = Formatting.Indented; | 545 | xtw.Formatting = Formatting.Indented; |
546 | SceneObjectSerializer.ToOriginalXmlFormat(so, xtw, true); | 546 | SceneObjectSerializer.ToOriginalXmlFormat(so, xtw, true); |
547 | } | 547 | } |
548 | 548 | ||
549 | m_console.OutputFormat("Object dumped to file {0}", fileName); | 549 | m_console.OutputFormat("Object dumped to file {0}", fileName); |
550 | } | 550 | } |
551 | 551 | ||
@@ -625,7 +625,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
625 | cdl.AddRow("FlexiSoftness", s.FlexiSoftness); | 625 | cdl.AddRow("FlexiSoftness", s.FlexiSoftness); |
626 | cdl.AddRow("HollowShape", s.HollowShape); | 626 | cdl.AddRow("HollowShape", s.HollowShape); |
627 | cdl.AddRow( | 627 | cdl.AddRow( |
628 | "LightColor", | 628 | "LightColor", |
629 | string.Format("<{0},{1},{2},{3}>", s.LightColorR, s.LightColorB, s.LightColorG, s.LightColorA)); | 629 | string.Format("<{0},{1},{2},{3}>", s.LightColorR, s.LightColorB, s.LightColorG, s.LightColorA)); |
630 | cdl.AddRow("LightCutoff", s.LightCutoff); | 630 | cdl.AddRow("LightCutoff", s.LightCutoff); |
631 | cdl.AddRow("LightEntry", s.LightEntry); | 631 | cdl.AddRow("LightEntry", s.LightEntry); |
@@ -659,7 +659,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
659 | cdl.AddRow("Rotation (World)", sop.GetWorldRotation()); | 659 | cdl.AddRow("Rotation (World)", sop.GetWorldRotation()); |
660 | cdl.AddRow("Scale", s.Scale); | 660 | cdl.AddRow("Scale", s.Scale); |
661 | cdl.AddRow( | 661 | cdl.AddRow( |
662 | "SculptData", | 662 | "SculptData", |
663 | string.Format("{0} bytes", s.SculptData != null ? s.SculptData.Length.ToString() : "n/a")); | 663 | string.Format("{0} bytes", s.SculptData != null ? s.SculptData.Length.ToString() : "n/a")); |
664 | cdl.AddRow("SculptEntry", s.SculptEntry); | 664 | cdl.AddRow("SculptEntry", s.SculptEntry); |
665 | cdl.AddRow("SculptTexture", s.SculptTexture); | 665 | cdl.AddRow("SculptTexture", s.SculptTexture); |
@@ -668,7 +668,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
668 | 668 | ||
669 | // TODO, need to display more information about textures but in a compact format | 669 | // TODO, need to display more information about textures but in a compact format |
670 | // to stop output becoming huge. | 670 | // to stop output becoming huge. |
671 | for (int i = 0; i < sop.GetNumberOfSides(); i++) | 671 | for (int i = 0; i < sop.GetNumberOfSides(); i++) |
672 | { | 672 | { |
673 | Primitive.TextureEntryFace teFace = s.Textures.FaceTextures[i]; | 673 | Primitive.TextureEntryFace teFace = s.Textures.FaceTextures[i]; |
674 | 674 | ||
@@ -765,12 +765,12 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
765 | if (g.OwnerID == match && !g.IsAttachment) | 765 | if (g.OwnerID == match && !g.IsAttachment) |
766 | deletes.Add(g); | 766 | deletes.Add(g); |
767 | }); | 767 | }); |
768 | 768 | ||
769 | // if (deletes.Count == 0) | 769 | // if (deletes.Count == 0) |
770 | // m_console.OutputFormat("No objects were found with owner {0}", match); | 770 | // m_console.OutputFormat("No objects were found with owner {0}", match); |
771 | 771 | ||
772 | break; | 772 | break; |
773 | 773 | ||
774 | case "creator": | 774 | case "creator": |
775 | if (!UUID.TryParse(o, out match)) | 775 | if (!UUID.TryParse(o, out match)) |
776 | return; | 776 | return; |
@@ -782,12 +782,12 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
782 | if (g.RootPart.CreatorID == match && !g.IsAttachment) | 782 | if (g.RootPart.CreatorID == match && !g.IsAttachment) |
783 | deletes.Add(g); | 783 | deletes.Add(g); |
784 | }); | 784 | }); |
785 | 785 | ||
786 | // if (deletes.Count == 0) | 786 | // if (deletes.Count == 0) |
787 | // m_console.OutputFormat("No objects were found with creator {0}", match); | 787 | // m_console.OutputFormat("No objects were found with creator {0}", match); |
788 | 788 | ||
789 | break; | 789 | break; |
790 | 790 | ||
791 | case "id": | 791 | case "id": |
792 | UUID uuid; | 792 | UUID uuid; |
793 | uint localId; | 793 | uint localId; |
@@ -808,13 +808,13 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
808 | 808 | ||
809 | // if (deletes.Count == 0) | 809 | // if (deletes.Count == 0) |
810 | // m_console.OutputFormat("No objects were found with uuid {0}", match); | 810 | // m_console.OutputFormat("No objects were found with uuid {0}", match); |
811 | 811 | ||
812 | break; | 812 | break; |
813 | 813 | ||
814 | case "name": | 814 | case "name": |
815 | deletes = GetDeleteCandidatesByName(module, cmd); | 815 | deletes = GetDeleteCandidatesByName(module, cmd); |
816 | break; | 816 | break; |
817 | 817 | ||
818 | case "outside": | 818 | case "outside": |
819 | deletes = new List<SceneObjectGroup>(); | 819 | deletes = new List<SceneObjectGroup>(); |
820 | 820 | ||
@@ -822,7 +822,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
822 | { | 822 | { |
823 | SceneObjectPart rootPart = g.RootPart; | 823 | SceneObjectPart rootPart = g.RootPart; |
824 | bool delete = false; | 824 | bool delete = false; |
825 | 825 | ||
826 | if (rootPart.GroupPosition.Z < 0.0 || rootPart.GroupPosition.Z > 10000.0) | 826 | if (rootPart.GroupPosition.Z < 0.0 || rootPart.GroupPosition.Z > 10000.0) |
827 | { | 827 | { |
828 | delete = true; | 828 | delete = true; |
@@ -831,18 +831,18 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
831 | { | 831 | { |
832 | ILandObject parcel | 832 | ILandObject parcel |
833 | = m_scene.LandChannel.GetLandObject(rootPart.GroupPosition.X, rootPart.GroupPosition.Y); | 833 | = m_scene.LandChannel.GetLandObject(rootPart.GroupPosition.X, rootPart.GroupPosition.Y); |
834 | 834 | ||
835 | if (parcel == null || parcel.LandData.Name == "NO LAND") | 835 | if (parcel == null || parcel.LandData.Name == "NO LAND") |
836 | delete = true; | 836 | delete = true; |
837 | } | 837 | } |
838 | 838 | ||
839 | if (delete && !g.IsAttachment && !deletes.Contains(g)) | 839 | if (delete && !g.IsAttachment && !deletes.Contains(g)) |
840 | deletes.Add(g); | 840 | deletes.Add(g); |
841 | }); | 841 | }); |
842 | 842 | ||
843 | if (deletes.Count == 0) | 843 | if (deletes.Count == 0) |
844 | m_console.OutputFormat("No objects were found outside region bounds"); | 844 | m_console.OutputFormat("No objects were found outside region bounds"); |
845 | 845 | ||
846 | break; | 846 | break; |
847 | 847 | ||
848 | case "pos": | 848 | case "pos": |
@@ -864,7 +864,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
864 | "Are you sure that you want to delete {0} objects from {1}", | 864 | "Are you sure that you want to delete {0} objects from {1}", |
865 | deletes.Count, m_scene.RegionInfo.RegionName), | 865 | deletes.Count, m_scene.RegionInfo.RegionName), |
866 | "y/N"); | 866 | "y/N"); |
867 | 867 | ||
868 | if (response.ToLower() != "y") | 868 | if (response.ToLower() != "y") |
869 | { | 869 | { |
870 | MainConsole.Instance.OutputFormat( | 870 | MainConsole.Instance.OutputFormat( |
@@ -951,7 +951,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
951 | { | 951 | { |
952 | m_console.OutputFormat("Error: Start vector '{0}' does not have a valid format", rawConsoleStartVector); | 952 | m_console.OutputFormat("Error: Start vector '{0}' does not have a valid format", rawConsoleStartVector); |
953 | endVector = Vector3.Zero; | 953 | endVector = Vector3.Zero; |
954 | 954 | ||
955 | return false; | 955 | return false; |
956 | } | 956 | } |
957 | 957 | ||
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 06900f0..1a61771 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
47 | public class DefaultPermissionsModule : INonSharedRegionModule, IPermissionsModule | 47 | public class DefaultPermissionsModule : INonSharedRegionModule, IPermissionsModule |
48 | { | 48 | { |
49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
50 | 50 | ||
51 | protected Scene m_scene; | 51 | protected Scene m_scene; |
52 | protected bool m_Enabled; | 52 | protected bool m_Enabled; |
53 | 53 | ||
@@ -77,7 +77,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
77 | private uint PERM_MOVE = (uint)524288; | 77 | private uint PERM_MOVE = (uint)524288; |
78 | private uint PERM_TRANS = (uint)8192; | 78 | private uint PERM_TRANS = (uint)8192; |
79 | private uint PERM_LOCKED = (uint)540672; | 79 | private uint PERM_LOCKED = (uint)540672; |
80 | 80 | ||
81 | /// <value> | 81 | /// <value> |
82 | /// Different user set names that come in from the configuration file. | 82 | /// Different user set names that come in from the configuration file. |
83 | /// </value> | 83 | /// </value> |
@@ -110,17 +110,17 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
110 | private UserSet m_allowedScriptCreators = UserSet.All; | 110 | private UserSet m_allowedScriptCreators = UserSet.All; |
111 | 111 | ||
112 | /// <value> | 112 | /// <value> |
113 | /// The set of users that are allowed to edit (save) scripts. This is only active if | 113 | /// The set of users that are allowed to edit (save) scripts. This is only active if |
114 | /// permissions are not being bypassed. This overrides normal permissions.- | 114 | /// permissions are not being bypassed. This overrides normal permissions.- |
115 | /// </value> | 115 | /// </value> |
116 | private UserSet m_allowedScriptEditors = UserSet.All; | 116 | private UserSet m_allowedScriptEditors = UserSet.All; |
117 | 117 | ||
118 | private Dictionary<string, bool> GrantLSL = new Dictionary<string, bool>(); | 118 | private Dictionary<string, bool> GrantLSL = new Dictionary<string, bool>(); |
119 | private Dictionary<string, bool> GrantCS = new Dictionary<string, bool>(); | 119 | private Dictionary<string, bool> GrantCS = new Dictionary<string, bool>(); |
120 | private Dictionary<string, bool> GrantVB = new Dictionary<string, bool>(); | 120 | private Dictionary<string, bool> GrantVB = new Dictionary<string, bool>(); |
121 | private Dictionary<string, bool> GrantJS = new Dictionary<string, bool>(); | 121 | private Dictionary<string, bool> GrantJS = new Dictionary<string, bool>(); |
122 | private Dictionary<string, bool> GrantYP = new Dictionary<string, bool>(); | 122 | private Dictionary<string, bool> GrantYP = new Dictionary<string, bool>(); |
123 | 123 | ||
124 | private IFriendsModule m_friendsModule; | 124 | private IFriendsModule m_friendsModule; |
125 | private IFriendsModule FriendsModule | 125 | private IFriendsModule FriendsModule |
126 | { | 126 | { |
@@ -169,20 +169,20 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
169 | m_Enabled = true; | 169 | m_Enabled = true; |
170 | 170 | ||
171 | m_allowGridGods = Util.GetConfigVarFromSections<bool>(config, "allow_grid_gods", | 171 | m_allowGridGods = Util.GetConfigVarFromSections<bool>(config, "allow_grid_gods", |
172 | new string[] { "Startup", "Permissions" }, false); | 172 | new string[] { "Startup", "Permissions" }, false); |
173 | m_bypassPermissions = !Util.GetConfigVarFromSections<bool>(config, "serverside_object_permissions", | 173 | m_bypassPermissions = !Util.GetConfigVarFromSections<bool>(config, "serverside_object_permissions", |
174 | new string[] { "Startup", "Permissions" }, true); | 174 | new string[] { "Startup", "Permissions" }, true); |
175 | m_propagatePermissions = Util.GetConfigVarFromSections<bool>(config, "propagate_permissions", | 175 | m_propagatePermissions = Util.GetConfigVarFromSections<bool>(config, "propagate_permissions", |
176 | new string[] { "Startup", "Permissions" }, true); | 176 | new string[] { "Startup", "Permissions" }, true); |
177 | m_RegionOwnerIsGod = Util.GetConfigVarFromSections<bool>(config, "region_owner_is_god", | 177 | m_RegionOwnerIsGod = Util.GetConfigVarFromSections<bool>(config, "region_owner_is_god", |
178 | new string[] { "Startup", "Permissions" }, true); | 178 | new string[] { "Startup", "Permissions" }, true); |
179 | m_RegionManagerIsGod = Util.GetConfigVarFromSections<bool>(config, "region_manager_is_god", | 179 | m_RegionManagerIsGod = Util.GetConfigVarFromSections<bool>(config, "region_manager_is_god", |
180 | new string[] { "Startup", "Permissions" }, false); | 180 | new string[] { "Startup", "Permissions" }, false); |
181 | m_ParcelOwnerIsGod = Util.GetConfigVarFromSections<bool>(config, "parcel_owner_is_god", | 181 | m_ParcelOwnerIsGod = Util.GetConfigVarFromSections<bool>(config, "parcel_owner_is_god", |
182 | new string[] { "Startup", "Permissions" }, false); | 182 | new string[] { "Startup", "Permissions" }, false); |
183 | 183 | ||
184 | m_SimpleBuildPermissions = Util.GetConfigVarFromSections<bool>(config, "simple_build_permissions", | 184 | m_SimpleBuildPermissions = Util.GetConfigVarFromSections<bool>(config, "simple_build_permissions", |
185 | new string[] { "Startup", "Permissions" }, false); | 185 | new string[] { "Startup", "Permissions" }, false); |
186 | 186 | ||
187 | m_allowedScriptCreators | 187 | m_allowedScriptCreators |
188 | = ParseUserSetConfigSetting(config, "allowed_script_creators", m_allowedScriptCreators); | 188 | = ParseUserSetConfigSetting(config, "allowed_script_creators", m_allowedScriptCreators); |
@@ -206,7 +206,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
206 | } | 206 | } |
207 | 207 | ||
208 | grant = Util.GetConfigVarFromSections<string>(config, "GrantCS", | 208 | grant = Util.GetConfigVarFromSections<string>(config, "GrantCS", |
209 | new string[] { "Startup", "Permissions" }, string.Empty); | 209 | new string[] { "Startup", "Permissions" }, string.Empty); |
210 | if (grant.Length > 0) | 210 | if (grant.Length > 0) |
211 | { | 211 | { |
212 | foreach (string uuidl in grant.Split(',')) | 212 | foreach (string uuidl in grant.Split(',')) |
@@ -273,46 +273,46 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
273 | m_scene.Permissions.OnIsAdministrator += IsAdministrator; | 273 | m_scene.Permissions.OnIsAdministrator += IsAdministrator; |
274 | m_scene.Permissions.OnIsEstateManager += IsEstateManager; | 274 | m_scene.Permissions.OnIsEstateManager += IsEstateManager; |
275 | m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; | 275 | m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; |
276 | m_scene.Permissions.OnDeleteObject += CanDeleteObject; | 276 | m_scene.Permissions.OnDeleteObject += CanDeleteObject; |
277 | m_scene.Permissions.OnEditObject += CanEditObject; | 277 | m_scene.Permissions.OnEditObject += CanEditObject; |
278 | m_scene.Permissions.OnEditParcelProperties += CanEditParcelProperties; | 278 | m_scene.Permissions.OnEditParcelProperties += CanEditParcelProperties; |
279 | m_scene.Permissions.OnInstantMessage += CanInstantMessage; | 279 | m_scene.Permissions.OnInstantMessage += CanInstantMessage; |
280 | m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer; | 280 | m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer; |
281 | m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; | 281 | m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; |
282 | m_scene.Permissions.OnMoveObject += CanMoveObject; | 282 | m_scene.Permissions.OnMoveObject += CanMoveObject; |
283 | m_scene.Permissions.OnObjectEntry += CanObjectEntry; | 283 | m_scene.Permissions.OnObjectEntry += CanObjectEntry; |
284 | m_scene.Permissions.OnReturnObjects += CanReturnObjects; | 284 | m_scene.Permissions.OnReturnObjects += CanReturnObjects; |
285 | m_scene.Permissions.OnRezObject += CanRezObject; | 285 | m_scene.Permissions.OnRezObject += CanRezObject; |
286 | m_scene.Permissions.OnRunConsoleCommand += CanRunConsoleCommand; | 286 | m_scene.Permissions.OnRunConsoleCommand += CanRunConsoleCommand; |
287 | m_scene.Permissions.OnRunScript += CanRunScript; | 287 | m_scene.Permissions.OnRunScript += CanRunScript; |
288 | m_scene.Permissions.OnCompileScript += CanCompileScript; | 288 | m_scene.Permissions.OnCompileScript += CanCompileScript; |
289 | m_scene.Permissions.OnSellParcel += CanSellParcel; | 289 | m_scene.Permissions.OnSellParcel += CanSellParcel; |
290 | m_scene.Permissions.OnTakeObject += CanTakeObject; | 290 | m_scene.Permissions.OnTakeObject += CanTakeObject; |
291 | m_scene.Permissions.OnSellGroupObject += CanSellGroupObject; | 291 | m_scene.Permissions.OnSellGroupObject += CanSellGroupObject; |
292 | m_scene.Permissions.OnTakeCopyObject += CanTakeCopyObject; | 292 | m_scene.Permissions.OnTakeCopyObject += CanTakeCopyObject; |
293 | m_scene.Permissions.OnTerraformLand += CanTerraformLand; | 293 | m_scene.Permissions.OnTerraformLand += CanTerraformLand; |
294 | m_scene.Permissions.OnLinkObject += CanLinkObject; | 294 | m_scene.Permissions.OnLinkObject += CanLinkObject; |
295 | m_scene.Permissions.OnDelinkObject += CanDelinkObject; | 295 | m_scene.Permissions.OnDelinkObject += CanDelinkObject; |
296 | m_scene.Permissions.OnBuyLand += CanBuyLand; | 296 | m_scene.Permissions.OnBuyLand += CanBuyLand; |
297 | 297 | ||
298 | m_scene.Permissions.OnViewNotecard += CanViewNotecard; | 298 | m_scene.Permissions.OnViewNotecard += CanViewNotecard; |
299 | m_scene.Permissions.OnViewScript += CanViewScript; | 299 | m_scene.Permissions.OnViewScript += CanViewScript; |
300 | m_scene.Permissions.OnEditNotecard += CanEditNotecard; | 300 | m_scene.Permissions.OnEditNotecard += CanEditNotecard; |
301 | m_scene.Permissions.OnEditScript += CanEditScript; | 301 | m_scene.Permissions.OnEditScript += CanEditScript; |
302 | 302 | ||
303 | m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory; | 303 | m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory; |
304 | m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory; | 304 | m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory; |
305 | m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; | 305 | m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; |
306 | m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; | 306 | m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; |
307 | m_scene.Permissions.OnResetScript += CanResetScript; | 307 | m_scene.Permissions.OnResetScript += CanResetScript; |
308 | 308 | ||
309 | m_scene.Permissions.OnCreateUserInventory += CanCreateUserInventory; | 309 | m_scene.Permissions.OnCreateUserInventory += CanCreateUserInventory; |
310 | m_scene.Permissions.OnCopyUserInventory += CanCopyUserInventory; | 310 | m_scene.Permissions.OnCopyUserInventory += CanCopyUserInventory; |
311 | m_scene.Permissions.OnEditUserInventory += CanEditUserInventory; | 311 | m_scene.Permissions.OnEditUserInventory += CanEditUserInventory; |
312 | m_scene.Permissions.OnDeleteUserInventory += CanDeleteUserInventory; | 312 | m_scene.Permissions.OnDeleteUserInventory += CanDeleteUserInventory; |
313 | 313 | ||
314 | m_scene.Permissions.OnTeleport += CanTeleport; | 314 | m_scene.Permissions.OnTeleport += CanTeleport; |
315 | 315 | ||
316 | m_scene.Permissions.OnControlPrimMedia += CanControlPrimMedia; | 316 | m_scene.Permissions.OnControlPrimMedia += CanControlPrimMedia; |
317 | m_scene.Permissions.OnInteractWithPrimMedia += CanInteractWithPrimMedia; | 317 | m_scene.Permissions.OnInteractWithPrimMedia += CanInteractWithPrimMedia; |
318 | 318 | ||
@@ -329,8 +329,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
329 | m_scene.AddCommand("Debug", this, "debug permissions", | 329 | m_scene.AddCommand("Debug", this, "debug permissions", |
330 | "debug permissions <true / false>", | 330 | "debug permissions <true / false>", |
331 | "Turn on permissions debugging", | 331 | "Turn on permissions debugging", |
332 | HandleDebugPermissions); | 332 | HandleDebugPermissions); |
333 | 333 | ||
334 | } | 334 | } |
335 | 335 | ||
336 | public void RegionLoaded(Scene scene) | 336 | public void RegionLoaded(Scene scene) |
@@ -441,7 +441,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
441 | { | 441 | { |
442 | m_scene.EventManager.TriggerPermissionError(user, reason); | 442 | m_scene.EventManager.TriggerPermissionError(user, reason); |
443 | } | 443 | } |
444 | 444 | ||
445 | protected void DebugPermissionInformation(string permissionCalled) | 445 | protected void DebugPermissionInformation(string permissionCalled) |
446 | { | 446 | { |
447 | if (m_debugPermissions) | 447 | if (m_debugPermissions) |
@@ -471,7 +471,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
471 | 471 | ||
472 | return false; | 472 | return false; |
473 | } | 473 | } |
474 | 474 | ||
475 | /// <summary> | 475 | /// <summary> |
476 | /// Parse a user set configuration setting | 476 | /// Parse a user set configuration setting |
477 | /// </summary> | 477 | /// </summary> |
@@ -483,28 +483,28 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
483 | { | 483 | { |
484 | UserSet userSet = defaultValue; | 484 | UserSet userSet = defaultValue; |
485 | 485 | ||
486 | string rawSetting = Util.GetConfigVarFromSections<string>(config, settingName, | 486 | string rawSetting = Util.GetConfigVarFromSections<string>(config, settingName, |
487 | new string[] {"Startup", "Permissions"}, defaultValue.ToString()); | 487 | new string[] {"Startup", "Permissions"}, defaultValue.ToString()); |
488 | 488 | ||
489 | // Temporary measure to allow 'gods' to be specified in config for consistency's sake. In the long term | 489 | // Temporary measure to allow 'gods' to be specified in config for consistency's sake. In the long term |
490 | // this should disappear. | 490 | // this should disappear. |
491 | if ("gods" == rawSetting.ToLower()) | 491 | if ("gods" == rawSetting.ToLower()) |
492 | rawSetting = UserSet.Administrators.ToString(); | 492 | rawSetting = UserSet.Administrators.ToString(); |
493 | 493 | ||
494 | // Doing it this was so that we can do a case insensitive conversion | 494 | // Doing it this was so that we can do a case insensitive conversion |
495 | try | 495 | try |
496 | { | 496 | { |
497 | userSet = (UserSet)Enum.Parse(typeof(UserSet), rawSetting, true); | 497 | userSet = (UserSet)Enum.Parse(typeof(UserSet), rawSetting, true); |
498 | } | 498 | } |
499 | catch | 499 | catch |
500 | { | 500 | { |
501 | m_log.ErrorFormat( | 501 | m_log.ErrorFormat( |
502 | "[PERMISSIONS]: {0} is not a valid {1} value, setting to {2}", | 502 | "[PERMISSIONS]: {0} is not a valid {1} value, setting to {2}", |
503 | rawSetting, settingName, userSet); | 503 | rawSetting, settingName, userSet); |
504 | } | 504 | } |
505 | 505 | ||
506 | m_log.DebugFormat("[PERMISSIONS]: {0} {1}", settingName, userSet); | 506 | m_log.DebugFormat("[PERMISSIONS]: {0} {1}", settingName, userSet); |
507 | 507 | ||
508 | return userSet; | 508 | return userSet; |
509 | } | 509 | } |
510 | 510 | ||
@@ -520,7 +520,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
520 | 520 | ||
521 | if (m_scene.RegionInfo.EstateSettings.EstateOwner == user && m_RegionOwnerIsGod) | 521 | if (m_scene.RegionInfo.EstateSettings.EstateOwner == user && m_RegionOwnerIsGod) |
522 | return true; | 522 | return true; |
523 | 523 | ||
524 | if (IsEstateManager(user) && m_RegionManagerIsGod) | 524 | if (IsEstateManager(user) && m_RegionManagerIsGod) |
525 | return true; | 525 | return true; |
526 | 526 | ||
@@ -558,7 +558,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
558 | } | 558 | } |
559 | 559 | ||
560 | protected bool IsFriendWithPerms(UUID user, UUID objectOwner) | 560 | protected bool IsFriendWithPerms(UUID user, UUID objectOwner) |
561 | { | 561 | { |
562 | if (user == UUID.Zero) | 562 | if (user == UUID.Zero) |
563 | return false; | 563 | return false; |
564 | 564 | ||
@@ -572,7 +572,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
572 | protected bool IsEstateManager(UUID user) | 572 | protected bool IsEstateManager(UUID user) |
573 | { | 573 | { |
574 | if (user == UUID.Zero) return false; | 574 | if (user == UUID.Zero) return false; |
575 | 575 | ||
576 | return m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(user); | 576 | return m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(user); |
577 | } | 577 | } |
578 | 578 | ||
@@ -777,7 +777,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
777 | // so just return true immediately and short circuit the more | 777 | // so just return true immediately and short circuit the more |
778 | // expensive group checks | 778 | // expensive group checks |
779 | return true; | 779 | return true; |
780 | 780 | ||
781 | //permission = true; | 781 | //permission = true; |
782 | } | 782 | } |
783 | else if (group.IsAttachment) | 783 | else if (group.IsAttachment) |
@@ -786,15 +786,15 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
786 | } | 786 | } |
787 | 787 | ||
788 | // m_log.DebugFormat( | 788 | // m_log.DebugFormat( |
789 | // "[PERMISSIONS]: group.GroupID = {0}, part.GroupMask = {1}, isGroupMember = {2} for {3}", | 789 | // "[PERMISSIONS]: group.GroupID = {0}, part.GroupMask = {1}, isGroupMember = {2} for {3}", |
790 | // group.GroupID, | 790 | // group.GroupID, |
791 | // m_scene.GetSceneObjectPart(objId).GroupMask, | 791 | // m_scene.GetSceneObjectPart(objId).GroupMask, |
792 | // IsGroupMember(group.GroupID, currentUser, 0), | 792 | // IsGroupMember(group.GroupID, currentUser, 0), |
793 | // currentUser); | 793 | // currentUser); |
794 | 794 | ||
795 | // Group members should be able to edit group objects | 795 | // Group members should be able to edit group objects |
796 | if ((group.GroupID != UUID.Zero) | 796 | if ((group.GroupID != UUID.Zero) |
797 | && ((m_scene.GetSceneObjectPart(objId).GroupMask & (uint)PermissionMask.Modify) != 0) | 797 | && ((m_scene.GetSceneObjectPart(objId).GroupMask & (uint)PermissionMask.Modify) != 0) |
798 | && IsGroupMember(group.GroupID, currentUser, 0)) | 798 | && IsGroupMember(group.GroupID, currentUser, 0)) |
799 | { | 799 | { |
800 | // Return immediately, so that the administrator can shares group objects | 800 | // Return immediately, so that the administrator can shares group objects |
@@ -807,7 +807,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
807 | // Return immediately, so that the administrator can share objects with friends | 807 | // Return immediately, so that the administrator can share objects with friends |
808 | return true; | 808 | return true; |
809 | } | 809 | } |
810 | 810 | ||
811 | // Users should be able to edit what is over their land. | 811 | // Users should be able to edit what is over their land. |
812 | ILandObject parcel = m_scene.LandChannel.GetLandObject(group.AbsolutePosition.X, group.AbsolutePosition.Y); | 812 | ILandObject parcel = m_scene.LandChannel.GetLandObject(group.AbsolutePosition.X, group.AbsolutePosition.Y); |
813 | if ((parcel != null) && (parcel.LandData.OwnerID == currentUser)) | 813 | if ((parcel != null) && (parcel.LandData.OwnerID == currentUser)) |
@@ -904,7 +904,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
904 | 904 | ||
905 | return permission; | 905 | return permission; |
906 | } | 906 | } |
907 | 907 | ||
908 | protected bool GenericParcelOwnerPermission(UUID user, ILandObject parcel, ulong groupPowers, bool allowEstateManager) | 908 | protected bool GenericParcelOwnerPermission(UUID user, ILandObject parcel, ulong groupPowers, bool allowEstateManager) |
909 | { | 909 | { |
910 | if (parcel.LandData.OwnerID == user) | 910 | if (parcel.LandData.OwnerID == user) |
@@ -919,7 +919,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
919 | { | 919 | { |
920 | return true; | 920 | return true; |
921 | } | 921 | } |
922 | 922 | ||
923 | if (allowEstateManager && IsEstateManager(user)) | 923 | if (allowEstateManager && IsEstateManager(user)) |
924 | { | 924 | { |
925 | return true; | 925 | return true; |
@@ -946,7 +946,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
946 | { | 946 | { |
947 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 947 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
948 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 948 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
949 | 949 | ||
950 | return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandRelease, false); | 950 | return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandRelease, false); |
951 | } | 951 | } |
952 | 952 | ||
@@ -1007,7 +1007,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1007 | //They can't even edit the object | 1007 | //They can't even edit the object |
1008 | return false; | 1008 | return false; |
1009 | } | 1009 | } |
1010 | 1010 | ||
1011 | SceneObjectPart part = scene.GetSceneObjectPart(objectID); | 1011 | SceneObjectPart part = scene.GetSceneObjectPart(objectID); |
1012 | if (part == null) | 1012 | if (part == null) |
1013 | return false; | 1013 | return false; |
@@ -1025,7 +1025,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1025 | if ((part.GroupMask & PERM_COPY) == 0) | 1025 | if ((part.GroupMask & PERM_COPY) == 0) |
1026 | return false; | 1026 | return false; |
1027 | } | 1027 | } |
1028 | 1028 | ||
1029 | //If they can rez, they can duplicate | 1029 | //If they can rez, they can duplicate |
1030 | return CanRezObject(objectCount, owner, objectPosition, scene); | 1030 | return CanRezObject(objectCount, owner, objectPosition, scene); |
1031 | } | 1031 | } |
@@ -1074,10 +1074,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1074 | { | 1074 | { |
1075 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1075 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1076 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1076 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
1077 | 1077 | ||
1078 | if (m_allowedScriptEditors == UserSet.Administrators && !IsAdministrator(user)) | 1078 | if (m_allowedScriptEditors == UserSet.Administrators && !IsAdministrator(user)) |
1079 | return false; | 1079 | return false; |
1080 | 1080 | ||
1081 | // Ordinarily, if you can view it, you can edit it | 1081 | // Ordinarily, if you can view it, you can edit it |
1082 | // There is no viewing a no mod script | 1082 | // There is no viewing a no mod script |
1083 | // | 1083 | // |
@@ -1135,10 +1135,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1135 | 1135 | ||
1136 | if (!IsGroupMember(part.GroupID, user, 0)) | 1136 | if (!IsGroupMember(part.GroupID, user, 0)) |
1137 | return false; | 1137 | return false; |
1138 | 1138 | ||
1139 | if ((part.GroupMask & (uint)PermissionMask.Modify) == 0) | 1139 | if ((part.GroupMask & (uint)PermissionMask.Modify) == 0) |
1140 | return false; | 1140 | return false; |
1141 | } | 1141 | } |
1142 | else | 1142 | else |
1143 | { | 1143 | { |
1144 | if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) | 1144 | if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) |
@@ -1572,7 +1572,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1572 | if ((so.GetEffectivePermissions() & PERM_COPY) != PERM_COPY) | 1572 | if ((so.GetEffectivePermissions() & PERM_COPY) != PERM_COPY) |
1573 | permission = false; | 1573 | permission = false; |
1574 | } | 1574 | } |
1575 | 1575 | ||
1576 | return permission; | 1576 | return permission; |
1577 | } | 1577 | } |
1578 | 1578 | ||
@@ -1662,7 +1662,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1662 | 1662 | ||
1663 | if (part == null) | 1663 | if (part == null) |
1664 | return false; | 1664 | return false; |
1665 | 1665 | ||
1666 | if (part.OwnerID != user) | 1666 | if (part.OwnerID != user) |
1667 | { | 1667 | { |
1668 | if (part.GroupID == UUID.Zero) | 1668 | if (part.GroupID == UUID.Zero) |
@@ -1670,11 +1670,11 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1670 | 1670 | ||
1671 | if (!IsGroupMember(part.GroupID, user, 0)) | 1671 | if (!IsGroupMember(part.GroupID, user, 0)) |
1672 | return false; | 1672 | return false; |
1673 | 1673 | ||
1674 | if ((part.GroupMask & (uint)PermissionMask.Modify) == 0) | 1674 | if ((part.GroupMask & (uint)PermissionMask.Modify) == 0) |
1675 | return false; | 1675 | return false; |
1676 | } | 1676 | } |
1677 | else | 1677 | else |
1678 | { | 1678 | { |
1679 | if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) | 1679 | if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) |
1680 | return false; | 1680 | return false; |
@@ -1684,12 +1684,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1684 | 1684 | ||
1685 | if (ti == null) | 1685 | if (ti == null) |
1686 | return false; | 1686 | return false; |
1687 | 1687 | ||
1688 | if (ti.OwnerID != user) | 1688 | if (ti.OwnerID != user) |
1689 | { | 1689 | { |
1690 | if (ti.GroupID == UUID.Zero) | 1690 | if (ti.GroupID == UUID.Zero) |
1691 | return false; | 1691 | return false; |
1692 | 1692 | ||
1693 | if (!IsGroupMember(ti.GroupID, user, 0)) | 1693 | if (!IsGroupMember(ti.GroupID, user, 0)) |
1694 | return false; | 1694 | return false; |
1695 | } | 1695 | } |
@@ -1746,12 +1746,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1746 | 1746 | ||
1747 | if (part == null) | 1747 | if (part == null) |
1748 | return false; | 1748 | return false; |
1749 | 1749 | ||
1750 | if (part.OwnerID != user) | 1750 | if (part.OwnerID != user) |
1751 | { | 1751 | { |
1752 | if (part.GroupID == UUID.Zero) | 1752 | if (part.GroupID == UUID.Zero) |
1753 | return false; | 1753 | return false; |
1754 | 1754 | ||
1755 | if (!IsGroupMember(part.GroupID, user, 0)) | 1755 | if (!IsGroupMember(part.GroupID, user, 0)) |
1756 | return false; | 1756 | return false; |
1757 | } | 1757 | } |
@@ -1768,7 +1768,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1768 | { | 1768 | { |
1769 | if (ti.GroupID == UUID.Zero) | 1769 | if (ti.GroupID == UUID.Zero) |
1770 | return false; | 1770 | return false; |
1771 | 1771 | ||
1772 | if (!IsGroupMember(ti.GroupID, user, 0)) | 1772 | if (!IsGroupMember(ti.GroupID, user, 0)) |
1773 | return false; | 1773 | return false; |
1774 | } | 1774 | } |
@@ -1863,7 +1863,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1863 | 1863 | ||
1864 | return true; | 1864 | return true; |
1865 | } | 1865 | } |
1866 | 1866 | ||
1867 | /// <summary> | 1867 | /// <summary> |
1868 | /// Check whether the specified user is allowed to create the given inventory type in their inventory. | 1868 | /// Check whether the specified user is allowed to create the given inventory type in their inventory. |
1869 | /// </summary> | 1869 | /// </summary> |
@@ -1878,10 +1878,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1878 | if ((int)InventoryType.LSL == invType) | 1878 | if ((int)InventoryType.LSL == invType) |
1879 | if (m_allowedScriptCreators == UserSet.Administrators && !IsAdministrator(userID)) | 1879 | if (m_allowedScriptCreators == UserSet.Administrators && !IsAdministrator(userID)) |
1880 | return false; | 1880 | return false; |
1881 | 1881 | ||
1882 | return true; | 1882 | return true; |
1883 | } | 1883 | } |
1884 | 1884 | ||
1885 | /// <summary> | 1885 | /// <summary> |
1886 | /// Check whether the specified user is allowed to copy the given inventory type in their inventory. | 1886 | /// Check whether the specified user is allowed to copy the given inventory type in their inventory. |
1887 | /// </summary> | 1887 | /// </summary> |
@@ -1895,7 +1895,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1895 | 1895 | ||
1896 | return true; | 1896 | return true; |
1897 | } | 1897 | } |
1898 | 1898 | ||
1899 | /// <summary> | 1899 | /// <summary> |
1900 | /// Check whether the specified user is allowed to edit the given inventory item within their own inventory. | 1900 | /// Check whether the specified user is allowed to edit the given inventory item within their own inventory. |
1901 | /// </summary> | 1901 | /// </summary> |
@@ -1909,7 +1909,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1909 | 1909 | ||
1910 | return true; | 1910 | return true; |
1911 | } | 1911 | } |
1912 | 1912 | ||
1913 | /// <summary> | 1913 | /// <summary> |
1914 | /// Check whether the specified user is allowed to delete the given inventory item from their own inventory. | 1914 | /// Check whether the specified user is allowed to delete the given inventory item from their own inventory. |
1915 | /// </summary> | 1915 | /// </summary> |
@@ -1947,7 +1947,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1947 | return GenericObjectPermission(agentID, prim, false); | 1947 | return GenericObjectPermission(agentID, prim, false); |
1948 | } | 1948 | } |
1949 | 1949 | ||
1950 | private bool CanCompileScript(UUID ownerUUID, int scriptType, Scene scene) | 1950 | private bool CanCompileScript(UUID ownerUUID, int scriptType, Scene scene) |
1951 | { | 1951 | { |
1952 | //m_log.DebugFormat("check if {0} is allowed to compile {1}", ownerUUID, scriptType); | 1952 | //m_log.DebugFormat("check if {0} is allowed to compile {1}", ownerUUID, scriptType); |
1953 | switch (scriptType) { | 1953 | switch (scriptType) { |
@@ -1981,64 +1981,64 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1981 | } | 1981 | } |
1982 | return(false); | 1982 | return(false); |
1983 | } | 1983 | } |
1984 | 1984 | ||
1985 | private bool CanControlPrimMedia(UUID agentID, UUID primID, int face) | 1985 | private bool CanControlPrimMedia(UUID agentID, UUID primID, int face) |
1986 | { | 1986 | { |
1987 | // m_log.DebugFormat( | 1987 | // m_log.DebugFormat( |
1988 | // "[PERMISSONS]: Performing CanControlPrimMedia check with agentID {0}, primID {1}, face {2}", | 1988 | // "[PERMISSONS]: Performing CanControlPrimMedia check with agentID {0}, primID {1}, face {2}", |
1989 | // agentID, primID, face); | 1989 | // agentID, primID, face); |
1990 | 1990 | ||
1991 | if (null == MoapModule) | 1991 | if (null == MoapModule) |
1992 | return false; | 1992 | return false; |
1993 | 1993 | ||
1994 | SceneObjectPart part = m_scene.GetSceneObjectPart(primID); | 1994 | SceneObjectPart part = m_scene.GetSceneObjectPart(primID); |
1995 | if (null == part) | 1995 | if (null == part) |
1996 | return false; | 1996 | return false; |
1997 | 1997 | ||
1998 | MediaEntry me = MoapModule.GetMediaEntry(part, face); | 1998 | MediaEntry me = MoapModule.GetMediaEntry(part, face); |
1999 | 1999 | ||
2000 | // If there is no existing media entry then it can be controlled (in this context, created). | 2000 | // If there is no existing media entry then it can be controlled (in this context, created). |
2001 | if (null == me) | 2001 | if (null == me) |
2002 | return true; | 2002 | return true; |
2003 | 2003 | ||
2004 | // m_log.DebugFormat( | 2004 | // m_log.DebugFormat( |
2005 | // "[PERMISSIONS]: Checking CanControlPrimMedia for {0} on {1} face {2} with control permissions {3}", | 2005 | // "[PERMISSIONS]: Checking CanControlPrimMedia for {0} on {1} face {2} with control permissions {3}", |
2006 | // agentID, primID, face, me.ControlPermissions); | 2006 | // agentID, primID, face, me.ControlPermissions); |
2007 | 2007 | ||
2008 | return GenericObjectPermission(agentID, part.ParentGroup.UUID, true); | 2008 | return GenericObjectPermission(agentID, part.ParentGroup.UUID, true); |
2009 | } | 2009 | } |
2010 | 2010 | ||
2011 | private bool CanInteractWithPrimMedia(UUID agentID, UUID primID, int face) | 2011 | private bool CanInteractWithPrimMedia(UUID agentID, UUID primID, int face) |
2012 | { | 2012 | { |
2013 | // m_log.DebugFormat( | 2013 | // m_log.DebugFormat( |
2014 | // "[PERMISSONS]: Performing CanInteractWithPrimMedia check with agentID {0}, primID {1}, face {2}", | 2014 | // "[PERMISSONS]: Performing CanInteractWithPrimMedia check with agentID {0}, primID {1}, face {2}", |
2015 | // agentID, primID, face); | 2015 | // agentID, primID, face); |
2016 | 2016 | ||
2017 | if (null == MoapModule) | 2017 | if (null == MoapModule) |
2018 | return false; | 2018 | return false; |
2019 | 2019 | ||
2020 | SceneObjectPart part = m_scene.GetSceneObjectPart(primID); | 2020 | SceneObjectPart part = m_scene.GetSceneObjectPart(primID); |
2021 | if (null == part) | 2021 | if (null == part) |
2022 | return false; | 2022 | return false; |
2023 | 2023 | ||
2024 | MediaEntry me = MoapModule.GetMediaEntry(part, face); | 2024 | MediaEntry me = MoapModule.GetMediaEntry(part, face); |
2025 | 2025 | ||
2026 | // If there is no existing media entry then it can be controlled (in this context, created). | 2026 | // If there is no existing media entry then it can be controlled (in this context, created). |
2027 | if (null == me) | 2027 | if (null == me) |
2028 | return true; | 2028 | return true; |
2029 | 2029 | ||
2030 | // m_log.DebugFormat( | 2030 | // m_log.DebugFormat( |
2031 | // "[PERMISSIONS]: Checking CanInteractWithPrimMedia for {0} on {1} face {2} with interact permissions {3}", | 2031 | // "[PERMISSIONS]: Checking CanInteractWithPrimMedia for {0} on {1} face {2} with interact permissions {3}", |
2032 | // agentID, primID, face, me.InteractPermissions); | 2032 | // agentID, primID, face, me.InteractPermissions); |
2033 | 2033 | ||
2034 | return GenericPrimMediaPermission(part, agentID, me.InteractPermissions); | 2034 | return GenericPrimMediaPermission(part, agentID, me.InteractPermissions); |
2035 | } | 2035 | } |
2036 | 2036 | ||
2037 | private bool GenericPrimMediaPermission(SceneObjectPart part, UUID agentID, MediaPermission perms) | 2037 | private bool GenericPrimMediaPermission(SceneObjectPart part, UUID agentID, MediaPermission perms) |
2038 | { | 2038 | { |
2039 | // if (IsAdministrator(agentID)) | 2039 | // if (IsAdministrator(agentID)) |
2040 | // return true; | 2040 | // return true; |
2041 | 2041 | ||
2042 | if ((perms & MediaPermission.Anyone) == MediaPermission.Anyone) | 2042 | if ((perms & MediaPermission.Anyone) == MediaPermission.Anyone) |
2043 | return true; | 2043 | return true; |
2044 | 2044 | ||
@@ -2047,13 +2047,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
2047 | if (agentID == part.OwnerID) | 2047 | if (agentID == part.OwnerID) |
2048 | return true; | 2048 | return true; |
2049 | } | 2049 | } |
2050 | 2050 | ||
2051 | if ((perms & MediaPermission.Group) == MediaPermission.Group) | 2051 | if ((perms & MediaPermission.Group) == MediaPermission.Group) |
2052 | { | 2052 | { |
2053 | if (IsGroupMember(part.GroupID, agentID, 0)) | 2053 | if (IsGroupMember(part.GroupID, agentID, 0)) |
2054 | return true; | 2054 | return true; |
2055 | } | 2055 | } |
2056 | 2056 | ||
2057 | return false; | 2057 | return false; |
2058 | } | 2058 | } |
2059 | } | 2059 | } |
diff --git a/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs b/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs index 411c4d6..49246a2 100644 --- a/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs +++ b/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs | |||
@@ -54,24 +54,24 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
54 | private ICommandConsole m_console; | 54 | private ICommandConsole m_console; |
55 | 55 | ||
56 | public string Name { get { return "Region Commands Module"; } } | 56 | public string Name { get { return "Region Commands Module"; } } |
57 | 57 | ||
58 | public Type ReplaceableInterface { get { return null; } } | 58 | public Type ReplaceableInterface { get { return null; } } |
59 | 59 | ||
60 | public void Initialise(IConfigSource source) | 60 | public void Initialise(IConfigSource source) |
61 | { | 61 | { |
62 | // m_log.DebugFormat("[REGION COMMANDS MODULE]: INITIALIZED MODULE"); | 62 | // m_log.DebugFormat("[REGION COMMANDS MODULE]: INITIALIZED MODULE"); |
63 | } | 63 | } |
64 | 64 | ||
65 | public void PostInitialise() | 65 | public void PostInitialise() |
66 | { | 66 | { |
67 | // m_log.DebugFormat("[REGION COMMANDS MODULE]: POST INITIALIZED MODULE"); | 67 | // m_log.DebugFormat("[REGION COMMANDS MODULE]: POST INITIALIZED MODULE"); |
68 | } | 68 | } |
69 | 69 | ||
70 | public void Close() | 70 | public void Close() |
71 | { | 71 | { |
72 | // m_log.DebugFormat("[REGION COMMANDS MODULE]: CLOSED MODULE"); | 72 | // m_log.DebugFormat("[REGION COMMANDS MODULE]: CLOSED MODULE"); |
73 | } | 73 | } |
74 | 74 | ||
75 | public void AddRegion(Scene scene) | 75 | public void AddRegion(Scene scene) |
76 | { | 76 | { |
77 | // m_log.DebugFormat("[REGION COMMANDS MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName); | 77 | // m_log.DebugFormat("[REGION COMMANDS MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName); |
@@ -87,14 +87,14 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
87 | m_console.Commands.AddCommand( | 87 | m_console.Commands.AddCommand( |
88 | "Regions", false, "show region", | 88 | "Regions", false, "show region", |
89 | "show region", | 89 | "show region", |
90 | "Show control information for the currently selected region (host name, max physical prim size, etc).", | 90 | "Show control information for the currently selected region (host name, max physical prim size, etc).", |
91 | "A synonym for \"region get\"", | 91 | "A synonym for \"region get\"", |
92 | HandleShowRegion); | 92 | HandleShowRegion); |
93 | 93 | ||
94 | m_console.Commands.AddCommand( | 94 | m_console.Commands.AddCommand( |
95 | "Regions", false, "region get", | 95 | "Regions", false, "region get", |
96 | "region get", | 96 | "region get", |
97 | "Show control information for the currently selected region (host name, max physical prim size, etc).", | 97 | "Show control information for the currently selected region (host name, max physical prim size, etc).", |
98 | "Some parameters can be set with the \"region set\" command.\n" | 98 | "Some parameters can be set with the \"region set\" command.\n" |
99 | + "Others must be changed via a viewer (usually via the region/estate dialog box).", | 99 | + "Others must be changed via a viewer (usually via the region/estate dialog box).", |
100 | HandleShowRegion); | 100 | HandleShowRegion); |
@@ -204,7 +204,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
204 | { | 204 | { |
205 | MainConsole.Instance.OutputFormat("Usage: region set <param> <value>"); | 205 | MainConsole.Instance.OutputFormat("Usage: region set <param> <value>"); |
206 | return; | 206 | return; |
207 | } | 207 | } |
208 | 208 | ||
209 | string param = args[2]; | 209 | string param = args[2]; |
210 | string rawValue = args[3]; | 210 | string rawValue = args[3]; |
@@ -225,7 +225,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
225 | if (newValue > ri.AgentCapacity) | 225 | if (newValue > ri.AgentCapacity) |
226 | { | 226 | { |
227 | MainConsole.Instance.OutputFormat( | 227 | MainConsole.Instance.OutputFormat( |
228 | "Cannot set {0} to {1} in {2} as max-agent-limit is {3}", "agent-limit", | 228 | "Cannot set {0} to {1} in {2} as max-agent-limit is {3}", "agent-limit", |
229 | newValue, m_scene.Name, ri.AgentCapacity); | 229 | newValue, m_scene.Name, ri.AgentCapacity); |
230 | } | 230 | } |
231 | else | 231 | else |
diff --git a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs index e6a0205..8bac9e6 100644 --- a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs +++ b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs | |||
@@ -78,22 +78,22 @@ namespace OpenSim.Region.CoreModules.World.Region | |||
78 | scene.RegionInfo.RegionID.ToString())); | 78 | scene.RegionInfo.RegionID.ToString())); |
79 | 79 | ||
80 | m_Scene = scene; | 80 | m_Scene = scene; |
81 | 81 | ||
82 | scene.RegisterModuleInterface<IRestartModule>(this); | 82 | scene.RegisterModuleInterface<IRestartModule>(this); |
83 | MainConsole.Instance.Commands.AddCommand("Regions", | 83 | MainConsole.Instance.Commands.AddCommand("Regions", |
84 | false, "region restart bluebox", | 84 | false, "region restart bluebox", |
85 | "region restart bluebox <message> <delta seconds>+", | 85 | "region restart bluebox <message> <delta seconds>+", |
86 | "Schedule a region restart", | 86 | "Schedule a region restart", |
87 | "Schedule a region restart after a given number of seconds. If one delta is given then the region is restarted in delta seconds time. A time to restart is sent to users in the region as a dismissable bluebox notice. If multiple deltas are given then a notice is sent when we reach each delta.", | 87 | "Schedule a region restart after a given number of seconds. If one delta is given then the region is restarted in delta seconds time. A time to restart is sent to users in the region as a dismissable bluebox notice. If multiple deltas are given then a notice is sent when we reach each delta.", |
88 | HandleRegionRestart); | 88 | HandleRegionRestart); |
89 | 89 | ||
90 | MainConsole.Instance.Commands.AddCommand("Regions", | 90 | MainConsole.Instance.Commands.AddCommand("Regions", |
91 | false, "region restart notice", | 91 | false, "region restart notice", |
92 | "region restart notice <message> <delta seconds>+", | 92 | "region restart notice <message> <delta seconds>+", |
93 | "Schedule a region restart", | 93 | "Schedule a region restart", |
94 | "Schedule a region restart after a given number of seconds. If one delta is given then the region is restarted in delta seconds time. A time to restart is sent to users in the region as a transient notice. If multiple deltas are given then a notice is sent when we reach each delta.", | 94 | "Schedule a region restart after a given number of seconds. If one delta is given then the region is restarted in delta seconds time. A time to restart is sent to users in the region as a transient notice. If multiple deltas are given then a notice is sent when we reach each delta.", |
95 | HandleRegionRestart); | 95 | HandleRegionRestart); |
96 | 96 | ||
97 | MainConsole.Instance.Commands.AddCommand("Regions", | 97 | MainConsole.Instance.Commands.AddCommand("Regions", |
98 | false, "region restart abort", | 98 | false, "region restart abort", |
99 | "region restart abort [<message>]", | 99 | "region restart abort [<message>]", |
@@ -183,7 +183,7 @@ namespace OpenSim.Region.CoreModules.World.Region | |||
183 | nextAlert = m_Alerts[1]; | 183 | nextAlert = m_Alerts[1]; |
184 | break; | 184 | break; |
185 | } | 185 | } |
186 | 186 | ||
187 | int currentAlert = m_Alerts[0]; | 187 | int currentAlert = m_Alerts[0]; |
188 | 188 | ||
189 | m_Alerts.RemoveAt(0); | 189 | m_Alerts.RemoveAt(0); |
@@ -242,7 +242,7 @@ namespace OpenSim.Region.CoreModules.World.Region | |||
242 | else | 242 | else |
243 | { | 243 | { |
244 | m_log.WarnFormat( | 244 | m_log.WarnFormat( |
245 | "[RESTART MODULE]: Tried to set restart timer to {0} in {1}, which is not a valid interval", | 245 | "[RESTART MODULE]: Tried to set restart timer to {0} in {1}, which is not a valid interval", |
246 | intervalSeconds, m_Scene.Name); | 246 | intervalSeconds, m_Scene.Name); |
247 | } | 247 | } |
248 | } | 248 | } |
@@ -286,7 +286,7 @@ namespace OpenSim.Region.CoreModules.World.Region | |||
286 | File.Delete(Path.Combine(m_MarkerPath, | 286 | File.Delete(Path.Combine(m_MarkerPath, |
287 | m_Scene.RegionInfo.RegionID.ToString())); | 287 | m_Scene.RegionInfo.RegionID.ToString())); |
288 | } | 288 | } |
289 | 289 | ||
290 | private void HandleRegionRestart(string module, string[] args) | 290 | private void HandleRegionRestart(string module, string[] args) |
291 | { | 291 | { |
292 | if (!(MainConsole.Instance.ConsoleScene is Scene)) | 292 | if (!(MainConsole.Instance.ConsoleScene is Scene)) |
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs b/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs index e0247d9..c9bc335 100644 --- a/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs +++ b/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs | |||
@@ -45,7 +45,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser | |||
45 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "SerialiserModule")] | 45 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "SerialiserModule")] |
46 | public class SerialiserModule : ISharedRegionModule, IRegionSerialiserModule | 46 | public class SerialiserModule : ISharedRegionModule, IRegionSerialiserModule |
47 | { | 47 | { |
48 | private static readonly ILog m_log = | 48 | private static readonly ILog m_log = |
49 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 49 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
50 | 50 | ||
51 | // private Commander m_commander = new Commander("export"); | 51 | // private Commander m_commander = new Commander("export"); |
@@ -55,15 +55,15 @@ namespace OpenSim.Region.CoreModules.World.Serialiser | |||
55 | 55 | ||
56 | #region ISharedRegionModule Members | 56 | #region ISharedRegionModule Members |
57 | 57 | ||
58 | public Type ReplaceableInterface | 58 | public Type ReplaceableInterface |
59 | { | 59 | { |
60 | get { return null; } | 60 | get { return null; } |
61 | } | 61 | } |
62 | 62 | ||
63 | public void Initialise(IConfigSource source) | 63 | public void Initialise(IConfigSource source) |
64 | { | 64 | { |
65 | IConfig config = source.Configs["Serialiser"]; | 65 | IConfig config = source.Configs["Serialiser"]; |
66 | if (config != null) | 66 | if (config != null) |
67 | { | 67 | { |
68 | m_savedir = config.GetString("save_dir", m_savedir); | 68 | m_savedir = config.GetString("save_dir", m_savedir); |
69 | } | 69 | } |
@@ -150,7 +150,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser | |||
150 | { | 150 | { |
151 | SceneXmlLoader.SavePrimsToXml2(scene, stream, min, max); | 151 | SceneXmlLoader.SavePrimsToXml2(scene, stream, min, max); |
152 | } | 152 | } |
153 | 153 | ||
154 | public void SaveNamedPrimsToXml2(Scene scene, string primName, string fileName) | 154 | public void SaveNamedPrimsToXml2(Scene scene, string primName, string fileName) |
155 | { | 155 | { |
156 | SceneXmlLoader.SaveNamedPrimsToXml2(scene, primName, fileName); | 156 | SceneXmlLoader.SaveNamedPrimsToXml2(scene, primName, fileName); |
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs index a5bb1a7..c9e3141 100644 --- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs +++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs | |||
@@ -43,7 +43,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
43 | [TestFixture] | 43 | [TestFixture] |
44 | public class SerialiserTests : OpenSimTestCase | 44 | public class SerialiserTests : OpenSimTestCase |
45 | { | 45 | { |
46 | private const string ObjectRootPartStubXml = | 46 | private const string ObjectRootPartStubXml = |
47 | @"<SceneObjectGroup> | 47 | @"<SceneObjectGroup> |
48 | <RootPart> | 48 | <RootPart> |
49 | <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""> | 49 | <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""> |
@@ -149,9 +149,9 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
149 | <llsd> | 149 | <llsd> |
150 | <map> | 150 | <map> |
151 | <key>MyNamespace</key> | 151 | <key>MyNamespace</key> |
152 | <map> | 152 | <map> |
153 | <key>MyStore</key> | 153 | <key>MyStore</key> |
154 | <map> | 154 | <map> |
155 | <key>the answer</key> | 155 | <key>the answer</key> |
156 | <integer>42</integer> | 156 | <integer>42</integer> |
157 | </map> | 157 | </map> |
@@ -162,12 +162,12 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
162 | </SceneObjectPart> | 162 | </SceneObjectPart> |
163 | </RootPart>"; | 163 | </RootPart>"; |
164 | 164 | ||
165 | private const string ObjectWithNoOtherPartsXml = ObjectRootPartStubXml + | 165 | private const string ObjectWithNoOtherPartsXml = ObjectRootPartStubXml + |
166 | @" | 166 | @" |
167 | <OtherParts /> | 167 | <OtherParts /> |
168 | </SceneObjectGroup>"; | 168 | </SceneObjectGroup>"; |
169 | 169 | ||
170 | private const string ObjectWithOtherPartsXml = ObjectRootPartStubXml + | 170 | private const string ObjectWithOtherPartsXml = ObjectRootPartStubXml + |
171 | @" | 171 | @" |
172 | <OtherParts> | 172 | <OtherParts> |
173 | <Part> | 173 | <Part> |
@@ -574,9 +574,9 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
574 | <llsd> | 574 | <llsd> |
575 | <map> | 575 | <map> |
576 | <key>MyNamespace</key> | 576 | <key>MyNamespace</key> |
577 | <map> | 577 | <map> |
578 | <key>MyStore</key> | 578 | <key>MyStore</key> |
579 | <map> | 579 | <map> |
580 | <key>last words</key> | 580 | <key>last words</key> |
581 | <string>Rosebud</string> | 581 | <string>Rosebud</string> |
582 | </map> | 582 | </map> |
@@ -636,7 +636,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
636 | Assert.That(part.Name, Is.EqualTo("PrimMyRide")); | 636 | Assert.That(part.Name, Is.EqualTo("PrimMyRide")); |
637 | OSDMap store = part.DynAttrs.GetStore("MyNamespace", "MyStore"); | 637 | OSDMap store = part.DynAttrs.GetStore("MyNamespace", "MyStore"); |
638 | Assert.AreEqual(42, store["the answer"].AsInteger()); | 638 | Assert.AreEqual(42, store["the answer"].AsInteger()); |
639 | } | 639 | } |
640 | 640 | ||
641 | { | 641 | { |
642 | SceneObjectPart part = parts[1]; | 642 | SceneObjectPart part = parts[1]; |
@@ -723,7 +723,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
723 | xtr.ReadStartElement("SceneObjectGroup"); | 723 | xtr.ReadStartElement("SceneObjectGroup"); |
724 | xtr.ReadStartElement("RootPart"); | 724 | xtr.ReadStartElement("RootPart"); |
725 | xtr.ReadStartElement("SceneObjectPart"); | 725 | xtr.ReadStartElement("SceneObjectPart"); |
726 | 726 | ||
727 | UUID uuid = UUID.Zero; | 727 | UUID uuid = UUID.Zero; |
728 | string name = null; | 728 | string name = null; |
729 | UUID creatorId = UUID.Zero; | 729 | UUID creatorId = UUID.Zero; |
@@ -733,7 +733,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
733 | { | 733 | { |
734 | if (xtr.NodeType != XmlNodeType.Element) | 734 | if (xtr.NodeType != XmlNodeType.Element) |
735 | continue; | 735 | continue; |
736 | 736 | ||
737 | switch (xtr.Name) | 737 | switch (xtr.Name) |
738 | { | 738 | { |
739 | case "UUID": | 739 | case "UUID": |
@@ -833,7 +833,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
833 | XmlTextReader xtr = new XmlTextReader(new StringReader(xml2)); | 833 | XmlTextReader xtr = new XmlTextReader(new StringReader(xml2)); |
834 | xtr.ReadStartElement("SceneObjectGroup"); | 834 | xtr.ReadStartElement("SceneObjectGroup"); |
835 | xtr.ReadStartElement("SceneObjectPart"); | 835 | xtr.ReadStartElement("SceneObjectPart"); |
836 | 836 | ||
837 | UUID uuid = UUID.Zero; | 837 | UUID uuid = UUID.Zero; |
838 | string name = null; | 838 | string name = null; |
839 | UUID creatorId = UUID.Zero; | 839 | UUID creatorId = UUID.Zero; |
@@ -843,7 +843,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests | |||
843 | { | 843 | { |
844 | if (xtr.NodeType != XmlNodeType.Element) | 844 | if (xtr.NodeType != XmlNodeType.Element) |
845 | continue; | 845 | continue; |
846 | 846 | ||
847 | switch (xtr.Name) | 847 | switch (xtr.Name) |
848 | { | 848 | { |
849 | case "UUID": | 849 | case "UUID": |
diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs index 45f3ccf..2b7db18 100644 --- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs +++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs | |||
@@ -279,7 +279,7 @@ namespace OpenSim.Region.CoreModules.World.Sound | |||
279 | 279 | ||
280 | m_host.Sound = soundID; | 280 | m_host.Sound = soundID; |
281 | m_host.SoundGain = volume; | 281 | m_host.SoundGain = volume; |
282 | m_host.SoundFlags = iflags; | 282 | m_host.SoundFlags = iflags; |
283 | m_host.SoundRadius = radius; | 283 | m_host.SoundRadius = radius; |
284 | 284 | ||
285 | m_host.ScheduleFullUpdate(); | 285 | m_host.ScheduleFullUpdate(); |
@@ -309,14 +309,14 @@ namespace OpenSim.Region.CoreModules.World.Sound | |||
309 | else | 309 | else |
310 | { | 310 | { |
311 | byte bflags = 0; | 311 | byte bflags = 0; |
312 | 312 | ||
313 | if (isMaster) | 313 | if (isMaster) |
314 | bflags |= (byte)SoundFlags.SYNC_MASTER; | 314 | bflags |= (byte)SoundFlags.SYNC_MASTER; |
315 | // TODO check viewer seems to accept both | 315 | // TODO check viewer seems to accept both |
316 | if (useMaster) | 316 | if (useMaster) |
317 | bflags |= (byte)SoundFlags.SYNC_SLAVE; | 317 | bflags |= (byte)SoundFlags.SYNC_SLAVE; |
318 | PlayAttachedSound(soundID, part.OwnerID, part.UUID, volume, position, bflags, radius); | 318 | PlayAttachedSound(soundID, part.OwnerID, part.UUID, volume, position, bflags, radius); |
319 | } | 319 | } |
320 | } | 320 | } |
321 | 321 | ||
322 | public void TriggerSoundLimited(UUID objectID, UUID sound, | 322 | public void TriggerSoundLimited(UUID objectID, UUID sound, |
diff --git a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs index d0318eb..e2b3487 100644 --- a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs +++ b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs | |||
@@ -77,7 +77,7 @@ namespace OpenSim.Region.CoreModules | |||
77 | // Number of virtual days to a virtual year | 77 | // Number of virtual days to a virtual year |
78 | private int m_YearLengthDays = 0; | 78 | private int m_YearLengthDays = 0; |
79 | 79 | ||
80 | // Ratio of Daylight hours to Night time hours. This is accomplished by shifting the | 80 | // Ratio of Daylight hours to Night time hours. This is accomplished by shifting the |
81 | // sun's orbit above the horizon | 81 | // sun's orbit above the horizon |
82 | private double m_HorizonShift = 0; | 82 | private double m_HorizonShift = 0; |
83 | 83 | ||
@@ -162,7 +162,7 @@ namespace OpenSim.Region.CoreModules | |||
162 | // Determine the current "day" from current time, so we can use "today" | 162 | // Determine the current "day" from current time, so we can use "today" |
163 | // to determine Seasonal Tilt and what'not | 163 | // to determine Seasonal Tilt and what'not |
164 | 164 | ||
165 | // Integer math rounded is on purpose to drop fractional day, determines number | 165 | // Integer math rounded is on purpose to drop fractional day, determines number |
166 | // of virtual days since Epoch | 166 | // of virtual days since Epoch |
167 | PosTime = CurrentTime / SecondsPerSunCycle; | 167 | PosTime = CurrentTime / SecondsPerSunCycle; |
168 | 168 | ||
@@ -343,7 +343,7 @@ namespace OpenSim.Region.CoreModules | |||
343 | m_log.Debug("[SUN]: Positional data updated every " + m_UpdateInterval + " frames"); | 343 | m_log.Debug("[SUN]: Positional data updated every " + m_UpdateInterval + " frames"); |
344 | } | 344 | } |
345 | 345 | ||
346 | public Type ReplaceableInterface | 346 | public Type ReplaceableInterface |
347 | { | 347 | { |
348 | get { return null; } | 348 | get { return null; } |
349 | } | 349 | } |
@@ -417,7 +417,7 @@ namespace OpenSim.Region.CoreModules | |||
417 | client.SendSunPos(Position, Velocity, CurrentTime, SecondsPerSunCycle, SecondsPerYear, OrbitalPosition); | 417 | client.SendSunPos(Position, Velocity, CurrentTime, SecondsPerSunCycle, SecondsPerYear, OrbitalPosition); |
418 | } | 418 | } |
419 | } | 419 | } |
420 | } | 420 | } |
421 | 421 | ||
422 | public void SunUpdate() | 422 | public void SunUpdate() |
423 | { | 423 | { |
@@ -464,7 +464,7 @@ namespace OpenSim.Region.CoreModules | |||
464 | 464 | ||
465 | while (sunFixedHour < 0) | 465 | while (sunFixedHour < 0) |
466 | sunFixedHour += 24; | 466 | sunFixedHour += 24; |
467 | 467 | ||
468 | m_SunFixedHour = sunFixedHour; | 468 | m_SunFixedHour = sunFixedHour; |
469 | m_SunFixed = fixedSun; | 469 | m_SunFixed = fixedSun; |
470 | 470 | ||
@@ -516,7 +516,7 @@ namespace OpenSim.Region.CoreModules | |||
516 | 516 | ||
517 | case "current_time": | 517 | case "current_time": |
518 | return GetCurrentTimeAsLindenSunHour(); | 518 | return GetCurrentTimeAsLindenSunHour(); |
519 | 519 | ||
520 | default: | 520 | default: |
521 | throw new Exception("Unknown sun parameter."); | 521 | throw new Exception("Unknown sun parameter."); |
522 | } | 522 | } |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs index 1e67f72..bcd9dcd 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs | |||
@@ -247,4 +247,4 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders | |||
247 | } | 247 | } |
248 | } | 248 | } |
249 | 249 | ||
250 | 250 | ||
diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/JPEG.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/JPEG.cs index 36c2bbf..d604dc7 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/JPEG.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/JPEG.cs | |||
@@ -104,10 +104,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders | |||
104 | using (Bitmap gradientmapLd = new Bitmap("defaultstripe.png")) | 104 | using (Bitmap gradientmapLd = new Bitmap("defaultstripe.png")) |
105 | { | 105 | { |
106 | pallete = gradientmapLd.Height; | 106 | pallete = gradientmapLd.Height; |
107 | 107 | ||
108 | bmp = new Bitmap(map.Width, map.Height); | 108 | bmp = new Bitmap(map.Width, map.Height); |
109 | colours = new Color[pallete]; | 109 | colours = new Color[pallete]; |
110 | 110 | ||
111 | for (int i = 0; i < pallete; i++) | 111 | for (int i = 0; i < pallete; i++) |
112 | { | 112 | { |
113 | colours[i] = gradientmapLd.GetPixel(0, i); | 113 | colours[i] = gradientmapLd.GetPixel(0, i); |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs index 59994e4..68d6ed2 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs | |||
@@ -275,6 +275,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders | |||
275 | public bool SupportsTileSave() | 275 | public bool SupportsTileSave() |
276 | { | 276 | { |
277 | return false; | 277 | return false; |
278 | } | 278 | } |
279 | } | 279 | } |
280 | } \ No newline at end of file | 280 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/ITerrainFloodEffect.cs b/OpenSim/Region/CoreModules/World/Terrain/ITerrainFloodEffect.cs index 6324aca..f7be25f 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/ITerrainFloodEffect.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/ITerrainFloodEffect.cs | |||
@@ -32,7 +32,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
32 | { | 32 | { |
33 | public interface ITerrainFloodEffect | 33 | public interface ITerrainFloodEffect |
34 | { | 34 | { |
35 | void FloodEffect(ITerrainChannel map, Boolean[,] fillArea, double strength, | 35 | void FloodEffect(ITerrainChannel map, Boolean[,] fillArea, double strength, |
36 | int startX, int endX, int startY, int endY); | 36 | int startX, int endX, int startY, int endY); |
37 | } | 37 | } |
38 | } \ No newline at end of file | 38 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/ITerrainLoader.cs b/OpenSim/Region/CoreModules/World/Terrain/ITerrainLoader.cs index 3ba3657..855d131 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/ITerrainLoader.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/ITerrainLoader.cs | |||
@@ -33,7 +33,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
33 | public interface ITerrainLoader | 33 | public interface ITerrainLoader |
34 | { | 34 | { |
35 | // Returns true if that extension can be used for terrain save-tile | 35 | // Returns true if that extension can be used for terrain save-tile |
36 | // (Look into each file in Region.CoreModules.World.Terrain.FileLoaders) | 36 | // (Look into each file in Region.CoreModules.World.Terrain.FileLoaders) |
37 | bool SupportsTileSave(); | 37 | bool SupportsTileSave(); |
38 | 38 | ||
39 | string FileExtension { get; } | 39 | string FileExtension { get; } |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/FlattenSphere.cs b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/FlattenSphere.cs index 8937f63..9d3d4cb 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/FlattenSphere.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/FlattenSphere.cs | |||
@@ -77,7 +77,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes | |||
77 | { | 77 | { |
78 | map[x, y] += delta; | 78 | map[x, y] += delta; |
79 | } | 79 | } |
80 | 80 | ||
81 | } | 81 | } |
82 | } | 82 | } |
83 | } | 83 | } |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs index bbf9407..a88a022 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs | |||
@@ -58,7 +58,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes | |||
58 | map[x, y] = 0.0; | 58 | map[x, y] = 0.0; |
59 | else | 59 | else |
60 | map[x, y] = newz; | 60 | map[x, y] = newz; |
61 | } | 61 | } |
62 | } | 62 | } |
63 | } | 63 | } |
64 | 64 | ||
diff --git a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs index 1b704bb..5305cb4 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs | |||
@@ -33,7 +33,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes | |||
33 | public class RaiseSphere : ITerrainPaintableEffect | 33 | public class RaiseSphere : ITerrainPaintableEffect |
34 | { | 34 | { |
35 | #region ITerrainPaintableEffect Members | 35 | #region ITerrainPaintableEffect Members |
36 | 36 | ||
37 | 37 | ||
38 | public void PaintEffect(ITerrainChannel map, bool[,] mask, double rx, double ry, double rz, | 38 | public void PaintEffect(ITerrainChannel map, bool[,] mask, double rx, double ry, double rz, |
39 | double strength, double duration, int startX, int endX, int startY, int endY) | 39 | double strength, double duration, int startX, int endX, int startY, int endY) |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RevertSphere.cs b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RevertSphere.cs index efc5324..ca30e9e 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RevertSphere.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RevertSphere.cs | |||
@@ -46,7 +46,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes | |||
46 | { | 46 | { |
47 | strength = TerrainUtil.MetersToSphericalStrength(strength); | 47 | strength = TerrainUtil.MetersToSphericalStrength(strength); |
48 | duration = 0.03; //MCP Should be read from ini file | 48 | duration = 0.03; //MCP Should be read from ini file |
49 | 49 | ||
50 | if (duration > 1.0) | 50 | if (duration > 1.0) |
51 | duration = 1.0; | 51 | duration = 1.0; |
52 | if (duration < 0) | 52 | if (duration < 0) |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/SmoothSphere.cs b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/SmoothSphere.cs index 65dd0a6..0342962 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/SmoothSphere.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/SmoothSphere.cs | |||
@@ -42,10 +42,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes | |||
42 | int x, y; | 42 | int x, y; |
43 | double[,] tweak = new double[map.Width,map.Height]; | 43 | double[,] tweak = new double[map.Width,map.Height]; |
44 | 44 | ||
45 | double area = strength; | 45 | double area = strength; |
46 | double step = strength / 4.0; | 46 | double step = strength / 4.0; |
47 | duration = 0.03; //MCP Should be read from ini file | 47 | duration = 0.03; //MCP Should be read from ini file |
48 | 48 | ||
49 | 49 | ||
50 | // compute delta map | 50 | // compute delta map |
51 | for (x = startX; x <= endX; x++) | 51 | for (x = startX; x <= endX; x++) |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index e21681d..65d4c4a 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |||
@@ -218,7 +218,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
218 | if (terrainConfig != null) | 218 | if (terrainConfig != null) |
219 | { | 219 | { |
220 | m_InitialTerrain = terrainConfig.GetString("InitialTerrain", m_InitialTerrain); | 220 | m_InitialTerrain = terrainConfig.GetString("InitialTerrain", m_InitialTerrain); |
221 | m_sendTerrainUpdatesByViewDistance = | 221 | m_sendTerrainUpdatesByViewDistance = |
222 | terrainConfig.GetBoolean( | 222 | terrainConfig.GetBoolean( |
223 | "SendTerrainUpdatesByViewDistance",m_sendTerrainUpdatesByViewDistance); | 223 | "SendTerrainUpdatesByViewDistance",m_sendTerrainUpdatesByViewDistance); |
224 | } | 224 | } |
@@ -240,7 +240,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
240 | if(m_baked != null) | 240 | if(m_baked != null) |
241 | m_channel = m_baked.MakeCopy(); | 241 | m_channel = m_baked.MakeCopy(); |
242 | else | 242 | else |
243 | m_channel = new TerrainChannel(m_InitialTerrain, | 243 | m_channel = new TerrainChannel(m_InitialTerrain, |
244 | (int)m_scene.RegionInfo.RegionSizeX, | 244 | (int)m_scene.RegionInfo.RegionSizeX, |
245 | (int)m_scene.RegionInfo.RegionSizeY, | 245 | (int)m_scene.RegionInfo.RegionSizeY, |
246 | (int)m_scene.RegionInfo.RegionSizeZ); | 246 | (int)m_scene.RegionInfo.RegionSizeZ); |
@@ -463,7 +463,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
463 | throw new TerrainException(String.Format("unable to load heightmap from file {0}: no loader available for that format", filename)); | 463 | throw new TerrainException(String.Format("unable to load heightmap from file {0}: no loader available for that format", filename)); |
464 | } | 464 | } |
465 | 465 | ||
466 | public void LoadFromStream(string filename, Vector3 displacement, | 466 | public void LoadFromStream(string filename, Vector3 displacement, |
467 | float rotationDegrees, Vector2 boundingOrigin, Vector2 boundingSize, Stream stream) | 467 | float rotationDegrees, Vector2 boundingOrigin, Vector2 boundingSize, Stream stream) |
468 | { | 468 | { |
469 | foreach (KeyValuePair<string, ITerrainLoader> loader in m_loaders) | 469 | foreach (KeyValuePair<string, ITerrainLoader> loader in m_loaders) |
@@ -724,7 +724,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
724 | 724 | ||
725 | /// <summary> | 725 | /// <summary> |
726 | /// Saves the current state of the region into the baked map buffer. | 726 | /// Saves the current state of the region into the baked map buffer. |
727 | 727 | ||
728 | /// </summary> | 728 | /// </summary> |
729 | public void UpdateBakedMap() | 729 | public void UpdateBakedMap() |
730 | { | 730 | { |
@@ -825,7 +825,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
825 | m_scene.RegionInfo.RegionName, filename, m_supportFileExtensionsForTileSave); | 825 | m_scene.RegionInfo.RegionName, filename, m_supportFileExtensionsForTileSave); |
826 | } | 826 | } |
827 | 827 | ||
828 | 828 | ||
829 | /// <summary> | 829 | /// <summary> |
830 | /// This is used to check to see of any of the terrain is tainted and, if so, schedule | 830 | /// This is used to check to see of any of the terrain is tainted and, if so, schedule |
831 | /// updates for all the presences. | 831 | /// updates for all the presences. |
@@ -945,7 +945,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
945 | lock (m_perClientPatchUpdates) | 945 | lock (m_perClientPatchUpdates) |
946 | m_perClientPatchUpdates.Remove(client); | 946 | m_perClientPatchUpdates.Remove(client); |
947 | } | 947 | } |
948 | 948 | ||
949 | /// <summary> | 949 | /// <summary> |
950 | /// Scan over changes in the terrain and limit height changes. This enforces the | 950 | /// Scan over changes in the terrain and limit height changes. This enforces the |
951 | /// non-estate owner limits on rate of terrain editting. | 951 | /// non-estate owner limits on rate of terrain editting. |
@@ -1312,7 +1312,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1312 | } | 1312 | } |
1313 | } | 1313 | } |
1314 | return ret; | 1314 | return ret; |
1315 | } | 1315 | } |
1316 | 1316 | ||
1317 | private void client_OnModifyTerrain(UUID user, float height, float seconds, byte size, byte action, | 1317 | private void client_OnModifyTerrain(UUID user, float height, float seconds, byte size, byte action, |
1318 | float north, float west, float south, float east, UUID agentId) | 1318 | float north, float west, float south, float east, UUID agentId) |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainModuleTests.cs b/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainModuleTests.cs index 0563ad0..6a832bc 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainModuleTests.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainModuleTests.cs | |||
@@ -45,8 +45,8 @@ namespace OpenSim.Region.CoreModules.Terrain.Tests | |||
45 | //UUID userId = TestHelpers.ParseTail(0x1); | 45 | //UUID userId = TestHelpers.ParseTail(0x1); |
46 | 46 | ||
47 | TerrainModule tm = new TerrainModule(); | 47 | TerrainModule tm = new TerrainModule(); |
48 | Scene scene = new SceneHelpers().SetupScene(); | 48 | Scene scene = new SceneHelpers().SetupScene(); |
49 | SceneHelpers.SetupSceneModules(scene, tm); | 49 | SceneHelpers.SetupSceneModules(scene, tm); |
50 | 50 | ||
51 | // Fillheight of 30 | 51 | // Fillheight of 30 |
52 | { | 52 | { |
diff --git a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs index 3f5d375..04b6f00 100644 --- a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs +++ b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs | |||
@@ -39,14 +39,14 @@ namespace OpenSim.Region.CoreModules.World.Vegetation | |||
39 | { | 39 | { |
40 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "VegetationModule")] | 40 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "VegetationModule")] |
41 | public class VegetationModule : INonSharedRegionModule, IVegetationModule | 41 | public class VegetationModule : INonSharedRegionModule, IVegetationModule |
42 | { | 42 | { |
43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
44 | 44 | ||
45 | protected Scene m_scene; | 45 | protected Scene m_scene; |
46 | 46 | ||
47 | protected static readonly PCode[] creationCapabilities = new PCode[] { PCode.Grass, PCode.NewTree, PCode.Tree }; | 47 | protected static readonly PCode[] creationCapabilities = new PCode[] { PCode.Grass, PCode.NewTree, PCode.Tree }; |
48 | public PCode[] CreationCapabilities { get { return creationCapabilities; } } | 48 | public PCode[] CreationCapabilities { get { return creationCapabilities; } } |
49 | 49 | ||
50 | public void Initialise(IConfigSource source) | 50 | public void Initialise(IConfigSource source) |
51 | { | 51 | { |
52 | } | 52 | } |
@@ -83,10 +83,10 @@ namespace OpenSim.Region.CoreModules.World.Vegetation | |||
83 | treeShape.PCode = newTree ? (byte)PCode.NewTree : (byte)PCode.Tree; | 83 | treeShape.PCode = newTree ? (byte)PCode.NewTree : (byte)PCode.Tree; |
84 | treeShape.Scale = scale; | 84 | treeShape.Scale = scale; |
85 | treeShape.State = (byte)treeType; | 85 | treeShape.State = (byte)treeType; |
86 | 86 | ||
87 | return m_scene.AddNewPrim(uuid, groupID, position, rotation, treeShape); | 87 | return m_scene.AddNewPrim(uuid, groupID, position, rotation, treeShape); |
88 | } | 88 | } |
89 | 89 | ||
90 | public SceneObjectGroup CreateEntity( | 90 | public SceneObjectGroup CreateEntity( |
91 | UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape) | 91 | UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape) |
92 | { | 92 | { |
@@ -95,22 +95,22 @@ namespace OpenSim.Region.CoreModules.World.Vegetation | |||
95 | m_log.DebugFormat("[VEGETATION]: PCode {0} not handled by {1}", shape.PCode, Name); | 95 | m_log.DebugFormat("[VEGETATION]: PCode {0} not handled by {1}", shape.PCode, Name); |
96 | return null; | 96 | return null; |
97 | } | 97 | } |
98 | 98 | ||
99 | SceneObjectGroup sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape); | 99 | SceneObjectGroup sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape); |
100 | SceneObjectPart rootPart = sceneObject.GetPart(sceneObject.UUID); | 100 | SceneObjectPart rootPart = sceneObject.GetPart(sceneObject.UUID); |
101 | 101 | ||
102 | // if grass or tree, make phantom | 102 | // if grass or tree, make phantom |
103 | //rootPart.TrimPermissions(); | 103 | //rootPart.TrimPermissions(); |
104 | rootPart.AddFlag(PrimFlags.Phantom); | 104 | rootPart.AddFlag(PrimFlags.Phantom); |
105 | if (rootPart.Shape.PCode != (byte)PCode.Grass) | 105 | if (rootPart.Shape.PCode != (byte)PCode.Grass) |
106 | AdaptTree(ref shape); | 106 | AdaptTree(ref shape); |
107 | 107 | ||
108 | m_scene.AddNewSceneObject(sceneObject, true); | 108 | m_scene.AddNewSceneObject(sceneObject, true); |
109 | sceneObject.SetGroup(groupID, null); | 109 | sceneObject.SetGroup(groupID, null); |
110 | 110 | ||
111 | return sceneObject; | 111 | return sceneObject; |
112 | } | 112 | } |
113 | 113 | ||
114 | protected void AdaptTree(ref PrimitiveBaseShape tree) | 114 | protected void AdaptTree(ref PrimitiveBaseShape tree) |
115 | { | 115 | { |
116 | // Tree size has to be adapted depending on its type | 116 | // Tree size has to be adapted depending on its type |
diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/TerrainSplat.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/TerrainSplat.cs index 4719ba3..226b330 100644 --- a/OpenSim/Region/CoreModules/World/Warp3DMap/TerrainSplat.cs +++ b/OpenSim/Region/CoreModules/World/Warp3DMap/TerrainSplat.cs | |||
@@ -226,7 +226,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
226 | float pctX = (float)x / 255f; | 226 | float pctX = (float)x / 255f; |
227 | float pctY = (float)y / 255f; | 227 | float pctY = (float)y / 255f; |
228 | 228 | ||
229 | // Use bilinear interpolation between the four corners of start height and | 229 | // Use bilinear interpolation between the four corners of start height and |
230 | // height range to select the current values at this position | 230 | // height range to select the current values at this position |
231 | float startHeight = ImageUtils.Bilinear( | 231 | float startHeight = ImageUtils.Bilinear( |
232 | startHeights[0], | 232 | startHeights[0], |
@@ -257,7 +257,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
257 | float highFreq = Perlin.turbulence2(vec.X, vec.Y, 2f) * 2.25f; | 257 | float highFreq = Perlin.turbulence2(vec.X, vec.Y, 2f) * 2.25f; |
258 | float noise = (lowFreq + highFreq) * 2f; | 258 | float noise = (lowFreq + highFreq) * 2f; |
259 | 259 | ||
260 | // Combine the current height, generated noise, start height, and height range parameters, then scale all of it | 260 | // Combine the current height, generated noise, start height, and height range parameters, then scale all of it |
261 | float layer = ((height + noise - startHeight) / heightRange) * 4f; | 261 | float layer = ((height + noise - startHeight) / heightRange) * 4f; |
262 | if (Single.IsNaN(layer)) | 262 | if (Single.IsNaN(layer)) |
263 | layer = 0f; | 263 | layer = 0f; |
diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs index cb37067..4934ebd 100644 --- a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs +++ b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs | |||
@@ -96,9 +96,9 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
96 | 96 | ||
97 | m_Enabled = true; | 97 | m_Enabled = true; |
98 | 98 | ||
99 | m_drawPrimVolume | 99 | m_drawPrimVolume |
100 | = Util.GetConfigVarFromSections<bool>(m_config, "DrawPrimOnMapTile", configSections, m_drawPrimVolume); | 100 | = Util.GetConfigVarFromSections<bool>(m_config, "DrawPrimOnMapTile", configSections, m_drawPrimVolume); |
101 | m_textureTerrain | 101 | m_textureTerrain |
102 | = Util.GetConfigVarFromSections<bool>(m_config, "TextureOnMapTile", configSections, m_textureTerrain); | 102 | = Util.GetConfigVarFromSections<bool>(m_config, "TextureOnMapTile", configSections, m_textureTerrain); |
103 | m_texturePrims | 103 | m_texturePrims |
104 | = Util.GetConfigVarFromSections<bool>(m_config, "TexturePrims", configSections, m_texturePrims); | 104 | = Util.GetConfigVarFromSections<bool>(m_config, "TexturePrims", configSections, m_texturePrims); |
@@ -277,7 +277,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
277 | m_scene.RegionInfo.RegionSizeY * 0.5f - 0.5f); | 277 | m_scene.RegionInfo.RegionSizeY * 0.5f - 0.5f); |
278 | 278 | ||
279 | warp_Material waterColorMaterial = new warp_Material(ConvertColor(WATER_COLOR)); | 279 | warp_Material waterColorMaterial = new warp_Material(ConvertColor(WATER_COLOR)); |
280 | waterColorMaterial.setReflectivity(0); // match water color with standard map module thanks lkalif | 280 | waterColorMaterial.setReflectivity(0); // match water color with standard map module thanks lkalif |
281 | waterColorMaterial.setTransparency((byte)((1f - WATER_COLOR.A) * 255f)); | 281 | waterColorMaterial.setTransparency((byte)((1f - WATER_COLOR.A) * 255f)); |
282 | renderer.Scene.addMaterial("WaterColor", waterColorMaterial); | 282 | renderer.Scene.addMaterial("WaterColor", waterColorMaterial); |
283 | renderer.SetObjectMaterial("Water", "WaterColor"); | 283 | renderer.SetObjectMaterial("Water", "WaterColor"); |
@@ -292,7 +292,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
292 | 292 | ||
293 | float regionsx = m_scene.RegionInfo.RegionSizeX; | 293 | float regionsx = m_scene.RegionInfo.RegionSizeX; |
294 | float regionsy = m_scene.RegionInfo.RegionSizeY; | 294 | float regionsy = m_scene.RegionInfo.RegionSizeY; |
295 | 295 | ||
296 | // 'diff' is the difference in scale between the real region size and the size of terrain we're buiding | 296 | // 'diff' is the difference in scale between the real region size and the size of terrain we're buiding |
297 | float diff = regionsx / 256f; | 297 | float diff = regionsx / 256f; |
298 | 298 | ||
@@ -377,7 +377,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
377 | warp_Material material = new warp_Material(texture); | 377 | warp_Material material = new warp_Material(texture); |
378 | material.setReflectivity(50); | 378 | material.setReflectivity(50); |
379 | renderer.Scene.addMaterial("TerrainColor", material); | 379 | renderer.Scene.addMaterial("TerrainColor", material); |
380 | renderer.Scene.material("TerrainColor").setReflectivity(0); // reduces tile seams a bit thanks lkalif | 380 | renderer.Scene.material("TerrainColor").setReflectivity(0); // reduces tile seams a bit thanks lkalif |
381 | renderer.SetObjectMaterial("Terrain", "TerrainColor"); | 381 | renderer.SetObjectMaterial("Terrain", "TerrainColor"); |
382 | } | 382 | } |
383 | 383 | ||
@@ -530,7 +530,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
530 | 530 | ||
531 | if (!fetched) | 531 | if (!fetched) |
532 | { | 532 | { |
533 | // Fetch the texture, decode and get the average color, | 533 | // Fetch the texture, decode and get the average color, |
534 | // then save it to a temporary metadata asset | 534 | // then save it to a temporary metadata asset |
535 | AssetBase textureAsset = m_scene.AssetService.Get(face.TextureID.ToString()); | 535 | AssetBase textureAsset = m_scene.AssetService.Get(face.TextureID.ToString()); |
536 | if (textureAsset != null) | 536 | if (textureAsset != null) |
@@ -616,7 +616,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
616 | catch (Exception e) | 616 | catch (Exception e) |
617 | { | 617 | { |
618 | m_log.Warn(string.Format("[WARP 3D IMAGE MODULE]: Failed to decode asset {0}, exception ", id), e); | 618 | m_log.Warn(string.Format("[WARP 3D IMAGE MODULE]: Failed to decode asset {0}, exception ", id), e); |
619 | } | 619 | } |
620 | } | 620 | } |
621 | 621 | ||
622 | return ret; | 622 | return ret; |
@@ -678,10 +678,10 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
678 | { | 678 | { |
679 | width = bitmap.Width; | 679 | width = bitmap.Width; |
680 | height = bitmap.Height; | 680 | height = bitmap.Height; |
681 | 681 | ||
682 | BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.ReadOnly, bitmap.PixelFormat); | 682 | BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.ReadOnly, bitmap.PixelFormat); |
683 | pixelBytes = (bitmap.PixelFormat == PixelFormat.Format24bppRgb) ? 3 : 4; | 683 | pixelBytes = (bitmap.PixelFormat == PixelFormat.Format24bppRgb) ? 3 : 4; |
684 | 684 | ||
685 | // Sum up the individual channels | 685 | // Sum up the individual channels |
686 | unsafe | 686 | unsafe |
687 | { | 687 | { |
@@ -690,7 +690,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
690 | for (int y = 0; y < height; y++) | 690 | for (int y = 0; y < height; y++) |
691 | { | 691 | { |
692 | byte* row = (byte*)bitmapData.Scan0 + (y * bitmapData.Stride); | 692 | byte* row = (byte*)bitmapData.Scan0 + (y * bitmapData.Stride); |
693 | 693 | ||
694 | for (int x = 0; x < width; x++) | 694 | for (int x = 0; x < width; x++) |
695 | { | 695 | { |
696 | b += row[x * pixelBytes + 0]; | 696 | b += row[x * pixelBytes + 0]; |
@@ -705,7 +705,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
705 | for (int y = 0; y < height; y++) | 705 | for (int y = 0; y < height; y++) |
706 | { | 706 | { |
707 | byte* row = (byte*)bitmapData.Scan0 + (y * bitmapData.Stride); | 707 | byte* row = (byte*)bitmapData.Scan0 + (y * bitmapData.Stride); |
708 | 708 | ||
709 | for (int x = 0; x < width; x++) | 709 | for (int x = 0; x < width; x++) |
710 | { | 710 | { |
711 | b += row[x * pixelBytes + 0]; | 711 | b += row[x * pixelBytes + 0]; |
diff --git a/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs b/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs index 65691fe..a2b44df 100644 --- a/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs +++ b/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs | |||
@@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins | |||
50 | private float m_avgDirection = 0.0f; // Average direction of the wind in degrees | 50 | private float m_avgDirection = 0.0f; // Average direction of the wind in degrees |
51 | private float m_varStrength = 5.0f; // Max Strength Variance | 51 | private float m_varStrength = 5.0f; // Max Strength Variance |
52 | private float m_varDirection = 30.0f;// Max Direction Variance | 52 | private float m_varDirection = 30.0f;// Max Direction Variance |
53 | private float m_rateChange = 1.0f; // | 53 | private float m_rateChange = 1.0f; // |
54 | 54 | ||
55 | private Vector2 m_curPredominateWind = new Vector2(); | 55 | private Vector2 m_curPredominateWind = new Vector2(); |
56 | 56 | ||
@@ -70,7 +70,7 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins | |||
70 | 70 | ||
71 | public void Initialise() | 71 | public void Initialise() |
72 | { | 72 | { |
73 | 73 | ||
74 | } | 74 | } |
75 | 75 | ||
76 | #endregion | 76 | #endregion |
@@ -111,7 +111,7 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins | |||
111 | // Prevailing wind algorithm | 111 | // Prevailing wind algorithm |
112 | // Inspired by Kanker Greenacre | 112 | // Inspired by Kanker Greenacre |
113 | 113 | ||
114 | // TODO: | 114 | // TODO: |
115 | // * This should probably be based on in-world time. | 115 | // * This should probably be based on in-world time. |
116 | // * should probably move all these local variables to class members and constants | 116 | // * should probably move all these local variables to class members and constants |
117 | double time = DateTime.Now.TimeOfDay.Seconds / 86400.0f; | 117 | double time = DateTime.Now.TimeOfDay.Seconds / 86400.0f; |
@@ -125,7 +125,7 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins | |||
125 | offset = Math.Sin(theta) * Math.Sin(theta*4) + (Math.Sin(theta*13) / 3); | 125 | offset = Math.Sin(theta) * Math.Sin(theta*4) + (Math.Sin(theta*13) / 3); |
126 | double windSpeed = m_avgStrength + (m_varStrength * offset); | 126 | double windSpeed = m_avgStrength + (m_varStrength * offset); |
127 | 127 | ||
128 | if (windSpeed < 0) | 128 | if (windSpeed < 0) |
129 | windSpeed = -windSpeed; | 129 | windSpeed = -windSpeed; |
130 | 130 | ||
131 | m_curPredominateWind.X = (float)Math.Cos(windDir); | 131 | m_curPredominateWind.X = (float)Math.Cos(windDir); |
@@ -157,9 +157,9 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins | |||
157 | 157 | ||
158 | public string Description | 158 | public string Description |
159 | { | 159 | { |
160 | get | 160 | get |
161 | { | 161 | { |
162 | return "Provides a predominate wind direction that can change within configured variances for direction and speed."; | 162 | return "Provides a predominate wind direction that can change within configured variances for direction and speed."; |
163 | } | 163 | } |
164 | } | 164 | } |
165 | 165 | ||
diff --git a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs index 95cf57d..a1fff62 100644 --- a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs +++ b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs | |||
@@ -155,7 +155,7 @@ namespace OpenSim.Region.CoreModules | |||
155 | // Register event handlers for when Avatars enter the region, and frame ticks | 155 | // Register event handlers for when Avatars enter the region, and frame ticks |
156 | m_scene.EventManager.OnFrame += WindUpdate; | 156 | m_scene.EventManager.OnFrame += WindUpdate; |
157 | 157 | ||
158 | // Register the wind module | 158 | // Register the wind module |
159 | m_scene.RegisterModuleInterface<IWindModule>(this); | 159 | m_scene.RegisterModuleInterface<IWindModule>(this); |
160 | 160 | ||
161 | // Generate initial wind values | 161 | // Generate initial wind values |
@@ -351,7 +351,7 @@ namespace OpenSim.Region.CoreModules | |||
351 | #region IWindModule Methods | 351 | #region IWindModule Methods |
352 | 352 | ||
353 | /// <summary> | 353 | /// <summary> |
354 | /// Retrieve the wind speed at the given region coordinate. This | 354 | /// Retrieve the wind speed at the given region coordinate. This |
355 | /// implimentation ignores Z. | 355 | /// implimentation ignores Z. |
356 | /// </summary> | 356 | /// </summary> |
357 | /// <param name="x">0...255</param> | 357 | /// <param name="x">0...255</param> |
@@ -396,7 +396,7 @@ namespace OpenSim.Region.CoreModules | |||
396 | 396 | ||
397 | public string WindActiveModelPluginName | 397 | public string WindActiveModelPluginName |
398 | { | 398 | { |
399 | get | 399 | get |
400 | { | 400 | { |
401 | if (m_activeWindPlugin != null) | 401 | if (m_activeWindPlugin != null) |
402 | { | 402 | { |
@@ -429,7 +429,7 @@ namespace OpenSim.Region.CoreModules | |||
429 | { | 429 | { |
430 | client.SendWindData(m_dataVersion, windSpeeds); | 430 | client.SendWindData(m_dataVersion, windSpeeds); |
431 | }); | 431 | }); |
432 | 432 | ||
433 | } | 433 | } |
434 | finally | 434 | finally |
435 | { | 435 | { |
@@ -440,7 +440,7 @@ namespace OpenSim.Region.CoreModules | |||
440 | } | 440 | } |
441 | 441 | ||
442 | /// <summary> | 442 | /// <summary> |
443 | /// Calculate new wind | 443 | /// Calculate new wind |
444 | /// returns false if no change | 444 | /// returns false if no change |
445 | /// </summary> | 445 | /// </summary> |
446 | 446 | ||
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index fb63c6a..5876df3 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs | |||
@@ -186,7 +186,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
186 | // remoteClient.SendAlertMessage("Hyperlink could not be established."); | 186 | // remoteClient.SendAlertMessage("Hyperlink could not be established."); |
187 | 187 | ||
188 | //m_log.DebugFormat("[MAPSEARCHMODULE]: search {0} returned {1} regions", mapName, regionInfos.Count); | 188 | //m_log.DebugFormat("[MAPSEARCHMODULE]: search {0} returned {1} regions", mapName, regionInfos.Count); |
189 | 189 | ||
190 | MapBlockData data; | 190 | MapBlockData data; |
191 | if (regionInfos != null && regionInfos.Count > 0) | 191 | if (regionInfos != null && regionInfos.Count > 0) |
192 | { | 192 | { |
@@ -214,7 +214,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
214 | // send extra user messages for V3 | 214 | // send extra user messages for V3 |
215 | // because the UI is very confusing | 215 | // because the UI is very confusing |
216 | // while we don't fix the hard-coded urls | 216 | // while we don't fix the hard-coded urls |
217 | if (flags == 2) | 217 | if (flags == 2) |
218 | { | 218 | { |
219 | if (regionInfos == null || regionInfos.Count == 0) | 219 | if (regionInfos == null || regionInfos.Count == 0) |
220 | remoteClient.SendAgentAlertMessage("No regions found with that name.", true); | 220 | remoteClient.SendAgentAlertMessage("No regions found with that name.", true); |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index c249e9d..5dcf326 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
68 | private static readonly UUID STOP_UUID = UUID.Random(); | 68 | private static readonly UUID STOP_UUID = UUID.Random(); |
69 | 69 | ||
70 | private OpenSim.Framework.BlockingQueue<MapRequestState> requests = new OpenSim.Framework.BlockingQueue<MapRequestState>(); | 70 | private OpenSim.Framework.BlockingQueue<MapRequestState> requests = new OpenSim.Framework.BlockingQueue<MapRequestState>(); |
71 | 71 | ||
72 | private ManualResetEvent m_mapBlockRequestEvent = new ManualResetEvent(false); | 72 | private ManualResetEvent m_mapBlockRequestEvent = new ManualResetEvent(false); |
73 | private Dictionary<UUID, Queue<MapBlockRequestData>> m_mapBlockRequests = new Dictionary<UUID, Queue<MapBlockRequestData>>(); | 73 | private Dictionary<UUID, Queue<MapBlockRequestData>> m_mapBlockRequests = new Dictionary<UUID, Queue<MapBlockRequestData>>(); |
74 | 74 | ||
@@ -729,7 +729,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
729 | break; | 729 | break; |
730 | 730 | ||
731 | // agent gone? | 731 | // agent gone? |
732 | 732 | ||
733 | m_scene.TryGetScenePresence(st.agentID, out av); | 733 | m_scene.TryGetScenePresence(st.agentID, out av); |
734 | if (av == null || av.IsChildAgent || av.IsDeleted || av.IsInTransit) | 734 | if (av == null || av.IsChildAgent || av.IsDeleted || av.IsInTransit) |
735 | continue; | 735 | continue; |
@@ -748,7 +748,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
748 | { | 748 | { |
749 | m_cachedRegionMapItemsResponses.TryGetValue(st.regionhandle, out responseMap); | 749 | m_cachedRegionMapItemsResponses.TryGetValue(st.regionhandle, out responseMap); |
750 | dorequest = false; | 750 | dorequest = false; |
751 | } | 751 | } |
752 | else | 752 | else |
753 | m_cachedRegionMapItemsResponses.Add(st.regionhandle, null, expireResponsesTime); // a bit more time for the access | 753 | m_cachedRegionMapItemsResponses.Add(st.regionhandle, null, expireResponsesTime); // a bit more time for the access |
754 | } | 754 | } |
@@ -1133,7 +1133,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1133 | if(m_mapBlockRequests[agentID].Count < 150 ) | 1133 | if(m_mapBlockRequests[agentID].Count < 150 ) |
1134 | m_mapBlockRequests[agentID].Enqueue(req); | 1134 | m_mapBlockRequests[agentID].Enqueue(req); |
1135 | else | 1135 | else |
1136 | { | 1136 | { |
1137 | spamBlocked[agentID] = now + SPAMBLOCKTIMEms; | 1137 | spamBlocked[agentID] = now + SPAMBLOCKTIMEms; |
1138 | m_log.DebugFormat("[WoldMapModule] RequestMapBlocks blocking spammer {0} for {1} s",agentID, SPAMBLOCKTIMEms/1000.0); | 1138 | m_log.DebugFormat("[WoldMapModule] RequestMapBlocks blocking spammer {0} for {1} s",agentID, SPAMBLOCKTIMEms/1000.0); |
1139 | } | 1139 | } |
@@ -1193,7 +1193,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1193 | maxY * (int)Constants.RegionSize); | 1193 | maxY * (int)Constants.RegionSize); |
1194 | 1194 | ||
1195 | // only send a negative answer for a single region request | 1195 | // only send a negative answer for a single region request |
1196 | // corresponding to a click on the map. Current viewers | 1196 | // corresponding to a click on the map. Current viewers |
1197 | // keep displaying "loading.." without this | 1197 | // keep displaying "loading.." without this |
1198 | if (regions.Count == 0 && (flag & 0x10000) != 0 && minX == maxX && minY == maxY) | 1198 | if (regions.Count == 0 && (flag & 0x10000) != 0 && minX == maxX && minY == maxY) |
1199 | { | 1199 | { |
@@ -1539,7 +1539,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1539 | responsemap["10"] = responsearr; | 1539 | responsemap["10"] = responsearr; |
1540 | else | 1540 | else |
1541 | responsemap["7"] = responsearr; | 1541 | responsemap["7"] = responsearr; |
1542 | } | 1542 | } |
1543 | } | 1543 | } |
1544 | 1544 | ||
1545 | if (m_scene.RegionInfo.RegionSettings.TelehubObject != UUID.Zero) | 1545 | if (m_scene.RegionInfo.RegionSettings.TelehubObject != UUID.Zero) |