From 80d8e2889e62d8900837d37a800a4eeaae5ffc5a Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Wed, 23 Jul 2008 13:24:25 +0000 Subject: Update svn properties. Formatting cleanup. Remove a compiler warning. --- .../Modules/Scripting/EMailModules/EmailModule.cs | 266 ++++++++++----------- .../Modules/World/Archiver/AssetsArchiver.cs | 2 +- .../Modules/World/Estate/EstateManagementModule.cs | 80 +++---- .../Environment/Modules/World/Land/LandObject.cs | 6 +- OpenSim/Region/Environment/Scenes/InnerScene.cs | 10 +- .../Region/Environment/Scenes/Scene.Inventory.cs | 2 +- OpenSim/Region/Environment/Scenes/Scene.cs | 30 +-- .../Region/Environment/Scenes/SceneObjectGroup.cs | 58 ++--- .../Region/Environment/Scenes/SceneObjectPart.cs | 2 +- OpenSim/Region/Environment/StorageManager.cs | 2 +- 10 files changed, 230 insertions(+), 228 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs index c65f958..1162c25 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/EMailModules/EmailModule.cs @@ -78,33 +78,33 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules //Load SMTP SERVER config try - { - if ((SMTPConfig = m_Config.Configs["SMTP"]) == null) - { - m_log.InfoFormat("[SMTP] SMTP server not configured"); - m_Enabled = false; - return; - } - - if (!SMTPConfig.GetBoolean("enabled", false)) - { - m_log.InfoFormat("[SMTP] module disabled in configuration"); - m_Enabled = false; - return; - } - - m_HostName = SMTPConfig.GetString("host_domain_header_from", m_HostName); - SMTP_SERVER_HOSTNAME = SMTPConfig.GetString("SMTP_SERVER_HOSTNAME",SMTP_SERVER_HOSTNAME); - SMTP_SERVER_PORT = SMTPConfig.GetInt("SMTP_SERVER_PORT", SMTP_SERVER_PORT); - SMTP_SERVER_LOGIN = SMTPConfig.GetString("SMTP_SERVER_LOGIN", SMTP_SERVER_LOGIN); - SMTP_SERVER_PASSWORD = SMTPConfig.GetString("SMTP_SERVER_PASSWORD", SMTP_SERVER_PASSWORD); - } - catch (Exception e) - { - m_log.Error("[EMAIL] DefaultEmailModule not configured: "+ e.Message); - m_Enabled = false; - return; - } + { + if ((SMTPConfig = m_Config.Configs["SMTP"]) == null) + { + m_log.InfoFormat("[SMTP] SMTP server not configured"); + m_Enabled = false; + return; + } + + if (!SMTPConfig.GetBoolean("enabled", false)) + { + m_log.InfoFormat("[SMTP] module disabled in configuration"); + m_Enabled = false; + return; + } + + m_HostName = SMTPConfig.GetString("host_domain_header_from", m_HostName); + SMTP_SERVER_HOSTNAME = SMTPConfig.GetString("SMTP_SERVER_HOSTNAME",SMTP_SERVER_HOSTNAME); + SMTP_SERVER_PORT = SMTPConfig.GetInt("SMTP_SERVER_PORT", SMTP_SERVER_PORT); + SMTP_SERVER_LOGIN = SMTPConfig.GetString("SMTP_SERVER_LOGIN", SMTP_SERVER_LOGIN); + SMTP_SERVER_PASSWORD = SMTPConfig.GetString("SMTP_SERVER_PASSWORD", SMTP_SERVER_PASSWORD); + } + catch (Exception e) + { + m_log.Error("[EMAIL] DefaultEmailModule not configured: "+ e.Message); + m_Enabled = false; + return; + } // It's a go! if (m_Enabled) @@ -124,7 +124,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules m_Scenes.Add(scene.RegionInfo.RegionHandle, scene); } } - + m_log.Info("[EMAIL] Activated DefaultEmailModule"); } } @@ -152,14 +152,14 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules /// /// private void DelayInSeconds(int seconds) - { - TimeSpan DiffDelay = new TimeSpan(0, 0, seconds); - DateTime EndDelay = DateTime.Now.Add(DiffDelay); - while (DateTime.Now < EndDelay) - { - ;//Do nothing!! - } - } + { + TimeSpan DiffDelay = new TimeSpan(0, 0, seconds); + DateTime EndDelay = DateTime.Now.Add(DiffDelay); + while (DateTime.Now < EndDelay) + { + ;//Do nothing!! + } + } private SceneObjectPart findPrim(LLUUID objectID, out string ObjectRegionName) { @@ -171,7 +171,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules if (part != null) { ObjectRegionName = s.RegionInfo.RegionName; - return part; + return part; } } } @@ -181,108 +181,108 @@ namespace OpenSim.Region.Environment.Modules.Scripting.EmailModules private void resolveNamePositionRegionName(LLUUID objectID, out string ObjectName, out string ObjectAbsolutePosition, out string ObjectRegionName) { - string m_ObjectRegionName; - SceneObjectPart part = findPrim(objectID, out m_ObjectRegionName); + string m_ObjectRegionName; + SceneObjectPart part = findPrim(objectID, out m_ObjectRegionName); if (part != null) { - ObjectAbsolutePosition = part.AbsolutePosition.ToString(); - ObjectName = part.Name; - ObjectRegionName = m_ObjectRegionName; - return; + ObjectAbsolutePosition = part.AbsolutePosition.ToString(); + ObjectName = part.Name; + ObjectRegionName = m_ObjectRegionName; + return; } ObjectAbsolutePosition = part.AbsolutePosition.ToString(); ObjectName = part.Name; ObjectRegionName = m_ObjectRegionName; return; } - - /// - /// SendMail function utilized by llEMail - /// - /// - /// - /// - /// - public void SendEmail(LLUUID objectID, string address, string subject, string body) - { - //Check if address is empty - if (address == string.Empty) - return; - - //FIXED:Check the email is correct form in REGEX - string EMailpatternStrict = @"^(([^<>()[\]\\.,;:\s@\""]+" - + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@" - + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" - + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+" - + @"[a-zA-Z]{2,}))$"; - Regex EMailreStrict = new Regex(EMailpatternStrict); - bool isEMailStrictMatch = EMailreStrict.IsMatch(address); - if (!isEMailStrictMatch) - { - m_log.Error("[EMAIL] REGEX Problem in EMail Address: "+address); - return; - } - //FIXME:Check if subject + body = 4096 Byte - if ((subject.Length + body.Length) > 1024) - { - m_log.Error("[EMAIL] subject + body > 1024 Byte"); - return; - } - - try - { - string LastObjectName = string.Empty; - string LastObjectPosition = string.Empty; - string LastObjectRegionName = string.Empty; - //DONE: Message as Second Life style - //20 second delay - AntiSpam System - for now only 10 seconds - DelayInSeconds(10); - //Creation EmailMessage - EmailMessage emailMessage = new EmailMessage(); - //From - emailMessage.FromAddress = new EmailAddress(objectID.UUID.ToString()+"@"+m_HostName); - //To - Only One - emailMessage.AddToAddress(new EmailAddress(address)); - //Subject - emailMessage.Subject = subject; - //TEXT Body - resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName); - emailMessage.TextPart = new TextAttachment("Object-Name: " + LastObjectName + - "\r\nRegion: " + LastObjectRegionName + "\r\nLocal-Position: " + - LastObjectPosition+"\r\n\r\n\r\n" + body); - //HTML Body - emailMessage.HtmlPart = new HtmlAttachment("

