From dde21314e75acdaeff27af70077f283493401961 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Fri, 15 Aug 2008 10:24:04 +0000 Subject: [PATCH] Update svn properties, formatting cleanup, fix a couple compiler warnings. --- .../Rest/Regions/GETHandler.cs | 8 ++- OpenSim/Framework/Cache.cs | 58 +++++++++---------- OpenSim/Grid/UserServer/UserLoginService.cs | 2 +- .../ClientStack/LindenUDP/LLClientView.cs | 2 +- .../Local/LocalBackEndServices.cs | 8 ++- .../Communications/OGS1/OGS1UserServices.cs | 14 +++-- .../World/Permissions/PermissionsModule.cs | 4 +- .../TreePopulator/TreePopulatorModule.cs | 12 ++-- OpenSim/Region/Environment/Scenes/Scene.cs | 14 ++--- .../Environment/Scenes/ScenePresence.cs | 22 ++++--- .../Common/LSL_BuiltIn_Commands.cs | 2 +- .../ScriptEngineBase/EventQueueThreadClass.cs | 2 +- .../Shared/Api/Implementation/LSL_Api.cs | 2 +- 13 files changed, 80 insertions(+), 70 deletions(-) diff --git a/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs b/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs index e5ec94b71f..ce564ddd9a 100644 --- a/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs +++ b/OpenSim/ApplicationPlugins/Rest/Regions/GETHandler.cs @@ -133,7 +133,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions return XmlWriterResult; } - if (2 == comps.Length) { + if (2 == comps.Length) + { string resp = ShortRegionInfo(comps[1], details[comps[1]]); if (null != resp) return resp; @@ -153,7 +154,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions } } - if (3 == comps.Length) { + if (3 == comps.Length) + { switch (comps[1].ToLower()) { case "prims": @@ -166,7 +168,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions min = new LLVector3((float)Double.Parse(subregion[0]), (float)Double.Parse(subregion[1]), (float)Double.Parse(subregion[2])); max = new LLVector3((float)Double.Parse(subregion[3]), (float)Double.Parse(subregion[4]), (float)Double.Parse(subregion[5])); } - catch (Exception e) + catch (Exception) { return Failure(httpResponse, OSHttpStatusCode.ClientErrorBadRequest, "GET", "invalid subregion parameter"); diff --git a/OpenSim/Framework/Cache.cs b/OpenSim/Framework/Cache.cs index 8d93d3efe2..4746d3c4b4 100644 --- a/OpenSim/Framework/Cache.cs +++ b/OpenSim/Framework/Cache.cs @@ -173,8 +173,8 @@ namespace Opensim.Framework public class Cache { private List m_Index = new List(); - private Dictionary m_Lookup = - new Dictionary(); + private Dictionary m_Lookup = + new Dictionary(); private CacheStrategy m_Strategy; private CacheMedium m_Medium; @@ -270,10 +270,10 @@ namespace Opensim.Framework m_Index.RemoveRange(newSize, Count - newSize); m_Size = newSize; - m_Lookup.Clear(); + m_Lookup.Clear(); - foreach (CacheItemBase item in m_Index) - m_Lookup[item.uuid] = item; + foreach (CacheItemBase item in m_Index) + m_Lookup[item.uuid] = item; } } @@ -291,8 +291,8 @@ namespace Opensim.Framework lock (m_Index) { - if(m_Lookup.ContainsKey(index)) - item = m_Lookup[index]; + if (m_Lookup.ContainsKey(index)) + item = m_Lookup[index]; } if (item == null) @@ -340,10 +340,10 @@ namespace Opensim.Framework { CacheItemBase missing = new CacheItemBase(index); if (!m_Index.Contains(missing)) - { + { m_Index.Add(missing); - m_Lookup[index] = missing; - } + m_Lookup[index] = missing; + } } } return null; @@ -354,17 +354,17 @@ namespace Opensim.Framework return data; } - // Find an object in cache by delegate. - // - public Object Find(Predicate d) - { - CacheItemBase item = m_Index.Find(d); + // Find an object in cache by delegate. + // + public Object Find(Predicate d) + { + CacheItemBase item = m_Index.Find(d); - if(item == null) - return null; + if (item == null) + return null; - return item.Retrieve(); - } + return item.Retrieve(); + } public virtual void Store(LLUUID index, Object data) { @@ -421,7 +421,7 @@ namespace Opensim.Framework item.expires = DateTime.Now + m_DefaultTTL; m_Index.Add(item); - m_Lookup[index] = item; + m_Lookup[index] = item; } item.Store(data); } @@ -439,10 +439,10 @@ namespace Opensim.Framework { if (item.expires.Ticks == 0 || item.expires <= now) - { + { m_Index.Remove(item); - m_Lookup.Remove(item.uuid); - } + m_Lookup.Remove(item.uuid); + } } } @@ -471,20 +471,20 @@ namespace Opensim.Framework foreach (CacheItemBase i in candidates) { if (doExpire(i.uuid)) - { + { m_Index.Remove(i); - m_Lookup.Remove(i.uuid); - } + m_Lookup.Remove(i.uuid); + } } } else { m_Index.RemoveRange(target, Count - target); - m_Lookup.Clear(); + m_Lookup.Clear(); - foreach (CacheItemBase item in m_Index) - m_Lookup[item.uuid] = item; + foreach (CacheItemBase item in m_Index) + m_Lookup[item.uuid] = item; } } break; diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index 2a70534242..0e61b3cd6d 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs @@ -153,7 +153,7 @@ namespace OpenSim.Grid.UserServer else if (startLocationRequest == "home") { // use the homeRegionID if it is stored already. If not, use the regionHandle as before - if(theUser.HomeRegionID != LLUUID.Zero) + if (theUser.HomeRegionID != LLUUID.Zero) { SimInfo = RegionProfileData.RequestSimProfileData( diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index bfc7b41df7..74f4d4467a 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -2669,7 +2669,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP EstateCovenantReplyPacket.DataBlock edata = new EstateCovenantReplyPacket.DataBlock(); edata.CovenantID = covenant; edata.CovenantTimestamp = 0; - if(m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero) + if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero) edata.EstateOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; else edata.EstateOwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs index a608da09aa..5cf62f3d64 100644 --- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs +++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs @@ -175,9 +175,10 @@ namespace OpenSim.Region.Communications.Local public RegionInfo RequestNeighbourInfo(LLUUID regionID) { // TODO add a dictionary for faster lookup - foreach(RegionInfo info in m_regions.Values) + foreach (RegionInfo info in m_regions.Values) { - if(info.RegionID == regionID) return info; + if (info.RegionID == regionID) + return info; } return null; } @@ -186,7 +187,8 @@ namespace OpenSim.Region.Communications.Local { foreach (RegionInfo regInfo in m_regions.Values) { - if (regInfo.RegionName == regionName) return regInfo; + if (regInfo.RegionName == regionName) + return regInfo; } return null; } diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs index ee5c7bbf85..01b19332a4 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs @@ -75,8 +75,10 @@ namespace OpenSim.Region.Communications.OGS1 userData.Image = new LLUUID((string) data["profile_image"]); userData.LastLogin = Convert.ToInt32((string) data["profile_lastlogin"]); userData.HomeRegion = Convert.ToUInt64((string) data["home_region"]); - if(data.Contains("home_region_id")) userData.HomeRegionID = new LLUUID((string)data["home_region_id"]); - else userData.HomeRegionID = LLUUID.Zero; + if (data.Contains("home_region_id")) + userData.HomeRegionID = new LLUUID((string)data["home_region_id"]); + else + userData.HomeRegionID = LLUUID.Zero; userData.HomeLocation = new LLVector3((float) Convert.ToDecimal((string) data["home_coordinates_x"]), (float) Convert.ToDecimal((string) data["home_coordinates_y"]), @@ -85,10 +87,10 @@ namespace OpenSim.Region.Communications.OGS1 new LLVector3((float) Convert.ToDecimal((string) data["home_look_x"]), (float) Convert.ToDecimal((string) data["home_look_y"]), (float) Convert.ToDecimal((string) data["home_look_z"])); - if(data.Contains("user_flags")) - userData.UserFlags = Convert.ToInt32((string) data["user_flags"]); - if(data.Contains("god_level")) - userData.GodLevel = Convert.ToInt32((string) data["god_level"]); + if (data.Contains("user_flags")) + userData.UserFlags = Convert.ToInt32((string) data["user_flags"]); + if (data.Contains("god_level")) + userData.GodLevel = Convert.ToInt32((string) data["god_level"]); return userData; } diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs index 25ea282755..0fbd4fb752 100644 --- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs @@ -238,12 +238,12 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions // If there is no master avatar, return false if (m_scene.RegionInfo.MasterAvatarAssignedUUID != LLUUID.Zero) { - if(m_scene.RegionInfo.MasterAvatarAssignedUUID == user) + if (m_scene.RegionInfo.MasterAvatarAssignedUUID == user) return true; } if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero) { - if(m_scene.RegionInfo.EstateSettings.EstateOwner == user) + if (m_scene.RegionInfo.EstateSettings.EstateOwner == user) return true; } diff --git a/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs b/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs index cb69b47db7..98b3bf8fc0 100644 --- a/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs +++ b/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs @@ -98,9 +98,9 @@ namespace OpenSim.Region.Environment.Modules.World.TreePopulator { if (args[0] == "tree") { - LLUUID uuid = m_scene.RegionInfo.EstateSettings.EstateOwner; - if(uuid == LLUUID.Zero) - uuid = m_scene.RegionInfo.MasterAvatarAssignedUUID; + LLUUID uuid = m_scene.RegionInfo.EstateSettings.EstateOwner; + if (uuid == LLUUID.Zero) + uuid = m_scene.RegionInfo.MasterAvatarAssignedUUID; m_log.Debug("[TREES]: New tree planting"); CreateTree(uuid, new LLVector3(128.0f, 128.0f, 0.0f)); } @@ -223,9 +223,9 @@ namespace OpenSim.Region.Environment.Modules.World.TreePopulator position.X += (float) randX; position.Y += (float) randY; - LLUUID uuid = m_scene.RegionInfo.EstateSettings.EstateOwner; - if(uuid == LLUUID.Zero) - uuid = m_scene.RegionInfo.MasterAvatarAssignedUUID; + LLUUID uuid = m_scene.RegionInfo.EstateSettings.EstateOwner; + if (uuid == LLUUID.Zero) + uuid = m_scene.RegionInfo.MasterAvatarAssignedUUID; CreateTree(uuid, position); } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 4e7e76479d..22251e969a 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -2122,10 +2122,10 @@ namespace OpenSim.Region.Environment.Scenes LLVector3 homePostion = new LLVector3(UserProfile.HomeLocationX,UserProfile.HomeLocationY,UserProfile.HomeLocationZ); LLVector3 homeLookat = new LLVector3(UserProfile.HomeLookAt); ulong homeRegionHandle = UserProfile.HomeRegion; - if(homeRegionID == LLUUID.Zero) + if (homeRegionID == LLUUID.Zero) { RegionInfo info = CommsManager.GridService.RequestNeighbourInfo(UserProfile.HomeRegion); - if(info == null) + if (info == null) { // can't find the region: Tell viewer and abort client.SendTeleportFailed("Your home-region could not be found."); @@ -2137,7 +2137,7 @@ namespace OpenSim.Region.Environment.Scenes else { RegionInfo info = CommsManager.GridService.RequestNeighbourInfo(homeRegionID); - if(info == null) + if (info == null) { // can't find the region: Tell viewer and abort client.SendTeleportFailed("Your home-region could not be found."); @@ -2762,7 +2762,7 @@ namespace OpenSim.Region.Environment.Scenes public void RequestTeleportLandmark(IClientAPI remoteClient, LLUUID regionID, LLVector3 position) { RegionInfo info = CommsManager.GridService.RequestNeighbourInfo(regionID); - if(info == null) + if (info == null) { // can't find the region: Tell viewer and abort remoteClient.SendTeleportFailed("The teleport destination could not be found."); @@ -3518,10 +3518,10 @@ namespace OpenSim.Region.Environment.Scenes // their scripts will actually run. // -- Leaf, Tue Aug 12 14:17:05 EDT 2008 SceneObjectPart parent = part.ParentGroup.RootPart; - if( parent != null && parent.IsAttachment ) - return scriptDanger(parent, parent.GetWorldPosition() ); + if (parent != null && parent.IsAttachment) + return scriptDanger(parent, parent.GetWorldPosition()); else - return scriptDanger(part, part.GetWorldPosition() ); + return scriptDanger(part, part.GetWorldPosition()); } else { diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 636d08cbdf..d8d534ebcb 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -1102,12 +1102,13 @@ namespace OpenSim.Region.Environment.Scenes // Get our own copy of the part array, and sort into the order we want to test SceneObjectPart[] partArray = targetPart.ParentGroup.GetParts(); - Array.Sort(partArray, delegate(SceneObjectPart p1, SceneObjectPart p2) { - // we want the originally selected part first, then the rest in link order -- so make the selected part link num (-1) - int linkNum1 = p1==targetPart ? -1 : p1.LinkNum; - int linkNum2 = p2==targetPart ? -1 : p2.LinkNum; - return linkNum1 - linkNum2; - } + Array.Sort(partArray, delegate(SceneObjectPart p1, SceneObjectPart p2) + { + // we want the originally selected part first, then the rest in link order -- so make the selected part link num (-1) + int linkNum1 = p1==targetPart ? -1 : p1.LinkNum; + int linkNum2 = p2==targetPart ? -1 : p2.LinkNum; + return linkNum1 - linkNum2; + } ); //look for prims with explicit sit targets that are available @@ -1772,7 +1773,8 @@ namespace OpenSim.Region.Environment.Scenes // Because appearance setting is in a module, we actually need // to give it access to our appearance directly, otherwise we // get a synchronization issue. - public AvatarAppearance Appearance { + public AvatarAppearance Appearance + { get { return m_appearance; } set { m_appearance = value; } } @@ -2789,7 +2791,8 @@ namespace OpenSim.Region.Environment.Scenes } // optimization; we have to check per script, but if nothing is pressed and nothing changed, we can skip that - if(allflags != ScriptControlled.CONTROL_ZERO || allflags != LastCommands) { + if (allflags != ScriptControlled.CONTROL_ZERO || allflags != LastCommands) + { lock (scriptedcontrols) { foreach (LLUUID scriptUUID in scriptedcontrols.Keys) @@ -2798,7 +2801,8 @@ namespace OpenSim.Region.Environment.Scenes ScriptControlled localHeld = allflags & scriptControlData.eventControls; // the flags interesting for us ScriptControlled localLast = LastCommands & scriptControlData.eventControls; // the activated controls in the last cycle ScriptControlled localChange = localHeld ^ localLast; // the changed bits - if(localHeld != ScriptControlled.CONTROL_ZERO || localChange != ScriptControlled.CONTROL_ZERO) { + if (localHeld != ScriptControlled.CONTROL_ZERO || localChange != ScriptControlled.CONTROL_ZERO) + { // only send if still pressed or just changed m_scene.EventManager.TriggerControlEvent(scriptControlData.objID, scriptUUID, UUID, (uint)localHeld, (uint)localChange); } diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index e1a4648978..f6cc7f0260 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -6907,7 +6907,7 @@ namespace OpenSim.Region.ScriptEngine.Common if (aList.Data[i] != null) { - switch((ParcelMediaCommandEnum)aList.Data[i]) + switch ((ParcelMediaCommandEnum) aList.Data[i]) { case ParcelMediaCommandEnum.Url: list.Add(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaURL); diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs index 7dfac62f15..255ab99a6a 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs @@ -43,7 +43,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase /// public class EventQueueThreadClass : iScriptEngineFunctionModule { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); /// /// How many ms to sleep if queue is empty diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6c4f34a119..825379d318 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -6662,7 +6662,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (aList.Data[i] != null) { - switch((ParcelMediaCommandEnum)aList.Data[i]) + switch ((ParcelMediaCommandEnum) aList.Data[i]) { case ParcelMediaCommandEnum.Url: list.Add(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaURL);