From c995d60d37032db3198b8496e186aa7a892dc7a8 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Wed, 14 May 2008 05:11:23 +0000 Subject: Formatting cleanup. --- .../Environment/Modules/Agent/Xfer/XferModule.cs | 2 +- .../Environment/Modules/World/Land/LandObject.cs | 2 +- .../Modules/World/Permissions/PermissionsModule.cs | 4 +- .../Environment/Modules/World/Sun/SunModule.cs | 70 ++++++++++------------ .../Region/Environment/Scenes/Scene.Inventory.cs | 4 +- .../Scenes/SceneCommunicationService.cs | 5 +- .../Environment/Scenes/SceneExternalChecks.cs | 2 +- OpenSim/Region/Environment/Scenes/SceneManager.cs | 2 +- .../Scenes/SceneObjectPart.Inventory.cs | 10 ++-- .../Region/Environment/Scenes/SceneObjectPart.cs | 4 +- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 2 +- 11 files changed, 51 insertions(+), 56 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs b/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs index c7ee233..1b50bbd 100644 --- a/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs +++ b/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs @@ -171,7 +171,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.Xfer { if (Data.Length < 1000) { - // for now (testing ) we only support files under 1000 bytes + // for now (testing) we only support files under 1000 bytes byte[] transferData = new byte[Data.Length + 4]; Array.Copy(Helpers.IntToBytes(Data.Length), 0, transferData, 0, 4); Array.Copy(Data, 0, transferData, 4, Data.Length); diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs index 0236e5f..b319370 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs @@ -278,7 +278,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land list.Add(entry.AgentID); } } - if(list.Count == 0) + if (list.Count == 0) { list.Add(LLUUID.Zero); } diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs index 2900b8c..44f5c2d 100644 --- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs @@ -220,7 +220,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions } protected void DebugPermissionInformation(string permissionCalled) { - if(m_debugPermissions) + if (m_debugPermissions) m_log.Info("[PERMISSIONS]: " + permissionCalled + " was called from " + m_scene.RegionInfo.RegionName); } @@ -240,7 +240,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions if (user != LLUUID.Zero) { LLUUID[] estatemanagers = m_scene.RegionInfo.EstateSettings.estateManagers; - foreach(LLUUID estatemanager in estatemanagers) + foreach (LLUUID estatemanager in estatemanagers) { if (estatemanager == user) return true; diff --git a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs index 0314562..beb74ce 100644 --- a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs @@ -65,7 +65,7 @@ namespace OpenSim.Region.Environment.Modules private double d_day_length = 4; // A VW day is 4 RW hours long private int d_year_length = 60; // There are 60 VW days in a VW year private double d_day_night = 0.45; // axis offset: ratio of light-to-dark, approx 1:3 - private double d_longitude = -73.53; + private double d_longitude = -73.53; private double d_latitude = 41.29; // Frame counter @@ -155,48 +155,44 @@ namespace OpenSim.Region.Environment.Modules m_longitude = d_longitude; } - switch(m_mode) + switch (m_mode) { + case "T1": + default: + case "SL": + // Time taken to complete a cycle (day and season) - case "T1" : + SecondsPerSunCycle = (uint) (m_day_length * 60 * 60); + SecondsPerYear = (uint) (SecondsPerSunCycle*m_year_length); - default : + // Ration of real-to-virtual time - case "SL" : - // Time taken to complete a cycle (day and season) + VWTimeRatio = 24/m_day_length; - SecondsPerSunCycle = (uint) (m_day_length * 60 * 60); - SecondsPerYear = (uint) (SecondsPerSunCycle*m_year_length); + // Speed of rotation needed to complete a cycle in the + // designated period (day and season) - // Ration of real-to-virtual time + SunSpeed = SunCycle/SecondsPerSunCycle; + SeasonSpeed = SeasonalCycle/SecondsPerYear; - VWTimeRatio = 24/m_day_length; + // Horizon translation - // Speed of rotation needed to complete a cycle in the - // designated period (day and season) + HorizonShift = m_day_night; // Z axis translation + HoursToRadians = (SunCycle/24)*VWTimeRatio; - SunSpeed = SunCycle/SecondsPerSunCycle; - SeasonSpeed = SeasonalCycle/SecondsPerYear; + // Insert our event handling hooks - // Horizon translation + scene.EventManager.OnFrame += SunUpdate; + scene.EventManager.OnNewClient += SunToClient; - HorizonShift = m_day_night; // Z axis translation - HoursToRadians = (SunCycle/24)*VWTimeRatio; + ready = true; - // Insert our event handling hooks - - scene.EventManager.OnFrame += SunUpdate; - scene.EventManager.OnNewClient += SunToClient; - - ready = true; - - m_log.Debug("[SUN] Mode is "+m_mode); - m_log.Debug("[SUN] Initialization completed. Day is "+SecondsPerSunCycle+" seconds, and year is "+m_year_length+" days"); - m_log.Debug("[SUN] Axis offset is "+m_day_night); - m_log.Debug("[SUN] Positional data updated every "+m_frame_mod+" frames"); + m_log.Debug("[SUN] Mode is "+m_mode); + m_log.Debug("[SUN] Initialization completed. Day is "+SecondsPerSunCycle+" seconds, and year is "+m_year_length+" days"); + m_log.Debug("[SUN] Axis offset is "+m_day_night); + m_log.Debug("[SUN] Positional data updated every "+m_frame_mod+" frames"); break; - } } @@ -224,21 +220,20 @@ namespace OpenSim.Region.Environment.Modules public void SunToClient(IClientAPI client) { - if(m_mode != "T1") + if (m_mode != "T1") { - if(ready) - { - GenSunPos(); // Generate shared values once - client.SendSunPos(Position, Velocity, CurrentTime, SecondsPerSunCycle, SecondsPerYear, OrbitalPosition); + if (ready) + { + GenSunPos(); // Generate shared values once + client.SendSunPos(Position, Velocity, CurrentTime, SecondsPerSunCycle, SecondsPerYear, OrbitalPosition); m_log.Debug("[SUN] Initial update for new client"); - } + } } } public void SunUpdate() { - - if(((m_frame++%m_frame_mod) != 0) || !ready) + if (((m_frame++%m_frame_mod) != 0) || !ready) { return; } @@ -253,7 +248,6 @@ namespace OpenSim.Region.Environment.Modules // set estate settings for region access to sun position m_scene.RegionInfo.EstateSettings.sunPosition = Position; - } /// diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 49ce341..efd258d 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -596,7 +596,7 @@ namespace OpenSim.Region.Environment.Scenes ScenePresence presence; TryGetAvatar(remoteClient.AgentId, out presence); byte[] data = null; - if(invType == 3 && presence != null) // libsecondlife.asset.assettype.landmark = 3 - needs to be turned into an enum + if (invType == 3 && presence != null) // libsecondlife.asset.assettype.landmark = 3 - needs to be turned into an enum { LLVector3 pos=presence.AbsolutePosition; string strdata=String.Format("Landmark version 2\nregion_id {0}\nlocal_pos {1} {2} {3}\nregion_handle {4}\n", @@ -996,7 +996,7 @@ namespace OpenSim.Region.Environment.Scenes permissionToDelete = false; //Just taking copy! } - else if(DeRezPacket.AgentBlock.Destination == 4) //Take + else if (DeRezPacket.AgentBlock.Destination == 4) //Take { // Take permissionToTake = ExternalChecks.ExternalChecksCanTakeObject(((SceneObjectGroup)selectedEnt).UUID, remoteClient.AgentId); diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index c9274dd..f922f1f 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs @@ -452,7 +452,7 @@ namespace OpenSim.Region.Environment.Scenes d); } - public delegate void SendCloseChildAgentDelegate( LLUUID agentID, List regionlst); + public delegate void SendCloseChildAgentDelegate(LLUUID agentID, List regionlst); /// /// This Closes child agents on neighboring regions @@ -568,7 +568,8 @@ namespace OpenSim.Region.Environment.Scenes // assume local regions are always up destRegionUp = true; } - if(destRegionUp) + + if (destRegionUp) { avatar.Close(); diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs index 285ee0d..99d19df 100644 --- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs +++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs @@ -51,7 +51,7 @@ namespace OpenSim.Region.Environment.Scenes public void addCheckRezObject(CanRezObject delegateFunc) { - if(!CanRezObjectCheckFunctions.Contains(delegateFunc)) + if (!CanRezObjectCheckFunctions.Contains(delegateFunc)) CanRezObjectCheckFunctions.Add(delegateFunc); } public void removeCheckRezObject(CanRezObject delegateFunc) diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs index 8603ccc..1f1f39f 100644 --- a/OpenSim/Region/Environment/Scenes/SceneManager.cs +++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs @@ -313,7 +313,7 @@ namespace OpenSim.Region.Environment.Scenes { foreach (Scene mscene in m_localScenes) { - if((mscene.RegionInfo.InternalEndPoint.Equals(ipEndPoint.Address)) && + if ((mscene.RegionInfo.InternalEndPoint.Equals(ipEndPoint.Address)) && (mscene.RegionInfo.InternalEndPoint.Port == ipEndPoint.Port)) { scene = mscene; diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index 1dbac52..9a9314c 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs @@ -263,7 +263,7 @@ namespace OpenSim.Region.Environment.Scenes { foreach (TaskInventoryItem item in m_taskInventory.Values) { - if(item.Name == name) + if (item.Name == name) return true; } return false; @@ -271,14 +271,14 @@ namespace OpenSim.Region.Environment.Scenes private string FindAvailableInventoryName(string name) { - if(!InventoryContainsName(name)) + if (!InventoryContainsName(name)) return name; int suffix=1; - while(suffix < 256) + while (suffix < 256) { string tryName=String.Format("{0} {1}", name, suffix); - if(!InventoryContainsName(tryName)) + if (!InventoryContainsName(tryName)) return tryName; suffix++; } @@ -296,7 +296,7 @@ namespace OpenSim.Region.Environment.Scenes item.ParentPartID = UUID; string name=FindAvailableInventoryName(item.Name); - if(name == String.Empty) + if (name == String.Empty) return; item.Name=name; diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 9502627..6c5a68d 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -2049,7 +2049,7 @@ namespace OpenSim.Region.Environment.Scenes data[pos] = (byte)pTexAnim.SizeY; pos++; Helpers.FloatToBytes(pTexAnim.Start).CopyTo(data, pos); - Helpers.FloatToBytes(pTexAnim.Length ).CopyTo(data, pos + 4); + Helpers.FloatToBytes(pTexAnim.Length).CopyTo(data, pos + 4); Helpers.FloatToBytes(pTexAnim.Rate).CopyTo(data, pos + 8); m_TextureAnimation = data; @@ -2495,7 +2495,7 @@ namespace OpenSim.Region.Environment.Scenes (int) (color.x*0xff), (int) (color.y*0xff), (int) (color.z*0xff)); - SetText( text ); + SetText(text); } public int registerTargetWaypoint(LLVector3 target, float tolerance) diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 6f0fbdf..2901a97 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -1263,7 +1263,7 @@ namespace OpenSim.Region.Environment.Scenes //bool colliding = (m_physicsActor.IsColliding==true); //if (controlland) // m_log.Info("[AGENT]: landCommand"); - //if (colliding ) + //if (colliding) // m_log.Info("[AGENT]: colliding"); //if (m_physicsActor.Flying && colliding && controlland) //{ -- cgit v1.1