diff options
author | Jeff Ames | 2009-06-09 18:07:35 +0000 |
---|---|---|
committer | Jeff Ames | 2009-06-09 18:07:35 +0000 |
commit | a7fcacf8f396acbca0b640a65acfbf5487d513e7 (patch) | |
tree | 5ba66f5c83eceeb81e24a0540ae4fac9847e0c78 /OpenSim/Region | |
parent | Update svn properties. (diff) | |
download | opensim-SC_OLD-a7fcacf8f396acbca0b640a65acfbf5487d513e7.zip opensim-SC_OLD-a7fcacf8f396acbca0b640a65acfbf5487d513e7.tar.gz opensim-SC_OLD-a7fcacf8f396acbca0b640a65acfbf5487d513e7.tar.bz2 opensim-SC_OLD-a7fcacf8f396acbca0b640a65acfbf5487d513e7.tar.xz |
Formatting cleanup. Ignore some generated files.
Diffstat (limited to 'OpenSim/Region')
8 files changed, 89 insertions, 89 deletions
diff --git a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs index 5e3d243..d42c9e2 100644 --- a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs | |||
@@ -114,12 +114,12 @@ namespace OpenSim.Region.CoreModules.Asset | |||
114 | /// <summary> | 114 | /// <summary> |
115 | /// Asset's default expiration time in the cache. | 115 | /// Asset's default expiration time in the cache. |
116 | /// </summary> | 116 | /// </summary> |
117 | public static readonly TimeSpan DefaultExpirationTime = TimeSpan.FromMinutes( 30.0 ); | 117 | public static readonly TimeSpan DefaultExpirationTime = TimeSpan.FromMinutes(30.0); |
118 | 118 | ||
119 | /// <summary> | 119 | /// <summary> |
120 | /// Log manager instance. | 120 | /// Log manager instance. |
121 | /// </summary> | 121 | /// </summary> |
122 | private static readonly ILog Log = LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType ); | 122 | private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
123 | 123 | ||
124 | /// <summary> | 124 | /// <summary> |
125 | /// Cache object. | 125 | /// Cache object. |
@@ -159,7 +159,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
159 | /// </summary> | 159 | /// </summary> |
160 | public void Initialize() | 160 | public void Initialize() |
161 | { | 161 | { |
162 | Initialize( DefaultMaxSize, DefaultMaxCount, DefaultExpirationTime ); | 162 | Initialize(DefaultMaxSize, DefaultMaxCount, DefaultExpirationTime); |
163 | } | 163 | } |
164 | 164 | ||
165 | /// <summary> | 165 | /// <summary> |
@@ -174,16 +174,16 @@ namespace OpenSim.Region.CoreModules.Asset | |||
174 | /// <param name="expirationTime"> | 174 | /// <param name="expirationTime"> |
175 | /// Asset's expiration time. | 175 | /// Asset's expiration time. |
176 | /// </param> | 176 | /// </param> |
177 | public void Initialize( long maximalSize, int maximalCount, TimeSpan expirationTime ) | 177 | public void Initialize(long maximalSize, int maximalCount, TimeSpan expirationTime) |
178 | { | 178 | { |
179 | if( maximalSize <= 0 || maximalCount <= 0 ) | 179 | if (maximalSize <= 0 || maximalCount <= 0) |
180 | { | 180 | { |
181 | Log.Info( "[ASSET CACHE]: Cenome asset cache is not enabled." ); | 181 | Log.Info("[ASSET CACHE]: Cenome asset cache is not enabled."); |
182 | m_enabled = false; | 182 | m_enabled = false; |
183 | return; | 183 | return; |
184 | } | 184 | } |
185 | 185 | ||
186 | if( expirationTime <= TimeSpan.Zero ) | 186 | if (expirationTime <= TimeSpan.Zero) |
187 | { | 187 | { |
188 | // Disable expiration time | 188 | // Disable expiration time |
189 | expirationTime = TimeSpan.MaxValue; | 189 | expirationTime = TimeSpan.MaxValue; |
@@ -191,14 +191,14 @@ namespace OpenSim.Region.CoreModules.Asset | |||
191 | 191 | ||
192 | // Create cache and add synchronization wrapper over it | 192 | // Create cache and add synchronization wrapper over it |
193 | m_cache = | 193 | m_cache = |
194 | CnmSynchronizedCache<string, AssetBase>.Synchronized( new CnmMemoryCache<string, AssetBase>( | 194 | CnmSynchronizedCache<string, AssetBase>.Synchronized(new CnmMemoryCache<string, AssetBase>( |
195 | maximalSize, maximalCount, expirationTime ) ); | 195 | maximalSize, maximalCount, expirationTime)); |
196 | m_enabled = true; | 196 | m_enabled = true; |
197 | Log.InfoFormat( | 197 | Log.InfoFormat( |
198 | "[ASSET CACHE]: Cenome asset cache enabled (MaxSize = {0} bytes, MaxCount = {1}, ExpirationTime = {2})", | 198 | "[ASSET CACHE]: Cenome asset cache enabled (MaxSize = {0} bytes, MaxCount = {1}, ExpirationTime = {2})", |
199 | maximalSize, | 199 | maximalSize, |
200 | maximalCount, | 200 | maximalCount, |
201 | expirationTime ); | 201 | expirationTime); |
202 | } | 202 | } |
203 | 203 | ||
204 | #region IImprovedAssetCache Members | 204 | #region IImprovedAssetCache Members |
@@ -209,10 +209,10 @@ namespace OpenSim.Region.CoreModules.Asset | |||
209 | /// <param name="asset"> | 209 | /// <param name="asset"> |
210 | /// The asset that is being cached. | 210 | /// The asset that is being cached. |
211 | /// </param> | 211 | /// </param> |
212 | public void Cache( AssetBase asset ) | 212 | public void Cache(AssetBase asset) |
213 | { | 213 | { |
214 | long size = asset.Data != null ? asset.Data.Length : 1; | 214 | long size = asset.Data != null ? asset.Data.Length : 1; |
215 | m_cache.Set( asset.ID, asset, size ); | 215 | m_cache.Set(asset.ID, asset, size); |
216 | m_cachedCount++; | 216 | m_cachedCount++; |
217 | } | 217 | } |
218 | 218 | ||
@@ -230,9 +230,9 @@ namespace OpenSim.Region.CoreModules.Asset | |||
230 | /// <param name="id"> | 230 | /// <param name="id"> |
231 | /// The expired asset's id. | 231 | /// The expired asset's id. |
232 | /// </param> | 232 | /// </param> |
233 | public void Expire( string id ) | 233 | public void Expire(string id) |
234 | { | 234 | { |
235 | m_cache.Remove( id ); | 235 | m_cache.Remove(id); |
236 | } | 236 | } |
237 | 237 | ||
238 | /// <summary> | 238 | /// <summary> |
@@ -250,14 +250,14 @@ namespace OpenSim.Region.CoreModules.Asset | |||
250 | /// Cache doesn't guarantee in any situation that asset is stored to it. | 250 | /// Cache doesn't guarantee in any situation that asset is stored to it. |
251 | /// </para> | 251 | /// </para> |
252 | /// </remarks> | 252 | /// </remarks> |
253 | public AssetBase Get( string id ) | 253 | public AssetBase Get(string id) |
254 | { | 254 | { |
255 | m_getCount++; | 255 | m_getCount++; |
256 | AssetBase assetBase; | 256 | AssetBase assetBase; |
257 | if( m_cache.TryGetValue( id, out assetBase ) ) | 257 | if (m_cache.TryGetValue(id, out assetBase)) |
258 | m_hitCount++; | 258 | m_hitCount++; |
259 | 259 | ||
260 | if( m_getCount == m_debugEpoch ) | 260 | if (m_getCount == m_debugEpoch) |
261 | { | 261 | { |
262 | Log.InfoFormat( | 262 | Log.InfoFormat( |
263 | "[ASSET CACHE]: Cached = {0}, Get = {1}, Hits = {2}%, Size = {3} bytes, Avg. A. Size = {4} bytes", | 263 | "[ASSET CACHE]: Cached = {0}, Get = {1}, Hits = {2}%, Size = {3} bytes, Avg. A. Size = {4} bytes", |
@@ -265,7 +265,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
265 | m_getCount, | 265 | m_getCount, |
266 | ((double) m_hitCount / m_getCount) * 100.0, | 266 | ((double) m_hitCount / m_getCount) * 100.0, |
267 | m_cache.Size, | 267 | m_cache.Size, |
268 | m_cache.Size / m_cache.Count ); | 268 | m_cache.Size / m_cache.Count); |
269 | m_getCount = 0; | 269 | m_getCount = 0; |
270 | m_hitCount = 0; | 270 | m_hitCount = 0; |
271 | m_cachedCount = 0; | 271 | m_cachedCount = 0; |
@@ -292,10 +292,10 @@ namespace OpenSim.Region.CoreModules.Asset | |||
292 | /// <param name="scene"> | 292 | /// <param name="scene"> |
293 | /// Region's scene. | 293 | /// Region's scene. |
294 | /// </param> | 294 | /// </param> |
295 | public void AddRegion( Scene scene ) | 295 | public void AddRegion(Scene scene) |
296 | { | 296 | { |
297 | if( m_enabled ) | 297 | if (m_enabled) |
298 | scene.RegisterModuleInterface<IImprovedAssetCache>( this ); | 298 | scene.RegisterModuleInterface<IImprovedAssetCache>(this); |
299 | } | 299 | } |
300 | 300 | ||
301 | /// <summary> | 301 | /// <summary> |
@@ -314,19 +314,19 @@ namespace OpenSim.Region.CoreModules.Asset | |||
314 | /// <param name="source"> | 314 | /// <param name="source"> |
315 | /// Configuration source. | 315 | /// Configuration source. |
316 | /// </param> | 316 | /// </param> |
317 | public void Initialise( IConfigSource source ) | 317 | public void Initialise(IConfigSource source) |
318 | { | 318 | { |
319 | m_cache = null; | 319 | m_cache = null; |
320 | m_enabled = false; | 320 | m_enabled = false; |
321 | 321 | ||
322 | IConfig moduleConfig = source.Configs[ "Modules" ]; | 322 | IConfig moduleConfig = source.Configs[ "Modules" ]; |
323 | if( moduleConfig == null ) | 323 | if (moduleConfig == null) |
324 | return; | 324 | return; |
325 | 325 | ||
326 | string name = moduleConfig.GetString( "AssetCaching" ); | 326 | string name = moduleConfig.GetString("AssetCaching"); |
327 | Log.DebugFormat( "[XXX] name = {0} (this module's name: {1}", name, Name ); | 327 | Log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name); |
328 | 328 | ||
329 | if( name != Name ) | 329 | if (name != Name) |
330 | return; | 330 | return; |
331 | 331 | ||
332 | // This module is used | 332 | // This module is used |
@@ -335,19 +335,19 @@ namespace OpenSim.Region.CoreModules.Asset | |||
335 | TimeSpan expirationTime = DefaultExpirationTime; | 335 | TimeSpan expirationTime = DefaultExpirationTime; |
336 | 336 | ||
337 | IConfig assetConfig = source.Configs[ "AssetCache" ]; | 337 | IConfig assetConfig = source.Configs[ "AssetCache" ]; |
338 | if( assetConfig != null ) | 338 | if (assetConfig != null) |
339 | { | 339 | { |
340 | // Get optional configurations | 340 | // Get optional configurations |
341 | maxSize = assetConfig.GetLong( "MaxSize", DefaultMaxSize ); | 341 | maxSize = assetConfig.GetLong("MaxSize", DefaultMaxSize); |
342 | maxCount = assetConfig.GetInt( "MaxCount", DefaultMaxCount ); | 342 | maxCount = assetConfig.GetInt("MaxCount", DefaultMaxCount); |
343 | expirationTime = | 343 | expirationTime = |
344 | TimeSpan.FromMinutes( assetConfig.GetInt( "ExpirationTime", (int) DefaultExpirationTime.TotalMinutes ) ); | 344 | TimeSpan.FromMinutes(assetConfig.GetInt("ExpirationTime", (int) DefaultExpirationTime.TotalMinutes)); |
345 | 345 | ||
346 | // Debugging purposes only | 346 | // Debugging purposes only |
347 | m_debugEpoch = assetConfig.GetInt( "DebugEpoch", 0 ); | 347 | m_debugEpoch = assetConfig.GetInt("DebugEpoch", 0); |
348 | } | 348 | } |
349 | 349 | ||
350 | Initialize( maxSize, maxCount, expirationTime ); | 350 | Initialize(maxSize, maxCount, expirationTime); |
351 | } | 351 | } |
352 | 352 | ||
353 | /// <summary> | 353 | /// <summary> |
@@ -381,7 +381,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
381 | /// The extra function stub is just that much cleaner. | 381 | /// The extra function stub is just that much cleaner. |
382 | /// </para> | 382 | /// </para> |
383 | /// </remarks> | 383 | /// </remarks> |
384 | public void RegionLoaded( Scene scene ) | 384 | public void RegionLoaded(Scene scene) |
385 | { | 385 | { |
386 | } | 386 | } |
387 | 387 | ||
@@ -391,7 +391,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
391 | /// <param name="scene"> | 391 | /// <param name="scene"> |
392 | /// Region scene that is being removed. | 392 | /// Region scene that is being removed. |
393 | /// </param> | 393 | /// </param> |
394 | public void RemoveRegion( Scene scene ) | 394 | public void RemoveRegion(Scene scene) |
395 | { | 395 | { |
396 | } | 396 | } |
397 | 397 | ||
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 9540bd4..b7c269d 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | |||
@@ -230,7 +230,7 @@ namespace Flotsam.RegionModules.AssetCache | |||
230 | 230 | ||
231 | private void UpdateMemoryCache(string key, AssetBase asset) | 231 | private void UpdateMemoryCache(string key, AssetBase asset) |
232 | { | 232 | { |
233 | if( m_MemoryCacheEnabled ) | 233 | if (m_MemoryCacheEnabled) |
234 | { | 234 | { |
235 | if (m_MemoryExpiration > TimeSpan.Zero) | 235 | if (m_MemoryExpiration > TimeSpan.Zero) |
236 | { | 236 | { |
@@ -404,7 +404,7 @@ namespace Flotsam.RegionModules.AssetCache | |||
404 | File.Delete(filename); | 404 | File.Delete(filename); |
405 | } | 405 | } |
406 | 406 | ||
407 | if( m_MemoryCacheEnabled ) | 407 | if (m_MemoryCacheEnabled) |
408 | m_MemoryCache.Remove(id); | 408 | m_MemoryCache.Remove(id); |
409 | } | 409 | } |
410 | catch (Exception e) | 410 | catch (Exception e) |
@@ -423,7 +423,7 @@ namespace Flotsam.RegionModules.AssetCache | |||
423 | Directory.Delete(dir); | 423 | Directory.Delete(dir); |
424 | } | 424 | } |
425 | 425 | ||
426 | if( m_MemoryCacheEnabled ) | 426 | if (m_MemoryCacheEnabled) |
427 | m_MemoryCache.Clear(); | 427 | m_MemoryCache.Clear(); |
428 | } | 428 | } |
429 | 429 | ||
diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index a547df5..8c3d993 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs | |||
@@ -332,7 +332,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
332 | 332 | ||
333 | UUID oldID = UUID.Zero; | 333 | UUID oldID = UUID.Zero; |
334 | 334 | ||
335 | lock(part) | 335 | lock (part) |
336 | { | 336 | { |
337 | // mostly keep the values from before | 337 | // mostly keep the values from before |
338 | Primitive.TextureEntry tmptex = part.Shape.Textures; | 338 | Primitive.TextureEntry tmptex = part.Shape.Textures; |
@@ -340,7 +340,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
340 | // remove the old asset from the cache | 340 | // remove the old asset from the cache |
341 | oldID = tmptex.DefaultTexture.TextureID; | 341 | oldID = tmptex.DefaultTexture.TextureID; |
342 | 342 | ||
343 | if(Face == ALL_SIDES) | 343 | if (Face == ALL_SIDES) |
344 | { | 344 | { |
345 | tmptex.DefaultTexture.TextureID = asset.FullID; | 345 | tmptex.DefaultTexture.TextureID = asset.FullID; |
346 | } | 346 | } |
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 036c4b8..d786df8 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -243,7 +243,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
243 | 243 | ||
244 | 244 | ||
245 | string grant = myConfig.GetString("GrantLSL",""); | 245 | string grant = myConfig.GetString("GrantLSL",""); |
246 | if(grant.Length > 0) { | 246 | if (grant.Length > 0) { |
247 | foreach (string uuidl in grant.Split(',')) { | 247 | foreach (string uuidl in grant.Split(',')) { |
248 | string uuid = uuidl.Trim(" \t".ToCharArray()); | 248 | string uuid = uuidl.Trim(" \t".ToCharArray()); |
249 | GrantLSL.Add(uuid, true); | 249 | GrantLSL.Add(uuid, true); |
@@ -251,7 +251,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
251 | } | 251 | } |
252 | 252 | ||
253 | grant = myConfig.GetString("GrantCS",""); | 253 | grant = myConfig.GetString("GrantCS",""); |
254 | if(grant.Length > 0) { | 254 | if (grant.Length > 0) { |
255 | foreach (string uuidl in grant.Split(',')) { | 255 | foreach (string uuidl in grant.Split(',')) { |
256 | string uuid = uuidl.Trim(" \t".ToCharArray()); | 256 | string uuid = uuidl.Trim(" \t".ToCharArray()); |
257 | GrantCS.Add(uuid, true); | 257 | GrantCS.Add(uuid, true); |
@@ -259,7 +259,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
259 | } | 259 | } |
260 | 260 | ||
261 | grant = myConfig.GetString("GrantVB",""); | 261 | grant = myConfig.GetString("GrantVB",""); |
262 | if(grant.Length > 0) { | 262 | if (grant.Length > 0) { |
263 | foreach (string uuidl in grant.Split(',')) { | 263 | foreach (string uuidl in grant.Split(',')) { |
264 | string uuid = uuidl.Trim(" \t".ToCharArray()); | 264 | string uuid = uuidl.Trim(" \t".ToCharArray()); |
265 | GrantVB.Add(uuid, true); | 265 | GrantVB.Add(uuid, true); |
@@ -267,7 +267,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
267 | } | 267 | } |
268 | 268 | ||
269 | grant = myConfig.GetString("GrantJS",""); | 269 | grant = myConfig.GetString("GrantJS",""); |
270 | if(grant.Length > 0) { | 270 | if (grant.Length > 0) { |
271 | foreach (string uuidl in grant.Split(',')) { | 271 | foreach (string uuidl in grant.Split(',')) { |
272 | string uuid = uuidl.Trim(" \t".ToCharArray()); | 272 | string uuid = uuidl.Trim(" \t".ToCharArray()); |
273 | GrantJS.Add(uuid, true); | 273 | GrantJS.Add(uuid, true); |
@@ -563,7 +563,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
563 | } | 563 | } |
564 | 564 | ||
565 | // Group permissions | 565 | // Group permissions |
566 | if ( ( task.GroupID != UUID.Zero) && IsGroupMember(task.GroupID, user, 0) ) | 566 | if ((task.GroupID != UUID.Zero) && IsGroupMember(task.GroupID, user, 0)) |
567 | return objectGroupMask; | 567 | return objectGroupMask; |
568 | 568 | ||
569 | return objectEveryoneMask; | 569 | return objectEveryoneMask; |
@@ -650,7 +650,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
650 | } | 650 | } |
651 | 651 | ||
652 | // Group members should be able to edit group objects | 652 | // Group members should be able to edit group objects |
653 | if ( (group.GroupID != UUID.Zero) && ((m_scene.GetSceneObjectPart(objId).GroupMask & (uint)PermissionMask.Modify) != 0) && IsGroupMember(group.GroupID, currentUser, 0) ) | 653 | if ((group.GroupID != UUID.Zero) && ((m_scene.GetSceneObjectPart(objId).GroupMask & (uint)PermissionMask.Modify) != 0) && IsGroupMember(group.GroupID, currentUser, 0)) |
654 | { | 654 | { |
655 | // Return immediately, so that the administrator can shares group objects | 655 | // Return immediately, so that the administrator can shares group objects |
656 | return true; | 656 | return true; |
@@ -731,7 +731,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
731 | permission = true; | 731 | permission = true; |
732 | } | 732 | } |
733 | 733 | ||
734 | if( ( parcel.landData.GroupID != UUID.Zero) && IsGroupMember(parcel.landData.GroupID, user, groupPowers) ) | 734 | if ((parcel.landData.GroupID != UUID.Zero) && IsGroupMember(parcel.landData.GroupID, user, groupPowers)) |
735 | { | 735 | { |
736 | permission = true; | 736 | permission = true; |
737 | } | 737 | } |
@@ -758,7 +758,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
758 | permission = true; | 758 | permission = true; |
759 | } | 759 | } |
760 | 760 | ||
761 | if( parcel.landData.IsGroupOwned && IsGroupMember(parcel.landData.GroupID, user, groupPowers) ) | 761 | if (parcel.landData.IsGroupOwned && IsGroupMember(parcel.landData.GroupID, user, groupPowers)) |
762 | { | 762 | { |
763 | permission = true; | 763 | permission = true; |
764 | } | 764 | } |
@@ -982,7 +982,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
982 | if (part.GroupID == UUID.Zero) | 982 | if (part.GroupID == UUID.Zero) |
983 | return false; | 983 | return false; |
984 | 984 | ||
985 | if( !IsGroupMember(part.GroupID, user, 0) ) | 985 | if (!IsGroupMember(part.GroupID, user, 0)) |
986 | return false; | 986 | return false; |
987 | 987 | ||
988 | if ((part.GroupMask & (uint)PermissionMask.Modify) == 0) | 988 | if ((part.GroupMask & (uint)PermissionMask.Modify) == 0) |
@@ -1002,7 +1002,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1002 | if (ti.GroupID == UUID.Zero) | 1002 | if (ti.GroupID == UUID.Zero) |
1003 | return false; | 1003 | return false; |
1004 | 1004 | ||
1005 | if( !IsGroupMember(ti.GroupID, user, 0) ) | 1005 | if (!IsGroupMember(ti.GroupID, user, 0)) |
1006 | return false; | 1006 | return false; |
1007 | } | 1007 | } |
1008 | 1008 | ||
@@ -1411,7 +1411,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1411 | if (part.GroupID == UUID.Zero) | 1411 | if (part.GroupID == UUID.Zero) |
1412 | return false; | 1412 | return false; |
1413 | 1413 | ||
1414 | if( !IsGroupMember(part.GroupID, user, 0) ) | 1414 | if (!IsGroupMember(part.GroupID, user, 0)) |
1415 | return false; | 1415 | return false; |
1416 | 1416 | ||
1417 | if ((part.GroupMask & (uint)PermissionMask.Modify) == 0) | 1417 | if ((part.GroupMask & (uint)PermissionMask.Modify) == 0) |
@@ -1431,7 +1431,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1431 | if (ti.GroupID == UUID.Zero) | 1431 | if (ti.GroupID == UUID.Zero) |
1432 | return false; | 1432 | return false; |
1433 | 1433 | ||
1434 | if( !IsGroupMember(ti.GroupID, user, 0) ) | 1434 | if (!IsGroupMember(ti.GroupID, user, 0)) |
1435 | return false; | 1435 | return false; |
1436 | } | 1436 | } |
1437 | 1437 | ||
@@ -1504,7 +1504,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1504 | if (part.GroupID == UUID.Zero) | 1504 | if (part.GroupID == UUID.Zero) |
1505 | return false; | 1505 | return false; |
1506 | 1506 | ||
1507 | if( !IsGroupMember(part.GroupID, user, 0) ) | 1507 | if (!IsGroupMember(part.GroupID, user, 0)) |
1508 | return false; | 1508 | return false; |
1509 | } | 1509 | } |
1510 | 1510 | ||
@@ -1521,7 +1521,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1521 | if (ti.GroupID == UUID.Zero) | 1521 | if (ti.GroupID == UUID.Zero) |
1522 | return false; | 1522 | return false; |
1523 | 1523 | ||
1524 | if( !IsGroupMember(ti.GroupID, user, 0) ) | 1524 | if (!IsGroupMember(ti.GroupID, user, 0)) |
1525 | return false; | 1525 | return false; |
1526 | } | 1526 | } |
1527 | 1527 | ||
@@ -1744,24 +1744,24 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1744 | 1744 | ||
1745 | private bool CanCompileScript(UUID ownerUUID, int scriptType, Scene scene) { | 1745 | private bool CanCompileScript(UUID ownerUUID, int scriptType, Scene scene) { |
1746 | //m_log.DebugFormat("check if {0} is allowed to compile {1}", ownerUUID, scriptType); | 1746 | //m_log.DebugFormat("check if {0} is allowed to compile {1}", ownerUUID, scriptType); |
1747 | switch(scriptType) { | 1747 | switch (scriptType) { |
1748 | case 0: | 1748 | case 0: |
1749 | if(GrantLSL.Count == 0 || GrantLSL.ContainsKey(ownerUUID.ToString())) { | 1749 | if (GrantLSL.Count == 0 || GrantLSL.ContainsKey(ownerUUID.ToString())) { |
1750 | return(true); | 1750 | return(true); |
1751 | } | 1751 | } |
1752 | break; | 1752 | break; |
1753 | case 1: | 1753 | case 1: |
1754 | if(GrantCS.Count == 0 || GrantCS.ContainsKey(ownerUUID.ToString())) { | 1754 | if (GrantCS.Count == 0 || GrantCS.ContainsKey(ownerUUID.ToString())) { |
1755 | return(true); | 1755 | return(true); |
1756 | } | 1756 | } |
1757 | break; | 1757 | break; |
1758 | case 2: | 1758 | case 2: |
1759 | if(GrantVB.Count == 0 || GrantVB.ContainsKey(ownerUUID.ToString())) { | 1759 | if (GrantVB.Count == 0 || GrantVB.ContainsKey(ownerUUID.ToString())) { |
1760 | return(true); | 1760 | return(true); |
1761 | } | 1761 | } |
1762 | break; | 1762 | break; |
1763 | case 3: | 1763 | case 3: |
1764 | if(GrantJS.Count == 0 || GrantJS.ContainsKey(ownerUUID.ToString())) { | 1764 | if (GrantJS.Count == 0 || GrantJS.ContainsKey(ownerUUID.ToString())) { |
1765 | return(true); | 1765 | return(true); |
1766 | } | 1766 | } |
1767 | break; | 1767 | break; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index a2a7392..8e3c688 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1526,14 +1526,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1526 | return; | 1526 | return; |
1527 | 1527 | ||
1528 | if (part.OwnerID != remoteClient.AgentId) | 1528 | if (part.OwnerID != remoteClient.AgentId) |
1529 | { | 1529 | { |
1530 | // Group permissions | 1530 | // Group permissions |
1531 | if ( (part.GroupID == UUID.Zero) || (remoteClient.GetGroupPowers(part.GroupID) == 0) || ((part.GroupMask & (uint)PermissionMask.Modify) == 0) ) | 1531 | if ((part.GroupID == UUID.Zero) || (remoteClient.GetGroupPowers(part.GroupID) == 0) || ((part.GroupMask & (uint)PermissionMask.Modify) == 0)) |
1532 | return; | 1532 | return; |
1533 | } else { | 1533 | } else { |
1534 | if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) | 1534 | if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) |
1535 | return; | 1535 | return; |
1536 | } | 1536 | } |
1537 | 1537 | ||
1538 | if (!Permissions.CanCreateObjectInventory( | 1538 | if (!Permissions.CanCreateObjectInventory( |
1539 | itemBase.InvType, part.UUID, remoteClient.AgentId)) | 1539 | itemBase.InvType, part.UUID, remoteClient.AgentId)) |
@@ -1602,18 +1602,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
1602 | destId); | 1602 | destId); |
1603 | return; | 1603 | return; |
1604 | } | 1604 | } |
1605 | 1605 | ||
1606 | // Must own the object, and have modify rights | 1606 | // Must own the object, and have modify rights |
1607 | if (srcPart.OwnerID != destPart.OwnerID) | 1607 | if (srcPart.OwnerID != destPart.OwnerID) |
1608 | { | 1608 | { |
1609 | // Group permissions | 1609 | // Group permissions |
1610 | if ( (destPart.GroupID == UUID.Zero) || (destPart.GroupID != srcPart.GroupID) || | 1610 | if ((destPart.GroupID == UUID.Zero) || (destPart.GroupID != srcPart.GroupID) || |
1611 | ((destPart.GroupMask & (uint)PermissionMask.Modify) == 0) ) | 1611 | ((destPart.GroupMask & (uint)PermissionMask.Modify) == 0)) |
1612 | return; | 1612 | return; |
1613 | } else { | 1613 | } else { |
1614 | if ((destPart.OwnerMask & (uint)PermissionMask.Modify) == 0) | 1614 | if ((destPart.OwnerMask & (uint)PermissionMask.Modify) == 0) |
1615 | return; | 1615 | return; |
1616 | } | 1616 | } |
1617 | 1617 | ||
1618 | if (destPart.ScriptAccessPin != pin) | 1618 | if (destPart.ScriptAccessPin != pin) |
1619 | { | 1619 | { |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 9cfc84f..d18af46 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -136,7 +136,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
136 | { | 136 | { |
137 | m_AssetService = RequestModuleInterface<IAssetService>(); | 137 | m_AssetService = RequestModuleInterface<IAssetService>(); |
138 | 138 | ||
139 | if( m_AssetService == null ) | 139 | if (m_AssetService == null) |
140 | { | 140 | { |
141 | throw new Exception("No IAssetService available."); | 141 | throw new Exception("No IAssetService available."); |
142 | } | 142 | } |
@@ -1097,7 +1097,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1097 | 1097 | ||
1098 | IMessageTransferModule tr = RequestModuleInterface<IMessageTransferModule>(); | 1098 | IMessageTransferModule tr = RequestModuleInterface<IMessageTransferModule>(); |
1099 | if (tr != null) | 1099 | if (tr != null) |
1100 | tr.SendInstantMessage(msg, delegate(bool success) {} ); | 1100 | tr.SendInstantMessage(msg, delegate(bool success) {}); |
1101 | } | 1101 | } |
1102 | m_returns.Clear(); | 1102 | m_returns.Clear(); |
1103 | } | 1103 | } |
@@ -1465,7 +1465,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1465 | 1465 | ||
1466 | foreach (SceneObjectPart part in group.Children.Values) | 1466 | foreach (SceneObjectPart part in group.Children.Values) |
1467 | { | 1467 | { |
1468 | if (part.IsJoint() && ((part.ObjectFlags&(uint)PrimFlags.Physics) != 0) ) | 1468 | if (part.IsJoint() && ((part.ObjectFlags&(uint)PrimFlags.Physics) != 0)) |
1469 | { | 1469 | { |
1470 | PhysicsScene.RequestJointDeletion(part.Name); // FIXME: what if the name changed? | 1470 | PhysicsScene.RequestJointDeletion(part.Name); // FIXME: what if the name changed? |
1471 | } | 1471 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index 911da5b..5c7ce43 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs | |||
@@ -342,13 +342,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
342 | throw new Exception(errtext); | 342 | throw new Exception(errtext); |
343 | } | 343 | } |
344 | 344 | ||
345 | if(m_scriptEngine.World.Permissions.CanCompileScript(ownerUUID, (int)l) == false) { | 345 | if (m_scriptEngine.World.Permissions.CanCompileScript(ownerUUID, (int)l) == false) { |
346 | // Not allowed to compile to this language! | 346 | // Not allowed to compile to this language! |
347 | string errtext = String.Empty; | 347 | string errtext = String.Empty; |
348 | errtext += ownerUUID + " is not in list of allowed users for this scripting language. Script will not be executed!"; | 348 | errtext += ownerUUID + " is not in list of allowed users for this scripting language. Script will not be executed!"; |
349 | throw new Exception(errtext); | 349 | throw new Exception(errtext); |
350 | } | 350 | } |
351 | 351 | ||
352 | string compileScript = Script; | 352 | string compileScript = Script; |
353 | 353 | ||
354 | if (l == enumCompileType.lsl) | 354 | if (l == enumCompileType.lsl) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs index 5dfbdbc..3ca7f7c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs | |||
@@ -135,8 +135,8 @@ state another_state | |||
135 | [Test] | 135 | [Test] |
136 | public void TestLoneIdent() | 136 | public void TestLoneIdent() |
137 | { | 137 | { |
138 | // A lone ident should be removed completely as it's an error in C# | 138 | // A lone ident should be removed completely as it's an error in C# |
139 | // (MONO at least). | 139 | // (MONO at least). |
140 | string input = @"default | 140 | string input = @"default |
141 | { | 141 | { |
142 | touch_start(integer num_detected) | 142 | touch_start(integer num_detected) |
@@ -150,7 +150,7 @@ state another_state | |||
150 | "\n public void default_event_touch_start(LSL_Types.LSLInteger num_detected)" + | 150 | "\n public void default_event_touch_start(LSL_Types.LSLInteger num_detected)" + |
151 | "\n {" + | 151 | "\n {" + |
152 | "\n LSL_Types.LSLInteger x = new LSL_Types.LSLInteger(0);" + | 152 | "\n LSL_Types.LSLInteger x = new LSL_Types.LSLInteger(0);" + |
153 | "\n ;" + | 153 | "\n ;" + |
154 | "\n }\n"; | 154 | "\n }\n"; |
155 | 155 | ||
156 | CSCodeGenerator cg = new CSCodeGenerator(); | 156 | CSCodeGenerator cg = new CSCodeGenerator(); |