diff options
author | Melanie Thielker | 2017-01-05 19:07:37 +0000 |
---|---|---|
committer | Melanie Thielker | 2017-01-05 19:07:37 +0000 |
commit | b16abc8166c29585cb76cc55c3bdd76e5833cb4f (patch) | |
tree | 6a34f465a74b7a3a6dc00a3d7aa8dcc25ac3e3a5 /OpenSim/Region/CoreModules | |
parent | Make it possible to disable the bakes module in the way it is described in co... (diff) | |
download | opensim-SC_OLD-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.zip opensim-SC_OLD-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.tar.gz opensim-SC_OLD-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.tar.bz2 opensim-SC_OLD-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.tar.xz |
Massive tab and trailing space cleanup
Diffstat (limited to 'OpenSim/Region/CoreModules')
170 files changed, 2037 insertions, 2037 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs index 1a19585..f48710f 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs | |||
@@ -127,7 +127,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
127 | if (estateModule.IsTerrainXfer(xferID)) | 127 | if (estateModule.IsTerrainXfer(xferID)) |
128 | return; | 128 | return; |
129 | } | 129 | } |
130 | 130 | ||
131 | m_log.ErrorFormat( | 131 | m_log.ErrorFormat( |
132 | "[AGENT ASSET TRANSACTIONS]: Could not find uploader for xfer id {0}, packet id {1}, data length {2}", | 132 | "[AGENT ASSET TRANSACTIONS]: Could not find uploader for xfer id {0}, packet id {1}, data length {2}", |
133 | xferID, packetID, data.Length); | 133 | xferID, packetID, data.Length); |
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs index f489262..89fdf09 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs | |||
@@ -43,7 +43,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
43 | IAgentAssetTransactions | 43 | IAgentAssetTransactions |
44 | { | 44 | { |
45 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | protected Scene m_Scene; | 47 | protected Scene m_Scene; |
48 | private bool m_dumpAssetsToFile = false; | 48 | private bool m_dumpAssetsToFile = false; |
49 | private int m_levelUpload = 0; | 49 | private int m_levelUpload = 0; |
@@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
53 | /// </summary> | 53 | /// </summary> |
54 | private Dictionary<UUID, AgentAssetTransactions> AgentTransactions = | 54 | private Dictionary<UUID, AgentAssetTransactions> AgentTransactions = |
55 | new Dictionary<UUID, AgentAssetTransactions>(); | 55 | new Dictionary<UUID, AgentAssetTransactions>(); |
56 | 56 | ||
57 | #region Region Module interface | 57 | #region Region Module interface |
58 | 58 | ||
59 | public void Initialise(IConfigSource source) | 59 | public void Initialise(IConfigSource source) |
@@ -241,7 +241,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
241 | // m_log.DebugFormat( | 241 | // m_log.DebugFormat( |
242 | // "[ASSET TRANSACTION MODULE]: HandleUDPUploadRequest - assetID: {0}, transaction {1}, type {2}, storeLocal {3}, tempFile {4}, data.Length {5}", | 242 | // "[ASSET TRANSACTION MODULE]: HandleUDPUploadRequest - assetID: {0}, transaction {1}, type {2}, storeLocal {3}, tempFile {4}, data.Length {5}", |
243 | // assetID, transactionID, type, storeLocal, tempFile, data.Length); | 243 | // assetID, transactionID, type, storeLocal, tempFile, data.Length); |
244 | 244 | ||
245 | if (((AssetType)type == AssetType.Texture || | 245 | if (((AssetType)type == AssetType.Texture || |
246 | (AssetType)type == AssetType.Sound || | 246 | (AssetType)type == AssetType.Sound || |
247 | (AssetType)type == AssetType.TextureTGA || | 247 | (AssetType)type == AssetType.TextureTGA || |
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs index 60a254e..d2aa177 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs | |||
@@ -41,7 +41,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
41 | { | 41 | { |
42 | public class AssetXferUploader | 42 | public class AssetXferUploader |
43 | { | 43 | { |
44 | 44 | ||
45 | private List<UUID> defaultIDs = new List<UUID> { | 45 | private List<UUID> defaultIDs = new List<UUID> { |
46 | // Viewer's notion of the default texture | 46 | // Viewer's notion of the default texture |
47 | new UUID("5748decc-f629-461c-9a36-a35a221fe21f"), // others == default blank | 47 | new UUID("5748decc-f629-461c-9a36-a35a221fe21f"), // others == default blank |
diff --git a/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs b/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs index 4b457b1..ff71593 100644 --- a/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs +++ b/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs | |||
@@ -38,7 +38,7 @@ using OpenSim.Region.Framework.Scenes; | |||
38 | namespace OpenSim.Region.CoreModules.Agent.IPBan | 38 | namespace OpenSim.Region.CoreModules.Agent.IPBan |
39 | { | 39 | { |
40 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "IPBanModule")] | 40 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "IPBanModule")] |
41 | public class IPBanModule : ISharedRegionModule | 41 | public class IPBanModule : ISharedRegionModule |
42 | { | 42 | { |
43 | #region Implementation of ISharedRegionModule | 43 | #region Implementation of ISharedRegionModule |
44 | 44 | ||
@@ -86,7 +86,7 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan | |||
86 | 86 | ||
87 | public void Close() | 87 | public void Close() |
88 | { | 88 | { |
89 | 89 | ||
90 | } | 90 | } |
91 | 91 | ||
92 | public string Name | 92 | public string Name |
@@ -107,9 +107,9 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan | |||
107 | /// matching domain (including "betasomewhere.com", "beta.somewhere.com", | 107 | /// matching domain (including "betasomewhere.com", "beta.somewhere.com", |
108 | /// "somewhere.com.beta") - make sure to be reasonably specific in DNS | 108 | /// "somewhere.com.beta") - make sure to be reasonably specific in DNS |
109 | /// bans. | 109 | /// bans. |
110 | /// | 110 | /// |
111 | /// IP address bans match on first characters, so, | 111 | /// IP address bans match on first characters, so, |
112 | /// "127.0.0.1" will ban only that address, | 112 | /// "127.0.0.1" will ban only that address, |
113 | /// "127.0.1" will ban "127.0.10.0" | 113 | /// "127.0.1" will ban "127.0.10.0" |
114 | /// but "127.0.1." will ban only the "127.0.1.*" network | 114 | /// but "127.0.1." will ban only the "127.0.1.*" network |
115 | /// </summary> | 115 | /// </summary> |
diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs index 6d1f0c2..2242e42 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs | |||
@@ -285,7 +285,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender | |||
285 | // Cache Decoded layers | 285 | // Cache Decoded layers |
286 | SaveFileCacheForAsset(assetID, layers); | 286 | SaveFileCacheForAsset(assetID, layers); |
287 | } | 287 | } |
288 | 288 | ||
289 | // Notify Interested Parties | 289 | // Notify Interested Parties |
290 | lock (m_notifyList) | 290 | lock (m_notifyList) |
291 | { | 291 | { |
diff --git a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs index 1391013..1b6401a 100644 --- a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs +++ b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs | |||
@@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer | |||
53 | private double lastTimeTick = 0.0; | 53 | private double lastTimeTick = 0.0; |
54 | private double lastFilesExpire = 0.0; | 54 | private double lastFilesExpire = 0.0; |
55 | private bool inTimeTick = false; | 55 | private bool inTimeTick = false; |
56 | 56 | ||
57 | public struct XferRequest | 57 | public struct XferRequest |
58 | { | 58 | { |
59 | public IClientAPI remoteClient; | 59 | public IClientAPI remoteClient; |
@@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer | |||
68 | public int refsCount; | 68 | public int refsCount; |
69 | public double timeStampMS; | 69 | public double timeStampMS; |
70 | } | 70 | } |
71 | 71 | ||
72 | #region INonSharedRegionModule Members | 72 | #region INonSharedRegionModule Members |
73 | 73 | ||
74 | public void Initialise(IConfigSource config) | 74 | public void Initialise(IConfigSource config) |
@@ -202,7 +202,7 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer | |||
202 | } | 202 | } |
203 | } | 203 | } |
204 | } | 204 | } |
205 | 205 | ||
206 | public void NewClient(IClientAPI client) | 206 | public void NewClient(IClientAPI client) |
207 | { | 207 | { |
208 | client.OnRequestXfer += RequestXfer; | 208 | client.OnRequestXfer += RequestXfer; |
@@ -275,7 +275,7 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer | |||
275 | int burstSize = remoteClient.GetAgentThrottleSilent((int)ThrottleOutPacketType.Asset) >> 11; | 275 | int burstSize = remoteClient.GetAgentThrottleSilent((int)ThrottleOutPacketType.Asset) >> 11; |
276 | if(Transfers.Count > 1) | 276 | if(Transfers.Count > 1) |
277 | burstSize /= Transfers.Count; | 277 | burstSize /= Transfers.Count; |
278 | XferDownLoad transaction = | 278 | XferDownLoad transaction = |
279 | new XferDownLoad(fileName, fileData, xferID, remoteClient, burstSize); | 279 | new XferDownLoad(fileName, fileData, xferID, remoteClient, burstSize); |
280 | 280 | ||
281 | Transfers.Add(xferID, transaction); | 281 | Transfers.Add(xferID, transaction); |
@@ -288,7 +288,7 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer | |||
288 | } | 288 | } |
289 | } | 289 | } |
290 | else | 290 | else |
291 | m_log.WarnFormat("[Xfer]: {0} not found", fileName); | 291 | m_log.WarnFormat("[Xfer]: {0} not found", fileName); |
292 | } | 292 | } |
293 | } | 293 | } |
294 | 294 | ||
@@ -381,9 +381,9 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer | |||
381 | lastBytes = 1024; | 381 | lastBytes = 1024; |
382 | LastPacket--; | 382 | LastPacket--; |
383 | } | 383 | } |
384 | 384 | ||
385 | } | 385 | } |
386 | 386 | ||
387 | lastAckPacket = -1; | 387 | lastAckPacket = -1; |
388 | lastSentPacket = -1; | 388 | lastSentPacket = -1; |
389 | 389 | ||
diff --git a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs index 14b0280..23c1f03 100644 --- a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs | |||
@@ -41,16 +41,16 @@ namespace OpenSim.Region.CoreModules.Asset | |||
41 | /// </summary> | 41 | /// </summary> |
42 | /// <remarks> | 42 | /// <remarks> |
43 | /// <para> | 43 | /// <para> |
44 | /// Cache is enabled by setting "AssetCaching" configuration to value "CenomeMemoryAssetCache". | 44 | /// Cache is enabled by setting "AssetCaching" configuration to value "CenomeMemoryAssetCache". |
45 | /// When cache is successfully enable log should have message | 45 | /// When cache is successfully enable log should have message |
46 | /// "[ASSET CACHE]: Cenome asset cache enabled (MaxSize = XXX bytes, MaxCount = XXX, ExpirationTime = XXX)". | 46 | /// "[ASSET CACHE]: Cenome asset cache enabled (MaxSize = XXX bytes, MaxCount = XXX, ExpirationTime = XXX)". |
47 | /// </para> | 47 | /// </para> |
48 | /// <para> | 48 | /// <para> |
49 | /// Cache's size is limited by two parameters: | 49 | /// Cache's size is limited by two parameters: |
50 | /// maximal allowed size in bytes and maximal allowed asset count. When new asset | 50 | /// maximal allowed size in bytes and maximal allowed asset count. When new asset |
51 | /// is added to cache that have achieved either size or count limitation, cache | 51 | /// is added to cache that have achieved either size or count limitation, cache |
52 | /// will automatically remove less recently used assets from cache. Additionally | 52 | /// will automatically remove less recently used assets from cache. Additionally |
53 | /// asset's lifetime is controlled by expiration time. | 53 | /// asset's lifetime is controlled by expiration time. |
54 | /// </para> | 54 | /// </para> |
55 | /// <para> | 55 | /// <para> |
56 | /// <list type="table"> | 56 | /// <list type="table"> |
@@ -94,7 +94,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
94 | public class CenomeMemoryAssetCache : IAssetCache, ISharedRegionModule | 94 | public class CenomeMemoryAssetCache : IAssetCache, ISharedRegionModule |
95 | { | 95 | { |
96 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 96 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
97 | 97 | ||
98 | /// <summary> | 98 | /// <summary> |
99 | /// Cache's default maximal asset count. | 99 | /// Cache's default maximal asset count. |
100 | /// </summary> | 100 | /// </summary> |
@@ -119,7 +119,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
119 | /// Asset's default expiration time in the cache. | 119 | /// Asset's default expiration time in the cache. |
120 | /// </summary> | 120 | /// </summary> |
121 | public static readonly TimeSpan DefaultExpirationTime = TimeSpan.FromMinutes(30.0); | 121 | public static readonly TimeSpan DefaultExpirationTime = TimeSpan.FromMinutes(30.0); |
122 | 122 | ||
123 | /// <summary> | 123 | /// <summary> |
124 | /// Cache object. | 124 | /// Cache object. |
125 | /// </summary> | 125 | /// </summary> |
@@ -213,7 +213,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
213 | if (asset != null) | 213 | if (asset != null) |
214 | { | 214 | { |
215 | // m_log.DebugFormat("[CENOME ASSET CACHE]: Caching asset {0}", asset.ID); | 215 | // m_log.DebugFormat("[CENOME ASSET CACHE]: Caching asset {0}", asset.ID); |
216 | 216 | ||
217 | long size = asset.Data != null ? asset.Data.Length : 1; | 217 | long size = asset.Data != null ? asset.Data.Length : 1; |
218 | m_cache.Set(asset.ID, asset, size); | 218 | m_cache.Set(asset.ID, asset, size); |
219 | m_cachedCount++; | 219 | m_cachedCount++; |
@@ -246,7 +246,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
246 | } | 246 | } |
247 | 247 | ||
248 | /// <summary> | 248 | /// <summary> |
249 | /// Get asset stored | 249 | /// Get asset stored |
250 | /// </summary> | 250 | /// </summary> |
251 | /// <param name="id"> | 251 | /// <param name="id"> |
252 | /// The asset's id. | 252 | /// The asset's id. |
@@ -283,7 +283,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
283 | 283 | ||
284 | // if (null == assetBase) | 284 | // if (null == assetBase) |
285 | // m_log.DebugFormat("[CENOME ASSET CACHE]: Asset {0} not in cache", id); | 285 | // m_log.DebugFormat("[CENOME ASSET CACHE]: Asset {0} not in cache", id); |
286 | 286 | ||
287 | return assetBase; | 287 | return assetBase; |
288 | } | 288 | } |
289 | 289 | ||
@@ -299,7 +299,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
299 | get { return "CenomeMemoryAssetCache"; } | 299 | get { return "CenomeMemoryAssetCache"; } |
300 | } | 300 | } |
301 | 301 | ||
302 | public Type ReplaceableInterface | 302 | public Type ReplaceableInterface |
303 | { | 303 | { |
304 | get { return null; } | 304 | get { return null; } |
305 | } | 305 | } |
@@ -349,7 +349,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
349 | 349 | ||
350 | if (name != Name) | 350 | if (name != Name) |
351 | return; | 351 | return; |
352 | 352 | ||
353 | long maxSize = DefaultMaxSize; | 353 | long maxSize = DefaultMaxSize; |
354 | int maxCount = DefaultMaxCount; | 354 | int maxCount = DefaultMaxCount; |
355 | TimeSpan expirationTime = DefaultExpirationTime; | 355 | TimeSpan expirationTime = DefaultExpirationTime; |
diff --git a/OpenSim/Region/CoreModules/Asset/CoreAssetCache.cs b/OpenSim/Region/CoreModules/Asset/CoreAssetCache.cs index 82bc5cc..51fc3d1 100644 --- a/OpenSim/Region/CoreModules/Asset/CoreAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/CoreAssetCache.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
54 | get { return "CoreAssetCache"; } | 54 | get { return "CoreAssetCache"; } |
55 | } | 55 | } |
56 | 56 | ||
57 | public Type ReplaceableInterface | 57 | public Type ReplaceableInterface |
58 | { | 58 | { |
59 | get { return null; } | 59 | get { return null; } |
60 | } | 60 | } |
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 84e13a0..187f090 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | |||
@@ -25,7 +25,7 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | // Uncomment to make asset Get requests for existing | 28 | // Uncomment to make asset Get requests for existing |
29 | // #define WAIT_ON_INPROGRESS_REQUESTS | 29 | // #define WAIT_ON_INPROGRESS_REQUESTS |
30 | 30 | ||
31 | using System; | 31 | using System; |
@@ -113,7 +113,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
113 | private IAssetService m_AssetService; | 113 | private IAssetService m_AssetService; |
114 | private List<Scene> m_Scenes = new List<Scene>(); | 114 | private List<Scene> m_Scenes = new List<Scene>(); |
115 | private object timerLock = new object(); | 115 | private object timerLock = new object(); |
116 | 116 | ||
117 | private Dictionary<string,WeakReference> weakAssetReferences = new Dictionary<string, WeakReference>(); | 117 | private Dictionary<string,WeakReference> weakAssetReferences = new Dictionary<string, WeakReference>(); |
118 | private object weakAssetReferencesLock = new object(); | 118 | private object weakAssetReferencesLock = new object(); |
119 | private bool m_updateFileTimeOnCacheHit = false; | 119 | private bool m_updateFileTimeOnCacheHit = false; |
@@ -124,7 +124,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
124 | m_InvalidChars.AddRange(Path.GetInvalidFileNameChars()); | 124 | m_InvalidChars.AddRange(Path.GetInvalidFileNameChars()); |
125 | } | 125 | } |
126 | 126 | ||
127 | public Type ReplaceableInterface | 127 | public Type ReplaceableInterface |
128 | { | 128 | { |
129 | get { return null; } | 129 | get { return null; } |
130 | } | 130 | } |
@@ -137,7 +137,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
137 | public void Initialise(IConfigSource source) | 137 | public void Initialise(IConfigSource source) |
138 | { | 138 | { |
139 | IConfig moduleConfig = source.Configs["Modules"]; | 139 | IConfig moduleConfig = source.Configs["Modules"]; |
140 | 140 | ||
141 | if (moduleConfig != null) | 141 | if (moduleConfig != null) |
142 | { | 142 | { |
143 | string name = moduleConfig.GetString("AssetCaching", String.Empty); | 143 | string name = moduleConfig.GetString("AssetCaching", String.Empty); |
@@ -169,11 +169,11 @@ namespace OpenSim.Region.CoreModules.Asset | |||
169 | m_negativeExpiration = assetConfig.GetInt("NegativeCacheTimeout", m_negativeExpiration); | 169 | m_negativeExpiration = assetConfig.GetInt("NegativeCacheTimeout", m_negativeExpiration); |
170 | m_negativeCacheSliding = assetConfig.GetBoolean("NegativeCacheSliding", m_negativeCacheSliding); | 170 | m_negativeCacheSliding = assetConfig.GetBoolean("NegativeCacheSliding", m_negativeCacheSliding); |
171 | m_updateFileTimeOnCacheHit = assetConfig.GetBoolean("UpdateFileTimeOnCacheHit", m_updateFileTimeOnCacheHit); | 171 | m_updateFileTimeOnCacheHit = assetConfig.GetBoolean("UpdateFileTimeOnCacheHit", m_updateFileTimeOnCacheHit); |
172 | 172 | ||
173 | #if WAIT_ON_INPROGRESS_REQUESTS | 173 | #if WAIT_ON_INPROGRESS_REQUESTS |
174 | m_WaitOnInprogressTimeout = assetConfig.GetInt("WaitOnInprogressTimeout", 3000); | 174 | m_WaitOnInprogressTimeout = assetConfig.GetInt("WaitOnInprogressTimeout", 3000); |
175 | #endif | 175 | #endif |
176 | 176 | ||
177 | m_LogLevel = assetConfig.GetInt("LogLevel", m_LogLevel); | 177 | m_LogLevel = assetConfig.GetInt("LogLevel", m_LogLevel); |
178 | m_HitRateDisplay = (ulong)assetConfig.GetLong("HitRateDisplay", (long)m_HitRateDisplay); | 178 | m_HitRateDisplay = (ulong)assetConfig.GetLong("HitRateDisplay", (long)m_HitRateDisplay); |
179 | 179 | ||
@@ -266,7 +266,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
266 | { | 266 | { |
267 | m_CacheCleanTimer = new System.Timers.Timer(m_FileExpirationCleanupTimer.TotalMilliseconds); | 267 | m_CacheCleanTimer = new System.Timers.Timer(m_FileExpirationCleanupTimer.TotalMilliseconds); |
268 | m_CacheCleanTimer.AutoReset = false; | 268 | m_CacheCleanTimer.AutoReset = false; |
269 | m_CacheCleanTimer.Elapsed += CleanupExpiredFiles; | 269 | m_CacheCleanTimer.Elapsed += CleanupExpiredFiles; |
270 | m_CacheCleanTimer.Start(); | 270 | m_CacheCleanTimer.Start(); |
271 | m_timerRunning = true; | 271 | m_timerRunning = true; |
272 | } | 272 | } |
@@ -274,7 +274,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
274 | } | 274 | } |
275 | if (m_MemoryCacheEnabled) | 275 | if (m_MemoryCacheEnabled) |
276 | m_MemoryCache = new ExpiringCache<string, AssetBase>(); | 276 | m_MemoryCache = new ExpiringCache<string, AssetBase>(); |
277 | 277 | ||
278 | lock(weakAssetReferencesLock) | 278 | lock(weakAssetReferencesLock) |
279 | weakAssetReferences = new Dictionary<string, WeakReference>(); | 279 | weakAssetReferences = new Dictionary<string, WeakReference>(); |
280 | } | 280 | } |
@@ -306,11 +306,11 @@ namespace OpenSim.Region.CoreModules.Asset | |||
306 | if (File.Exists(filename)) | 306 | if (File.Exists(filename)) |
307 | { | 307 | { |
308 | UpdateFileLastAccessTime(filename); | 308 | UpdateFileLastAccessTime(filename); |
309 | } | 309 | } |
310 | else | 310 | else |
311 | { | 311 | { |
312 | // Once we start writing, make sure we flag that we're writing | 312 | // Once we start writing, make sure we flag that we're writing |
313 | // that object to the cache so that we don't try to write the | 313 | // that object to the cache so that we don't try to write the |
314 | // same file multiple times. | 314 | // same file multiple times. |
315 | lock (m_CurrentlyWriting) | 315 | lock (m_CurrentlyWriting) |
316 | { | 316 | { |
@@ -439,7 +439,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
439 | /// <param name="id"></param> | 439 | /// <param name="id"></param> |
440 | /// <returns>An asset retrieved from the file cache. null if there was a problem retrieving an asset.</returns> | 440 | /// <returns>An asset retrieved from the file cache. null if there was a problem retrieving an asset.</returns> |
441 | private AssetBase GetFromFileCache(string id) | 441 | private AssetBase GetFromFileCache(string id) |
442 | { | 442 | { |
443 | string filename = GetFileName(id); | 443 | string filename = GetFileName(id); |
444 | 444 | ||
445 | #if WAIT_ON_INPROGRESS_REQUESTS | 445 | #if WAIT_ON_INPROGRESS_REQUESTS |
@@ -649,7 +649,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
649 | m_MemoryCache = new ExpiringCache<string, AssetBase>(); | 649 | m_MemoryCache = new ExpiringCache<string, AssetBase>(); |
650 | if (m_negativeCacheEnabled) | 650 | if (m_negativeCacheEnabled) |
651 | m_negativeCache = new ExpiringCache<string, object>(); | 651 | m_negativeCache = new ExpiringCache<string, object>(); |
652 | 652 | ||
653 | lock(weakAssetReferencesLock) | 653 | lock(weakAssetReferencesLock) |
654 | weakAssetReferences = new Dictionary<string, WeakReference>(); | 654 | weakAssetReferences = new Dictionary<string, WeakReference>(); |
655 | } | 655 | } |
@@ -659,7 +659,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
659 | if (m_LogLevel >= 2) | 659 | if (m_LogLevel >= 2) |
660 | m_log.DebugFormat("[FLOTSAM ASSET CACHE]: Checking for expired files older then {0}.", m_FileExpiration); | 660 | m_log.DebugFormat("[FLOTSAM ASSET CACHE]: Checking for expired files older then {0}.", m_FileExpiration); |
661 | 661 | ||
662 | lock(timerLock) | 662 | lock(timerLock) |
663 | { | 663 | { |
664 | if(!m_timerRunning || m_cleanupRunning) | 664 | if(!m_timerRunning || m_cleanupRunning) |
665 | return; | 665 | return; |
@@ -687,8 +687,8 @@ namespace OpenSim.Region.CoreModules.Asset | |||
687 | } | 687 | } |
688 | 688 | ||
689 | /// <summary> | 689 | /// <summary> |
690 | /// Recurses through specified directory checking for asset files last | 690 | /// Recurses through specified directory checking for asset files last |
691 | /// accessed prior to the specified purge line and deletes them. Also | 691 | /// accessed prior to the specified purge line and deletes them. Also |
692 | /// removes empty tier directories. | 692 | /// removes empty tier directories. |
693 | /// </summary> | 693 | /// </summary> |
694 | /// <param name="dir"></param> | 694 | /// <param name="dir"></param> |
@@ -720,7 +720,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
720 | else if (dirSize >= m_CacheWarnAt) | 720 | else if (dirSize >= m_CacheWarnAt) |
721 | { | 721 | { |
722 | m_log.WarnFormat( | 722 | m_log.WarnFormat( |
723 | "[FLOTSAM ASSET CACHE]: Cache folder exceeded CacheWarnAt limit {0} {1}. Suggest increasing tiers, tier length, or reducing cache expiration", | 723 | "[FLOTSAM ASSET CACHE]: Cache folder exceeded CacheWarnAt limit {0} {1}. Suggest increasing tiers, tier length, or reducing cache expiration", |
724 | dir, dirSize); | 724 | dir, dirSize); |
725 | } | 725 | } |
726 | } | 726 | } |
@@ -760,7 +760,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
760 | } | 760 | } |
761 | 761 | ||
762 | /// <summary> | 762 | /// <summary> |
763 | /// Writes a file to the file cache, creating any nessesary | 763 | /// Writes a file to the file cache, creating any nessesary |
764 | /// tier directories along the way | 764 | /// tier directories along the way |
765 | /// </summary> | 765 | /// </summary> |
766 | /// <param name="filename"></param> | 766 | /// <param name="filename"></param> |
@@ -772,7 +772,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
772 | // Make sure the target cache directory exists | 772 | // Make sure the target cache directory exists |
773 | string directory = Path.GetDirectoryName(filename); | 773 | string directory = Path.GetDirectoryName(filename); |
774 | 774 | ||
775 | // Write file first to a temp name, so that it doesn't look | 775 | // Write file first to a temp name, so that it doesn't look |
776 | // like it's already cached while it's still writing. | 776 | // like it's already cached while it's still writing. |
777 | string tempname = Path.Combine(directory, Path.GetRandomFileName()); | 777 | string tempname = Path.Combine(directory, Path.GetRandomFileName()); |
778 | 778 | ||
@@ -784,7 +784,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
784 | { | 784 | { |
785 | Directory.CreateDirectory(directory); | 785 | Directory.CreateDirectory(directory); |
786 | } | 786 | } |
787 | 787 | ||
788 | stream = File.Open(tempname, FileMode.Create); | 788 | stream = File.Open(tempname, FileMode.Create); |
789 | BinaryFormatter bformatter = new BinaryFormatter(); | 789 | BinaryFormatter bformatter = new BinaryFormatter(); |
790 | bformatter.Serialize(stream, asset); | 790 | bformatter.Serialize(stream, asset); |
@@ -818,7 +818,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
818 | // This situation occurs fairly rarely anyway. We assume in this that moves are atomic on the | 818 | // This situation occurs fairly rarely anyway. We assume in this that moves are atomic on the |
819 | // filesystem. | 819 | // filesystem. |
820 | File.Move(tempname, filename); | 820 | File.Move(tempname, filename); |
821 | 821 | ||
822 | if (m_LogLevel >= 2) | 822 | if (m_LogLevel >= 2) |
823 | m_log.DebugFormat("[FLOTSAM ASSET CACHE]: Cache Stored :: {0}", asset.ID); | 823 | m_log.DebugFormat("[FLOTSAM ASSET CACHE]: Cache Stored :: {0}", asset.ID); |
824 | } | 824 | } |
@@ -875,7 +875,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
875 | { | 875 | { |
876 | string RegionCacheStatusFile = Path.Combine(m_CacheDirectory, "RegionStatus_" + regionID.ToString() + ".fac"); | 876 | string RegionCacheStatusFile = Path.Combine(m_CacheDirectory, "RegionStatus_" + regionID.ToString() + ".fac"); |
877 | 877 | ||
878 | try | 878 | try |
879 | { | 879 | { |
880 | if (File.Exists(RegionCacheStatusFile)) | 880 | if (File.Exists(RegionCacheStatusFile)) |
881 | { | 881 | { |
@@ -884,7 +884,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
884 | else | 884 | else |
885 | { | 885 | { |
886 | File.WriteAllText( | 886 | File.WriteAllText( |
887 | RegionCacheStatusFile, | 887 | RegionCacheStatusFile, |
888 | "Please do not delete this file unless you are manually clearing your Flotsam Asset Cache."); | 888 | "Please do not delete this file unless you are manually clearing your Flotsam Asset Cache."); |
889 | } | 889 | } |
890 | } | 890 | } |
@@ -892,14 +892,14 @@ namespace OpenSim.Region.CoreModules.Asset | |||
892 | { | 892 | { |
893 | m_log.Warn( | 893 | m_log.Warn( |
894 | string.Format( | 894 | string.Format( |
895 | "[FLOTSAM ASSET CACHE]: Could not stamp region status file for region {0}. Exception ", | 895 | "[FLOTSAM ASSET CACHE]: Could not stamp region status file for region {0}. Exception ", |
896 | regionID), | 896 | regionID), |
897 | e); | 897 | e); |
898 | } | 898 | } |
899 | } | 899 | } |
900 | 900 | ||
901 | /// <summary> | 901 | /// <summary> |
902 | /// Iterates through all Scenes, doing a deep scan through assets | 902 | /// Iterates through all Scenes, doing a deep scan through assets |
903 | /// to update the access time of all assets present in the scene or referenced by assets | 903 | /// to update the access time of all assets present in the scene or referenced by assets |
904 | /// in the scene. | 904 | /// in the scene. |
905 | /// </summary> | 905 | /// </summary> |
@@ -918,7 +918,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
918 | StampRegionStatusFile(s.RegionInfo.RegionID); | 918 | StampRegionStatusFile(s.RegionInfo.RegionID); |
919 | 919 | ||
920 | s.ForEachSOG(delegate(SceneObjectGroup e) | 920 | s.ForEachSOG(delegate(SceneObjectGroup e) |
921 | { | 921 | { |
922 | if(!m_timerRunning && !storeUncached) | 922 | if(!m_timerRunning && !storeUncached) |
923 | return; | 923 | return; |
924 | 924 | ||
@@ -1012,7 +1012,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
1012 | 1012 | ||
1013 | double weakHitRate = m_weakRefHits * invReq; | 1013 | double weakHitRate = m_weakRefHits * invReq; |
1014 | int weakEntries = weakAssetReferences.Count; | 1014 | int weakEntries = weakAssetReferences.Count; |
1015 | 1015 | ||
1016 | double fileHitRate = m_DiskHits * invReq; | 1016 | double fileHitRate = m_DiskHits * invReq; |
1017 | double TotalHitRate = weakHitRate + fileHitRate; | 1017 | double TotalHitRate = weakHitRate + fileHitRate; |
1018 | 1018 | ||
@@ -1073,9 +1073,9 @@ namespace OpenSim.Region.CoreModules.Asset | |||
1073 | if (m_FileCacheEnabled) | 1073 | if (m_FileCacheEnabled) |
1074 | { | 1074 | { |
1075 | con.Output("Deep scans have previously been performed on the following regions:"); | 1075 | con.Output("Deep scans have previously been performed on the following regions:"); |
1076 | 1076 | ||
1077 | foreach (string s in Directory.GetFiles(m_CacheDirectory, "*.fac")) | 1077 | foreach (string s in Directory.GetFiles(m_CacheDirectory, "*.fac")) |
1078 | { | 1078 | { |
1079 | string RegionID = s.Remove(0,s.IndexOf("_")).Replace(".fac",""); | 1079 | string RegionID = s.Remove(0,s.IndexOf("_")).Replace(".fac",""); |
1080 | DateTime RegionDeepScanTMStamp = File.GetLastWriteTime(s); | 1080 | DateTime RegionDeepScanTMStamp = File.GetLastWriteTime(s); |
1081 | con.OutputFormat("Region: {0}, {1}", RegionID, RegionDeepScanTMStamp.ToString("MM/dd/yyyy hh:mm:ss")); | 1081 | con.OutputFormat("Region: {0}, {1}", RegionID, RegionDeepScanTMStamp.ToString("MM/dd/yyyy hh:mm:ss")); |
@@ -1118,7 +1118,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
1118 | con.Output("Memory cache not enabled."); | 1118 | con.Output("Memory cache not enabled."); |
1119 | } | 1119 | } |
1120 | } | 1120 | } |
1121 | 1121 | ||
1122 | if (clearFile) | 1122 | if (clearFile) |
1123 | { | 1123 | { |
1124 | if (m_FileCacheEnabled) | 1124 | if (m_FileCacheEnabled) |
@@ -1147,7 +1147,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
1147 | 1147 | ||
1148 | con.Output("FloatSam Ensuring assets are cached for all scenes."); | 1148 | con.Output("FloatSam Ensuring assets are cached for all scenes."); |
1149 | 1149 | ||
1150 | WorkManager.RunInThread(delegate | 1150 | WorkManager.RunInThread(delegate |
1151 | { | 1151 | { |
1152 | bool wasRunning= false; | 1152 | bool wasRunning= false; |
1153 | lock(timerLock) | 1153 | lock(timerLock) |
@@ -1167,7 +1167,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
1167 | if(wasRunning) | 1167 | if(wasRunning) |
1168 | { | 1168 | { |
1169 | m_CacheCleanTimer.Start(); | 1169 | m_CacheCleanTimer.Start(); |
1170 | m_timerRunning = true; | 1170 | m_timerRunning = true; |
1171 | } | 1171 | } |
1172 | m_cleanupRunning = false; | 1172 | m_cleanupRunning = false; |
1173 | } | 1173 | } |
@@ -1247,12 +1247,12 @@ namespace OpenSim.Region.CoreModules.Asset | |||
1247 | public bool[] AssetsExist(string[] ids) | 1247 | public bool[] AssetsExist(string[] ids) |
1248 | { | 1248 | { |
1249 | bool[] exist = new bool[ids.Length]; | 1249 | bool[] exist = new bool[ids.Length]; |
1250 | 1250 | ||
1251 | for (int i = 0; i < ids.Length; i++) | 1251 | for (int i = 0; i < ids.Length; i++) |
1252 | { | 1252 | { |
1253 | exist[i] = Check(ids[i]); | 1253 | exist[i] = Check(ids[i]); |
1254 | } | 1254 | } |
1255 | 1255 | ||
1256 | return exist; | 1256 | return exist; |
1257 | } | 1257 | } |
1258 | 1258 | ||
diff --git a/OpenSim/Region/CoreModules/Asset/GlynnTuckerAssetCache.cs b/OpenSim/Region/CoreModules/Asset/GlynnTuckerAssetCache.cs index 195bdaa..208963d 100644 --- a/OpenSim/Region/CoreModules/Asset/GlynnTuckerAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/GlynnTuckerAssetCache.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
55 | // Instrumentation | 55 | // Instrumentation |
56 | private uint m_DebugRate; | 56 | private uint m_DebugRate; |
57 | 57 | ||
58 | public Type ReplaceableInterface | 58 | public Type ReplaceableInterface |
59 | { | 59 | { |
60 | get { return null; } | 60 | get { return null; } |
61 | } | 61 | } |
diff --git a/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs b/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs index 73e4431..dbb7941 100644 --- a/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs +++ b/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs | |||
@@ -112,7 +112,7 @@ namespace OpenSim.Region.CoreModules.Asset.Tests | |||
112 | { | 112 | { |
113 | TestHelpers.InMethod(); | 113 | TestHelpers.InMethod(); |
114 | // log4net.Config.XmlConfigurator.Configure(); | 114 | // log4net.Config.XmlConfigurator.Configure(); |
115 | 115 | ||
116 | AssetBase asset = AssetHelpers.CreateNotecardAsset(); | 116 | AssetBase asset = AssetHelpers.CreateNotecardAsset(); |
117 | asset.ID = TestHelpers.ParseTail(0x2).ToString(); | 117 | asset.ID = TestHelpers.ParseTail(0x2).ToString(); |
118 | 118 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index d5c81ce..f4a8a6b 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -61,7 +61,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
61 | /// A value of 0 will apply no pause. The pause is specified in milliseconds. | 61 | /// A value of 0 will apply no pause. The pause is specified in milliseconds. |
62 | /// </remarks> | 62 | /// </remarks> |
63 | public int ThrottlePer100PrimsRezzed { get; set; } | 63 | public int ThrottlePer100PrimsRezzed { get; set; } |
64 | 64 | ||
65 | private Scene m_scene; | 65 | private Scene m_scene; |
66 | private IInventoryAccessModule m_invAccessModule; | 66 | private IInventoryAccessModule m_invAccessModule; |
67 | 67 | ||
@@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
69 | /// Are attachments enabled? | 69 | /// Are attachments enabled? |
70 | /// </summary> | 70 | /// </summary> |
71 | public bool Enabled { get; private set; } | 71 | public bool Enabled { get; private set; } |
72 | 72 | ||
73 | public string Name { get { return "Attachments Module"; } } | 73 | public string Name { get { return "Attachments Module"; } } |
74 | public Type ReplaceableInterface { get { return null; } } | 74 | public Type ReplaceableInterface { get { return null; } } |
75 | 75 | ||
@@ -87,14 +87,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
87 | Enabled = true; | 87 | Enabled = true; |
88 | } | 88 | } |
89 | } | 89 | } |
90 | 90 | ||
91 | public void AddRegion(Scene scene) | 91 | public void AddRegion(Scene scene) |
92 | { | 92 | { |
93 | m_scene = scene; | 93 | m_scene = scene; |
94 | if (Enabled) | 94 | if (Enabled) |
95 | { | 95 | { |
96 | // Only register module with scene if it is enabled. All callers check for a null attachments module. | 96 | // Only register module with scene if it is enabled. All callers check for a null attachments module. |
97 | // Ideally, there should be a null attachments module for when this core attachments module has been | 97 | // Ideally, there should be a null attachments module for when this core attachments module has been |
98 | // disabled. Registering only when enabled allows for other attachments module implementations. | 98 | // disabled. Registering only when enabled allows for other attachments module implementations. |
99 | m_scene.RegisterModuleInterface<IAttachmentsModule>(this); | 99 | m_scene.RegisterModuleInterface<IAttachmentsModule>(this); |
100 | m_scene.EventManager.OnNewClient += SubscribeToClientEvents; | 100 | m_scene.EventManager.OnNewClient += SubscribeToClientEvents; |
@@ -181,7 +181,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
181 | private void HandleScriptStateChange(uint localID, bool started) | 181 | private void HandleScriptStateChange(uint localID, bool started) |
182 | { | 182 | { |
183 | SceneObjectGroup sog = m_scene.GetGroupByPrim(localID); | 183 | SceneObjectGroup sog = m_scene.GetGroupByPrim(localID); |
184 | if (sog != null && sog.IsAttachment) | 184 | if (sog != null && sog.IsAttachment) |
185 | { | 185 | { |
186 | if (!started) | 186 | if (!started) |
187 | { | 187 | { |
@@ -198,21 +198,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
198 | } | 198 | } |
199 | } | 199 | } |
200 | } | 200 | } |
201 | 201 | ||
202 | public void RemoveRegion(Scene scene) | 202 | public void RemoveRegion(Scene scene) |
203 | { | 203 | { |
204 | m_scene.UnregisterModuleInterface<IAttachmentsModule>(this); | 204 | m_scene.UnregisterModuleInterface<IAttachmentsModule>(this); |
205 | 205 | ||
206 | if (Enabled) | 206 | if (Enabled) |
207 | m_scene.EventManager.OnNewClient -= SubscribeToClientEvents; | 207 | m_scene.EventManager.OnNewClient -= SubscribeToClientEvents; |
208 | } | 208 | } |
209 | 209 | ||
210 | public void RegionLoaded(Scene scene) | 210 | public void RegionLoaded(Scene scene) |
211 | { | 211 | { |
212 | m_invAccessModule = m_scene.RequestModuleInterface<IInventoryAccessModule>(); | 212 | m_invAccessModule = m_scene.RequestModuleInterface<IInventoryAccessModule>(); |
213 | } | 213 | } |
214 | 214 | ||
215 | public void Close() | 215 | public void Close() |
216 | { | 216 | { |
217 | RemoveRegion(m_scene); | 217 | RemoveRegion(m_scene); |
218 | } | 218 | } |
@@ -270,7 +270,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
270 | ((SceneObjectGroup)so).RootPart.ClearUpdateSchedule(); | 270 | ((SceneObjectGroup)so).RootPart.ClearUpdateSchedule(); |
271 | 271 | ||
272 | // m_log.DebugFormat( | 272 | // m_log.DebugFormat( |
273 | // "[ATTACHMENTS MODULE]: Copying script state with {0} bytes for object {1} for {2} in {3}", | 273 | // "[ATTACHMENTS MODULE]: Copying script state with {0} bytes for object {1} for {2} in {3}", |
274 | // ad.AttachmentObjectStates[i].Length, so.Name, sp.Name, m_scene.Name); | 274 | // ad.AttachmentObjectStates[i].Length, so.Name, sp.Name, m_scene.Name); |
275 | 275 | ||
276 | so.SetState(ad.AttachmentObjectStates[i++], m_scene); | 276 | so.SetState(ad.AttachmentObjectStates[i++], m_scene); |
@@ -295,7 +295,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
295 | { | 295 | { |
296 | if (DebugLevel > 0) | 296 | if (DebugLevel > 0) |
297 | m_log.DebugFormat( | 297 | m_log.DebugFormat( |
298 | "[ATTACHMENTS MODULE]: Not doing simulator-side attachment rez for {0} in {1} as their viewer has already rezzed attachments", | 298 | "[ATTACHMENTS MODULE]: Not doing simulator-side attachment rez for {0} in {1} as their viewer has already rezzed attachments", |
299 | m_scene.Name, sp.Name); | 299 | m_scene.Name, sp.Name); |
300 | 300 | ||
301 | return; | 301 | return; |
@@ -357,7 +357,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
357 | 357 | ||
358 | // For some reason assetIDs are being written as Zero's in the DB -- need to track tat down | 358 | // For some reason assetIDs are being written as Zero's in the DB -- need to track tat down |
359 | // But they're not used anyway, the item is being looked up for now, so let's proceed. | 359 | // But they're not used anyway, the item is being looked up for now, so let's proceed. |
360 | //if (UUID.Zero == assetID) | 360 | //if (UUID.Zero == assetID) |
361 | //{ | 361 | //{ |
362 | // m_log.DebugFormat("[ATTACHMENT]: Cannot rez attachment in point {0} with itemID {1}", p, itemID); | 362 | // m_log.DebugFormat("[ATTACHMENT]: Cannot rez attachment in point {0} with itemID {1}", p, itemID); |
363 | // continue; | 363 | // continue; |
@@ -434,7 +434,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
434 | UpdateDetachedObject(sp, so, String.Empty); | 434 | UpdateDetachedObject(sp, so, String.Empty); |
435 | sp.ClearAttachments(); | 435 | sp.ClearAttachments(); |
436 | } | 436 | } |
437 | } | 437 | } |
438 | } | 438 | } |
439 | 439 | ||
440 | public void DeleteAttachmentsFromScene(IScenePresence sp, bool silent) | 440 | public void DeleteAttachmentsFromScene(IScenePresence sp, bool silent) |
@@ -445,7 +445,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
445 | if (DebugLevel > 0) | 445 | if (DebugLevel > 0) |
446 | m_log.DebugFormat( | 446 | m_log.DebugFormat( |
447 | "[ATTACHMENTS MODULE]: Deleting attachments from scene {0} for {1}, silent = {2}", | 447 | "[ATTACHMENTS MODULE]: Deleting attachments from scene {0} for {1}, silent = {2}", |
448 | m_scene.RegionInfo.RegionName, sp.Name, silent); | 448 | m_scene.RegionInfo.RegionName, sp.Name, silent); |
449 | 449 | ||
450 | foreach (SceneObjectGroup sop in sp.GetAttachments()) | 450 | foreach (SceneObjectGroup sop in sp.GetAttachments()) |
451 | { | 451 | { |
@@ -454,7 +454,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
454 | 454 | ||
455 | sp.ClearAttachments(); | 455 | sp.ClearAttachments(); |
456 | } | 456 | } |
457 | 457 | ||
458 | public bool AttachObject(IScenePresence sp, SceneObjectGroup group, uint attachmentPt, bool silent, | 458 | public bool AttachObject(IScenePresence sp, SceneObjectGroup group, uint attachmentPt, bool silent, |
459 | bool addToInventory, bool append) | 459 | bool addToInventory, bool append) |
460 | { | 460 | { |
@@ -505,7 +505,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
505 | // TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should | 505 | // TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should |
506 | // be removed when that functionality is implemented in opensim | 506 | // be removed when that functionality is implemented in opensim |
507 | attachmentPt &= 0x7f; | 507 | attachmentPt &= 0x7f; |
508 | 508 | ||
509 | // If the attachment point isn't the same as the one previously used | 509 | // If the attachment point isn't the same as the one previously used |
510 | // set it's offset position = 0 so that it appears on the attachment point | 510 | // set it's offset position = 0 so that it appears on the attachment point |
511 | // and not in a weird location somewhere unknown. | 511 | // and not in a weird location somewhere unknown. |
@@ -583,7 +583,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
583 | 583 | ||
584 | if (addToInventory && sp.PresenceType != PresenceType.Npc) | 584 | if (addToInventory && sp.PresenceType != PresenceType.Npc) |
585 | UpdateUserInventoryWithAttachment(sp, group, attachmentPt, append); | 585 | UpdateUserInventoryWithAttachment(sp, group, attachmentPt, append); |
586 | 586 | ||
587 | AttachToAgent(sp, group, attachmentPt, attachPos, silent); | 587 | AttachToAgent(sp, group, attachmentPt, attachPos, silent); |
588 | 588 | ||
589 | if (resumeScripts) | 589 | if (resumeScripts) |
@@ -616,11 +616,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
616 | } | 616 | } |
617 | 617 | ||
618 | public ISceneEntity RezSingleAttachmentFromInventory(IScenePresence sp, UUID itemID, uint AttachmentPt) | 618 | public ISceneEntity RezSingleAttachmentFromInventory(IScenePresence sp, UUID itemID, uint AttachmentPt) |
619 | { | 619 | { |
620 | return RezSingleAttachmentFromInventory(sp, itemID, AttachmentPt, null); | 620 | return RezSingleAttachmentFromInventory(sp, itemID, AttachmentPt, null); |
621 | } | 621 | } |
622 | 622 | ||
623 | public ISceneEntity RezSingleAttachmentFromInventory(IScenePresence sp, UUID itemID, uint AttachmentPt, XmlDocument doc) | 623 | public ISceneEntity RezSingleAttachmentFromInventory(IScenePresence sp, UUID itemID, uint AttachmentPt, XmlDocument doc) |
624 | { | 624 | { |
625 | if (!Enabled) | 625 | if (!Enabled) |
626 | return null; | 626 | return null; |
@@ -631,8 +631,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
631 | (AttachmentPoint)AttachmentPt, itemID, sp.Name, m_scene.Name); | 631 | (AttachmentPoint)AttachmentPt, itemID, sp.Name, m_scene.Name); |
632 | 632 | ||
633 | // We check the attachments in the avatar appearance here rather than the objects attached to the | 633 | // We check the attachments in the avatar appearance here rather than the objects attached to the |
634 | // ScenePresence itself so that we can ignore calls by viewer 2/3 to attach objects on startup. We are | 634 | // ScenePresence itself so that we can ignore calls by viewer 2/3 to attach objects on startup. We are |
635 | // already doing this in ScenePresence.MakeRootAgent(). Simulator-side attaching needs to be done | 635 | // already doing this in ScenePresence.MakeRootAgent(). Simulator-side attaching needs to be done |
636 | // because pre-outfit folder viewers (most version 1 viewers) require it. | 636 | // because pre-outfit folder viewers (most version 1 viewers) require it. |
637 | bool alreadyOn = false; | 637 | bool alreadyOn = false; |
638 | List<AvatarAttachment> existingAttachments = sp.Appearance.GetAttachments(); | 638 | List<AvatarAttachment> existingAttachments = sp.Appearance.GetAttachments(); |
@@ -668,7 +668,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
668 | 668 | ||
669 | if (DebugLevel > 0) | 669 | if (DebugLevel > 0) |
670 | m_log.DebugFormat( | 670 | m_log.DebugFormat( |
671 | "[ATTACHMENTS MODULE]: Rezzing {0} attachments from inventory for {1} in {2}", | 671 | "[ATTACHMENTS MODULE]: Rezzing {0} attachments from inventory for {1} in {2}", |
672 | rezlist.Count, sp.Name, m_scene.Name); | 672 | rezlist.Count, sp.Name, m_scene.Name); |
673 | 673 | ||
674 | foreach (KeyValuePair<UUID, uint> rez in rezlist) | 674 | foreach (KeyValuePair<UUID, uint> rez in rezlist) |
@@ -727,7 +727,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
727 | m_scene.AvatarFactory.QueueAppearanceSave(sp.UUID); | 727 | m_scene.AvatarFactory.QueueAppearanceSave(sp.UUID); |
728 | 728 | ||
729 | so.RootPart.Shape.LastAttachPoint = (byte)so.AttachmentPoint; | 729 | so.RootPart.Shape.LastAttachPoint = (byte)so.AttachmentPoint; |
730 | 730 | ||
731 | sp.RemoveAttachment(so); | 731 | sp.RemoveAttachment(so); |
732 | so.FromItemID = UUID.Zero; | 732 | so.FromItemID = UUID.Zero; |
733 | 733 | ||
@@ -744,7 +744,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
744 | } | 744 | } |
745 | 745 | ||
746 | rootPart.RemFlag(PrimFlags.TemporaryOnRez); | 746 | rootPart.RemFlag(PrimFlags.TemporaryOnRez); |
747 | 747 | ||
748 | so.ApplyPhysics(); | 748 | so.ApplyPhysics(); |
749 | 749 | ||
750 | rootPart.Rezzed = DateTime.Now; | 750 | rootPart.Rezzed = DateTime.Now; |
@@ -804,7 +804,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
804 | 804 | ||
805 | if (DebugLevel > 0) | 805 | if (DebugLevel > 0) |
806 | m_log.DebugFormat( | 806 | m_log.DebugFormat( |
807 | "[ATTACHMENTS MODULE]: Detaching object {0} {1} (FromItemID {2}) for {3} in {4}", | 807 | "[ATTACHMENTS MODULE]: Detaching object {0} {1} (FromItemID {2}) for {3} in {4}", |
808 | so.Name, so.LocalId, so.FromItemID, sp.Name, m_scene.Name); | 808 | so.Name, so.LocalId, so.FromItemID, sp.Name, m_scene.Name); |
809 | 809 | ||
810 | // Scripts MUST be snapshotted before the object is | 810 | // Scripts MUST be snapshotted before the object is |
@@ -827,14 +827,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
827 | UpdateDetachedObject(sp, so, scriptedState); | 827 | UpdateDetachedObject(sp, so, scriptedState); |
828 | } | 828 | } |
829 | } | 829 | } |
830 | 830 | ||
831 | public void UpdateAttachmentPosition(SceneObjectGroup sog, Vector3 pos) | 831 | public void UpdateAttachmentPosition(SceneObjectGroup sog, Vector3 pos) |
832 | { | 832 | { |
833 | if (!Enabled) | 833 | if (!Enabled) |
834 | return; | 834 | return; |
835 | 835 | ||
836 | sog.UpdateGroupPosition(pos); | 836 | sog.UpdateGroupPosition(pos); |
837 | sog.HasGroupChanged = true; | 837 | sog.HasGroupChanged = true; |
838 | } | 838 | } |
839 | 839 | ||
840 | #endregion | 840 | #endregion |
@@ -843,7 +843,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
843 | 843 | ||
844 | // This is public but is not part of the IAttachmentsModule interface. | 844 | // This is public but is not part of the IAttachmentsModule interface. |
845 | // RegionCombiner module needs to poke at it to deliver client events. | 845 | // RegionCombiner module needs to poke at it to deliver client events. |
846 | // This breaks the encapsulation of the module and should get fixed somehow. | 846 | // This breaks the encapsulation of the module and should get fixed somehow. |
847 | public void SubscribeToClientEvents(IClientAPI client) | 847 | public void SubscribeToClientEvents(IClientAPI client) |
848 | { | 848 | { |
849 | client.OnRezSingleAttachmentFromInv += Client_OnRezSingleAttachmentFromInv; | 849 | client.OnRezSingleAttachmentFromInv += Client_OnRezSingleAttachmentFromInv; |
@@ -856,7 +856,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
856 | 856 | ||
857 | // This is public but is not part of the IAttachmentsModule interface. | 857 | // This is public but is not part of the IAttachmentsModule interface. |
858 | // RegionCombiner module needs to poke at it to deliver client events. | 858 | // RegionCombiner module needs to poke at it to deliver client events. |
859 | // This breaks the encapsulation of the module and should get fixed somehow. | 859 | // This breaks the encapsulation of the module and should get fixed somehow. |
860 | public void UnsubscribeFromClientEvents(IClientAPI client) | 860 | public void UnsubscribeFromClientEvents(IClientAPI client) |
861 | { | 861 | { |
862 | client.OnRezSingleAttachmentFromInv -= Client_OnRezSingleAttachmentFromInv; | 862 | client.OnRezSingleAttachmentFromInv -= Client_OnRezSingleAttachmentFromInv; |
@@ -936,7 +936,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
936 | /// Attach this scene object to the given avatar. | 936 | /// Attach this scene object to the given avatar. |
937 | /// </summary> | 937 | /// </summary> |
938 | /// <remarks> | 938 | /// <remarks> |
939 | /// This isn't publicly available since attachments should always perform the corresponding inventory | 939 | /// This isn't publicly available since attachments should always perform the corresponding inventory |
940 | /// operation (to show the attach in user inventory and update the asset with positional information). | 940 | /// operation (to show the attach in user inventory and update the asset with positional information). |
941 | /// </remarks> | 941 | /// </remarks> |
942 | /// <param name="sp"></param> | 942 | /// <param name="sp"></param> |
@@ -997,7 +997,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
997 | 997 | ||
998 | // Fudge below is an extremely unhelpful comment. It's probably here so that the scheduled full update | 998 | // Fudge below is an extremely unhelpful comment. It's probably here so that the scheduled full update |
999 | // will succeed, as that will not update if an attachment is selected. | 999 | // will succeed, as that will not update if an attachment is selected. |
1000 | so.IsSelected = false; // fudge.... | 1000 | so.IsSelected = false; // fudge.... |
1001 | 1001 | ||
1002 | so.ScheduleGroupForFullUpdate(); | 1002 | so.ScheduleGroupForFullUpdate(); |
1003 | } | 1003 | } |
@@ -1041,7 +1041,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
1041 | /// </summary> | 1041 | /// </summary> |
1042 | /// <remarks> | 1042 | /// <remarks> |
1043 | /// This involves triggering the detach event and getting the script state (which also stops the script) | 1043 | /// This involves triggering the detach event and getting the script state (which also stops the script) |
1044 | /// This MUST be done outside sp.AttachmentsSyncLock, since otherwise there is a chance of deadlock if a | 1044 | /// This MUST be done outside sp.AttachmentsSyncLock, since otherwise there is a chance of deadlock if a |
1045 | /// running script is performing attachment operations. | 1045 | /// running script is performing attachment operations. |
1046 | /// </remarks> | 1046 | /// </remarks> |
1047 | /// <returns> | 1047 | /// <returns> |
@@ -1088,7 +1088,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
1088 | // Remove the object from the scene so no more updates | 1088 | // Remove the object from the scene so no more updates |
1089 | // are sent. Doing this before the below changes will ensure | 1089 | // are sent. Doing this before the below changes will ensure |
1090 | // updates can't cause "HUD artefacts" | 1090 | // updates can't cause "HUD artefacts" |
1091 | 1091 | ||
1092 | m_scene.DeleteSceneObject(so, false, false); | 1092 | m_scene.DeleteSceneObject(so, false, false); |
1093 | 1093 | ||
1094 | // Prepare sog for storage | 1094 | // Prepare sog for storage |
@@ -1125,7 +1125,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
1125 | itemID, rezGroupID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true, | 1125 | itemID, rezGroupID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true, |
1126 | false, false, sp.UUID, true); | 1126 | false, false, sp.UUID, true); |
1127 | else | 1127 | else |
1128 | objatt = m_invAccessModule.RezObject(sp.ControllingClient, | 1128 | objatt = m_invAccessModule.RezObject(sp.ControllingClient, |
1129 | null, rezGroupID, assetID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true, | 1129 | null, rezGroupID, assetID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true, |
1130 | false, false, sp.UUID, true); | 1130 | false, false, sp.UUID, true); |
1131 | 1131 | ||
@@ -1139,7 +1139,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
1139 | } | 1139 | } |
1140 | else if (itemID == UUID.Zero) | 1140 | else if (itemID == UUID.Zero) |
1141 | { | 1141 | { |
1142 | // We need to have a FromItemID for multiple attachments on a single attach point to appear. This is | 1142 | // We need to have a FromItemID for multiple attachments on a single attach point to appear. This is |
1143 | // true on Singularity 1.8.5 and quite possibly other viewers as well. As NPCs don't have an inventory | 1143 | // true on Singularity 1.8.5 and quite possibly other viewers as well. As NPCs don't have an inventory |
1144 | // we will satisfy this requirement by inserting a random UUID. | 1144 | // we will satisfy this requirement by inserting a random UUID. |
1145 | objatt.FromItemID = UUID.Random(); | 1145 | objatt.FromItemID = UUID.Random(); |
@@ -1185,7 +1185,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
1185 | } | 1185 | } |
1186 | 1186 | ||
1187 | if (tainted) | 1187 | if (tainted) |
1188 | objatt.HasGroupChanged = true; | 1188 | objatt.HasGroupChanged = true; |
1189 | 1189 | ||
1190 | if (ThrottlePer100PrimsRezzed > 0) | 1190 | if (ThrottlePer100PrimsRezzed > 0) |
1191 | { | 1191 | { |
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs index 16f1952..941853c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs | |||
@@ -485,7 +485,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
485 | 485 | ||
486 | // Test wearing a second attachment at the same position | 486 | // Test wearing a second attachment at the same position |
487 | // Until multiple attachments at one point is implemented, this will remove the first attachment | 487 | // Until multiple attachments at one point is implemented, this will remove the first attachment |
488 | // This test relies on both attachments having the same default attachment point (in this case LeftHand | 488 | // This test relies on both attachments having the same default attachment point (in this case LeftHand |
489 | // since none other has been set). | 489 | // since none other has been set). |
490 | { | 490 | { |
491 | scene.AttachmentsModule.RezSingleAttachmentFromInventory(sp, attItem2.ID, (uint)AttachmentPoint.Default); | 491 | scene.AttachmentsModule.RezSingleAttachmentFromInventory(sp, attItem2.ID, (uint)AttachmentPoint.Default); |
@@ -975,8 +975,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
975 | // Both these operations will occur on different threads and will wait for each other. | 975 | // Both these operations will occur on different threads and will wait for each other. |
976 | // We have to do this via ThreadPool directly since FireAndForget has been switched to sync for the V1 | 976 | // We have to do this via ThreadPool directly since FireAndForget has been switched to sync for the V1 |
977 | // test protocol, where we are trying to avoid unpredictable async operations in regression tests. | 977 | // test protocol, where we are trying to avoid unpredictable async operations in regression tests. |
978 | tc.OnTestClientSendRegionTeleport | 978 | tc.OnTestClientSendRegionTeleport |
979 | += (regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL) | 979 | += (regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL) |
980 | => ThreadPool.UnsafeQueueUserWorkItem(o => destinationTestClients[0].CompleteMovement(), null); | 980 | => ThreadPool.UnsafeQueueUserWorkItem(o => destinationTestClients[0].CompleteMovement(), null); |
981 | 981 | ||
982 | m_numberOfAttachEventsFired = 0; | 982 | m_numberOfAttachEventsFired = 0; |
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 67256ee..0826a08 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -75,7 +75,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
75 | m_savetime = Convert.ToInt32(appearanceConfig.GetString("DelayBeforeAppearanceSave",Convert.ToString(m_savetime))); | 75 | m_savetime = Convert.ToInt32(appearanceConfig.GetString("DelayBeforeAppearanceSave",Convert.ToString(m_savetime))); |
76 | m_sendtime = Convert.ToInt32(appearanceConfig.GetString("DelayBeforeAppearanceSend",Convert.ToString(m_sendtime))); | 76 | m_sendtime = Convert.ToInt32(appearanceConfig.GetString("DelayBeforeAppearanceSend",Convert.ToString(m_sendtime))); |
77 | m_reusetextures = appearanceConfig.GetBoolean("ReuseTextures",m_reusetextures); | 77 | m_reusetextures = appearanceConfig.GetBoolean("ReuseTextures",m_reusetextures); |
78 | 78 | ||
79 | // m_log.InfoFormat("[AVFACTORY] configured for {0} save and {1} send",m_savetime,m_sendtime); | 79 | // m_log.InfoFormat("[AVFACTORY] configured for {0} save and {1} send",m_savetime,m_sendtime); |
80 | } | 80 | } |
81 | 81 | ||
@@ -166,7 +166,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
166 | } | 166 | } |
167 | 167 | ||
168 | /// <summary> | 168 | /// <summary> |
169 | /// Set appearance data (texture asset IDs and slider settings) | 169 | /// Set appearance data (texture asset IDs and slider settings) |
170 | /// </summary> | 170 | /// </summary> |
171 | /// <param name="sp"></param> | 171 | /// <param name="sp"></param> |
172 | /// <param name="texture"></param> | 172 | /// <param name="texture"></param> |
@@ -190,7 +190,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
190 | { | 190 | { |
191 | changed = sp.Appearance.SetVisualParams(visualParams); | 191 | changed = sp.Appearance.SetVisualParams(visualParams); |
192 | } | 192 | } |
193 | 193 | ||
194 | // Process the baked texture array | 194 | // Process the baked texture array |
195 | if (textureEntry != null) | 195 | if (textureEntry != null) |
196 | { | 196 | { |
@@ -267,7 +267,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
267 | WearableCacheItem[] items = sp.Appearance.WearableCacheItems; | 267 | WearableCacheItem[] items = sp.Appearance.WearableCacheItems; |
268 | //foreach (WearableCacheItem item in items) | 268 | //foreach (WearableCacheItem item in items) |
269 | //{ | 269 | //{ |
270 | 270 | ||
271 | //} | 271 | //} |
272 | return items; | 272 | return items; |
273 | } | 273 | } |
@@ -468,7 +468,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
468 | } | 468 | } |
469 | 469 | ||
470 | sp.Appearance.WearableCacheItems = wearableCache; | 470 | sp.Appearance.WearableCacheItems = wearableCache; |
471 | 471 | ||
472 | if (missing.Count > 0) | 472 | if (missing.Count > 0) |
473 | { | 473 | { |
474 | foreach (UUID id in missing) | 474 | foreach (UUID id in missing) |
@@ -493,7 +493,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
493 | for (int iter = 0; iter < AvatarAppearance.BAKE_INDICES.Length; iter++) | 493 | for (int iter = 0; iter < AvatarAppearance.BAKE_INDICES.Length; iter++) |
494 | { | 494 | { |
495 | int j = AvatarAppearance.BAKE_INDICES[iter]; | 495 | int j = AvatarAppearance.BAKE_INDICES[iter]; |
496 | m_log.Debug("[UpdateBCache] {" + iter + "/" + | 496 | m_log.Debug("[UpdateBCache] {" + iter + "/" + |
497 | sp.Appearance.WearableCacheItems[j].TextureIndex + "}: c-" + | 497 | sp.Appearance.WearableCacheItems[j].TextureIndex + "}: c-" + |
498 | sp.Appearance.WearableCacheItems[j].CacheId + ", t-" + | 498 | sp.Appearance.WearableCacheItems[j].CacheId + ", t-" + |
499 | sp.Appearance.WearableCacheItems[j].TextureID); | 499 | sp.Appearance.WearableCacheItems[j].TextureID); |
@@ -588,7 +588,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
588 | wearableCacheValid = false; | 588 | wearableCacheValid = false; |
589 | } | 589 | } |
590 | } | 590 | } |
591 | 591 | ||
592 | wearableCacheValid = (wearableCacheValid && (hits >= AvatarAppearance.BAKE_INDICES.Length - 1)); | 592 | wearableCacheValid = (wearableCacheValid && (hits >= AvatarAppearance.BAKE_INDICES.Length - 1)); |
593 | if (wearableCacheValid) | 593 | if (wearableCacheValid) |
594 | m_log.Debug("[ValidateBakedCache] have valid local cache"); | 594 | m_log.Debug("[ValidateBakedCache] have valid local cache"); |
@@ -601,7 +601,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
601 | if (!wearableCacheValid) | 601 | if (!wearableCacheValid) |
602 | { | 602 | { |
603 | hits = 0; | 603 | hits = 0; |
604 | // only use external bake module on login condition check | 604 | // only use external bake module on login condition check |
605 | // ScenePresence ssp = null; | 605 | // ScenePresence ssp = null; |
606 | // if (sp is ScenePresence) | 606 | // if (sp is ScenePresence) |
607 | { | 607 | { |
@@ -816,7 +816,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
816 | foreach (KeyValuePair<UUID, long> kvp in saves) | 816 | foreach (KeyValuePair<UUID, long> kvp in saves) |
817 | { | 817 | { |
818 | // We have to load the key and value into local parameters to avoid a race condition if we loop | 818 | // We have to load the key and value into local parameters to avoid a race condition if we loop |
819 | // around and load kvp with a different value before FireAndForget has launched its thread. | 819 | // around and load kvp with a different value before FireAndForget has launched its thread. |
820 | UUID avatarID = kvp.Key; | 820 | UUID avatarID = kvp.Key; |
821 | long sendTime = kvp.Value; | 821 | long sendTime = kvp.Value; |
822 | 822 | ||
@@ -869,13 +869,13 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
869 | 869 | ||
870 | m_scene.AvatarService.SetAppearance(agentid, sp.Appearance); | 870 | m_scene.AvatarService.SetAppearance(agentid, sp.Appearance); |
871 | 871 | ||
872 | // Trigger this here because it's the final step in the set/queue/save process for appearance setting. | 872 | // Trigger this here because it's the final step in the set/queue/save process for appearance setting. |
873 | // Everything has been updated and stored. Ensures bakes have been persisted (if option is set to persist bakes). | 873 | // Everything has been updated and stored. Ensures bakes have been persisted (if option is set to persist bakes). |
874 | m_scene.EventManager.TriggerAvatarAppearanceChanged(sp); | 874 | m_scene.EventManager.TriggerAvatarAppearanceChanged(sp); |
875 | } | 875 | } |
876 | 876 | ||
877 | /// <summary> | 877 | /// <summary> |
878 | /// For a given set of appearance items, check whether the items are valid and add their asset IDs to | 878 | /// For a given set of appearance items, check whether the items are valid and add their asset IDs to |
879 | /// appearance data. | 879 | /// appearance data. |
880 | /// </summary> | 880 | /// </summary> |
881 | /// <param name='userID'></param> | 881 | /// <param name='userID'></param> |
@@ -893,7 +893,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
893 | if (appearance.Wearables[i][j].ItemID == UUID.Zero) | 893 | if (appearance.Wearables[i][j].ItemID == UUID.Zero) |
894 | { | 894 | { |
895 | m_log.WarnFormat( | 895 | m_log.WarnFormat( |
896 | "[AVFACTORY]: Wearable item {0}:{1} for user {2} unexpectedly UUID.Zero. Ignoring.", | 896 | "[AVFACTORY]: Wearable item {0}:{1} for user {2} unexpectedly UUID.Zero. Ignoring.", |
897 | i, j, userID); | 897 | i, j, userID); |
898 | 898 | ||
899 | continue; | 899 | continue; |
@@ -967,7 +967,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
967 | // case WearableType.Skin: | 967 | // case WearableType.Skin: |
968 | // //case WearableType.Underpants: | 968 | // //case WearableType.Underpants: |
969 | // TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance); | 969 | // TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance); |
970 | // | 970 | // |
971 | // m_log.WarnFormat("[AVFACTORY]: {0} Default Wearables, passing existing values.", (WearableType)i); | 971 | // m_log.WarnFormat("[AVFACTORY]: {0} Default Wearables, passing existing values.", (WearableType)i); |
972 | // resetwearable = true; | 972 | // resetwearable = true; |
973 | // break; | 973 | // break; |
@@ -975,7 +975,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
975 | // } | 975 | // } |
976 | // continue; | 976 | // continue; |
977 | // } | 977 | // } |
978 | // | 978 | // |
979 | // InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i][j].ItemID, userID); | 979 | // InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i][j].ItemID, userID); |
980 | // baseItem = invService.GetItem(baseItem); | 980 | // baseItem = invService.GetItem(baseItem); |
981 | // | 981 | // |
@@ -1002,7 +1002,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
1002 | // | 1002 | // |
1003 | // TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance); | 1003 | // TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance); |
1004 | // resetwearable = true; | 1004 | // resetwearable = true; |
1005 | // | 1005 | // |
1006 | // } | 1006 | // } |
1007 | // } | 1007 | // } |
1008 | // } | 1008 | // } |
@@ -1011,7 +1011,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
1011 | // if (appearance.Wearables[(int) WearableType.Eyes] == null) | 1011 | // if (appearance.Wearables[(int) WearableType.Eyes] == null) |
1012 | // { | 1012 | // { |
1013 | // m_log.WarnFormat("[AVFACTORY]: {0} Eyes are Null, passing existing values.", (WearableType.Eyes)); | 1013 | // m_log.WarnFormat("[AVFACTORY]: {0} Eyes are Null, passing existing values.", (WearableType.Eyes)); |
1014 | // | 1014 | // |
1015 | // TryAndRepairBrokenWearable(WearableType.Eyes, invService, userID, appearance); | 1015 | // TryAndRepairBrokenWearable(WearableType.Eyes, invService, userID, appearance); |
1016 | // resetwearable = true; | 1016 | // resetwearable = true; |
1017 | // } | 1017 | // } |
@@ -1213,7 +1213,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
1213 | m_log.WarnFormat("[AVFACTORY]: Client_OnRequestWearables unable to find presence for {0}", client.AgentId); | 1213 | m_log.WarnFormat("[AVFACTORY]: Client_OnRequestWearables unable to find presence for {0}", client.AgentId); |
1214 | }, null, "AvatarFactoryModule.OnClientRequestWearables"); | 1214 | }, null, "AvatarFactoryModule.OnClientRequestWearables"); |
1215 | } | 1215 | } |
1216 | 1216 | ||
1217 | /// <summary> | 1217 | /// <summary> |
1218 | /// Set appearance data (texture asset IDs and slider settings) received from a client | 1218 | /// Set appearance data (texture asset IDs and slider settings) received from a client |
1219 | /// </summary> | 1219 | /// </summary> |
@@ -1299,12 +1299,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
1299 | { | 1299 | { |
1300 | UUID texture = UUID.Zero; | 1300 | UUID texture = UUID.Zero; |
1301 | int index = request.BakedTextureIndex; | 1301 | int index = request.BakedTextureIndex; |
1302 | 1302 | ||
1303 | if (m_reusetextures) | 1303 | if (m_reusetextures) |
1304 | { | 1304 | { |
1305 | // this is the most insanely dumb way to do this... however it seems to | 1305 | // this is the most insanely dumb way to do this... however it seems to |
1306 | // actually work. if the appearance has been reset because wearables have | 1306 | // actually work. if the appearance has been reset because wearables have |
1307 | // changed then the texture entries are zero'd out until the bakes are | 1307 | // changed then the texture entries are zero'd out until the bakes are |
1308 | // uploaded. on login, if the textures exist in the cache (eg if you logged | 1308 | // uploaded. on login, if the textures exist in the cache (eg if you logged |
1309 | // into the simulator recently, then the appearance will pull those and send | 1309 | // into the simulator recently, then the appearance will pull those and send |
1310 | // them back in the packet and you won't have to rebake. if the textures aren't | 1310 | // them back in the packet and you won't have to rebake. if the textures aren't |
@@ -1320,7 +1320,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
1320 | 1320 | ||
1321 | // m_log.WarnFormat("[AVFACTORY]: reuse texture {0} for index {1}",texture,index); | 1321 | // m_log.WarnFormat("[AVFACTORY]: reuse texture {0} for index {1}",texture,index); |
1322 | } | 1322 | } |
1323 | 1323 | ||
1324 | CachedTextureResponseArg response = new CachedTextureResponseArg(); | 1324 | CachedTextureResponseArg response = new CachedTextureResponseArg(); |
1325 | response.BakedTextureIndex = index; | 1325 | response.BakedTextureIndex = index; |
1326 | response.BakedTextureID = texture; | 1326 | response.BakedTextureID = texture; |
@@ -1328,7 +1328,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
1328 | 1328 | ||
1329 | cachedTextureResponse.Add(response); | 1329 | cachedTextureResponse.Add(response); |
1330 | } | 1330 | } |
1331 | 1331 | ||
1332 | // m_log.WarnFormat("[AVFACTORY]: serial is {0}",serial); | 1332 | // m_log.WarnFormat("[AVFACTORY]: serial is {0}",serial); |
1333 | // The serial number appears to be used to match requests and responses | 1333 | // The serial number appears to be used to match requests and responses |
1334 | // in the texture transaction. We just send back the serial number | 1334 | // in the texture transaction. We just send back the serial number |
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs index dd93449..33489d1 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
55 | // We need an asset cache because otherwise the LocalAssetServiceConnector will short-circuit directly | 55 | // We need an asset cache because otherwise the LocalAssetServiceConnector will short-circuit directly |
56 | // to the AssetService, which will then store temporary and local assets permanently | 56 | // to the AssetService, which will then store temporary and local assets permanently |
57 | CoreAssetCache assetCache = new CoreAssetCache(); | 57 | CoreAssetCache assetCache = new CoreAssetCache(); |
58 | 58 | ||
59 | AvatarFactoryModule afm = new AvatarFactoryModule(); | 59 | AvatarFactoryModule afm = new AvatarFactoryModule(); |
60 | TestScene scene = new SceneHelpers(assetCache).SetupScene(); | 60 | TestScene scene = new SceneHelpers(assetCache).SetupScene(); |
61 | SceneHelpers.SetupSceneModules(scene, afm); | 61 | SceneHelpers.SetupSceneModules(scene, afm); |
@@ -63,7 +63,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
63 | 63 | ||
64 | // TODO: Use the actual BunchOfCaps functionality once we slot in the CapabilitiesModules | 64 | // TODO: Use the actual BunchOfCaps functionality once we slot in the CapabilitiesModules |
65 | AssetBase bakedTextureAsset; | 65 | AssetBase bakedTextureAsset; |
66 | bakedTextureAsset | 66 | bakedTextureAsset |
67 | = new AssetBase( | 67 | = new AssetBase( |
68 | bakedTextureID, "Test Baked Texture", (sbyte)AssetType.Texture, userId.ToString()); | 68 | bakedTextureID, "Test Baked Texture", (sbyte)AssetType.Texture, userId.ToString()); |
69 | bakedTextureAsset.Data = new byte[] { 2 }; // Not necessary to have a genuine JPEG2000 asset here yet | 69 | bakedTextureAsset.Data = new byte[] { 2 }; // Not necessary to have a genuine JPEG2000 asset here yet |
@@ -85,7 +85,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
85 | // This is the alpha texture | 85 | // This is the alpha texture |
86 | eyesFace.TextureID = bakedTextureID; | 86 | eyesFace.TextureID = bakedTextureID; |
87 | afm.SetAppearance(sp, bakedTextureEntry, visualParams, null); | 87 | afm.SetAppearance(sp, bakedTextureEntry, visualParams, null); |
88 | 88 | ||
89 | Assert.That(rebakeRequestsReceived, Is.EqualTo(0)); | 89 | Assert.That(rebakeRequestsReceived, Is.EqualTo(0)); |
90 | 90 | ||
91 | AssetBase eyesBake = scene.AssetService.Get(bakedTextureID.ToString()); | 91 | AssetBase eyesBake = scene.AssetService.Get(bakedTextureID.ToString()); |
@@ -98,7 +98,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
98 | /// Test appearance setting where the baked texture UUID are library alpha textures. | 98 | /// Test appearance setting where the baked texture UUID are library alpha textures. |
99 | /// </summary> | 99 | /// </summary> |
100 | /// <remarks> | 100 | /// <remarks> |
101 | /// For a mesh avatar, it appears these 'baked textures' are used. So these should not trigger a request to | 101 | /// For a mesh avatar, it appears these 'baked textures' are used. So these should not trigger a request to |
102 | /// rebake. | 102 | /// rebake. |
103 | /// </remarks> | 103 | /// </remarks> |
104 | [Test] | 104 | [Test] |
@@ -113,14 +113,14 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
113 | // We need an asset cache because otherwise the LocalAssetServiceConnector will short-circuit directly | 113 | // We need an asset cache because otherwise the LocalAssetServiceConnector will short-circuit directly |
114 | // to the AssetService, which will then store temporary and local assets permanently | 114 | // to the AssetService, which will then store temporary and local assets permanently |
115 | CoreAssetCache assetCache = new CoreAssetCache(); | 115 | CoreAssetCache assetCache = new CoreAssetCache(); |
116 | 116 | ||
117 | AvatarFactoryModule afm = new AvatarFactoryModule(); | 117 | AvatarFactoryModule afm = new AvatarFactoryModule(); |
118 | TestScene scene = new SceneHelpers(assetCache).SetupScene(); | 118 | TestScene scene = new SceneHelpers(assetCache).SetupScene(); |
119 | SceneHelpers.SetupSceneModules(scene, afm); | 119 | SceneHelpers.SetupSceneModules(scene, afm); |
120 | ScenePresence sp = SceneHelpers.AddScenePresence(scene, userId); | 120 | ScenePresence sp = SceneHelpers.AddScenePresence(scene, userId); |
121 | 121 | ||
122 | AssetBase libraryAsset; | 122 | AssetBase libraryAsset; |
123 | libraryAsset | 123 | libraryAsset |
124 | = new AssetBase( | 124 | = new AssetBase( |
125 | alphaTextureID, "Default Alpha Layer Texture", (sbyte)AssetType.Texture, userId.ToString()); | 125 | alphaTextureID, "Default Alpha Layer Texture", (sbyte)AssetType.Texture, userId.ToString()); |
126 | libraryAsset.Data = new byte[] { 2 }; // Not necessary to have a genuine JPEG2000 asset here yet | 126 | libraryAsset.Data = new byte[] { 2 }; // Not necessary to have a genuine JPEG2000 asset here yet |
@@ -142,7 +142,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
142 | // This is the alpha texture | 142 | // This is the alpha texture |
143 | eyesFace.TextureID = alphaTextureID; | 143 | eyesFace.TextureID = alphaTextureID; |
144 | afm.SetAppearance(sp, bakedTextureEntry, visualParams, null); | 144 | afm.SetAppearance(sp, bakedTextureEntry, visualParams, null); |
145 | 145 | ||
146 | Assert.That(rebakeRequestsReceived, Is.EqualTo(0)); | 146 | Assert.That(rebakeRequestsReceived, Is.EqualTo(0)); |
147 | } | 147 | } |
148 | 148 | ||
@@ -158,7 +158,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
158 | // We need an asset cache because otherwise the LocalAssetServiceConnector will short-circuit directly | 158 | // We need an asset cache because otherwise the LocalAssetServiceConnector will short-circuit directly |
159 | // to the AssetService, which will then store temporary and local assets permanently | 159 | // to the AssetService, which will then store temporary and local assets permanently |
160 | CoreAssetCache assetCache = new CoreAssetCache(); | 160 | CoreAssetCache assetCache = new CoreAssetCache(); |
161 | 161 | ||
162 | AvatarFactoryModule afm = new AvatarFactoryModule(); | 162 | AvatarFactoryModule afm = new AvatarFactoryModule(); |
163 | TestScene scene = new SceneHelpers(assetCache).SetupScene(); | 163 | TestScene scene = new SceneHelpers(assetCache).SetupScene(); |
164 | SceneHelpers.SetupSceneModules(scene, afm); | 164 | SceneHelpers.SetupSceneModules(scene, afm); |
diff --git a/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs b/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs index 6d97251..27e84b0 100644 --- a/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs | |||
@@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures | |||
53 | private UTF8Encoding enc = new UTF8Encoding(); | 53 | private UTF8Encoding enc = new UTF8Encoding(); |
54 | private string m_URL = String.Empty; | 54 | private string m_URL = String.Empty; |
55 | private static XmlSerializer m_serializer = new XmlSerializer(typeof(AssetBase)); | 55 | private static XmlSerializer m_serializer = new XmlSerializer(typeof(AssetBase)); |
56 | private static bool m_enabled = false; | 56 | private static bool m_enabled = false; |
57 | 57 | ||
58 | private static IServiceAuth m_Auth; | 58 | private static IServiceAuth m_Auth; |
59 | 59 | ||
@@ -64,18 +64,18 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures | |||
64 | return; | 64 | return; |
65 | 65 | ||
66 | m_URL = config.GetString("URL", String.Empty); | 66 | m_URL = config.GetString("URL", String.Empty); |
67 | if (m_URL == String.Empty) | 67 | if (m_URL == String.Empty) |
68 | return; | 68 | return; |
69 | 69 | ||
70 | m_enabled = true; | 70 | m_enabled = true; |
71 | 71 | ||
72 | m_Auth = ServiceAuth.Create(configSource, "XBakes"); | 72 | m_Auth = ServiceAuth.Create(configSource, "XBakes"); |
73 | } | 73 | } |
74 | 74 | ||
75 | public void AddRegion(Scene scene) | 75 | public void AddRegion(Scene scene) |
76 | { | 76 | { |
77 | if (!m_enabled) | 77 | if (!m_enabled) |
78 | return; | 78 | return; |
79 | 79 | ||
80 | // m_log.InfoFormat("[XBakes]: Enabled for region {0}", scene.RegionInfo.RegionName); | 80 | // m_log.InfoFormat("[XBakes]: Enabled for region {0}", scene.RegionInfo.RegionName); |
81 | m_Scene = scene; | 81 | m_Scene = scene; |
@@ -177,7 +177,7 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures | |||
177 | 177 | ||
178 | int numberWears = 0; | 178 | int numberWears = 0; |
179 | MemoryStream reqStream; | 179 | MemoryStream reqStream; |
180 | 180 | ||
181 | using (MemoryStream bakeStream = new MemoryStream()) | 181 | using (MemoryStream bakeStream = new MemoryStream()) |
182 | using (XmlTextWriter bakeWriter = new XmlTextWriter(bakeStream, null)) | 182 | using (XmlTextWriter bakeWriter = new XmlTextWriter(bakeStream, null)) |
183 | { | 183 | { |
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index 5164289..53800bb 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | |||
@@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
69 | m_enabled = false; | 69 | m_enabled = false; |
70 | return; | 70 | return; |
71 | } | 71 | } |
72 | 72 | ||
73 | m_whisperdistance = m_config.GetInt("whisper_distance", m_whisperdistance); | 73 | m_whisperdistance = m_config.GetInt("whisper_distance", m_whisperdistance); |
74 | m_saydistance = m_config.GetInt("say_distance", m_saydistance); | 74 | m_saydistance = m_config.GetInt("say_distance", m_saydistance); |
75 | m_shoutdistance = m_config.GetInt("shout_distance", m_shoutdistance); | 75 | m_shoutdistance = m_config.GetInt("shout_distance", m_shoutdistance); |
@@ -123,7 +123,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
123 | } | 123 | } |
124 | } | 124 | } |
125 | } | 125 | } |
126 | 126 | ||
127 | public virtual void Close() | 127 | public virtual void Close() |
128 | { | 128 | { |
129 | } | 129 | } |
@@ -132,7 +132,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
132 | { | 132 | { |
133 | } | 133 | } |
134 | 134 | ||
135 | public virtual Type ReplaceableInterface | 135 | public virtual Type ReplaceableInterface |
136 | { | 136 | { |
137 | get { return null; } | 137 | get { return null; } |
138 | } | 138 | } |
@@ -222,7 +222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
222 | return; | 222 | return; |
223 | } | 223 | } |
224 | 224 | ||
225 | switch (sourceType) | 225 | switch (sourceType) |
226 | { | 226 | { |
227 | case ChatSourceType.Agent: | 227 | case ChatSourceType.Agent: |
228 | ScenePresence avatar = (scene as Scene).GetScenePresence(c.Sender.AgentId); | 228 | ScenePresence avatar = (scene as Scene).GetScenePresence(c.Sender.AgentId); |
@@ -240,7 +240,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
240 | } | 240 | } |
241 | destination = UUID.Zero; // Avatars cant "SayTo" | 241 | destination = UUID.Zero; // Avatars cant "SayTo" |
242 | ownerID = c.Sender.AgentId; | 242 | ownerID = c.Sender.AgentId; |
243 | 243 | ||
244 | hidePos = fromPos; | 244 | hidePos = fromPos; |
245 | break; | 245 | break; |
246 | 246 | ||
@@ -264,7 +264,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
264 | message = message.Substring(0, 1000); | 264 | message = message.Substring(0, 1000); |
265 | 265 | ||
266 | // m_log.DebugFormat( | 266 | // m_log.DebugFormat( |
267 | // "[CHAT]: DCTA: fromID {0} fromName {1}, region{2}, cType {3}, sType {4}", | 267 | // "[CHAT]: DCTA: fromID {0} fromName {1}, region{2}, cType {3}, sType {4}", |
268 | // fromID, fromName, scene.RegionInfo.RegionName, c.Type, sourceType); | 268 | // fromID, fromName, scene.RegionInfo.RegionName, c.Type, sourceType); |
269 | 269 | ||
270 | HashSet<UUID> receiverIDs = new HashSet<UUID>(); | 270 | HashSet<UUID> receiverIDs = new HashSet<UUID>(); |
@@ -317,13 +317,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
317 | } | 317 | } |
318 | } | 318 | } |
319 | }); | 319 | }); |
320 | 320 | ||
321 | scene.EventManager.TriggerOnChatToClients( | 321 | scene.EventManager.TriggerOnChatToClients( |
322 | fromID, receiverIDs, message, c.Type, fromPos, fromName, sourceType, ChatAudibleLevel.Fully); | 322 | fromID, receiverIDs, message, c.Type, fromPos, fromName, sourceType, ChatAudibleLevel.Fully); |
323 | } | 323 | } |
324 | 324 | ||
325 | static protected Vector3 CenterOfRegion = new Vector3(128, 128, 30); | 325 | static protected Vector3 CenterOfRegion = new Vector3(128, 128, 30); |
326 | 326 | ||
327 | public virtual void OnChatBroadcast(Object sender, OSChatMessage c) | 327 | public virtual void OnChatBroadcast(Object sender, OSChatMessage c) |
328 | { | 328 | { |
329 | if (c.Channel != 0 && c.Channel != DEBUG_CHANNEL) return; | 329 | if (c.Channel != 0 && c.Channel != DEBUG_CHANNEL) return; |
@@ -341,7 +341,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
341 | // broadcast chat works by redistributing every incoming chat | 341 | // broadcast chat works by redistributing every incoming chat |
342 | // message to each avatar in the scene. | 342 | // message to each avatar in the scene. |
343 | string fromName = c.From; | 343 | string fromName = c.From; |
344 | 344 | ||
345 | UUID fromID = UUID.Zero; | 345 | UUID fromID = UUID.Zero; |
346 | UUID ownerID = UUID.Zero; | 346 | UUID ownerID = UUID.Zero; |
347 | ChatSourceType sourceType = ChatSourceType.Object; | 347 | ChatSourceType sourceType = ChatSourceType.Object; |
@@ -353,15 +353,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
353 | ownerID = c.Sender.AgentId; | 353 | ownerID = c.Sender.AgentId; |
354 | sourceType = ChatSourceType.Agent; | 354 | sourceType = ChatSourceType.Agent; |
355 | } | 355 | } |
356 | else if (c.SenderUUID != UUID.Zero) | 356 | else if (c.SenderUUID != UUID.Zero) |
357 | { | 357 | { |
358 | fromID = c.SenderUUID; | 358 | fromID = c.SenderUUID; |
359 | ownerID = ((SceneObjectPart)c.SenderObject).OwnerID; | 359 | ownerID = ((SceneObjectPart)c.SenderObject).OwnerID; |
360 | } | 360 | } |
361 | 361 | ||
362 | // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); | 362 | // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); |
363 | HashSet<UUID> receiverIDs = new HashSet<UUID>(); | 363 | HashSet<UUID> receiverIDs = new HashSet<UUID>(); |
364 | 364 | ||
365 | if (c.Scene != null) | 365 | if (c.Scene != null) |
366 | { | 366 | { |
367 | ((Scene)c.Scene).ForEachRootClient | 367 | ((Scene)c.Scene).ForEachRootClient |
@@ -374,7 +374,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
374 | (null != c.SenderObject) && | 374 | (null != c.SenderObject) && |
375 | (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) | 375 | (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) |
376 | return; | 376 | return; |
377 | 377 | ||
378 | client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, fromID, | 378 | client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, fromID, |
379 | (byte)sourceType, (byte)ChatAudibleLevel.Fully); | 379 | (byte)sourceType, (byte)ChatAudibleLevel.Fully); |
380 | receiverIDs.Add(client.AgentId); | 380 | receiverIDs.Add(client.AgentId); |
@@ -400,7 +400,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
400 | /// <param name="type"></param> | 400 | /// <param name="type"></param> |
401 | /// <param name="message"></param> | 401 | /// <param name="message"></param> |
402 | /// <param name="src"></param> | 402 | /// <param name="src"></param> |
403 | /// <returns>true if the message was sent to the receiver, false if it was not sent due to failing a | 403 | /// <returns>true if the message was sent to the receiver, false if it was not sent due to failing a |
404 | /// precondition</returns> | 404 | /// precondition</returns> |
405 | protected virtual bool TrySendChatMessage( | 405 | protected virtual bool TrySendChatMessage( |
406 | ScenePresence presence, Vector3 fromPos, Vector3 regionPos, | 406 | ScenePresence presence, Vector3 fromPos, Vector3 regionPos, |
@@ -430,7 +430,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
430 | presence.ControllingClient.SendChatMessage( | 430 | presence.ControllingClient.SendChatMessage( |
431 | message, (byte) type, fromPos, fromName, | 431 | message, (byte) type, fromPos, fromName, |
432 | fromAgentID, ownerID, (byte)src, (byte)ChatAudibleLevel.Fully); | 432 | fromAgentID, ownerID, (byte)src, (byte)ChatAudibleLevel.Fully); |
433 | 433 | ||
434 | return true; | 434 | return true; |
435 | } | 435 | } |
436 | 436 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs index a720ad9..5457dc3 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
47 | { | 47 | { |
48 | [TestFixture] | 48 | [TestFixture] |
49 | public class ChatModuleTests : OpenSimTestCase | 49 | public class ChatModuleTests : OpenSimTestCase |
50 | { | 50 | { |
51 | [TestFixtureSetUp] | 51 | [TestFixtureSetUp] |
52 | public void FixtureInit() | 52 | public void FixtureInit() |
53 | { | 53 | { |
@@ -66,14 +66,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
66 | } | 66 | } |
67 | 67 | ||
68 | private void SetupNeighbourRegions(TestScene sceneA, TestScene sceneB) | 68 | private void SetupNeighbourRegions(TestScene sceneA, TestScene sceneB) |
69 | { | 69 | { |
70 | // XXX: HTTP server is not (and should not be) necessary for this test, though it's absence makes the | 70 | // XXX: HTTP server is not (and should not be) necessary for this test, though it's absence makes the |
71 | // CapabilitiesModule complain when it can't set up HTTP endpoints. | 71 | // CapabilitiesModule complain when it can't set up HTTP endpoints. |
72 | BaseHttpServer httpServer = new BaseHttpServer(99999); | 72 | BaseHttpServer httpServer = new BaseHttpServer(99999); |
73 | MainServer.AddHttpServer(httpServer); | 73 | MainServer.AddHttpServer(httpServer); |
74 | MainServer.Instance = httpServer; | 74 | MainServer.Instance = httpServer; |
75 | 75 | ||
76 | // We need entity transfer modules so that when sp2 logs into the east region, the region calls | 76 | // We need entity transfer modules so that when sp2 logs into the east region, the region calls |
77 | // EntityTransferModuleto set up a child agent on the west region. | 77 | // EntityTransferModuleto set up a child agent on the west region. |
78 | // XXX: However, this is not an entity transfer so is misleading. | 78 | // XXX: However, this is not an entity transfer so is misleading. |
79 | EntityTransferModule etmA = new EntityTransferModule(); | 79 | EntityTransferModule etmA = new EntityTransferModule(); |
@@ -87,7 +87,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
87 | modulesConfig.Set("SimulationServices", lscm.Name); | 87 | modulesConfig.Set("SimulationServices", lscm.Name); |
88 | 88 | ||
89 | SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); | 89 | SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); |
90 | SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA, new ChatModule()); | 90 | SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA, new ChatModule()); |
91 | SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB, new ChatModule()); | 91 | SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB, new ChatModule()); |
92 | } | 92 | } |
93 | 93 | ||
@@ -111,8 +111,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
111 | Vector3 sp2Position = new Vector3(250, 128, 20); | 111 | Vector3 sp2Position = new Vector3(250, 128, 20); |
112 | 112 | ||
113 | SceneHelpers sh = new SceneHelpers(); | 113 | SceneHelpers sh = new SceneHelpers(); |
114 | TestScene sceneWest = sh.SetupScene("sceneWest", TestHelpers.ParseTail(0x1), 1000, 1000); | 114 | TestScene sceneWest = sh.SetupScene("sceneWest", TestHelpers.ParseTail(0x1), 1000, 1000); |
115 | TestScene sceneEast = sh.SetupScene("sceneEast", TestHelpers.ParseTail(0x2), 1001, 1000); | 115 | TestScene sceneEast = sh.SetupScene("sceneEast", TestHelpers.ParseTail(0x2), 1001, 1000); |
116 | 116 | ||
117 | SetupNeighbourRegions(sceneWest, sceneEast); | 117 | SetupNeighbourRegions(sceneWest, sceneEast); |
118 | 118 | ||
@@ -124,12 +124,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
124 | // physics is irrelevant to this test. | 124 | // physics is irrelevant to this test. |
125 | sp1.Flying = true; | 125 | sp1.Flying = true; |
126 | 126 | ||
127 | // When sp1 logs in to sceneEast, it sets up a child agent in sceneWest and informs the sp2 client to | 127 | // When sp1 logs in to sceneEast, it sets up a child agent in sceneWest and informs the sp2 client to |
128 | // make the connection. For this test, will simplify this chain by making the connection directly. | 128 | // make the connection. For this test, will simplify this chain by making the connection directly. |
129 | ScenePresence sp1Child = SceneHelpers.AddChildScenePresence(sceneWest, sp1Uuid); | 129 | ScenePresence sp1Child = SceneHelpers.AddChildScenePresence(sceneWest, sp1Uuid); |
130 | TestClient sp1ChildClient = (TestClient)sp1Child.ControllingClient; | 130 | TestClient sp1ChildClient = (TestClient)sp1Child.ControllingClient; |
131 | 131 | ||
132 | sp1.AbsolutePosition = sp1Position; | 132 | sp1.AbsolutePosition = sp1Position; |
133 | 133 | ||
134 | ScenePresence sp2 = SceneHelpers.AddScenePresence(sceneWest, sp2Uuid); | 134 | ScenePresence sp2 = SceneHelpers.AddScenePresence(sceneWest, sp2Uuid); |
135 | TestClient sp2Client = (TestClient)sp2.ControllingClient; | 135 | TestClient sp2Client = (TestClient)sp2.ControllingClient; |
@@ -138,7 +138,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
138 | ScenePresence sp2Child = SceneHelpers.AddChildScenePresence(sceneEast, sp2Uuid); | 138 | ScenePresence sp2Child = SceneHelpers.AddChildScenePresence(sceneEast, sp2Uuid); |
139 | TestClient sp2ChildClient = (TestClient)sp2Child.ControllingClient; | 139 | TestClient sp2ChildClient = (TestClient)sp2Child.ControllingClient; |
140 | 140 | ||
141 | sp2.AbsolutePosition = sp2Position; | 141 | sp2.AbsolutePosition = sp2Position; |
142 | 142 | ||
143 | // We must update the scenes in order to make the root new root agents trigger position updates in their | 143 | // We must update the scenes in order to make the root new root agents trigger position updates in their |
144 | // children. | 144 | // children. |
@@ -147,19 +147,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
147 | 147 | ||
148 | // Check child positions are correct. | 148 | // Check child positions are correct. |
149 | Assert.AreEqual( | 149 | Assert.AreEqual( |
150 | new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z), | 150 | new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z), |
151 | sp1ChildClient.SceneAgent.AbsolutePosition); | 151 | sp1ChildClient.SceneAgent.AbsolutePosition); |
152 | 152 | ||
153 | Assert.AreEqual( | 153 | Assert.AreEqual( |
154 | new Vector3(sp2Position.X - sceneWest.RegionInfo.RegionSizeX, sp2Position.Y, sp2Position.Z), | 154 | new Vector3(sp2Position.X - sceneWest.RegionInfo.RegionSizeX, sp2Position.Y, sp2Position.Z), |
155 | sp2ChildClient.SceneAgent.AbsolutePosition); | 155 | sp2ChildClient.SceneAgent.AbsolutePosition); |
156 | 156 | ||
157 | string receivedSp1ChatMessage = ""; | 157 | string receivedSp1ChatMessage = ""; |
158 | string receivedSp2ChatMessage = ""; | 158 | string receivedSp2ChatMessage = ""; |
159 | 159 | ||
160 | sp1ChildClient.OnReceivedChatMessage | 160 | sp1ChildClient.OnReceivedChatMessage |
161 | += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp1ChatMessage = message; | 161 | += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp1ChatMessage = message; |
162 | sp2ChildClient.OnReceivedChatMessage | 162 | sp2ChildClient.OnReceivedChatMessage |
163 | += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp2ChatMessage = message; | 163 | += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp2ChatMessage = message; |
164 | 164 | ||
165 | TestUserInRange(sp1Client, "ello darling", ref receivedSp2ChatMessage); | 165 | TestUserInRange(sp1Client, "ello darling", ref receivedSp2ChatMessage); |
@@ -175,7 +175,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
175 | 175 | ||
176 | // Check child position is correct. | 176 | // Check child position is correct. |
177 | Assert.AreEqual( | 177 | Assert.AreEqual( |
178 | new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z), | 178 | new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z), |
179 | sp1ChildClient.SceneAgent.AbsolutePosition); | 179 | sp1ChildClient.SceneAgent.AbsolutePosition); |
180 | 180 | ||
181 | TestUserOutOfRange(sp1Client, "beef", ref receivedSp2ChatMessage); | 181 | TestUserOutOfRange(sp1Client, "beef", ref receivedSp2ChatMessage); |
@@ -202,8 +202,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
202 | Vector3 sp2Position = new Vector3(128, 6, 20); | 202 | Vector3 sp2Position = new Vector3(128, 6, 20); |
203 | 203 | ||
204 | SceneHelpers sh = new SceneHelpers(); | 204 | SceneHelpers sh = new SceneHelpers(); |
205 | TestScene sceneNorth = sh.SetupScene("sceneNorth", TestHelpers.ParseTail(0x1), 1000, 1000); | 205 | TestScene sceneNorth = sh.SetupScene("sceneNorth", TestHelpers.ParseTail(0x1), 1000, 1000); |
206 | TestScene sceneSouth = sh.SetupScene("sceneSouth", TestHelpers.ParseTail(0x2), 1000, 1001); | 206 | TestScene sceneSouth = sh.SetupScene("sceneSouth", TestHelpers.ParseTail(0x2), 1000, 1001); |
207 | 207 | ||
208 | SetupNeighbourRegions(sceneNorth, sceneSouth); | 208 | SetupNeighbourRegions(sceneNorth, sceneSouth); |
209 | 209 | ||
@@ -215,12 +215,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
215 | // physics is irrelevant to this test. | 215 | // physics is irrelevant to this test. |
216 | sp1.Flying = true; | 216 | sp1.Flying = true; |
217 | 217 | ||
218 | // When sp1 logs in to sceneEast, it sets up a child agent in sceneNorth and informs the sp2 client to | 218 | // When sp1 logs in to sceneEast, it sets up a child agent in sceneNorth and informs the sp2 client to |
219 | // make the connection. For this test, will simplify this chain by making the connection directly. | 219 | // make the connection. For this test, will simplify this chain by making the connection directly. |
220 | ScenePresence sp1Child = SceneHelpers.AddChildScenePresence(sceneSouth, sp1Uuid); | 220 | ScenePresence sp1Child = SceneHelpers.AddChildScenePresence(sceneSouth, sp1Uuid); |
221 | TestClient sp1ChildClient = (TestClient)sp1Child.ControllingClient; | 221 | TestClient sp1ChildClient = (TestClient)sp1Child.ControllingClient; |
222 | 222 | ||
223 | sp1.AbsolutePosition = sp1Position; | 223 | sp1.AbsolutePosition = sp1Position; |
224 | 224 | ||
225 | ScenePresence sp2 = SceneHelpers.AddScenePresence(sceneSouth, sp2Uuid); | 225 | ScenePresence sp2 = SceneHelpers.AddScenePresence(sceneSouth, sp2Uuid); |
226 | TestClient sp2Client = (TestClient)sp2.ControllingClient; | 226 | TestClient sp2Client = (TestClient)sp2.ControllingClient; |
@@ -229,7 +229,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
229 | ScenePresence sp2Child = SceneHelpers.AddChildScenePresence(sceneNorth, sp2Uuid); | 229 | ScenePresence sp2Child = SceneHelpers.AddChildScenePresence(sceneNorth, sp2Uuid); |
230 | TestClient sp2ChildClient = (TestClient)sp2Child.ControllingClient; | 230 | TestClient sp2ChildClient = (TestClient)sp2Child.ControllingClient; |
231 | 231 | ||
232 | sp2.AbsolutePosition = sp2Position; | 232 | sp2.AbsolutePosition = sp2Position; |
233 | 233 | ||
234 | // We must update the scenes in order to make the root new root agents trigger position updates in their | 234 | // We must update the scenes in order to make the root new root agents trigger position updates in their |
235 | // children. | 235 | // children. |
@@ -238,19 +238,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
238 | 238 | ||
239 | // Check child positions are correct. | 239 | // Check child positions are correct. |
240 | Assert.AreEqual( | 240 | Assert.AreEqual( |
241 | new Vector3(sp1Position.X, sp1Position.Y - sceneNorth.RegionInfo.RegionSizeY, sp1Position.Z), | 241 | new Vector3(sp1Position.X, sp1Position.Y - sceneNorth.RegionInfo.RegionSizeY, sp1Position.Z), |
242 | sp1ChildClient.SceneAgent.AbsolutePosition); | 242 | sp1ChildClient.SceneAgent.AbsolutePosition); |
243 | 243 | ||
244 | Assert.AreEqual( | 244 | Assert.AreEqual( |
245 | new Vector3(sp2Position.X, sp2Position.Y + sceneSouth.RegionInfo.RegionSizeY, sp2Position.Z), | 245 | new Vector3(sp2Position.X, sp2Position.Y + sceneSouth.RegionInfo.RegionSizeY, sp2Position.Z), |
246 | sp2ChildClient.SceneAgent.AbsolutePosition); | 246 | sp2ChildClient.SceneAgent.AbsolutePosition); |
247 | 247 | ||
248 | string receivedSp1ChatMessage = ""; | 248 | string receivedSp1ChatMessage = ""; |
249 | string receivedSp2ChatMessage = ""; | 249 | string receivedSp2ChatMessage = ""; |
250 | 250 | ||
251 | sp1ChildClient.OnReceivedChatMessage | 251 | sp1ChildClient.OnReceivedChatMessage |
252 | += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp1ChatMessage = message; | 252 | += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp1ChatMessage = message; |
253 | sp2ChildClient.OnReceivedChatMessage | 253 | sp2ChildClient.OnReceivedChatMessage |
254 | += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp2ChatMessage = message; | 254 | += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp2ChatMessage = message; |
255 | 255 | ||
256 | TestUserInRange(sp1Client, "ello darling", ref receivedSp2ChatMessage); | 256 | TestUserInRange(sp1Client, "ello darling", ref receivedSp2ChatMessage); |
@@ -266,13 +266,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
266 | 266 | ||
267 | // Check child position is correct. | 267 | // Check child position is correct. |
268 | Assert.AreEqual( | 268 | Assert.AreEqual( |
269 | new Vector3(sp1Position.X, sp1Position.Y - sceneNorth.RegionInfo.RegionSizeY, sp1Position.Z), | 269 | new Vector3(sp1Position.X, sp1Position.Y - sceneNorth.RegionInfo.RegionSizeY, sp1Position.Z), |
270 | sp1ChildClient.SceneAgent.AbsolutePosition); | 270 | sp1ChildClient.SceneAgent.AbsolutePosition); |
271 | 271 | ||
272 | TestUserOutOfRange(sp1Client, "beef", ref receivedSp2ChatMessage); | 272 | TestUserOutOfRange(sp1Client, "beef", ref receivedSp2ChatMessage); |
273 | TestUserOutOfRange(sp2Client, "lentils", ref receivedSp1ChatMessage); | 273 | TestUserOutOfRange(sp2Client, "lentils", ref receivedSp1ChatMessage); |
274 | } | 274 | } |
275 | 275 | ||
276 | private void TestUserInRange(TestClient speakClient, string testMessage, ref string receivedMessage) | 276 | private void TestUserInRange(TestClient speakClient, string testMessage, ref string receivedMessage) |
277 | { | 277 | { |
278 | receivedMessage = ""; | 278 | receivedMessage = ""; |
diff --git a/OpenSim/Region/CoreModules/Avatar/Commands/UserCommandsModule.cs b/OpenSim/Region/CoreModules/Avatar/Commands/UserCommandsModule.cs index 764adf9..cf65c47 100644 --- a/OpenSim/Region/CoreModules/Avatar/Commands/UserCommandsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Commands/UserCommandsModule.cs | |||
@@ -62,19 +62,19 @@ namespace OpenSim.Region.CoreModules.Avatars.Commands | |||
62 | private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>(); | 62 | private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>(); |
63 | 63 | ||
64 | public string Name { get { return "User Commands Module"; } } | 64 | public string Name { get { return "User Commands Module"; } } |
65 | 65 | ||
66 | public Type ReplaceableInterface { get { return null; } } | 66 | public Type ReplaceableInterface { get { return null; } } |
67 | 67 | ||
68 | public void Initialise(IConfigSource source) | 68 | public void Initialise(IConfigSource source) |
69 | { | 69 | { |
70 | // m_log.DebugFormat("[USER COMMANDS MODULE]: INITIALIZED MODULE"); | 70 | // m_log.DebugFormat("[USER COMMANDS MODULE]: INITIALIZED MODULE"); |
71 | } | 71 | } |
72 | 72 | ||
73 | public void PostInitialise() | 73 | public void PostInitialise() |
74 | { | 74 | { |
75 | // m_log.DebugFormat("[USER COMMANDS MODULE]: POST INITIALIZED MODULE"); | 75 | // m_log.DebugFormat("[USER COMMANDS MODULE]: POST INITIALIZED MODULE"); |
76 | } | 76 | } |
77 | 77 | ||
78 | public void Close() | 78 | public void Close() |
79 | { | 79 | { |
80 | // m_log.DebugFormat("[USER COMMANDS MODULE]: CLOSED MODULE"); | 80 | // m_log.DebugFormat("[USER COMMANDS MODULE]: CLOSED MODULE"); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index aaa331b..7980de3 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -167,7 +167,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
167 | m_Enabled = true; | 167 | m_Enabled = true; |
168 | m_log.DebugFormat("[FRIENDS MODULE]: {0} enabled.", Name); | 168 | m_log.DebugFormat("[FRIENDS MODULE]: {0} enabled.", Name); |
169 | } | 169 | } |
170 | } | 170 | } |
171 | } | 171 | } |
172 | 172 | ||
173 | protected virtual void InitModule(IConfigSource config) | 173 | protected virtual void InitModule(IConfigSource config) |
@@ -570,7 +570,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
570 | protected virtual void OnInstantMessage(IClientAPI client, GridInstantMessage im) | 570 | protected virtual void OnInstantMessage(IClientAPI client, GridInstantMessage im) |
571 | { | 571 | { |
572 | if ((InstantMessageDialog)im.dialog == InstantMessageDialog.FriendshipOffered) | 572 | if ((InstantMessageDialog)im.dialog == InstantMessageDialog.FriendshipOffered) |
573 | { | 573 | { |
574 | // we got a friendship offer | 574 | // we got a friendship offer |
575 | UUID principalID = new UUID(im.fromAgentID); | 575 | UUID principalID = new UUID(im.fromAgentID); |
576 | UUID friendID = new UUID(im.toAgentID); | 576 | UUID friendID = new UUID(im.toAgentID); |
@@ -605,7 +605,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
605 | im.imSessionID = im.fromAgentID; | 605 | im.imSessionID = im.fromAgentID; |
606 | im.fromAgentName = GetFriendshipRequesterName(agentID); | 606 | im.fromAgentName = GetFriendshipRequesterName(agentID); |
607 | 607 | ||
608 | // Try the local sim | 608 | // Try the local sim |
609 | if (LocalFriendshipOffered(friendID, im)) | 609 | if (LocalFriendshipOffered(friendID, im)) |
610 | return true; | 610 | return true; |
611 | 611 | ||
@@ -648,7 +648,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
648 | ccm.CreateCallingCard(client.AgentId, friendID, UUID.Zero); | 648 | ccm.CreateCallingCard(client.AgentId, friendID, UUID.Zero); |
649 | } | 649 | } |
650 | 650 | ||
651 | // Update the local cache. | 651 | // Update the local cache. |
652 | RecacheFriends(client); | 652 | RecacheFriends(client); |
653 | 653 | ||
654 | // | 654 | // |
@@ -704,7 +704,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
704 | } | 704 | } |
705 | } | 705 | } |
706 | } | 706 | } |
707 | 707 | ||
708 | public void RemoveFriendship(IClientAPI client, UUID exfriendID) | 708 | public void RemoveFriendship(IClientAPI client, UUID exfriendID) |
709 | { | 709 | { |
710 | if (!DeleteFriendship(client.AgentId, exfriendID)) | 710 | if (!DeleteFriendship(client.AgentId, exfriendID)) |
@@ -732,7 +732,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
732 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); | 732 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); |
733 | m_FriendsSimConnector.FriendshipTerminated(region, client.AgentId, exfriendID); | 733 | m_FriendsSimConnector.FriendshipTerminated(region, client.AgentId, exfriendID); |
734 | } | 734 | } |
735 | } | 735 | } |
736 | } | 736 | } |
737 | 737 | ||
738 | public void FindFriend(IClientAPI remoteClient,UUID HunterID ,UUID PreyID) | 738 | public void FindFriend(IClientAPI remoteClient,UUID HunterID ,UUID PreyID) |
@@ -740,7 +740,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
740 | UUID requester = remoteClient.AgentId; | 740 | UUID requester = remoteClient.AgentId; |
741 | if(requester != HunterID) // only allow client agent to be the hunter (?) | 741 | if(requester != HunterID) // only allow client agent to be the hunter (?) |
742 | return; | 742 | return; |
743 | 743 | ||
744 | FriendInfo[] friends = GetFriendsFromCache(requester); | 744 | FriendInfo[] friends = GetFriendsFromCache(requester); |
745 | if (friends.Length == 0) | 745 | if (friends.Length == 0) |
746 | return; | 746 | return; |
@@ -773,7 +773,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
773 | } | 773 | } |
774 | 774 | ||
775 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { PreyID.ToString() }); | 775 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { PreyID.ToString() }); |
776 | 776 | ||
777 | if (friendSessions == null || friendSessions.Length == 0) | 777 | if (friendSessions == null || friendSessions.Length == 0) |
778 | return; | 778 | return; |
779 | 779 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs index c421740..81aa882 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs | |||
@@ -127,7 +127,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
127 | UserAccount account = m_FriendsModule.UserAccountService.GetUserAccount(UUID.Zero, fromID); | 127 | UserAccount account = m_FriendsModule.UserAccountService.GetUserAccount(UUID.Zero, fromID); |
128 | string name = (account == null) ? "Unknown" : account.FirstName + " " + account.LastName; | 128 | string name = (account == null) ? "Unknown" : account.FirstName + " " + account.LastName; |
129 | 129 | ||
130 | GridInstantMessage im = new GridInstantMessage(m_FriendsModule.Scene, fromID, name, toID, | 130 | GridInstantMessage im = new GridInstantMessage(m_FriendsModule.Scene, fromID, name, toID, |
131 | (byte)InstantMessageDialog.FriendshipOffered, message, false, Vector3.Zero); | 131 | (byte)InstantMessageDialog.FriendshipOffered, message, false, Vector3.Zero); |
132 | 132 | ||
133 | // !! HACK | 133 | // !! HACK |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs index 9954749..ac05a6e 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs | |||
@@ -539,8 +539,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
539 | // m_log.DebugFormat("[HGFRIENDS MODULE] HG Friendship! thisUUI={0}; friendUUI={1}; foreignThisFriendService={2}; foreignFriendFriendService={3}", | 539 | // m_log.DebugFormat("[HGFRIENDS MODULE] HG Friendship! thisUUI={0}; friendUUI={1}; foreignThisFriendService={2}; foreignFriendFriendService={3}", |
540 | // agentUUI, friendUUI, agentFriendService, friendFriendService); | 540 | // agentUUI, friendUUI, agentFriendService, friendFriendService); |
541 | 541 | ||
542 | } | 542 | } |
543 | 543 | ||
544 | // Delete any previous friendship relations | 544 | // Delete any previous friendship relations |
545 | DeletePreviousRelations(agentID, friendID); | 545 | DeletePreviousRelations(agentID, friendID); |
546 | 546 | ||
@@ -641,11 +641,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
641 | FriendsService.Delete(a1, f.Friend); | 641 | FriendsService.Delete(a1, f.Friend); |
642 | // and also the converse | 642 | // and also the converse |
643 | FriendsService.Delete(f.Friend, a1.ToString()); | 643 | FriendsService.Delete(f.Friend, a1.ToString()); |
644 | } | 644 | } |
645 | } | 645 | } |
646 | } | 646 | } |
647 | } | 647 | } |
648 | 648 | ||
649 | finfos = GetFriendsFromCache(a1); | 649 | finfos = GetFriendsFromCache(a1); |
650 | if (finfos != null) | 650 | if (finfos != null) |
651 | { | 651 | { |
@@ -658,7 +658,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
658 | FriendsService.Delete(a2, f.Friend); | 658 | FriendsService.Delete(a2, f.Friend); |
659 | // and also the converse | 659 | // and also the converse |
660 | FriendsService.Delete(f.Friend, a2.ToString()); | 660 | FriendsService.Delete(f.Friend, a2.ToString()); |
661 | } | 661 | } |
662 | } | 662 | } |
663 | } | 663 | } |
664 | } | 664 | } |
@@ -783,7 +783,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
783 | m_log.DebugFormat("[HGFRIENDS MODULE]: Forwading friendship from {0} to {1} @ {2}", agentID, friendID, friendsURL); | 783 | m_log.DebugFormat("[HGFRIENDS MODULE]: Forwading friendship from {0} to {1} @ {2}", agentID, friendID, friendsURL); |
784 | GridRegion region = new GridRegion(); | 784 | GridRegion region = new GridRegion(); |
785 | region.ServerURI = friendsURL; | 785 | region.ServerURI = friendsURL; |
786 | 786 | ||
787 | string name = im.fromAgentName; | 787 | string name = im.fromAgentName; |
788 | if (m_uMan.IsLocalGridUser(agentID)) | 788 | if (m_uMan.IsLocalGridUser(agentID)) |
789 | { | 789 | { |
@@ -815,7 +815,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
815 | } | 815 | } |
816 | 816 | ||
817 | m_HGFriendsConnector.FriendshipOffered(region, agentID, friendID, im.message, name); | 817 | m_HGFriendsConnector.FriendshipOffered(region, agentID, friendID, im.message, name); |
818 | 818 | ||
819 | return true; | 819 | return true; |
820 | } | 820 | } |
821 | } | 821 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGStatusNotifier.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGStatusNotifier.cs index 1fa4dd6..3fae271 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/HGStatusNotifier.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGStatusNotifier.cs | |||
@@ -32,7 +32,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
32 | { | 32 | { |
33 | if (kvp.Key != "local") | 33 | if (kvp.Key != "local") |
34 | { | 34 | { |
35 | // For the others, call the user agent service | 35 | // For the others, call the user agent service |
36 | List<string> ids = new List<string>(); | 36 | List<string> ids = new List<string>(); |
37 | foreach (FriendInfo f in kvp.Value) | 37 | foreach (FriendInfo f in kvp.Value) |
38 | ids.Add(f.Friend); | 38 | ids.Add(f.Friend); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs index e6fd54e..3d9bd35 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs | |||
@@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends.Tests | |||
67 | // so that different services and simulator can share the data in standalone mode. This is pretty horrible | 67 | // so that different services and simulator can share the data in standalone mode. This is pretty horrible |
68 | // effectively the statics are global variables. | 68 | // effectively the statics are global variables. |
69 | NullFriendsData.Clear(); | 69 | NullFriendsData.Clear(); |
70 | 70 | ||
71 | IConfigSource config = new IniConfigSource(); | 71 | IConfigSource config = new IniConfigSource(); |
72 | config.AddConfig("Modules"); | 72 | config.AddConfig("Modules"); |
73 | // Not strictly necessary since FriendsModule assumes it is the default (!) | 73 | // Not strictly necessary since FriendsModule assumes it is the default (!) |
diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs index 4efcd3b..03e2c5a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs | |||
@@ -42,11 +42,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures | |||
42 | { | 42 | { |
43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GesturesModule")] | 43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GesturesModule")] |
44 | public class GesturesModule : INonSharedRegionModule | 44 | public class GesturesModule : INonSharedRegionModule |
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 | protected Scene m_scene; | 48 | protected Scene m_scene; |
49 | 49 | ||
50 | public void Initialise(IConfigSource source) | 50 | public void Initialise(IConfigSource source) |
51 | { | 51 | { |
52 | } | 52 | } |
@@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures | |||
67 | m_scene.EventManager.OnNewClient -= OnNewClient; | 67 | m_scene.EventManager.OnNewClient -= OnNewClient; |
68 | m_scene = null; | 68 | m_scene = null; |
69 | } | 69 | } |
70 | 70 | ||
71 | public void Close() {} | 71 | public void Close() {} |
72 | public string Name { get { return "Gestures Module"; } } | 72 | public string Name { get { return "Gestures Module"; } } |
73 | 73 | ||
@@ -81,7 +81,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures | |||
81 | client.OnActivateGesture += ActivateGesture; | 81 | client.OnActivateGesture += ActivateGesture; |
82 | client.OnDeactivateGesture += DeactivateGesture; | 82 | client.OnDeactivateGesture += DeactivateGesture; |
83 | } | 83 | } |
84 | 84 | ||
85 | public virtual void ActivateGesture(IClientAPI client, UUID assetId, UUID gestureId) | 85 | public virtual void ActivateGesture(IClientAPI client, UUID assetId, UUID gestureId) |
86 | { | 86 | { |
87 | IInventoryService invService = m_scene.InventoryService; | 87 | IInventoryService invService = m_scene.InventoryService; |
@@ -92,7 +92,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures | |||
92 | item.Flags |= 1; | 92 | item.Flags |= 1; |
93 | invService.UpdateItem(item); | 93 | invService.UpdateItem(item); |
94 | } | 94 | } |
95 | else | 95 | else |
96 | m_log.WarnFormat( | 96 | m_log.WarnFormat( |
97 | "[GESTURES]: Unable to find gesture {0} to activate for {1}", gestureId, client.Name); | 97 | "[GESTURES]: Unable to find gesture {0} to activate for {1}", gestureId, client.Name); |
98 | } | 98 | } |
@@ -107,7 +107,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures | |||
107 | item.Flags &= ~(uint)1; | 107 | item.Flags &= ~(uint)1; |
108 | invService.UpdateItem(item); | 108 | invService.UpdateItem(item); |
109 | } | 109 | } |
110 | else | 110 | else |
111 | m_log.ErrorFormat( | 111 | m_log.ErrorFormat( |
112 | "[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name); | 112 | "[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name); |
113 | } | 113 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index db02379..8d3c10d 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | |||
@@ -112,19 +112,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
112 | client.OnGodKickUser += KickUser; | 112 | client.OnGodKickUser += KickUser; |
113 | client.OnRequestGodlikePowers += RequestGodlikePowers; | 113 | client.OnRequestGodlikePowers += RequestGodlikePowers; |
114 | } | 114 | } |
115 | 115 | ||
116 | public void UnsubscribeFromClientEvents(IClientAPI client) | 116 | public void UnsubscribeFromClientEvents(IClientAPI client) |
117 | { | 117 | { |
118 | client.OnGodKickUser -= KickUser; | 118 | client.OnGodKickUser -= KickUser; |
119 | client.OnRequestGodlikePowers -= RequestGodlikePowers; | 119 | client.OnRequestGodlikePowers -= RequestGodlikePowers; |
120 | } | 120 | } |
121 | 121 | ||
122 | private void OnRegisterCaps(UUID agentID, Caps caps) | 122 | private void OnRegisterCaps(UUID agentID, Caps caps) |
123 | { | 123 | { |
124 | string uri = "/CAPS/" + UUID.Random(); | 124 | string uri = "/CAPS/" + UUID.Random(); |
125 | 125 | ||
126 | caps.RegisterHandler( | 126 | caps.RegisterHandler( |
127 | "UntrustedSimulatorMessage", | 127 | "UntrustedSimulatorMessage", |
128 | new RestStreamHandler("POST", uri, HandleUntrustedSimulatorMessage, "UntrustedSimulatorMessage", null)); | 128 | new RestStreamHandler("POST", uri, HandleUntrustedSimulatorMessage, "UntrustedSimulatorMessage", null)); |
129 | } | 129 | } |
130 | 130 | ||
@@ -176,7 +176,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
176 | if (godLike && sp.GodLevel < 200 && DialogModule != null) | 176 | if (godLike && sp.GodLevel < 200 && DialogModule != null) |
177 | DialogModule.SendAlertToUser(agentID, "Request for god powers denied"); | 177 | DialogModule.SendAlertToUser(agentID, "Request for god powers denied"); |
178 | } | 178 | } |
179 | 179 | ||
180 | /// <summary> | 180 | /// <summary> |
181 | /// Kicks or freezes User specified from the simulator. This logs them off of the grid | 181 | /// Kicks or freezes User specified from the simulator. This logs them off of the grid |
182 | /// </summary> | 182 | /// </summary> |
@@ -261,7 +261,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
261 | if(sp.IsDeleted || sp.IsChildAgent) | 261 | if(sp.IsDeleted || sp.IsChildAgent) |
262 | return; | 262 | return; |
263 | sp.ControllingClient.Kick(reason); | 263 | sp.ControllingClient.Kick(reason); |
264 | sp.Scene.CloseAgent(sp.UUID, true); | 264 | sp.Scene.CloseAgent(sp.UUID, true); |
265 | } | 265 | } |
266 | 266 | ||
267 | private void OnIncomingInstantMessage(GridInstantMessage msg) | 267 | private void OnIncomingInstantMessage(GridInstantMessage msg) |
diff --git a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs index 543410e..7f91a61 100644 --- a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs | |||
@@ -145,7 +145,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups | |||
145 | return; | 145 | return; |
146 | 146 | ||
147 | // m_log.Debug("[GROUPS]: Shutting down group module."); | 147 | // m_log.Debug("[GROUPS]: Shutting down group module."); |
148 | 148 | ||
149 | lock (m_ClientMap) | 149 | lock (m_ClientMap) |
150 | { | 150 | { |
151 | m_ClientMap.Clear(); | 151 | m_ClientMap.Clear(); |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs index 63b3dba..16e2ec3 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs | |||
@@ -144,11 +144,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
144 | foreach (Scene scene in m_Scenes) | 144 | foreach (Scene scene in m_Scenes) |
145 | { | 145 | { |
146 | // m_log.DebugFormat( | 146 | // m_log.DebugFormat( |
147 | // "[HG INSTANT MESSAGE]: Looking for root agent {0} in {1}", | 147 | // "[HG INSTANT MESSAGE]: Looking for root agent {0} in {1}", |
148 | // toAgentID.ToString(), scene.RegionInfo.RegionName); | 148 | // toAgentID.ToString(), scene.RegionInfo.RegionName); |
149 | ScenePresence sp = scene.GetScenePresence(toAgentID); | 149 | ScenePresence sp = scene.GetScenePresence(toAgentID); |
150 | if (sp != null && !sp.IsChildAgent && !sp.IsDeleted) | 150 | if (sp != null && !sp.IsChildAgent && !sp.IsDeleted) |
151 | { | 151 | { |
152 | // Local message | 152 | // Local message |
153 | // m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID); | 153 | // m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID); |
154 | sp.ControllingClient.SendInstantMessage(im); | 154 | sp.ControllingClient.SendInstantMessage(im); |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs index 7d54a00..71c0a8a 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs | |||
@@ -49,7 +49,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
49 | /// Is this module enabled? | 49 | /// Is this module enabled? |
50 | /// </value> | 50 | /// </value> |
51 | protected bool m_enabled = false; | 51 | protected bool m_enabled = false; |
52 | 52 | ||
53 | protected readonly List<Scene> m_scenes = new List<Scene>(); | 53 | protected readonly List<Scene> m_scenes = new List<Scene>(); |
54 | 54 | ||
55 | #region Region Module interface | 55 | #region Region Module interface |
@@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
65 | "InstantMessageModule") | 65 | "InstantMessageModule") |
66 | return; | 66 | return; |
67 | } | 67 | } |
68 | 68 | ||
69 | m_enabled = true; | 69 | m_enabled = true; |
70 | } | 70 | } |
71 | 71 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index 6b120fb..efb9421 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs | |||
@@ -207,10 +207,10 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
207 | protected virtual XmlRpcResponse processXMLRPCGridInstantMessage(XmlRpcRequest request, IPEndPoint remoteClient) | 207 | protected virtual XmlRpcResponse processXMLRPCGridInstantMessage(XmlRpcRequest request, IPEndPoint remoteClient) |
208 | { | 208 | { |
209 | bool successful = false; | 209 | bool successful = false; |
210 | 210 | ||
211 | // TODO: For now, as IMs seem to be a bit unreliable on OSGrid, catch all exception that | 211 | // TODO: For now, as IMs seem to be a bit unreliable on OSGrid, catch all exception that |
212 | // happen here and aren't caught and log them. | 212 | // happen here and aren't caught and log them. |
213 | try | 213 | try |
214 | { | 214 | { |
215 | // various rational defaults | 215 | // various rational defaults |
216 | UUID fromAgentID = UUID.Zero; | 216 | UUID fromAgentID = UUID.Zero; |
@@ -475,7 +475,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
475 | /// </summary> | 475 | /// </summary> |
476 | 476 | ||
477 | /// <param name="prevRegionHandle"> | 477 | /// <param name="prevRegionHandle"> |
478 | /// Pass in 0 the first time this method is called. It will be called recursively with the last | 478 | /// Pass in 0 the first time this method is called. It will be called recursively with the last |
479 | /// regionhandle tried | 479 | /// regionhandle tried |
480 | /// </param> | 480 | /// </param> |
481 | private void SendGridInstantMessageViaXMLRPCAsyncMain(GridInstantMessage im, MessageResultNotification result) | 481 | private void SendGridInstantMessageViaXMLRPCAsyncMain(GridInstantMessage im, MessageResultNotification result) |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs index 315d372..2d57193 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs | |||
@@ -118,11 +118,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
118 | { | 118 | { |
119 | get { return null; } | 119 | get { return null; } |
120 | } | 120 | } |
121 | 121 | ||
122 | public void Close() | 122 | public void Close() |
123 | { | 123 | { |
124 | } | 124 | } |
125 | 125 | ||
126 | private void OnNewClient(IClientAPI client) | 126 | private void OnNewClient(IClientAPI client) |
127 | { | 127 | { |
128 | client.OnMuteListRequest += OnMuteListRequest; | 128 | client.OnMuteListRequest += OnMuteListRequest; |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index 369d480..d1f6054 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs | |||
@@ -146,7 +146,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
146 | { | 146 | { |
147 | get { return null; } | 147 | get { return null; } |
148 | } | 148 | } |
149 | 149 | ||
150 | public void Close() | 150 | public void Close() |
151 | { | 151 | { |
152 | } | 152 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 4a06fd1..3838316 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -56,7 +56,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
56 | /// bumps here should be compatible. | 56 | /// bumps here should be compatible. |
57 | /// </summary> | 57 | /// </summary> |
58 | public static int MAX_MAJOR_VERSION = 1; | 58 | public static int MAX_MAJOR_VERSION = 1; |
59 | 59 | ||
60 | protected TarArchiveReader archive; | 60 | protected TarArchiveReader archive; |
61 | 61 | ||
62 | private UserAccount m_userInfo; | 62 | private UserAccount m_userInfo; |
@@ -66,7 +66,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
66 | /// ID of this request | 66 | /// ID of this request |
67 | /// </value> | 67 | /// </value> |
68 | protected UUID m_id; | 68 | protected UUID m_id; |
69 | 69 | ||
70 | /// <summary> | 70 | /// <summary> |
71 | /// Do we want to merge this load with existing inventory? | 71 | /// Do we want to merge this load with existing inventory? |
72 | /// </summary> | 72 | /// </summary> |
@@ -82,41 +82,41 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
82 | /// The stream from which the inventory archive will be loaded. | 82 | /// The stream from which the inventory archive will be loaded. |
83 | /// </value> | 83 | /// </value> |
84 | private Stream m_loadStream; | 84 | private Stream m_loadStream; |
85 | 85 | ||
86 | /// <summary> | 86 | /// <summary> |
87 | /// Has the control file been loaded for this archive? | 87 | /// Has the control file been loaded for this archive? |
88 | /// </summary> | 88 | /// </summary> |
89 | public bool ControlFileLoaded { get; private set; } | 89 | public bool ControlFileLoaded { get; private set; } |
90 | 90 | ||
91 | /// <summary> | 91 | /// <summary> |
92 | /// Do we want to enforce the check. IAR versions before 0.2 and 1.1 do not guarantee this order, so we can't | 92 | /// Do we want to enforce the check. IAR versions before 0.2 and 1.1 do not guarantee this order, so we can't |
93 | /// enforce. | 93 | /// enforce. |
94 | /// </summary> | 94 | /// </summary> |
95 | public bool EnforceControlFileCheck { get; private set; } | 95 | public bool EnforceControlFileCheck { get; private set; } |
96 | 96 | ||
97 | protected bool m_assetsLoaded; | 97 | protected bool m_assetsLoaded; |
98 | protected bool m_inventoryNodesLoaded; | 98 | protected bool m_inventoryNodesLoaded; |
99 | 99 | ||
100 | protected int m_successfulAssetRestores; | 100 | protected int m_successfulAssetRestores; |
101 | protected int m_failedAssetRestores; | 101 | protected int m_failedAssetRestores; |
102 | protected int m_successfulItemRestores; | 102 | protected int m_successfulItemRestores; |
103 | 103 | ||
104 | /// <summary> | 104 | /// <summary> |
105 | /// Root destination folder for the IAR load. | 105 | /// Root destination folder for the IAR load. |
106 | /// </summary> | 106 | /// </summary> |
107 | protected InventoryFolderBase m_rootDestinationFolder; | 107 | protected InventoryFolderBase m_rootDestinationFolder; |
108 | 108 | ||
109 | /// <summary> | 109 | /// <summary> |
110 | /// Inventory nodes loaded from the iar. | 110 | /// Inventory nodes loaded from the iar. |
111 | /// </summary> | 111 | /// </summary> |
112 | protected HashSet<InventoryNodeBase> m_loadedNodes = new HashSet<InventoryNodeBase>(); | 112 | protected HashSet<InventoryNodeBase> m_loadedNodes = new HashSet<InventoryNodeBase>(); |
113 | 113 | ||
114 | /// <summary> | 114 | /// <summary> |
115 | /// In order to load identically named folders, we need to keep track of the folders that we have already | 115 | /// In order to load identically named folders, we need to keep track of the folders that we have already |
116 | /// resolved. | 116 | /// resolved. |
117 | /// </summary> | 117 | /// </summary> |
118 | Dictionary <string, InventoryFolderBase> m_resolvedFolders = new Dictionary<string, InventoryFolderBase>(); | 118 | Dictionary <string, InventoryFolderBase> m_resolvedFolders = new Dictionary<string, InventoryFolderBase>(); |
119 | 119 | ||
120 | /// <summary> | 120 | /// <summary> |
121 | /// Record the creator id that should be associated with an asset. This is used to adjust asset creator ids | 121 | /// Record the creator id that should be associated with an asset. This is used to adjust asset creator ids |
122 | /// after OSP resolution (since OSP creators are only stored in the item | 122 | /// after OSP resolution (since OSP creators are only stored in the item |
@@ -163,9 +163,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
163 | m_invPath = invPath; | 163 | m_invPath = invPath; |
164 | m_loadStream = loadStream; | 164 | m_loadStream = loadStream; |
165 | m_module = module; | 165 | m_module = module; |
166 | 166 | ||
167 | // FIXME: Do not perform this check since older versions of OpenSim do save the control file after other things | 167 | // FIXME: Do not perform this check since older versions of OpenSim do save the control file after other things |
168 | // (I thought they weren't). We will need to bump the version number and perform this check on all | 168 | // (I thought they weren't). We will need to bump the version number and perform this check on all |
169 | // subsequent IAR versions only | 169 | // subsequent IAR versions only |
170 | ControlFileLoaded = true; | 170 | ControlFileLoaded = true; |
171 | } | 171 | } |
@@ -188,19 +188,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
188 | Exception reportedException = null; | 188 | Exception reportedException = null; |
189 | 189 | ||
190 | string filePath = "ERROR"; | 190 | string filePath = "ERROR"; |
191 | 191 | ||
192 | List<InventoryFolderBase> folderCandidates | 192 | List<InventoryFolderBase> folderCandidates |
193 | = InventoryArchiveUtils.FindFoldersByPath( | 193 | = InventoryArchiveUtils.FindFoldersByPath( |
194 | m_InventoryService, m_userInfo.PrincipalID, m_invPath); | 194 | m_InventoryService, m_userInfo.PrincipalID, m_invPath); |
195 | 195 | ||
196 | if (folderCandidates.Count == 0) | 196 | if (folderCandidates.Count == 0) |
197 | { | 197 | { |
198 | // Possibly provide an option later on to automatically create this folder if it does not exist | 198 | // Possibly provide an option later on to automatically create this folder if it does not exist |
199 | m_log.ErrorFormat("[INVENTORY ARCHIVER]: Inventory path {0} does not exist", m_invPath); | 199 | m_log.ErrorFormat("[INVENTORY ARCHIVER]: Inventory path {0} does not exist", m_invPath); |
200 | 200 | ||
201 | return m_loadedNodes; | 201 | return m_loadedNodes; |
202 | } | 202 | } |
203 | 203 | ||
204 | m_rootDestinationFolder = folderCandidates[0]; | 204 | m_rootDestinationFolder = folderCandidates[0]; |
205 | archive = new TarArchiveReader(m_loadStream); | 205 | archive = new TarArchiveReader(m_loadStream); |
206 | byte[] data; | 206 | byte[] data; |
@@ -211,7 +211,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
211 | if (filePath == ArchiveConstants.CONTROL_FILE_PATH) | 211 | if (filePath == ArchiveConstants.CONTROL_FILE_PATH) |
212 | { | 212 | { |
213 | LoadControlFile(filePath, data); | 213 | LoadControlFile(filePath, data); |
214 | } | 214 | } |
215 | else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) | 215 | else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) |
216 | { | 216 | { |
217 | LoadAssetFile(filePath, data); | 217 | LoadAssetFile(filePath, data); |
@@ -221,17 +221,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
221 | LoadInventoryFile(filePath, entryType, data); | 221 | LoadInventoryFile(filePath, entryType, data); |
222 | } | 222 | } |
223 | } | 223 | } |
224 | 224 | ||
225 | archive.Close(); | 225 | archive.Close(); |
226 | 226 | ||
227 | m_log.DebugFormat( | 227 | m_log.DebugFormat( |
228 | "[INVENTORY ARCHIVER]: Successfully loaded {0} assets with {1} failures", | 228 | "[INVENTORY ARCHIVER]: Successfully loaded {0} assets with {1} failures", |
229 | m_successfulAssetRestores, m_failedAssetRestores); | 229 | m_successfulAssetRestores, m_failedAssetRestores); |
230 | 230 | ||
231 | //Alicia: When this is called by LibraryModule or Tests, m_module will be null as event is not required | 231 | //Alicia: When this is called by LibraryModule or Tests, m_module will be null as event is not required |
232 | if(m_module != null) | 232 | if(m_module != null) |
233 | m_module.TriggerInventoryArchiveLoaded(m_id, true, m_userInfo, m_invPath, m_loadStream, reportedException, m_successfulItemRestores); | 233 | m_module.TriggerInventoryArchiveLoaded(m_id, true, m_userInfo, m_invPath, m_loadStream, reportedException, m_successfulItemRestores); |
234 | 234 | ||
235 | return m_loadedNodes; | 235 | return m_loadedNodes; |
236 | } | 236 | } |
237 | catch(Exception Ex) | 237 | catch(Exception Ex) |
@@ -268,8 +268,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
268 | /// </param> | 268 | /// </param> |
269 | /// <returns>The last user inventory folder created or found for the archive path</returns> | 269 | /// <returns>The last user inventory folder created or found for the archive path</returns> |
270 | public InventoryFolderBase ReplicateArchivePathToUserInventory( | 270 | public InventoryFolderBase ReplicateArchivePathToUserInventory( |
271 | string iarPath, | 271 | string iarPath, |
272 | InventoryFolderBase rootDestFolder, | 272 | InventoryFolderBase rootDestFolder, |
273 | Dictionary <string, InventoryFolderBase> resolvedFolders, | 273 | Dictionary <string, InventoryFolderBase> resolvedFolders, |
274 | HashSet<InventoryNodeBase> loadedNodes) | 274 | HashSet<InventoryNodeBase> loadedNodes) |
275 | { | 275 | { |
@@ -277,27 +277,27 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
277 | 277 | ||
278 | // m_log.DebugFormat( | 278 | // m_log.DebugFormat( |
279 | // "[INVENTORY ARCHIVER]: Loading folder {0} {1}", rootDestFolder.Name, rootDestFolder.ID); | 279 | // "[INVENTORY ARCHIVER]: Loading folder {0} {1}", rootDestFolder.Name, rootDestFolder.ID); |
280 | 280 | ||
281 | InventoryFolderBase destFolder | 281 | InventoryFolderBase destFolder |
282 | = ResolveDestinationFolder(rootDestFolder, ref iarPathExisting, resolvedFolders); | 282 | = ResolveDestinationFolder(rootDestFolder, ref iarPathExisting, resolvedFolders); |
283 | 283 | ||
284 | // m_log.DebugFormat( | 284 | // m_log.DebugFormat( |
285 | // "[INVENTORY ARCHIVER]: originalArchivePath [{0}], section already loaded [{1}]", | 285 | // "[INVENTORY ARCHIVER]: originalArchivePath [{0}], section already loaded [{1}]", |
286 | // iarPath, iarPathExisting); | 286 | // iarPath, iarPathExisting); |
287 | 287 | ||
288 | string iarPathToCreate = iarPath.Substring(iarPathExisting.Length); | 288 | string iarPathToCreate = iarPath.Substring(iarPathExisting.Length); |
289 | CreateFoldersForPath(destFolder, iarPathExisting, iarPathToCreate, resolvedFolders, loadedNodes); | 289 | CreateFoldersForPath(destFolder, iarPathExisting, iarPathToCreate, resolvedFolders, loadedNodes); |
290 | 290 | ||
291 | return destFolder; | 291 | return destFolder; |
292 | } | 292 | } |
293 | 293 | ||
294 | /// <summary> | 294 | /// <summary> |
295 | /// Resolve a destination folder | 295 | /// Resolve a destination folder |
296 | /// </summary> | 296 | /// </summary> |
297 | /// | 297 | /// |
298 | /// We require here a root destination folder (usually the root of the user's inventory) and the archive | 298 | /// We require here a root destination folder (usually the root of the user's inventory) and the archive |
299 | /// path. We also pass in a list of previously resolved folders in case we've found this one previously. | 299 | /// path. We also pass in a list of previously resolved folders in case we've found this one previously. |
300 | /// | 300 | /// |
301 | /// <param name="archivePath"> | 301 | /// <param name="archivePath"> |
302 | /// The item archive path to resolve. The portion of the path passed back is that | 302 | /// The item archive path to resolve. The portion of the path passed back is that |
303 | /// which corresponds to the resolved desintation folder. | 303 | /// which corresponds to the resolved desintation folder. |
@@ -321,7 +321,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
321 | while (archivePath.Length > 0) | 321 | while (archivePath.Length > 0) |
322 | { | 322 | { |
323 | // m_log.DebugFormat("[INVENTORY ARCHIVER]: Trying to resolve destination folder {0}", archivePath); | 323 | // m_log.DebugFormat("[INVENTORY ARCHIVER]: Trying to resolve destination folder {0}", archivePath); |
324 | 324 | ||
325 | if (resolvedFolders.ContainsKey(archivePath)) | 325 | if (resolvedFolders.ContainsKey(archivePath)) |
326 | { | 326 | { |
327 | // m_log.DebugFormat( | 327 | // m_log.DebugFormat( |
@@ -332,13 +332,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
332 | { | 332 | { |
333 | if (m_merge) | 333 | if (m_merge) |
334 | { | 334 | { |
335 | // TODO: Using m_invPath is totally wrong - what we need to do is strip the uuid from the | 335 | // TODO: Using m_invPath is totally wrong - what we need to do is strip the uuid from the |
336 | // iar name and try to find that instead. | 336 | // iar name and try to find that instead. |
337 | string plainPath = ArchiveConstants.ExtractPlainPathFromIarPath(archivePath); | 337 | string plainPath = ArchiveConstants.ExtractPlainPathFromIarPath(archivePath); |
338 | List<InventoryFolderBase> folderCandidates | 338 | List<InventoryFolderBase> folderCandidates |
339 | = InventoryArchiveUtils.FindFoldersByPath( | 339 | = InventoryArchiveUtils.FindFoldersByPath( |
340 | m_InventoryService, m_userInfo.PrincipalID, plainPath); | 340 | m_InventoryService, m_userInfo.PrincipalID, plainPath); |
341 | 341 | ||
342 | if (folderCandidates.Count != 0) | 342 | if (folderCandidates.Count != 0) |
343 | { | 343 | { |
344 | InventoryFolderBase destFolder = folderCandidates[0]; | 344 | InventoryFolderBase destFolder = folderCandidates[0]; |
@@ -346,7 +346,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
346 | return destFolder; | 346 | return destFolder; |
347 | } | 347 | } |
348 | } | 348 | } |
349 | 349 | ||
350 | // Don't include the last slash so find the penultimate one | 350 | // Don't include the last slash so find the penultimate one |
351 | int penultimateSlashIndex = archivePath.LastIndexOf("/", archivePath.Length - 2); | 351 | int penultimateSlashIndex = archivePath.LastIndexOf("/", archivePath.Length - 2); |
352 | 352 | ||
@@ -365,10 +365,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
365 | } | 365 | } |
366 | } | 366 | } |
367 | } | 367 | } |
368 | 368 | ||
369 | return rootDestFolder; | 369 | return rootDestFolder; |
370 | } | 370 | } |
371 | 371 | ||
372 | /// <summary> | 372 | /// <summary> |
373 | /// Create a set of folders for the given path. | 373 | /// Create a set of folders for the given path. |
374 | /// </summary> | 374 | /// </summary> |
@@ -388,10 +388,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
388 | /// Track the inventory nodes created. | 388 | /// Track the inventory nodes created. |
389 | /// </param> | 389 | /// </param> |
390 | protected void CreateFoldersForPath( | 390 | protected void CreateFoldersForPath( |
391 | InventoryFolderBase destFolder, | 391 | InventoryFolderBase destFolder, |
392 | string iarPathExisting, | 392 | string iarPathExisting, |
393 | string iarPathToReplicate, | 393 | string iarPathToReplicate, |
394 | Dictionary <string, InventoryFolderBase> resolvedFolders, | 394 | Dictionary <string, InventoryFolderBase> resolvedFolders, |
395 | HashSet<InventoryNodeBase> loadedNodes) | 395 | HashSet<InventoryNodeBase> loadedNodes) |
396 | { | 396 | { |
397 | string[] rawDirsToCreate = iarPathToReplicate.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); | 397 | string[] rawDirsToCreate = iarPathToReplicate.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); |
@@ -402,7 +402,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
402 | 402 | ||
403 | if (!rawDirsToCreate[i].Contains(ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR)) | 403 | if (!rawDirsToCreate[i].Contains(ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR)) |
404 | continue; | 404 | continue; |
405 | 405 | ||
406 | int identicalNameIdentifierIndex | 406 | int identicalNameIdentifierIndex |
407 | = rawDirsToCreate[i].LastIndexOf( | 407 | = rawDirsToCreate[i].LastIndexOf( |
408 | ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR); | 408 | ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR); |
@@ -412,7 +412,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
412 | newFolderName = InventoryArchiveUtils.UnescapeArchivePath(newFolderName); | 412 | newFolderName = InventoryArchiveUtils.UnescapeArchivePath(newFolderName); |
413 | UUID newFolderId = UUID.Random(); | 413 | UUID newFolderId = UUID.Random(); |
414 | 414 | ||
415 | destFolder | 415 | destFolder |
416 | = new InventoryFolderBase( | 416 | = new InventoryFolderBase( |
417 | newFolderId, newFolderName, m_userInfo.PrincipalID, | 417 | newFolderId, newFolderName, m_userInfo.PrincipalID, |
418 | (short)FolderType.None, destFolder.ID, 1); | 418 | (short)FolderType.None, destFolder.ID, 1); |
@@ -427,7 +427,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
427 | loadedNodes.Add(destFolder); | 427 | loadedNodes.Add(destFolder); |
428 | } | 428 | } |
429 | } | 429 | } |
430 | 430 | ||
431 | /// <summary> | 431 | /// <summary> |
432 | /// Load an item from the archive | 432 | /// Load an item from the archive |
433 | /// </summary> | 433 | /// </summary> |
@@ -438,7 +438,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
438 | protected InventoryItemBase LoadItem(byte[] data, InventoryFolderBase loadFolder) | 438 | protected InventoryItemBase LoadItem(byte[] data, InventoryFolderBase loadFolder) |
439 | { | 439 | { |
440 | InventoryItemBase item = UserInventoryItemSerializer.Deserialize(data); | 440 | InventoryItemBase item = UserInventoryItemSerializer.Deserialize(data); |
441 | 441 | ||
442 | // Don't use the item ID that's in the file | 442 | // Don't use the item ID that's in the file |
443 | item.ID = UUID.Random(); | 443 | item.ID = UUID.Random(); |
444 | 444 | ||
@@ -446,7 +446,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
446 | if (UUID.Zero != ospResolvedId) // The user exists in this grid | 446 | if (UUID.Zero != ospResolvedId) // The user exists in this grid |
447 | { | 447 | { |
448 | // m_log.DebugFormat("[INVENTORY ARCHIVER]: Found creator {0} via OSPA resolution", ospResolvedId); | 448 | // m_log.DebugFormat("[INVENTORY ARCHIVER]: Found creator {0} via OSPA resolution", ospResolvedId); |
449 | 449 | ||
450 | // item.CreatorIdAsUuid = ospResolvedId; | 450 | // item.CreatorIdAsUuid = ospResolvedId; |
451 | 451 | ||
452 | // Don't preserve the OSPA in the creator id (which actually gets persisted to the | 452 | // Don't preserve the OSPA in the creator id (which actually gets persisted to the |
@@ -474,7 +474,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
474 | 474 | ||
475 | if (!m_InventoryService.AddItem(item)) | 475 | if (!m_InventoryService.AddItem(item)) |
476 | m_log.WarnFormat("[INVENTORY ARCHIVER]: Unable to save item {0} in folder {1}", item.Name, item.Folder); | 476 | m_log.WarnFormat("[INVENTORY ARCHIVER]: Unable to save item {0} in folder {1}", item.Name, item.Folder); |
477 | 477 | ||
478 | return item; | 478 | return item; |
479 | } | 479 | } |
480 | 480 | ||
@@ -519,7 +519,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
519 | data = SceneObjectSerializer.ModifySerializedObject(assetId, data, | 519 | data = SceneObjectSerializer.ModifySerializedObject(assetId, data, |
520 | sog => { | 520 | sog => { |
521 | bool modified = false; | 521 | bool modified = false; |
522 | 522 | ||
523 | foreach (SceneObjectPart sop in sog.Parts) | 523 | foreach (SceneObjectPart sop in sog.Parts) |
524 | { | 524 | { |
525 | if (string.IsNullOrEmpty(sop.CreatorData)) | 525 | if (string.IsNullOrEmpty(sop.CreatorData)) |
@@ -528,10 +528,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
528 | modified = true; | 528 | modified = true; |
529 | } | 529 | } |
530 | } | 530 | } |
531 | 531 | ||
532 | return modified; | 532 | return modified; |
533 | }); | 533 | }); |
534 | 534 | ||
535 | if (data == null) | 535 | if (data == null) |
536 | return false; | 536 | return false; |
537 | } | 537 | } |
@@ -568,7 +568,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
568 | int majorVersion = int.Parse(archiveElement.Attribute("major_version").Value); | 568 | int majorVersion = int.Parse(archiveElement.Attribute("major_version").Value); |
569 | int minorVersion = int.Parse(archiveElement.Attribute("minor_version").Value); | 569 | int minorVersion = int.Parse(archiveElement.Attribute("minor_version").Value); |
570 | string version = string.Format("{0}.{1}", majorVersion, minorVersion); | 570 | string version = string.Format("{0}.{1}", majorVersion, minorVersion); |
571 | 571 | ||
572 | if (majorVersion > MAX_MAJOR_VERSION) | 572 | if (majorVersion > MAX_MAJOR_VERSION) |
573 | { | 573 | { |
574 | throw new Exception( | 574 | throw new Exception( |
@@ -576,38 +576,38 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
576 | "The IAR you are trying to load has major version number of {0} but this version of OpenSim can only load IARs with major version number {1} and below", | 576 | "The IAR you are trying to load has major version number of {0} but this version of OpenSim can only load IARs with major version number {1} and below", |
577 | majorVersion, MAX_MAJOR_VERSION)); | 577 | majorVersion, MAX_MAJOR_VERSION)); |
578 | } | 578 | } |
579 | 579 | ||
580 | ControlFileLoaded = true; | 580 | ControlFileLoaded = true; |
581 | m_log.InfoFormat("[INVENTORY ARCHIVER]: Loading IAR with version {0}", version); | 581 | m_log.InfoFormat("[INVENTORY ARCHIVER]: Loading IAR with version {0}", version); |
582 | } | 582 | } |
583 | 583 | ||
584 | /// <summary> | 584 | /// <summary> |
585 | /// Load inventory file | 585 | /// Load inventory file |
586 | /// </summary> | 586 | /// </summary> |
587 | /// <param name="path"></param> | 587 | /// <param name="path"></param> |
588 | /// <param name="entryType"></param> | 588 | /// <param name="entryType"></param> |
589 | /// <param name="data"></param> | 589 | /// <param name="data"></param> |
590 | protected void LoadInventoryFile(string path, TarArchiveReader.TarEntryType entryType, byte[] data) | 590 | protected void LoadInventoryFile(string path, TarArchiveReader.TarEntryType entryType, byte[] data) |
591 | { | 591 | { |
592 | if (!ControlFileLoaded) | 592 | if (!ControlFileLoaded) |
593 | throw new Exception( | 593 | throw new Exception( |
594 | string.Format( | 594 | string.Format( |
595 | "The IAR you are trying to load does not list {0} before {1}. Aborting load", | 595 | "The IAR you are trying to load does not list {0} before {1}. Aborting load", |
596 | ArchiveConstants.CONTROL_FILE_PATH, ArchiveConstants.INVENTORY_PATH)); | 596 | ArchiveConstants.CONTROL_FILE_PATH, ArchiveConstants.INVENTORY_PATH)); |
597 | 597 | ||
598 | if (m_assetsLoaded) | 598 | if (m_assetsLoaded) |
599 | throw new Exception( | 599 | throw new Exception( |
600 | string.Format( | 600 | string.Format( |
601 | "The IAR you are trying to load does not list all {0} before {1}. Aborting load", | 601 | "The IAR you are trying to load does not list all {0} before {1}. Aborting load", |
602 | ArchiveConstants.INVENTORY_PATH, ArchiveConstants.ASSETS_PATH)); | 602 | ArchiveConstants.INVENTORY_PATH, ArchiveConstants.ASSETS_PATH)); |
603 | 603 | ||
604 | path = path.Substring(ArchiveConstants.INVENTORY_PATH.Length); | 604 | path = path.Substring(ArchiveConstants.INVENTORY_PATH.Length); |
605 | 605 | ||
606 | // Trim off the file portion if we aren't already dealing with a directory path | 606 | // Trim off the file portion if we aren't already dealing with a directory path |
607 | if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY != entryType) | 607 | if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY != entryType) |
608 | path = path.Remove(path.LastIndexOf("/") + 1); | 608 | path = path.Remove(path.LastIndexOf("/") + 1); |
609 | 609 | ||
610 | InventoryFolderBase foundFolder | 610 | InventoryFolderBase foundFolder |
611 | = ReplicateArchivePathToUserInventory( | 611 | = ReplicateArchivePathToUserInventory( |
612 | path, m_rootDestinationFolder, m_resolvedFolders, m_loadedNodes); | 612 | path, m_rootDestinationFolder, m_resolvedFolders, m_loadedNodes); |
613 | 613 | ||
@@ -618,17 +618,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
618 | if (item != null) | 618 | if (item != null) |
619 | { | 619 | { |
620 | m_successfulItemRestores++; | 620 | m_successfulItemRestores++; |
621 | 621 | ||
622 | // If we aren't loading the folder containing the item then well need to update the | 622 | // If we aren't loading the folder containing the item then well need to update the |
623 | // viewer separately for that item. | 623 | // viewer separately for that item. |
624 | if (!m_loadedNodes.Contains(foundFolder)) | 624 | if (!m_loadedNodes.Contains(foundFolder)) |
625 | m_loadedNodes.Add(item); | 625 | m_loadedNodes.Add(item); |
626 | } | 626 | } |
627 | } | 627 | } |
628 | 628 | ||
629 | m_inventoryNodesLoaded = true; | 629 | m_inventoryNodesLoaded = true; |
630 | } | 630 | } |
631 | 631 | ||
632 | /// <summary> | 632 | /// <summary> |
633 | /// Load asset file | 633 | /// Load asset file |
634 | /// </summary> | 634 | /// </summary> |
@@ -639,15 +639,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
639 | if (!ControlFileLoaded) | 639 | if (!ControlFileLoaded) |
640 | throw new Exception( | 640 | throw new Exception( |
641 | string.Format( | 641 | string.Format( |
642 | "The IAR you are trying to load does not list {0} before {1}. Aborting load", | 642 | "The IAR you are trying to load does not list {0} before {1}. Aborting load", |
643 | ArchiveConstants.CONTROL_FILE_PATH, ArchiveConstants.ASSETS_PATH)); | 643 | ArchiveConstants.CONTROL_FILE_PATH, ArchiveConstants.ASSETS_PATH)); |
644 | 644 | ||
645 | if (!m_inventoryNodesLoaded) | 645 | if (!m_inventoryNodesLoaded) |
646 | throw new Exception( | 646 | throw new Exception( |
647 | string.Format( | 647 | string.Format( |
648 | "The IAR you are trying to load does not list all {0} before {1}. Aborting load", | 648 | "The IAR you are trying to load does not list all {0} before {1}. Aborting load", |
649 | ArchiveConstants.INVENTORY_PATH, ArchiveConstants.ASSETS_PATH)); | 649 | ArchiveConstants.INVENTORY_PATH, ArchiveConstants.ASSETS_PATH)); |
650 | 650 | ||
651 | if (LoadAsset(path, data)) | 651 | if (LoadAsset(path, data)) |
652 | m_successfulAssetRestores++; | 652 | m_successfulAssetRestores++; |
653 | else | 653 | else |
@@ -655,10 +655,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
655 | 655 | ||
656 | if ((m_successfulAssetRestores) % 50 == 0) | 656 | if ((m_successfulAssetRestores) % 50 == 0) |
657 | m_log.DebugFormat( | 657 | m_log.DebugFormat( |
658 | "[INVENTORY ARCHIVER]: Loaded {0} assets...", | 658 | "[INVENTORY ARCHIVER]: Loaded {0} assets...", |
659 | m_successfulAssetRestores); | 659 | m_successfulAssetRestores); |
660 | 660 | ||
661 | m_assetsLoaded = true; | 661 | m_assetsLoaded = true; |
662 | } | 662 | } |
663 | } | 663 | } |
664 | } | 664 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs index dbaf2aa..b66aad5 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs | |||
@@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
69 | /// The path to the required folder. | 69 | /// The path to the required folder. |
70 | /// It this is empty or consists only of the PATH_DELIMTER then this folder itself is returned. | 70 | /// It this is empty or consists only of the PATH_DELIMTER then this folder itself is returned. |
71 | /// </param> | 71 | /// </param> |
72 | /// <returns>The folder found. Please note that if there are multiple folders with the same name then an | 72 | /// <returns>The folder found. Please note that if there are multiple folders with the same name then an |
73 | /// unspecified one will be returned. If no such folder eixsts then null is returned</returns> | 73 | /// unspecified one will be returned. If no such folder eixsts then null is returned</returns> |
74 | public static InventoryFolderBase FindFolderByPath( | 74 | public static InventoryFolderBase FindFolderByPath( |
75 | IInventoryService inventoryService, UUID userId, string path) | 75 | IInventoryService inventoryService, UUID userId, string path) |
@@ -102,7 +102,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
102 | /// The path to the required folder. | 102 | /// The path to the required folder. |
103 | /// It this is empty or consists only of the PATH_DELIMTER then this folder itself is returned. | 103 | /// It this is empty or consists only of the PATH_DELIMTER then this folder itself is returned. |
104 | /// </param> | 104 | /// </param> |
105 | /// <returns>The folder found. Please note that if there are multiple folders with the same name then an | 105 | /// <returns>The folder found. Please note that if there are multiple folders with the same name then an |
106 | /// unspecified one will be returned. If no such folder eixsts then null is returned</returns> | 106 | /// unspecified one will be returned. If no such folder eixsts then null is returned</returns> |
107 | public static InventoryFolderBase FindFolderByPath( | 107 | public static InventoryFolderBase FindFolderByPath( |
108 | IInventoryService inventoryService, InventoryFolderBase startFolder, string path) | 108 | IInventoryService inventoryService, InventoryFolderBase startFolder, string path) |
@@ -149,7 +149,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
149 | 149 | ||
150 | return FindFoldersByPath(inventoryService, rootFolder, path); | 150 | return FindFoldersByPath(inventoryService, rootFolder, path); |
151 | } | 151 | } |
152 | 152 | ||
153 | /// <summary> | 153 | /// <summary> |
154 | /// Find a set of folders given a PATH_DELIMITER delimited path starting from this folder | 154 | /// Find a set of folders given a PATH_DELIMITER delimited path starting from this folder |
155 | /// </summary> | 155 | /// </summary> |
@@ -175,7 +175,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
175 | IInventoryService inventoryService, InventoryFolderBase startFolder, string path) | 175 | IInventoryService inventoryService, InventoryFolderBase startFolder, string path) |
176 | { | 176 | { |
177 | List<InventoryFolderBase> foundFolders = new List<InventoryFolderBase>(); | 177 | List<InventoryFolderBase> foundFolders = new List<InventoryFolderBase>(); |
178 | 178 | ||
179 | if (path == string.Empty) | 179 | if (path == string.Empty) |
180 | { | 180 | { |
181 | foundFolders.Add(startFolder); | 181 | foundFolders.Add(startFolder); |
@@ -189,17 +189,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
189 | foundFolders.Add(startFolder); | 189 | foundFolders.Add(startFolder); |
190 | return foundFolders; | 190 | return foundFolders; |
191 | } | 191 | } |
192 | 192 | ||
193 | // If the path isn't just / then trim any starting extraneous slashes | 193 | // If the path isn't just / then trim any starting extraneous slashes |
194 | path = path.TrimStart(new char[] { PATH_DELIMITER }); | 194 | path = path.TrimStart(new char[] { PATH_DELIMITER }); |
195 | 195 | ||
196 | // m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Adjusted path in FindFolderByPath() is [{0}]", path); | 196 | // m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Adjusted path in FindFolderByPath() is [{0}]", path); |
197 | 197 | ||
198 | string[] components = SplitEscapedPath(path); | 198 | string[] components = SplitEscapedPath(path); |
199 | components[0] = UnescapePath(components[0]); | 199 | components[0] = UnescapePath(components[0]); |
200 | 200 | ||
201 | //string[] components = path.Split(new string[] { PATH_DELIMITER.ToString() }, 2, StringSplitOptions.None); | 201 | //string[] components = path.Split(new string[] { PATH_DELIMITER.ToString() }, 2, StringSplitOptions.None); |
202 | 202 | ||
203 | InventoryCollection contents = inventoryService.GetFolderContent(startFolder.Owner, startFolder.ID); | 203 | InventoryCollection contents = inventoryService.GetFolderContent(startFolder.Owner, startFolder.ID); |
204 | 204 | ||
205 | // m_log.DebugFormat( | 205 | // m_log.DebugFormat( |
@@ -230,7 +230,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
230 | /// | 230 | /// |
231 | /// FIXME: Delimitors which occur in names themselves are not currently escapable. | 231 | /// FIXME: Delimitors which occur in names themselves are not currently escapable. |
232 | /// </remarks> | 232 | /// </remarks> |
233 | /// | 233 | /// |
234 | /// <param name="inventoryService"> | 234 | /// <param name="inventoryService"> |
235 | /// Inventory service to query | 235 | /// Inventory service to query |
236 | /// </param> | 236 | /// </param> |
@@ -301,7 +301,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
301 | /// | 301 | /// |
302 | /// FIXME: Delimitors which occur in names themselves are not currently escapable. | 302 | /// FIXME: Delimitors which occur in names themselves are not currently escapable. |
303 | /// </remarks> | 303 | /// </remarks> |
304 | /// | 304 | /// |
305 | /// <param name="inventoryService">Inventory service to query</param> | 305 | /// <param name="inventoryService">Inventory service to query</param> |
306 | /// <param name="startFolder">The folder from which the path starts</param> | 306 | /// <param name="startFolder">The folder from which the path starts</param> |
307 | /// <param name="path">The path to the required item.</param> | 307 | /// <param name="path">The path to the required item.</param> |
@@ -313,10 +313,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
313 | 313 | ||
314 | // If the path isn't just / then trim any starting extraneous slashes | 314 | // If the path isn't just / then trim any starting extraneous slashes |
315 | path = path.TrimStart(new char[] { PATH_DELIMITER }); | 315 | path = path.TrimStart(new char[] { PATH_DELIMITER }); |
316 | 316 | ||
317 | string[] components = SplitEscapedPath(path); | 317 | string[] components = SplitEscapedPath(path); |
318 | components[0] = UnescapePath(components[0]); | 318 | components[0] = UnescapePath(components[0]); |
319 | 319 | ||
320 | //string[] components = path.Split(new string[] { PATH_DELIMITER }, 2, StringSplitOptions.None); | 320 | //string[] components = path.Split(new string[] { PATH_DELIMITER }, 2, StringSplitOptions.None); |
321 | 321 | ||
322 | if (components.Length == 1) | 322 | if (components.Length == 1) |
@@ -324,15 +324,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
324 | // m_log.DebugFormat( | 324 | // m_log.DebugFormat( |
325 | // "FOUND SINGLE COMPONENT [{0}]. Looking for this in [{1}] {2}", | 325 | // "FOUND SINGLE COMPONENT [{0}]. Looking for this in [{1}] {2}", |
326 | // components[0], startFolder.Name, startFolder.ID); | 326 | // components[0], startFolder.Name, startFolder.ID); |
327 | 327 | ||
328 | List<InventoryItemBase> items = inventoryService.GetFolderItems(startFolder.Owner, startFolder.ID); | 328 | List<InventoryItemBase> items = inventoryService.GetFolderItems(startFolder.Owner, startFolder.ID); |
329 | 329 | ||
330 | // m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Found {0} items in FindItemByPath()", items.Count); | 330 | // m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Found {0} items in FindItemByPath()", items.Count); |
331 | 331 | ||
332 | foreach (InventoryItemBase item in items) | 332 | foreach (InventoryItemBase item in items) |
333 | { | 333 | { |
334 | // m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Inspecting item {0} {1}", item.Name, item.ID); | 334 | // m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Inspecting item {0} {1}", item.Name, item.ID); |
335 | 335 | ||
336 | if (item.Name == components[0]) | 336 | if (item.Name == components[0]) |
337 | foundItems.Add(item); | 337 | foundItems.Add(item); |
338 | } | 338 | } |
@@ -342,7 +342,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
342 | // m_log.DebugFormat("FOUND COMPONENTS [{0}] and [{1}]", components[0], components[1]); | 342 | // m_log.DebugFormat("FOUND COMPONENTS [{0}] and [{1}]", components[0], components[1]); |
343 | 343 | ||
344 | InventoryCollection contents = inventoryService.GetFolderContent(startFolder.Owner, startFolder.ID); | 344 | InventoryCollection contents = inventoryService.GetFolderContent(startFolder.Owner, startFolder.ID); |
345 | 345 | ||
346 | foreach (InventoryFolderBase folder in contents.Folders) | 346 | foreach (InventoryFolderBase folder in contents.Folders) |
347 | { | 347 | { |
348 | if (folder.Name == components[0]) | 348 | if (folder.Name == components[0]) |
@@ -365,9 +365,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
365 | public static string[] SplitEscapedPath(string path) | 365 | public static string[] SplitEscapedPath(string path) |
366 | { | 366 | { |
367 | // m_log.DebugFormat("SPLITTING PATH {0}", path); | 367 | // m_log.DebugFormat("SPLITTING PATH {0}", path); |
368 | 368 | ||
369 | bool singleEscapeChar = false; | 369 | bool singleEscapeChar = false; |
370 | 370 | ||
371 | for (int i = 0; i < path.Length; i++) | 371 | for (int i = 0; i < path.Length; i++) |
372 | { | 372 | { |
373 | if (path[i] == ESCAPE_CHARACTER && !singleEscapeChar) | 373 | if (path[i] == ESCAPE_CHARACTER && !singleEscapeChar) |
@@ -395,7 +395,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
395 | public static string UnescapePath(string path) | 395 | public static string UnescapePath(string path) |
396 | { | 396 | { |
397 | // m_log.DebugFormat("ESCAPING PATH {0}", path); | 397 | // m_log.DebugFormat("ESCAPING PATH {0}", path); |
398 | 398 | ||
399 | StringBuilder sb = new StringBuilder(); | 399 | StringBuilder sb = new StringBuilder(); |
400 | 400 | ||
401 | bool singleEscapeChar = false; | 401 | bool singleEscapeChar = false; |
@@ -418,7 +418,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
418 | } | 418 | } |
419 | 419 | ||
420 | // m_log.DebugFormat("ESCAPED PATH TO {0}", sb); | 420 | // m_log.DebugFormat("ESCAPED PATH TO {0}", sb); |
421 | 421 | ||
422 | return sb.ToString(); | 422 | return sb.ToString(); |
423 | } | 423 | } |
424 | 424 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index 8847414..be59eb5 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs | |||
@@ -172,7 +172,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
172 | 172 | ||
173 | public string Name { get { return "Inventory Archiver Module"; } } | 173 | public string Name { get { return "Inventory Archiver Module"; } } |
174 | 174 | ||
175 | #endregion | 175 | #endregion |
176 | 176 | ||
177 | /// <summary> | 177 | /// <summary> |
178 | /// Trigger the inventory archive saved event. | 178 | /// Trigger the inventory archive saved event. |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs index c2e645f..f559c2e 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs | |||
@@ -56,23 +56,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
56 | { | 56 | { |
57 | TestHelpers.InMethod(); | 57 | TestHelpers.InMethod(); |
58 | // log4net.Config.XmlConfigurator.Configure(); | 58 | // log4net.Config.XmlConfigurator.Configure(); |
59 | 59 | ||
60 | SerialiserModule serialiserModule = new SerialiserModule(); | 60 | SerialiserModule serialiserModule = new SerialiserModule(); |
61 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); | 61 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); |
62 | 62 | ||
63 | // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene | 63 | // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene |
64 | Scene scene = new SceneHelpers().SetupScene(); | 64 | Scene scene = new SceneHelpers().SetupScene(); |
65 | 65 | ||
66 | SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); | 66 | SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); |
67 | 67 | ||
68 | UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "meowfood"); | 68 | UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "meowfood"); |
69 | UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); | 69 | UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); |
70 | 70 | ||
71 | archiverModule.DearchiveInventory(UUID.Random(), m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream); | 71 | archiverModule.DearchiveInventory(UUID.Random(), m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream); |
72 | InventoryItemBase foundItem1 | 72 | InventoryItemBase foundItem1 |
73 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_uaMT.PrincipalID, m_item1Name); | 73 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_uaMT.PrincipalID, m_item1Name); |
74 | 74 | ||
75 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); | 75 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); |
76 | 76 | ||
77 | // Now try loading to a root child folder | 77 | // Now try loading to a root child folder |
78 | UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, m_uaMT.PrincipalID, "xA", false); | 78 | UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, m_uaMT.PrincipalID, "xA", false); |
@@ -90,9 +90,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
90 | 90 | ||
91 | InventoryItemBase foundItem3 | 91 | InventoryItemBase foundItem3 |
92 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_uaMT.PrincipalID, "xB/xC/" + m_item1Name); | 92 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_uaMT.PrincipalID, "xB/xC/" + m_item1Name); |
93 | Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3"); | 93 | Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3"); |
94 | } | 94 | } |
95 | 95 | ||
96 | /// <summary> | 96 | /// <summary> |
97 | /// Test that things work when the load path specified starts with a slash | 97 | /// Test that things work when the load path specified starts with a slash |
98 | /// </summary> | 98 | /// </summary> |
@@ -101,22 +101,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
101 | { | 101 | { |
102 | TestHelpers.InMethod(); | 102 | TestHelpers.InMethod(); |
103 | // log4net.Config.XmlConfigurator.Configure(); | 103 | // log4net.Config.XmlConfigurator.Configure(); |
104 | 104 | ||
105 | SerialiserModule serialiserModule = new SerialiserModule(); | 105 | SerialiserModule serialiserModule = new SerialiserModule(); |
106 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); | 106 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); |
107 | Scene scene = new SceneHelpers().SetupScene(); | 107 | Scene scene = new SceneHelpers().SetupScene(); |
108 | SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); | 108 | SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); |
109 | 109 | ||
110 | UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "password"); | 110 | UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "password"); |
111 | archiverModule.DearchiveInventory(UUID.Random(), m_uaMT.FirstName, m_uaMT.LastName, "/Objects", "password", m_iarStream); | 111 | archiverModule.DearchiveInventory(UUID.Random(), m_uaMT.FirstName, m_uaMT.LastName, "/Objects", "password", m_iarStream); |
112 | 112 | ||
113 | InventoryItemBase foundItem1 | 113 | InventoryItemBase foundItem1 |
114 | = InventoryArchiveUtils.FindItemByPath( | 114 | = InventoryArchiveUtils.FindItemByPath( |
115 | scene.InventoryService, m_uaMT.PrincipalID, "/Objects/" + m_item1Name); | 115 | scene.InventoryService, m_uaMT.PrincipalID, "/Objects/" + m_item1Name); |
116 | 116 | ||
117 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1 in TestLoadIarFolderStartsWithSlash()"); | 117 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1 in TestLoadIarFolderStartsWithSlash()"); |
118 | } | 118 | } |
119 | 119 | ||
120 | [Test] | 120 | [Test] |
121 | public void TestLoadIarPathWithEscapedChars() | 121 | public void TestLoadIarPathWithEscapedChars() |
122 | { | 122 | { |
@@ -137,7 +137,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
137 | string userLastName = "Stirrup"; | 137 | string userLastName = "Stirrup"; |
138 | UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); | 138 | UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); |
139 | UserAccountHelpers.CreateUserWithInventory(scene, userFirstName, userLastName, userId, "meowfood"); | 139 | UserAccountHelpers.CreateUserWithInventory(scene, userFirstName, userLastName, userId, "meowfood"); |
140 | 140 | ||
141 | // Create asset | 141 | // Create asset |
142 | SceneObjectGroup object1; | 142 | SceneObjectGroup object1; |
143 | SceneObjectPart part1; | 143 | SceneObjectPart part1; |
@@ -168,7 +168,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
168 | item1.Name = itemName; | 168 | item1.Name = itemName; |
169 | item1.AssetID = asset1.FullID; | 169 | item1.AssetID = asset1.FullID; |
170 | item1.ID = item1Id; | 170 | item1.ID = item1Id; |
171 | InventoryFolderBase objsFolder | 171 | InventoryFolderBase objsFolder |
172 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, userId, "Objects")[0]; | 172 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, userId, "Objects")[0]; |
173 | item1.Folder = objsFolder.ID; | 173 | item1.Folder = objsFolder.ID; |
174 | scene.AddInventoryItem(item1); | 174 | scene.AddInventoryItem(item1); |
@@ -189,16 +189,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
189 | InventoryItemBase foundItem1 | 189 | InventoryItemBase foundItem1 |
190 | = InventoryArchiveUtils.FindItemByPath( | 190 | = InventoryArchiveUtils.FindItemByPath( |
191 | scene.InventoryService, userId, "Scripts/Objects/" + humanEscapedItemName); | 191 | scene.InventoryService, userId, "Scripts/Objects/" + humanEscapedItemName); |
192 | 192 | ||
193 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); | 193 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); |
194 | // Assert.That( | 194 | // Assert.That( |
195 | // foundItem1.CreatorId, Is.EqualTo(userUuid), | 195 | // foundItem1.CreatorId, Is.EqualTo(userUuid), |
196 | // "Loaded item non-uuid creator doesn't match that of the loading user"); | 196 | // "Loaded item non-uuid creator doesn't match that of the loading user"); |
197 | Assert.That( | 197 | Assert.That( |
198 | foundItem1.Name, Is.EqualTo(itemName), | 198 | foundItem1.Name, Is.EqualTo(itemName), |
199 | "Loaded item name doesn't match saved name"); | 199 | "Loaded item name doesn't match saved name"); |
200 | } | 200 | } |
201 | 201 | ||
202 | /// <summary> | 202 | /// <summary> |
203 | /// Test replication of an archive path to the user's inventory. | 203 | /// Test replication of an archive path to the user's inventory. |
204 | /// </summary> | 204 | /// </summary> |
@@ -207,21 +207,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
207 | { | 207 | { |
208 | TestHelpers.InMethod(); | 208 | TestHelpers.InMethod(); |
209 | // log4net.Config.XmlConfigurator.Configure(); | 209 | // log4net.Config.XmlConfigurator.Configure(); |
210 | 210 | ||
211 | Scene scene = new SceneHelpers().SetupScene(); | 211 | Scene scene = new SceneHelpers().SetupScene(); |
212 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); | 212 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); |
213 | 213 | ||
214 | Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>(); | 214 | Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>(); |
215 | HashSet<InventoryNodeBase> nodesLoaded = new HashSet<InventoryNodeBase>(); | 215 | HashSet<InventoryNodeBase> nodesLoaded = new HashSet<InventoryNodeBase>(); |
216 | 216 | ||
217 | string folder1Name = "1"; | 217 | string folder1Name = "1"; |
218 | string folder2aName = "2a"; | 218 | string folder2aName = "2a"; |
219 | string folder2bName = "2b"; | 219 | string folder2bName = "2b"; |
220 | 220 | ||
221 | string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1Name, UUID.Random()); | 221 | string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1Name, UUID.Random()); |
222 | string folder2aArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2aName, UUID.Random()); | 222 | string folder2aArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2aName, UUID.Random()); |
223 | string folder2bArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2bName, UUID.Random()); | 223 | string folder2bArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2bName, UUID.Random()); |
224 | 224 | ||
225 | string iarPath1 = string.Join("", new string[] { folder1ArchiveName, folder2aArchiveName }); | 225 | string iarPath1 = string.Join("", new string[] { folder1ArchiveName, folder2aArchiveName }); |
226 | string iarPath2 = string.Join("", new string[] { folder1ArchiveName, folder2bArchiveName }); | 226 | string iarPath2 = string.Join("", new string[] { folder1ArchiveName, folder2bArchiveName }); |
227 | 227 | ||
@@ -229,42 +229,42 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
229 | // Test replication of path1 | 229 | // Test replication of path1 |
230 | new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false) | 230 | new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false) |
231 | .ReplicateArchivePathToUserInventory( | 231 | .ReplicateArchivePathToUserInventory( |
232 | iarPath1, scene.InventoryService.GetRootFolder(ua1.PrincipalID), | 232 | iarPath1, scene.InventoryService.GetRootFolder(ua1.PrincipalID), |
233 | foldersCreated, nodesLoaded); | 233 | foldersCreated, nodesLoaded); |
234 | 234 | ||
235 | List<InventoryFolderBase> folder1Candidates | 235 | List<InventoryFolderBase> folder1Candidates |
236 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1Name); | 236 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1Name); |
237 | Assert.That(folder1Candidates.Count, Is.EqualTo(1)); | 237 | Assert.That(folder1Candidates.Count, Is.EqualTo(1)); |
238 | 238 | ||
239 | InventoryFolderBase folder1 = folder1Candidates[0]; | 239 | InventoryFolderBase folder1 = folder1Candidates[0]; |
240 | List<InventoryFolderBase> folder2aCandidates | 240 | List<InventoryFolderBase> folder2aCandidates |
241 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1, folder2aName); | 241 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1, folder2aName); |
242 | Assert.That(folder2aCandidates.Count, Is.EqualTo(1)); | 242 | Assert.That(folder2aCandidates.Count, Is.EqualTo(1)); |
243 | } | 243 | } |
244 | 244 | ||
245 | { | 245 | { |
246 | // Test replication of path2 | 246 | // Test replication of path2 |
247 | new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false) | 247 | new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false) |
248 | .ReplicateArchivePathToUserInventory( | 248 | .ReplicateArchivePathToUserInventory( |
249 | iarPath2, scene.InventoryService.GetRootFolder(ua1.PrincipalID), | 249 | iarPath2, scene.InventoryService.GetRootFolder(ua1.PrincipalID), |
250 | foldersCreated, nodesLoaded); | 250 | foldersCreated, nodesLoaded); |
251 | 251 | ||
252 | List<InventoryFolderBase> folder1Candidates | 252 | List<InventoryFolderBase> folder1Candidates |
253 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1Name); | 253 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1Name); |
254 | Assert.That(folder1Candidates.Count, Is.EqualTo(1)); | 254 | Assert.That(folder1Candidates.Count, Is.EqualTo(1)); |
255 | 255 | ||
256 | InventoryFolderBase folder1 = folder1Candidates[0]; | 256 | InventoryFolderBase folder1 = folder1Candidates[0]; |
257 | 257 | ||
258 | List<InventoryFolderBase> folder2aCandidates | 258 | List<InventoryFolderBase> folder2aCandidates |
259 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1, folder2aName); | 259 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1, folder2aName); |
260 | Assert.That(folder2aCandidates.Count, Is.EqualTo(1)); | 260 | Assert.That(folder2aCandidates.Count, Is.EqualTo(1)); |
261 | 261 | ||
262 | List<InventoryFolderBase> folder2bCandidates | 262 | List<InventoryFolderBase> folder2bCandidates |
263 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1, folder2bName); | 263 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1, folder2bName); |
264 | Assert.That(folder2bCandidates.Count, Is.EqualTo(1)); | 264 | Assert.That(folder2bCandidates.Count, Is.EqualTo(1)); |
265 | } | 265 | } |
266 | } | 266 | } |
267 | 267 | ||
268 | /// <summary> | 268 | /// <summary> |
269 | /// Test replication of a partly existing archive path to the user's inventory. This should create | 269 | /// Test replication of a partly existing archive path to the user's inventory. This should create |
270 | /// a duplicate path without the merge option. | 270 | /// a duplicate path without the merge option. |
@@ -274,31 +274,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
274 | { | 274 | { |
275 | TestHelpers.InMethod(); | 275 | TestHelpers.InMethod(); |
276 | //log4net.Config.XmlConfigurator.Configure(); | 276 | //log4net.Config.XmlConfigurator.Configure(); |
277 | 277 | ||
278 | Scene scene = new SceneHelpers().SetupScene(); | 278 | Scene scene = new SceneHelpers().SetupScene(); |
279 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); | 279 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); |
280 | 280 | ||
281 | string folder1ExistingName = "a"; | 281 | string folder1ExistingName = "a"; |
282 | string folder2Name = "b"; | 282 | string folder2Name = "b"; |
283 | 283 | ||
284 | InventoryFolderBase folder1 | 284 | InventoryFolderBase folder1 |
285 | = UserInventoryHelpers.CreateInventoryFolder( | 285 | = UserInventoryHelpers.CreateInventoryFolder( |
286 | scene.InventoryService, ua1.PrincipalID, folder1ExistingName, false); | 286 | scene.InventoryService, ua1.PrincipalID, folder1ExistingName, false); |
287 | 287 | ||
288 | string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); | 288 | string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); |
289 | string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); | 289 | string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); |
290 | 290 | ||
291 | string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName }); | 291 | string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName }); |
292 | 292 | ||
293 | new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false) | 293 | new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, null, (Stream)null, false) |
294 | .ReplicateArchivePathToUserInventory( | 294 | .ReplicateArchivePathToUserInventory( |
295 | itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), | 295 | itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), |
296 | new Dictionary<string, InventoryFolderBase>(), new HashSet<InventoryNodeBase>()); | 296 | new Dictionary<string, InventoryFolderBase>(), new HashSet<InventoryNodeBase>()); |
297 | 297 | ||
298 | List<InventoryFolderBase> folder1PostCandidates | 298 | List<InventoryFolderBase> folder1PostCandidates |
299 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName); | 299 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName); |
300 | Assert.That(folder1PostCandidates.Count, Is.EqualTo(2)); | 300 | Assert.That(folder1PostCandidates.Count, Is.EqualTo(2)); |
301 | 301 | ||
302 | // FIXME: Temporarily, we're going to do something messy to make sure we pick up the created folder. | 302 | // FIXME: Temporarily, we're going to do something messy to make sure we pick up the created folder. |
303 | InventoryFolderBase folder1Post = null; | 303 | InventoryFolderBase folder1Post = null; |
304 | foreach (InventoryFolderBase folder in folder1PostCandidates) | 304 | foreach (InventoryFolderBase folder in folder1PostCandidates) |
@@ -311,11 +311,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
311 | } | 311 | } |
312 | // Assert.That(folder1Post.ID, Is.EqualTo(folder1.ID)); | 312 | // Assert.That(folder1Post.ID, Is.EqualTo(folder1.ID)); |
313 | 313 | ||
314 | List<InventoryFolderBase> folder2PostCandidates | 314 | List<InventoryFolderBase> folder2PostCandidates |
315 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1Post, "b"); | 315 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1Post, "b"); |
316 | Assert.That(folder2PostCandidates.Count, Is.EqualTo(1)); | 316 | Assert.That(folder2PostCandidates.Count, Is.EqualTo(1)); |
317 | } | 317 | } |
318 | 318 | ||
319 | /// <summary> | 319 | /// <summary> |
320 | /// Test replication of a partly existing archive path to the user's inventory. This should create | 320 | /// Test replication of a partly existing archive path to the user's inventory. This should create |
321 | /// a merged path. | 321 | /// a merged path. |
@@ -325,33 +325,33 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
325 | { | 325 | { |
326 | TestHelpers.InMethod(); | 326 | TestHelpers.InMethod(); |
327 | // log4net.Config.XmlConfigurator.Configure(); | 327 | // log4net.Config.XmlConfigurator.Configure(); |
328 | 328 | ||
329 | Scene scene = new SceneHelpers().SetupScene(); | 329 | Scene scene = new SceneHelpers().SetupScene(); |
330 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); | 330 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene); |
331 | 331 | ||
332 | string folder1ExistingName = "a"; | 332 | string folder1ExistingName = "a"; |
333 | string folder2Name = "b"; | 333 | string folder2Name = "b"; |
334 | 334 | ||
335 | InventoryFolderBase folder1 | 335 | InventoryFolderBase folder1 |
336 | = UserInventoryHelpers.CreateInventoryFolder( | 336 | = UserInventoryHelpers.CreateInventoryFolder( |
337 | scene.InventoryService, ua1.PrincipalID, folder1ExistingName, false); | 337 | scene.InventoryService, ua1.PrincipalID, folder1ExistingName, false); |
338 | 338 | ||
339 | string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); | 339 | string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); |
340 | string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); | 340 | string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); |
341 | 341 | ||
342 | string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName }); | 342 | string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName }); |
343 | 343 | ||
344 | new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, folder1ExistingName, (Stream)null, true) | 344 | new InventoryArchiveReadRequest(UUID.Random(), null, scene.InventoryService, scene.AssetService, scene.UserAccountService, ua1, folder1ExistingName, (Stream)null, true) |
345 | .ReplicateArchivePathToUserInventory( | 345 | .ReplicateArchivePathToUserInventory( |
346 | itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), | 346 | itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), |
347 | new Dictionary<string, InventoryFolderBase>(), new HashSet<InventoryNodeBase>()); | 347 | new Dictionary<string, InventoryFolderBase>(), new HashSet<InventoryNodeBase>()); |
348 | 348 | ||
349 | List<InventoryFolderBase> folder1PostCandidates | 349 | List<InventoryFolderBase> folder1PostCandidates |
350 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName); | 350 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName); |
351 | Assert.That(folder1PostCandidates.Count, Is.EqualTo(1)); | 351 | Assert.That(folder1PostCandidates.Count, Is.EqualTo(1)); |
352 | Assert.That(folder1PostCandidates[0].ID, Is.EqualTo(folder1.ID)); | 352 | Assert.That(folder1PostCandidates[0].ID, Is.EqualTo(folder1.ID)); |
353 | 353 | ||
354 | List<InventoryFolderBase> folder2PostCandidates | 354 | List<InventoryFolderBase> folder2PostCandidates |
355 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1PostCandidates[0], "b"); | 355 | = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, folder1PostCandidates[0], "b"); |
356 | Assert.That(folder2PostCandidates.Count, Is.EqualTo(1)); | 356 | Assert.That(folder2PostCandidates.Count, Is.EqualTo(1)); |
357 | } | 357 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadTests.cs index 57b4f80..d0bdc91 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadTests.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
47 | { | 47 | { |
48 | [TestFixture] | 48 | [TestFixture] |
49 | public class InventoryArchiveLoadTests : InventoryArchiveTestCase | 49 | public class InventoryArchiveLoadTests : InventoryArchiveTestCase |
50 | { | 50 | { |
51 | protected TestScene m_scene; | 51 | protected TestScene m_scene; |
52 | protected InventoryArchiverModule m_archiverModule; | 52 | protected InventoryArchiverModule m_archiverModule; |
53 | 53 | ||
@@ -55,12 +55,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
55 | public override void SetUp() | 55 | public override void SetUp() |
56 | { | 56 | { |
57 | base.SetUp(); | 57 | base.SetUp(); |
58 | 58 | ||
59 | SerialiserModule serialiserModule = new SerialiserModule(); | 59 | SerialiserModule serialiserModule = new SerialiserModule(); |
60 | m_archiverModule = new InventoryArchiverModule(); | 60 | m_archiverModule = new InventoryArchiverModule(); |
61 | 61 | ||
62 | m_scene = new SceneHelpers().SetupScene(); | 62 | m_scene = new SceneHelpers().SetupScene(); |
63 | SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule); | 63 | SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule); |
64 | } | 64 | } |
65 | 65 | ||
66 | [Test] | 66 | [Test] |
@@ -68,35 +68,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
68 | { | 68 | { |
69 | TestHelpers.InMethod(); | 69 | TestHelpers.InMethod(); |
70 | // TestHelpers.EnableLogging(); | 70 | // TestHelpers.EnableLogging(); |
71 | 71 | ||
72 | UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "password"); | 72 | UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "password"); |
73 | m_archiverModule.DearchiveInventory(UUID.Random(), m_uaLL1.FirstName, m_uaLL1.LastName, "/", "password", m_iarStream); | 73 | m_archiverModule.DearchiveInventory(UUID.Random(), m_uaLL1.FirstName, m_uaLL1.LastName, "/", "password", m_iarStream); |
74 | 74 | ||
75 | InventoryItemBase coaItem | 75 | InventoryItemBase coaItem |
76 | = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaLL1.PrincipalID, m_coaItemName); | 76 | = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaLL1.PrincipalID, m_coaItemName); |
77 | 77 | ||
78 | Assert.That(coaItem, Is.Not.Null, "Didn't find loaded item 1"); | 78 | Assert.That(coaItem, Is.Not.Null, "Didn't find loaded item 1"); |
79 | 79 | ||
80 | string assetXml = AssetHelpers.ReadAssetAsString(m_scene.AssetService, coaItem.AssetID); | 80 | string assetXml = AssetHelpers.ReadAssetAsString(m_scene.AssetService, coaItem.AssetID); |
81 | 81 | ||
82 | CoalescedSceneObjects coa; | 82 | CoalescedSceneObjects coa; |
83 | bool readResult = CoalescedSceneObjectsSerializer.TryFromXml(assetXml, out coa); | 83 | bool readResult = CoalescedSceneObjectsSerializer.TryFromXml(assetXml, out coa); |
84 | 84 | ||
85 | Assert.That(readResult, Is.True); | 85 | Assert.That(readResult, Is.True); |
86 | Assert.That(coa.Count, Is.EqualTo(2)); | 86 | Assert.That(coa.Count, Is.EqualTo(2)); |
87 | 87 | ||
88 | List<SceneObjectGroup> coaObjects = coa.Objects; | 88 | List<SceneObjectGroup> coaObjects = coa.Objects; |
89 | Assert.That(coaObjects[0].UUID, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000120"))); | 89 | Assert.That(coaObjects[0].UUID, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000120"))); |
90 | Assert.That(coaObjects[0].AbsolutePosition, Is.EqualTo(new Vector3(15, 30, 45))); | 90 | Assert.That(coaObjects[0].AbsolutePosition, Is.EqualTo(new Vector3(15, 30, 45))); |
91 | 91 | ||
92 | Assert.That(coaObjects[1].UUID, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000140"))); | 92 | Assert.That(coaObjects[1].UUID, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000140"))); |
93 | Assert.That(coaObjects[1].AbsolutePosition, Is.EqualTo(new Vector3(25, 50, 75))); | 93 | Assert.That(coaObjects[1].AbsolutePosition, Is.EqualTo(new Vector3(25, 50, 75))); |
94 | } | 94 | } |
95 | 95 | ||
96 | /// <summary> | 96 | /// <summary> |
97 | /// Test case where a creator account exists for the creator UUID embedded in item metadata and serialized | 97 | /// Test case where a creator account exists for the creator UUID embedded in item metadata and serialized |
98 | /// objects. | 98 | /// objects. |
99 | /// </summary> | 99 | /// </summary> |
100 | [Test] | 100 | [Test] |
101 | public void TestLoadIarCreatorAccountPresent() | 101 | public void TestLoadIarCreatorAccountPresent() |
102 | { | 102 | { |
@@ -105,26 +105,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
105 | 105 | ||
106 | UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "meowfood"); | 106 | UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "meowfood"); |
107 | 107 | ||
108 | m_archiverModule.DearchiveInventory(UUID.Random(), m_uaLL1.FirstName, m_uaLL1.LastName, "/", "meowfood", m_iarStream); | 108 | m_archiverModule.DearchiveInventory(UUID.Random(), m_uaLL1.FirstName, m_uaLL1.LastName, "/", "meowfood", m_iarStream); |
109 | InventoryItemBase foundItem1 | 109 | InventoryItemBase foundItem1 |
110 | = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaLL1.PrincipalID, m_item1Name); | 110 | = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaLL1.PrincipalID, m_item1Name); |
111 | 111 | ||
112 | Assert.That( | 112 | Assert.That( |
113 | foundItem1.CreatorId, Is.EqualTo(m_uaLL1.PrincipalID.ToString()), | 113 | foundItem1.CreatorId, Is.EqualTo(m_uaLL1.PrincipalID.ToString()), |
114 | "Loaded item non-uuid creator doesn't match original"); | 114 | "Loaded item non-uuid creator doesn't match original"); |
115 | Assert.That( | 115 | Assert.That( |
116 | foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaLL1.PrincipalID), | 116 | foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaLL1.PrincipalID), |
117 | "Loaded item uuid creator doesn't match original"); | 117 | "Loaded item uuid creator doesn't match original"); |
118 | Assert.That(foundItem1.Owner, Is.EqualTo(m_uaLL1.PrincipalID), | 118 | Assert.That(foundItem1.Owner, Is.EqualTo(m_uaLL1.PrincipalID), |
119 | "Loaded item owner doesn't match inventory reciever"); | 119 | "Loaded item owner doesn't match inventory reciever"); |
120 | 120 | ||
121 | AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString()); | 121 | AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString()); |
122 | string xmlData = Utils.BytesToString(asset1.Data); | 122 | string xmlData = Utils.BytesToString(asset1.Data); |
123 | SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); | 123 | SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); |
124 | 124 | ||
125 | Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaLL1.PrincipalID)); | 125 | Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaLL1.PrincipalID)); |
126 | } | 126 | } |
127 | 127 | ||
128 | // /// <summary> | 128 | // /// <summary> |
129 | // /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where | 129 | // /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where |
130 | // /// an account exists with the same name as the creator, though not the same id. | 130 | // /// an account exists with the same name as the creator, though not the same id. |
@@ -137,24 +137,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
137 | // | 137 | // |
138 | // UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "meowfood"); | 138 | // UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "meowfood"); |
139 | // UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL2, "hampshire"); | 139 | // UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL2, "hampshire"); |
140 | // | 140 | // |
141 | // m_archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream); | 141 | // m_archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream); |
142 | // InventoryItemBase foundItem1 | 142 | // InventoryItemBase foundItem1 |
143 | // = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaMT.PrincipalID, m_item1Name); | 143 | // = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaMT.PrincipalID, m_item1Name); |
144 | // | 144 | // |
145 | // Assert.That( | 145 | // Assert.That( |
146 | // foundItem1.CreatorId, Is.EqualTo(m_uaLL2.PrincipalID.ToString()), | 146 | // foundItem1.CreatorId, Is.EqualTo(m_uaLL2.PrincipalID.ToString()), |
147 | // "Loaded item non-uuid creator doesn't match original"); | 147 | // "Loaded item non-uuid creator doesn't match original"); |
148 | // Assert.That( | 148 | // Assert.That( |
149 | // foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaLL2.PrincipalID), | 149 | // foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaLL2.PrincipalID), |
150 | // "Loaded item uuid creator doesn't match original"); | 150 | // "Loaded item uuid creator doesn't match original"); |
151 | // Assert.That(foundItem1.Owner, Is.EqualTo(m_uaMT.PrincipalID), | 151 | // Assert.That(foundItem1.Owner, Is.EqualTo(m_uaMT.PrincipalID), |
152 | // "Loaded item owner doesn't match inventory reciever"); | 152 | // "Loaded item owner doesn't match inventory reciever"); |
153 | // | 153 | // |
154 | // AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString()); | 154 | // AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString()); |
155 | // string xmlData = Utils.BytesToString(asset1.Data); | 155 | // string xmlData = Utils.BytesToString(asset1.Data); |
156 | // SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); | 156 | // SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); |
157 | // | 157 | // |
158 | // Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaLL2.PrincipalID)); | 158 | // Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaLL2.PrincipalID)); |
159 | // } | 159 | // } |
160 | 160 | ||
@@ -167,26 +167,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
167 | { | 167 | { |
168 | TestHelpers.InMethod(); | 168 | TestHelpers.InMethod(); |
169 | // log4net.Config.XmlConfigurator.Configure(); | 169 | // log4net.Config.XmlConfigurator.Configure(); |
170 | 170 | ||
171 | UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "password"); | 171 | UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "password"); |
172 | m_archiverModule.DearchiveInventory(UUID.Random(), m_uaMT.FirstName, m_uaMT.LastName, "/", "password", m_iarStream); | 172 | m_archiverModule.DearchiveInventory(UUID.Random(), m_uaMT.FirstName, m_uaMT.LastName, "/", "password", m_iarStream); |
173 | 173 | ||
174 | InventoryItemBase foundItem1 | 174 | InventoryItemBase foundItem1 |
175 | = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaMT.PrincipalID, m_item1Name); | 175 | = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaMT.PrincipalID, m_item1Name); |
176 | 176 | ||
177 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); | 177 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); |
178 | Assert.That( | 178 | Assert.That( |
179 | foundItem1.CreatorId, Is.EqualTo(m_uaMT.PrincipalID.ToString()), | 179 | foundItem1.CreatorId, Is.EqualTo(m_uaMT.PrincipalID.ToString()), |
180 | "Loaded item non-uuid creator doesn't match that of the loading user"); | 180 | "Loaded item non-uuid creator doesn't match that of the loading user"); |
181 | Assert.That( | 181 | Assert.That( |
182 | foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaMT.PrincipalID), | 182 | foundItem1.CreatorIdAsUuid, Is.EqualTo(m_uaMT.PrincipalID), |
183 | "Loaded item uuid creator doesn't match that of the loading user"); | 183 | "Loaded item uuid creator doesn't match that of the loading user"); |
184 | 184 | ||
185 | AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString()); | 185 | AssetBase asset1 = m_scene.AssetService.Get(foundItem1.AssetID.ToString()); |
186 | string xmlData = Utils.BytesToString(asset1.Data); | 186 | string xmlData = Utils.BytesToString(asset1.Data); |
187 | SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); | 187 | SceneObjectGroup sog1 = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); |
188 | 188 | ||
189 | Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaMT.PrincipalID)); | 189 | Assert.That(sog1.RootPart.CreatorID, Is.EqualTo(m_uaMT.PrincipalID)); |
190 | } | 190 | } |
191 | } | 191 | } |
192 | } \ No newline at end of file | 192 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs index 7265405..bd112b4 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs | |||
@@ -50,19 +50,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
50 | { | 50 | { |
51 | protected TestScene m_scene; | 51 | protected TestScene m_scene; |
52 | protected InventoryArchiverModule m_archiverModule; | 52 | protected InventoryArchiverModule m_archiverModule; |
53 | 53 | ||
54 | [SetUp] | 54 | [SetUp] |
55 | public override void SetUp() | 55 | public override void SetUp() |
56 | { | 56 | { |
57 | base.SetUp(); | 57 | base.SetUp(); |
58 | 58 | ||
59 | SerialiserModule serialiserModule = new SerialiserModule(); | 59 | SerialiserModule serialiserModule = new SerialiserModule(); |
60 | m_archiverModule = new InventoryArchiverModule(); | 60 | m_archiverModule = new InventoryArchiverModule(); |
61 | 61 | ||
62 | m_scene = new SceneHelpers().SetupScene(); | 62 | m_scene = new SceneHelpers().SetupScene(); |
63 | SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule); | 63 | SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule); |
64 | } | 64 | } |
65 | 65 | ||
66 | /// <summary> | 66 | /// <summary> |
67 | /// Test that the IAR has the required files in the right order. | 67 | /// Test that the IAR has the required files in the right order. |
68 | /// </summary> | 68 | /// </summary> |
@@ -73,20 +73,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
73 | public void TestOrder() | 73 | public void TestOrder() |
74 | { | 74 | { |
75 | TestHelpers.InMethod(); | 75 | TestHelpers.InMethod(); |
76 | // log4net.Config.XmlConfigurator.Configure(); | 76 | // log4net.Config.XmlConfigurator.Configure(); |
77 | 77 | ||
78 | MemoryStream archiveReadStream = new MemoryStream(m_iarStreamBytes); | 78 | MemoryStream archiveReadStream = new MemoryStream(m_iarStreamBytes); |
79 | TarArchiveReader tar = new TarArchiveReader(archiveReadStream); | 79 | TarArchiveReader tar = new TarArchiveReader(archiveReadStream); |
80 | string filePath; | 80 | string filePath; |
81 | TarArchiveReader.TarEntryType tarEntryType; | 81 | TarArchiveReader.TarEntryType tarEntryType; |
82 | 82 | ||
83 | byte[] data = tar.ReadEntry(out filePath, out tarEntryType); | 83 | byte[] data = tar.ReadEntry(out filePath, out tarEntryType); |
84 | Assert.That(filePath, Is.EqualTo(ArchiveConstants.CONTROL_FILE_PATH)); | 84 | Assert.That(filePath, Is.EqualTo(ArchiveConstants.CONTROL_FILE_PATH)); |
85 | 85 | ||
86 | InventoryArchiveReadRequest iarr | 86 | InventoryArchiveReadRequest iarr |
87 | = new InventoryArchiveReadRequest(UUID.Random(), null, null, null, null, null, null, (Stream)null, false); | 87 | = new InventoryArchiveReadRequest(UUID.Random(), null, null, null, null, null, null, (Stream)null, false); |
88 | iarr.LoadControlFile(filePath, data); | 88 | iarr.LoadControlFile(filePath, data); |
89 | 89 | ||
90 | Assert.That(iarr.ControlFileLoaded, Is.True); | 90 | Assert.That(iarr.ControlFileLoaded, Is.True); |
91 | } | 91 | } |
92 | 92 | ||
@@ -119,22 +119,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
119 | // InventoryArchiveUtils. | 119 | // InventoryArchiveUtils. |
120 | bool gotObjectsFolder = false; | 120 | bool gotObjectsFolder = false; |
121 | 121 | ||
122 | string objectsFolderName | 122 | string objectsFolderName |
123 | = string.Format( | 123 | = string.Format( |
124 | "{0}{1}", | 124 | "{0}{1}", |
125 | ArchiveConstants.INVENTORY_PATH, | 125 | ArchiveConstants.INVENTORY_PATH, |
126 | InventoryArchiveWriteRequest.CreateArchiveFolderName( | 126 | InventoryArchiveWriteRequest.CreateArchiveFolderName( |
127 | UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, userId, "Objects"))); | 127 | UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, userId, "Objects"))); |
128 | 128 | ||
129 | string filePath; | 129 | string filePath; |
130 | TarArchiveReader.TarEntryType tarEntryType; | 130 | TarArchiveReader.TarEntryType tarEntryType; |
131 | 131 | ||
132 | while (tar.ReadEntry(out filePath, out tarEntryType) != null) | 132 | while (tar.ReadEntry(out filePath, out tarEntryType) != null) |
133 | { | 133 | { |
134 | // Console.WriteLine("Got {0}", filePath); | 134 | // Console.WriteLine("Got {0}", filePath); |
135 | 135 | ||
136 | // Lazily, we only bother to look for the system objects folder created when we call CreateUserWithInventory() | 136 | // Lazily, we only bother to look for the system objects folder created when we call CreateUserWithInventory() |
137 | // XXX: But really we need to stop all that stuff being created in tests or check for such folders | 137 | // XXX: But really we need to stop all that stuff being created in tests or check for such folders |
138 | // more thoroughly | 138 | // more thoroughly |
139 | if (filePath == objectsFolderName) | 139 | if (filePath == objectsFolderName) |
140 | gotObjectsFolder = true; | 140 | gotObjectsFolder = true; |
@@ -157,19 +157,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
157 | UserAccountHelpers.CreateUserWithInventory(m_scene, userFirstName, userLastName, userId, userPassword); | 157 | UserAccountHelpers.CreateUserWithInventory(m_scene, userFirstName, userLastName, userId, userPassword); |
158 | 158 | ||
159 | // Create base folder | 159 | // Create base folder |
160 | InventoryFolderBase f1 | 160 | InventoryFolderBase f1 |
161 | = UserInventoryHelpers.CreateInventoryFolder(m_scene.InventoryService, userId, "f1", true); | 161 | = UserInventoryHelpers.CreateInventoryFolder(m_scene.InventoryService, userId, "f1", true); |
162 | 162 | ||
163 | // Create item1 | 163 | // Create item1 |
164 | SceneObjectGroup so1 = SceneHelpers.CreateSceneObject(1, userId, "My Little Dog Object", 0x5); | 164 | SceneObjectGroup so1 = SceneHelpers.CreateSceneObject(1, userId, "My Little Dog Object", 0x5); |
165 | InventoryItemBase i1 = UserInventoryHelpers.AddInventoryItem(m_scene, so1, 0x50, 0x60, "f1"); | 165 | InventoryItemBase i1 = UserInventoryHelpers.AddInventoryItem(m_scene, so1, 0x50, 0x60, "f1"); |
166 | 166 | ||
167 | // Create embedded folder | 167 | // Create embedded folder |
168 | InventoryFolderBase f1_1 | 168 | InventoryFolderBase f1_1 |
169 | = UserInventoryHelpers.CreateInventoryFolder(m_scene.InventoryService, userId, "f1/f1.1", true); | 169 | = UserInventoryHelpers.CreateInventoryFolder(m_scene.InventoryService, userId, "f1/f1.1", true); |
170 | 170 | ||
171 | // Create embedded item | 171 | // Create embedded item |
172 | SceneObjectGroup so1_1 = SceneHelpers.CreateSceneObject(1, userId, "My Little Cat Object", 0x6); | 172 | SceneObjectGroup so1_1 = SceneHelpers.CreateSceneObject(1, userId, "My Little Cat Object", 0x6); |
173 | InventoryItemBase i2 = UserInventoryHelpers.AddInventoryItem(m_scene, so1_1, 0x500, 0x600, "f1/f1.1"); | 173 | InventoryItemBase i2 = UserInventoryHelpers.AddInventoryItem(m_scene, so1_1, 0x500, 0x600, "f1/f1.1"); |
174 | 174 | ||
175 | MemoryStream archiveWriteStream = new MemoryStream(); | 175 | MemoryStream archiveWriteStream = new MemoryStream(); |
@@ -188,18 +188,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
188 | // InventoryArchiveUtils. | 188 | // InventoryArchiveUtils. |
189 | bool gotf1 = false, gotf1_1 = false, gotso1 = false, gotso2 = false; | 189 | bool gotf1 = false, gotf1_1 = false, gotso1 = false, gotso2 = false; |
190 | 190 | ||
191 | string f1FileName | 191 | string f1FileName |
192 | = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, InventoryArchiveWriteRequest.CreateArchiveFolderName(f1)); | 192 | = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, InventoryArchiveWriteRequest.CreateArchiveFolderName(f1)); |
193 | string f1_1FileName | 193 | string f1_1FileName |
194 | = string.Format("{0}{1}", f1FileName, InventoryArchiveWriteRequest.CreateArchiveFolderName(f1_1)); | 194 | = string.Format("{0}{1}", f1FileName, InventoryArchiveWriteRequest.CreateArchiveFolderName(f1_1)); |
195 | string so1FileName | 195 | string so1FileName |
196 | = string.Format("{0}{1}", f1FileName, InventoryArchiveWriteRequest.CreateArchiveItemName(i1)); | 196 | = string.Format("{0}{1}", f1FileName, InventoryArchiveWriteRequest.CreateArchiveItemName(i1)); |
197 | string so2FileName | 197 | string so2FileName |
198 | = string.Format("{0}{1}", f1_1FileName, InventoryArchiveWriteRequest.CreateArchiveItemName(i2)); | 198 | = string.Format("{0}{1}", f1_1FileName, InventoryArchiveWriteRequest.CreateArchiveItemName(i2)); |
199 | 199 | ||
200 | string filePath; | 200 | string filePath; |
201 | TarArchiveReader.TarEntryType tarEntryType; | 201 | TarArchiveReader.TarEntryType tarEntryType; |
202 | 202 | ||
203 | while (tar.ReadEntry(out filePath, out tarEntryType) != null) | 203 | while (tar.ReadEntry(out filePath, out tarEntryType) != null) |
204 | { | 204 | { |
205 | // Console.WriteLine("Got {0}", filePath); | 205 | // Console.WriteLine("Got {0}", filePath); |
@@ -222,7 +222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
222 | 222 | ||
223 | // TODO: Test presence of more files and contents of files. | 223 | // TODO: Test presence of more files and contents of files. |
224 | } | 224 | } |
225 | 225 | ||
226 | /// <summary> | 226 | /// <summary> |
227 | /// Test saving a single inventory item to an IAR | 227 | /// Test saving a single inventory item to an IAR |
228 | /// (subject to change since there is no fixed format yet). | 228 | /// (subject to change since there is no fixed format yet). |
@@ -239,10 +239,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
239 | string userPassword = "troll"; | 239 | string userPassword = "troll"; |
240 | UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); | 240 | UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); |
241 | UserAccountHelpers.CreateUserWithInventory(m_scene, userFirstName, userLastName, userId, userPassword); | 241 | UserAccountHelpers.CreateUserWithInventory(m_scene, userFirstName, userLastName, userId, userPassword); |
242 | 242 | ||
243 | // Create asset | 243 | // Create asset |
244 | UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); | 244 | UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); |
245 | SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, ownerId, "My Little Dog Object", 0x50); | 245 | SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, ownerId, "My Little Dog Object", 0x50); |
246 | 246 | ||
247 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); | 247 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); |
248 | AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); | 248 | AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); |
@@ -255,7 +255,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
255 | item1.Name = item1Name; | 255 | item1.Name = item1Name; |
256 | item1.AssetID = asset1.FullID; | 256 | item1.AssetID = asset1.FullID; |
257 | item1.ID = item1Id; | 257 | item1.ID = item1Id; |
258 | InventoryFolderBase objsFolder | 258 | InventoryFolderBase objsFolder |
259 | = InventoryArchiveUtils.FindFoldersByPath(m_scene.InventoryService, userId, "Objects")[0]; | 259 | = InventoryArchiveUtils.FindFoldersByPath(m_scene.InventoryService, userId, "Objects")[0]; |
260 | item1.Folder = objsFolder.ID; | 260 | item1.Folder = objsFolder.ID; |
261 | m_scene.AddInventoryItem(item1); | 261 | m_scene.AddInventoryItem(item1); |
@@ -285,7 +285,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
285 | TarArchiveReader.TarEntryType tarEntryType; | 285 | TarArchiveReader.TarEntryType tarEntryType; |
286 | 286 | ||
287 | // Console.WriteLine("Reading archive"); | 287 | // Console.WriteLine("Reading archive"); |
288 | 288 | ||
289 | while (tar.ReadEntry(out filePath, out tarEntryType) != null) | 289 | while (tar.ReadEntry(out filePath, out tarEntryType) != null) |
290 | { | 290 | { |
291 | Console.WriteLine("Got {0}", filePath); | 291 | Console.WriteLine("Got {0}", filePath); |
@@ -294,7 +294,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
294 | // { | 294 | // { |
295 | // gotControlFile = true; | 295 | // gotControlFile = true; |
296 | // } | 296 | // } |
297 | 297 | ||
298 | if (filePath.StartsWith(ArchiveConstants.INVENTORY_PATH) && filePath.EndsWith(".xml")) | 298 | if (filePath.StartsWith(ArchiveConstants.INVENTORY_PATH) && filePath.EndsWith(".xml")) |
299 | { | 299 | { |
300 | // string fileName = filePath.Remove(0, "Objects/".Length); | 300 | // string fileName = filePath.Remove(0, "Objects/".Length); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs index 519c697..0b65829 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs | |||
@@ -49,35 +49,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
49 | public class InventoryArchiveTestCase : OpenSimTestCase | 49 | public class InventoryArchiveTestCase : OpenSimTestCase |
50 | { | 50 | { |
51 | protected ManualResetEvent mre = new ManualResetEvent(false); | 51 | protected ManualResetEvent mre = new ManualResetEvent(false); |
52 | 52 | ||
53 | /// <summary> | 53 | /// <summary> |
54 | /// A raw array of bytes that we'll use to create an IAR memory stream suitable for isolated use in each test. | 54 | /// A raw array of bytes that we'll use to create an IAR memory stream suitable for isolated use in each test. |
55 | /// </summary> | 55 | /// </summary> |
56 | protected byte[] m_iarStreamBytes; | 56 | protected byte[] m_iarStreamBytes; |
57 | 57 | ||
58 | /// <summary> | 58 | /// <summary> |
59 | /// Stream of data representing a common IAR for load tests. | 59 | /// Stream of data representing a common IAR for load tests. |
60 | /// </summary> | 60 | /// </summary> |
61 | protected MemoryStream m_iarStream; | 61 | protected MemoryStream m_iarStream; |
62 | 62 | ||
63 | protected UserAccount m_uaMT | 63 | protected UserAccount m_uaMT |
64 | = new UserAccount { | 64 | = new UserAccount { |
65 | PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000555"), | 65 | PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000555"), |
66 | FirstName = "Mr", | 66 | FirstName = "Mr", |
67 | LastName = "Tiddles" }; | 67 | LastName = "Tiddles" }; |
68 | 68 | ||
69 | protected UserAccount m_uaLL1 | 69 | protected UserAccount m_uaLL1 |
70 | = new UserAccount { | 70 | = new UserAccount { |
71 | PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000666"), | 71 | PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000666"), |
72 | FirstName = "Lord", | 72 | FirstName = "Lord", |
73 | LastName = "Lucan" }; | 73 | LastName = "Lucan" }; |
74 | 74 | ||
75 | protected UserAccount m_uaLL2 | 75 | protected UserAccount m_uaLL2 |
76 | = new UserAccount { | 76 | = new UserAccount { |
77 | PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000777"), | 77 | PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000777"), |
78 | FirstName = "Lord", | 78 | FirstName = "Lord", |
79 | LastName = "Lucan" }; | 79 | LastName = "Lucan" }; |
80 | 80 | ||
81 | protected string m_item1Name = "Ray Gun Item"; | 81 | protected string m_item1Name = "Ray Gun Item"; |
82 | protected string m_coaItemName = "Coalesced Item"; | 82 | protected string m_coaItemName = "Coalesced Item"; |
83 | 83 | ||
@@ -105,72 +105,72 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
105 | base.SetUp(); | 105 | base.SetUp(); |
106 | m_iarStream = new MemoryStream(m_iarStreamBytes); | 106 | m_iarStream = new MemoryStream(m_iarStreamBytes); |
107 | } | 107 | } |
108 | 108 | ||
109 | protected void ConstructDefaultIarBytesForTestLoad() | 109 | protected void ConstructDefaultIarBytesForTestLoad() |
110 | { | 110 | { |
111 | // log4net.Config.XmlConfigurator.Configure(); | 111 | // log4net.Config.XmlConfigurator.Configure(); |
112 | 112 | ||
113 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); | 113 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); |
114 | Scene scene = new SceneHelpers().SetupScene(); | 114 | Scene scene = new SceneHelpers().SetupScene(); |
115 | SceneHelpers.SetupSceneModules(scene, archiverModule); | 115 | SceneHelpers.SetupSceneModules(scene, archiverModule); |
116 | 116 | ||
117 | UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); | 117 | UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); |
118 | 118 | ||
119 | MemoryStream archiveWriteStream = new MemoryStream(); | 119 | MemoryStream archiveWriteStream = new MemoryStream(); |
120 | 120 | ||
121 | // Create scene object asset | 121 | // Create scene object asset |
122 | UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); | 122 | UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); |
123 | SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, ownerId, "Ray Gun Object", 0x50); | 123 | SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, ownerId, "Ray Gun Object", 0x50); |
124 | 124 | ||
125 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); | 125 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); |
126 | AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); | 126 | AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); |
127 | scene.AssetService.Store(asset1); | 127 | scene.AssetService.Store(asset1); |
128 | 128 | ||
129 | // Create scene object item | 129 | // Create scene object item |
130 | InventoryItemBase item1 = new InventoryItemBase(); | 130 | InventoryItemBase item1 = new InventoryItemBase(); |
131 | item1.Name = m_item1Name; | 131 | item1.Name = m_item1Name; |
132 | item1.ID = UUID.Parse("00000000-0000-0000-0000-000000000020"); | 132 | item1.ID = UUID.Parse("00000000-0000-0000-0000-000000000020"); |
133 | item1.AssetID = asset1.FullID; | 133 | item1.AssetID = asset1.FullID; |
134 | item1.GroupID = UUID.Random(); | 134 | item1.GroupID = UUID.Random(); |
135 | item1.CreatorId = m_uaLL1.PrincipalID.ToString(); | 135 | item1.CreatorId = m_uaLL1.PrincipalID.ToString(); |
136 | item1.Owner = m_uaLL1.PrincipalID; | 136 | item1.Owner = m_uaLL1.PrincipalID; |
137 | item1.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID; | 137 | item1.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID; |
138 | scene.AddInventoryItem(item1); | 138 | scene.AddInventoryItem(item1); |
139 | 139 | ||
140 | // Create coalesced objects asset | 140 | // Create coalesced objects asset |
141 | SceneObjectGroup cobj1 = SceneHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object1", 0x120); | 141 | SceneObjectGroup cobj1 = SceneHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object1", 0x120); |
142 | cobj1.AbsolutePosition = new Vector3(15, 30, 45); | 142 | cobj1.AbsolutePosition = new Vector3(15, 30, 45); |
143 | 143 | ||
144 | SceneObjectGroup cobj2 = SceneHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object2", 0x140); | 144 | SceneObjectGroup cobj2 = SceneHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object2", 0x140); |
145 | cobj2.AbsolutePosition = new Vector3(25, 50, 75); | 145 | cobj2.AbsolutePosition = new Vector3(25, 50, 75); |
146 | 146 | ||
147 | CoalescedSceneObjects coa = new CoalescedSceneObjects(m_uaLL1.PrincipalID, cobj1, cobj2); | 147 | CoalescedSceneObjects coa = new CoalescedSceneObjects(m_uaLL1.PrincipalID, cobj1, cobj2); |
148 | 148 | ||
149 | AssetBase coaAsset = AssetHelpers.CreateAsset(0x160, coa); | 149 | AssetBase coaAsset = AssetHelpers.CreateAsset(0x160, coa); |
150 | scene.AssetService.Store(coaAsset); | 150 | scene.AssetService.Store(coaAsset); |
151 | 151 | ||
152 | // Create coalesced objects inventory item | 152 | // Create coalesced objects inventory item |
153 | InventoryItemBase coaItem = new InventoryItemBase(); | 153 | InventoryItemBase coaItem = new InventoryItemBase(); |
154 | coaItem.Name = m_coaItemName; | 154 | coaItem.Name = m_coaItemName; |
155 | coaItem.ID = UUID.Parse("00000000-0000-0000-0000-000000000180"); | 155 | coaItem.ID = UUID.Parse("00000000-0000-0000-0000-000000000180"); |
156 | coaItem.AssetID = coaAsset.FullID; | 156 | coaItem.AssetID = coaAsset.FullID; |
157 | coaItem.GroupID = UUID.Random(); | 157 | coaItem.GroupID = UUID.Random(); |
158 | coaItem.CreatorId = m_uaLL1.PrincipalID.ToString(); | 158 | coaItem.CreatorId = m_uaLL1.PrincipalID.ToString(); |
159 | coaItem.Owner = m_uaLL1.PrincipalID; | 159 | coaItem.Owner = m_uaLL1.PrincipalID; |
160 | coaItem.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID; | 160 | coaItem.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID; |
161 | scene.AddInventoryItem(coaItem); | 161 | scene.AddInventoryItem(coaItem); |
162 | 162 | ||
163 | archiverModule.ArchiveInventory( | 163 | archiverModule.ArchiveInventory( |
164 | UUID.Random(), m_uaLL1.FirstName, m_uaLL1.LastName, "/*", "hampshire", archiveWriteStream); | 164 | UUID.Random(), m_uaLL1.FirstName, m_uaLL1.LastName, "/*", "hampshire", archiveWriteStream); |
165 | 165 | ||
166 | m_iarStreamBytes = archiveWriteStream.ToArray(); | 166 | m_iarStreamBytes = archiveWriteStream.ToArray(); |
167 | } | 167 | } |
168 | 168 | ||
169 | protected void SaveCompleted( | 169 | protected void SaveCompleted( |
170 | UUID id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream, | 170 | UUID id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream, |
171 | Exception reportedException, int SaveCount, int FilterCount) | 171 | Exception reportedException, int SaveCount, int FilterCount) |
172 | { | 172 | { |
173 | mre.Set(); | 173 | mre.Set(); |
174 | } | 174 | } |
175 | } | 175 | } |
176 | } \ No newline at end of file | 176 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 46da5a9..5d7f25c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -149,10 +149,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
149 | private void OnInstantMessage(IClientAPI client, GridInstantMessage im) | 149 | private void OnInstantMessage(IClientAPI client, GridInstantMessage im) |
150 | { | 150 | { |
151 | // m_log.DebugFormat( | 151 | // m_log.DebugFormat( |
152 | // "[INVENTORY TRANSFER]: {0} IM type received from client {1}. From={2} ({3}), To={4}", | 152 | // "[INVENTORY TRANSFER]: {0} IM type received from client {1}. From={2} ({3}), To={4}", |
153 | // (InstantMessageDialog)im.dialog, client.Name, | 153 | // (InstantMessageDialog)im.dialog, client.Name, |
154 | // im.fromAgentID, im.fromAgentName, im.toAgentID); | 154 | // im.fromAgentID, im.fromAgentName, im.toAgentID); |
155 | 155 | ||
156 | Scene scene = FindClientScene(client.AgentId); | 156 | Scene scene = FindClientScene(client.AgentId); |
157 | 157 | ||
158 | if (scene == null) // Something seriously wrong here. | 158 | if (scene == null) // Something seriously wrong here. |
@@ -164,31 +164,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
164 | 164 | ||
165 | if (im.binaryBucket.Length < 17) // Invalid | 165 | if (im.binaryBucket.Length < 17) // Invalid |
166 | return; | 166 | return; |
167 | 167 | ||
168 | UUID recipientID = new UUID(im.toAgentID); | 168 | UUID recipientID = new UUID(im.toAgentID); |
169 | ScenePresence user = scene.GetScenePresence(recipientID); | 169 | ScenePresence user = scene.GetScenePresence(recipientID); |
170 | UUID copyID; | 170 | UUID copyID; |
171 | 171 | ||
172 | // First byte is the asset type | 172 | // First byte is the asset type |
173 | AssetType assetType = (AssetType)im.binaryBucket[0]; | 173 | AssetType assetType = (AssetType)im.binaryBucket[0]; |
174 | 174 | ||
175 | if (AssetType.Folder == assetType) | 175 | if (AssetType.Folder == assetType) |
176 | { | 176 | { |
177 | UUID folderID = new UUID(im.binaryBucket, 1); | 177 | UUID folderID = new UUID(im.binaryBucket, 1); |
178 | 178 | ||
179 | m_log.DebugFormat( | 179 | m_log.DebugFormat( |
180 | "[INVENTORY TRANSFER]: Inserting original folder {0} into agent {1}'s inventory", | 180 | "[INVENTORY TRANSFER]: Inserting original folder {0} into agent {1}'s inventory", |
181 | folderID, new UUID(im.toAgentID)); | 181 | folderID, new UUID(im.toAgentID)); |
182 | 182 | ||
183 | InventoryFolderBase folderCopy | 183 | InventoryFolderBase folderCopy |
184 | = scene.GiveInventoryFolder(client, recipientID, client.AgentId, folderID, UUID.Zero); | 184 | = scene.GiveInventoryFolder(client, recipientID, client.AgentId, folderID, UUID.Zero); |
185 | 185 | ||
186 | if (folderCopy == null) | 186 | if (folderCopy == null) |
187 | { | 187 | { |
188 | client.SendAgentAlertMessage("Can't find folder to give. Nothing given.", false); | 188 | client.SendAgentAlertMessage("Can't find folder to give. Nothing given.", false); |
189 | return; | 189 | return; |
190 | } | 190 | } |
191 | 191 | ||
192 | // The outgoing binary bucket should contain only the byte which signals an asset folder is | 192 | // The outgoing binary bucket should contain only the byte which signals an asset folder is |
193 | // being copied and the following bytes for the copied folder's UUID | 193 | // being copied and the following bytes for the copied folder's UUID |
194 | copyID = folderCopy.ID; | 194 | copyID = folderCopy.ID; |
@@ -196,7 +196,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
196 | im.binaryBucket = new byte[1 + copyIDBytes.Length]; | 196 | im.binaryBucket = new byte[1 + copyIDBytes.Length]; |
197 | im.binaryBucket[0] = (byte)AssetType.Folder; | 197 | im.binaryBucket[0] = (byte)AssetType.Folder; |
198 | Array.Copy(copyIDBytes, 0, im.binaryBucket, 1, copyIDBytes.Length); | 198 | Array.Copy(copyIDBytes, 0, im.binaryBucket, 1, copyIDBytes.Length); |
199 | 199 | ||
200 | if (user != null) | 200 | if (user != null) |
201 | user.ControllingClient.SendBulkUpdateInventory(folderCopy); | 201 | user.ControllingClient.SendBulkUpdateInventory(folderCopy); |
202 | 202 | ||
@@ -225,10 +225,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
225 | client.SendAgentAlertMessage(message, false); | 225 | client.SendAgentAlertMessage(message, false); |
226 | return; | 226 | return; |
227 | } | 227 | } |
228 | 228 | ||
229 | copyID = itemCopy.ID; | 229 | copyID = itemCopy.ID; |
230 | Array.Copy(copyID.GetBytes(), 0, im.binaryBucket, 1, 16); | 230 | Array.Copy(copyID.GetBytes(), 0, im.binaryBucket, 1, 16); |
231 | 231 | ||
232 | if (user != null) | 232 | if (user != null) |
233 | user.ControllingClient.SendBulkUpdateInventory(itemCopy); | 233 | user.ControllingClient.SendBulkUpdateInventory(itemCopy); |
234 | 234 | ||
@@ -253,7 +253,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
253 | else | 253 | else |
254 | { | 254 | { |
255 | if (m_TransferModule != null) | 255 | if (m_TransferModule != null) |
256 | m_TransferModule.SendInstantMessage(im, delegate(bool success) | 256 | m_TransferModule.SendInstantMessage(im, delegate(bool success) |
257 | { | 257 | { |
258 | if (!success) | 258 | if (!success) |
259 | client.SendAlertMessage("User not online. Inventory has been saved"); | 259 | client.SendAlertMessage("User not online. Inventory has been saved"); |
@@ -308,8 +308,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
308 | } | 308 | } |
309 | 309 | ||
310 | // XXX: This code was placed here to try and accomodate RLV which moves given folders named #RLV/~<name> | 310 | // XXX: This code was placed here to try and accomodate RLV which moves given folders named #RLV/~<name> |
311 | // to the requested folder, which in this case is #RLV. However, it is the viewer that appears to be | 311 | // to the requested folder, which in this case is #RLV. However, it is the viewer that appears to be |
312 | // response from renaming the #RLV/~example folder to ~example. For some reason this is not yet | 312 | // response from renaming the #RLV/~example folder to ~example. For some reason this is not yet |
313 | // happening, possibly because we are not sending the correct inventory update messages with the correct | 313 | // happening, possibly because we are not sending the correct inventory update messages with the correct |
314 | // transaction IDs | 314 | // transaction IDs |
315 | else if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) | 315 | else if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) |
@@ -380,7 +380,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
380 | InventoryItemBase item = invService.GetItem(client.AgentId, inventoryID); | 380 | InventoryItemBase item = invService.GetItem(client.AgentId, inventoryID); |
381 | InventoryFolderBase folder = null; | 381 | InventoryFolderBase folder = null; |
382 | UUID? previousParentFolderID = null; | 382 | UUID? previousParentFolderID = null; |
383 | 383 | ||
384 | if (item != null && trashFolder != null) | 384 | if (item != null && trashFolder != null) |
385 | { | 385 | { |
386 | previousParentFolderID = item.Folder; | 386 | previousParentFolderID = item.Folder; |
@@ -404,18 +404,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
404 | client.SendBulkUpdateInventory(folder); | 404 | client.SendBulkUpdateInventory(folder); |
405 | } | 405 | } |
406 | } | 406 | } |
407 | 407 | ||
408 | if ((null == item && null == folder) | null == trashFolder) | 408 | if ((null == item && null == folder) | null == trashFolder) |
409 | { | 409 | { |
410 | string reason = String.Empty; | 410 | string reason = String.Empty; |
411 | 411 | ||
412 | if (trashFolder == null) | 412 | if (trashFolder == null) |
413 | reason += " Trash folder not found."; | 413 | reason += " Trash folder not found."; |
414 | if (item == null) | 414 | if (item == null) |
415 | reason += " Item not found."; | 415 | reason += " Item not found."; |
416 | if (folder == null) | 416 | if (folder == null) |
417 | reason += " Folder not found."; | 417 | reason += " Folder not found."; |
418 | 418 | ||
419 | client.SendAgentAlertMessage("Unable to delete "+ | 419 | client.SendAgentAlertMessage("Unable to delete "+ |
420 | "received inventory" + reason, false); | 420 | "received inventory" + reason, false); |
421 | } | 421 | } |
@@ -471,12 +471,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
471 | { | 471 | { |
472 | if (im.binaryBucket.Length < 17) // Invalid | 472 | if (im.binaryBucket.Length < 17) // Invalid |
473 | return; | 473 | return; |
474 | 474 | ||
475 | UUID recipientID = new UUID(im.toAgentID); | 475 | UUID recipientID = new UUID(im.toAgentID); |
476 | 476 | ||
477 | // First byte is the asset type | 477 | // First byte is the asset type |
478 | AssetType assetType = (AssetType)im.binaryBucket[0]; | 478 | AssetType assetType = (AssetType)im.binaryBucket[0]; |
479 | 479 | ||
480 | if (AssetType.Folder == assetType) | 480 | if (AssetType.Folder == assetType) |
481 | { | 481 | { |
482 | UUID folderID = new UUID(im.binaryBucket, 1); | 482 | UUID folderID = new UUID(im.binaryBucket, 1); |
@@ -505,12 +505,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
505 | { | 505 | { |
506 | if (im.binaryBucket.Length < 1) // Invalid | 506 | if (im.binaryBucket.Length < 1) // Invalid |
507 | return; | 507 | return; |
508 | 508 | ||
509 | UUID recipientID = new UUID(im.toAgentID); | 509 | UUID recipientID = new UUID(im.toAgentID); |
510 | 510 | ||
511 | // Bucket is the asset type | 511 | // Bucket is the asset type |
512 | AssetType assetType = (AssetType)im.binaryBucket[0]; | 512 | AssetType assetType = (AssetType)im.binaryBucket[0]; |
513 | 513 | ||
514 | if (AssetType.Folder == assetType) | 514 | if (AssetType.Folder == assetType) |
515 | { | 515 | { |
516 | UUID folderID = new UUID(im.imSessionID); | 516 | UUID folderID = new UUID(im.imSessionID); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs index 7ddc396..82ed091 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/Tests/InventoryTransferModuleTests.cs | |||
@@ -44,9 +44,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
44 | { | 44 | { |
45 | [TestFixture] | 45 | [TestFixture] |
46 | public class InventoryTransferModuleTests : OpenSimTestCase | 46 | public class InventoryTransferModuleTests : OpenSimTestCase |
47 | { | 47 | { |
48 | protected TestScene m_scene; | 48 | protected TestScene m_scene; |
49 | 49 | ||
50 | [SetUp] | 50 | [SetUp] |
51 | public override void SetUp() | 51 | public override void SetUp() |
52 | { | 52 | { |
@@ -56,9 +56,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
56 | config.AddConfig("Messaging"); | 56 | config.AddConfig("Messaging"); |
57 | config.Configs["Messaging"].Set("InventoryTransferModule", "InventoryTransferModule"); | 57 | config.Configs["Messaging"].Set("InventoryTransferModule", "InventoryTransferModule"); |
58 | 58 | ||
59 | m_scene = new SceneHelpers().SetupScene(); | 59 | m_scene = new SceneHelpers().SetupScene(); |
60 | SceneHelpers.SetupSceneModules(m_scene, config, new InventoryTransferModule()); | 60 | SceneHelpers.SetupSceneModules(m_scene, config, new InventoryTransferModule()); |
61 | } | 61 | } |
62 | 62 | ||
63 | [Test] | 63 | [Test] |
64 | public void TestAcceptGivenItem() | 64 | public void TestAcceptGivenItem() |
@@ -69,9 +69,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
69 | UUID itemId = TestHelpers.ParseTail(0x100); | 69 | UUID itemId = TestHelpers.ParseTail(0x100); |
70 | UUID assetId = TestHelpers.ParseTail(0x200); | 70 | UUID assetId = TestHelpers.ParseTail(0x200); |
71 | 71 | ||
72 | UserAccount ua1 | 72 | UserAccount ua1 |
73 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); | 73 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); |
74 | UserAccount ua2 | 74 | UserAccount ua2 |
75 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); | 75 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); |
76 | 76 | ||
77 | ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); | 77 | ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); |
@@ -81,7 +81,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
81 | TestClient receiverClient = (TestClient)receiverSp.ControllingClient; | 81 | TestClient receiverClient = (TestClient)receiverSp.ControllingClient; |
82 | 82 | ||
83 | // Create the object to test give | 83 | // Create the object to test give |
84 | InventoryItemBase originalItem | 84 | InventoryItemBase originalItem |
85 | = UserInventoryHelpers.CreateInventoryItem( | 85 | = UserInventoryHelpers.CreateInventoryItem( |
86 | m_scene, "givenObj", itemId, assetId, giverSp.UUID, InventoryType.Object); | 86 | m_scene, "givenObj", itemId, assetId, giverSp.UUID, InventoryType.Object); |
87 | 87 | ||
@@ -89,35 +89,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
89 | byte[] itemIdBytes = itemId.GetBytes(); | 89 | byte[] itemIdBytes = itemId.GetBytes(); |
90 | Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); | 90 | Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); |
91 | 91 | ||
92 | GridInstantMessage giveIm | 92 | GridInstantMessage giveIm |
93 | = new GridInstantMessage( | 93 | = new GridInstantMessage( |
94 | m_scene, | 94 | m_scene, |
95 | giverSp.UUID, | 95 | giverSp.UUID, |
96 | giverSp.Name, | 96 | giverSp.Name, |
97 | receiverSp.UUID, | 97 | receiverSp.UUID, |
98 | (byte)InstantMessageDialog.InventoryOffered, | 98 | (byte)InstantMessageDialog.InventoryOffered, |
99 | false, | 99 | false, |
100 | "inventory offered msg", | 100 | "inventory offered msg", |
101 | initialSessionId, | 101 | initialSessionId, |
102 | false, | 102 | false, |
103 | Vector3.Zero, | 103 | Vector3.Zero, |
104 | giveImBinaryBucket, | 104 | giveImBinaryBucket, |
105 | true); | 105 | true); |
106 | 106 | ||
107 | giverClient.HandleImprovedInstantMessage(giveIm); | 107 | giverClient.HandleImprovedInstantMessage(giveIm); |
108 | 108 | ||
109 | // These details might not all be correct. | 109 | // These details might not all be correct. |
110 | GridInstantMessage acceptIm | 110 | GridInstantMessage acceptIm |
111 | = new GridInstantMessage( | 111 | = new GridInstantMessage( |
112 | m_scene, | 112 | m_scene, |
113 | receiverSp.UUID, | 113 | receiverSp.UUID, |
114 | receiverSp.Name, | 114 | receiverSp.Name, |
115 | giverSp.UUID, | 115 | giverSp.UUID, |
116 | (byte)InstantMessageDialog.InventoryAccepted, | 116 | (byte)InstantMessageDialog.InventoryAccepted, |
117 | false, | 117 | false, |
118 | "inventory accepted msg", | 118 | "inventory accepted msg", |
119 | initialSessionId, | 119 | initialSessionId, |
120 | false, | 120 | false, |
121 | Vector3.Zero, | 121 | Vector3.Zero, |
122 | null, | 122 | null, |
123 | true); | 123 | true); |
@@ -133,7 +133,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
133 | Assert.That(originalItemAfterGive.ID, Is.EqualTo(originalItem.ID)); | 133 | Assert.That(originalItemAfterGive.ID, Is.EqualTo(originalItem.ID)); |
134 | 134 | ||
135 | // Test for item successfully making it into the receiver's inventory | 135 | // Test for item successfully making it into the receiver's inventory |
136 | InventoryItemBase receivedItem | 136 | InventoryItemBase receivedItem |
137 | = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, receiverSp.UUID, "Objects/givenObj"); | 137 | = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, receiverSp.UUID, "Objects/givenObj"); |
138 | 138 | ||
139 | Assert.That(receivedItem, Is.Not.Null); | 139 | Assert.That(receivedItem, Is.Not.Null); |
@@ -148,7 +148,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
148 | Assert.That(originalItemAfterDelete, Is.Not.Null); | 148 | Assert.That(originalItemAfterDelete, Is.Not.Null); |
149 | 149 | ||
150 | // TODO: Test scenario where giver deletes their item first. | 150 | // TODO: Test scenario where giver deletes their item first. |
151 | } | 151 | } |
152 | 152 | ||
153 | /// <summary> | 153 | /// <summary> |
154 | /// Test user rejection of a given item. | 154 | /// Test user rejection of a given item. |
@@ -165,9 +165,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
165 | UUID itemId = TestHelpers.ParseTail(0x100); | 165 | UUID itemId = TestHelpers.ParseTail(0x100); |
166 | UUID assetId = TestHelpers.ParseTail(0x200); | 166 | UUID assetId = TestHelpers.ParseTail(0x200); |
167 | 167 | ||
168 | UserAccount ua1 | 168 | UserAccount ua1 |
169 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); | 169 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); |
170 | UserAccount ua2 | 170 | UserAccount ua2 |
171 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); | 171 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); |
172 | 172 | ||
173 | ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); | 173 | ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); |
@@ -177,7 +177,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
177 | TestClient receiverClient = (TestClient)receiverSp.ControllingClient; | 177 | TestClient receiverClient = (TestClient)receiverSp.ControllingClient; |
178 | 178 | ||
179 | // Create the object to test give | 179 | // Create the object to test give |
180 | InventoryItemBase originalItem | 180 | InventoryItemBase originalItem |
181 | = UserInventoryHelpers.CreateInventoryItem( | 181 | = UserInventoryHelpers.CreateInventoryItem( |
182 | m_scene, "givenObj", itemId, assetId, giverSp.UUID, InventoryType.Object); | 182 | m_scene, "givenObj", itemId, assetId, giverSp.UUID, InventoryType.Object); |
183 | 183 | ||
@@ -188,36 +188,36 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
188 | byte[] itemIdBytes = itemId.GetBytes(); | 188 | byte[] itemIdBytes = itemId.GetBytes(); |
189 | Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); | 189 | Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); |
190 | 190 | ||
191 | GridInstantMessage giveIm | 191 | GridInstantMessage giveIm |
192 | = new GridInstantMessage( | 192 | = new GridInstantMessage( |
193 | m_scene, | 193 | m_scene, |
194 | giverSp.UUID, | 194 | giverSp.UUID, |
195 | giverSp.Name, | 195 | giverSp.Name, |
196 | receiverSp.UUID, | 196 | receiverSp.UUID, |
197 | (byte)InstantMessageDialog.InventoryOffered, | 197 | (byte)InstantMessageDialog.InventoryOffered, |
198 | false, | 198 | false, |
199 | "inventory offered msg", | 199 | "inventory offered msg", |
200 | initialSessionId, | 200 | initialSessionId, |
201 | false, | 201 | false, |
202 | Vector3.Zero, | 202 | Vector3.Zero, |
203 | giveImBinaryBucket, | 203 | giveImBinaryBucket, |
204 | true); | 204 | true); |
205 | 205 | ||
206 | giverClient.HandleImprovedInstantMessage(giveIm); | 206 | giverClient.HandleImprovedInstantMessage(giveIm); |
207 | 207 | ||
208 | // These details might not all be correct. | 208 | // These details might not all be correct. |
209 | // Session ID is now the created item ID (!) | 209 | // Session ID is now the created item ID (!) |
210 | GridInstantMessage rejectIm | 210 | GridInstantMessage rejectIm |
211 | = new GridInstantMessage( | 211 | = new GridInstantMessage( |
212 | m_scene, | 212 | m_scene, |
213 | receiverSp.UUID, | 213 | receiverSp.UUID, |
214 | receiverSp.Name, | 214 | receiverSp.Name, |
215 | giverSp.UUID, | 215 | giverSp.UUID, |
216 | (byte)InstantMessageDialog.InventoryDeclined, | 216 | (byte)InstantMessageDialog.InventoryDeclined, |
217 | false, | 217 | false, |
218 | "inventory declined msg", | 218 | "inventory declined msg", |
219 | new UUID(receivedIm.imSessionID), | 219 | new UUID(receivedIm.imSessionID), |
220 | false, | 220 | false, |
221 | Vector3.Zero, | 221 | Vector3.Zero, |
222 | null, | 222 | null, |
223 | true); | 223 | true); |
@@ -233,7 +233,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
233 | Assert.That(originalItemAfterGive.ID, Is.EqualTo(originalItem.ID)); | 233 | Assert.That(originalItemAfterGive.ID, Is.EqualTo(originalItem.ID)); |
234 | 234 | ||
235 | // Test for item successfully making it into the receiver's inventory | 235 | // Test for item successfully making it into the receiver's inventory |
236 | InventoryItemBase receivedItem | 236 | InventoryItemBase receivedItem |
237 | = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, receiverSp.UUID, "Trash/givenObj"); | 237 | = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, receiverSp.UUID, "Trash/givenObj"); |
238 | 238 | ||
239 | InventoryFolderBase trashFolder | 239 | InventoryFolderBase trashFolder |
@@ -250,7 +250,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
250 | = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, giverSp.UUID, "Objects/givenObj"); | 250 | = UserInventoryHelpers.GetInventoryItem(m_scene.InventoryService, giverSp.UUID, "Objects/givenObj"); |
251 | 251 | ||
252 | Assert.That(originalItemAfterDelete, Is.Not.Null); | 252 | Assert.That(originalItemAfterDelete, Is.Not.Null); |
253 | } | 253 | } |
254 | 254 | ||
255 | [Test] | 255 | [Test] |
256 | public void TestAcceptGivenFolder() | 256 | public void TestAcceptGivenFolder() |
@@ -261,9 +261,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
261 | UUID initialSessionId = TestHelpers.ParseTail(0x10); | 261 | UUID initialSessionId = TestHelpers.ParseTail(0x10); |
262 | UUID folderId = TestHelpers.ParseTail(0x100); | 262 | UUID folderId = TestHelpers.ParseTail(0x100); |
263 | 263 | ||
264 | UserAccount ua1 | 264 | UserAccount ua1 |
265 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); | 265 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); |
266 | UserAccount ua2 | 266 | UserAccount ua2 |
267 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); | 267 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); |
268 | 268 | ||
269 | ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); | 269 | ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); |
@@ -272,7 +272,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
272 | ScenePresence receiverSp = SceneHelpers.AddScenePresence(m_scene, ua2); | 272 | ScenePresence receiverSp = SceneHelpers.AddScenePresence(m_scene, ua2); |
273 | TestClient receiverClient = (TestClient)receiverSp.ControllingClient; | 273 | TestClient receiverClient = (TestClient)receiverSp.ControllingClient; |
274 | 274 | ||
275 | InventoryFolderBase originalFolder | 275 | InventoryFolderBase originalFolder |
276 | = UserInventoryHelpers.CreateInventoryFolder( | 276 | = UserInventoryHelpers.CreateInventoryFolder( |
277 | m_scene.InventoryService, giverSp.UUID, folderId, "f1", true); | 277 | m_scene.InventoryService, giverSp.UUID, folderId, "f1", true); |
278 | 278 | ||
@@ -281,35 +281,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
281 | byte[] itemIdBytes = folderId.GetBytes(); | 281 | byte[] itemIdBytes = folderId.GetBytes(); |
282 | Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); | 282 | Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); |
283 | 283 | ||
284 | GridInstantMessage giveIm | 284 | GridInstantMessage giveIm |
285 | = new GridInstantMessage( | 285 | = new GridInstantMessage( |
286 | m_scene, | 286 | m_scene, |
287 | giverSp.UUID, | 287 | giverSp.UUID, |
288 | giverSp.Name, | 288 | giverSp.Name, |
289 | receiverSp.UUID, | 289 | receiverSp.UUID, |
290 | (byte)InstantMessageDialog.InventoryOffered, | 290 | (byte)InstantMessageDialog.InventoryOffered, |
291 | false, | 291 | false, |
292 | "inventory offered msg", | 292 | "inventory offered msg", |
293 | initialSessionId, | 293 | initialSessionId, |
294 | false, | 294 | false, |
295 | Vector3.Zero, | 295 | Vector3.Zero, |
296 | giveImBinaryBucket, | 296 | giveImBinaryBucket, |
297 | true); | 297 | true); |
298 | 298 | ||
299 | giverClient.HandleImprovedInstantMessage(giveIm); | 299 | giverClient.HandleImprovedInstantMessage(giveIm); |
300 | 300 | ||
301 | // These details might not all be correct. | 301 | // These details might not all be correct. |
302 | GridInstantMessage acceptIm | 302 | GridInstantMessage acceptIm |
303 | = new GridInstantMessage( | 303 | = new GridInstantMessage( |
304 | m_scene, | 304 | m_scene, |
305 | receiverSp.UUID, | 305 | receiverSp.UUID, |
306 | receiverSp.Name, | 306 | receiverSp.Name, |
307 | giverSp.UUID, | 307 | giverSp.UUID, |
308 | (byte)InstantMessageDialog.InventoryAccepted, | 308 | (byte)InstantMessageDialog.InventoryAccepted, |
309 | false, | 309 | false, |
310 | "inventory accepted msg", | 310 | "inventory accepted msg", |
311 | initialSessionId, | 311 | initialSessionId, |
312 | false, | 312 | false, |
313 | Vector3.Zero, | 313 | Vector3.Zero, |
314 | null, | 314 | null, |
315 | true); | 315 | true); |
@@ -325,7 +325,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
325 | Assert.That(originalFolderAfterGive.ID, Is.EqualTo(originalFolder.ID)); | 325 | Assert.That(originalFolderAfterGive.ID, Is.EqualTo(originalFolder.ID)); |
326 | 326 | ||
327 | // Test for item successfully making it into the receiver's inventory | 327 | // Test for item successfully making it into the receiver's inventory |
328 | InventoryFolderBase receivedFolder | 328 | InventoryFolderBase receivedFolder |
329 | = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, receiverSp.UUID, "f1"); | 329 | = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, receiverSp.UUID, "f1"); |
330 | 330 | ||
331 | Assert.That(receivedFolder, Is.Not.Null); | 331 | Assert.That(receivedFolder, Is.Not.Null); |
@@ -340,7 +340,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
340 | Assert.That(originalFolderAfterDelete, Is.Not.Null); | 340 | Assert.That(originalFolderAfterDelete, Is.Not.Null); |
341 | 341 | ||
342 | // TODO: Test scenario where giver deletes their item first. | 342 | // TODO: Test scenario where giver deletes their item first. |
343 | } | 343 | } |
344 | 344 | ||
345 | /// <summary> | 345 | /// <summary> |
346 | /// Test user rejection of a given item. | 346 | /// Test user rejection of a given item. |
@@ -357,9 +357,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
357 | UUID initialSessionId = TestHelpers.ParseTail(0x10); | 357 | UUID initialSessionId = TestHelpers.ParseTail(0x10); |
358 | UUID folderId = TestHelpers.ParseTail(0x100); | 358 | UUID folderId = TestHelpers.ParseTail(0x100); |
359 | 359 | ||
360 | UserAccount ua1 | 360 | UserAccount ua1 |
361 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); | 361 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "One", TestHelpers.ParseTail(0x1), "pw"); |
362 | UserAccount ua2 | 362 | UserAccount ua2 |
363 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); | 363 | = UserAccountHelpers.CreateUserWithInventory(m_scene, "User", "Two", TestHelpers.ParseTail(0x2), "pw"); |
364 | 364 | ||
365 | ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); | 365 | ScenePresence giverSp = SceneHelpers.AddScenePresence(m_scene, ua1); |
@@ -369,7 +369,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
369 | TestClient receiverClient = (TestClient)receiverSp.ControllingClient; | 369 | TestClient receiverClient = (TestClient)receiverSp.ControllingClient; |
370 | 370 | ||
371 | // Create the folder to test give | 371 | // Create the folder to test give |
372 | InventoryFolderBase originalFolder | 372 | InventoryFolderBase originalFolder |
373 | = UserInventoryHelpers.CreateInventoryFolder( | 373 | = UserInventoryHelpers.CreateInventoryFolder( |
374 | m_scene.InventoryService, giverSp.UUID, folderId, "f1", true); | 374 | m_scene.InventoryService, giverSp.UUID, folderId, "f1", true); |
375 | 375 | ||
@@ -381,36 +381,36 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
381 | byte[] itemIdBytes = folderId.GetBytes(); | 381 | byte[] itemIdBytes = folderId.GetBytes(); |
382 | Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); | 382 | Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); |
383 | 383 | ||
384 | GridInstantMessage giveIm | 384 | GridInstantMessage giveIm |
385 | = new GridInstantMessage( | 385 | = new GridInstantMessage( |
386 | m_scene, | 386 | m_scene, |
387 | giverSp.UUID, | 387 | giverSp.UUID, |
388 | giverSp.Name, | 388 | giverSp.Name, |
389 | receiverSp.UUID, | 389 | receiverSp.UUID, |
390 | (byte)InstantMessageDialog.InventoryOffered, | 390 | (byte)InstantMessageDialog.InventoryOffered, |
391 | false, | 391 | false, |
392 | "inventory offered msg", | 392 | "inventory offered msg", |
393 | initialSessionId, | 393 | initialSessionId, |
394 | false, | 394 | false, |
395 | Vector3.Zero, | 395 | Vector3.Zero, |
396 | giveImBinaryBucket, | 396 | giveImBinaryBucket, |
397 | true); | 397 | true); |
398 | 398 | ||
399 | giverClient.HandleImprovedInstantMessage(giveIm); | 399 | giverClient.HandleImprovedInstantMessage(giveIm); |
400 | 400 | ||
401 | // These details might not all be correct. | 401 | // These details might not all be correct. |
402 | // Session ID is now the created item ID (!) | 402 | // Session ID is now the created item ID (!) |
403 | GridInstantMessage rejectIm | 403 | GridInstantMessage rejectIm |
404 | = new GridInstantMessage( | 404 | = new GridInstantMessage( |
405 | m_scene, | 405 | m_scene, |
406 | receiverSp.UUID, | 406 | receiverSp.UUID, |
407 | receiverSp.Name, | 407 | receiverSp.Name, |
408 | giverSp.UUID, | 408 | giverSp.UUID, |
409 | (byte)InstantMessageDialog.InventoryDeclined, | 409 | (byte)InstantMessageDialog.InventoryDeclined, |
410 | false, | 410 | false, |
411 | "inventory declined msg", | 411 | "inventory declined msg", |
412 | new UUID(receivedIm.imSessionID), | 412 | new UUID(receivedIm.imSessionID), |
413 | false, | 413 | false, |
414 | Vector3.Zero, | 414 | Vector3.Zero, |
415 | null, | 415 | null, |
416 | true); | 416 | true); |
@@ -426,7 +426,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
426 | Assert.That(originalFolderAfterGive.ID, Is.EqualTo(originalFolder.ID)); | 426 | Assert.That(originalFolderAfterGive.ID, Is.EqualTo(originalFolder.ID)); |
427 | 427 | ||
428 | // Test for folder successfully making it into the receiver's inventory | 428 | // Test for folder successfully making it into the receiver's inventory |
429 | InventoryFolderBase receivedFolder | 429 | InventoryFolderBase receivedFolder |
430 | = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, receiverSp.UUID, "Trash/f1"); | 430 | = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, receiverSp.UUID, "Trash/f1"); |
431 | 431 | ||
432 | InventoryFolderBase trashFolder | 432 | InventoryFolderBase trashFolder |
@@ -443,6 +443,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.Tests | |||
443 | = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, giverSp.UUID, "f1"); | 443 | = UserInventoryHelpers.GetInventoryFolder(m_scene.InventoryService, giverSp.UUID, "f1"); |
444 | 444 | ||
445 | Assert.That(originalFolderAfterDelete, Is.Not.Null); | 445 | Assert.That(originalFolderAfterDelete, Is.Not.Null); |
446 | } | 446 | } |
447 | } | 447 | } |
448 | } \ No newline at end of file | 448 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs index 24286a4..10781e9 100644 --- a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs | |||
@@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure | |||
65 | { | 65 | { |
66 | m_Enabled = true; | 66 | m_Enabled = true; |
67 | 67 | ||
68 | m_ThisGridURL = Util.GetConfigVarFromSections<string>(config, "GatekeeperURI", | 68 | m_ThisGridURL = Util.GetConfigVarFromSections<string>(config, "GatekeeperURI", |
69 | new string[] { "Startup", "Hypergrid", "Messaging" }, String.Empty); | 69 | new string[] { "Startup", "Hypergrid", "Messaging" }, String.Empty); |
70 | // Legacy. Remove soon! | 70 | // Legacy. Remove soon! |
71 | m_ThisGridURL = config.Configs["Messaging"].GetString("Gatekeeper", m_ThisGridURL); | 71 | m_ThisGridURL = config.Configs["Messaging"].GetString("Gatekeeper", m_ThisGridURL); |
@@ -154,7 +154,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure | |||
154 | 154 | ||
155 | void OnIncomingInstantMessage(GridInstantMessage im) | 155 | void OnIncomingInstantMessage(GridInstantMessage im) |
156 | { | 156 | { |
157 | if (im.dialog == (byte)InstantMessageDialog.RequestTeleport | 157 | if (im.dialog == (byte)InstantMessageDialog.RequestTeleport |
158 | || im.dialog == (byte)InstantMessageDialog.GodLikeRequestTeleport) | 158 | || im.dialog == (byte)InstantMessageDialog.GodLikeRequestTeleport) |
159 | { | 159 | { |
160 | UUID sessionID = new UUID(im.imSessionID); | 160 | UUID sessionID = new UUID(im.imSessionID); |
@@ -195,7 +195,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure | |||
195 | 195 | ||
196 | m_log.DebugFormat("[HG LURE MODULE]: RequestTeleport sessionID={0}, regionID={1}, message={2}", m.imSessionID, m.RegionID, m.message); | 196 | m_log.DebugFormat("[HG LURE MODULE]: RequestTeleport sessionID={0}, regionID={1}, message={2}", m.imSessionID, m.RegionID, m.message); |
197 | m_PendingLures.Add(sessionID, m, 7200); // 2 hours | 197 | m_PendingLures.Add(sessionID, m, 7200); // 2 hours |
198 | 198 | ||
199 | if (m_TransferModule != null) | 199 | if (m_TransferModule != null) |
200 | { | 200 | { |
201 | m_TransferModule.SendInstantMessage(m, | 201 | m_TransferModule.SendInstantMessage(m, |
diff --git a/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs index 0b1dbc7..1e1caca 100644 --- a/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Profile/BasicProfileModule.cs | |||
@@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile | |||
68 | { | 68 | { |
69 | if (!m_Enabled) | 69 | if (!m_Enabled) |
70 | return; | 70 | return; |
71 | 71 | ||
72 | lock (m_Scenes) | 72 | lock (m_Scenes) |
73 | { | 73 | { |
74 | if (!m_Scenes.Contains(scene)) | 74 | if (!m_Scenes.Contains(scene)) |
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index df5265c..138c0f7 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs | |||
@@ -85,7 +85,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
85 | /// <value> | 85 | /// <value> |
86 | /// The configuration | 86 | /// The configuration |
87 | /// </value> | 87 | /// </value> |
88 | public IConfigSource Config | 88 | public IConfigSource Config |
89 | { | 89 | { |
90 | get; | 90 | get; |
91 | set; | 91 | set; |
@@ -97,7 +97,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
97 | /// <value> | 97 | /// <value> |
98 | /// The profile server URI. | 98 | /// The profile server URI. |
99 | /// </value> | 99 | /// </value> |
100 | public string ProfileServerUri | 100 | public string ProfileServerUri |
101 | { | 101 | { |
102 | get; | 102 | get; |
103 | set; | 103 | set; |
@@ -120,13 +120,13 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
120 | /// <value> | 120 | /// <value> |
121 | /// <c>true</c> if enabled; otherwise, <c>false</c>. | 121 | /// <c>true</c> if enabled; otherwise, <c>false</c>. |
122 | /// </value> | 122 | /// </value> |
123 | public bool Enabled | 123 | public bool Enabled |
124 | { | 124 | { |
125 | get; | 125 | get; |
126 | set; | 126 | set; |
127 | } | 127 | } |
128 | 128 | ||
129 | public string MyGatekeeper | 129 | public string MyGatekeeper |
130 | { | 130 | { |
131 | get; private set; | 131 | get; private set; |
132 | } | 132 | } |
@@ -135,7 +135,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
135 | /// <summary> | 135 | /// <summary> |
136 | /// This is called to initialize the region module. For shared modules, this is called exactly once, after | 136 | /// This is called to initialize the region module. For shared modules, this is called exactly once, after |
137 | /// creating the single (shared) instance. For non-shared modules, this is called once on each instance, after | 137 | /// creating the single (shared) instance. For non-shared modules, this is called once on each instance, after |
138 | /// the instace for the region has been created. | 138 | /// the instace for the region has been created. |
139 | /// </summary> | 139 | /// </summary> |
140 | /// <param name='source'> | 140 | /// <param name='source'> |
141 | /// Source. | 141 | /// Source. |
@@ -162,7 +162,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
162 | Enabled = false; | 162 | Enabled = false; |
163 | return; | 163 | return; |
164 | } | 164 | } |
165 | 165 | ||
166 | m_allowUserProfileWebURLs = profileConfig.GetBoolean("AllowUserProfileWebURLs", m_allowUserProfileWebURLs); | 166 | m_allowUserProfileWebURLs = profileConfig.GetBoolean("AllowUserProfileWebURLs", m_allowUserProfileWebURLs); |
167 | 167 | ||
168 | m_log.Debug("[PROFILES]: Full Profiles Enabled"); | 168 | m_log.Debug("[PROFILES]: Full Profiles Enabled"); |
@@ -212,7 +212,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
212 | /// This will be called once for every scene loaded. In a shared module this will be multiple times in one | 212 | /// This will be called once for every scene loaded. In a shared module this will be multiple times in one |
213 | /// instance, while a nonshared module instance will only be called once. This method is called after AddRegion | 213 | /// instance, while a nonshared module instance will only be called once. This method is called after AddRegion |
214 | /// has been called in all modules for that scene, providing an opportunity to request another module's | 214 | /// has been called in all modules for that scene, providing an opportunity to request another module's |
215 | /// interface, or hook an event from another module. | 215 | /// interface, or hook an event from another module. |
216 | /// </summary> | 216 | /// </summary> |
217 | /// <param name='scene'> | 217 | /// <param name='scene'> |
218 | /// Scene. | 218 | /// Scene. |
@@ -230,7 +230,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
230 | /// module has registered the interface by then, this module will be activated, else it will remain inactive, | 230 | /// module has registered the interface by then, this module will be activated, else it will remain inactive, |
231 | /// letting the other module take over. This should return non-null ONLY in modules that are intended to be | 231 | /// letting the other module take over. This should return non-null ONLY in modules that are intended to be |
232 | /// easily replaceable, e.g. stub implementations that the developer expects to be replaced by third party | 232 | /// easily replaceable, e.g. stub implementations that the developer expects to be replaced by third party |
233 | /// provided modules. | 233 | /// provided modules. |
234 | /// </summary> | 234 | /// </summary> |
235 | /// <value> | 235 | /// <value> |
236 | /// The replaceable interface. | 236 | /// The replaceable interface. |
@@ -248,7 +248,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
248 | } | 248 | } |
249 | 249 | ||
250 | /// <value> | 250 | /// <value> |
251 | /// The name of the module | 251 | /// The name of the module |
252 | /// </value> | 252 | /// </value> |
253 | /// <summary> | 253 | /// <summary> |
254 | /// Gets the module name. | 254 | /// Gets the module name. |
@@ -451,7 +451,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
451 | } | 451 | } |
452 | 452 | ||
453 | public void ClassifiedInfoRequest(UUID queryClassifiedID, IClientAPI remoteClient) | 453 | public void ClassifiedInfoRequest(UUID queryClassifiedID, IClientAPI remoteClient) |
454 | { | 454 | { |
455 | UUID target = remoteClient.AgentId; | 455 | UUID target = remoteClient.AgentId; |
456 | UserClassifiedAdd ad = new UserClassifiedAdd(); | 456 | UserClassifiedAdd ad = new UserClassifiedAdd(); |
457 | ad.ClassifiedId = queryClassifiedID; | 457 | ad.ClassifiedId = queryClassifiedID; |
@@ -459,7 +459,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
459 | lock (m_classifiedCache) | 459 | lock (m_classifiedCache) |
460 | { | 460 | { |
461 | if (m_classifiedCache.ContainsKey(queryClassifiedID)) | 461 | if (m_classifiedCache.ContainsKey(queryClassifiedID)) |
462 | { | 462 | { |
463 | target = m_classifiedCache[queryClassifiedID]; | 463 | target = m_classifiedCache[queryClassifiedID]; |
464 | 464 | ||
465 | m_classifiedInterest[queryClassifiedID] --; | 465 | m_classifiedInterest[queryClassifiedID] --; |
@@ -870,7 +870,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
870 | 870 | ||
871 | string theirGatekeeperURI; | 871 | string theirGatekeeperURI; |
872 | GetUserGatekeeperURI(targetID, out theirGatekeeperURI); | 872 | GetUserGatekeeperURI(targetID, out theirGatekeeperURI); |
873 | 873 | ||
874 | object Pick = (object)pick; | 874 | object Pick = (object)pick; |
875 | if (!rpc.JsonRpcRequest (ref Pick, "pickinforequest", serverURI, UUID.Random ().ToString ())) { | 875 | if (!rpc.JsonRpcRequest (ref Pick, "pickinforequest", serverURI, UUID.Random ().ToString ())) { |
876 | remoteClient.SendAgentAlertMessage ( | 876 | remoteClient.SendAgentAlertMessage ( |
@@ -880,11 +880,11 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
880 | pick = (UserProfilePick)Pick; | 880 | pick = (UserProfilePick)Pick; |
881 | if(foreign) | 881 | if(foreign) |
882 | cacheForeignImage(targetID, pick.SnapshotId); | 882 | cacheForeignImage(targetID, pick.SnapshotId); |
883 | 883 | ||
884 | Vector3 globalPos = new Vector3(Vector3.Zero); | 884 | Vector3 globalPos = new Vector3(Vector3.Zero); |
885 | Vector3.TryParse(pick.GlobalPos, out globalPos); | 885 | Vector3.TryParse(pick.GlobalPos, out globalPos); |
886 | 886 | ||
887 | if (!string.IsNullOrWhiteSpace(MyGatekeeper) && pick.Gatekeeper != MyGatekeeper) | 887 | if (!string.IsNullOrWhiteSpace(MyGatekeeper) && pick.Gatekeeper != MyGatekeeper) |
888 | { | 888 | { |
889 | // Setup the illusion | 889 | // Setup the illusion |
890 | string region = string.Format("{0} {1}",pick.Gatekeeper,pick.SimName); | 890 | string region = string.Format("{0} {1}",pick.Gatekeeper,pick.SimName); |
@@ -896,7 +896,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
896 | } | 896 | } |
897 | else | 897 | else |
898 | { | 898 | { |
899 | // we have a proxy on map | 899 | // we have a proxy on map |
900 | ulong oriHandle; | 900 | ulong oriHandle; |
901 | uint oriX; | 901 | uint oriX; |
902 | uint oriY; | 902 | uint oriY; |
@@ -909,7 +909,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
909 | } | 909 | } |
910 | else | 910 | else |
911 | { | 911 | { |
912 | // this is a fail on large regions | 912 | // this is a fail on large regions |
913 | uint gtmp = (uint)globalPos.X >> 8; | 913 | uint gtmp = (uint)globalPos.X >> 8; |
914 | globalPos.X -= (gtmp << 8); | 914 | globalPos.X -= (gtmp << 8); |
915 | 915 | ||
@@ -975,7 +975,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
975 | /// Enabled. | 975 | /// Enabled. |
976 | /// </param> | 976 | /// </param> |
977 | public void PickInfoUpdate(IClientAPI remoteClient, UUID pickID, UUID creatorID, bool topPick, string name, string desc, UUID snapshotID, int sortOrder, bool enabled) | 977 | public void PickInfoUpdate(IClientAPI remoteClient, UUID pickID, UUID creatorID, bool topPick, string name, string desc, UUID snapshotID, int sortOrder, bool enabled) |
978 | { | 978 | { |
979 | m_log.DebugFormat("[PROFILES]: Start PickInfoUpdate Name: {0} PickId: {1} SnapshotId: {2}", name, pickID.ToString(), snapshotID.ToString()); | 979 | m_log.DebugFormat("[PROFILES]: Start PickInfoUpdate Name: {0} PickId: {1} SnapshotId: {2}", name, pickID.ToString(), snapshotID.ToString()); |
980 | 980 | ||
981 | UserProfilePick pick = new UserProfilePick(); | 981 | UserProfilePick pick = new UserProfilePick(); |
@@ -1012,7 +1012,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
1012 | else | 1012 | else |
1013 | { | 1013 | { |
1014 | m_log.WarnFormat( | 1014 | m_log.WarnFormat( |
1015 | "[PROFILES]: PickInfoUpdate found no parcel info at {0},{1} in {2}", | 1015 | "[PROFILES]: PickInfoUpdate found no parcel info at {0},{1} in {2}", |
1016 | avaPos.X, avaPos.Y, p.Scene.Name); | 1016 | avaPos.X, avaPos.Y, p.Scene.Name); |
1017 | } | 1017 | } |
1018 | 1018 | ||
@@ -1146,7 +1146,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
1146 | remoteClient.SendAvatarNotesReply(note.TargetId, note.Notes); | 1146 | remoteClient.SendAvatarNotesReply(note.TargetId, note.Notes); |
1147 | return; | 1147 | return; |
1148 | } | 1148 | } |
1149 | note = (UserProfileNotes) Note; | 1149 | note = (UserProfileNotes) Note; |
1150 | remoteClient.SendAvatarNotesReply(note.TargetId, note.Notes); | 1150 | remoteClient.SendAvatarNotesReply(note.TargetId, note.Notes); |
1151 | } | 1151 | } |
1152 | 1152 | ||
@@ -1225,10 +1225,10 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
1225 | { | 1225 | { |
1226 | m_log.InfoFormat("[PROFILES]: UserPreferences update error"); | 1226 | m_log.InfoFormat("[PROFILES]: UserPreferences update error"); |
1227 | remoteClient.SendAgentAlertMessage("Error updating preferences", false); | 1227 | remoteClient.SendAgentAlertMessage("Error updating preferences", false); |
1228 | return; | 1228 | return; |
1229 | } | 1229 | } |
1230 | } | 1230 | } |
1231 | 1231 | ||
1232 | /// <summary> | 1232 | /// <summary> |
1233 | /// Users the preferences request. | 1233 | /// Users the preferences request. |
1234 | /// </summary> | 1234 | /// </summary> |
@@ -1256,7 +1256,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
1256 | pref = (UserPreferences) Pref; | 1256 | pref = (UserPreferences) Pref; |
1257 | 1257 | ||
1258 | remoteClient.SendUserInfoReply(pref.IMViaEmail, pref.Visible, pref.EMail); | 1258 | remoteClient.SendUserInfoReply(pref.IMViaEmail, pref.Visible, pref.EMail); |
1259 | 1259 | ||
1260 | } | 1260 | } |
1261 | #endregion User Preferences | 1261 | #endregion User Preferences |
1262 | 1262 | ||
@@ -1437,7 +1437,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
1437 | { | 1437 | { |
1438 | props.AboutText ="Profile not available at this time. User may still be unknown to this grid"; | 1438 | props.AboutText ="Profile not available at this time. User may still be unknown to this grid"; |
1439 | } | 1439 | } |
1440 | 1440 | ||
1441 | if(!m_allowUserProfileWebURLs) | 1441 | if(!m_allowUserProfileWebURLs) |
1442 | props.WebUrl =""; | 1442 | props.WebUrl =""; |
1443 | 1443 | ||
@@ -1568,7 +1568,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
1568 | { | 1568 | { |
1569 | m_log.Debug( | 1569 | m_log.Debug( |
1570 | string.Format( | 1570 | string.Format( |
1571 | "[PROFILES]: Request using the OpenProfile API for user {0} to {1} failed", | 1571 | "[PROFILES]: Request using the OpenProfile API for user {0} to {1} failed", |
1572 | properties.UserId, serverURI), | 1572 | properties.UserId, serverURI), |
1573 | e); | 1573 | e); |
1574 | 1574 | ||
@@ -1586,7 +1586,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
1586 | return false; | 1586 | return false; |
1587 | } | 1587 | } |
1588 | } | 1588 | } |
1589 | 1589 | ||
1590 | properties = (UserProfileProperties)Prop; | 1590 | properties = (UserProfileProperties)Prop; |
1591 | if(foreign) | 1591 | if(foreign) |
1592 | { | 1592 | { |
@@ -1704,7 +1704,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
1704 | { | 1704 | { |
1705 | bool local; | 1705 | bool local; |
1706 | local = UserManagementModule.IsLocalGridUser(userID); | 1706 | local = UserManagementModule.IsLocalGridUser(userID); |
1707 | 1707 | ||
1708 | if (!local) | 1708 | if (!local) |
1709 | { | 1709 | { |
1710 | serverURI = UserManagementModule.GetUserServerURL(userID, "GatekeeperURI"); | 1710 | serverURI = UserManagementModule.GetUserServerURL(userID, "GatekeeperURI"); |
@@ -1761,13 +1761,13 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
1761 | 1761 | ||
1762 | string imageIDstr = imageID.ToString(); | 1762 | string imageIDstr = imageID.ToString(); |
1763 | 1763 | ||
1764 | 1764 | ||
1765 | if(m_assetCache != null && m_assetCache.Check(imageIDstr)) | 1765 | if(m_assetCache != null && m_assetCache.Check(imageIDstr)) |
1766 | return; | 1766 | return; |
1767 | 1767 | ||
1768 | if(Scene.AssetService.Get(imageIDstr) != null) | 1768 | if(Scene.AssetService.Get(imageIDstr) != null) |
1769 | return; | 1769 | return; |
1770 | 1770 | ||
1771 | Scene.AssetService.Get(string.Format("{0}/{1}", assetServerURI, imageIDstr)); | 1771 | Scene.AssetService.Get(string.Format("{0}/{1}", assetServerURI, imageIDstr)); |
1772 | } | 1772 | } |
1773 | 1773 | ||
@@ -1876,7 +1876,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles | |||
1876 | 1876 | ||
1877 | if (mret.ContainsKey("error")) | 1877 | if (mret.ContainsKey("error")) |
1878 | return false; | 1878 | return false; |
1879 | 1879 | ||
1880 | // get params... | 1880 | // get params... |
1881 | OSD.DeserializeMembers(ref parameters, (OSDMap) mret["result"]); | 1881 | OSD.DeserializeMembers(ref parameters, (OSDMap) mret["result"]); |
1882 | return true; | 1882 | return true; |
diff --git a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs index 386694a..292099d 100644 --- a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs | |||
@@ -47,23 +47,23 @@ namespace OpenSim.Region.CoreModules.Framework | |||
47 | { | 47 | { |
48 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "CapabilitiesModule")] | 48 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "CapabilitiesModule")] |
49 | public class CapabilitiesModule : INonSharedRegionModule, ICapabilitiesModule | 49 | public class CapabilitiesModule : INonSharedRegionModule, ICapabilitiesModule |
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 | private string m_showCapsCommandFormat = " {0,-38} {1,-60}\n"; | 53 | private string m_showCapsCommandFormat = " {0,-38} {1,-60}\n"; |
54 | 54 | ||
55 | protected Scene m_scene; | 55 | protected Scene m_scene; |
56 | 56 | ||
57 | /// <summary> | 57 | /// <summary> |
58 | /// Each agent has its own capabilities handler. | 58 | /// Each agent has its own capabilities handler. |
59 | /// </summary> | 59 | /// </summary> |
60 | protected Dictionary<uint, Caps> m_capsObjects = new Dictionary<uint, Caps>(); | 60 | protected Dictionary<uint, Caps> m_capsObjects = new Dictionary<uint, Caps>(); |
61 | 61 | ||
62 | protected Dictionary<UUID, string> m_capsPaths = new Dictionary<UUID, string>(); | 62 | protected Dictionary<UUID, string> m_capsPaths = new Dictionary<UUID, string>(); |
63 | 63 | ||
64 | protected Dictionary<UUID, Dictionary<ulong, string>> m_childrenSeeds | 64 | protected Dictionary<UUID, Dictionary<ulong, string>> m_childrenSeeds |
65 | = new Dictionary<UUID, Dictionary<ulong, string>>(); | 65 | = new Dictionary<UUID, Dictionary<ulong, string>>(); |
66 | 66 | ||
67 | public void Initialise(IConfigSource source) | 67 | public void Initialise(IConfigSource source) |
68 | { | 68 | { |
69 | } | 69 | } |
@@ -101,16 +101,16 @@ namespace OpenSim.Region.CoreModules.Framework | |||
101 | { | 101 | { |
102 | m_scene.UnregisterModuleInterface<ICapabilitiesModule>(this); | 102 | m_scene.UnregisterModuleInterface<ICapabilitiesModule>(this); |
103 | } | 103 | } |
104 | 104 | ||
105 | public void PostInitialise() | 105 | public void PostInitialise() |
106 | { | 106 | { |
107 | } | 107 | } |
108 | 108 | ||
109 | public void Close() {} | 109 | public void Close() {} |
110 | 110 | ||
111 | public string Name | 111 | public string Name |
112 | { | 112 | { |
113 | get { return "Capabilities Module"; } | 113 | get { return "Capabilities Module"; } |
114 | } | 114 | } |
115 | 115 | ||
116 | public Type ReplaceableInterface | 116 | public Type ReplaceableInterface |
@@ -154,7 +154,7 @@ namespace OpenSim.Region.CoreModules.Framework | |||
154 | // new object created below | 154 | // new object created below |
155 | oldCaps.DeregisterHandlers(); | 155 | oldCaps.DeregisterHandlers(); |
156 | 156 | ||
157 | // Better safe ... should not be needed but also | 157 | // Better safe ... should not be needed but also |
158 | // no big deal | 158 | // no big deal |
159 | m_capsObjects.Remove(circuitCode); | 159 | m_capsObjects.Remove(circuitCode); |
160 | } | 160 | } |
@@ -215,7 +215,7 @@ namespace OpenSim.Region.CoreModules.Framework | |||
215 | } | 215 | } |
216 | } | 216 | } |
217 | } | 217 | } |
218 | 218 | ||
219 | public Caps GetCapsForUser(uint circuitCode) | 219 | public Caps GetCapsForUser(uint circuitCode) |
220 | { | 220 | { |
221 | lock (m_capsObjects) | 221 | lock (m_capsObjects) |
@@ -225,10 +225,10 @@ namespace OpenSim.Region.CoreModules.Framework | |||
225 | return m_capsObjects[circuitCode]; | 225 | return m_capsObjects[circuitCode]; |
226 | } | 226 | } |
227 | } | 227 | } |
228 | 228 | ||
229 | return null; | 229 | return null; |
230 | } | 230 | } |
231 | 231 | ||
232 | public void ActivateCaps(uint circuitCode) | 232 | public void ActivateCaps(uint circuitCode) |
233 | { | 233 | { |
234 | lock (m_capsObjects) | 234 | lock (m_capsObjects) |
@@ -246,10 +246,10 @@ namespace OpenSim.Region.CoreModules.Framework | |||
246 | m_capsPaths[agent.AgentID] = agent.CapsPath; | 246 | m_capsPaths[agent.AgentID] = agent.CapsPath; |
247 | 247 | ||
248 | lock (m_childrenSeeds) | 248 | lock (m_childrenSeeds) |
249 | m_childrenSeeds[agent.AgentID] | 249 | m_childrenSeeds[agent.AgentID] |
250 | = ((agent.ChildrenCapSeeds == null) ? new Dictionary<ulong, string>() : agent.ChildrenCapSeeds); | 250 | = ((agent.ChildrenCapSeeds == null) ? new Dictionary<ulong, string>() : agent.ChildrenCapSeeds); |
251 | } | 251 | } |
252 | 252 | ||
253 | public string GetCapsPath(UUID agentId) | 253 | public string GetCapsPath(UUID agentId) |
254 | { | 254 | { |
255 | lock (m_capsPaths) | 255 | lock (m_capsPaths) |
@@ -262,7 +262,7 @@ namespace OpenSim.Region.CoreModules.Framework | |||
262 | 262 | ||
263 | return null; | 263 | return null; |
264 | } | 264 | } |
265 | 265 | ||
266 | public Dictionary<ulong, string> GetChildrenSeeds(UUID agentID) | 266 | public Dictionary<ulong, string> GetChildrenSeeds(UUID agentID) |
267 | { | 267 | { |
268 | Dictionary<ulong, string> seeds = null; | 268 | Dictionary<ulong, string> seeds = null; |
@@ -414,8 +414,8 @@ namespace OpenSim.Region.CoreModules.Framework | |||
414 | { | 414 | { |
415 | receivedStats[sp.Name] = reqHandler.RequestsReceived; | 415 | receivedStats[sp.Name] = reqHandler.RequestsReceived; |
416 | handledStats[sp.Name] = reqHandler.RequestsHandled; | 416 | handledStats[sp.Name] = reqHandler.RequestsHandled; |
417 | } | 417 | } |
418 | else | 418 | else |
419 | { | 419 | { |
420 | PollServiceEventArgs pollHandler = null; | 420 | PollServiceEventArgs pollHandler = null; |
421 | if (caps.TryGetPollHandler(capName, out pollHandler)) | 421 | if (caps.TryGetPollHandler(capName, out pollHandler)) |
@@ -454,7 +454,7 @@ namespace OpenSim.Region.CoreModules.Framework | |||
454 | Caps caps = m_scene.CapsModule.GetCapsForUser(sp.UUID); | 454 | Caps caps = m_scene.CapsModule.GetCapsForUser(sp.UUID); |
455 | 455 | ||
456 | if (caps == null) | 456 | if (caps == null) |
457 | return; | 457 | return; |
458 | 458 | ||
459 | foreach (IRequestHandler reqHandler in caps.CapsHandlers.GetCapsHandlers().Values) | 459 | foreach (IRequestHandler reqHandler in caps.CapsHandlers.GetCapsHandlers().Values) |
460 | { | 460 | { |
@@ -490,7 +490,7 @@ namespace OpenSim.Region.CoreModules.Framework | |||
490 | } | 490 | } |
491 | } | 491 | } |
492 | ); | 492 | ); |
493 | 493 | ||
494 | foreach (KeyValuePair<string, int> kvp in receivedStats.OrderByDescending(kp => kp.Value)) | 494 | foreach (KeyValuePair<string, int> kvp in receivedStats.OrderByDescending(kp => kp.Value)) |
495 | cdt.AddRow(kvp.Key, kvp.Value, handledStats[kvp.Key]); | 495 | cdt.AddRow(kvp.Key, kvp.Value, handledStats[kvp.Key]); |
496 | 496 | ||
@@ -559,7 +559,7 @@ namespace OpenSim.Region.CoreModules.Framework | |||
559 | capRows.Add(new CapTableRow(kvp.Key, kvp.Value.RequestsReceived, kvp.Value.RequestsHandled)); | 559 | capRows.Add(new CapTableRow(kvp.Key, kvp.Value.RequestsReceived, kvp.Value.RequestsHandled)); |
560 | 560 | ||
561 | foreach (CapTableRow ctr in capRows.OrderByDescending(ctr => ctr.RequestsReceived)) | 561 | foreach (CapTableRow ctr in capRows.OrderByDescending(ctr => ctr.RequestsReceived)) |
562 | cdt.AddRow(ctr.Name, ctr.RequestsReceived, ctr.RequestsHandled); | 562 | cdt.AddRow(ctr.Name, ctr.RequestsReceived, ctr.RequestsHandled); |
563 | 563 | ||
564 | sb.Append(cdt.ToString()); | 564 | sb.Append(cdt.ToString()); |
565 | */ | 565 | */ |
@@ -601,7 +601,7 @@ namespace OpenSim.Region.CoreModules.Framework | |||
601 | totalRequestsReceived += handler.RequestsReceived; | 601 | totalRequestsReceived += handler.RequestsReceived; |
602 | totalRequestsHandled += handler.RequestsHandled; | 602 | totalRequestsHandled += handler.RequestsHandled; |
603 | } | 603 | } |
604 | 604 | ||
605 | cdt.AddRow(sp.Name, sp.IsChildAgent ? "child" : "root", totalRequestsReceived, totalRequestsHandled); | 605 | cdt.AddRow(sp.Name, sp.IsChildAgent ? "child" : "root", totalRequestsReceived, totalRequestsHandled); |
606 | } | 606 | } |
607 | ); | 607 | ); |
diff --git a/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DAExampleModule.cs b/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DAExampleModule.cs index 0c632b1..d652f43 100644 --- a/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DAExampleModule.cs +++ b/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DAExampleModule.cs | |||
@@ -53,12 +53,12 @@ namespace OpenSim.Region.CoreModules.Framework.DynamicAttributes.DAExampleModule | |||
53 | 53 | ||
54 | protected Scene m_scene; | 54 | protected Scene m_scene; |
55 | protected IDialogModule m_dialogMod; | 55 | protected IDialogModule m_dialogMod; |
56 | 56 | ||
57 | public string Name { get { return "DAExample Module"; } } | 57 | public string Name { get { return "DAExample Module"; } } |
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 | public void AddRegion(Scene scene) | 62 | public void AddRegion(Scene scene) |
63 | { | 63 | { |
64 | if (ENABLED) | 64 | if (ENABLED) |
@@ -70,22 +70,22 @@ namespace OpenSim.Region.CoreModules.Framework.DynamicAttributes.DAExampleModule | |||
70 | m_log.DebugFormat("[DA EXAMPLE MODULE]: Added region {0}", m_scene.Name); | 70 | m_log.DebugFormat("[DA EXAMPLE MODULE]: Added region {0}", m_scene.Name); |
71 | } | 71 | } |
72 | } | 72 | } |
73 | 73 | ||
74 | public void RemoveRegion(Scene scene) | 74 | public void RemoveRegion(Scene scene) |
75 | { | 75 | { |
76 | if (ENABLED) | 76 | if (ENABLED) |
77 | { | 77 | { |
78 | m_scene.EventManager.OnSceneGroupMove -= OnSceneGroupMove; | 78 | m_scene.EventManager.OnSceneGroupMove -= OnSceneGroupMove; |
79 | } | 79 | } |
80 | } | 80 | } |
81 | 81 | ||
82 | public void RegionLoaded(Scene scene) {} | 82 | public void RegionLoaded(Scene scene) {} |
83 | 83 | ||
84 | public void Close() | 84 | public void Close() |
85 | { | 85 | { |
86 | RemoveRegion(m_scene); | 86 | RemoveRegion(m_scene); |
87 | } | 87 | } |
88 | 88 | ||
89 | protected bool OnSceneGroupMove(UUID groupId, Vector3 delta) | 89 | protected bool OnSceneGroupMove(UUID groupId, Vector3 delta) |
90 | { | 90 | { |
91 | OSDMap attrs = null; | 91 | OSDMap attrs = null; |
@@ -96,28 +96,28 @@ namespace OpenSim.Region.CoreModules.Framework.DynamicAttributes.DAExampleModule | |||
96 | 96 | ||
97 | if (!sop.DynAttrs.TryGetStore(Namespace, StoreName, out attrs)) | 97 | if (!sop.DynAttrs.TryGetStore(Namespace, StoreName, out attrs)) |
98 | attrs = new OSDMap(); | 98 | attrs = new OSDMap(); |
99 | 99 | ||
100 | OSDInteger newValue; | 100 | OSDInteger newValue; |
101 | 101 | ||
102 | // We have to lock on the entire dynamic attributes map to avoid race conditions with serialization code. | 102 | // We have to lock on the entire dynamic attributes map to avoid race conditions with serialization code. |
103 | lock (sop.DynAttrs) | 103 | lock (sop.DynAttrs) |
104 | { | 104 | { |
105 | if (!attrs.ContainsKey("moves")) | 105 | if (!attrs.ContainsKey("moves")) |
106 | newValue = new OSDInteger(1); | 106 | newValue = new OSDInteger(1); |
107 | else | 107 | else |
108 | newValue = new OSDInteger(attrs["moves"].AsInteger() + 1); | 108 | newValue = new OSDInteger(attrs["moves"].AsInteger() + 1); |
109 | 109 | ||
110 | attrs["moves"] = newValue; | 110 | attrs["moves"] = newValue; |
111 | 111 | ||
112 | sop.DynAttrs.SetStore(Namespace, StoreName, attrs); | 112 | sop.DynAttrs.SetStore(Namespace, StoreName, attrs); |
113 | } | 113 | } |
114 | 114 | ||
115 | sop.ParentGroup.HasGroupChanged = true; | 115 | sop.ParentGroup.HasGroupChanged = true; |
116 | 116 | ||
117 | string msg = string.Format("{0} {1} moved {2} times", sop.Name, sop.UUID, newValue); | 117 | string msg = string.Format("{0} {1} moved {2} times", sop.Name, sop.UUID, newValue); |
118 | m_log.DebugFormat("[DA EXAMPLE MODULE]: {0}", msg); | 118 | m_log.DebugFormat("[DA EXAMPLE MODULE]: {0}", msg); |
119 | m_dialogMod.SendGeneralAlert(msg); | 119 | m_dialogMod.SendGeneralAlert(msg); |
120 | 120 | ||
121 | return true; | 121 | return true; |
122 | } | 122 | } |
123 | } | 123 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DOExampleModule.cs b/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DOExampleModule.cs index 166a994..3364cbc 100644 --- a/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DOExampleModule.cs +++ b/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DOExampleModule.cs | |||
@@ -65,11 +65,11 @@ namespace OpenSim.Region.Framework.DynamicAttributes.DOExampleModule | |||
65 | private Scene m_scene; | 65 | private Scene m_scene; |
66 | private IDialogModule m_dialogMod; | 66 | private IDialogModule m_dialogMod; |
67 | 67 | ||
68 | public string Name { get { return "DO"; } } | 68 | public string Name { get { return "DO"; } } |
69 | public Type ReplaceableInterface { get { return null; } } | 69 | public Type ReplaceableInterface { get { return null; } } |
70 | 70 | ||
71 | public void Initialise(IConfigSource source) {} | 71 | public void Initialise(IConfigSource source) {} |
72 | 72 | ||
73 | public void AddRegion(Scene scene) | 73 | public void AddRegion(Scene scene) |
74 | { | 74 | { |
75 | if (ENABLED) | 75 | if (ENABLED) |
@@ -80,18 +80,18 @@ namespace OpenSim.Region.Framework.DynamicAttributes.DOExampleModule | |||
80 | m_dialogMod = m_scene.RequestModuleInterface<IDialogModule>(); | 80 | m_dialogMod = m_scene.RequestModuleInterface<IDialogModule>(); |
81 | } | 81 | } |
82 | } | 82 | } |
83 | 83 | ||
84 | public void RemoveRegion(Scene scene) | 84 | public void RemoveRegion(Scene scene) |
85 | { | 85 | { |
86 | if (ENABLED) | 86 | if (ENABLED) |
87 | { | 87 | { |
88 | m_scene.EventManager.OnSceneGroupMove -= OnSceneGroupMove; | 88 | m_scene.EventManager.OnSceneGroupMove -= OnSceneGroupMove; |
89 | } | 89 | } |
90 | } | 90 | } |
91 | 91 | ||
92 | public void RegionLoaded(Scene scene) {} | 92 | public void RegionLoaded(Scene scene) {} |
93 | 93 | ||
94 | public void Close() | 94 | public void Close() |
95 | { | 95 | { |
96 | RemoveRegion(m_scene); | 96 | RemoveRegion(m_scene); |
97 | } | 97 | } |
@@ -116,7 +116,7 @@ namespace OpenSim.Region.Framework.DynamicAttributes.DOExampleModule | |||
116 | 116 | ||
117 | rootPart.DynObjs.Add(DAExampleModule.Namespace, Name, new MyObject(movesSoFar)); | 117 | rootPart.DynObjs.Add(DAExampleModule.Namespace, Name, new MyObject(movesSoFar)); |
118 | } | 118 | } |
119 | 119 | ||
120 | private bool OnSceneGroupMove(UUID groupId, Vector3 delta) | 120 | private bool OnSceneGroupMove(UUID groupId, Vector3 delta) |
121 | { | 121 | { |
122 | SceneObjectGroup so = m_scene.GetSceneObjectGroup(groupId); | 122 | SceneObjectGroup so = m_scene.GetSceneObjectGroup(groupId); |
@@ -129,11 +129,11 @@ namespace OpenSim.Region.Framework.DynamicAttributes.DOExampleModule | |||
129 | if (rawObj != null) | 129 | if (rawObj != null) |
130 | { | 130 | { |
131 | MyObject myObj = (MyObject)rawObj; | 131 | MyObject myObj = (MyObject)rawObj; |
132 | 132 | ||
133 | m_dialogMod.SendGeneralAlert(string.Format("{0} {1} moved {2} times", so.Name, so.UUID, ++myObj.Moves)); | 133 | m_dialogMod.SendGeneralAlert(string.Format("{0} {1} moved {2} times", so.Name, so.UUID, ++myObj.Moves)); |
134 | } | 134 | } |
135 | 135 | ||
136 | return true; | 136 | return true; |
137 | } | 137 | } |
138 | } | 138 | } |
139 | } \ No newline at end of file | 139 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 58d6cf2..6b1eb54 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -72,9 +72,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
72 | /// If true then we ask the viewer to disable teleport cancellation and ignore teleport requests. | 72 | /// If true then we ask the viewer to disable teleport cancellation and ignore teleport requests. |
73 | /// </summary> | 73 | /// </summary> |
74 | /// <remarks> | 74 | /// <remarks> |
75 | /// This is useful in situations where teleport is very likely to always succeed and we want to avoid a | 75 | /// This is useful in situations where teleport is very likely to always succeed and we want to avoid a |
76 | /// situation where avatars can be come 'stuck' due to a failed teleport cancellation. Unfortunately, the | 76 | /// situation where avatars can be come 'stuck' due to a failed teleport cancellation. Unfortunately, the |
77 | /// nature of the teleport protocol makes it extremely difficult (maybe impossible) to make teleport | 77 | /// nature of the teleport protocol makes it extremely difficult (maybe impossible) to make teleport |
78 | /// cancellation consistently suceed. | 78 | /// cancellation consistently suceed. |
79 | /// </remarks> | 79 | /// </remarks> |
80 | public bool DisableInterRegionTeleportCancellation { get; set; } | 80 | public bool DisableInterRegionTeleportCancellation { get; set; } |
@@ -221,12 +221,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
221 | IConfig transferConfig = source.Configs["EntityTransfer"]; | 221 | IConfig transferConfig = source.Configs["EntityTransfer"]; |
222 | if (transferConfig != null) | 222 | if (transferConfig != null) |
223 | { | 223 | { |
224 | DisableInterRegionTeleportCancellation | 224 | DisableInterRegionTeleportCancellation |
225 | = transferConfig.GetBoolean("DisableInterRegionTeleportCancellation", false); | 225 | = transferConfig.GetBoolean("DisableInterRegionTeleportCancellation", false); |
226 | 226 | ||
227 | WaitForAgentArrivedAtDestination | 227 | WaitForAgentArrivedAtDestination |
228 | = transferConfig.GetBoolean("wait_for_callback", WaitForAgentArrivedAtDestinationDefault); | 228 | = transferConfig.GetBoolean("wait_for_callback", WaitForAgentArrivedAtDestinationDefault); |
229 | 229 | ||
230 | MaxTransferDistance = transferConfig.GetInt("max_distance", DefaultMaxTransferDistance); | 230 | MaxTransferDistance = transferConfig.GetInt("max_distance", DefaultMaxTransferDistance); |
231 | } | 231 | } |
232 | else | 232 | else |
@@ -250,7 +250,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
250 | 250 | ||
251 | Scene = scene; | 251 | Scene = scene; |
252 | 252 | ||
253 | m_interRegionTeleportAttempts = | 253 | m_interRegionTeleportAttempts = |
254 | new Stat( | 254 | new Stat( |
255 | "InterRegionTeleportAttempts", | 255 | "InterRegionTeleportAttempts", |
256 | "Number of inter-region teleports attempted.", | 256 | "Number of inter-region teleports attempted.", |
@@ -263,7 +263,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
263 | null, | 263 | null, |
264 | StatVerbosity.Debug); | 264 | StatVerbosity.Debug); |
265 | 265 | ||
266 | m_interRegionTeleportAborts = | 266 | m_interRegionTeleportAborts = |
267 | new Stat( | 267 | new Stat( |
268 | "InterRegionTeleportAborts", | 268 | "InterRegionTeleportAborts", |
269 | "Number of inter-region teleports aborted due to client actions.", | 269 | "Number of inter-region teleports aborted due to client actions.", |
@@ -275,7 +275,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
275 | null, | 275 | null, |
276 | StatVerbosity.Debug); | 276 | StatVerbosity.Debug); |
277 | 277 | ||
278 | m_interRegionTeleportCancels = | 278 | m_interRegionTeleportCancels = |
279 | new Stat( | 279 | new Stat( |
280 | "InterRegionTeleportCancels", | 280 | "InterRegionTeleportCancels", |
281 | "Number of inter-region teleports cancelled by the client.", | 281 | "Number of inter-region teleports cancelled by the client.", |
@@ -287,7 +287,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
287 | null, | 287 | null, |
288 | StatVerbosity.Debug); | 288 | StatVerbosity.Debug); |
289 | 289 | ||
290 | m_interRegionTeleportFailures = | 290 | m_interRegionTeleportFailures = |
291 | new Stat( | 291 | new Stat( |
292 | "InterRegionTeleportFailures", | 292 | "InterRegionTeleportFailures", |
293 | "Number of inter-region teleports that failed due to server/client/network issues.", | 293 | "Number of inter-region teleports that failed due to server/client/network issues.", |
@@ -321,7 +321,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
321 | 321 | ||
322 | public virtual void Close() {} | 322 | public virtual void Close() {} |
323 | 323 | ||
324 | public virtual void RemoveRegion(Scene scene) | 324 | public virtual void RemoveRegion(Scene scene) |
325 | { | 325 | { |
326 | if (m_Enabled) | 326 | if (m_Enabled) |
327 | { | 327 | { |
@@ -349,7 +349,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
349 | if (client.IsLoggingOut && m_entityTransferStateMachine.UpdateInTransit(client.AgentId, AgentTransferState.Aborting)) | 349 | if (client.IsLoggingOut && m_entityTransferStateMachine.UpdateInTransit(client.AgentId, AgentTransferState.Aborting)) |
350 | { | 350 | { |
351 | m_log.DebugFormat( | 351 | m_log.DebugFormat( |
352 | "[ENTITY TRANSFER MODULE]: Aborted teleport request from {0} in {1} due to simultaneous logout", | 352 | "[ENTITY TRANSFER MODULE]: Aborted teleport request from {0} in {1} due to simultaneous logout", |
353 | client.Name, Scene.Name); | 353 | client.Name, Scene.Name); |
354 | } | 354 | } |
355 | } | 355 | } |
@@ -672,7 +672,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
672 | sp.ControllingClient.SendTeleportFailed("Agent is already in transit."); | 672 | sp.ControllingClient.SendTeleportFailed("Agent is already in transit."); |
673 | return; | 673 | return; |
674 | } | 674 | } |
675 | 675 | ||
676 | try | 676 | try |
677 | { | 677 | { |
678 | DoTeleportInternal(sp, reg, finalDestination, position, lookAt, teleportFlags); | 678 | DoTeleportInternal(sp, reg, finalDestination, position, lookAt, teleportFlags); |
@@ -766,7 +766,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
766 | m_interRegionTeleportAttempts.Value++; | 766 | m_interRegionTeleportAttempts.Value++; |
767 | 767 | ||
768 | m_log.DebugFormat( | 768 | m_log.DebugFormat( |
769 | "[ENTITY TRANSFER MODULE]: {0} transfer protocol version to {1} is {2} / {3}", | 769 | "[ENTITY TRANSFER MODULE]: {0} transfer protocol version to {1} is {2} / {3}", |
770 | sp.Scene.Name, finalDestination.RegionName, ctx.OutboundVersion, ctx.InboundVersion); | 770 | sp.Scene.Name, finalDestination.RegionName, ctx.OutboundVersion, ctx.InboundVersion); |
771 | 771 | ||
772 | // Fixing a bug where teleporting while sitting results in the avatar ending up removed from | 772 | // Fixing a bug where teleporting while sitting results in the avatar ending up removed from |
@@ -797,7 +797,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
797 | AgentCircuitData agentCircuit = sp.ControllingClient.RequestClientInfo(); | 797 | AgentCircuitData agentCircuit = sp.ControllingClient.RequestClientInfo(); |
798 | agentCircuit.startpos = position; | 798 | agentCircuit.startpos = position; |
799 | agentCircuit.child = true; | 799 | agentCircuit.child = true; |
800 | 800 | ||
801 | // agentCircuit.Appearance = sp.Appearance; | 801 | // agentCircuit.Appearance = sp.Appearance; |
802 | // agentCircuit.Appearance = new AvatarAppearance(sp.Appearance, true, false); | 802 | // agentCircuit.Appearance = new AvatarAppearance(sp.Appearance, true, false); |
803 | agentCircuit.Appearance = new AvatarAppearance(); | 803 | agentCircuit.Appearance = new AvatarAppearance(); |
@@ -814,7 +814,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
814 | } | 814 | } |
815 | 815 | ||
816 | IClientIPEndpoint ipepClient; | 816 | IClientIPEndpoint ipepClient; |
817 | 817 | ||
818 | uint newRegionX, newRegionY, oldRegionX, oldRegionY; | 818 | uint newRegionX, newRegionY, oldRegionX, oldRegionY; |
819 | Util.RegionHandleToRegionLoc(destinationHandle, out newRegionX, out newRegionY); | 819 | Util.RegionHandleToRegionLoc(destinationHandle, out newRegionX, out newRegionY); |
820 | Util.RegionHandleToRegionLoc(sourceRegion.RegionHandle, out oldRegionX, out oldRegionY); | 820 | Util.RegionHandleToRegionLoc(sourceRegion.RegionHandle, out oldRegionX, out oldRegionY); |
@@ -853,7 +853,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
853 | if (ctx.OutboundVersion >= 0.2f) | 853 | if (ctx.OutboundVersion >= 0.2f) |
854 | TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, OutSideViewRange , ctx, out reason); | 854 | TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, OutSideViewRange , ctx, out reason); |
855 | else | 855 | else |
856 | TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, OutSideViewRange, ctx, out reason); | 856 | TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, OutSideViewRange, ctx, out reason); |
857 | } | 857 | } |
858 | 858 | ||
859 | private void TransferAgent_V1(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination, | 859 | private void TransferAgent_V1(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination, |
@@ -863,12 +863,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
863 | AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); | 863 | AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); |
864 | 864 | ||
865 | m_log.DebugFormat( | 865 | m_log.DebugFormat( |
866 | "[ENTITY TRANSFER MODULE]: Using TP V1 for {0} going from {1} to {2}", | 866 | "[ENTITY TRANSFER MODULE]: Using TP V1 for {0} going from {1} to {2}", |
867 | sp.Name, Scene.Name, finalDestination.RegionName); | 867 | sp.Name, Scene.Name, finalDestination.RegionName); |
868 | 868 | ||
869 | string capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); | 869 | string capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); |
870 | 870 | ||
871 | // Let's create an agent there if one doesn't exist yet. | 871 | // Let's create an agent there if one doesn't exist yet. |
872 | // NOTE: logout will always be false for a non-HG teleport. | 872 | // NOTE: logout will always be false for a non-HG teleport. |
873 | bool logout = false; | 873 | bool logout = false; |
874 | if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, ctx, out reason, out logout)) | 874 | if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, ctx, out reason, out logout)) |
@@ -953,7 +953,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
953 | SetCallbackURL(agent, sp.Scene.RegionInfo); | 953 | SetCallbackURL(agent, sp.Scene.RegionInfo); |
954 | 954 | ||
955 | 955 | ||
956 | // We will check for an abort before UpdateAgent since UpdateAgent will require an active viewer to | 956 | // We will check for an abort before UpdateAgent since UpdateAgent will require an active viewer to |
957 | // establish th econnection to the destination which makes it return true. | 957 | // establish th econnection to the destination which makes it return true. |
958 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) | 958 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) |
959 | { | 959 | { |
@@ -966,7 +966,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
966 | return; | 966 | return; |
967 | } | 967 | } |
968 | 968 | ||
969 | // A common teleport failure occurs when we can send CreateAgent to the | 969 | // A common teleport failure occurs when we can send CreateAgent to the |
970 | // destination region but the viewer cannot establish the connection (e.g. due to network issues between | 970 | // destination region but the viewer cannot establish the connection (e.g. due to network issues between |
971 | // the viewer and the destination). In this case, UpdateAgent timesout after 10 seconds, although then | 971 | // the viewer and the destination). In this case, UpdateAgent timesout after 10 seconds, although then |
972 | // there's a further 10 second wait whilst we attempt to tell the destination to delete the agent in Fail(). | 972 | // there's a further 10 second wait whilst we attempt to tell the destination to delete the agent in Fail(). |
@@ -1010,7 +1010,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1010 | capsPath, sp.Scene.RegionInfo.RegionName, sp.Name); | 1010 | capsPath, sp.Scene.RegionInfo.RegionName, sp.Name); |
1011 | 1011 | ||
1012 | // We need to set this here to avoid an unlikely race condition when teleporting to a neighbour simulator, | 1012 | // We need to set this here to avoid an unlikely race condition when teleporting to a neighbour simulator, |
1013 | // where that neighbour simulator could otherwise request a child agent create on the source which then | 1013 | // where that neighbour simulator could otherwise request a child agent create on the source which then |
1014 | // closes our existing agent which is still signalled as root. | 1014 | // closes our existing agent which is still signalled as root. |
1015 | sp.IsChildAgent = true; | 1015 | sp.IsChildAgent = true; |
1016 | 1016 | ||
@@ -1071,7 +1071,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1071 | AgentHasMovedAway(sp, logout); | 1071 | AgentHasMovedAway(sp, logout); |
1072 | 1072 | ||
1073 | sp.HasMovedAway(!(OutSideViewRange || logout)); | 1073 | sp.HasMovedAway(!(OutSideViewRange || logout)); |
1074 | 1074 | ||
1075 | // ulong sourceRegionHandle = sp.RegionHandle; | 1075 | // ulong sourceRegionHandle = sp.RegionHandle; |
1076 | 1076 | ||
1077 | // Now let's make it officially a child agent | 1077 | // Now let's make it officially a child agent |
@@ -1107,7 +1107,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1107 | 1107 | ||
1108 | string capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);; | 1108 | string capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);; |
1109 | 1109 | ||
1110 | // Let's create an agent there if one doesn't exist yet. | 1110 | // Let's create an agent there if one doesn't exist yet. |
1111 | // NOTE: logout will always be false for a non-HG teleport. | 1111 | // NOTE: logout will always be false for a non-HG teleport. |
1112 | bool logout = false; | 1112 | bool logout = false; |
1113 | if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, ctx, out reason, out logout)) | 1113 | if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, ctx, out reason, out logout)) |
@@ -1150,7 +1150,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1150 | m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.Transferring); | 1150 | m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.Transferring); |
1151 | 1151 | ||
1152 | // We need to set this here to avoid an unlikely race condition when teleporting to a neighbour simulator, | 1152 | // We need to set this here to avoid an unlikely race condition when teleporting to a neighbour simulator, |
1153 | // where that neighbour simulator could otherwise request a child agent create on the source which then | 1153 | // where that neighbour simulator could otherwise request a child agent create on the source which then |
1154 | // closes our existing agent which is still signalled as root. | 1154 | // closes our existing agent which is still signalled as root. |
1155 | //sp.IsChildAgent = true; | 1155 | //sp.IsChildAgent = true; |
1156 | 1156 | ||
@@ -1166,7 +1166,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1166 | "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} from {1} to {2}", | 1166 | "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} from {1} to {2}", |
1167 | capsPath, sp.Scene.RegionInfo.RegionName, sp.Name); | 1167 | capsPath, sp.Scene.RegionInfo.RegionName, sp.Name); |
1168 | 1168 | ||
1169 | // Let's send a full update of the agent. | 1169 | // Let's send a full update of the agent. |
1170 | AgentData agent = new AgentData(); | 1170 | AgentData agent = new AgentData(); |
1171 | sp.CopyTo(agent,false); | 1171 | sp.CopyTo(agent,false); |
1172 | agent.Position = agentCircuit.startpos; | 1172 | agent.Position = agentCircuit.startpos; |
@@ -1207,7 +1207,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1207 | sp.IsInTransit = false; | 1207 | sp.IsInTransit = false; |
1208 | return; | 1208 | return; |
1209 | } | 1209 | } |
1210 | 1210 | ||
1211 | m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp); | 1211 | m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp); |
1212 | 1212 | ||
1213 | // Need to signal neighbours whether child agents may need closing irrespective of whether this | 1213 | // Need to signal neighbours whether child agents may need closing irrespective of whether this |
@@ -1248,7 +1248,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1248 | // Thread.Sleep(1000); | 1248 | // Thread.Sleep(1000); |
1249 | 1249 | ||
1250 | // OK, it got this agent. Let's close everything | 1250 | // OK, it got this agent. Let's close everything |
1251 | // If we shouldn't close the agent due to some other region renewing the connection | 1251 | // If we shouldn't close the agent due to some other region renewing the connection |
1252 | // then this will be handled in IncomingCloseAgent under lock conditions | 1252 | // then this will be handled in IncomingCloseAgent under lock conditions |
1253 | m_log.DebugFormat( | 1253 | m_log.DebugFormat( |
1254 | "[ENTITY TRANSFER MODULE]: Closing agent {0} in {1} after teleport", sp.Name, Scene.Name); | 1254 | "[ENTITY TRANSFER MODULE]: Closing agent {0} in {1} after teleport", sp.Name, Scene.Name); |
@@ -1258,7 +1258,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1258 | /* | 1258 | /* |
1259 | else | 1259 | else |
1260 | { | 1260 | { |
1261 | // now we have a child agent in this region. | 1261 | // now we have a child agent in this region. |
1262 | sp.Reset(); | 1262 | sp.Reset(); |
1263 | } | 1263 | } |
1264 | */ | 1264 | */ |
@@ -1343,7 +1343,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1343 | /// </summary> | 1343 | /// </summary> |
1344 | /// <param name='sp'></param> | 1344 | /// <param name='sp'></param> |
1345 | /// <param name='logout'></param> | 1345 | /// <param name='logout'></param> |
1346 | /// | 1346 | /// |
1347 | /// now just a HG hook | 1347 | /// now just a HG hook |
1348 | protected virtual void AgentHasMovedAway(ScenePresence sp, bool logout) | 1348 | protected virtual void AgentHasMovedAway(ScenePresence sp, bool logout) |
1349 | { | 1349 | { |
@@ -1375,7 +1375,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1375 | 1375 | ||
1376 | // HG Hook | 1376 | // HG Hook |
1377 | protected virtual bool NeedsClosing(GridRegion reg, bool OutViewRange) | 1377 | protected virtual bool NeedsClosing(GridRegion reg, bool OutViewRange) |
1378 | 1378 | ||
1379 | { | 1379 | { |
1380 | return OutViewRange; | 1380 | return OutViewRange; |
1381 | } | 1381 | } |
@@ -1399,11 +1399,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1399 | remoteClient.SendTeleportFailed("The teleport destination could not be found."); | 1399 | remoteClient.SendTeleportFailed("The teleport destination could not be found."); |
1400 | return; | 1400 | return; |
1401 | } | 1401 | } |
1402 | ((Scene)(remoteClient.Scene)).RequestTeleportLocation(remoteClient, info.RegionHandle, lm.Position, | 1402 | ((Scene)(remoteClient.Scene)).RequestTeleportLocation(remoteClient, info.RegionHandle, lm.Position, |
1403 | Vector3.Zero, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaLandmark)); | 1403 | Vector3.Zero, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaLandmark)); |
1404 | } | 1404 | } |
1405 | 1405 | ||
1406 | #endregion | 1406 | #endregion |
1407 | 1407 | ||
1408 | #region Teleport Home | 1408 | #region Teleport Home |
1409 | 1409 | ||
@@ -1437,7 +1437,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1437 | client.SendTeleportFailed("Your home region could not be found."); | 1437 | client.SendTeleportFailed("Your home region could not be found."); |
1438 | return false; | 1438 | return false; |
1439 | } | 1439 | } |
1440 | 1440 | ||
1441 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Home region of {0} is {1} ({2}-{3})", | 1441 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Home region of {0} is {1} ({2}-{3})", |
1442 | client.Name, regionInfo.RegionName, regionInfo.RegionCoordX, regionInfo.RegionCoordY); | 1442 | client.Name, regionInfo.RegionName, regionInfo.RegionCoordX, regionInfo.RegionCoordY); |
1443 | 1443 | ||
@@ -1475,7 +1475,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1475 | 1475 | ||
1476 | Scene ascene = agent.Scene; | 1476 | Scene ascene = agent.Scene; |
1477 | string homeURI = ascene.GetAgentHomeURI(agentID); | 1477 | string homeURI = ascene.GetAgentHomeURI(agentID); |
1478 | 1478 | ||
1479 | 1479 | ||
1480 | if (!ascene.SimulationService.QueryAccess(destiny, agentID, homeURI, false, position, | 1480 | if (!ascene.SimulationService.QueryAccess(destiny, agentID, homeURI, false, position, |
1481 | agent.Scene.GetFormatsOffered(), ctx, out reason)) | 1481 | agent.Scene.GetFormatsOffered(), ctx, out reason)) |
@@ -1489,7 +1489,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1489 | 1489 | ||
1490 | // Given a position relative to the current region and outside of it | 1490 | // Given a position relative to the current region and outside of it |
1491 | // find the new region that the point is actually in. | 1491 | // find the new region that the point is actually in. |
1492 | // returns 'null' if new region not found or if information | 1492 | // returns 'null' if new region not found or if information |
1493 | // and new position relative to it | 1493 | // and new position relative to it |
1494 | // now only works for crossings | 1494 | // now only works for crossings |
1495 | 1495 | ||
@@ -1611,14 +1611,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1611 | Thread.Sleep(10000); | 1611 | Thread.Sleep(10000); |
1612 | 1612 | ||
1613 | m_log.DebugFormat( | 1613 | m_log.DebugFormat( |
1614 | "[ENTITY TRANSFER MODULE]: Auto-reteleporting {0} to correct megaregion location {1},{2},{3} from {4}", | 1614 | "[ENTITY TRANSFER MODULE]: Auto-reteleporting {0} to correct megaregion location {1},{2},{3} from {4}", |
1615 | agent.Name, regionX, regionY, position, initiatingScene.Name); | 1615 | agent.Name, regionX, regionY, position, initiatingScene.Name); |
1616 | 1616 | ||
1617 | agent.Scene.RequestTeleportLocation( | 1617 | agent.Scene.RequestTeleportLocation( |
1618 | agent.ControllingClient, | 1618 | agent.ControllingClient, |
1619 | Util.RegionGridLocToHandle(regionX, regionY), | 1619 | Util.RegionGridLocToHandle(regionX, regionY), |
1620 | position, | 1620 | position, |
1621 | agent.Lookat, | 1621 | agent.Lookat, |
1622 | (uint)Constants.TeleportFlags.ViaLocation); | 1622 | (uint)Constants.TeleportFlags.ViaLocation); |
1623 | 1623 | ||
1624 | /* | 1624 | /* |
@@ -1662,7 +1662,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1662 | icon.EndInvoke(iar); | 1662 | icon.EndInvoke(iar); |
1663 | } | 1663 | } |
1664 | 1664 | ||
1665 | 1665 | ||
1666 | 1666 | ||
1667 | /// <summary> | 1667 | /// <summary> |
1668 | /// This Closes child agents on neighbouring regions | 1668 | /// This Closes child agents on neighbouring regions |
@@ -1708,7 +1708,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1708 | int ts = Util.EnvironmentTickCount(); | 1708 | int ts = Util.EnvironmentTickCount(); |
1709 | try | 1709 | try |
1710 | { | 1710 | { |
1711 | AgentData cAgent = new AgentData(); | 1711 | AgentData cAgent = new AgentData(); |
1712 | agent.CopyTo(cAgent,true); | 1712 | agent.CopyTo(cAgent,true); |
1713 | 1713 | ||
1714 | // agent.Appearance.WearableCacheItems = null; | 1714 | // agent.Appearance.WearableCacheItems = null; |
@@ -1731,7 +1731,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1731 | m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp); | 1731 | m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp); |
1732 | 1732 | ||
1733 | m_log.WarnFormat( | 1733 | m_log.WarnFormat( |
1734 | "[ENTITY TRANSFER MODULE]: Region {0} would not accept update for agent {1} on cross attempt. Returning to original region.", | 1734 | "[ENTITY TRANSFER MODULE]: Region {0} would not accept update for agent {1} on cross attempt. Returning to original region.", |
1735 | neighbourRegion.RegionName, agent.Name); | 1735 | neighbourRegion.RegionName, agent.Name); |
1736 | 1736 | ||
1737 | ReInstantiateScripts(agent); | 1737 | ReInstantiateScripts(agent); |
@@ -1827,7 +1827,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1827 | 1827 | ||
1828 | return; | 1828 | return; |
1829 | } | 1829 | } |
1830 | 1830 | ||
1831 | private void CrossAgentToNewRegionCompleted(IAsyncResult iar) | 1831 | private void CrossAgentToNewRegionCompleted(IAsyncResult iar) |
1832 | { | 1832 | { |
1833 | CrossAgentToNewRegionDelegate icon = (CrossAgentToNewRegionDelegate)iar.AsyncState; | 1833 | CrossAgentToNewRegionDelegate icon = (CrossAgentToNewRegionDelegate)iar.AsyncState; |
@@ -2167,7 +2167,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2167 | return false; | 2167 | return false; |
2168 | } | 2168 | } |
2169 | } | 2169 | } |
2170 | 2170 | ||
2171 | private void DoExpiration() | 2171 | private void DoExpiration() |
2172 | { | 2172 | { |
2173 | List<ulong> m_toRemove = new List<ulong>();; | 2173 | List<ulong> m_toRemove = new List<ulong>();; |
@@ -2179,7 +2179,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2179 | if (kvp.Value < now) | 2179 | if (kvp.Value < now) |
2180 | m_toRemove.Add(kvp.Key); | 2180 | m_toRemove.Add(kvp.Key); |
2181 | } | 2181 | } |
2182 | 2182 | ||
2183 | if (m_toRemove.Count > 0) | 2183 | if (m_toRemove.Count > 0) |
2184 | { | 2184 | { |
2185 | foreach (ulong u in m_toRemove) | 2185 | foreach (ulong u in m_toRemove) |
@@ -2199,7 +2199,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2199 | // to find possible regions. | 2199 | // to find possible regions. |
2200 | return GetRegionContainingWorldLocation(pGridService, pScopeID, px, py, Constants.MaximumRegionSize); | 2200 | return GetRegionContainingWorldLocation(pGridService, pScopeID, px, py, Constants.MaximumRegionSize); |
2201 | } | 2201 | } |
2202 | 2202 | ||
2203 | // Given a world position, get the GridRegion info for | 2203 | // Given a world position, get the GridRegion info for |
2204 | // the region containing that point. | 2204 | // the region containing that point. |
2205 | // for compatibility with old grids it does a scan to find large regions | 2205 | // for compatibility with old grids it does a scan to find large regions |
@@ -2285,7 +2285,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2285 | if (newAgent) | 2285 | if (newAgent) |
2286 | { | 2286 | { |
2287 | // we may already had lost this sp | 2287 | // we may already had lost this sp |
2288 | if(sp == null || sp.IsDeleted || sp.ClientView == null) // something bad already happened | 2288 | if(sp == null || sp.IsDeleted || sp.ClientView == null) // something bad already happened |
2289 | return; | 2289 | return; |
2290 | 2290 | ||
2291 | Scene scene = sp.Scene; | 2291 | Scene scene = sp.Scene; |
@@ -2303,13 +2303,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2303 | 2303 | ||
2304 | if (regionAccepted) | 2304 | if (regionAccepted) |
2305 | { | 2305 | { |
2306 | // give time for createAgent to finish, since it is async and does grid services access | 2306 | // give time for createAgent to finish, since it is async and does grid services access |
2307 | Thread.Sleep(500); | 2307 | Thread.Sleep(500); |
2308 | 2308 | ||
2309 | if (m_eqModule != null) | 2309 | if (m_eqModule != null) |
2310 | { | 2310 | { |
2311 | #region IP Translation for NAT | 2311 | #region IP Translation for NAT |
2312 | if(sp == null || sp.IsDeleted || sp.ClientView == null) // something bad already happened | 2312 | if(sp == null || sp.IsDeleted || sp.ClientView == null) // something bad already happened |
2313 | return; | 2313 | return; |
2314 | 2314 | ||
2315 | IClientIPEndpoint ipepClient; | 2315 | IClientIPEndpoint ipepClient; |
@@ -2344,7 +2344,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2344 | reg.RegionName, sp.Name, sp.UUID, reason); | 2344 | reg.RegionName, sp.Name, sp.UUID, reason); |
2345 | } | 2345 | } |
2346 | } | 2346 | } |
2347 | 2347 | ||
2348 | } | 2348 | } |
2349 | 2349 | ||
2350 | /// <summary> | 2350 | /// <summary> |
@@ -2353,7 +2353,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2353 | /// <param name="avatar"></param> | 2353 | /// <param name="avatar"></param> |
2354 | /// <param name="pRegionLocX"></param> | 2354 | /// <param name="pRegionLocX"></param> |
2355 | /// <param name="pRegionLocY"></param> | 2355 | /// <param name="pRegionLocY"></param> |
2356 | /// <returns></returns> | 2356 | /// <returns></returns> |
2357 | protected List<GridRegion> GetNeighbors(ScenePresence avatar, uint pRegionLocX, uint pRegionLocY) | 2357 | protected List<GridRegion> GetNeighbors(ScenePresence avatar, uint pRegionLocX, uint pRegionLocY) |
2358 | { | 2358 | { |
2359 | Scene pScene = avatar.Scene; | 2359 | Scene pScene = avatar.Scene; |
@@ -2588,7 +2588,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2588 | if (Scene.RegionInfo.EstateSettings.IsBanned(so.OwnerID)) | 2588 | if (Scene.RegionInfo.EstateSettings.IsBanned(so.OwnerID)) |
2589 | { | 2589 | { |
2590 | m_log.DebugFormat( | 2590 | m_log.DebugFormat( |
2591 | "[ENTITY TRANSFER MODULE]: Denied prim crossing of {0} {1} into {2} for banned avatar {3}", | 2591 | "[ENTITY TRANSFER MODULE]: Denied prim crossing of {0} {1} into {2} for banned avatar {3}", |
2592 | so.Name, so.UUID, Scene.Name, so.OwnerID); | 2592 | so.Name, so.UUID, Scene.Name, so.OwnerID); |
2593 | 2593 | ||
2594 | return false; | 2594 | return false; |
@@ -2600,7 +2600,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2600 | if (!Scene.AddSceneObject(so)) | 2600 | if (!Scene.AddSceneObject(so)) |
2601 | { | 2601 | { |
2602 | m_log.DebugFormat( | 2602 | m_log.DebugFormat( |
2603 | "[ENTITY TRANSFER MODULE]: Problem adding scene object {0} {1} into {2} ", | 2603 | "[ENTITY TRANSFER MODULE]: Problem adding scene object {0} {1} into {2} ", |
2604 | so.Name, so.UUID, Scene.Name); | 2604 | so.Name, so.UUID, Scene.Name); |
2605 | 2605 | ||
2606 | return false; | 2606 | return false; |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs index acfdaef..0a24555 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs | |||
@@ -169,7 +169,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
169 | } | 169 | } |
170 | else | 170 | else |
171 | { | 171 | { |
172 | if (newState == AgentTransferState.Cancelling | 172 | if (newState == AgentTransferState.Cancelling |
173 | && (oldState == AgentTransferState.Preparing || oldState == AgentTransferState.Transferring)) | 173 | && (oldState == AgentTransferState.Preparing || oldState == AgentTransferState.Transferring)) |
174 | { | 174 | { |
175 | transitionOkay = true; | 175 | transitionOkay = true; |
@@ -181,7 +181,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
181 | } | 181 | } |
182 | 182 | ||
183 | if (!transitionOkay) | 183 | if (!transitionOkay) |
184 | failureMessage | 184 | failureMessage |
185 | = string.Format( | 185 | = string.Format( |
186 | "Agent with ID {0} is not allowed to move from old transit state {1} to new state {2} in {3}", | 186 | "Agent with ID {0} is not allowed to move from old transit state {1} to new state {2} in {3}", |
187 | id, oldState, newState, m_mod.Scene.RegionInfo.RegionName); | 187 | id, oldState, newState, m_mod.Scene.RegionInfo.RegionName); |
@@ -192,7 +192,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
192 | m_agentsInTransit[id] = newState; | 192 | m_agentsInTransit[id] = newState; |
193 | 193 | ||
194 | // m_log.DebugFormat( | 194 | // m_log.DebugFormat( |
195 | // "[ENTITY TRANSFER STATE MACHINE]: Changed agent with id {0} from state {1} to {2} in {3}", | 195 | // "[ENTITY TRANSFER STATE MACHINE]: Changed agent with id {0} from state {1} to {2} in {3}", |
196 | // id, oldState, newState, m_mod.Scene.Name); | 196 | // id, oldState, newState, m_mod.Scene.Name); |
197 | } | 197 | } |
198 | else if (failIfNotOkay) | 198 | else if (failIfNotOkay) |
@@ -204,11 +204,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
204 | // { | 204 | // { |
205 | // if (oldState != null) | 205 | // if (oldState != null) |
206 | // m_log.DebugFormat( | 206 | // m_log.DebugFormat( |
207 | // "[ENTITY TRANSFER STATE MACHINE]: Ignored change of agent with id {0} from state {1} to {2} in {3}", | 207 | // "[ENTITY TRANSFER STATE MACHINE]: Ignored change of agent with id {0} from state {1} to {2} in {3}", |
208 | // id, oldState, newState, m_mod.Scene.Name); | 208 | // id, oldState, newState, m_mod.Scene.Name); |
209 | // else | 209 | // else |
210 | // m_log.DebugFormat( | 210 | // m_log.DebugFormat( |
211 | // "[ENTITY TRANSFER STATE MACHINE]: Ignored change of agent with id {0} to state {1} in {2} since agent not in transit", | 211 | // "[ENTITY TRANSFER STATE MACHINE]: Ignored change of agent with id {0} to state {1} in {2} since agent not in transit", |
212 | // id, newState, m_mod.Scene.Name); | 212 | // id, newState, m_mod.Scene.Name); |
213 | // } | 213 | // } |
214 | } | 214 | } |
@@ -281,7 +281,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
281 | { | 281 | { |
282 | if (!m_mod.WaitForAgentArrivedAtDestination) | 282 | if (!m_mod.WaitForAgentArrivedAtDestination) |
283 | return true; | 283 | return true; |
284 | 284 | ||
285 | lock (m_agentsInTransit) | 285 | lock (m_agentsInTransit) |
286 | { | 286 | { |
287 | AgentTransferState? currentState = GetAgentTransferState(id); | 287 | AgentTransferState? currentState = GetAgentTransferState(id); |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index a9aaf12..4ad500a 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -160,9 +160,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
160 | scene.RegisterModuleInterface<IUserAgentVerificationModule>(this); | 160 | scene.RegisterModuleInterface<IUserAgentVerificationModule>(this); |
161 | //scene.EventManager.OnIncomingSceneObject += OnIncomingSceneObject; | 161 | //scene.EventManager.OnIncomingSceneObject += OnIncomingSceneObject; |
162 | 162 | ||
163 | m_incomingSceneObjectEngine | 163 | m_incomingSceneObjectEngine |
164 | = new JobEngine( | 164 | = new JobEngine( |
165 | string.Format("HG Incoming Scene Object Engine ({0})", scene.Name), | 165 | string.Format("HG Incoming Scene Object Engine ({0})", scene.Name), |
166 | "HG INCOMING SCENE OBJECT ENGINE"); | 166 | "HG INCOMING SCENE OBJECT ENGINE"); |
167 | 167 | ||
168 | StatsManager.RegisterStat( | 168 | StatsManager.RegisterStat( |
@@ -291,7 +291,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
291 | 291 | ||
292 | GridRegion source = new GridRegion(Scene.RegionInfo); | 292 | GridRegion source = new GridRegion(Scene.RegionInfo); |
293 | source.RawServerURI = m_GatekeeperURI; | 293 | source.RawServerURI = m_GatekeeperURI; |
294 | 294 | ||
295 | bool success = connector.LoginAgentToGrid(source, agentCircuit, reg, finalDestination, false, out reason); | 295 | bool success = connector.LoginAgentToGrid(source, agentCircuit, reg, finalDestination, false, out reason); |
296 | logout = success; // flag for later logout from this grid; this is an HG TP | 296 | logout = success; // flag for later logout from this grid; this is an HG TP |
297 | 297 | ||
@@ -347,7 +347,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
347 | break; | 347 | break; |
348 | } | 348 | } |
349 | 349 | ||
350 | if (!found) | 350 | if (!found) |
351 | { | 351 | { |
352 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Wearable not allowed to go outside {0}", i); | 352 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Wearable not allowed to go outside {0}", i); |
353 | return false; | 353 | return false; |
@@ -416,7 +416,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
416 | // // Rez needed npc attachments | 416 | // // Rez needed npc attachments |
417 | // Scene.AttachmentsModule.RezAttachments(sp); | 417 | // Scene.AttachmentsModule.RezAttachments(sp); |
418 | 418 | ||
419 | 419 | ||
420 | // IAvatarFactoryModule module = Scene.RequestModuleInterface<IAvatarFactoryModule>(); | 420 | // IAvatarFactoryModule module = Scene.RequestModuleInterface<IAvatarFactoryModule>(); |
421 | // //module.SendAppearance(sp.UUID); | 421 | // //module.SendAppearance(sp.UUID); |
422 | // module.RequestRebake(sp, false); | 422 | // module.RequestRebake(sp, false); |
@@ -433,7 +433,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
433 | // return base.UpdateAgent(reg, finalDestination, agentData, sp); | 433 | // return base.UpdateAgent(reg, finalDestination, agentData, sp); |
434 | //} | 434 | //} |
435 | 435 | ||
436 | 436 | ||
437 | public override bool TeleportHome(UUID id, IClientAPI client) | 437 | public override bool TeleportHome(UUID id, IClientAPI client) |
438 | { | 438 | { |
439 | m_log.DebugFormat( | 439 | m_log.DebugFormat( |
@@ -449,7 +449,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
449 | } | 449 | } |
450 | 450 | ||
451 | // Foreign user wants to go home | 451 | // Foreign user wants to go home |
452 | // | 452 | // |
453 | AgentCircuitData aCircuit = ((Scene)(client.Scene)).AuthenticateHandler.GetAgentCircuitData(client.CircuitCode); | 453 | AgentCircuitData aCircuit = ((Scene)(client.Scene)).AuthenticateHandler.GetAgentCircuitData(client.CircuitCode); |
454 | if (aCircuit == null || (aCircuit != null && !aCircuit.ServiceURLs.ContainsKey("HomeURI"))) | 454 | if (aCircuit == null || (aCircuit != null && !aCircuit.ServiceURLs.ContainsKey("HomeURI"))) |
455 | { | 455 | { |
@@ -470,7 +470,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
470 | { | 470 | { |
471 | m_log.Debug("[HG ENTITY TRANSFER MODULE]: GetHomeRegion call failed ", e); | 471 | m_log.Debug("[HG ENTITY TRANSFER MODULE]: GetHomeRegion call failed ", e); |
472 | } | 472 | } |
473 | 473 | ||
474 | if (finalDestination == null) | 474 | if (finalDestination == null) |
475 | { | 475 | { |
476 | client.SendTeleportFailed("Your home region could not be found"); | 476 | client.SendTeleportFailed("Your home region could not be found"); |
@@ -487,7 +487,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
487 | } | 487 | } |
488 | 488 | ||
489 | GridRegion homeGatekeeper = MakeRegion(aCircuit); | 489 | GridRegion homeGatekeeper = MakeRegion(aCircuit); |
490 | 490 | ||
491 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: teleporting user {0} {1} home to {2} via {3}:{4}", | 491 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: teleporting user {0} {1} home to {2} via {3}:{4}", |
492 | aCircuit.firstname, aCircuit.lastname, finalDestination.RegionName, homeGatekeeper.ServerURI, homeGatekeeper.RegionName); | 492 | aCircuit.firstname, aCircuit.lastname, finalDestination.RegionName, homeGatekeeper.ServerURI, homeGatekeeper.RegionName); |
493 | 493 | ||
@@ -503,7 +503,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
503 | /// <param name="position"></param> | 503 | /// <param name="position"></param> |
504 | public override void RequestTeleportLandmark(IClientAPI remoteClient, AssetLandmark lm) | 504 | public override void RequestTeleportLandmark(IClientAPI remoteClient, AssetLandmark lm) |
505 | { | 505 | { |
506 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Teleporting agent via landmark to {0} region {1} position {2}", | 506 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Teleporting agent via landmark to {0} region {1} position {2}", |
507 | (lm.Gatekeeper == string.Empty) ? "local" : lm.Gatekeeper, lm.RegionID, lm.Position); | 507 | (lm.Gatekeeper == string.Empty) ? "local" : lm.Gatekeeper, lm.RegionID, lm.Position); |
508 | 508 | ||
509 | if (lm.Gatekeeper == string.Empty) | 509 | if (lm.Gatekeeper == string.Empty) |
@@ -521,7 +521,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
521 | remoteClient, info.RegionHandle, lm.Position, | 521 | remoteClient, info.RegionHandle, lm.Position, |
522 | Vector3.Zero, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaLandmark)); | 522 | Vector3.Zero, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaLandmark)); |
523 | } | 523 | } |
524 | else | 524 | else |
525 | { | 525 | { |
526 | // Foreign region | 526 | // Foreign region |
527 | GatekeeperServiceConnector gConn = new GatekeeperServiceConnector(); | 527 | GatekeeperServiceConnector gConn = new GatekeeperServiceConnector(); |
@@ -581,7 +581,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
581 | jobsRemoved, commonIdToRemove, jobsToReinsert.Count); | 581 | jobsRemoved, commonIdToRemove, jobsToReinsert.Count); |
582 | 582 | ||
583 | if (jobsToReinsert.Count > 0) | 583 | if (jobsToReinsert.Count > 0) |
584 | { | 584 | { |
585 | foreach (JobEngine.Job jobToReinsert in jobsToReinsert) | 585 | foreach (JobEngine.Job jobToReinsert in jobsToReinsert) |
586 | m_incomingSceneObjectEngine.QueueJob(jobToReinsert); | 586 | m_incomingSceneObjectEngine.QueueJob(jobToReinsert); |
587 | } | 587 | } |
@@ -611,16 +611,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
611 | if (aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServerURI")) | 611 | if (aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServerURI")) |
612 | { | 612 | { |
613 | m_incomingSceneObjectEngine.QueueJob( | 613 | m_incomingSceneObjectEngine.QueueJob( |
614 | string.Format("HG UUID Gather for attachment {0} for {1}", so.Name, aCircuit.Name), | 614 | string.Format("HG UUID Gather for attachment {0} for {1}", so.Name, aCircuit.Name), |
615 | () => | 615 | () => |
616 | { | 616 | { |
617 | string url = aCircuit.ServiceURLs["AssetServerURI"].ToString(); | 617 | string url = aCircuit.ServiceURLs["AssetServerURI"].ToString(); |
618 | // m_log.DebugFormat( | 618 | // m_log.DebugFormat( |
619 | // "[HG ENTITY TRANSFER MODULE]: Incoming attachment {0} for HG user {1} with asset service {2}", | 619 | // "[HG ENTITY TRANSFER MODULE]: Incoming attachment {0} for HG user {1} with asset service {2}", |
620 | // so.Name, so.AttachedAvatar, url); | 620 | // so.Name, so.AttachedAvatar, url); |
621 | 621 | ||
622 | IDictionary<UUID, sbyte> ids = new Dictionary<UUID, sbyte>(); | 622 | IDictionary<UUID, sbyte> ids = new Dictionary<UUID, sbyte>(); |
623 | HGUuidGatherer uuidGatherer | 623 | HGUuidGatherer uuidGatherer |
624 | = new HGUuidGatherer(Scene.AssetService, url, ids); | 624 | = new HGUuidGatherer(Scene.AssetService, url, ids); |
625 | uuidGatherer.AddForInspection(so); | 625 | uuidGatherer.AddForInspection(so); |
626 | 626 | ||
@@ -646,7 +646,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
646 | RemoveIncomingSceneObjectJobs(so.OwnerID.ToString()); | 646 | RemoveIncomingSceneObjectJobs(so.OwnerID.ToString()); |
647 | 647 | ||
648 | return; | 648 | return; |
649 | } | 649 | } |
650 | } | 650 | } |
651 | 651 | ||
652 | // m_log.DebugFormat( | 652 | // m_log.DebugFormat( |
@@ -657,7 +657,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
657 | { | 657 | { |
658 | int tickStart = Util.EnvironmentTickCount(); | 658 | int tickStart = Util.EnvironmentTickCount(); |
659 | 659 | ||
660 | uuidGatherer.FetchAsset(kvp.Key); | 660 | uuidGatherer.FetchAsset(kvp.Key); |
661 | 661 | ||
662 | int ticksElapsed = Util.EnvironmentTickCountSubtract(tickStart); | 662 | int ticksElapsed = Util.EnvironmentTickCountSubtract(tickStart); |
663 | 663 | ||
@@ -670,15 +670,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
670 | RemoveIncomingSceneObjectJobs(so.OwnerID.ToString()); | 670 | RemoveIncomingSceneObjectJobs(so.OwnerID.ToString()); |
671 | 671 | ||
672 | return; | 672 | return; |
673 | } | 673 | } |
674 | } | 674 | } |
675 | 675 | ||
676 | base.HandleIncomingSceneObject(so, newPosition); | 676 | base.HandleIncomingSceneObject(so, newPosition); |
677 | 677 | ||
678 | // m_log.DebugFormat( | 678 | // m_log.DebugFormat( |
679 | // "[HG ENTITY TRANSFER MODULE]: Completed incoming attachment {0} for HG user {1} with asset server {2}", | 679 | // "[HG ENTITY TRANSFER MODULE]: Completed incoming attachment {0} for HG user {1} with asset server {2}", |
680 | // so.Name, so.OwnerID, url); | 680 | // so.Name, so.OwnerID, url); |
681 | }, | 681 | }, |
682 | so.OwnerID.ToString()); | 682 | so.OwnerID.ToString()); |
683 | } | 683 | } |
684 | } | 684 | } |
@@ -698,7 +698,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
698 | string url = aCircuit.ServiceURLs["HomeURI"].ToString(); | 698 | string url = aCircuit.ServiceURLs["HomeURI"].ToString(); |
699 | IUserAgentService security = new UserAgentServiceConnector(url); | 699 | IUserAgentService security = new UserAgentServiceConnector(url); |
700 | return security.VerifyClient(aCircuit.SessionID, token); | 700 | return security.VerifyClient(aCircuit.SessionID, token); |
701 | } | 701 | } |
702 | else | 702 | else |
703 | { | 703 | { |
704 | m_log.DebugFormat( | 704 | m_log.DebugFormat( |
@@ -746,7 +746,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
746 | GridRegion region = new GridRegion(); | 746 | GridRegion region = new GridRegion(); |
747 | 747 | ||
748 | Uri uri = null; | 748 | Uri uri = null; |
749 | if (!aCircuit.ServiceURLs.ContainsKey("HomeURI") || | 749 | if (!aCircuit.ServiceURLs.ContainsKey("HomeURI") || |
750 | (aCircuit.ServiceURLs.ContainsKey("HomeURI") && !Uri.TryCreate(aCircuit.ServiceURLs["HomeURI"].ToString(), UriKind.Absolute, out uri))) | 750 | (aCircuit.ServiceURLs.ContainsKey("HomeURI") && !Uri.TryCreate(aCircuit.ServiceURLs["HomeURI"].ToString(), UriKind.Absolute, out uri))) |
751 | return null; | 751 | return null; |
752 | 752 | ||
diff --git a/OpenSim/Region/CoreModules/Framework/InterfaceCommander/Commander.cs b/OpenSim/Region/CoreModules/Framework/InterfaceCommander/Commander.cs index b5a4005..63dbb19 100644 --- a/OpenSim/Region/CoreModules/Framework/InterfaceCommander/Commander.cs +++ b/OpenSim/Region/CoreModules/Framework/InterfaceCommander/Commander.cs | |||
@@ -41,34 +41,34 @@ namespace OpenSim.Region.CoreModules.Framework.InterfaceCommander | |||
41 | public class Commander : ICommander | 41 | public class Commander : ICommander |
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 | /// <value> | 45 | /// <value> |
46 | /// Used in runtime class generation | 46 | /// Used in runtime class generation |
47 | /// </summary> | 47 | /// </summary> |
48 | private string m_generatedApiClassName; | 48 | private string m_generatedApiClassName; |
49 | 49 | ||
50 | public string Name | 50 | public string Name |
51 | { | 51 | { |
52 | get { return m_name; } | 52 | get { return m_name; } |
53 | } | 53 | } |
54 | private string m_name; | 54 | private string m_name; |
55 | 55 | ||
56 | public string Help | 56 | public string Help |
57 | { | 57 | { |
58 | get | 58 | get |
59 | { | 59 | { |
60 | StringBuilder sb = new StringBuilder(); | 60 | StringBuilder sb = new StringBuilder(); |
61 | 61 | ||
62 | sb.AppendLine("=== " + m_name + " ==="); | 62 | sb.AppendLine("=== " + m_name + " ==="); |
63 | 63 | ||
64 | foreach (ICommand com in m_commands.Values) | 64 | foreach (ICommand com in m_commands.Values) |
65 | { | 65 | { |
66 | sb.AppendLine("* " + Name + " " + com.Name + " - " + com.Help); | 66 | sb.AppendLine("* " + Name + " " + com.Name + " - " + com.Help); |
67 | } | 67 | } |
68 | 68 | ||
69 | return sb.ToString(); | 69 | return sb.ToString(); |
70 | } | 70 | } |
71 | } | 71 | } |
72 | 72 | ||
73 | /// <summary> | 73 | /// <summary> |
74 | /// Constructor | 74 | /// Constructor |
@@ -78,7 +78,7 @@ namespace OpenSim.Region.CoreModules.Framework.InterfaceCommander | |||
78 | { | 78 | { |
79 | m_name = name; | 79 | m_name = name; |
80 | m_generatedApiClassName = m_name[0].ToString().ToUpper(); | 80 | m_generatedApiClassName = m_name[0].ToString().ToUpper(); |
81 | 81 | ||
82 | if (m_name.Length > 1) | 82 | if (m_name.Length > 1) |
83 | m_generatedApiClassName += m_name.Substring(1); | 83 | m_generatedApiClassName += m_name.Substring(1); |
84 | } | 84 | } |
@@ -87,7 +87,7 @@ namespace OpenSim.Region.CoreModules.Framework.InterfaceCommander | |||
87 | { | 87 | { |
88 | get { return m_commands; } | 88 | get { return m_commands; } |
89 | } | 89 | } |
90 | private Dictionary<string, ICommand> m_commands = new Dictionary<string, ICommand>(); | 90 | private Dictionary<string, ICommand> m_commands = new Dictionary<string, ICommand>(); |
91 | 91 | ||
92 | #region ICommander Members | 92 | #region ICommander Members |
93 | 93 | ||
@@ -162,7 +162,7 @@ namespace OpenSim.Region.CoreModules.Framework.InterfaceCommander | |||
162 | { | 162 | { |
163 | if (function != "help") | 163 | if (function != "help") |
164 | Console.WriteLine("ERROR: Invalid command - No such command exists"); | 164 | Console.WriteLine("ERROR: Invalid command - No such command exists"); |
165 | 165 | ||
166 | Console.Write(Help); | 166 | Console.Write(Help); |
167 | } | 167 | } |
168 | } | 168 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs index f54298c..51ae217 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs | |||
@@ -178,7 +178,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
178 | { | 178 | { |
179 | UUID uuid = UUID.Zero; | 179 | UUID uuid = UUID.Zero; |
180 | UUID.TryParse(meta.CreatorID, out uuid); | 180 | UUID.TryParse(meta.CreatorID, out uuid); |
181 | UserAccount creator = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, uuid); | 181 | UserAccount creator = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, uuid); |
182 | if (creator != null) | 182 | if (creator != null) |
183 | meta.CreatorID = m_HomeURI + ";" + creator.FirstName + " " + creator.LastName; | 183 | meta.CreatorID = m_HomeURI + ";" + creator.FirstName + " " + creator.LastName; |
184 | } | 184 | } |
@@ -300,8 +300,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
300 | { | 300 | { |
301 | m_log.Error( | 301 | m_log.Error( |
302 | string.Format( | 302 | string.Format( |
303 | "[HG ASSET MAPPER]: Failed to post asset {0} (type {1}, length {2}) referenced from {3} to {4} with exception ", | 303 | "[HG ASSET MAPPER]: Failed to post asset {0} (type {1}, length {2}) referenced from {3} to {4} with exception ", |
304 | asset.ID, asset.Type, asset.Data.Length, assetID, userAssetURL), | 304 | asset.ID, asset.Type, asset.Data.Length, assetID, userAssetURL), |
305 | e); | 305 | e); |
306 | 306 | ||
307 | // For debugging purposes for now we will continue to throw the exception up the stack as was already happening. However, after | 307 | // For debugging purposes for now we will continue to throw the exception up the stack as was already happening. However, after |
@@ -315,7 +315,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
315 | else | 315 | else |
316 | { | 316 | { |
317 | m_log.DebugFormat( | 317 | m_log.DebugFormat( |
318 | "[HG ASSET MAPPER]: Didn't post asset {0} referenced from {1} because it already exists in asset server {2}", | 318 | "[HG ASSET MAPPER]: Didn't post asset {0} referenced from {1} because it already exists in asset server {2}", |
319 | uuid, assetID, userAssetURL); | 319 | uuid, assetID, userAssetURL); |
320 | } | 320 | } |
321 | } | 321 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index 4d7c25b..f89e446 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs | |||
@@ -91,9 +91,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
91 | if (name == Name) | 91 | if (name == Name) |
92 | { | 92 | { |
93 | m_Enabled = true; | 93 | m_Enabled = true; |
94 | 94 | ||
95 | InitialiseCommon(source); | 95 | InitialiseCommon(source); |
96 | 96 | ||
97 | m_log.InfoFormat("[HG INVENTORY ACCESS MODULE]: {0} enabled.", Name); | 97 | m_log.InfoFormat("[HG INVENTORY ACCESS MODULE]: {0} enabled.", Name); |
98 | 98 | ||
99 | IConfig thisModuleConfig = source.Configs["HGInventoryAccessModule"]; | 99 | IConfig thisModuleConfig = source.Configs["HGInventoryAccessModule"]; |
@@ -117,7 +117,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
117 | m_log.Warn("[HG INVENTORY ACCESS MODULE]: HGInventoryAccessModule configs not found. ProfileServerURI not set!"); | 117 | m_log.Warn("[HG INVENTORY ACCESS MODULE]: HGInventoryAccessModule configs not found. ProfileServerURI not set!"); |
118 | 118 | ||
119 | m_bypassPermissions = !Util.GetConfigVarFromSections<bool>(source, "serverside_object_permissions", | 119 | m_bypassPermissions = !Util.GetConfigVarFromSections<bool>(source, "serverside_object_permissions", |
120 | new string[] { "Startup", "Permissions" }, true); | 120 | new string[] { "Startup", "Permissions" }, true); |
121 | 121 | ||
122 | } | 122 | } |
123 | } | 123 | } |
@@ -248,7 +248,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
248 | } | 248 | } |
249 | 249 | ||
250 | 250 | ||
251 | /// | 251 | /// |
252 | /// CapsUpdateInventoryItemAsset | 252 | /// CapsUpdateInventoryItemAsset |
253 | /// | 253 | /// |
254 | public override UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data) | 254 | public override UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data) |
@@ -268,7 +268,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
268 | return newAssetID; | 268 | return newAssetID; |
269 | } | 269 | } |
270 | 270 | ||
271 | /// | 271 | /// |
272 | /// UpdateInventoryItemAsset | 272 | /// UpdateInventoryItemAsset |
273 | /// | 273 | /// |
274 | public override bool UpdateInventoryItemAsset(UUID ownerID, InventoryItemBase item, AssetBase asset) | 274 | public override bool UpdateInventoryItemAsset(UUID ownerID, InventoryItemBase item, AssetBase asset) |
@@ -317,7 +317,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
317 | RezSelected, RemoveItem, fromTaskID, attachment); | 317 | RezSelected, RemoveItem, fromTaskID, attachment); |
318 | } | 318 | } |
319 | 319 | ||
320 | public override SceneObjectGroup RezObject(IClientAPI remoteClient, UUID itemID, | 320 | public override SceneObjectGroup RezObject(IClientAPI remoteClient, UUID itemID, |
321 | UUID groupID, Vector3 RayEnd, Vector3 RayStart, | 321 | UUID groupID, Vector3 RayEnd, Vector3 RayStart, |
322 | UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, | 322 | UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, |
323 | bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) | 323 | bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) |
@@ -386,7 +386,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
386 | if (!m_CheckSeparateAssets) | 386 | if (!m_CheckSeparateAssets) |
387 | { | 387 | { |
388 | if (!UserManagementModule.IsLocalGridUser(userID)) | 388 | if (!UserManagementModule.IsLocalGridUser(userID)) |
389 | { // foreign | 389 | { // foreign |
390 | ScenePresence sp = null; | 390 | ScenePresence sp = null; |
391 | if (m_Scene.TryGetScenePresence(userID, out sp)) | 391 | if (m_Scene.TryGetScenePresence(userID, out sp)) |
392 | { | 392 | { |
@@ -524,7 +524,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
524 | foreach (InventoryItemBase it in content.Items) | 524 | foreach (InventoryItemBase it in content.Items) |
525 | it.Name = it.Name + " (Unavailable)"; ; | 525 | it.Name = it.Name + " (Unavailable)"; ; |
526 | 526 | ||
527 | // Send the new names | 527 | // Send the new names |
528 | inv.SendBulkUpdateInventory(keep.ToArray(), content.Items.ToArray()); | 528 | inv.SendBulkUpdateInventory(keep.ToArray(), content.Items.ToArray()); |
529 | 529 | ||
530 | } | 530 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 771e5fe..fcf373b 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
68 | return m_UserManagement; | 68 | return m_UserManagement; |
69 | } | 69 | } |
70 | } | 70 | } |
71 | 71 | ||
72 | public bool CoalesceMultipleObjectsToInventory { get; set; } | 72 | public bool CoalesceMultipleObjectsToInventory { get; set; } |
73 | 73 | ||
74 | #region INonSharedRegionModule | 74 | #region INonSharedRegionModule |
@@ -92,14 +92,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
92 | if (name == Name) | 92 | if (name == Name) |
93 | { | 93 | { |
94 | m_Enabled = true; | 94 | m_Enabled = true; |
95 | 95 | ||
96 | InitialiseCommon(source); | 96 | InitialiseCommon(source); |
97 | 97 | ||
98 | m_log.InfoFormat("[INVENTORY ACCESS MODULE]: {0} enabled.", Name); | 98 | m_log.InfoFormat("[INVENTORY ACCESS MODULE]: {0} enabled.", Name); |
99 | } | 99 | } |
100 | } | 100 | } |
101 | } | 101 | } |
102 | 102 | ||
103 | /// <summary> | 103 | /// <summary> |
104 | /// Common module config for both this and descendant classes. | 104 | /// Common module config for both this and descendant classes. |
105 | /// </summary> | 105 | /// </summary> |
@@ -107,9 +107,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
107 | protected virtual void InitialiseCommon(IConfigSource source) | 107 | protected virtual void InitialiseCommon(IConfigSource source) |
108 | { | 108 | { |
109 | IConfig inventoryConfig = source.Configs["Inventory"]; | 109 | IConfig inventoryConfig = source.Configs["Inventory"]; |
110 | 110 | ||
111 | if (inventoryConfig != null) | 111 | if (inventoryConfig != null) |
112 | CoalesceMultipleObjectsToInventory | 112 | CoalesceMultipleObjectsToInventory |
113 | = inventoryConfig.GetBoolean("CoalesceMultipleObjectsToInventory", true); | 113 | = inventoryConfig.GetBoolean("CoalesceMultipleObjectsToInventory", true); |
114 | else | 114 | else |
115 | CoalesceMultipleObjectsToInventory = true; | 115 | CoalesceMultipleObjectsToInventory = true; |
@@ -322,7 +322,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
322 | if (item != null && item.Owner == ownerID && asset != null) | 322 | if (item != null && item.Owner == ownerID && asset != null) |
323 | { | 323 | { |
324 | // m_log.DebugFormat( | 324 | // m_log.DebugFormat( |
325 | // "[INVENTORY ACCESS MODULE]: Updating item {0} {1} with new asset {2}", | 325 | // "[INVENTORY ACCESS MODULE]: Updating item {0} {1} with new asset {2}", |
326 | // item.Name, item.ID, asset.ID); | 326 | // item.Name, item.ID, asset.ID); |
327 | 327 | ||
328 | item.AssetID = asset.FullID; | 328 | item.AssetID = asset.FullID; |
@@ -351,7 +351,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
351 | List<InventoryItemBase> copiedItems = new List<InventoryItemBase>(); | 351 | List<InventoryItemBase> copiedItems = new List<InventoryItemBase>(); |
352 | 352 | ||
353 | Dictionary<UUID, List<SceneObjectGroup>> bundlesToCopy = new Dictionary<UUID, List<SceneObjectGroup>>(); | 353 | Dictionary<UUID, List<SceneObjectGroup>> bundlesToCopy = new Dictionary<UUID, List<SceneObjectGroup>>(); |
354 | 354 | ||
355 | if (CoalesceMultipleObjectsToInventory) | 355 | if (CoalesceMultipleObjectsToInventory) |
356 | { | 356 | { |
357 | // The following code groups the SOG's by owner. No objects | 357 | // The following code groups the SOG's by owner. No objects |
@@ -361,7 +361,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
361 | { | 361 | { |
362 | if (!bundlesToCopy.ContainsKey(g.OwnerID)) | 362 | if (!bundlesToCopy.ContainsKey(g.OwnerID)) |
363 | bundlesToCopy[g.OwnerID] = new List<SceneObjectGroup>(); | 363 | bundlesToCopy[g.OwnerID] = new List<SceneObjectGroup>(); |
364 | 364 | ||
365 | bundlesToCopy[g.OwnerID].Add(g); | 365 | bundlesToCopy[g.OwnerID].Add(g); |
366 | } | 366 | } |
367 | } | 367 | } |
@@ -372,7 +372,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
372 | { | 372 | { |
373 | List<SceneObjectGroup> bundle = new List<SceneObjectGroup>(); | 373 | List<SceneObjectGroup> bundle = new List<SceneObjectGroup>(); |
374 | bundle.Add(g); | 374 | bundle.Add(g); |
375 | bundlesToCopy[g.UUID] = bundle; | 375 | bundlesToCopy[g.UUID] = bundle; |
376 | } | 376 | } |
377 | } | 377 | } |
378 | 378 | ||
@@ -384,10 +384,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
384 | // with distinct destinations as well. | 384 | // with distinct destinations as well. |
385 | foreach (List<SceneObjectGroup> bundle in bundlesToCopy.Values) | 385 | foreach (List<SceneObjectGroup> bundle in bundlesToCopy.Values) |
386 | copiedItems.Add(CopyBundleToInventory(action, folderID, bundle, remoteClient, asAttachment)); | 386 | copiedItems.Add(CopyBundleToInventory(action, folderID, bundle, remoteClient, asAttachment)); |
387 | 387 | ||
388 | return copiedItems; | 388 | return copiedItems; |
389 | } | 389 | } |
390 | 390 | ||
391 | /// <summary> | 391 | /// <summary> |
392 | /// Copy a bundle of objects to inventory. If there is only one object, then this will create an object | 392 | /// Copy a bundle of objects to inventory. If there is only one object, then this will create an object |
393 | /// item. If there are multiple objects then these will be saved as a single coalesced item. | 393 | /// item. If there are multiple objects then these will be saved as a single coalesced item. |
@@ -408,7 +408,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
408 | Dictionary<UUID, Quaternion> originalRotations = new Dictionary<UUID, Quaternion>(); | 408 | Dictionary<UUID, Quaternion> originalRotations = new Dictionary<UUID, Quaternion>(); |
409 | // this possible is not needed if keyframes are saved | 409 | // this possible is not needed if keyframes are saved |
410 | Dictionary<UUID, KeyframeMotion> originalKeyframes = new Dictionary<UUID, KeyframeMotion>(); | 410 | Dictionary<UUID, KeyframeMotion> originalKeyframes = new Dictionary<UUID, KeyframeMotion>(); |
411 | 411 | ||
412 | foreach (SceneObjectGroup objectGroup in objlist) | 412 | foreach (SceneObjectGroup objectGroup in objlist) |
413 | { | 413 | { |
414 | if (objectGroup.RootPart.KeyframeMotion != null) | 414 | if (objectGroup.RootPart.KeyframeMotion != null) |
@@ -457,7 +457,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
457 | (uint)PermissionMask.Export); | 457 | (uint)PermissionMask.Export); |
458 | objectGroup.RootPart.NextOwnerMask |= | 458 | objectGroup.RootPart.NextOwnerMask |= |
459 | (uint)PermissionMask.Move; | 459 | (uint)PermissionMask.Move; |
460 | 460 | ||
461 | coa.Add(objectGroup); | 461 | coa.Add(objectGroup); |
462 | } | 462 | } |
463 | 463 | ||
@@ -471,7 +471,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
471 | itemXml = CoalescedSceneObjectsSerializer.ToXml(coa, !asAttachment); | 471 | itemXml = CoalescedSceneObjectsSerializer.ToXml(coa, !asAttachment); |
472 | else | 472 | else |
473 | itemXml = SceneObjectSerializer.ToOriginalXmlFormat(objlist[0], !asAttachment); | 473 | itemXml = SceneObjectSerializer.ToOriginalXmlFormat(objlist[0], !asAttachment); |
474 | 474 | ||
475 | // Restore the position of each group now that it has been stored to inventory. | 475 | // Restore the position of each group now that it has been stored to inventory. |
476 | foreach (SceneObjectGroup objectGroup in objlist) | 476 | foreach (SceneObjectGroup objectGroup in objlist) |
477 | { | 477 | { |
@@ -493,11 +493,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
493 | 493 | ||
494 | item.CreatorId = objlist[0].RootPart.CreatorID.ToString(); | 494 | item.CreatorId = objlist[0].RootPart.CreatorID.ToString(); |
495 | item.CreatorData = objlist[0].RootPart.CreatorData; | 495 | item.CreatorData = objlist[0].RootPart.CreatorData; |
496 | 496 | ||
497 | if (objlist.Count > 1) | 497 | if (objlist.Count > 1) |
498 | { | 498 | { |
499 | item.Flags = (uint)InventoryItemFlags.ObjectHasMultipleItems; | 499 | item.Flags = (uint)InventoryItemFlags.ObjectHasMultipleItems; |
500 | 500 | ||
501 | // If the objects have different creators then don't specify a creator at all | 501 | // If the objects have different creators then don't specify a creator at all |
502 | foreach (SceneObjectGroup objectGroup in objlist) | 502 | foreach (SceneObjectGroup objectGroup in objlist) |
503 | { | 503 | { |
@@ -513,8 +513,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
513 | else | 513 | else |
514 | { | 514 | { |
515 | item.SaleType = objlist[0].RootPart.ObjectSaleType; | 515 | item.SaleType = objlist[0].RootPart.ObjectSaleType; |
516 | item.SalePrice = objlist[0].RootPart.SalePrice; | 516 | item.SalePrice = objlist[0].RootPart.SalePrice; |
517 | } | 517 | } |
518 | 518 | ||
519 | AssetBase asset = CreateAsset( | 519 | AssetBase asset = CreateAsset( |
520 | objlist[0].GetPartName(objlist[0].RootPart.LocalId), | 520 | objlist[0].GetPartName(objlist[0].RootPart.LocalId), |
@@ -523,7 +523,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
523 | Utils.StringToBytes(itemXml), | 523 | Utils.StringToBytes(itemXml), |
524 | objlist[0].OwnerID.ToString()); | 524 | objlist[0].OwnerID.ToString()); |
525 | m_Scene.AssetService.Store(asset); | 525 | m_Scene.AssetService.Store(asset); |
526 | 526 | ||
527 | item.AssetID = asset.FullID; | 527 | item.AssetID = asset.FullID; |
528 | 528 | ||
529 | if (DeRezAction.SaveToExistingUserInventoryItem == action) | 529 | if (DeRezAction.SaveToExistingUserInventoryItem == action) |
@@ -562,7 +562,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
562 | // This is a hook to do some per-asset post-processing for subclasses that need that | 562 | // This is a hook to do some per-asset post-processing for subclasses that need that |
563 | if (remoteClient != null && action != DeRezAction.Delete) | 563 | if (remoteClient != null && action != DeRezAction.Delete) |
564 | ExportAsset(remoteClient.AgentId, asset.FullID); | 564 | ExportAsset(remoteClient.AgentId, asset.FullID); |
565 | 565 | ||
566 | return item; | 566 | return item; |
567 | } | 567 | } |
568 | 568 | ||
@@ -580,7 +580,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
580 | /// <param name="remoteClient"></param> | 580 | /// <param name="remoteClient"></param> |
581 | /// <returns></returns> | 581 | /// <returns></returns> |
582 | protected InventoryItemBase AddPermissions( | 582 | protected InventoryItemBase AddPermissions( |
583 | InventoryItemBase item, SceneObjectGroup so, List<SceneObjectGroup> objsForEffectivePermissions, | 583 | InventoryItemBase item, SceneObjectGroup so, List<SceneObjectGroup> objsForEffectivePermissions, |
584 | IClientAPI remoteClient) | 584 | IClientAPI remoteClient) |
585 | { | 585 | { |
586 | uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move | PermissionMask.Export) | 7; | 586 | uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move | PermissionMask.Export) | 7; |
@@ -614,7 +614,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
614 | item.NextPermissions = perms & so.RootPart.NextOwnerMask; | 614 | item.NextPermissions = perms & so.RootPart.NextOwnerMask; |
615 | item.EveryOnePermissions = so.RootPart.EveryoneMask & so.RootPart.NextOwnerMask; | 615 | item.EveryOnePermissions = so.RootPart.EveryoneMask & so.RootPart.NextOwnerMask; |
616 | item.GroupPermissions = so.RootPart.GroupMask & so.RootPart.NextOwnerMask; | 616 | item.GroupPermissions = so.RootPart.GroupMask & so.RootPart.NextOwnerMask; |
617 | 617 | ||
618 | // apply next owner perms on rez | 618 | // apply next owner perms on rez |
619 | item.CurrentPermissions |= SceneObjectGroup.SLAM; | 619 | item.CurrentPermissions |= SceneObjectGroup.SLAM; |
620 | } | 620 | } |
@@ -642,11 +642,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
642 | 7); // Preserve folded permissions | 642 | 7); // Preserve folded permissions |
643 | } | 643 | } |
644 | 644 | ||
645 | //PermissionsUtil.LogPermissions(item.Name, "After AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions); | 645 | //PermissionsUtil.LogPermissions(item.Name, "After AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions); |
646 | 646 | ||
647 | return item; | 647 | return item; |
648 | } | 648 | } |
649 | 649 | ||
650 | /// <summary> | 650 | /// <summary> |
651 | /// Create an item using details for the given scene object. | 651 | /// Create an item using details for the given scene object. |
652 | /// </summary> | 652 | /// </summary> |
@@ -659,7 +659,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
659 | DeRezAction action, IClientAPI remoteClient, SceneObjectGroup so, UUID folderID) | 659 | DeRezAction action, IClientAPI remoteClient, SceneObjectGroup so, UUID folderID) |
660 | { | 660 | { |
661 | // m_log.DebugFormat( | 661 | // m_log.DebugFormat( |
662 | // "[BASIC INVENTORY ACCESS MODULE]: Creating item for object {0} {1} for folder {2}, action {3}", | 662 | // "[BASIC INVENTORY ACCESS MODULE]: Creating item for object {0} {1} for folder {2}, action {3}", |
663 | // so.Name, so.UUID, folderID, action); | 663 | // so.Name, so.UUID, folderID, action); |
664 | // | 664 | // |
665 | // Get the user info of the item destination | 665 | // Get the user info of the item destination |
@@ -707,7 +707,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
707 | // Delete is treated like return in this case | 707 | // Delete is treated like return in this case |
708 | // Deleting your own items makes them go to trash | 708 | // Deleting your own items makes them go to trash |
709 | // | 709 | // |
710 | 710 | ||
711 | InventoryFolderBase folder = null; | 711 | InventoryFolderBase folder = null; |
712 | InventoryItemBase item = null; | 712 | InventoryItemBase item = null; |
713 | 713 | ||
@@ -723,7 +723,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
723 | m_log.DebugFormat( | 723 | m_log.DebugFormat( |
724 | "[INVENTORY ACCESS MODULE]: Object {0} {1} scheduled for save to inventory has already been deleted.", | 724 | "[INVENTORY ACCESS MODULE]: Object {0} {1} scheduled for save to inventory has already been deleted.", |
725 | so.Name, so.UUID); | 725 | so.Name, so.UUID); |
726 | 726 | ||
727 | return null; | 727 | return null; |
728 | } | 728 | } |
729 | } | 729 | } |
@@ -805,13 +805,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
805 | } | 805 | } |
806 | } | 806 | } |
807 | 807 | ||
808 | item = new InventoryItemBase(); | 808 | item = new InventoryItemBase(); |
809 | item.ID = UUID.Random(); | 809 | item.ID = UUID.Random(); |
810 | item.InvType = (int)InventoryType.Object; | 810 | item.InvType = (int)InventoryType.Object; |
811 | item.Folder = folder.ID; | 811 | item.Folder = folder.ID; |
812 | item.Owner = userID; | 812 | item.Owner = userID; |
813 | } | 813 | } |
814 | 814 | ||
815 | return item; | 815 | return item; |
816 | } | 816 | } |
817 | // compatibility do not use | 817 | // compatibility do not use |
@@ -863,7 +863,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
863 | byte BypassRayCast, bool RayEndIsIntersection, | 863 | byte BypassRayCast, bool RayEndIsIntersection, |
864 | bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) | 864 | bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) |
865 | { | 865 | { |
866 | AssetBase rezAsset = m_Scene.AssetService.Get(assetID.ToString()); | 866 | AssetBase rezAsset = m_Scene.AssetService.Get(assetID.ToString()); |
867 | 867 | ||
868 | if (rezAsset == null) | 868 | if (rezAsset == null) |
869 | { | 869 | { |
@@ -891,7 +891,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
891 | "[INVENTORY ACCESS MODULE]: missing data in asset {0} to RezObject()", | 891 | "[INVENTORY ACCESS MODULE]: missing data in asset {0} to RezObject()", |
892 | assetID, remoteClient.Name); | 892 | assetID, remoteClient.Name); |
893 | remoteClient.SendAgentAlertMessage(string.Format("Unable to rez: missing data in asset {0} ", assetID), false); | 893 | remoteClient.SendAgentAlertMessage(string.Format("Unable to rez: missing data in asset {0} ", assetID), false); |
894 | return null; | 894 | return null; |
895 | } | 895 | } |
896 | 896 | ||
897 | SceneObjectGroup group = null; | 897 | SceneObjectGroup group = null; |
@@ -903,7 +903,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
903 | byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0); | 903 | byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0); |
904 | Vector3 pos; | 904 | Vector3 pos; |
905 | 905 | ||
906 | bool single | 906 | bool single |
907 | = m_Scene.GetObjectsToRez( | 907 | = m_Scene.GetObjectsToRez( |
908 | rezAsset.Data, attachment, out objlist, out veclist, out bbox, out offsetHeight); | 908 | rezAsset.Data, attachment, out objlist, out veclist, out bbox, out offsetHeight); |
909 | 909 | ||
@@ -1055,7 +1055,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
1055 | /// <param name="isAttachment"></param> | 1055 | /// <param name="isAttachment"></param> |
1056 | /// <returns>true if we can processed with rezzing, false if we need to abort</returns> | 1056 | /// <returns>true if we can processed with rezzing, false if we need to abort</returns> |
1057 | private bool DoPreRezWhenFromItem( | 1057 | private bool DoPreRezWhenFromItem( |
1058 | IClientAPI remoteClient, InventoryItemBase item, List<SceneObjectGroup> objlist, | 1058 | IClientAPI remoteClient, InventoryItemBase item, List<SceneObjectGroup> objlist, |
1059 | Vector3 pos, List<Vector3> veclist, bool isAttachment) | 1059 | Vector3 pos, List<Vector3> veclist, bool isAttachment) |
1060 | { | 1060 | { |
1061 | UUID fromUserInventoryItemId = UUID.Zero; | 1061 | UUID fromUserInventoryItemId = UUID.Zero; |
@@ -1142,7 +1142,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
1142 | //Need to kill the for sale here | 1142 | //Need to kill the for sale here |
1143 | rootPart.ObjectSaleType = 0; | 1143 | rootPart.ObjectSaleType = 0; |
1144 | rootPart.SalePrice = 10; | 1144 | rootPart.SalePrice = 10; |
1145 | 1145 | ||
1146 | if (m_Scene.Permissions.PropagatePermissions()) | 1146 | if (m_Scene.Permissions.PropagatePermissions()) |
1147 | { | 1147 | { |
1148 | foreach (SceneObjectPart part in so.Parts) | 1148 | foreach (SceneObjectPart part in so.Parts) |
@@ -1154,7 +1154,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
1154 | part.RezzerID = item.Owner; | 1154 | part.RezzerID = item.Owner; |
1155 | part.Inventory.ChangeInventoryOwner(item.Owner); | 1155 | part.Inventory.ChangeInventoryOwner(item.Owner); |
1156 | } | 1156 | } |
1157 | 1157 | ||
1158 | so.ApplyNextOwnerPermissions(); | 1158 | so.ApplyNextOwnerPermissions(); |
1159 | 1159 | ||
1160 | // In case the user has changed flags on a received item | 1160 | // In case the user has changed flags on a received item |
@@ -1312,7 +1312,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
1312 | { | 1312 | { |
1313 | IInventoryService invService = m_Scene.RequestModuleInterface<IInventoryService>(); | 1313 | IInventoryService invService = m_Scene.RequestModuleInterface<IInventoryService>(); |
1314 | InventoryItemBase item = invService.GetItem(agentID, itemID); | 1314 | InventoryItemBase item = invService.GetItem(agentID, itemID); |
1315 | 1315 | ||
1316 | if (item != null && item.CreatorData != null && item.CreatorData != string.Empty) | 1316 | if (item != null && item.CreatorData != null && item.CreatorData != string.Empty) |
1317 | UserManagementModule.AddUser(item.CreatorIdAsUuid, item.CreatorData); | 1317 | UserManagementModule.AddUser(item.CreatorIdAsUuid, item.CreatorData); |
1318 | 1318 | ||
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/HGAssetMapperTests.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/HGAssetMapperTests.cs index 007ff63..8f12331 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/HGAssetMapperTests.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/HGAssetMapperTests.cs | |||
@@ -77,7 +77,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
77 | scene.StartScripts(); | 77 | scene.StartScripts(); |
78 | 78 | ||
79 | HGAssetMapper hgam = new HGAssetMapper(scene, homeUrl); | 79 | HGAssetMapper hgam = new HGAssetMapper(scene, homeUrl); |
80 | UserAccount ua | 80 | UserAccount ua |
81 | = UserAccountHelpers.CreateUserWithInventory(scene, userFirstName, userLastName, userId, "password"); | 81 | = UserAccountHelpers.CreateUserWithInventory(scene, userFirstName, userLastName, userId, "password"); |
82 | 82 | ||
83 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, soPartsCount, ua.PrincipalID, "part", soIdTail); | 83 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, soPartsCount, ua.PrincipalID, "part", soIdTail); |
@@ -116,7 +116,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
116 | XmlNode uuidAttribute = savedScriptStateNodes[0].Attributes.GetNamedItem("UUID"); | 116 | XmlNode uuidAttribute = savedScriptStateNodes[0].Attributes.GetNamedItem("UUID"); |
117 | Assert.NotNull(uuidAttribute); | 117 | Assert.NotNull(uuidAttribute); |
118 | // XXX: To check the actual UUID attribute we would have to do some work to retreive the UUID of the task | 118 | // XXX: To check the actual UUID attribute we would have to do some work to retreive the UUID of the task |
119 | // item created earlier. | 119 | // item created earlier. |
120 | } | 120 | } |
121 | 121 | ||
122 | private void RezScript(Scene scene, UUID soId, string script, string itemName, UUID userId) | 122 | private void RezScript(Scene scene, UUID soId, string script, string itemName, UUID userId) |
@@ -131,9 +131,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
131 | // immediately for tests rather than chunter through it's threaded mechanisms. | 131 | // immediately for tests rather than chunter through it's threaded mechanisms. |
132 | AutoResetEvent chatEvent = new AutoResetEvent(false); | 132 | AutoResetEvent chatEvent = new AutoResetEvent(false); |
133 | 133 | ||
134 | scene.EventManager.OnChatFromWorld += (s, c) => | 134 | scene.EventManager.OnChatFromWorld += (s, c) => |
135 | { | 135 | { |
136 | // Console.WriteLine("Got chat [{0}]", c.Message); | 136 | // Console.WriteLine("Got chat [{0}]", c.Message); |
137 | chatEvent.Set(); | 137 | chatEvent.Set(); |
138 | }; | 138 | }; |
139 | 139 | ||
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs index b31d4df..de29ae9 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs | |||
@@ -48,12 +48,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
48 | { | 48 | { |
49 | [TestFixture] | 49 | [TestFixture] |
50 | public class InventoryAccessModuleTests : OpenSimTestCase | 50 | public class InventoryAccessModuleTests : OpenSimTestCase |
51 | { | 51 | { |
52 | protected TestScene m_scene; | 52 | protected TestScene m_scene; |
53 | protected BasicInventoryAccessModule m_iam; | 53 | protected BasicInventoryAccessModule m_iam; |
54 | protected UUID m_userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); | 54 | protected UUID m_userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); |
55 | protected TestClient m_tc; | 55 | protected TestClient m_tc; |
56 | 56 | ||
57 | [SetUp] | 57 | [SetUp] |
58 | public override void SetUp() | 58 | public override void SetUp() |
59 | { | 59 | { |
@@ -68,32 +68,32 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
68 | SceneHelpers sceneHelpers = new SceneHelpers(); | 68 | SceneHelpers sceneHelpers = new SceneHelpers(); |
69 | m_scene = sceneHelpers.SetupScene(); | 69 | m_scene = sceneHelpers.SetupScene(); |
70 | SceneHelpers.SetupSceneModules(m_scene, config, m_iam); | 70 | SceneHelpers.SetupSceneModules(m_scene, config, m_iam); |
71 | 71 | ||
72 | // Create user | 72 | // Create user |
73 | string userFirstName = "Jock"; | 73 | string userFirstName = "Jock"; |
74 | string userLastName = "Stirrup"; | 74 | string userLastName = "Stirrup"; |
75 | string userPassword = "troll"; | 75 | string userPassword = "troll"; |
76 | UserAccountHelpers.CreateUserWithInventory(m_scene, userFirstName, userLastName, m_userId, userPassword); | 76 | UserAccountHelpers.CreateUserWithInventory(m_scene, userFirstName, userLastName, m_userId, userPassword); |
77 | 77 | ||
78 | AgentCircuitData acd = new AgentCircuitData(); | 78 | AgentCircuitData acd = new AgentCircuitData(); |
79 | acd.AgentID = m_userId; | 79 | acd.AgentID = m_userId; |
80 | m_tc = new TestClient(acd, m_scene); | 80 | m_tc = new TestClient(acd, m_scene); |
81 | } | 81 | } |
82 | 82 | ||
83 | [Test] | 83 | [Test] |
84 | public void TestRezCoalescedObject() | 84 | public void TestRezCoalescedObject() |
85 | { | 85 | { |
86 | /* | 86 | /* |
87 | TestHelpers.InMethod(); | 87 | TestHelpers.InMethod(); |
88 | // log4net.Config.XmlConfigurator.Configure(); | 88 | // log4net.Config.XmlConfigurator.Configure(); |
89 | 89 | ||
90 | // Create asset | 90 | // Create asset |
91 | SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, m_userId, "Object1", 0x20); | 91 | SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, m_userId, "Object1", 0x20); |
92 | object1.AbsolutePosition = new Vector3(15, 30, 45); | 92 | object1.AbsolutePosition = new Vector3(15, 30, 45); |
93 | 93 | ||
94 | SceneObjectGroup object2 = SceneHelpers.CreateSceneObject(1, m_userId, "Object2", 0x40); | 94 | SceneObjectGroup object2 = SceneHelpers.CreateSceneObject(1, m_userId, "Object2", 0x40); |
95 | object2.AbsolutePosition = new Vector3(25, 50, 75); | 95 | object2.AbsolutePosition = new Vector3(25, 50, 75); |
96 | 96 | ||
97 | CoalescedSceneObjects coa = new CoalescedSceneObjects(m_userId, object1, object2); | 97 | CoalescedSceneObjects coa = new CoalescedSceneObjects(m_userId, object1, object2); |
98 | 98 | ||
99 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); | 99 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); |
@@ -107,46 +107,46 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
107 | item1.Name = item1Name; | 107 | item1.Name = item1Name; |
108 | item1.AssetID = asset1.FullID; | 108 | item1.AssetID = asset1.FullID; |
109 | item1.ID = item1Id; | 109 | item1.ID = item1Id; |
110 | InventoryFolderBase objsFolder | 110 | InventoryFolderBase objsFolder |
111 | = InventoryArchiveUtils.FindFoldersByPath(m_scene.InventoryService, m_userId, "Objects")[0]; | 111 | = InventoryArchiveUtils.FindFoldersByPath(m_scene.InventoryService, m_userId, "Objects")[0]; |
112 | item1.Folder = objsFolder.ID; | 112 | item1.Folder = objsFolder.ID; |
113 | item1.Flags |= (uint)InventoryItemFlags.ObjectHasMultipleItems; | 113 | item1.Flags |= (uint)InventoryItemFlags.ObjectHasMultipleItems; |
114 | m_scene.AddInventoryItem(item1); | 114 | m_scene.AddInventoryItem(item1); |
115 | 115 | ||
116 | SceneObjectGroup so | 116 | SceneObjectGroup so |
117 | = m_iam.RezObject( | 117 | = m_iam.RezObject( |
118 | m_tc, item1Id, new Vector3(100, 100, 100), Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false); | 118 | m_tc, item1Id, new Vector3(100, 100, 100), Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false); |
119 | 119 | ||
120 | Assert.That(so, Is.Not.Null); | 120 | Assert.That(so, Is.Not.Null); |
121 | 121 | ||
122 | Assert.That(m_scene.SceneGraph.GetTotalObjectsCount(), Is.EqualTo(2)); | 122 | Assert.That(m_scene.SceneGraph.GetTotalObjectsCount(), Is.EqualTo(2)); |
123 | 123 | ||
124 | SceneObjectPart retrievedObj1Part = m_scene.GetSceneObjectPart(object1.Name); | 124 | SceneObjectPart retrievedObj1Part = m_scene.GetSceneObjectPart(object1.Name); |
125 | Assert.That(retrievedObj1Part, Is.Null); | 125 | Assert.That(retrievedObj1Part, Is.Null); |
126 | 126 | ||
127 | retrievedObj1Part = m_scene.GetSceneObjectPart(item1.Name); | 127 | retrievedObj1Part = m_scene.GetSceneObjectPart(item1.Name); |
128 | Assert.That(retrievedObj1Part, Is.Not.Null); | 128 | Assert.That(retrievedObj1Part, Is.Not.Null); |
129 | Assert.That(retrievedObj1Part.Name, Is.EqualTo(item1.Name)); | 129 | Assert.That(retrievedObj1Part.Name, Is.EqualTo(item1.Name)); |
130 | 130 | ||
131 | // Bottom of coalescence is placed on ground, hence we end up with 100.5 rather than 85 since the bottom | 131 | // Bottom of coalescence is placed on ground, hence we end up with 100.5 rather than 85 since the bottom |
132 | // object is unit square. | 132 | // object is unit square. |
133 | Assert.That(retrievedObj1Part.AbsolutePosition, Is.EqualTo(new Vector3(95, 90, 100.5f))); | 133 | Assert.That(retrievedObj1Part.AbsolutePosition, Is.EqualTo(new Vector3(95, 90, 100.5f))); |
134 | 134 | ||
135 | SceneObjectPart retrievedObj2Part = m_scene.GetSceneObjectPart(object2.Name); | 135 | SceneObjectPart retrievedObj2Part = m_scene.GetSceneObjectPart(object2.Name); |
136 | Assert.That(retrievedObj2Part, Is.Not.Null); | 136 | Assert.That(retrievedObj2Part, Is.Not.Null); |
137 | Assert.That(retrievedObj2Part.Name, Is.EqualTo(object2.Name)); | 137 | Assert.That(retrievedObj2Part.Name, Is.EqualTo(object2.Name)); |
138 | Assert.That(retrievedObj2Part.AbsolutePosition, Is.EqualTo(new Vector3(105, 110, 130.5f))); | 138 | Assert.That(retrievedObj2Part.AbsolutePosition, Is.EqualTo(new Vector3(105, 110, 130.5f))); |
139 | */ | 139 | */ |
140 | } | 140 | } |
141 | 141 | ||
142 | [Test] | 142 | [Test] |
143 | public void TestRezObject() | 143 | public void TestRezObject() |
144 | { | 144 | { |
145 | TestHelpers.InMethod(); | 145 | TestHelpers.InMethod(); |
146 | // log4net.Config.XmlConfigurator.Configure(); | 146 | // log4net.Config.XmlConfigurator.Configure(); |
147 | 147 | ||
148 | // Create asset | 148 | // Create asset |
149 | SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, m_userId, "My Little Dog Object", 0x40); | 149 | SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, m_userId, "My Little Dog Object", 0x40); |
150 | 150 | ||
151 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); | 151 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); |
152 | AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); | 152 | AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); |
@@ -159,17 +159,17 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests | |||
159 | item1.Name = item1Name; | 159 | item1.Name = item1Name; |
160 | item1.AssetID = asset1.FullID; | 160 | item1.AssetID = asset1.FullID; |
161 | item1.ID = item1Id; | 161 | item1.ID = item1Id; |
162 | InventoryFolderBase objsFolder | 162 | InventoryFolderBase objsFolder |
163 | = InventoryArchiveUtils.FindFoldersByPath(m_scene.InventoryService, m_userId, "Objects")[0]; | 163 | = InventoryArchiveUtils.FindFoldersByPath(m_scene.InventoryService, m_userId, "Objects")[0]; |
164 | item1.Folder = objsFolder.ID; | 164 | item1.Folder = objsFolder.ID; |
165 | m_scene.AddInventoryItem(item1); | 165 | m_scene.AddInventoryItem(item1); |
166 | 166 | ||
167 | SceneObjectGroup so | 167 | SceneObjectGroup so |
168 | = m_iam.RezObject( | 168 | = m_iam.RezObject( |
169 | m_tc, item1Id, UUID.Zero, Vector3.Zero, Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false); | 169 | m_tc, item1Id, UUID.Zero, Vector3.Zero, Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false); |
170 | 170 | ||
171 | Assert.That(so, Is.Not.Null); | 171 | Assert.That(so, Is.Not.Null); |
172 | 172 | ||
173 | SceneObjectPart retrievedPart = m_scene.GetSceneObjectPart(so.UUID); | 173 | SceneObjectPart retrievedPart = m_scene.GetSceneObjectPart(so.UUID); |
174 | Assert.That(retrievedPart, Is.Not.Null); | 174 | Assert.That(retrievedPart, Is.Not.Null); |
175 | } | 175 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs index 862f0b7..df9d4f9 100644 --- a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs | |||
@@ -126,7 +126,7 @@ namespace OpenSim.Region.CoreModules.Framework.Library | |||
126 | return; | 126 | return; |
127 | 127 | ||
128 | // This will never run more than once, even if the region is restarted | 128 | // This will never run more than once, even if the region is restarted |
129 | if (!m_HasRunOnce) | 129 | if (!m_HasRunOnce) |
130 | { | 130 | { |
131 | LoadLibrariesFromArchives(); | 131 | LoadLibrariesFromArchives(); |
132 | //DumpLibrary(); | 132 | //DumpLibrary(); |
diff --git a/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs b/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs index 21e00b2..c1a9457 100644 --- a/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs +++ b/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs | |||
@@ -259,11 +259,11 @@ namespace OpenSim.Region.CoreModules.Framework.Library | |||
259 | 259 | ||
260 | /// <summary> | 260 | /// <summary> |
261 | /// Get the union of permissions of all inventory items | 261 | /// Get the union of permissions of all inventory items |
262 | /// that hold the given assetID. | 262 | /// that hold the given assetID. |
263 | /// </summary> | 263 | /// </summary> |
264 | /// <param name="userID"></param> | 264 | /// <param name="userID"></param> |
265 | /// <param name="assetID"></param> | 265 | /// <param name="assetID"></param> |
266 | /// <returns>The permissions or 0 if no such asset is found in | 266 | /// <returns>The permissions or 0 if no such asset is found in |
267 | /// the user's inventory</returns> | 267 | /// the user's inventory</returns> |
268 | public int GetAssetPermissions(UUID userID, UUID assetID) { return 0; } | 268 | public int GetAssetPermissions(UUID userID, UUID assetID) { return 0; } |
269 | } | 269 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs index 93a7cf2..fb3d31c 100644 --- a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs | |||
@@ -44,7 +44,7 @@ using Mono.Addins; | |||
44 | namespace OpenSim.Region.CoreModules.Framework.Monitoring | 44 | namespace OpenSim.Region.CoreModules.Framework.Monitoring |
45 | { | 45 | { |
46 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "MonitorModule")] | 46 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "MonitorModule")] |
47 | public class MonitorModule : INonSharedRegionModule | 47 | public class MonitorModule : INonSharedRegionModule |
48 | { | 48 | { |
49 | /// <summary> | 49 | /// <summary> |
50 | /// Is this module enabled? | 50 | /// Is this module enabled? |
@@ -78,7 +78,7 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring | |||
78 | 78 | ||
79 | if (cnfg != null) | 79 | if (cnfg != null) |
80 | Enabled = cnfg.GetBoolean("Enabled", true); | 80 | Enabled = cnfg.GetBoolean("Enabled", true); |
81 | 81 | ||
82 | if (!Enabled) | 82 | if (!Enabled) |
83 | return; | 83 | return; |
84 | 84 | ||
@@ -433,7 +433,7 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring | |||
433 | MakeStat("ScriptLines", "lines/sec", (s) => { s.Value = m_scene.StatsReporter.LastReportedSimStats[20]; }); | 433 | MakeStat("ScriptLines", "lines/sec", (s) => { s.Value = m_scene.StatsReporter.LastReportedSimStats[20]; }); |
434 | MakeStat("SimSpareMS", "ms/sec", (s) => { s.Value = m_scene.StatsReporter.LastReportedSimStats[21]; }); | 434 | MakeStat("SimSpareMS", "ms/sec", (s) => { s.Value = m_scene.StatsReporter.LastReportedSimStats[21]; }); |
435 | } | 435 | } |
436 | 436 | ||
437 | private void UnRegisterStatsManagerRegionStatistics() | 437 | private void UnRegisterStatsManagerRegionStatistics() |
438 | { | 438 | { |
439 | foreach (Stat stat in registeredStats) | 439 | foreach (Stat stat in registeredStats) |
@@ -443,6 +443,6 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring | |||
443 | } | 443 | } |
444 | registeredStats.Clear(); | 444 | registeredStats.Clear(); |
445 | } | 445 | } |
446 | 446 | ||
447 | } | 447 | } |
448 | } \ No newline at end of file | 448 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs b/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs index 3849996..c04d856 100644 --- a/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs | |||
@@ -135,7 +135,7 @@ namespace OpenSim.Region.CoreModules.Framework.Search | |||
135 | 135 | ||
136 | #endregion ISharedRegionModule | 136 | #endregion ISharedRegionModule |
137 | 137 | ||
138 | 138 | ||
139 | #region Event Handlers | 139 | #region Event Handlers |
140 | 140 | ||
141 | void EventManager_OnMakeRootAgent(ScenePresence sp) | 141 | void EventManager_OnMakeRootAgent(ScenePresence sp) |
diff --git a/OpenSim/Region/CoreModules/Framework/ServiceThrottle/ServiceThrottleModule.cs b/OpenSim/Region/CoreModules/Framework/ServiceThrottle/ServiceThrottleModule.cs index 36fb57a..924a1a3 100644 --- a/OpenSim/Region/CoreModules/Framework/ServiceThrottle/ServiceThrottleModule.cs +++ b/OpenSim/Region/CoreModules/Framework/ServiceThrottle/ServiceThrottleModule.cs | |||
@@ -49,7 +49,7 @@ namespace OpenSim.Region.CoreModules.Framework | |||
49 | 49 | ||
50 | private readonly List<Scene> m_scenes = new List<Scene>(); | 50 | private readonly List<Scene> m_scenes = new List<Scene>(); |
51 | private JobEngine m_processorJobEngine; | 51 | private JobEngine m_processorJobEngine; |
52 | 52 | ||
53 | #region ISharedRegionModule | 53 | #region ISharedRegionModule |
54 | 54 | ||
55 | public void Initialise(IConfigSource config) | 55 | public void Initialise(IConfigSource config) |
diff --git a/OpenSim/Region/CoreModules/Framework/Statistics/Logging/BinaryLoggingModule.cs b/OpenSim/Region/CoreModules/Framework/Statistics/Logging/BinaryLoggingModule.cs index f3436d1..3e6c8b5 100644 --- a/OpenSim/Region/CoreModules/Framework/Statistics/Logging/BinaryLoggingModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Statistics/Logging/BinaryLoggingModule.cs | |||
@@ -45,14 +45,14 @@ namespace OpenSim.Region.CoreModules.Framework.Statistics.Logging | |||
45 | public class BinaryLoggingModule : INonSharedRegionModule | 45 | public class BinaryLoggingModule : INonSharedRegionModule |
46 | { | 46 | { |
47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
48 | 48 | ||
49 | protected bool m_collectStats; | 49 | protected bool m_collectStats; |
50 | protected Scene m_scene = null; | 50 | protected Scene m_scene = null; |
51 | 51 | ||
52 | public string Name { get { return "Binary Statistics Logging Module"; } } | 52 | public string Name { get { return "Binary Statistics Logging Module"; } } |
53 | public Type ReplaceableInterface { get { return null; } } | 53 | public Type ReplaceableInterface { get { return null; } } |
54 | 54 | ||
55 | public void Initialise(IConfigSource source) | 55 | public void Initialise(IConfigSource source) |
56 | { | 56 | { |
57 | try | 57 | try |
58 | { | 58 | { |
@@ -81,23 +81,23 @@ namespace OpenSim.Region.CoreModules.Framework.Statistics.Logging | |||
81 | // if it doesn't work, we don't collect anything | 81 | // if it doesn't work, we don't collect anything |
82 | } | 82 | } |
83 | } | 83 | } |
84 | 84 | ||
85 | public void AddRegion(Scene scene) | 85 | public void AddRegion(Scene scene) |
86 | { | 86 | { |
87 | m_scene = scene; | 87 | m_scene = scene; |
88 | } | 88 | } |
89 | 89 | ||
90 | public void RemoveRegion(Scene scene) | 90 | public void RemoveRegion(Scene scene) |
91 | { | 91 | { |
92 | } | 92 | } |
93 | 93 | ||
94 | public void RegionLoaded(Scene scene) | 94 | public void RegionLoaded(Scene scene) |
95 | { | 95 | { |
96 | if (m_collectStats) | 96 | if (m_collectStats) |
97 | m_scene.StatsReporter.OnSendStatsResult += LogSimStats; | 97 | m_scene.StatsReporter.OnSendStatsResult += LogSimStats; |
98 | } | 98 | } |
99 | 99 | ||
100 | public void Close() | 100 | public void Close() |
101 | { | 101 | { |
102 | } | 102 | } |
103 | 103 | ||
@@ -107,12 +107,12 @@ namespace OpenSim.Region.CoreModules.Framework.Statistics.Logging | |||
107 | public string Path; | 107 | public string Path; |
108 | public System.IO.BinaryWriter Log; | 108 | public System.IO.BinaryWriter Log; |
109 | } | 109 | } |
110 | 110 | ||
111 | static StatLogger m_statLog = null; | 111 | static StatLogger m_statLog = null; |
112 | static TimeSpan m_statLogPeriod = TimeSpan.FromSeconds(300); | 112 | static TimeSpan m_statLogPeriod = TimeSpan.FromSeconds(300); |
113 | static string m_statsDir = String.Empty; | 113 | static string m_statsDir = String.Empty; |
114 | static Object m_statLockObject = new Object(); | 114 | static Object m_statLockObject = new Object(); |
115 | 115 | ||
116 | private void LogSimStats(SimStats stats) | 116 | private void LogSimStats(SimStats stats) |
117 | { | 117 | { |
118 | SimStatsPacket pack = new SimStatsPacket(); | 118 | SimStatsPacket pack = new SimStatsPacket(); |
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs index ea3bbe7..3e0a610 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/HGUserManagementModule.cs | |||
@@ -111,7 +111,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
111 | } | 111 | } |
112 | 112 | ||
113 | // This is it! Let's ask the other world | 113 | // This is it! Let's ask the other world |
114 | if (words[0].Contains(".")) | 114 | if (words[0].Contains(".")) |
115 | { | 115 | { |
116 | string[] names = words[0].Split(new char[] { '.' }); | 116 | string[] names = words[0].Split(new char[] { '.' }); |
117 | if (names.Length >= 2) | 117 | if (names.Length >= 2) |
@@ -130,7 +130,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
130 | } | 130 | } |
131 | 131 | ||
132 | UserAgentServiceConnector uasConn = new UserAgentServiceConnector(uriStr); | 132 | UserAgentServiceConnector uasConn = new UserAgentServiceConnector(uriStr); |
133 | 133 | ||
134 | UUID userID = UUID.Zero; | 134 | UUID userID = UUID.Zero; |
135 | try | 135 | try |
136 | { | 136 | { |
@@ -140,7 +140,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
140 | { | 140 | { |
141 | m_log.Debug("[USER MANAGEMENT MODULE]: GetUUID call failed ", e); | 141 | m_log.Debug("[USER MANAGEMENT MODULE]: GetUUID call failed ", e); |
142 | } | 142 | } |
143 | 143 | ||
144 | if (!userID.Equals(UUID.Zero)) | 144 | if (!userID.Equals(UUID.Zero)) |
145 | { | 145 | { |
146 | UserData ud = new UserData(); | 146 | UserData ud = new UserData(); |
@@ -163,8 +163,8 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
163 | //{ | 163 | //{ |
164 | // foreach (UserData d in m_UserCache.Values) | 164 | // foreach (UserData d in m_UserCache.Values) |
165 | // { | 165 | // { |
166 | // if (d.LastName.StartsWith("@") && | 166 | // if (d.LastName.StartsWith("@") && |
167 | // (d.FirstName.ToLower().StartsWith(query.ToLower()) || | 167 | // (d.FirstName.ToLower().StartsWith(query.ToLower()) || |
168 | // d.LastName.ToLower().StartsWith(query.ToLower()))) | 168 | // d.LastName.ToLower().StartsWith(query.ToLower()))) |
169 | // users.Add(d); | 169 | // users.Add(d); |
170 | // } | 170 | // } |
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/Tests/HGUserManagementModuleTests.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/Tests/HGUserManagementModuleTests.cs index 4e3b7e5..9d91aa3 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/Tests/HGUserManagementModuleTests.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/Tests/HGUserManagementModuleTests.cs | |||
@@ -37,7 +37,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement.Tests | |||
37 | { | 37 | { |
38 | [TestFixture] | 38 | [TestFixture] |
39 | public class HGUserManagementModuleTests : OpenSimTestCase | 39 | public class HGUserManagementModuleTests : OpenSimTestCase |
40 | { | 40 | { |
41 | /// <summary> | 41 | /// <summary> |
42 | /// Test that a new HG agent (i.e. one without a user account) has their name cached in the UMM upon creation. | 42 | /// Test that a new HG agent (i.e. one without a user account) has their name cached in the UMM upon creation. |
43 | /// </summary> | 43 | /// </summary> |
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index 2701912..51f973a 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -345,7 +345,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
345 | } | 345 | } |
346 | 346 | ||
347 | /// <summary> | 347 | /// <summary> |
348 | /// | 348 | /// |
349 | /// </summary> | 349 | /// </summary> |
350 | /// <param name="uuid"></param> | 350 | /// <param name="uuid"></param> |
351 | /// <param name="names">Caller please provide a properly instantiated array for names, string[2]</param> | 351 | /// <param name="names">Caller please provide a properly instantiated array for names, string[2]</param> |
@@ -557,7 +557,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
557 | return ret; | 557 | return ret; |
558 | 558 | ||
559 | // try grid user service | 559 | // try grid user service |
560 | 560 | ||
561 | GridUserInfo[] pinfos = m_Scenes[0].GridUserService.GetGridUserInfo(missing.ToArray()); | 561 | GridUserInfo[] pinfos = m_Scenes[0].GridUserService.GetGridUserInfo(missing.ToArray()); |
562 | if(pinfos.Length > 0) | 562 | if(pinfos.Length > 0) |
563 | { | 563 | { |
diff --git a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs index a5c7543..5d66d34 100644 --- a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs +++ b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs | |||
@@ -46,7 +46,7 @@ namespace OpenSim.Region.CoreModules.Hypergrid | |||
46 | public class HGWorldMapModule : WorldMapModule | 46 | public class HGWorldMapModule : WorldMapModule |
47 | { | 47 | { |
48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | 49 | ||
50 | // Remember the map area that each client has been exposed to in this region | 50 | // Remember the map area that each client has been exposed to in this region |
51 | private Dictionary<UUID, List<MapBlockData>> m_SeenMapBlocks = new Dictionary<UUID, List<MapBlockData>>(); | 51 | private Dictionary<UUID, List<MapBlockData>> m_SeenMapBlocks = new Dictionary<UUID, List<MapBlockData>>(); |
52 | 52 | ||
diff --git a/OpenSim/Region/CoreModules/Properties/AssemblyInfo.cs b/OpenSim/Region/CoreModules/Properties/AssemblyInfo.cs index 74dcaae..2e3ac8e 100644 --- a/OpenSim/Region/CoreModules/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/CoreModules/Properties/AssemblyInfo.cs | |||
@@ -3,7 +3,7 @@ using System.Runtime.CompilerServices; | |||
3 | using System.Runtime.InteropServices; | 3 | using System.Runtime.InteropServices; |
4 | using Mono.Addins; | 4 | using Mono.Addins; |
5 | 5 | ||
6 | // General Information about an assembly is controlled through the following | 6 | // General Information about an assembly is controlled through the following |
7 | // set of attributes. Change these attribute values to modify the information | 7 | // set of attributes. Change these attribute values to modify the information |
8 | // associated with an assembly. | 8 | // associated with an assembly. |
9 | [assembly: AssemblyTitle("OpenSim.Region.CoreModules")] | 9 | [assembly: AssemblyTitle("OpenSim.Region.CoreModules")] |
@@ -15,8 +15,8 @@ using Mono.Addins; | |||
15 | [assembly: AssemblyTrademark("")] | 15 | [assembly: AssemblyTrademark("")] |
16 | [assembly: AssemblyCulture("")] | 16 | [assembly: AssemblyCulture("")] |
17 | 17 | ||
18 | // Setting ComVisible to false makes the types in this assembly not visible | 18 | // Setting ComVisible to false makes the types in this assembly not visible |
19 | // to COM components. If you need to access a type in this assembly from | 19 | // to COM components. If you need to access a type in this assembly from |
20 | // COM, set the ComVisible attribute to true on that type. | 20 | // COM, set the ComVisible attribute to true on that type. |
21 | [assembly: ComVisible(false)] | 21 | [assembly: ComVisible(false)] |
22 | 22 | ||
@@ -26,7 +26,7 @@ using Mono.Addins; | |||
26 | // Version information for an assembly consists of the following four values: | 26 | // Version information for an assembly consists of the following four values: |
27 | // | 27 | // |
28 | // Major Version | 28 | // Major Version |
29 | // Minor Version | 29 | // Minor Version |
30 | // Build Number | 30 | // Build Number |
31 | // Revision | 31 | // Revision |
32 | // | 32 | // |
diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index 665d7f7..c369d87 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs | |||
@@ -181,12 +181,12 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
181 | string extraParams, int updateTimer, bool SetBlending, byte AlphaValue) | 181 | string extraParams, int updateTimer, bool SetBlending, byte AlphaValue) |
182 | { | 182 | { |
183 | return AddDynamicTextureURL(simID, primID, contentType, url, | 183 | return AddDynamicTextureURL(simID, primID, contentType, url, |
184 | extraParams, updateTimer, SetBlending, | 184 | extraParams, updateTimer, SetBlending, |
185 | (int)(DISP_TEMP|DISP_EXPIRE), AlphaValue, ALL_SIDES); | 185 | (int)(DISP_TEMP|DISP_EXPIRE), AlphaValue, ALL_SIDES); |
186 | } | 186 | } |
187 | 187 | ||
188 | public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, | 188 | public UUID AddDynamicTextureURL(UUID simID, UUID primID, string contentType, string url, |
189 | string extraParams, int updateTimer, bool SetBlending, | 189 | string extraParams, int updateTimer, bool SetBlending, |
190 | int disp, byte AlphaValue, int face) | 190 | int disp, byte AlphaValue, int face) |
191 | { | 191 | { |
192 | if (RenderPlugins.ContainsKey(contentType)) | 192 | if (RenderPlugins.ContainsKey(contentType)) |
@@ -227,7 +227,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
227 | public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, | 227 | public UUID AddDynamicTextureData(UUID simID, UUID primID, string contentType, string data, |
228 | string extraParams, int updateTimer, bool SetBlending, byte AlphaValue) | 228 | string extraParams, int updateTimer, bool SetBlending, byte AlphaValue) |
229 | { | 229 | { |
230 | return AddDynamicTextureData(simID, primID, contentType, data, extraParams, updateTimer, SetBlending, | 230 | return AddDynamicTextureData(simID, primID, contentType, data, extraParams, updateTimer, SetBlending, |
231 | (int) (DISP_TEMP|DISP_EXPIRE), AlphaValue, ALL_SIDES); | 231 | (int) (DISP_TEMP|DISP_EXPIRE), AlphaValue, ALL_SIDES); |
232 | } | 232 | } |
233 | 233 | ||
@@ -478,17 +478,17 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
478 | 478 | ||
479 | if (part == null || data == null || data.Length <= 1) | 479 | if (part == null || data == null || data.Length <= 1) |
480 | { | 480 | { |
481 | string msg = | 481 | string msg = |
482 | String.Format("DynamicTextureModule: Error preparing image using URL {0}", Url); | 482 | String.Format("DynamicTextureModule: Error preparing image using URL {0}", Url); |
483 | scene.SimChat(Utils.StringToBytes(msg), ChatTypeEnum.Say, | 483 | scene.SimChat(Utils.StringToBytes(msg), ChatTypeEnum.Say, |
484 | 0, part.ParentGroup.RootPart.AbsolutePosition, part.Name, part.UUID, false); | 484 | 0, part.ParentGroup.RootPart.AbsolutePosition, part.Name, part.UUID, false); |
485 | 485 | ||
486 | return UUID.Zero; | 486 | return UUID.Zero; |
487 | } | 487 | } |
488 | 488 | ||
489 | byte[] assetData = null; | 489 | byte[] assetData = null; |
490 | AssetBase oldAsset = null; | 490 | AssetBase oldAsset = null; |
491 | 491 | ||
492 | if (BlendWithOldTexture) | 492 | if (BlendWithOldTexture) |
493 | { | 493 | { |
494 | Primitive.TextureEntryFace defaultFace = part.Shape.Textures.DefaultTexture; | 494 | Primitive.TextureEntryFace defaultFace = part.Shape.Textures.DefaultTexture; |
@@ -558,7 +558,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
558 | 558 | ||
559 | Bitmap image1 = new Bitmap(image); | 559 | Bitmap image1 = new Bitmap(image); |
560 | image.Dispose(); | 560 | image.Dispose(); |
561 | 561 | ||
562 | if (!OpenJPEG.DecodeToImage(backImage, out managedImage, out image) || image == null) | 562 | if (!OpenJPEG.DecodeToImage(backImage, out managedImage, out image) || image == null) |
563 | { | 563 | { |
564 | image1.Dispose(); | 564 | image1.Dispose(); |
diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs index 3948667..09891f7 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs | |||
@@ -246,7 +246,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
246 | } | 246 | } |
247 | } | 247 | } |
248 | } | 248 | } |
249 | 249 | ||
250 | htc.RequestModule = this; | 250 | htc.RequestModule = this; |
251 | htc.LocalID = localID; | 251 | htc.LocalID = localID; |
252 | htc.ItemID = itemID; | 252 | htc.ItemID = itemID; |
@@ -283,7 +283,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
283 | } | 283 | } |
284 | 284 | ||
285 | public bool StartHttpRequest(HttpRequestClass req) | 285 | public bool StartHttpRequest(HttpRequestClass req) |
286 | { | 286 | { |
287 | if (!CheckAllowed(new Uri(req.Url))) | 287 | if (!CheckAllowed(new Uri(req.Url))) |
288 | return false; | 288 | return false; |
289 | 289 | ||
@@ -541,7 +541,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
541 | try | 541 | try |
542 | { | 542 | { |
543 | Request = (HttpWebRequest)WebRequest.Create(Url); | 543 | Request = (HttpWebRequest)WebRequest.Create(Url); |
544 | Request.AllowAutoRedirect = false; | 544 | Request.AllowAutoRedirect = false; |
545 | 545 | ||
546 | //This works around some buggy HTTP Servers like Lighttpd | 546 | //This works around some buggy HTTP Servers like Lighttpd |
547 | Request.ServicePoint.Expect100Continue = false; | 547 | Request.ServicePoint.Expect100Continue = false; |
@@ -684,9 +684,9 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
684 | resStream.Close(); | 684 | resStream.Close(); |
685 | if (response != null) | 685 | if (response != null) |
686 | response.Close(); | 686 | response.Close(); |
687 | |||
688 | 687 | ||
689 | // We need to resubmit | 688 | |
689 | // We need to resubmit | ||
690 | if ( | 690 | if ( |
691 | (Status == (int)HttpStatusCode.MovedPermanently | 691 | (Status == (int)HttpStatusCode.MovedPermanently |
692 | || Status == (int)HttpStatusCode.Found | 692 | || Status == (int)HttpStatusCode.Found |
diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/Tests/ScriptsHttpRequestsTests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/Tests/ScriptsHttpRequestsTests.cs index d22487e..7e223d7 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/Tests/ScriptsHttpRequestsTests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/Tests/ScriptsHttpRequestsTests.cs | |||
@@ -45,7 +45,7 @@ using OpenSim.Tests.Common; | |||
45 | namespace OpenSim.Region.CoreModules.Scripting.HttpRequest.Tests | 45 | namespace OpenSim.Region.CoreModules.Scripting.HttpRequest.Tests |
46 | { | 46 | { |
47 | class TestWebRequestCreate : IWebRequestCreate | 47 | class TestWebRequestCreate : IWebRequestCreate |
48 | { | 48 | { |
49 | public TestWebRequest NextRequest { get; set; } | 49 | public TestWebRequest NextRequest { get; set; } |
50 | 50 | ||
51 | public WebRequest Create(Uri uri) | 51 | public WebRequest Create(Uri uri) |
@@ -65,13 +65,13 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest.Tests | |||
65 | 65 | ||
66 | public Func<IAsyncResult, WebResponse> OnEndGetResponse { get; set; } | 66 | public Func<IAsyncResult, WebResponse> OnEndGetResponse { get; set; } |
67 | 67 | ||
68 | public TestWebRequest() : base() | 68 | public TestWebRequest() : base() |
69 | { | 69 | { |
70 | // Console.WriteLine("created"); | 70 | // Console.WriteLine("created"); |
71 | } | 71 | } |
72 | 72 | ||
73 | // public TestWebRequest(SerializationInfo serializationInfo, StreamingContext streamingContext) | 73 | // public TestWebRequest(SerializationInfo serializationInfo, StreamingContext streamingContext) |
74 | // : base(serializationInfo, streamingContext) | 74 | // : base(serializationInfo, streamingContext) |
75 | // { | 75 | // { |
76 | // Console.WriteLine("created"); | 76 | // Console.WriteLine("created"); |
77 | // } | 77 | // } |
@@ -97,7 +97,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest.Tests | |||
97 | public string Response { get; set; } | 97 | public string Response { get; set; } |
98 | 98 | ||
99 | #pragma warning disable 0618 | 99 | #pragma warning disable 0618 |
100 | public TestHttpWebResponse(SerializationInfo serializationInfo, StreamingContext streamingContext) | 100 | public TestHttpWebResponse(SerializationInfo serializationInfo, StreamingContext streamingContext) |
101 | : base(serializationInfo, streamingContext) {} | 101 | : base(serializationInfo, streamingContext) {} |
102 | #pragma warning restore 0618 | 102 | #pragma warning restore 0618 |
103 | 103 | ||
@@ -111,24 +111,24 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest.Tests | |||
111 | { | 111 | { |
112 | WaitHandle m_wh = new ManualResetEvent(true); | 112 | WaitHandle m_wh = new ManualResetEvent(true); |
113 | 113 | ||
114 | object IAsyncResult.AsyncState | 114 | object IAsyncResult.AsyncState |
115 | { | 115 | { |
116 | get { | 116 | get { |
117 | throw new System.NotImplementedException (); | 117 | throw new System.NotImplementedException (); |
118 | } | 118 | } |
119 | } | 119 | } |
120 | 120 | ||
121 | WaitHandle IAsyncResult.AsyncWaitHandle | 121 | WaitHandle IAsyncResult.AsyncWaitHandle |
122 | { | 122 | { |
123 | get { return m_wh; } | 123 | get { return m_wh; } |
124 | } | 124 | } |
125 | 125 | ||
126 | bool IAsyncResult.CompletedSynchronously | 126 | bool IAsyncResult.CompletedSynchronously |
127 | { | 127 | { |
128 | get { return false; } | 128 | get { return false; } |
129 | } | 129 | } |
130 | 130 | ||
131 | bool IAsyncResult.IsCompleted | 131 | bool IAsyncResult.IsCompleted |
132 | { | 132 | { |
133 | get { return true; } | 133 | get { return true; } |
134 | } | 134 | } |
@@ -155,7 +155,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest.Tests | |||
155 | TestHelpers.EnableLogging(); | 155 | TestHelpers.EnableLogging(); |
156 | 156 | ||
157 | if (!Util.IsPlatformMono) | 157 | if (!Util.IsPlatformMono) |
158 | Assert.Ignore("Ignoring test since can only currently run on Mono"); | 158 | Assert.Ignore("Ignoring test since can only currently run on Mono"); |
159 | 159 | ||
160 | string rawResponse = "boom"; | 160 | string rawResponse = "boom"; |
161 | 161 | ||
@@ -163,7 +163,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest.Tests | |||
163 | 163 | ||
164 | TestWebRequest twr = new TestWebRequest(); | 164 | TestWebRequest twr = new TestWebRequest(); |
165 | //twr.OnEndGetResponse += ar => new TestHttpWebResponse(null, new StreamingContext()); | 165 | //twr.OnEndGetResponse += ar => new TestHttpWebResponse(null, new StreamingContext()); |
166 | twr.OnEndGetResponse += ar => | 166 | twr.OnEndGetResponse += ar => |
167 | { | 167 | { |
168 | SerializationInfo si = new SerializationInfo(typeof(HttpWebResponse), new FormatterConverter()); | 168 | SerializationInfo si = new SerializationInfo(typeof(HttpWebResponse), new FormatterConverter()); |
169 | StreamingContext sc = new StreamingContext(); | 169 | StreamingContext sc = new StreamingContext(); |
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index f563c68..bb80a88 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs | |||
@@ -105,7 +105,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
105 | /// </summary> | 105 | /// </summary> |
106 | public int TotalUrls { get; set; } | 106 | public int TotalUrls { get; set; } |
107 | 107 | ||
108 | public Type ReplaceableInterface | 108 | public Type ReplaceableInterface |
109 | { | 109 | { |
110 | get { return null; } | 110 | get { return null; } |
111 | } | 111 | } |
@@ -221,10 +221,10 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
221 | urlData.allowXss = true; | 221 | urlData.allowXss = true; |
222 | 222 | ||
223 | m_UrlMap[url] = urlData; | 223 | m_UrlMap[url] = urlData; |
224 | 224 | ||
225 | string uri = "/lslhttp/" + urlcode.ToString() + "/"; | 225 | string uri = "/lslhttp/" + urlcode.ToString() + "/"; |
226 | 226 | ||
227 | PollServiceEventArgs args | 227 | PollServiceEventArgs args |
228 | = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, urlcode, 25000); | 228 | = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, urlcode, 25000); |
229 | args.Type = PollServiceEventArgs.EventType.LslHttp; | 229 | args.Type = PollServiceEventArgs.EventType.LslHttp; |
230 | m_HttpServer.AddPollServiceHTTPHandler(uri, args); | 230 | m_HttpServer.AddPollServiceHTTPHandler(uri, args); |
@@ -270,12 +270,12 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
270 | 270 | ||
271 | if (options != null && options["allowXss"] != null) | 271 | if (options != null && options["allowXss"] != null) |
272 | urlData.allowXss = true; | 272 | urlData.allowXss = true; |
273 | 273 | ||
274 | m_UrlMap[url] = urlData; | 274 | m_UrlMap[url] = urlData; |
275 | 275 | ||
276 | string uri = "/lslhttps/" + urlcode.ToString() + "/"; | 276 | string uri = "/lslhttps/" + urlcode.ToString() + "/"; |
277 | 277 | ||
278 | PollServiceEventArgs args | 278 | PollServiceEventArgs args |
279 | = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, urlcode, 25000); | 279 | = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, urlcode, 25000); |
280 | args.Type = PollServiceEventArgs.EventType.LslHttp; | 280 | args.Type = PollServiceEventArgs.EventType.LslHttp; |
281 | m_HttpsServer.AddPollServiceHTTPHandler(uri, args); | 281 | m_HttpsServer.AddPollServiceHTTPHandler(uri, args); |
@@ -306,7 +306,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
306 | foreach (UUID req in data.requests.Keys) | 306 | foreach (UUID req in data.requests.Keys) |
307 | m_RequestMap.Remove(req); | 307 | m_RequestMap.Remove(req); |
308 | } | 308 | } |
309 | 309 | ||
310 | // m_log.DebugFormat( | 310 | // m_log.DebugFormat( |
311 | // "[URL MODULE]: Releasing url {0} for {1} in {2}", | 311 | // "[URL MODULE]: Releasing url {0} for {1} in {2}", |
312 | // url, data.itemID, data.hostID); | 312 | // url, data.itemID, data.hostID); |
@@ -315,7 +315,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
315 | m_UrlMap.Remove(url); | 315 | m_UrlMap.Remove(url); |
316 | } | 316 | } |
317 | } | 317 | } |
318 | 318 | ||
319 | public void HttpContentType(UUID request, string type) | 319 | public void HttpContentType(UUID request, string type) |
320 | { | 320 | { |
321 | lock (m_UrlMap) | 321 | lock (m_UrlMap) |
@@ -331,7 +331,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
331 | } | 331 | } |
332 | } | 332 | } |
333 | } | 333 | } |
334 | 334 | ||
335 | public void HttpResponse(UUID request, int status, string body) | 335 | public void HttpResponse(UUID request, int status, string body) |
336 | { | 336 | { |
337 | lock (m_RequestMap) | 337 | lock (m_RequestMap) |
@@ -403,7 +403,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
403 | public void ScriptRemoved(UUID itemID) | 403 | public void ScriptRemoved(UUID itemID) |
404 | { | 404 | { |
405 | // m_log.DebugFormat("[URL MODULE]: Removing script {0}", itemID); | 405 | // m_log.DebugFormat("[URL MODULE]: Removing script {0}", itemID); |
406 | 406 | ||
407 | lock (m_UrlMap) | 407 | lock (m_UrlMap) |
408 | { | 408 | { |
409 | List<string> removeURLs = new List<string>(); | 409 | List<string> removeURLs = new List<string>(); |
@@ -495,14 +495,14 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
495 | return response; | 495 | return response; |
496 | } | 496 | } |
497 | 497 | ||
498 | 498 | ||
499 | return response; | 499 | return response; |
500 | } | 500 | } |
501 | 501 | ||
502 | private bool HasEvents(UUID requestID, UUID sessionID) | 502 | private bool HasEvents(UUID requestID, UUID sessionID) |
503 | { | 503 | { |
504 | UrlData url=null; | 504 | UrlData url=null; |
505 | 505 | ||
506 | lock (m_RequestMap) | 506 | lock (m_RequestMap) |
507 | { | 507 | { |
508 | if (!m_RequestMap.ContainsKey(requestID)) | 508 | if (!m_RequestMap.ContainsKey(requestID)) |
@@ -545,10 +545,10 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
545 | { | 545 | { |
546 | requestData = url.requests[requestID]; | 546 | requestData = url.requests[requestID]; |
547 | } | 547 | } |
548 | 548 | ||
549 | if (!requestData.requestDone) | 549 | if (!requestData.requestDone) |
550 | return NoEvents(requestID,sessionID); | 550 | return NoEvents(requestID,sessionID); |
551 | 551 | ||
552 | Hashtable response = new Hashtable(); | 552 | Hashtable response = new Hashtable(); |
553 | 553 | ||
554 | if (System.Environment.TickCount - requestData.startTime > 25000) | 554 | if (System.Environment.TickCount - requestData.startTime > 25000) |
@@ -569,7 +569,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
569 | 569 | ||
570 | if (url.allowXss) | 570 | if (url.allowXss) |
571 | response["access_control_allow_origin"] = "*"; | 571 | response["access_control_allow_origin"] = "*"; |
572 | 572 | ||
573 | //remove from map | 573 | //remove from map |
574 | lock (url.requests) | 574 | lock (url.requests) |
575 | { | 575 | { |
@@ -627,7 +627,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
627 | } | 627 | } |
628 | 628 | ||
629 | //for llGetHttpHeader support we need to store original URI here | 629 | //for llGetHttpHeader support we need to store original URI here |
630 | //to make x-path-info / x-query-string / x-script-url / x-remote-ip headers | 630 | //to make x-path-info / x-query-string / x-script-url / x-remote-ip headers |
631 | //as per http://wiki.secondlife.com/wiki/LlGetHTTPHeader | 631 | //as per http://wiki.secondlife.com/wiki/LlGetHTTPHeader |
632 | 632 | ||
633 | RequestData requestData = new RequestData(); | 633 | RequestData requestData = new RequestData(); |
@@ -689,7 +689,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
689 | else | 689 | else |
690 | { | 690 | { |
691 | queryString = queryString + val + "&"; | 691 | queryString = queryString + val + "&"; |
692 | } | 692 | } |
693 | } | 693 | } |
694 | } | 694 | } |
695 | if (queryString.Length > 1) | 695 | if (queryString.Length > 1) |
diff --git a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs index 7267515..673a453 100644 --- a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs | |||
@@ -98,7 +98,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL | |||
98 | return false; | 98 | return false; |
99 | } | 99 | } |
100 | 100 | ||
101 | public void GetDrawStringSize(string text, string fontName, int fontSize, | 101 | public void GetDrawStringSize(string text, string fontName, int fontSize, |
102 | out double xSize, out double ySize) | 102 | out double xSize, out double ySize) |
103 | { | 103 | { |
104 | xSize = 0; | 104 | xSize = 0; |
@@ -124,7 +124,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL | |||
124 | { | 124 | { |
125 | if (m_scene == null) | 125 | if (m_scene == null) |
126 | m_scene = scene; | 126 | m_scene = scene; |
127 | 127 | ||
128 | } | 128 | } |
129 | 129 | ||
130 | public void RemoveRegion(Scene scene) | 130 | public void RemoveRegion(Scene scene) |
@@ -166,15 +166,15 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL | |||
166 | 166 | ||
167 | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); | 167 | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); |
168 | request.AllowAutoRedirect = false; | 168 | request.AllowAutoRedirect = false; |
169 | 169 | ||
170 | if (!string.IsNullOrEmpty(m_proxyurl)) | 170 | if (!string.IsNullOrEmpty(m_proxyurl)) |
171 | { | 171 | { |
172 | if (!string.IsNullOrEmpty(m_proxyexcepts)) | 172 | if (!string.IsNullOrEmpty(m_proxyexcepts)) |
173 | { | 173 | { |
174 | string[] elist = m_proxyexcepts.Split(';'); | 174 | string[] elist = m_proxyexcepts.Split(';'); |
175 | request.Proxy = new WebProxy(m_proxyurl, true, elist); | 175 | request.Proxy = new WebProxy(m_proxyurl, true, elist); |
176 | } | 176 | } |
177 | else | 177 | else |
178 | { | 178 | { |
179 | request.Proxy = new WebProxy(m_proxyurl, true); | 179 | request.Proxy = new WebProxy(m_proxyurl, true); |
180 | } | 180 | } |
@@ -253,7 +253,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL | |||
253 | { | 253 | { |
254 | imageJ2000 = OpenJPEG.EncodeFromImage(resize, true); | 254 | imageJ2000 = OpenJPEG.EncodeFromImage(resize, true); |
255 | } | 255 | } |
256 | } | 256 | } |
257 | catch (Exception) | 257 | catch (Exception) |
258 | { | 258 | { |
259 | m_log.Error("[LOADIMAGEURLMODULE]: OpenJpeg Conversion Failed. Empty byte data returned!"); | 259 | m_log.Error("[LOADIMAGEURLMODULE]: OpenJpeg Conversion Failed. Empty byte data returned!"); |
diff --git a/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs b/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs index ad33f23..9c3f08e 100644 --- a/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs | |||
@@ -89,7 +89,7 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms | |||
89 | public void RegionLoaded(Scene scene) | 89 | public void RegionLoaded(Scene scene) |
90 | { | 90 | { |
91 | m_scriptModule = scene.RequestModuleInterface<IScriptModule>(); | 91 | m_scriptModule = scene.RequestModuleInterface<IScriptModule>(); |
92 | 92 | ||
93 | if (m_scriptModule != null) | 93 | if (m_scriptModule != null) |
94 | m_log.Info("[MODULE COMMANDS]: Script engine found, module active"); | 94 | m_log.Info("[MODULE COMMANDS]: Script engine found, module active"); |
95 | } | 95 | } |
@@ -237,7 +237,7 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms | |||
237 | } | 237 | } |
238 | } | 238 | } |
239 | } | 239 | } |
240 | 240 | ||
241 | public Delegate[] GetScriptInvocationList() | 241 | public Delegate[] GetScriptInvocationList() |
242 | { | 242 | { |
243 | List<Delegate> ret = new List<Delegate>(); | 243 | List<Delegate> ret = new List<Delegate>(); |
@@ -361,14 +361,14 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms | |||
361 | public object LookupModConstant(string cname) | 361 | public object LookupModConstant(string cname) |
362 | { | 362 | { |
363 | // m_log.DebugFormat("[MODULE COMMANDS] lookup constant <{0}>",cname); | 363 | // m_log.DebugFormat("[MODULE COMMANDS] lookup constant <{0}>",cname); |
364 | 364 | ||
365 | lock (m_constants) | 365 | lock (m_constants) |
366 | { | 366 | { |
367 | object value = null; | 367 | object value = null; |
368 | if (m_constants.TryGetValue(cname,out value)) | 368 | if (m_constants.TryGetValue(cname,out value)) |
369 | return value; | 369 | return value; |
370 | } | 370 | } |
371 | 371 | ||
372 | return null; | 372 | return null; |
373 | } | 373 | } |
374 | 374 | ||
diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index 2fc89fc..f12286d 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs | |||
@@ -117,7 +117,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
117 | return true; | 117 | return true; |
118 | } | 118 | } |
119 | 119 | ||
120 | public void GetDrawStringSize(string text, string fontName, int fontSize, | 120 | public void GetDrawStringSize(string text, string fontName, int fontSize, |
121 | out double xSize, out double ySize) | 121 | out double xSize, out double ySize) |
122 | { | 122 | { |
123 | lock (this) | 123 | lock (this) |
@@ -209,32 +209,32 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
209 | int alpha = 255; // 0 is transparent | 209 | int alpha = 255; // 0 is transparent |
210 | Color bgColor = Color.White; // Default background color | 210 | Color bgColor = Color.White; // Default background color |
211 | char altDataDelim = ';'; | 211 | char altDataDelim = ';'; |
212 | 212 | ||
213 | char[] paramDelimiter = { ',' }; | 213 | char[] paramDelimiter = { ',' }; |
214 | char[] nvpDelimiter = { ':' }; | 214 | char[] nvpDelimiter = { ':' }; |
215 | 215 | ||
216 | extraParams = extraParams.Trim(); | 216 | extraParams = extraParams.Trim(); |
217 | extraParams = extraParams.ToLower(); | 217 | extraParams = extraParams.ToLower(); |
218 | 218 | ||
219 | string[] nvps = extraParams.Split(paramDelimiter); | 219 | string[] nvps = extraParams.Split(paramDelimiter); |
220 | 220 | ||
221 | int temp = -1; | 221 | int temp = -1; |
222 | foreach (string pair in nvps) | 222 | foreach (string pair in nvps) |
223 | { | 223 | { |
224 | string[] nvp = pair.Split(nvpDelimiter); | 224 | string[] nvp = pair.Split(nvpDelimiter); |
225 | string name = ""; | 225 | string name = ""; |
226 | string value = ""; | 226 | string value = ""; |
227 | 227 | ||
228 | if (nvp[0] != null) | 228 | if (nvp[0] != null) |
229 | { | 229 | { |
230 | name = nvp[0].Trim(); | 230 | name = nvp[0].Trim(); |
231 | } | 231 | } |
232 | 232 | ||
233 | if (nvp.Length == 2) | 233 | if (nvp.Length == 2) |
234 | { | 234 | { |
235 | value = nvp[1].Trim(); | 235 | value = nvp[1].Trim(); |
236 | } | 236 | } |
237 | 237 | ||
238 | switch (name) | 238 | switch (name) |
239 | { | 239 | { |
240 | case "width": | 240 | case "width": |
@@ -301,7 +301,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
301 | if (Int32.TryParse(value, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out hex)) | 301 | if (Int32.TryParse(value, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out hex)) |
302 | { | 302 | { |
303 | bgColor = Color.FromArgb(hex); | 303 | bgColor = Color.FromArgb(hex); |
304 | } | 304 | } |
305 | else | 305 | else |
306 | { | 306 | { |
307 | bgColor = Color.FromName(value); | 307 | bgColor = Color.FromName(value); |
@@ -321,7 +321,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
321 | } | 321 | } |
322 | else | 322 | else |
323 | { | 323 | { |
324 | // this function used to accept an int on its own that represented both | 324 | // this function used to accept an int on its own that represented both |
325 | // width and height, this is to maintain backwards compat, could be removed | 325 | // width and height, this is to maintain backwards compat, could be removed |
326 | // but would break existing scripts | 326 | // but would break existing scripts |
327 | temp = parseIntParam(name); | 327 | temp = parseIntParam(name); |
@@ -329,10 +329,10 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
329 | { | 329 | { |
330 | if (temp > 1024) | 330 | if (temp > 1024) |
331 | temp = 1024; | 331 | temp = 1024; |
332 | 332 | ||
333 | if (temp < 128) | 333 | if (temp < 128) |
334 | temp = 128; | 334 | temp = 128; |
335 | 335 | ||
336 | width = temp; | 336 | width = temp; |
337 | height = temp; | 337 | height = temp; |
338 | } | 338 | } |
@@ -358,10 +358,10 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
358 | bitmap = new Bitmap(width, height, PixelFormat.Format32bppRgb); | 358 | bitmap = new Bitmap(width, height, PixelFormat.Format32bppRgb); |
359 | else | 359 | else |
360 | bitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb); | 360 | bitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb); |
361 | 361 | ||
362 | graph = Graphics.FromImage(bitmap); | 362 | graph = Graphics.FromImage(bitmap); |
363 | 363 | ||
364 | // this is really just to save people filling the | 364 | // this is really just to save people filling the |
365 | // background color in their scripts, only do when fully opaque | 365 | // background color in their scripts, only do when fully opaque |
366 | if (alpha >= 255) | 366 | if (alpha >= 255) |
367 | { | 367 | { |
@@ -370,10 +370,10 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
370 | graph.FillRectangle(bgFillBrush, 0, 0, width, height); | 370 | graph.FillRectangle(bgFillBrush, 0, 0, width, height); |
371 | } | 371 | } |
372 | } | 372 | } |
373 | 373 | ||
374 | for (int w = 0; w < bitmap.Width; w++) | 374 | for (int w = 0; w < bitmap.Width; w++) |
375 | { | 375 | { |
376 | if (alpha <= 255) | 376 | if (alpha <= 255) |
377 | { | 377 | { |
378 | for (int h = 0; h < bitmap.Height; h++) | 378 | for (int h = 0; h < bitmap.Height; h++) |
379 | { | 379 | { |
@@ -381,10 +381,10 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
381 | } | 381 | } |
382 | } | 382 | } |
383 | } | 383 | } |
384 | 384 | ||
385 | GDIDraw(data, graph, altDataDelim, out reuseable); | 385 | GDIDraw(data, graph, altDataDelim, out reuseable); |
386 | } | 386 | } |
387 | 387 | ||
388 | byte[] imageJ2000 = new byte[0]; | 388 | byte[] imageJ2000 = new byte[0]; |
389 | 389 | ||
390 | // This code exists for testing purposes, please do not remove. | 390 | // This code exists for testing purposes, please do not remove. |
@@ -394,7 +394,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
394 | // imageJ2000 = s_asset2Data; | 394 | // imageJ2000 = s_asset2Data; |
395 | // | 395 | // |
396 | // s_flipper = !s_flipper; | 396 | // s_flipper = !s_flipper; |
397 | 397 | ||
398 | try | 398 | try |
399 | { | 399 | { |
400 | imageJ2000 = OpenJPEG.EncodeFromImage(bitmap, true); | 400 | imageJ2000 = OpenJPEG.EncodeFromImage(bitmap, true); |
@@ -420,13 +420,13 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
420 | { | 420 | { |
421 | if (graph != null) | 421 | if (graph != null) |
422 | graph.Dispose(); | 422 | graph.Dispose(); |
423 | 423 | ||
424 | if (bitmap != null) | 424 | if (bitmap != null) |
425 | bitmap.Dispose(); | 425 | bitmap.Dispose(); |
426 | } | 426 | } |
427 | } | 427 | } |
428 | } | 428 | } |
429 | 429 | ||
430 | private int parseIntParam(string strInt) | 430 | private int parseIntParam(string strInt) |
431 | { | 431 | { |
432 | int parsed; | 432 | int parsed; |
@@ -440,7 +440,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
440 | // m_log.Debug("Problem with Draw. Please verify parameters." + e.ToString()); | 440 | // m_log.Debug("Problem with Draw. Please verify parameters." + e.ToString()); |
441 | parsed = -1; | 441 | parsed = -1; |
442 | } | 442 | } |
443 | 443 | ||
444 | return parsed; | 444 | return parsed; |
445 | } | 445 | } |
446 | 446 | ||
@@ -572,7 +572,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
572 | graph.DrawString("not an image. Please check URL.", errorFont, | 572 | graph.DrawString("not an image. Please check URL.", errorFont, |
573 | myBrush, new Point(startPoint.X, 12 + startPoint.Y)); | 573 | myBrush, new Point(startPoint.X, 12 + startPoint.Y)); |
574 | } | 574 | } |
575 | 575 | ||
576 | graph.DrawRectangle(drawPen, startPoint.X, startPoint.Y, endPoint.X, endPoint.Y); | 576 | graph.DrawRectangle(drawPen, startPoint.X, startPoint.Y, endPoint.X, endPoint.Y); |
577 | } | 577 | } |
578 | } | 578 | } |
@@ -638,11 +638,11 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
638 | { | 638 | { |
639 | nextLine = nextLine.Remove(0, 8); | 639 | nextLine = nextLine.Remove(0, 8); |
640 | nextLine = nextLine.Trim(); | 640 | nextLine = nextLine.Trim(); |
641 | 641 | ||
642 | string[] fprops = nextLine.Split(partsDelimiter); | 642 | string[] fprops = nextLine.Split(partsDelimiter); |
643 | foreach (string prop in fprops) | 643 | foreach (string prop in fprops) |
644 | { | 644 | { |
645 | 645 | ||
646 | switch (prop) | 646 | switch (prop) |
647 | { | 647 | { |
648 | case "B": | 648 | case "B": |
@@ -717,7 +717,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
717 | else if (cap[0].ToLower() != "both") | 717 | else if (cap[0].ToLower() != "both") |
718 | return; | 718 | return; |
719 | string type = cap[1].ToLower(); | 719 | string type = cap[1].ToLower(); |
720 | 720 | ||
721 | if (end) | 721 | if (end) |
722 | { | 722 | { |
723 | switch (type) | 723 | switch (type) |
@@ -760,7 +760,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
760 | nextLine = nextLine.Remove(0, 9); | 760 | nextLine = nextLine.Remove(0, 9); |
761 | nextLine = nextLine.Trim(); | 761 | nextLine = nextLine.Trim(); |
762 | int hex = 0; | 762 | int hex = 0; |
763 | 763 | ||
764 | Color newColor; | 764 | Color newColor; |
765 | if (Int32.TryParse(nextLine, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out hex)) | 765 | if (Int32.TryParse(nextLine, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out hex)) |
766 | { | 766 | { |
diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index e1c0cd7..660e03f 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs | |||
@@ -417,7 +417,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
417 | continue; | 417 | continue; |
418 | if (m_scene.GetSceneObjectPart(liHostID) == null) | 418 | if (m_scene.GetSceneObjectPart(liHostID) == null) |
419 | continue; | 419 | continue; |
420 | 420 | ||
421 | if (targets.Contains(liHostID)) | 421 | if (targets.Contains(liHostID)) |
422 | QueueMessage(new ListenerInfo(li, name, id, msg)); | 422 | QueueMessage(new ListenerInfo(li, name, id, msg)); |
423 | } | 423 | } |
diff --git a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs index 87f4277..aed1372 100644 --- a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs | |||
@@ -621,7 +621,7 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC | |||
621 | private Thread httpThread; | 621 | private Thread httpThread; |
622 | public int Idata; | 622 | public int Idata; |
623 | private UUID _itemID; | 623 | private UUID _itemID; |
624 | public UUID ItemID | 624 | public UUID ItemID |
625 | { | 625 | { |
626 | get { return _itemID; } | 626 | get { return _itemID; } |
627 | set { _itemID = value; } | 627 | set { _itemID = value; } |
@@ -633,7 +633,7 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC | |||
633 | set { _localID = value; } | 633 | set { _localID = value; } |
634 | } | 634 | } |
635 | private UUID _reqID; | 635 | private UUID _reqID; |
636 | public UUID ReqID | 636 | public UUID ReqID |
637 | { | 637 | { |
638 | get { return _reqID; } | 638 | get { return _reqID; } |
639 | set { _reqID = value; } | 639 | set { _reqID = value; } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs index 7b4668a..2c882e6 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs | |||
@@ -45,7 +45,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Asset | |||
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 | private static bool m_Enabled = false; | 47 | private static bool m_Enabled = false; |
48 | 48 | ||
49 | private IConfigSource m_Config; | 49 | private IConfigSource m_Config; |
50 | bool m_Registered = false; | 50 | bool m_Registered = false; |
51 | 51 | ||
@@ -74,7 +74,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Asset | |||
74 | { | 74 | { |
75 | } | 75 | } |
76 | 76 | ||
77 | public Type ReplaceableInterface | 77 | public Type ReplaceableInterface |
78 | { | 78 | { |
79 | get { return null; } | 79 | get { return null; } |
80 | } | 80 | } |
@@ -95,7 +95,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Asset | |||
95 | 95 | ||
96 | m_log.Info("[HGAssetService]: Starting..."); | 96 | m_log.Info("[HGAssetService]: Starting..."); |
97 | 97 | ||
98 | 98 | ||
99 | Object[] args = new Object[] { m_Config, MainServer.Instance, "HGAssetService" }; | 99 | Object[] args = new Object[] { m_Config, MainServer.Instance, "HGAssetService" }; |
100 | 100 | ||
101 | ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:AssetServiceConnector", args); | 101 | ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:AssetServiceConnector", args); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Authentication/AuthenticationServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Authentication/AuthenticationServiceInConnectorModule.cs index 2cdffe6..a8c4e3c 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Authentication/AuthenticationServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Authentication/AuthenticationServiceInConnectorModule.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Authentication | |||
47 | { | 47 | { |
48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | private static bool m_Enabled = false; | 49 | private static bool m_Enabled = false; |
50 | 50 | ||
51 | private IConfigSource m_Config; | 51 | private IConfigSource m_Config; |
52 | bool m_Registered = false; | 52 | bool m_Registered = false; |
53 | 53 | ||
@@ -77,7 +77,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Authentication | |||
77 | { | 77 | { |
78 | } | 78 | } |
79 | 79 | ||
80 | public Type ReplaceableInterface | 80 | public Type ReplaceableInterface |
81 | { | 81 | { |
82 | get { return null; } | 82 | get { return null; } |
83 | } | 83 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/GridInfoServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/GridInfoServiceInConnectorModule.cs index 22857d0..834cbb7 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/GridInfoServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/GridInfoServiceInConnectorModule.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid | |||
47 | { | 47 | { |
48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | private static bool m_Enabled = false; | 49 | private static bool m_Enabled = false; |
50 | 50 | ||
51 | private IConfigSource m_Config; | 51 | private IConfigSource m_Config; |
52 | bool m_Registered = false; | 52 | bool m_Registered = false; |
53 | 53 | ||
@@ -77,7 +77,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid | |||
77 | { | 77 | { |
78 | } | 78 | } |
79 | 79 | ||
80 | public Type ReplaceableInterface | 80 | public Type ReplaceableInterface |
81 | { | 81 | { |
82 | get { return null; } | 82 | get { return null; } |
83 | } | 83 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Hypergrid/HypergridServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Hypergrid/HypergridServiceInConnectorModule.cs index f749295..4f87595 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Hypergrid/HypergridServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Hypergrid/HypergridServiceInConnectorModule.cs | |||
@@ -48,7 +48,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Hypergrid | |||
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 | private static bool m_Enabled = false; | 50 | private static bool m_Enabled = false; |
51 | 51 | ||
52 | private IConfigSource m_Config; | 52 | private IConfigSource m_Config; |
53 | private bool m_Registered = false; | 53 | private bool m_Registered = false; |
54 | private string m_LocalServiceDll = String.Empty; | 54 | private string m_LocalServiceDll = String.Empty; |
@@ -88,7 +88,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Hypergrid | |||
88 | { | 88 | { |
89 | } | 89 | } |
90 | 90 | ||
91 | public Type ReplaceableInterface | 91 | public Type ReplaceableInterface |
92 | { | 92 | { |
93 | get { return null; } | 93 | get { return null; } |
94 | } | 94 | } |
@@ -130,7 +130,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Hypergrid | |||
130 | m_HypergridHandler = new GatekeeperServiceInConnector(m_Config, MainServer.Instance, simService); | 130 | m_HypergridHandler = new GatekeeperServiceInConnector(m_Config, MainServer.Instance, simService); |
131 | 131 | ||
132 | m_UASHandler = new UserAgentServerConnector(m_Config, MainServer.Instance, friendsConn); | 132 | m_UASHandler = new UserAgentServerConnector(m_Config, MainServer.Instance, friendsConn); |
133 | 133 | ||
134 | new HeloServiceInConnector(m_Config, MainServer.Instance, "HeloService"); | 134 | new HeloServiceInConnector(m_Config, MainServer.Instance, "HeloService"); |
135 | 135 | ||
136 | new HGFriendsServerConnector(m_Config, MainServer.Instance, "HGFriendsService", friendsConn); | 136 | new HGFriendsServerConnector(m_Config, MainServer.Instance, "HGFriendsService", friendsConn); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs index 0a4e736..61e37a9 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs | |||
@@ -45,7 +45,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Inventory | |||
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 | private static bool m_Enabled = false; | 47 | private static bool m_Enabled = false; |
48 | 48 | ||
49 | private IConfigSource m_Config; | 49 | private IConfigSource m_Config; |
50 | bool m_Registered = false; | 50 | bool m_Registered = false; |
51 | 51 | ||
@@ -73,7 +73,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Inventory | |||
73 | { | 73 | { |
74 | } | 74 | } |
75 | 75 | ||
76 | public Type ReplaceableInterface | 76 | public Type ReplaceableInterface |
77 | { | 77 | { |
78 | get { return null; } | 78 | get { return null; } |
79 | } | 79 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs index 1273f0d..21483c5 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs | |||
@@ -84,7 +84,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land | |||
84 | { | 84 | { |
85 | } | 85 | } |
86 | 86 | ||
87 | public Type ReplaceableInterface | 87 | public Type ReplaceableInterface |
88 | { | 88 | { |
89 | get { return null; } | 89 | get { return null; } |
90 | } | 90 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Login/LLLoginServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Login/LLLoginServiceInConnectorModule.cs index 425febd..065dd94 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Login/LLLoginServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Login/LLLoginServiceInConnectorModule.cs | |||
@@ -84,7 +84,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Login | |||
84 | { | 84 | { |
85 | } | 85 | } |
86 | 86 | ||
87 | public Type ReplaceableInterface | 87 | public Type ReplaceableInterface |
88 | { | 88 | { |
89 | get { return null; } | 89 | get { return null; } |
90 | } | 90 | } |
@@ -113,7 +113,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Login | |||
113 | { | 113 | { |
114 | if (!m_Enabled) | 114 | if (!m_Enabled) |
115 | return; | 115 | return; |
116 | 116 | ||
117 | if (!m_Registered) | 117 | if (!m_Registered) |
118 | { | 118 | { |
119 | m_Registered = true; | 119 | m_Registered = true; |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/MapImage/MapImageServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/MapImage/MapImageServiceInConnectorModule.cs index c14bce7..a75a156 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/MapImage/MapImageServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/MapImage/MapImageServiceInConnectorModule.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.MapImage | |||
47 | { | 47 | { |
48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | private static bool m_Enabled = false; | 49 | private static bool m_Enabled = false; |
50 | 50 | ||
51 | private IConfigSource m_Config; | 51 | private IConfigSource m_Config; |
52 | 52 | ||
53 | #region Region Module interface | 53 | #region Region Module interface |
@@ -75,7 +75,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.MapImage | |||
75 | { | 75 | { |
76 | } | 76 | } |
77 | 77 | ||
78 | public Type ReplaceableInterface | 78 | public Type ReplaceableInterface |
79 | { | 79 | { |
80 | get { return null; } | 80 | get { return null; } |
81 | } | 81 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs index 6bf47cb..09c545c 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs | |||
@@ -83,7 +83,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Neighbour | |||
83 | { | 83 | { |
84 | } | 84 | } |
85 | 85 | ||
86 | public Type ReplaceableInterface | 86 | public Type ReplaceableInterface |
87 | { | 87 | { |
88 | get { return null; } | 88 | get { return null; } |
89 | } | 89 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs index 57d1132..7ba39d4 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs | |||
@@ -77,7 +77,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Simulation | |||
77 | { | 77 | { |
78 | } | 78 | } |
79 | 79 | ||
80 | public Type ReplaceableInterface | 80 | public Type ReplaceableInterface |
81 | { | 81 | { |
82 | get { return null; } | 82 | get { return null; } |
83 | } | 83 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs index 4701ee6..9e75ee2 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs | |||
@@ -77,8 +77,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Profile | |||
77 | { | 77 | { |
78 | get; private set; | 78 | get; private set; |
79 | } | 79 | } |
80 | 80 | ||
81 | public Type ReplaceableInterface | 81 | public Type ReplaceableInterface |
82 | { | 82 | { |
83 | get { return null; } | 83 | get { return null; } |
84 | } | 84 | } |
@@ -87,7 +87,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Profile | |||
87 | { | 87 | { |
88 | m_log.Debug("[LOCAL USERPROFILES SERVICE CONNECTOR]: LocalUserProfileServicesConnector no params"); | 88 | m_log.Debug("[LOCAL USERPROFILES SERVICE CONNECTOR]: LocalUserProfileServicesConnector no params"); |
89 | } | 89 | } |
90 | 90 | ||
91 | public LocalUserProfilesServicesConnector(IConfigSource source) | 91 | public LocalUserProfilesServicesConnector(IConfigSource source) |
92 | { | 92 | { |
93 | m_log.Debug("[LOCAL USERPROFILES SERVICE CONNECTOR]: LocalUserProfileServicesConnector instantiated directly."); | 93 | m_log.Debug("[LOCAL USERPROFILES SERVICE CONNECTOR]: LocalUserProfileServicesConnector instantiated directly."); |
@@ -97,7 +97,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Profile | |||
97 | public void InitialiseService(IConfigSource source) | 97 | public void InitialiseService(IConfigSource source) |
98 | { | 98 | { |
99 | ConfigName = "UserProfilesService"; | 99 | ConfigName = "UserProfilesService"; |
100 | 100 | ||
101 | // Instantiate the request handler | 101 | // Instantiate the request handler |
102 | IHttpServer Server = MainServer.Instance; | 102 | IHttpServer Server = MainServer.Instance; |
103 | 103 | ||
@@ -107,35 +107,35 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Profile | |||
107 | m_log.Error("[LOCAL USERPROFILES SERVICE CONNECTOR]: UserProfilesService missing from OpenSim.ini"); | 107 | m_log.Error("[LOCAL USERPROFILES SERVICE CONNECTOR]: UserProfilesService missing from OpenSim.ini"); |
108 | return; | 108 | return; |
109 | } | 109 | } |
110 | 110 | ||
111 | if(!config.GetBoolean("Enabled",false)) | 111 | if(!config.GetBoolean("Enabled",false)) |
112 | { | 112 | { |
113 | Enabled = false; | 113 | Enabled = false; |
114 | return; | 114 | return; |
115 | } | 115 | } |
116 | 116 | ||
117 | Enabled = true; | 117 | Enabled = true; |
118 | 118 | ||
119 | string serviceDll = config.GetString("LocalServiceModule", | 119 | string serviceDll = config.GetString("LocalServiceModule", |
120 | String.Empty); | 120 | String.Empty); |
121 | 121 | ||
122 | if (serviceDll == String.Empty) | 122 | if (serviceDll == String.Empty) |
123 | { | 123 | { |
124 | m_log.Error("[LOCAL USERPROFILES SERVICE CONNECTOR]: No LocalServiceModule named in section UserProfilesService"); | 124 | m_log.Error("[LOCAL USERPROFILES SERVICE CONNECTOR]: No LocalServiceModule named in section UserProfilesService"); |
125 | return; | 125 | return; |
126 | } | 126 | } |
127 | 127 | ||
128 | Object[] args = new Object[] { source, ConfigName }; | 128 | Object[] args = new Object[] { source, ConfigName }; |
129 | ServiceModule = | 129 | ServiceModule = |
130 | ServerUtils.LoadPlugin<IUserProfilesService>(serviceDll, | 130 | ServerUtils.LoadPlugin<IUserProfilesService>(serviceDll, |
131 | args); | 131 | args); |
132 | 132 | ||
133 | if (ServiceModule == null) | 133 | if (ServiceModule == null) |
134 | { | 134 | { |
135 | m_log.Error("[LOCAL USERPROFILES SERVICE CONNECTOR]: Can't load user profiles service"); | 135 | m_log.Error("[LOCAL USERPROFILES SERVICE CONNECTOR]: Can't load user profiles service"); |
136 | return; | 136 | return; |
137 | } | 137 | } |
138 | 138 | ||
139 | Enabled = true; | 139 | Enabled = true; |
140 | 140 | ||
141 | JsonRpcProfileHandlers handler = new JsonRpcProfileHandlers(ServiceModule); | 141 | JsonRpcProfileHandlers handler = new JsonRpcProfileHandlers(ServiceModule); |
@@ -196,7 +196,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Profile | |||
196 | { | 196 | { |
197 | if (!Enabled) | 197 | if (!Enabled) |
198 | return; | 198 | return; |
199 | 199 | ||
200 | lock (regions) | 200 | lock (regions) |
201 | { | 201 | { |
202 | if (regions.ContainsKey(scene.RegionInfo.RegionID)) | 202 | if (regions.ContainsKey(scene.RegionInfo.RegionID)) |
@@ -209,7 +209,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Profile | |||
209 | void IRegionModuleBase.RemoveRegion(Scene scene) | 209 | void IRegionModuleBase.RemoveRegion(Scene scene) |
210 | { | 210 | { |
211 | if (!Enabled) | 211 | if (!Enabled) |
212 | return; | 212 | return; |
213 | 213 | ||
214 | lock (regions) | 214 | lock (regions) |
215 | { | 215 | { |
@@ -221,7 +221,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Profile | |||
221 | void IRegionModuleBase.RegionLoaded(Scene scene) | 221 | void IRegionModuleBase.RegionLoaded(Scene scene) |
222 | { | 222 | { |
223 | if (!Enabled) | 223 | if (!Enabled) |
224 | return; | 224 | return; |
225 | } | 225 | } |
226 | #endregion | 226 | #endregion |
227 | } | 227 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/AgentPreferences/LocalAgentPreferencesServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/AgentPreferences/LocalAgentPreferencesServiceConnector.cs index 41ae53f..5cd68d9 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/AgentPreferences/LocalAgentPreferencesServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/AgentPreferences/LocalAgentPreferencesServiceConnector.cs | |||
@@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.AgentPreferences | |||
50 | 50 | ||
51 | #region ISharedRegionModule | 51 | #region ISharedRegionModule |
52 | 52 | ||
53 | public Type ReplaceableInterface | 53 | public Type ReplaceableInterface |
54 | { | 54 | { |
55 | get { return null; } | 55 | get { return null; } |
56 | } | 56 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/AgentPreferences/RemoteAgentPreferencesServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/AgentPreferences/RemoteAgentPreferencesServiceConnector.cs index a827c4c..d60236a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/AgentPreferences/RemoteAgentPreferencesServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/AgentPreferences/RemoteAgentPreferencesServiceConnector.cs | |||
@@ -44,14 +44,14 @@ using Nini.Config; | |||
44 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.AgentPreferences | 44 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.AgentPreferences |
45 | { | 45 | { |
46 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemoteAgentPreferencesServicesConnector")] | 46 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemoteAgentPreferencesServicesConnector")] |
47 | public class RemoteAgentPreferencesServicesConnector : AgentPreferencesServicesConnector, | 47 | public class RemoteAgentPreferencesServicesConnector : AgentPreferencesServicesConnector, |
48 | ISharedRegionModule, IAgentPreferencesService | 48 | ISharedRegionModule, IAgentPreferencesService |
49 | { | 49 | { |
50 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 50 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
51 | 51 | ||
52 | private bool m_Enabled = false; | 52 | private bool m_Enabled = false; |
53 | 53 | ||
54 | public Type ReplaceableInterface | 54 | public Type ReplaceableInterface |
55 | { | 55 | { |
56 | get { return null; } | 56 | get { return null; } |
57 | } | 57 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs index 31d1129..f5aa971 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs | |||
@@ -59,7 +59,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
59 | 59 | ||
60 | private AssetPermissions m_AssetPerms; | 60 | private AssetPermissions m_AssetPerms; |
61 | 61 | ||
62 | public Type ReplaceableInterface | 62 | public Type ReplaceableInterface |
63 | { | 63 | { |
64 | get { return null; } | 64 | get { return null; } |
65 | } | 65 | } |
@@ -159,7 +159,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
159 | { | 159 | { |
160 | if (!m_Enabled) | 160 | if (!m_Enabled) |
161 | return; | 161 | return; |
162 | 162 | ||
163 | m_aScene = scene; | 163 | m_aScene = scene; |
164 | 164 | ||
165 | m_aScene.RegisterModuleInterface<IAssetService>(this); | 165 | m_aScene.RegisterModuleInterface<IAssetService>(this); |
@@ -180,7 +180,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
180 | 180 | ||
181 | if (!(m_Cache is ISharedRegionModule)) | 181 | if (!(m_Cache is ISharedRegionModule)) |
182 | m_Cache = null; | 182 | m_Cache = null; |
183 | 183 | ||
184 | } | 184 | } |
185 | 185 | ||
186 | m_log.InfoFormat("[HG ASSET CONNECTOR]: Enabled hypergrid asset broker for region {0}", scene.RegionInfo.RegionName); | 186 | m_log.InfoFormat("[HG ASSET CONNECTOR]: Enabled hypergrid asset broker for region {0}", scene.RegionInfo.RegionName); |
@@ -206,7 +206,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
206 | { | 206 | { |
207 | //m_log.DebugFormat("[HG ASSET CONNECTOR]: Get {0}", id); | 207 | //m_log.DebugFormat("[HG ASSET CONNECTOR]: Get {0}", id); |
208 | AssetBase asset = null; | 208 | AssetBase asset = null; |
209 | 209 | ||
210 | if (m_Cache != null) | 210 | if (m_Cache != null) |
211 | { | 211 | { |
212 | asset = m_Cache.Get(id); | 212 | asset = m_Cache.Get(id); |
@@ -247,7 +247,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
247 | public AssetMetadata GetMetadata(string id) | 247 | public AssetMetadata GetMetadata(string id) |
248 | { | 248 | { |
249 | AssetBase asset = null; | 249 | AssetBase asset = null; |
250 | 250 | ||
251 | if (m_Cache != null) | 251 | if (m_Cache != null) |
252 | { | 252 | { |
253 | if (m_Cache != null) | 253 | if (m_Cache != null) |
@@ -270,7 +270,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
270 | public byte[] GetData(string id) | 270 | public byte[] GetData(string id) |
271 | { | 271 | { |
272 | AssetBase asset = null; | 272 | AssetBase asset = null; |
273 | 273 | ||
274 | if (m_Cache != null) | 274 | if (m_Cache != null) |
275 | { | 275 | { |
276 | if (m_Cache != null) | 276 | if (m_Cache != null) |
@@ -290,7 +290,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
290 | public bool Get(string id, Object sender, AssetRetrieved handler) | 290 | public bool Get(string id, Object sender, AssetRetrieved handler) |
291 | { | 291 | { |
292 | AssetBase asset = null; | 292 | AssetBase asset = null; |
293 | 293 | ||
294 | if (m_Cache != null) | 294 | if (m_Cache != null) |
295 | asset = m_Cache.Get(id); | 295 | asset = m_Cache.Get(id); |
296 | 296 | ||
@@ -348,7 +348,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
348 | 348 | ||
349 | bool isHG = IsHG(asset.ID); | 349 | bool isHG = IsHG(asset.ID); |
350 | if ((m_Cache != null) && !isHG) | 350 | if ((m_Cache != null) && !isHG) |
351 | // Don't store it in the cache if the asset is to | 351 | // Don't store it in the cache if the asset is to |
352 | // be sent to the other grid, because this is already | 352 | // be sent to the other grid, because this is already |
353 | // a copy of the local asset. | 353 | // a copy of the local asset. |
354 | m_Cache.Cache(asset); | 354 | m_Cache.Cache(asset); |
@@ -366,7 +366,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
366 | 366 | ||
367 | if (String.IsNullOrEmpty(id)) | 367 | if (String.IsNullOrEmpty(id)) |
368 | return string.Empty; | 368 | return string.Empty; |
369 | 369 | ||
370 | if(asset.ID != id) | 370 | if(asset.ID != id) |
371 | { | 371 | { |
372 | asset.ID = id; | 372 | asset.ID = id; |
@@ -380,7 +380,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
380 | public bool UpdateContent(string id, byte[] data) | 380 | public bool UpdateContent(string id, byte[] data) |
381 | { | 381 | { |
382 | AssetBase asset = null; | 382 | AssetBase asset = null; |
383 | 383 | ||
384 | if (m_Cache != null) | 384 | if (m_Cache != null) |
385 | asset = m_Cache.Get(id); | 385 | asset = m_Cache.Get(id); |
386 | 386 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs index d5d6667..7190aa0 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs | |||
@@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
50 | 50 | ||
51 | private bool m_Enabled = false; | 51 | private bool m_Enabled = false; |
52 | 52 | ||
53 | public Type ReplaceableInterface | 53 | public Type ReplaceableInterface |
54 | { | 54 | { |
55 | get { return null; } | 55 | get { return null; } |
56 | } | 56 | } |
@@ -155,7 +155,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
155 | public AssetBase Get(string id) | 155 | public AssetBase Get(string id) |
156 | { | 156 | { |
157 | // m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Synchronously requesting asset {0}", id); | 157 | // m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Synchronously requesting asset {0}", id); |
158 | 158 | ||
159 | AssetBase asset = null; | 159 | AssetBase asset = null; |
160 | if (m_Cache != null) | 160 | if (m_Cache != null) |
161 | asset = m_Cache.Get(id); | 161 | asset = m_Cache.Get(id); |
@@ -169,7 +169,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
169 | // if (null == asset) | 169 | // if (null == asset) |
170 | // m_log.WarnFormat("[LOCAL ASSET SERVICES CONNECTOR]: Could not synchronously find asset with id {0}", id); | 170 | // m_log.WarnFormat("[LOCAL ASSET SERVICES CONNECTOR]: Could not synchronously find asset with id {0}", id); |
171 | } | 171 | } |
172 | 172 | ||
173 | return asset; | 173 | return asset; |
174 | } | 174 | } |
175 | 175 | ||
@@ -193,7 +193,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
193 | return asset.Metadata; | 193 | return asset.Metadata; |
194 | 194 | ||
195 | asset = m_AssetService.Get(id); | 195 | asset = m_AssetService.Get(id); |
196 | if (asset != null) | 196 | if (asset != null) |
197 | { | 197 | { |
198 | if (m_Cache != null) | 198 | if (m_Cache != null) |
199 | m_Cache.Cache(asset); | 199 | m_Cache.Cache(asset); |
@@ -229,7 +229,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
229 | public bool Get(string id, Object sender, AssetRetrieved handler) | 229 | public bool Get(string id, Object sender, AssetRetrieved handler) |
230 | { | 230 | { |
231 | // m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Asynchronously requesting asset {0}", id); | 231 | // m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Asynchronously requesting asset {0}", id); |
232 | 232 | ||
233 | if (m_Cache != null) | 233 | if (m_Cache != null) |
234 | { | 234 | { |
235 | AssetBase asset = m_Cache.Get(id); | 235 | AssetBase asset = m_Cache.Get(id); |
@@ -264,7 +264,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
264 | { | 264 | { |
265 | if (m_Cache != null) | 265 | if (m_Cache != null) |
266 | m_Cache.Cache(asset); | 266 | m_Cache.Cache(asset); |
267 | 267 | ||
268 | if (asset.Local) | 268 | if (asset.Local) |
269 | { | 269 | { |
270 | // m_log.DebugFormat( | 270 | // m_log.DebugFormat( |
@@ -278,7 +278,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
278 | // m_log.DebugFormat( | 278 | // m_log.DebugFormat( |
279 | // "[LOCAL ASSET SERVICE CONNECTOR]: Passing {0} {1} on to asset service for storage, status Temporary = {2}, Local = {3}", | 279 | // "[LOCAL ASSET SERVICE CONNECTOR]: Passing {0} {1} on to asset service for storage, status Temporary = {2}, Local = {3}", |
280 | // asset.Name, asset.ID, asset.Temporary, asset.Local); | 280 | // asset.Name, asset.ID, asset.Temporary, asset.Local); |
281 | 281 | ||
282 | return m_AssetService.Store(asset); | 282 | return m_AssetService.Store(asset); |
283 | } | 283 | } |
284 | } | 284 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/RemoteAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/RemoteAssetServiceConnector.cs index ff04f9d..1225ab5 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/RemoteAssetServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/RemoteAssetServiceConnector.cs | |||
@@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
50 | private bool m_Enabled = false; | 50 | private bool m_Enabled = false; |
51 | private IAssetCache m_Cache; | 51 | private IAssetCache m_Cache; |
52 | 52 | ||
53 | public Type ReplaceableInterface | 53 | public Type ReplaceableInterface |
54 | { | 54 | { |
55 | get { return null; } | 55 | get { return null; } |
56 | } | 56 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/LocalAuthenticationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/LocalAuthenticationServiceConnector.cs index f027810..8017245 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/LocalAuthenticationServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/LocalAuthenticationServiceConnector.cs | |||
@@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authentication | |||
53 | 53 | ||
54 | #region ISharedRegionModule | 54 | #region ISharedRegionModule |
55 | 55 | ||
56 | public Type ReplaceableInterface | 56 | public Type ReplaceableInterface |
57 | { | 57 | { |
58 | get { return null; } | 58 | get { return null; } |
59 | } | 59 | } |
@@ -143,13 +143,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authentication | |||
143 | { | 143 | { |
144 | // Not implemented at the regions | 144 | // Not implemented at the regions |
145 | realID = UUID.Zero; | 145 | realID = UUID.Zero; |
146 | return string.Empty; | 146 | return string.Empty; |
147 | } | 147 | } |
148 | 148 | ||
149 | public string Authenticate(UUID principalID, string password, int lifetime) | 149 | public string Authenticate(UUID principalID, string password, int lifetime) |
150 | { | 150 | { |
151 | // Not implemented at the regions | 151 | // Not implemented at the regions |
152 | return string.Empty; | 152 | return string.Empty; |
153 | } | 153 | } |
154 | 154 | ||
155 | public bool Verify(UUID principalID, string token, int lifetime) | 155 | public bool Verify(UUID principalID, string token, int lifetime) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/RemoteAuthenticationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/RemoteAuthenticationServiceConnector.cs index 7cb8b22..fd1d802 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/RemoteAuthenticationServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/RemoteAuthenticationServiceConnector.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authentication | |||
47 | 47 | ||
48 | private bool m_Enabled = false; | 48 | private bool m_Enabled = false; |
49 | 49 | ||
50 | public Type ReplaceableInterface | 50 | public Type ReplaceableInterface |
51 | { | 51 | { |
52 | get { return null; } | 52 | get { return null; } |
53 | } | 53 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs index 1acb695..0be0676 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs | |||
@@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization | |||
53 | 53 | ||
54 | private bool m_Enabled = false; | 54 | private bool m_Enabled = false; |
55 | 55 | ||
56 | public Type ReplaceableInterface | 56 | public Type ReplaceableInterface |
57 | { | 57 | { |
58 | get { return null; } | 58 | get { return null; } |
59 | } | 59 | } |
@@ -66,7 +66,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization | |||
66 | public void Initialise(IConfigSource source) | 66 | public void Initialise(IConfigSource source) |
67 | { | 67 | { |
68 | m_log.Info("[AUTHORIZATION CONNECTOR]: Initialise"); | 68 | m_log.Info("[AUTHORIZATION CONNECTOR]: Initialise"); |
69 | 69 | ||
70 | IConfig moduleConfig = source.Configs["Modules"]; | 70 | IConfig moduleConfig = source.Configs["Modules"]; |
71 | if (moduleConfig != null) | 71 | if (moduleConfig != null) |
72 | { | 72 | { |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs index b8d409d..f312b0d 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs | |||
@@ -51,7 +51,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization | |||
51 | private bool m_Enabled = false; | 51 | private bool m_Enabled = false; |
52 | private List<Scene> m_scenes = new List<Scene>(); | 52 | private List<Scene> m_scenes = new List<Scene>(); |
53 | 53 | ||
54 | public Type ReplaceableInterface | 54 | public Type ReplaceableInterface |
55 | { | 55 | { |
56 | get { return null; } | 56 | get { return null; } |
57 | } | 57 | } |
@@ -103,7 +103,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization | |||
103 | m_scenes.Add(scene); | 103 | m_scenes.Add(scene); |
104 | scene.RegisterModuleInterface<IAuthorizationService>(this); | 104 | scene.RegisterModuleInterface<IAuthorizationService>(this); |
105 | } | 105 | } |
106 | 106 | ||
107 | } | 107 | } |
108 | 108 | ||
109 | public void RemoveRegion(Scene scene) | 109 | public void RemoveRegion(Scene scene) |
@@ -118,16 +118,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization | |||
118 | m_log.InfoFormat("[REMOTE AUTHORIZATION CONNECTOR]: Enabled remote authorization for region {0}", scene.RegionInfo.RegionName); | 118 | m_log.InfoFormat("[REMOTE AUTHORIZATION CONNECTOR]: Enabled remote authorization for region {0}", scene.RegionInfo.RegionName); |
119 | 119 | ||
120 | } | 120 | } |
121 | 121 | ||
122 | public bool IsAuthorizedForRegion( | 122 | public bool IsAuthorizedForRegion( |
123 | string userID, string firstName, string lastName, string regionID, out string message) | 123 | string userID, string firstName, string lastName, string regionID, out string message) |
124 | { | 124 | { |
125 | m_log.InfoFormat( | 125 | m_log.InfoFormat( |
126 | "[REMOTE AUTHORIZATION CONNECTOR]: IsAuthorizedForRegion checking {0} for region {1}", userID, regionID); | 126 | "[REMOTE AUTHORIZATION CONNECTOR]: IsAuthorizedForRegion checking {0} for region {1}", userID, regionID); |
127 | 127 | ||
128 | bool isAuthorized = true; | 128 | bool isAuthorized = true; |
129 | message = String.Empty; | 129 | message = String.Empty; |
130 | 130 | ||
131 | // get the scene this call is being made for | 131 | // get the scene this call is being made for |
132 | Scene scene = null; | 132 | Scene scene = null; |
133 | lock (m_scenes) | 133 | lock (m_scenes) |
@@ -140,11 +140,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization | |||
140 | } | 140 | } |
141 | } | 141 | } |
142 | } | 142 | } |
143 | 143 | ||
144 | if (scene != null) | 144 | if (scene != null) |
145 | { | 145 | { |
146 | string mail = String.Empty; | 146 | string mail = String.Empty; |
147 | 147 | ||
148 | UserAccount account = scene.UserAccountService.GetUserAccount(UUID.Zero, new UUID(userID)); | 148 | UserAccount account = scene.UserAccountService.GetUserAccount(UUID.Zero, new UUID(userID)); |
149 | 149 | ||
150 | //if account not found, we assume its a foreign visitor from HG, else use account data... | 150 | //if account not found, we assume its a foreign visitor from HG, else use account data... |
@@ -165,7 +165,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization | |||
165 | "[REMOTE AUTHORIZATION CONNECTOR] IsAuthorizedForRegion, can't find scene to match region id of {0}", | 165 | "[REMOTE AUTHORIZATION CONNECTOR] IsAuthorizedForRegion, can't find scene to match region id of {0}", |
166 | regionID); | 166 | regionID); |
167 | } | 167 | } |
168 | 168 | ||
169 | return isAuthorized; | 169 | return isAuthorized; |
170 | } | 170 | } |
171 | } | 171 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/LocalAvatarServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/LocalAvatarServiceConnector.cs index c3ef588..42f6c3f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/LocalAvatarServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/LocalAvatarServiceConnector.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Avatar | |||
54 | 54 | ||
55 | #region ISharedRegionModule | 55 | #region ISharedRegionModule |
56 | 56 | ||
57 | public Type ReplaceableInterface | 57 | public Type ReplaceableInterface |
58 | { | 58 | { |
59 | get { return null; } | 59 | get { return null; } |
60 | } | 60 | } |
@@ -144,12 +144,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Avatar | |||
144 | { | 144 | { |
145 | return m_AvatarService.GetAppearance(userID); | 145 | return m_AvatarService.GetAppearance(userID); |
146 | } | 146 | } |
147 | 147 | ||
148 | public bool SetAppearance(UUID userID, AvatarAppearance appearance) | 148 | public bool SetAppearance(UUID userID, AvatarAppearance appearance) |
149 | { | 149 | { |
150 | return m_AvatarService.SetAppearance(userID,appearance); | 150 | return m_AvatarService.SetAppearance(userID,appearance); |
151 | } | 151 | } |
152 | 152 | ||
153 | public AvatarData GetAvatar(UUID userID) | 153 | public AvatarData GetAvatar(UUID userID) |
154 | { | 154 | { |
155 | return m_AvatarService.GetAvatar(userID); | 155 | return m_AvatarService.GetAvatar(userID); |
@@ -174,7 +174,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Avatar | |||
174 | { | 174 | { |
175 | return m_AvatarService.RemoveItems(userID, names); | 175 | return m_AvatarService.RemoveItems(userID, names); |
176 | } | 176 | } |
177 | 177 | ||
178 | #endregion | 178 | #endregion |
179 | 179 | ||
180 | } | 180 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/RemoteAvatarServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/RemoteAvatarServiceConnector.cs index a087aea..37cfbbc 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/RemoteAvatarServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/RemoteAvatarServiceConnector.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Avatar | |||
47 | 47 | ||
48 | private bool m_Enabled = false; | 48 | private bool m_Enabled = false; |
49 | 49 | ||
50 | public Type ReplaceableInterface | 50 | public Type ReplaceableInterface |
51 | { | 51 | { |
52 | get { return null; } | 52 | get { return null; } |
53 | } | 53 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs index 70733fc..d220568 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs | |||
@@ -64,7 +64,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
64 | public LocalGridServicesConnector(IConfigSource source) | 64 | public LocalGridServicesConnector(IConfigSource source) |
65 | { | 65 | { |
66 | m_log.DebugFormat("{0} LocalGridServicesConnector instantiated directly.", LogHeader); | 66 | m_log.DebugFormat("{0} LocalGridServicesConnector instantiated directly.", LogHeader); |
67 | InitialiseService(source, null); | 67 | InitialiseService(source, null); |
68 | } | 68 | } |
69 | 69 | ||
70 | public LocalGridServicesConnector(IConfigSource source, RegionInfoCache regionInfoCache) | 70 | public LocalGridServicesConnector(IConfigSource source, RegionInfoCache regionInfoCache) |
@@ -75,7 +75,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
75 | 75 | ||
76 | #region ISharedRegionModule | 76 | #region ISharedRegionModule |
77 | 77 | ||
78 | public Type ReplaceableInterface | 78 | public Type ReplaceableInterface |
79 | { | 79 | { |
80 | get { return null; } | 80 | get { return null; } |
81 | } | 81 | } |
@@ -92,7 +92,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
92 | { | 92 | { |
93 | string name = moduleConfig.GetString("GridServices", ""); | 93 | string name = moduleConfig.GetString("GridServices", ""); |
94 | if (name == Name) | 94 | if (name == Name) |
95 | { | 95 | { |
96 | if(InitialiseService(source, null)) | 96 | if(InitialiseService(source, null)) |
97 | m_log.Info("[LOCAL GRID SERVICE CONNECTOR]: Local grid connector enabled"); | 97 | m_log.Info("[LOCAL GRID SERVICE CONNECTOR]: Local grid connector enabled"); |
98 | } | 98 | } |
@@ -190,8 +190,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
190 | // This shouldn't happen | 190 | // This shouldn't happen |
191 | if (region == null) | 191 | if (region == null) |
192 | return; | 192 | return; |
193 | 193 | ||
194 | m_RegionInfoCache.CacheNearNeighbour(region.ScopeID, region); | 194 | m_RegionInfoCache.CacheNearNeighbour(region.ScopeID, region); |
195 | } | 195 | } |
196 | 196 | ||
197 | public string RegisterRegion(UUID scopeID, GridRegion regionInfo) | 197 | public string RegisterRegion(UUID scopeID, GridRegion regionInfo) |
@@ -206,7 +206,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
206 | 206 | ||
207 | public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID) | 207 | public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID) |
208 | { | 208 | { |
209 | return m_GridService.GetNeighbours(scopeID, regionID); | 209 | return m_GridService.GetNeighbours(scopeID, regionID); |
210 | } | 210 | } |
211 | 211 | ||
212 | public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) | 212 | public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) |
@@ -282,7 +282,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
282 | { | 282 | { |
283 | return m_GridService.GetHyperlinks(scopeID); | 283 | return m_GridService.GetHyperlinks(scopeID); |
284 | } | 284 | } |
285 | 285 | ||
286 | public int GetRegionFlags(UUID scopeID, UUID regionID) | 286 | public int GetRegionFlags(UUID scopeID, UUID regionID) |
287 | { | 287 | { |
288 | return m_GridService.GetRegionFlags(scopeID, regionID); | 288 | return m_GridService.GetRegionFlags(scopeID, regionID); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs index 5eb525b..84e52f7 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs | |||
@@ -44,7 +44,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
44 | // private static readonly ILog m_log = | 44 | // private static readonly ILog m_log = |
45 | // LogManager.GetLogger( | 45 | // LogManager.GetLogger( |
46 | // MethodBase.GetCurrentMethod().DeclaringType); | 46 | // MethodBase.GetCurrentMethod().DeclaringType); |
47 | 47 | ||
48 | private static RegionsExpiringCache m_Cache; | 48 | private static RegionsExpiringCache m_Cache; |
49 | private int numberInstances; | 49 | private int numberInstances; |
50 | 50 | ||
@@ -60,12 +60,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
60 | if (rinfo != null) | 60 | if (rinfo != null) |
61 | this.Cache(rinfo.ScopeID, rinfo); | 61 | this.Cache(rinfo.ScopeID, rinfo); |
62 | } | 62 | } |
63 | 63 | ||
64 | public void Cache(UUID scopeID, GridRegion rinfo) | 64 | public void Cache(UUID scopeID, GridRegion rinfo) |
65 | { | 65 | { |
66 | if (rinfo == null) | 66 | if (rinfo == null) |
67 | return; | 67 | return; |
68 | 68 | ||
69 | m_Cache.AddOrUpdate(scopeID, rinfo, CACHE_EXPIRATION_SECONDS); | 69 | m_Cache.AddOrUpdate(scopeID, rinfo, CACHE_EXPIRATION_SECONDS); |
70 | } | 70 | } |
71 | 71 | ||
@@ -73,7 +73,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
73 | { | 73 | { |
74 | if (rinfo == null) | 74 | if (rinfo == null) |
75 | return; | 75 | return; |
76 | 76 | ||
77 | m_Cache.AddOrUpdate(rinfo.ScopeID, rinfo, 1e7f); | 77 | m_Cache.AddOrUpdate(rinfo.ScopeID, rinfo, 1e7f); |
78 | } | 78 | } |
79 | 79 | ||
@@ -81,7 +81,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
81 | { | 81 | { |
82 | if (rinfo == null) | 82 | if (rinfo == null) |
83 | return; | 83 | return; |
84 | 84 | ||
85 | m_Cache.AddOrUpdate(scopeID, rinfo, CACHE_EXPIRATION_SECONDS); | 85 | m_Cache.AddOrUpdate(scopeID, rinfo, CACHE_EXPIRATION_SECONDS); |
86 | } | 86 | } |
87 | 87 | ||
@@ -89,7 +89,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
89 | { | 89 | { |
90 | if (rinfo == null) | 90 | if (rinfo == null) |
91 | return; | 91 | return; |
92 | 92 | ||
93 | m_Cache.AddOrUpdate(scopeID, rinfo, expireSeconds); | 93 | m_Cache.AddOrUpdate(scopeID, rinfo, expireSeconds); |
94 | } | 94 | } |
95 | 95 | ||
@@ -141,7 +141,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
141 | inCache = true; | 141 | inCache = true; |
142 | return rinfo; | 142 | return rinfo; |
143 | } | 143 | } |
144 | 144 | ||
145 | return null; | 145 | return null; |
146 | } | 146 | } |
147 | 147 | ||
@@ -155,7 +155,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
155 | inCache = true; | 155 | inCache = true; |
156 | return rinfo; | 156 | return rinfo; |
157 | } | 157 | } |
158 | 158 | ||
159 | return null; | 159 | return null; |
160 | } | 160 | } |
161 | } | 161 | } |
@@ -300,7 +300,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
300 | private Dictionary<string, ulong> byname; | 300 | private Dictionary<string, ulong> byname; |
301 | private Dictionary<UUID, ulong> byuuid; | 301 | private Dictionary<UUID, ulong> byuuid; |
302 | // includes handles to the inside of large regions | 302 | // includes handles to the inside of large regions |
303 | private Dictionary<ulong, ulong> innerHandles = new Dictionary<ulong, ulong>(); | 303 | private Dictionary<ulong, ulong> innerHandles = new Dictionary<ulong, ulong>(); |
304 | 304 | ||
305 | public RegionInfoForScope() | 305 | public RegionInfoForScope() |
306 | { | 306 | { |
@@ -342,7 +342,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
342 | byuuid = new Dictionary<UUID, ulong>(); | 342 | byuuid = new Dictionary<UUID, ulong>(); |
343 | 343 | ||
344 | storage[handle] = region; | 344 | storage[handle] = region; |
345 | expires[handle] = expire; | 345 | expires[handle] = expire; |
346 | byname[region.RegionName] = handle; | 346 | byname[region.RegionName] = handle; |
347 | byuuid[region.RegionID] = handle; | 347 | byuuid[region.RegionID] = handle; |
348 | 348 | ||
@@ -385,7 +385,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
385 | storage[handle] = region; | 385 | storage[handle] = region; |
386 | byname[region.RegionName] = handle; | 386 | byname[region.RegionName] = handle; |
387 | byuuid[region.RegionID] = handle; | 387 | byuuid[region.RegionID] = handle; |
388 | 388 | ||
389 | } | 389 | } |
390 | 390 | ||
391 | public void Remove(GridRegion region) | 391 | public void Remove(GridRegion region) |
@@ -483,7 +483,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
483 | 483 | ||
484 | if(!innerHandles.ContainsKey(handle)) | 484 | if(!innerHandles.ContainsKey(handle)) |
485 | return null; | 485 | return null; |
486 | 486 | ||
487 | ulong rhandle = innerHandles[handle]; | 487 | ulong rhandle = innerHandles[handle]; |
488 | if(storage.ContainsKey(rhandle)) | 488 | if(storage.ContainsKey(rhandle)) |
489 | return storage[rhandle]; | 489 | return storage[rhandle]; |
@@ -495,7 +495,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
495 | { | 495 | { |
496 | if(byname == null || !byname.ContainsKey(name)) | 496 | if(byname == null || !byname.ContainsKey(name)) |
497 | return null; | 497 | return null; |
498 | 498 | ||
499 | ulong handle = byname[name]; | 499 | ulong handle = byname[name]; |
500 | if(storage.ContainsKey(handle)) | 500 | if(storage.ContainsKey(handle)) |
501 | return storage[handle]; | 501 | return storage[handle]; |
@@ -528,7 +528,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
528 | 528 | ||
529 | if(!innerHandles.ContainsKey(handle)) | 529 | if(!innerHandles.ContainsKey(handle)) |
530 | return null; | 530 | return null; |
531 | 531 | ||
532 | ulong rhandle = innerHandles[handle]; | 532 | ulong rhandle = innerHandles[handle]; |
533 | if(!storage.ContainsKey(rhandle)) | 533 | if(!storage.ContainsKey(rhandle)) |
534 | return null; | 534 | return null; |
@@ -536,7 +536,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
536 | GridRegion r = storage[rhandle]; | 536 | GridRegion r = storage[rhandle]; |
537 | if(r == null) | 537 | if(r == null) |
538 | return null; | 538 | return null; |
539 | 539 | ||
540 | // extra check, possible redundant | 540 | // extra check, possible redundant |
541 | 541 | ||
542 | int test = r.RegionLocX; | 542 | int test = r.RegionLocX; |
@@ -552,7 +552,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
552 | if (y < test) | 552 | if (y < test) |
553 | return r; | 553 | return r; |
554 | 554 | ||
555 | /* | 555 | /* |
556 | // next do the harder work | 556 | // next do the harder work |
557 | foreach(KeyValuePair<ulong, GridRegion> kvp in storage) | 557 | foreach(KeyValuePair<ulong, GridRegion> kvp in storage) |
558 | { | 558 | { |
@@ -588,7 +588,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
588 | if(kvp.Value < now) | 588 | if(kvp.Value < now) |
589 | toexpire.Add(kvp.Key); | 589 | toexpire.Add(kvp.Key); |
590 | } | 590 | } |
591 | 591 | ||
592 | if(toexpire.Count == 0) | 592 | if(toexpire.Count == 0) |
593 | return expires.Count; | 593 | return expires.Count; |
594 | 594 | ||
@@ -597,7 +597,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
597 | Clear(); | 597 | Clear(); |
598 | return 0; | 598 | return 0; |
599 | } | 599 | } |
600 | 600 | ||
601 | foreach(ulong h in toexpire) | 601 | foreach(ulong h in toexpire) |
602 | { | 602 | { |
603 | if(storage != null) | 603 | if(storage != null) |
@@ -658,7 +658,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
658 | innerHandles[fh.toHandle()] = handle; | 658 | innerHandles[fh.toHandle()] = handle; |
659 | fh.y += 256; | 659 | fh.y += 256; |
660 | } | 660 | } |
661 | 661 | ||
662 | fh.y = startY; | 662 | fh.y = startY; |
663 | fh.x += 256; | 663 | fh.x += 256; |
664 | } | 664 | } |
@@ -684,18 +684,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
684 | innerHandles.Remove(fh.toHandle()); | 684 | innerHandles.Remove(fh.toHandle()); |
685 | fh.y += 256; | 685 | fh.y += 256; |
686 | } | 686 | } |
687 | 687 | ||
688 | fh.y = startY; | 688 | fh.y = startY; |
689 | fh.x += 256; | 689 | fh.x += 256; |
690 | } | 690 | } |
691 | } | 691 | } |
692 | } | 692 | } |
693 | 693 | ||
694 | public class RegionsExpiringCache | 694 | public class RegionsExpiringCache |
695 | { | 695 | { |
696 | const double CACHE_PURGE_HZ = 60; // seconds | 696 | const double CACHE_PURGE_HZ = 60; // seconds |
697 | const int MAX_LOCK_WAIT = 10000; // milliseconds | 697 | const int MAX_LOCK_WAIT = 10000; // milliseconds |
698 | 698 | ||
699 | /// <summary>For thread safety</summary> | 699 | /// <summary>For thread safety</summary> |
700 | object syncRoot = new object(); | 700 | object syncRoot = new object(); |
701 | /// <summary>For thread safety</summary> | 701 | /// <summary>For thread safety</summary> |
@@ -728,7 +728,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
728 | ris = new RegionInfoForScope(region, expire); | 728 | ris = new RegionInfoForScope(region, expire); |
729 | InfobyScope[scope] = ris; | 729 | InfobyScope[scope] = ris; |
730 | } | 730 | } |
731 | else | 731 | else |
732 | ris.AddUpdate(region, expire); | 732 | ris.AddUpdate(region, expire); |
733 | 733 | ||
734 | return true; | 734 | return true; |
@@ -748,7 +748,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
748 | } | 748 | } |
749 | finally { Monitor.Exit(syncRoot); } | 749 | finally { Monitor.Exit(syncRoot); } |
750 | } | 750 | } |
751 | 751 | ||
752 | public bool Contains(UUID scope, GridRegion region) | 752 | public bool Contains(UUID scope, GridRegion region) |
753 | { | 753 | { |
754 | if(region == null) | 754 | if(region == null) |
@@ -758,11 +758,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
758 | throw new ApplicationException("Lock could not be acquired after " + MAX_LOCK_WAIT + "ms"); | 758 | throw new ApplicationException("Lock could not be acquired after " + MAX_LOCK_WAIT + "ms"); |
759 | 759 | ||
760 | try | 760 | try |
761 | { | 761 | { |
762 | RegionInfoForScope ris = null; | 762 | RegionInfoForScope ris = null; |
763 | if(!InfobyScope.TryGetValue(scope, out ris) || ris == null) | 763 | if(!InfobyScope.TryGetValue(scope, out ris) || ris == null) |
764 | return false; | 764 | return false; |
765 | 765 | ||
766 | return ris.Contains(region); | 766 | return ris.Contains(region); |
767 | } | 767 | } |
768 | finally { Monitor.Exit(syncRoot); } | 768 | finally { Monitor.Exit(syncRoot); } |
@@ -774,11 +774,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
774 | throw new ApplicationException("Lock could not be acquired after " + MAX_LOCK_WAIT + "ms"); | 774 | throw new ApplicationException("Lock could not be acquired after " + MAX_LOCK_WAIT + "ms"); |
775 | 775 | ||
776 | try | 776 | try |
777 | { | 777 | { |
778 | RegionInfoForScope ris = null; | 778 | RegionInfoForScope ris = null; |
779 | if(!InfobyScope.TryGetValue(scope, out ris) || ris == null) | 779 | if(!InfobyScope.TryGetValue(scope, out ris) || ris == null) |
780 | return false; | 780 | return false; |
781 | 781 | ||
782 | return ris.Contains(handle); | 782 | return ris.Contains(handle); |
783 | } | 783 | } |
784 | finally { Monitor.Exit(syncRoot); } | 784 | finally { Monitor.Exit(syncRoot); } |
@@ -790,7 +790,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
790 | throw new ApplicationException("Lock could not be acquired after " + MAX_LOCK_WAIT + "ms"); | 790 | throw new ApplicationException("Lock could not be acquired after " + MAX_LOCK_WAIT + "ms"); |
791 | 791 | ||
792 | try | 792 | try |
793 | { | 793 | { |
794 | int count = 0; | 794 | int count = 0; |
795 | foreach(RegionInfoForScope ris in InfobyScope.Values) | 795 | foreach(RegionInfoForScope ris in InfobyScope.Values) |
796 | count += ris.Count(); | 796 | count += ris.Count(); |
@@ -804,7 +804,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
804 | if (!Monitor.TryEnter(syncRoot, MAX_LOCK_WAIT)) | 804 | if (!Monitor.TryEnter(syncRoot, MAX_LOCK_WAIT)) |
805 | throw new ApplicationException("Lock could not be acquired after " + MAX_LOCK_WAIT + "ms"); | 805 | throw new ApplicationException("Lock could not be acquired after " + MAX_LOCK_WAIT + "ms"); |
806 | try | 806 | try |
807 | { | 807 | { |
808 | RegionInfoForScope ris = null; | 808 | RegionInfoForScope ris = null; |
809 | if(!InfobyScope.TryGetValue(scope, out ris) || ris == null) | 809 | if(!InfobyScope.TryGetValue(scope, out ris) || ris == null) |
810 | return false; | 810 | return false; |
@@ -825,7 +825,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
825 | if (!Monitor.TryEnter(syncRoot, MAX_LOCK_WAIT)) | 825 | if (!Monitor.TryEnter(syncRoot, MAX_LOCK_WAIT)) |
826 | throw new ApplicationException("Lock could not be acquired after " + MAX_LOCK_WAIT + "ms"); | 826 | throw new ApplicationException("Lock could not be acquired after " + MAX_LOCK_WAIT + "ms"); |
827 | try | 827 | try |
828 | { | 828 | { |
829 | RegionInfoForScope ris = null; | 829 | RegionInfoForScope ris = null; |
830 | if(!InfobyScope.TryGetValue(scope, out ris) || ris == null) | 830 | if(!InfobyScope.TryGetValue(scope, out ris) || ris == null) |
831 | return false; | 831 | return false; |
@@ -940,7 +940,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
940 | private void PurgeCache(object sender, System.Timers.ElapsedEventArgs e) | 940 | private void PurgeCache(object sender, System.Timers.ElapsedEventArgs e) |
941 | { | 941 | { |
942 | // Only let one thread purge at once - a buildup could cause a crash | 942 | // Only let one thread purge at once - a buildup could cause a crash |
943 | // This could cause the purge to be delayed while there are lots of read/write ops | 943 | // This could cause the purge to be delayed while there are lots of read/write ops |
944 | // happening on the cache | 944 | // happening on the cache |
945 | if (!Monitor.TryEnter(isPurging)) | 945 | if (!Monitor.TryEnter(isPurging)) |
946 | return; | 946 | return; |
@@ -961,7 +961,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
961 | if (kvp.Value.expire(now) == 0) | 961 | if (kvp.Value.expire(now) == 0) |
962 | expiredscopes.Add(kvp.Key); | 962 | expiredscopes.Add(kvp.Key); |
963 | } | 963 | } |
964 | 964 | ||
965 | if (expiredscopes.Count > 0) | 965 | if (expiredscopes.Count > 0) |
966 | { | 966 | { |
967 | foreach (UUID sid in expiredscopes) | 967 | foreach (UUID sid in expiredscopes) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs index 50e4c8a..ee17093 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs | |||
@@ -58,7 +58,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
58 | private IGridService m_RemoteGridService; | 58 | private IGridService m_RemoteGridService; |
59 | 59 | ||
60 | private RegionInfoCache m_RegionInfoCache; | 60 | private RegionInfoCache m_RegionInfoCache; |
61 | 61 | ||
62 | public RemoteGridServicesConnector() | 62 | public RemoteGridServicesConnector() |
63 | { | 63 | { |
64 | } | 64 | } |
@@ -70,7 +70,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
70 | 70 | ||
71 | #region ISharedRegionmodule | 71 | #region ISharedRegionmodule |
72 | 72 | ||
73 | public Type ReplaceableInterface | 73 | public Type ReplaceableInterface |
74 | { | 74 | { |
75 | get { return null; } | 75 | get { return null; } |
76 | } | 76 | } |
@@ -113,7 +113,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
113 | return false; | 113 | return false; |
114 | } | 114 | } |
115 | 115 | ||
116 | Object[] args = new Object[] { source }; | 116 | Object[] args = new Object[] { source }; |
117 | m_RemoteGridService = ServerUtils.LoadPlugin<IGridService>(networkConnector, args); | 117 | m_RemoteGridService = ServerUtils.LoadPlugin<IGridService>(networkConnector, args); |
118 | 118 | ||
119 | m_LocalGridService = new LocalGridServicesConnector(source, m_RegionInfoCache); | 119 | m_LocalGridService = new LocalGridServicesConnector(source, m_RegionInfoCache); |
@@ -130,11 +130,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
130 | new string[] { "Startup", "Hypergrid", "GridService" }, String.Empty); | 130 | new string[] { "Startup", "Hypergrid", "GridService" }, String.Empty); |
131 | // Legacy. Remove soon! | 131 | // Legacy. Remove soon! |
132 | m_ThisGatekeeper = gridConfig.GetString("Gatekeeper", m_ThisGatekeeper); | 132 | m_ThisGatekeeper = gridConfig.GetString("Gatekeeper", m_ThisGatekeeper); |
133 | 133 | ||
134 | Util.checkServiceURI(m_ThisGatekeeper, out m_ThisGatekeeper); | 134 | Util.checkServiceURI(m_ThisGatekeeper, out m_ThisGatekeeper); |
135 | 135 | ||
136 | return true; | 136 | return true; |
137 | } | 137 | } |
138 | 138 | ||
139 | public void PostInitialise() | 139 | public void PostInitialise() |
140 | { | 140 | { |
@@ -249,14 +249,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
249 | { | 249 | { |
250 | if(string.IsNullOrWhiteSpace(m_ThisGatekeeper)) | 250 | if(string.IsNullOrWhiteSpace(m_ThisGatekeeper)) |
251 | return rinfo; // no HG | 251 | return rinfo; // no HG |
252 | 252 | ||
253 | string regionURI = ""; | 253 | string regionURI = ""; |
254 | if(!Util.buildHGRegionURI(name, out regionURI, out regionName) || string.IsNullOrWhiteSpace(regionName)) | 254 | if(!Util.buildHGRegionURI(name, out regionURI, out regionName) || string.IsNullOrWhiteSpace(regionName)) |
255 | return rinfo; // invalid | 255 | return rinfo; // invalid |
256 | if(m_ThisGatekeeper != regionURI) | 256 | if(m_ThisGatekeeper != regionURI) |
257 | return rinfo; // not local grid | 257 | return rinfo; // not local grid |
258 | } | 258 | } |
259 | 259 | ||
260 | rinfo = m_RemoteGridService.GetRegionByName(scopeID, regionName); | 260 | rinfo = m_RemoteGridService.GetRegionByName(scopeID, regionName); |
261 | m_RegionInfoCache.Cache(scopeID, rinfo); | 261 | m_RegionInfoCache.Cache(scopeID, rinfo); |
262 | return rinfo; | 262 | return rinfo; |
@@ -275,10 +275,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
275 | { | 275 | { |
276 | if(string.IsNullOrWhiteSpace(m_ThisGatekeeper)) | 276 | if(string.IsNullOrWhiteSpace(m_ThisGatekeeper)) |
277 | return rinfo; // no HG | 277 | return rinfo; // no HG |
278 | 278 | ||
279 | string regionURI = ""; | 279 | string regionURI = ""; |
280 | if(!Util.buildHGRegionURI(name, out regionURI, out regionName) || string.IsNullOrWhiteSpace(regionName)) | 280 | if(!Util.buildHGRegionURI(name, out regionURI, out regionName) || string.IsNullOrWhiteSpace(regionName)) |
281 | return rinfo; // invalid | 281 | return rinfo; // invalid |
282 | if(m_ThisGatekeeper != regionURI) | 282 | if(m_ThisGatekeeper != regionURI) |
283 | return rinfo; // not local grid | 283 | return rinfo; // not local grid |
284 | } | 284 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs index 044e0e5..1378368 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs | |||
@@ -88,7 +88,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests | |||
88 | Scene s = new Scene(new RegionInfo()); | 88 | Scene s = new Scene(new RegionInfo()); |
89 | s.RegionInfo.RegionID = r1.RegionID; | 89 | s.RegionInfo.RegionID = r1.RegionID; |
90 | m_LocalConnector.AddRegion(s); | 90 | m_LocalConnector.AddRegion(s); |
91 | 91 | ||
92 | GridRegion r2 = new GridRegion(); | 92 | GridRegion r2 = new GridRegion(); |
93 | r2.RegionName = "Test Region 2"; | 93 | r2.RegionName = "Test Region 2"; |
94 | r2.RegionID = new UUID(2); | 94 | r2.RegionID = new UUID(2); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs index 98ccc95..c780bcd 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs | |||
@@ -37,7 +37,7 @@ using log4net; | |||
37 | 37 | ||
38 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser | 38 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser |
39 | { | 39 | { |
40 | public class ActivityDetector | 40 | public class ActivityDetector |
41 | { | 41 | { |
42 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 42 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
43 | 43 | ||
@@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser | |||
67 | { | 67 | { |
68 | if (sp.isNPC) | 68 | if (sp.isNPC) |
69 | return; | 69 | return; |
70 | 70 | ||
71 | if(sp.gotCrossUpdate) | 71 | if(sp.gotCrossUpdate) |
72 | { | 72 | { |
73 | Util.FireAndForget(delegate | 73 | Util.FireAndForget(delegate |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index c48186f..5efdd9b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -86,7 +86,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
86 | } | 86 | } |
87 | } | 87 | } |
88 | 88 | ||
89 | public Type ReplaceableInterface | 89 | public Type ReplaceableInterface |
90 | { | 90 | { |
91 | get { return null; } | 91 | get { return null; } |
92 | } | 92 | } |
@@ -299,7 +299,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
299 | return m_InventoryURLs[userID]; | 299 | return m_InventoryURLs[userID]; |
300 | 300 | ||
301 | return null; //it means that the methods should forward to local grid's inventory | 301 | return null; //it means that the methods should forward to local grid's inventory |
302 | 302 | ||
303 | } | 303 | } |
304 | #endregion | 304 | #endregion |
305 | 305 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index 0d36725..fa36b66 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -72,7 +72,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
72 | 72 | ||
73 | private bool m_Enabled = false; | 73 | private bool m_Enabled = false; |
74 | 74 | ||
75 | public Type ReplaceableInterface | 75 | public Type ReplaceableInterface |
76 | { | 76 | { |
77 | get { return null; } | 77 | get { return null; } |
78 | } | 78 | } |
@@ -134,7 +134,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
134 | { | 134 | { |
135 | if (!m_Enabled) | 135 | if (!m_Enabled) |
136 | return; | 136 | return; |
137 | 137 | ||
138 | scene.RegisterModuleInterface<IInventoryService>(this); | 138 | scene.RegisterModuleInterface<IInventoryService>(this); |
139 | 139 | ||
140 | if (Scene == null) | 140 | if (Scene == null) |
@@ -261,9 +261,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
261 | public bool AddItem(InventoryItemBase item) | 261 | public bool AddItem(InventoryItemBase item) |
262 | { | 262 | { |
263 | // m_log.DebugFormat( | 263 | // m_log.DebugFormat( |
264 | // "[LOCAL INVENTORY SERVICES CONNECTOR]: Adding inventory item {0} to user {1} folder {2}", | 264 | // "[LOCAL INVENTORY SERVICES CONNECTOR]: Adding inventory item {0} to user {1} folder {2}", |
265 | // item.Name, item.Owner, item.Folder); | 265 | // item.Name, item.Owner, item.Folder); |
266 | 266 | ||
267 | return m_InventoryService.AddItem(item); | 267 | return m_InventoryService.AddItem(item); |
268 | } | 268 | } |
269 | 269 | ||
@@ -297,7 +297,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
297 | // m_log.DebugFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Requesting inventory item {0}", item.ID); | 297 | // m_log.DebugFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Requesting inventory item {0}", item.ID); |
298 | 298 | ||
299 | // UUID requestedItemId = item.ID; | 299 | // UUID requestedItemId = item.ID; |
300 | 300 | ||
301 | InventoryItemBase item = m_InventoryService.GetItem(principalID, itemID); | 301 | InventoryItemBase item = m_InventoryService.GetItem(principalID, itemID); |
302 | 302 | ||
303 | // if (null == item) | 303 | // if (null == item) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs index 62b44b1..d8ae2c4 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs | |||
@@ -74,7 +74,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
74 | } | 74 | } |
75 | } | 75 | } |
76 | 76 | ||
77 | public Type ReplaceableInterface | 77 | public Type ReplaceableInterface |
78 | { | 78 | { |
79 | get { return null; } | 79 | get { return null; } |
80 | } | 80 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs index 9e251aa..cad2061 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs | |||
@@ -62,7 +62,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land | |||
62 | 62 | ||
63 | #region ISharedRegionModule | 63 | #region ISharedRegionModule |
64 | 64 | ||
65 | public Type ReplaceableInterface | 65 | public Type ReplaceableInterface |
66 | { | 66 | { |
67 | get { return null; } | 67 | get { return null; } |
68 | } | 68 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs index 77dfa4a..68c5b64 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs | |||
@@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land | |||
53 | private bool m_Enabled = false; | 53 | private bool m_Enabled = false; |
54 | private LocalLandServicesConnector m_LocalService; | 54 | private LocalLandServicesConnector m_LocalService; |
55 | 55 | ||
56 | public Type ReplaceableInterface | 56 | public Type ReplaceableInterface |
57 | { | 57 | { |
58 | get { return null; } | 58 | get { return null; } |
59 | } | 59 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs index 1357825..9888c3b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs | |||
@@ -68,11 +68,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
68 | private int m_refreshtime = 0; | 68 | private int m_refreshtime = 0; |
69 | private int m_lastrefresh = 0; | 69 | private int m_lastrefresh = 0; |
70 | private System.Timers.Timer m_refreshTimer; | 70 | private System.Timers.Timer m_refreshTimer; |
71 | 71 | ||
72 | #region ISharedRegionModule | 72 | #region ISharedRegionModule |
73 | 73 | ||
74 | public Type ReplaceableInterface { get { return null; } } | 74 | public Type ReplaceableInterface { get { return null; } } |
75 | public string Name { get { return "MapImageServiceModule"; } } | 75 | public string Name { get { return "MapImageServiceModule"; } } |
76 | public void RegionLoaded(Scene scene) { } | 76 | public void RegionLoaded(Scene scene) { } |
77 | public void Close() { } | 77 | public void Close() { } |
78 | public void PostInitialise() { } | 78 | public void PostInitialise() { } |
@@ -115,12 +115,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
115 | m_log.WarnFormat("[MAP IMAGE SERVICE MODULE]: Unable to load LocalServiceModule from {0}. MapService module disabled. Please fix the configuration.", service); | 115 | m_log.WarnFormat("[MAP IMAGE SERVICE MODULE]: Unable to load LocalServiceModule from {0}. MapService module disabled. Please fix the configuration.", service); |
116 | return; | 116 | return; |
117 | } | 117 | } |
118 | 118 | ||
119 | // we don't want the timer if the interval is zero, but we still want this module enables | 119 | // we don't want the timer if the interval is zero, but we still want this module enables |
120 | if(refreshminutes > 0) | 120 | if(refreshminutes > 0) |
121 | { | 121 | { |
122 | m_refreshtime = refreshminutes * 60 * 1000; // convert from minutes to ms | 122 | m_refreshtime = refreshminutes * 60 * 1000; // convert from minutes to ms |
123 | 123 | ||
124 | m_refreshTimer = new System.Timers.Timer(); | 124 | m_refreshTimer = new System.Timers.Timer(); |
125 | m_refreshTimer.Enabled = true; | 125 | m_refreshTimer.Enabled = true; |
126 | m_refreshTimer.AutoReset = true; | 126 | m_refreshTimer.AutoReset = true; |
@@ -131,7 +131,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
131 | m_log.InfoFormat("[MAP IMAGE SERVICE MODULE]: enabled with refresh time {0} min and service object {1}", | 131 | m_log.InfoFormat("[MAP IMAGE SERVICE MODULE]: enabled with refresh time {0} min and service object {1}", |
132 | refreshminutes, service); | 132 | refreshminutes, service); |
133 | } | 133 | } |
134 | else | 134 | else |
135 | { | 135 | { |
136 | m_log.InfoFormat("[MAP IMAGE SERVICE MODULE]: enabled with no refresh and service object {0}", service); | 136 | m_log.InfoFormat("[MAP IMAGE SERVICE MODULE]: enabled with no refresh and service object {0}", service); |
137 | } | 137 | } |
@@ -171,7 +171,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
171 | } | 171 | } |
172 | 172 | ||
173 | #endregion ISharedRegionModule | 173 | #endregion ISharedRegionModule |
174 | 174 | ||
175 | ///<summary> | 175 | ///<summary> |
176 | /// | 176 | /// |
177 | ///</summary> | 177 | ///</summary> |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs index bda354f..e8d01b0 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs | |||
@@ -63,7 +63,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour | |||
63 | 63 | ||
64 | #region ISharedRegionModule | 64 | #region ISharedRegionModule |
65 | 65 | ||
66 | public Type ReplaceableInterface | 66 | public Type ReplaceableInterface |
67 | { | 67 | { |
68 | get { return null; } | 68 | get { return null; } |
69 | } | 69 | } |
@@ -113,7 +113,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour | |||
113 | 113 | ||
114 | public void RemoveRegion(Scene scene) | 114 | public void RemoveRegion(Scene scene) |
115 | { | 115 | { |
116 | // Always remove | 116 | // Always remove |
117 | if (m_Scenes.Contains(scene)) | 117 | if (m_Scenes.Contains(scene)) |
118 | m_Scenes.Remove(scene); | 118 | m_Scenes.Remove(scene); |
119 | } | 119 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/RemoteNeighourServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/RemoteNeighourServiceConnector.cs index e6772f3..fcb5521 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/RemoteNeighourServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/RemoteNeighourServiceConnector.cs | |||
@@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour | |||
53 | //private string serviceDll; | 53 | //private string serviceDll; |
54 | //private List<Scene> m_Scenes = new List<Scene>(); | 54 | //private List<Scene> m_Scenes = new List<Scene>(); |
55 | 55 | ||
56 | public Type ReplaceableInterface | 56 | public Type ReplaceableInterface |
57 | { | 57 | { |
58 | get { return null; } | 58 | get { return null; } |
59 | } | 59 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs index 117f02c..aafd047 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs | |||
@@ -35,7 +35,7 @@ using OpenSim.Services.Interfaces; | |||
35 | 35 | ||
36 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence | 36 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence |
37 | { | 37 | { |
38 | public class PresenceDetector | 38 | public class PresenceDetector |
39 | { | 39 | { |
40 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 40 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
41 | 41 | ||
@@ -70,7 +70,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence | |||
70 | { | 70 | { |
71 | if (sp.isNPC) | 71 | if (sp.isNPC) |
72 | return; | 72 | return; |
73 | 73 | ||
74 | if(sp.gotCrossUpdate) | 74 | if(sp.gotCrossUpdate) |
75 | { | 75 | { |
76 | Util.FireAndForget(delegate | 76 | Util.FireAndForget(delegate |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs index 69bac82..7838d12 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs | |||
@@ -72,7 +72,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence.Tests | |||
72 | public void TestPresenceV0_1() | 72 | public void TestPresenceV0_1() |
73 | { | 73 | { |
74 | SetUp(); | 74 | SetUp(); |
75 | 75 | ||
76 | // Let's stick in a test presence | 76 | // Let's stick in a test presence |
77 | /* | 77 | /* |
78 | PresenceData p = new PresenceData(); | 78 | PresenceData p = new PresenceData(); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index 3755650..57aba05 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | |||
@@ -219,7 +219,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
219 | } | 219 | } |
220 | 220 | ||
221 | // m_log.DebugFormat( | 221 | // m_log.DebugFormat( |
222 | // "[LOCAL COMMS]: Did not find region {0} {1} for ChildAgentUpdate", | 222 | // "[LOCAL COMMS]: Did not find region {0} {1} for ChildAgentUpdate", |
223 | // destination.RegionName, destination.RegionID); | 223 | // destination.RegionName, destination.RegionID); |
224 | 224 | ||
225 | return false; | 225 | return false; |
@@ -265,7 +265,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
265 | reason = "Destination is a variable-sized region, and source is an old simulator. Consider upgrading."; | 265 | reason = "Destination is a variable-sized region, and source is an old simulator. Consider upgrading."; |
266 | m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Request to access this variable-sized region from older simulator was denied"); | 266 | m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Request to access this variable-sized region from older simulator was denied"); |
267 | return false; | 267 | return false; |
268 | 268 | ||
269 | } | 269 | } |
270 | 270 | ||
271 | 271 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index 0ebdbce..b402d2a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | |||
@@ -137,7 +137,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
137 | } | 137 | } |
138 | 138 | ||
139 | protected virtual void InitOnce(Scene scene) | 139 | protected virtual void InitOnce(Scene scene) |
140 | { | 140 | { |
141 | m_aScene = scene; | 141 | m_aScene = scene; |
142 | //m_regionClient = new RegionToRegionClient(m_aScene, m_hyperlinkService); | 142 | //m_regionClient = new RegionToRegionClient(m_aScene, m_hyperlinkService); |
143 | } | 143 | } |
@@ -248,7 +248,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
248 | // else do the remote thing | 248 | // else do the remote thing |
249 | if (!m_localBackend.IsLocalRegion(destination.RegionID)) | 249 | if (!m_localBackend.IsLocalRegion(destination.RegionID)) |
250 | return m_remoteConnector.CloseAgent(destination, id, auth_token); | 250 | return m_remoteConnector.CloseAgent(destination, id, auth_token); |
251 | 251 | ||
252 | return false; | 252 | return false; |
253 | } | 253 | } |
254 | 254 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs index b72ffbb..77fd70b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs | |||
@@ -59,7 +59,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
59 | 59 | ||
60 | #region ISharedRegionModule | 60 | #region ISharedRegionModule |
61 | 61 | ||
62 | public Type ReplaceableInterface | 62 | public Type ReplaceableInterface |
63 | { | 63 | { |
64 | get { return null; } | 64 | get { return null; } |
65 | } | 65 | } |
@@ -200,7 +200,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
200 | account = m_Cache.Get(uuid, out inCache); | 200 | account = m_Cache.Get(uuid, out inCache); |
201 | if (inCache) | 201 | if (inCache) |
202 | ret.Add(account); | 202 | ret.Add(account); |
203 | else | 203 | else |
204 | missing.Add(id); | 204 | missing.Add(id); |
205 | } | 205 | } |
206 | } | 206 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs index f5eda11..b510d0a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs | |||
@@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
53 | private bool m_Enabled = false; | 53 | private bool m_Enabled = false; |
54 | private UserAccountCache m_Cache; | 54 | private UserAccountCache m_Cache; |
55 | 55 | ||
56 | public Type ReplaceableInterface | 56 | public Type ReplaceableInterface |
57 | { | 57 | { |
58 | get { return null; } | 58 | get { return null; } |
59 | } | 59 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs index 2afd74e..f3572a2 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs | |||
@@ -43,7 +43,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
43 | // private static readonly ILog m_log = | 43 | // private static readonly ILog m_log = |
44 | // LogManager.GetLogger( | 44 | // LogManager.GetLogger( |
45 | // MethodBase.GetCurrentMethod().DeclaringType); | 45 | // MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | private ExpiringCache<UUID, UserAccount> m_UUIDCache; | 47 | private ExpiringCache<UUID, UserAccount> m_UUIDCache; |
48 | private ExpiringCache<string, UUID> m_NameCache; | 48 | private ExpiringCache<string, UUID> m_NameCache; |
49 | private object accessLock = new object(); | 49 | private object accessLock = new object(); |
@@ -51,7 +51,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
51 | public UserAccountCache() | 51 | public UserAccountCache() |
52 | { | 52 | { |
53 | m_UUIDCache = new ExpiringCache<UUID, UserAccount>(); | 53 | m_UUIDCache = new ExpiringCache<UUID, UserAccount>(); |
54 | m_NameCache = new ExpiringCache<string, UUID>(); | 54 | m_NameCache = new ExpiringCache<string, UUID>(); |
55 | } | 55 | } |
56 | 56 | ||
57 | public void Cache(UUID userID, UserAccount account) | 57 | public void Cache(UUID userID, UserAccount account) |
@@ -70,7 +70,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
70 | { | 70 | { |
71 | m_UUIDCache.AddOrUpdate(userID, account, CACHE_ALIEN_EXPIRATION_SECONDS); | 71 | m_UUIDCache.AddOrUpdate(userID, account, CACHE_ALIEN_EXPIRATION_SECONDS); |
72 | m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, CACHE_ALIEN_EXPIRATION_SECONDS); | 72 | m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, CACHE_ALIEN_EXPIRATION_SECONDS); |
73 | } | 73 | } |
74 | //m_log.DebugFormat("[USER CACHE]: cached user {0}", userID); | 74 | //m_log.DebugFormat("[USER CACHE]: cached user {0}", userID); |
75 | } | 75 | } |
76 | } | 76 | } |
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) |