" + - "
Object-Name: " + LastObjectName + - "
Region: " + LastObjectRegionName + - "
Local-Position: " + LastObjectPosition + "


" - +body+"\r\n

"); - - //Set SMTP SERVER config - SmtpServer smtpServer=new SmtpServer(SMTP_SERVER_HOSTNAME,SMTP_SERVER_PORT); - //Authentication - smtpServer.SmtpAuthToken=new SmtpAuthToken(SMTP_SERVER_LOGIN, SMTP_SERVER_PASSWORD); - //Send Email Message - emailMessage.Send(smtpServer); - //Log - m_log.Info("[EMAIL] EMail sent to: " + address + " from object: " + objectID.UUID.ToString()); - } - catch (Exception e) - { - m_log.Error("[EMAIL] DefaultEmailModule Exception: "+e.Message); - return; - } - } - - /// - /// - /// - /// - /// - /// - /// - public Email GetNextEmail(LLUUID objectID, string sender, string subject) - { - return null; - } - } + + /// + /// SendMail function utilized by llEMail + /// + /// + /// + /// + /// + public void SendEmail(LLUUID objectID, string address, string subject, string body) + { + //Check if address is empty + if (address == string.Empty) + return; + + //FIXED:Check the email is correct form in REGEX + string EMailpatternStrict = @"^(([^<>()[\]\\.,;:\s@\""]+" + + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@" + + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" + + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+" + + @"[a-zA-Z]{2,}))$"; + Regex EMailreStrict = new Regex(EMailpatternStrict); + bool isEMailStrictMatch = EMailreStrict.IsMatch(address); + if (!isEMailStrictMatch) + { + m_log.Error("[EMAIL] REGEX Problem in EMail Address: "+address); + return; + } + //FIXME:Check if subject + body = 4096 Byte + if ((subject.Length + body.Length) > 1024) + { + m_log.Error("[EMAIL] subject + body > 1024 Byte"); + return; + } + + try + { + string LastObjectName = string.Empty; + string LastObjectPosition = string.Empty; + string LastObjectRegionName = string.Empty; + //DONE: Message as Second Life style + //20 second delay - AntiSpam System - for now only 10 seconds + DelayInSeconds(10); + //Creation EmailMessage + EmailMessage emailMessage = new EmailMessage(); + //From + emailMessage.FromAddress = new EmailAddress(objectID.UUID.ToString()+"@"+m_HostName); + //To - Only One + emailMessage.AddToAddress(new EmailAddress(address)); + //Subject + emailMessage.Subject = subject; + //TEXT Body + resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName); + emailMessage.TextPart = new TextAttachment("Object-Name: " + LastObjectName + + "\r\nRegion: " + LastObjectRegionName + "\r\nLocal-Position: " + + LastObjectPosition+"\r\n\r\n\r\n" + body); + //HTML Body + emailMessage.HtmlPart = new HtmlAttachment("

" + + "
Object-Name: " + LastObjectName + + "
Region: " + LastObjectRegionName + + "
Local-Position: " + LastObjectPosition + "


" + +body+"\r\n

"); + + //Set SMTP SERVER config + SmtpServer smtpServer=new SmtpServer(SMTP_SERVER_HOSTNAME,SMTP_SERVER_PORT); + //Authentication + smtpServer.SmtpAuthToken=new SmtpAuthToken(SMTP_SERVER_LOGIN, SMTP_SERVER_PASSWORD); + //Send Email Message + emailMessage.Send(smtpServer); + //Log + m_log.Info("[EMAIL] EMail sent to: " + address + " from object: " + objectID.UUID.ToString()); + } + catch (Exception e) + { + m_log.Error("[EMAIL] DefaultEmailModule Exception: "+e.Message); + return; + } + } + + /// + /// + /// + /// + /// + /// + /// + public Email GetNextEmail(LLUUID objectID, string sender, string subject) + { + return null; + } + } } diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs index 81d85d2..2704224 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs @@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// public class AssetsArchiver { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); /// /// Archive assets diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs index 3996fb3..c0fdc05 100644 --- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs @@ -52,7 +52,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate //SendDetailedEstateData(LLUUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, LLUUID covenant) uint sun = 0; - if(!m_scene.RegionInfo.EstateSettings.UseGlobalTime) + if (!m_scene.RegionInfo.EstateSettings.UseGlobalTime) sun=(uint)(m_scene.RegionInfo.EstateSettings.SunPosition*1024.0) + 0x1800; remote_client.SendDetailedEstateData(invoice, m_scene.RegionInfo.EstateSettings.EstateName, @@ -98,7 +98,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate m_scene.RegionInfo.RegionSettings.ObjectBonus = objectBonusFactor; - if(matureLevel <= 13) + if (matureLevel <= 13) m_scene.RegionInfo.RegionSettings.Maturity = 0; else m_scene.RegionInfo.RegionSettings.Maturity = 1; @@ -245,7 +245,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate ScenePresence s = m_scene.GetScenePresence(user); if (s != null) { - if(!s.IsChildAgent) + if (!s.IsChildAgent) m_scene.TeleportClientHome(user, s.ControllingClient); } @@ -395,7 +395,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate args.redirectGridY = m_scene.RegionInfo.EstateSettings.RedirectGridY; args.regionFlags = GetRegionFlags(); byte mature = 13; - if(m_scene.RegionInfo.RegionSettings.Maturity == 1) + if (m_scene.RegionInfo.RegionSettings.Maturity == 1) mature = 21; args.simAccess = mature; @@ -550,7 +550,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate args.terrainStartHeight3 = (float)m_scene.RegionInfo.RegionSettings.Elevation1NE; args.terrainHeightRange3 = (float)m_scene.RegionInfo.RegionSettings.Elevation2NE; byte mature = 13; - if(m_scene.RegionInfo.RegionSettings.Maturity == 1) + if (m_scene.RegionInfo.RegionSettings.Maturity == 1) mature = 21; args.simAccess = mature; args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; @@ -579,7 +579,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate public void handleEstateChangeInfo(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, UInt32 parms1, UInt32 parms2) { - if(parms2 == 0) + if (parms2 == 0) { m_scene.RegionInfo.EstateSettings.UseGlobalTime = true; m_scene.RegionInfo.EstateSettings.SunPosition = 0.0; @@ -590,37 +590,37 @@ namespace OpenSim.Region.Environment.Modules.World.Estate m_scene.RegionInfo.EstateSettings.SunPosition = (double)(parms2 - 0x1800)/1024.0; } - if((parms1 & 0x00000010) != 0) + if ((parms1 & 0x00000010) != 0) m_scene.RegionInfo.EstateSettings.FixedSun = true; else m_scene.RegionInfo.EstateSettings.FixedSun = false; - if((parms1 & 0x00008000) != 0) + if ((parms1 & 0x00008000) != 0) m_scene.RegionInfo.EstateSettings.PublicAccess = true; else m_scene.RegionInfo.EstateSettings.PublicAccess = false; - if((parms1 & 0x10000000) != 0) + if ((parms1 & 0x10000000) != 0) m_scene.RegionInfo.EstateSettings.AllowVoice = true; else m_scene.RegionInfo.EstateSettings.AllowVoice = false; - if((parms1 & 0x00100000) != 0) + if ((parms1 & 0x00100000) != 0) m_scene.RegionInfo.EstateSettings.AllowDirectTeleport = true; else m_scene.RegionInfo.EstateSettings.AllowDirectTeleport = false; - if((parms1 & 0x00800000) != 0) + if ((parms1 & 0x00800000) != 0) m_scene.RegionInfo.EstateSettings.DenyAnonymous = true; else m_scene.RegionInfo.EstateSettings.DenyAnonymous = false; - if((parms1 & 0x01000000) != 0) + if ((parms1 & 0x01000000) != 0) m_scene.RegionInfo.EstateSettings.DenyIdentified = true; else m_scene.RegionInfo.EstateSettings.DenyIdentified = false; - if((parms1 & 0x02000000) != 0) + if ((parms1 & 0x02000000) != 0) m_scene.RegionInfo.EstateSettings.DenyTransacted = true; else m_scene.RegionInfo.EstateSettings.DenyTransacted = false; @@ -628,10 +628,10 @@ namespace OpenSim.Region.Environment.Modules.World.Estate m_scene.RegionInfo.EstateSettings.Save(); float sun = (float)m_scene.RegionInfo.RegionSettings.SunPosition; - if(m_scene.RegionInfo.RegionSettings.UseEstateSun) + if (m_scene.RegionInfo.RegionSettings.UseEstateSun) { sun = (float)m_scene.RegionInfo.EstateSettings.SunPosition; - if(m_scene.RegionInfo.EstateSettings.UseGlobalTime) + if (m_scene.RegionInfo.EstateSettings.UseGlobalTime) sun = m_scene.EventManager.GetSunLindenHour(); } @@ -726,30 +726,30 @@ namespace OpenSim.Region.Environment.Modules.World.Estate // Fully implemented // - if(m_scene.RegionInfo.RegionSettings.AllowDamage) + if (m_scene.RegionInfo.RegionSettings.AllowDamage) flags |= Simulator.RegionFlags.AllowDamage; - if(m_scene.RegionInfo.RegionSettings.BlockTerraform) + if (m_scene.RegionInfo.RegionSettings.BlockTerraform) flags |= Simulator.RegionFlags.BlockTerraform; - if(!m_scene.RegionInfo.RegionSettings.AllowLandResell) + if (!m_scene.RegionInfo.RegionSettings.AllowLandResell) flags |= Simulator.RegionFlags.BlockLandResell; - if(m_scene.RegionInfo.RegionSettings.DisableCollisions) + if (m_scene.RegionInfo.RegionSettings.DisableCollisions) flags |= Simulator.RegionFlags.SkipCollisions; - if(m_scene.RegionInfo.RegionSettings.DisableScripts) + if (m_scene.RegionInfo.RegionSettings.DisableScripts) flags |= Simulator.RegionFlags.SkipScripts; - if(m_scene.RegionInfo.RegionSettings.DisablePhysics) + if (m_scene.RegionInfo.RegionSettings.DisablePhysics) flags |= Simulator.RegionFlags.SkipPhysics; - if(m_scene.RegionInfo.RegionSettings.BlockFly) + if (m_scene.RegionInfo.RegionSettings.BlockFly) flags |= Simulator.RegionFlags.NoFly; - if(m_scene.RegionInfo.RegionSettings.RestrictPushing) + if (m_scene.RegionInfo.RegionSettings.RestrictPushing) flags |= Simulator.RegionFlags.RestrictPushObject; - if(m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide) + if (m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide) flags |= Simulator.RegionFlags.AllowParcelChanges; - if(m_scene.RegionInfo.RegionSettings.BlockShowInSearch) + if (m_scene.RegionInfo.RegionSettings.BlockShowInSearch) flags |= (Simulator.RegionFlags)(1 << 29); - if(m_scene.RegionInfo.RegionSettings.FixedSun) + if (m_scene.RegionInfo.RegionSettings.FixedSun) flags |= Simulator.RegionFlags.SunFixed; - if(m_scene.RegionInfo.RegionSettings.Sandbox) + if (m_scene.RegionInfo.RegionSettings.Sandbox) flags |= Simulator.RegionFlags.Sandbox; // Handled in LandObject.cs: AllowLandmark @@ -769,30 +769,30 @@ namespace OpenSim.Region.Environment.Modules.World.Estate { Simulator.RegionFlags flags = Simulator.RegionFlags.None; - if(m_scene.RegionInfo.EstateSettings.FixedSun) + if (m_scene.RegionInfo.EstateSettings.FixedSun) flags |= Simulator.RegionFlags.SunFixed; - if(m_scene.RegionInfo.EstateSettings.PublicAccess) + if (m_scene.RegionInfo.EstateSettings.PublicAccess) flags |= (Simulator.RegionFlags.PublicAllowed | Simulator.RegionFlags.ExternallyVisible); - if(m_scene.RegionInfo.EstateSettings.AllowVoice) + if (m_scene.RegionInfo.EstateSettings.AllowVoice) flags |= Simulator.RegionFlags.AllowVoice; - if(m_scene.RegionInfo.EstateSettings.AllowDirectTeleport) + if (m_scene.RegionInfo.EstateSettings.AllowDirectTeleport) flags |= Simulator.RegionFlags.AllowDirectTeleport; - if(m_scene.RegionInfo.EstateSettings.DenyAnonymous) + if (m_scene.RegionInfo.EstateSettings.DenyAnonymous) flags |= Simulator.RegionFlags.DenyAnonymous; - if(m_scene.RegionInfo.EstateSettings.DenyIdentified) + if (m_scene.RegionInfo.EstateSettings.DenyIdentified) flags |= Simulator.RegionFlags.DenyIdentified; - if(m_scene.RegionInfo.EstateSettings.DenyTransacted) + if (m_scene.RegionInfo.EstateSettings.DenyTransacted) flags |= Simulator.RegionFlags.DenyTransacted; - if(m_scene.RegionInfo.EstateSettings.AbuseEmailToEstateOwner) + if (m_scene.RegionInfo.EstateSettings.AbuseEmailToEstateOwner) flags |= Simulator.RegionFlags.AbuseEmailToEstateOwner; - if(m_scene.RegionInfo.EstateSettings.BlockDwell) + if (m_scene.RegionInfo.EstateSettings.BlockDwell) flags |= Simulator.RegionFlags.BlockDwell; - if(m_scene.RegionInfo.EstateSettings.EstateSkipScripts) + if (m_scene.RegionInfo.EstateSettings.EstateSkipScripts) flags |= Simulator.RegionFlags.EstateSkipScripts; - if(m_scene.RegionInfo.EstateSettings.ResetHomeOnTeleport) + if (m_scene.RegionInfo.EstateSettings.ResetHomeOnTeleport) flags |= Simulator.RegionFlags.ResetHomeOnTeleport; - if(m_scene.RegionInfo.EstateSettings.TaxFree) + if (m_scene.RegionInfo.EstateSettings.TaxFree) flags |= Simulator.RegionFlags.TaxFree; return (uint)flags; @@ -804,7 +804,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate return true; List ems = new List(m_scene.RegionInfo.EstateSettings.EstateManagers); - if(ems.Contains(avatarID)) + if (ems.Contains(avatarID)) return true; return false; diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs index 5aed2a7..02d74e5 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs @@ -163,11 +163,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land { IEstateModule estateModule = m_scene.RequestModuleInterface(); uint regionFlags = 336723974 & ~((uint)(Simulator.RegionFlags.AllowLandmark | Simulator.RegionFlags.AllowSetHome)); - if(estateModule != null) + if (estateModule != null) regionFlags = estateModule.GetRegionFlags(); - if((landData.landFlags & (uint)Parcel.ParcelFlags.AllowLandmark) != 0) + if ((landData.landFlags & (uint)Parcel.ParcelFlags.AllowLandmark) != 0) regionFlags |= (uint)Simulator.RegionFlags.AllowLandmark; - if(landData.ownerID == remote_client.AgentId) + if (landData.ownerID == remote_client.AgentId) regionFlags |= (uint)Simulator.RegionFlags.AllowSetHome; remote_client.SendLandProperties(remote_client, sequence_id, snap_selection, request_result, landData, diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 399cbf6..7df70a0 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -1365,7 +1365,7 @@ namespace OpenSim.Region.Environment.Scenes // We need to explicitly resend the newly link prim's object properties since no other actions // occur on link to invoke this elsewhere (such as object selection) parenPrim.TriggerScriptChangedEvent(Changed.LINK); - if(client != null) + if (client != null) parenPrim.GetProperties(client); else { @@ -1426,13 +1426,13 @@ namespace OpenSim.Region.Environment.Scenes parenPrim.DelinkFromGroup(childPrimId, sendEvents); } - if(parenPrim.Children.Count == 1) + if (parenPrim.Children.Count == 1) { // The link set has been completely torn down // This is the case if you select a link set and delink // parenPrim.RootPart.LinkNum = 1; - if(sendEvents) + if (sendEvents) parenPrim.TriggerScriptChangedEvent(Changed.LINK); } else @@ -1449,7 +1449,7 @@ namespace OpenSim.Region.Environment.Scenes // Tear down the remaining link set // - if(unlink_ids.Count == 2) + if (unlink_ids.Count == 2) { DelinkObjects(unlink_ids, true); return; @@ -1494,7 +1494,7 @@ namespace OpenSim.Region.Environment.Scenes { grp.DelinkFromGroup(primIds[i]); delinkedSomething = true; - if(!parents.Contains(grp)) + if (!parents.Contains(grp)) parents.Add(grp); } diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 0cf2016..5caf0f0 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -1693,7 +1693,7 @@ namespace OpenSim.Region.Environment.Scenes } // Finally remove the item, for reals this time. - if(permissionToDelete) + if (permissionToDelete) DeleteSceneObject(objectGroup); } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index ae5a3c7..7ff5024 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -88,8 +88,8 @@ namespace OpenSim.Region.Environment.Scenes /// Are we applying physics to any of the prims in this scene? /// public bool m_physicalPrim; - public float m_maxNonphys = 65536; - public float m_maxPhys = 10; + public float m_maxNonphys = 65536; + public float m_maxPhys = 10; public bool m_seeIntoRegionFromNeighbor; public int MaxUndoCount = 5; @@ -272,7 +272,7 @@ namespace OpenSim.Region.Environment.Scenes // Load region settings m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID); - if(m_storageManager.EstateDataStore != null) + if (m_storageManager.EstateDataStore != null) m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID); @@ -311,16 +311,16 @@ namespace OpenSim.Region.Environment.Scenes + " ChilTasks:" + m_seeIntoRegionFromNeighbor.ToString() + " PhysPrim:" + m_physicalPrim.ToString(); - try - { - IConfig startupConfig = m_config.Configs["Startup"]; - m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", 65536.0f); - m_maxPhys = startupConfig.GetFloat("PhysicalPrimMax", 10.0f); - } - catch (Exception) - { - m_log.Warn("Failed to load StartupConfig"); - } + try + { + IConfig startupConfig = m_config.Configs["Startup"]; + m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", 65536.0f); + m_maxPhys = startupConfig.GetFloat("PhysicalPrimMax", 10.0f); + } + catch (Exception) + { + m_log.Warn("Failed to load StartupConfig"); + } } @@ -2505,8 +2505,8 @@ namespace OpenSim.Region.Environment.Scenes /// public void AddCapsHandler(LLUUID agentId) { - if(RegionInfo.EstateSettings.IsBanned(agentId)) - return; + if (RegionInfo.EstateSettings.IsBanned(agentId)) + return; String capsObjectPath = GetCapsPath(agentId); m_log.DebugFormat( diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index c2ce9d8..87e69f7 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -427,7 +427,7 @@ namespace OpenSim.Region.Environment.Scenes if (reader.Name == "SceneObjectPart") { SceneObjectPart Part = SceneObjectPart.FromXml(reader); - if(m_rootPart.LinkNum == 0) + if (m_rootPart.LinkNum == 0) m_rootPart.LinkNum++; AddPart(Part); Part.LinkNum = m_parts.Count; @@ -833,7 +833,7 @@ namespace OpenSim.Region.Environment.Scenes part.LinkNum = m_parts.Count; - if(part.LinkNum == 2 && RootPart != null) + if (part.LinkNum == 2 && RootPart != null) RootPart.LinkNum = 1; } } @@ -1745,7 +1745,7 @@ namespace OpenSim.Region.Environment.Scenes linkPart.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w); linkPart.ParentID = m_rootPart.LocalId; - if(m_rootPart.LinkNum == 0) + if (m_rootPart.LinkNum == 0) m_rootPart.LinkNum = 1; lock (m_parts) @@ -1815,13 +1815,15 @@ namespace OpenSim.Region.Environment.Scenes m_parts.Remove(linkPart.UUID); } - if(m_parts.Count == 1 && RootPart != null) //Single prim is left + if (m_parts.Count == 1 && RootPart != null) //Single prim is left RootPart.LinkNum = 0; else { foreach (SceneObjectPart p in m_parts.Values) - if(p.LinkNum > linkPart.LinkNum) + { + if (p.LinkNum > linkPart.LinkNum) p.LinkNum--; + } } linkPart.ParentID = 0; @@ -1858,7 +1860,7 @@ namespace OpenSim.Region.Environment.Scenes m_scene.AddNewSceneObject(objectGroup, true); - if(sendEvents) + if (sendEvents) linkPart.TriggerScriptChangedEvent(Changed.LINK); HasGroupChanged = true; @@ -2131,11 +2133,11 @@ namespace OpenSim.Region.Environment.Scenes /// public void Resize(LLVector3 scale, uint localID) { - if(scale.X > m_scene.m_maxNonphys) + if (scale.X > m_scene.m_maxNonphys) scale.X = m_scene.m_maxNonphys; - if(scale.Y > m_scene.m_maxNonphys) + if (scale.Y > m_scene.m_maxNonphys) scale.Y = m_scene.m_maxNonphys; - if(scale.Z > m_scene.m_maxNonphys) + if (scale.Z > m_scene.m_maxNonphys) scale.Z = m_scene.m_maxNonphys; SceneObjectPart part = GetChildPart(localID); @@ -2144,13 +2146,13 @@ namespace OpenSim.Region.Environment.Scenes part.Resize(scale); if (part.PhysActor != null) { - if(part.PhysActor.IsPhysical) + if (part.PhysActor.IsPhysical) { - if(scale.X > m_scene.m_maxPhys) + if (scale.X > m_scene.m_maxPhys) scale.X = m_scene.m_maxPhys; - if(scale.Y > m_scene.m_maxPhys) + if (scale.Y > m_scene.m_maxPhys) scale.Y = m_scene.m_maxPhys; - if(scale.Z > m_scene.m_maxPhys) + if (scale.Z > m_scene.m_maxPhys) scale.Z = m_scene.m_maxPhys; } part.PhysActor.Size = @@ -2179,19 +2181,19 @@ namespace OpenSim.Region.Environment.Scenes SceneObjectPart part = GetChildPart(localID); if (part != null) { - if(scale.X > m_scene.m_maxNonphys) + if (scale.X > m_scene.m_maxNonphys) scale.X = m_scene.m_maxNonphys; - if(scale.Y > m_scene.m_maxNonphys) + if (scale.Y > m_scene.m_maxNonphys) scale.Y = m_scene.m_maxNonphys; - if(scale.Z > m_scene.m_maxNonphys) + if (scale.Z > m_scene.m_maxNonphys) scale.Z = m_scene.m_maxNonphys; - if(part.PhysActor != null && part.PhysActor.IsPhysical) + if (part.PhysActor != null && part.PhysActor.IsPhysical) { - if(scale.X > m_scene.m_maxPhys) + if (scale.X > m_scene.m_maxPhys) scale.X = m_scene.m_maxPhys; - if(scale.Y > m_scene.m_maxPhys) + if (scale.Y > m_scene.m_maxPhys) scale.Y = m_scene.m_maxPhys; - if(scale.Z > m_scene.m_maxPhys) + if (scale.Z > m_scene.m_maxPhys) scale.Z = m_scene.m_maxPhys; } float x = (scale.X / part.Scale.X); @@ -2200,7 +2202,7 @@ namespace OpenSim.Region.Environment.Scenes lock (m_parts) { - if(x > 1.0f || y > 1.0f || z > 1.0f) + if (x > 1.0f || y > 1.0f || z > 1.0f) { foreach (SceneObjectPart obPart in m_parts.Values) { @@ -2211,9 +2213,9 @@ namespace OpenSim.Region.Environment.Scenes float f = 1.0f; float a = 1.0f; - if(part.PhysActor != null && part.PhysActor.IsPhysical) + if (part.PhysActor != null && part.PhysActor.IsPhysical) { - if(oldSize.X*x > m_scene.m_maxPhys) + if (oldSize.X*x > m_scene.m_maxPhys) { f = m_scene.m_maxPhys / oldSize.X; a = f / x; @@ -2221,7 +2223,7 @@ namespace OpenSim.Region.Environment.Scenes y *= a; z *= a; } - if(oldSize.Y*y > m_scene.m_maxPhys) + if (oldSize.Y*y > m_scene.m_maxPhys) { f = m_scene.m_maxPhys / oldSize.Y; a = f / y; @@ -2229,7 +2231,7 @@ namespace OpenSim.Region.Environment.Scenes y *= a; z *= a; } - if(oldSize.Z*z > m_scene.m_maxPhys) + if (oldSize.Z*z > m_scene.m_maxPhys) { f = m_scene.m_maxPhys / oldSize.Z; a = f / z; @@ -2240,7 +2242,7 @@ namespace OpenSim.Region.Environment.Scenes } else { - if(oldSize.X*x > m_scene.m_maxNonphys) + if (oldSize.X*x > m_scene.m_maxNonphys) { f = m_scene.m_maxNonphys / oldSize.X; a = f / x; @@ -2248,7 +2250,7 @@ namespace OpenSim.Region.Environment.Scenes y *= a; z *= a; } - if(oldSize.Y*y > m_scene.m_maxNonphys) + if (oldSize.Y*y > m_scene.m_maxNonphys) { f = m_scene.m_maxNonphys / oldSize.Y; a = f / y; @@ -2256,7 +2258,7 @@ namespace OpenSim.Region.Environment.Scenes y *= a; z *= a; } - if(oldSize.Z*z > m_scene.m_maxNonphys) + if (oldSize.Z*z > m_scene.m_maxNonphys) { f = m_scene.m_maxNonphys / oldSize.Z; a = f / z; diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 156310b..ac7e8a2 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -2245,7 +2245,7 @@ namespace OpenSim.Region.Environment.Scenes public void SetAvatarOnSitTarget(LLUUID avatarID) { m_sitTargetAvatar = avatarID; - if(ParentGroup != null) + if (ParentGroup != null) ParentGroup.TriggerScriptChangedEvent(Changed.LINK); } diff --git a/OpenSim/Region/Environment/StorageManager.cs b/OpenSim/Region/Environment/StorageManager.cs index 36c9196..c9057f2 100644 --- a/OpenSim/Region/Environment/StorageManager.cs +++ b/OpenSim/Region/Environment/StorageManager.cs @@ -79,7 +79,7 @@ namespace OpenSim.Region.Environment typeInterface = pluginType.GetInterface("IEstateDataStore", true); - if(typeInterface != null) + if (typeInterface != null) { IEstateDataStore estPlug = (IEstateDataStore) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); -- cgit v1.1