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. --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 28 +-- .../ClientStack/LindenUDP/LLPacketHandler.cs | 122 +++++----- .../Region/ClientStack/LindenUDP/LLPacketQueue.cs | 2 +- .../Region/ClientStack/LindenUDP/LLUDPServer.cs | 4 +- .../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 +- .../Modules/SvnSerialiser/SvnBackupModule.cs | 12 +- .../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 60 ++--- .../DotNetEngine/Compiler/YieldProlog/YP.cs | 2 +- .../Shared/Api/Implementation/LSL_Api.cs | 26 +- .../Shared/Api/Runtime/YieldProlog/YP.cs | 2 +- .../ScriptEngine/Shared/CodeTools/Compiler.cs | 2 +- .../Shared/CodeTools/ICodeConverter.cs | 8 +- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 8 +- 22 files changed, 368 insertions(+), 366 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 3fa26e4..7141e13 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -4737,51 +4737,51 @@ namespace OpenSim.Region.ClientStack.LindenUDP requestID = new LLUUID(transfer.TransferInfo.Params, 80); if (!(((Scene)m_scene).ExternalChecks.ExternalChecksBypassPermissions())) { - if(taskID != LLUUID.Zero) // Prim + if (taskID != LLUUID.Zero) // Prim { SceneObjectPart part = ((Scene)m_scene).GetSceneObjectPart(taskID); - if(part == null) + if (part == null) break; - if(part.OwnerID != AgentId) + if (part.OwnerID != AgentId) break; - if((part.OwnerMask & (uint)PermissionMask.Modify) == 0) + if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) break; TaskInventoryItem ti = part.GetInventoryItem(itemID); - if(ti == null) + if (ti == null) break; - if(ti.OwnerID != AgentId) + if (ti.OwnerID != AgentId) break; - if((ti.OwnerMask & ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) + if ((ti.OwnerMask & ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) break; - if(ti.AssetID != requestID) + if (ti.AssetID != requestID) break; } else // Agent { CachedUserInfo userInfo = ((Scene)m_scene).CommsManager.UserProfileCacheService.GetUserDetails(AgentId); - if(userInfo == null) + if (userInfo == null) break; - if(userInfo.RootFolder == null) + if (userInfo.RootFolder == null) break; InventoryItemBase assetRequestItem = userInfo.RootFolder.FindItem(itemID); - if(assetRequestItem == null) + if (assetRequestItem == null) { assetRequestItem = ((Scene)m_scene).CommsManager.UserProfileCacheService.libraryRoot.FindItem(itemID); - if(assetRequestItem == null) + if (assetRequestItem == null) return; } - if((assetRequestItem.CurrentPermissions & ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) + if ((assetRequestItem.CurrentPermissions & ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) break; - if(assetRequestItem.AssetID != requestID) + if (assetRequestItem.AssetID != requestID) break; } } diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs index c09da9b..11abf87 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs @@ -57,9 +57,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP void InPacket(Packet packet); void ProcessInPacket(Packet packet); void OutPacket(Packet NewPack, - ThrottleOutPacketType throttlePacketType); + ThrottleOutPacketType throttlePacketType); void OutPacket(Packet NewPack, - ThrottleOutPacketType throttlePacketType, Object id); + ThrottleOutPacketType throttlePacketType, Object id); LLPacketQueue PacketQueue { get; } void Stop(); void Flush(); @@ -136,7 +136,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // time for a linear scan. // private Dictionary m_DupeTracker = - new Dictionary(); + new Dictionary(); private uint m_DupeTrackerWindow = 30; // Values for the SimStatsReporter @@ -207,14 +207,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP // notifier. // public void OutPacket( - Packet packet, ThrottleOutPacketType throttlePacketType) + Packet packet, ThrottleOutPacketType throttlePacketType) { OutPacket(packet, throttlePacketType, null); } public void OutPacket( - Packet packet, ThrottleOutPacketType throttlePacketType, - Object id) + Packet packet, ThrottleOutPacketType throttlePacketType, + Object id) { // Call the load balancer's hook. If this is not active here // we defer to the sim server this client is actually connected @@ -224,20 +224,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP if ((m_SynchronizeClient != null) && (!m_Client.IsActive)) { if (m_SynchronizeClient(m_Client.Scene, packet, - m_Client.AgentId, throttlePacketType)) + m_Client.AgentId, throttlePacketType)) return; } packet.Header.Sequence = NextPacketSequenceNumber(); - lock(m_NeedAck) + lock (m_NeedAck) { DropResend(id); QueuePacket(packet, throttlePacketType, id); // We want to see that packet arrive if it's reliable - if(packet.Header.Reliable) + if (packet.Header.Reliable) { m_UnackedBytes += packet.ToBytes().Length; m_NeedAck[packet.Header.Sequence] = new AckData(packet, id); @@ -251,24 +251,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP { // Add acks to outgoing packets // - if(m_PendingAcks.Count > 0) - { - int count = m_PendingAcks.Count; - if(count > 10) - count = 10; - packet.Header.AckList = new uint[count]; - - int i = 0; - - foreach (uint ack in new List(m_PendingAcks.Keys)) - { - packet.Header.AckList[i] = ack; - i++; - m_PendingAcks.Remove(ack); - if (i >= 10) // That is how much space there is - break; - } - } + if (m_PendingAcks.Count > 0) + { + int count = m_PendingAcks.Count; + if (count > 10) + count = 10; + packet.Header.AckList = new uint[count]; + + int i = 0; + + foreach (uint ack in new List(m_PendingAcks.Keys)) + { + packet.Header.AckList[i] = ack; + i++; + m_PendingAcks.Remove(ack); + if (i >= 10) // That is how much space there is + break; + } + } packet.TickCount = System.Environment.TickCount; @@ -291,14 +291,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP // anything. There may not be a client there, don't clog up the // pipes. // - if(lastAck == 0) + if (lastAck == 0) return; lock (m_NeedAck) { // Nothing to do // - if(m_NeedAck.Count == 0) + if (m_NeedAck.Count == 0) return; // If we have seen no acks in s but are @@ -307,7 +307,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // then it will be dropped. // if ((((now - lastAck) > m_SilenceLimit) && - m_NeedAck.Count > 0) || m_NeedAck.Count == 0) + m_NeedAck.Count > 0) || m_NeedAck.Count == 0) { return; } @@ -336,7 +336,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // if ((now - packet.TickCount) > m_DiscardTimeout) { - if(!m_ImportantPackets.Contains(packet.Type)) + if (!m_ImportantPackets.Contains(packet.Type)) m_NeedAck.Remove(packet.Header.Sequence); TriggerOnPacketDrop(packet, data.Identifier); @@ -364,8 +364,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP // the counter reaches 250. So there is a good chance another // packet with 250 blocks exists. // - if(acks.Packets == null || - acks.Packets.Length != m_PendingAcks.Count) + if (acks.Packets == null || + acks.Packets.Length != m_PendingAcks.Count) acks.Packets = new PacketAckPacket.PacketsBlock[m_PendingAcks.Count]; int i = 0; foreach (uint ack in new List(m_PendingAcks.Keys)) @@ -389,11 +389,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP { lock (m_PendingAcks) { - if(m_PendingAcks.Count < 250) + if (m_PendingAcks.Count < 250) { - if(!m_PendingAcks.ContainsKey(packet.Header.Sequence)) - m_PendingAcks.Add(packet.Header.Sequence, - packet.Header.Sequence); + if (!m_PendingAcks.ContainsKey(packet.Header.Sequence)) + m_PendingAcks.Add(packet.Header.Sequence, + packet.Header.Sequence); return; } } @@ -405,11 +405,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP // If this is still full we have a truly exceptional // condition (means, can't happen) // - if(m_PendingAcks.Count < 250) + if (m_PendingAcks.Count < 250) { - if(!m_PendingAcks.ContainsKey(packet.Header.Sequence)) - m_PendingAcks.Add(packet.Header.Sequence, - packet.Header.Sequence); + if (!m_PendingAcks.ContainsKey(packet.Header.Sequence)) + m_PendingAcks.Add(packet.Header.Sequence, + packet.Header.Sequence); return; } } @@ -433,9 +433,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (handlerPacketStats != null) { handlerPacketStats( - m_PacketsReceived - m_PacketsReceivedReported, - m_PacketsSent - m_PacketsSentReported, - m_UnackedBytes); + m_PacketsReceived - m_PacketsReceivedReported, + m_PacketsSent - m_PacketsSentReported, + m_UnackedBytes); m_PacketsReceivedReported = m_PacketsReceived; m_PacketsSentReported = m_PacketsSent; @@ -450,12 +450,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP lock (m_DupeTracker) { Dictionary packs = - new Dictionary(m_DupeTracker); + new Dictionary(m_DupeTracker); foreach (uint pack in packs.Keys) { - if(Util.UnixTimeSinceEpoch() - m_DupeTracker[pack] > - m_DupeTrackerWindow) + if (Util.UnixTimeSinceEpoch() - m_DupeTracker[pack] > + m_DupeTrackerWindow) m_DupeTracker.Remove(pack); } } @@ -463,13 +463,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void InPacket(Packet packet) { - if(packet == null) + if (packet == null) return; // If this client is on another partial instance, no need // to handle packets // - if(!m_Client.IsActive && packet.Type != PacketType.LogoutRequest) + if (!m_Client.IsActive && packet.Type != PacketType.LogoutRequest) { PacketPool.Instance.ReturnPacket(packet); return; @@ -478,9 +478,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP // Any packet can have some packet acks in the header. // Process them here // - if(packet.Header.AppendedAcks) + if (packet.Header.AppendedAcks) { - foreach(uint id in packet.Header.AckList) + foreach (uint id in packet.Header.AckList) { ProcessAck(id); } @@ -489,12 +489,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP // When too many acks are needed to be sent, the client sends // a packet consisting of acks only // - if(packet.Type == PacketType.PacketAck) + if (packet.Type == PacketType.PacketAck) { PacketAckPacket ackPacket = (PacketAckPacket)packet; foreach (PacketAckPacket.PacketsBlock block in - ackPacket.Packets) + ackPacket.Packets) { ProcessAck(block.ID); } @@ -502,7 +502,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP PacketPool.Instance.ReturnPacket(packet); return; } - else if(packet.Type == PacketType.StartPingCheck) + else if (packet.Type == PacketType.StartPingCheck) { StartPingCheckPacket startPing = (StartPingCheckPacket)packet; CompletePingCheckPacket endPing = (CompletePingCheckPacket)PacketPool.Instance.GetPacket(PacketType.CompletePingCheck); @@ -537,7 +537,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP return; m_DupeTracker.Add(packet.Header.Sequence, - Util.UnixTimeSinceEpoch()); + Util.UnixTimeSinceEpoch()); } m_Client.ProcessInPacket(packet); @@ -560,9 +560,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP AckData data; Packet packet; - lock(m_NeedAck) + lock (m_NeedAck) { - if(!m_NeedAck.TryGetValue(id, out data)) + if (!m_NeedAck.TryGetValue(id, out data)) return; packet = data.Packet; @@ -650,7 +650,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void AddImportantPacket(PacketType type) { - if(m_ImportantPackets.Contains(type)) + if (m_ImportantPackets.Contains(type)) return; m_ImportantPackets.Add(type); @@ -658,7 +658,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void RemoveImportantPacket(PacketType type) { - if(!m_ImportantPackets.Contains(type)) + if (!m_ImportantPackets.Contains(type)) return; m_ImportantPackets.Remove(type); @@ -668,7 +668,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { foreach (AckData data in new List(m_NeedAck.Values)) { - if(data.Identifier != null && data.Identifier == id) + if (data.Identifier != null && data.Identifier == id) { m_NeedAck.Remove(data.Packet.Header.Sequence); return; @@ -680,7 +680,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { PacketDrop handlerPacketDrop = OnPacketDrop; - if(handlerPacketDrop == null) + if (handlerPacketDrop == null) return; handlerPacketDrop(packet, id); diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs index 96f8ac6..aed9465 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs @@ -338,7 +338,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (TaskThrottle.UnderLimit() && (TaskOutgoingPacketQueue.Count > 0 || TaskLowpriorityPacketQueue.Count > 0)) { LLQueItem qpack; - if(TaskOutgoingPacketQueue.Count > 0) + if (TaskOutgoingPacketQueue.Count > 0) { qpack = TaskOutgoingPacketQueue.Dequeue(); SendQueue.PriorityEnqueue(qpack); diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 321c2ff..28f5a32 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -380,8 +380,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP //Slave regions don't accept new clients if (m_localScene.Region_Status != RegionStatus.SlaveScene) { - if (!(packet is UseCircuitCodePacket)) - return; + if (!(packet is UseCircuitCodePacket)) + return; UseCircuitCodePacket useCircuit = (UseCircuitCodePacket) packet; lock (clientCircuits) { 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())); diff --git a/OpenSim/Region/Modules/SvnSerialiser/SvnBackupModule.cs b/OpenSim/Region/Modules/SvnSerialiser/SvnBackupModule.cs index 9f5e5a3..a1c1b88 100644 --- a/OpenSim/Region/Modules/SvnSerialiser/SvnBackupModule.cs +++ b/OpenSim/Region/Modules/SvnSerialiser/SvnBackupModule.cs @@ -212,11 +212,12 @@ namespace OpenSim.Region.Modules.SvnSerialiser { m_scenes.Add(scene); } - //Only register it once, to prevend command being executed x*region times - if(m_scenes.Count ==1) { - scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; - } - } + //Only register it once, to prevent command being executed x*region times + if (m_scenes.Count == 1) + { + scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; + } + } public void PostInitialise() { @@ -341,7 +342,6 @@ namespace OpenSim.Region.Modules.SvnSerialiser } } - public void LoadAllScenes(int revision) { CheckoutSvn(new SvnRevision(revision)); diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 3129c19..da1e511 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -425,8 +425,8 @@ namespace OpenSim.Region.ScriptEngine.Common m_host.AddScriptLPS(1); double x,y,z,s; int f=0; - // Important Note: q1= is equal to q2=<-x,-y,-z,-s> - // Computing quaternion x,y,z,s values + // Important Note: q1= is equal to q2=<-x,-y,-z,-s> + // Computing quaternion x,y,z,s values x = ((fwd.x - left.y - up.z + 1) / 4); x *= x; x = Math.Sqrt(Math.Sqrt(x)); @@ -440,11 +440,11 @@ namespace OpenSim.Region.ScriptEngine.Common s *= s; s = Math.Sqrt(Math.Sqrt(s)); - // Set f for signs detection - if (fwd.y+left.x >= 0){f+=1;} - if (fwd.z+up.x >= 0){f+=2;} - if (left.z-up.y >= 0){f+=4;} - // Set correct quaternion signs based on f value + // Set f for signs detection + if (fwd.y+left.x >= 0){f+=1;} + if (fwd.z+up.x >= 0){f+=2;} + if (left.z-up.y >= 0){f+=4;} + // Set correct quaternion signs based on f value if (f == 0) { x = -x; } if (f == 1) { x = -x; y = -y; } if (f == 2) { x = -x; z = -z; } @@ -459,7 +459,7 @@ namespace OpenSim.Region.ScriptEngine.Common if (llVecDist(llRot2Fwd(result), fwd) > 0.001 || llVecDist(llRot2Left(result), left) > 0.001) result.s = -s; - return result; + return result; } public LSL_Types.Vector3 llRot2Fwd(LSL_Types.Quaternion r) @@ -950,19 +950,19 @@ namespace OpenSim.Region.ScriptEngine.Common if (value == 1) { SceneObjectGroup group = m_host.ParentGroup; - if(group == null) + if (group == null) return; bool allow = true; - foreach(SceneObjectPart part in group.Children.Values) + foreach (SceneObjectPart part in group.Children.Values) { - if(part.Scale.X > World.m_maxPhys || part.Scale.Y > World.m_maxPhys || part.Scale.Z > World.m_maxPhys) + if (part.Scale.X > World.m_maxPhys || part.Scale.Y > World.m_maxPhys || part.Scale.Z > World.m_maxPhys) { allow = false; break; } } - if(!allow) + if (!allow) return; m_host.ScriptSetPhysicsStatus(true); } @@ -1083,23 +1083,23 @@ namespace OpenSim.Region.ScriptEngine.Common { // TODO: this needs to trigger a persistance save as well - if(part == null || part.ParentGroup == null || part.ParentGroup.RootPart == null) + if (part == null || part.ParentGroup == null || part.ParentGroup.RootPart == null) return; - if(part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical) + if (part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical) { - if(scale.x > World.m_maxPhys) + if (scale.x > World.m_maxPhys) scale.x = World.m_maxPhys; - if(scale.y > World.m_maxPhys) + if (scale.y > World.m_maxPhys) scale.y = World.m_maxPhys; - if(scale.z > World.m_maxPhys) + if (scale.z > World.m_maxPhys) scale.z = World.m_maxPhys; } - if(scale.x > World.m_maxNonphys) + if (scale.x > World.m_maxNonphys) scale.x = World.m_maxNonphys; - if(scale.y > World.m_maxNonphys) + if (scale.y > World.m_maxNonphys) scale.y = World.m_maxNonphys; - if(scale.z > World.m_maxNonphys) + if (scale.z > World.m_maxNonphys) scale.z = World.m_maxNonphys; LLVector3 tmp = part.Scale; tmp.X = (float)scale.x; @@ -6776,7 +6776,7 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.Vector3 llGetCameraPos() { - m_host.AddScriptLPS(1); + m_host.AddScriptLPS(1); LLUUID invItemID=InventorySelf(); if (invItemID == LLUUID.Zero) return new LSL_Types.Vector3(); @@ -6784,16 +6784,16 @@ namespace OpenSim.Region.ScriptEngine.Common return new LSL_Types.Vector3(); if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRACK_CAMERA) == 0) { - ShoutError("No permissions to track the camera"); + ShoutError("No permissions to track the camera"); return new LSL_Types.Vector3(); } - ScenePresence presence = World.GetScenePresence(m_host.OwnerID); - if(presence != null) - { - LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z); - return pos; - } - return new LSL_Types.Vector3(); + ScenePresence presence = World.GetScenePresence(m_host.OwnerID); + if (presence != null) + { + LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z); + return pos; + } + return new LSL_Types.Vector3(); } public LSL_Types.Quaternion llGetCameraRot() @@ -6968,7 +6968,7 @@ namespace OpenSim.Region.ScriptEngine.Common { m_host.AddScriptLPS(1); IEstateModule estate = World.RequestModuleInterface(); - if(estate == null) + if (estate == null) return 67108864; return estate.GetRegionFlags(); } diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs index 537c114..ac56875 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs @@ -2108,7 +2108,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog string results = ""; for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) { - //Console.WriteLine( m ); + //Console.WriteLine( m ); results += presep+ m + postsep; } return results; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index ac4d43a..a5c5453 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -790,19 +790,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (value == 1) { SceneObjectGroup group = m_host.ParentGroup; - if(group == null) + if (group == null) return; bool allow = true; - foreach(SceneObjectPart part in group.Children.Values) + foreach (SceneObjectPart part in group.Children.Values) { - if(part.Scale.X > World.m_maxPhys || part.Scale.Y > World.m_maxPhys || part.Scale.Z > World.m_maxPhys) + if (part.Scale.X > World.m_maxPhys || part.Scale.Y > World.m_maxPhys || part.Scale.Z > World.m_maxPhys) { allow = false; break; } } - if(!allow) + if (!allow) return; m_host.ScriptSetPhysicsStatus(true); } @@ -937,23 +937,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { // TODO: this needs to trigger a persistance save as well - if(part == null || part.ParentGroup == null || part.ParentGroup.RootPart == null) + if (part == null || part.ParentGroup == null || part.ParentGroup.RootPart == null) return; - if(part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical) + if (part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical) { - if(scale.x > World.m_maxPhys) + if (scale.x > World.m_maxPhys) scale.x = World.m_maxPhys; - if(scale.y > World.m_maxPhys) + if (scale.y > World.m_maxPhys) scale.y = World.m_maxPhys; - if(scale.z > World.m_maxPhys) + if (scale.z > World.m_maxPhys) scale.z = World.m_maxPhys; } - if(scale.x > World.m_maxNonphys) + if (scale.x > World.m_maxNonphys) scale.x = World.m_maxNonphys; - if(scale.y > World.m_maxNonphys) + if (scale.y > World.m_maxNonphys) scale.y = World.m_maxNonphys; - if(scale.z > World.m_maxNonphys) + if (scale.z > World.m_maxNonphys) scale.z = World.m_maxNonphys; LLVector3 tmp = part.Scale; tmp.X = (float)scale.x; @@ -6748,7 +6748,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); IEstateModule estate = World.RequestModuleInterface(); - if(estate == null) + if (estate == null) return 67108864; return (int)estate.GetRegionFlags(); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs index 17f2f1c..76e307a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs @@ -2108,7 +2108,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog string results = ""; for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) { - //Console.WriteLine( m ); + //Console.WriteLine( m ); results += presep+ m + postsep; } return results; diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index f7b6d08..e8cfdf7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs @@ -327,7 +327,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools { // Its LSL, convert it to C# //compileScript = LSL_Converter.Convert(Script); - if(m_UseCompiler) + if (m_UseCompiler) LSL_Converter = (ICodeConverter)new CSCodeGenerator(); else LSL_Converter = (ICodeConverter)new LSL2CSConverter(); diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/ICodeConverter.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/ICodeConverter.cs index a57530c..28e42da 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/ICodeConverter.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/ICodeConverter.cs @@ -30,8 +30,8 @@ using System; namespace OpenSim.Region.ScriptEngine.Shared.CodeTools { - public interface ICodeConverter - { - string Convert(string script); - } + public interface ICodeConverter + { + string Convert(string script); + } } diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 9f67dc1..673189a 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -1191,8 +1191,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine if (result == null) return true; - if(!m_InSelfDelete) - result.Abort(); + if (!m_InSelfDelete) + result.Abort(); lock (m_EventQueue) { @@ -1342,10 +1342,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine e.ToString()); } } - else if((e is TargetInvocationException) && (e.InnerException is SelfDeleteException)) + else if ((e is TargetInvocationException) && (e.InnerException is SelfDeleteException)) { m_InSelfDelete = true; - if(part != null && part.ParentGroup != null) + if (part != null && part.ParentGroup != null) m_Engine.World.DeleteSceneObject(part.ParentGroup); } } -- cgit v1.1