Browse Source

Update svn properties. Formatting cleanup.

Jeff Ames 16 years ago
parent
commit
0462510956

+ 5 - 5
CONTRIBUTORS.txt

@@ -23,9 +23,10 @@ OpenSim Developers
 * Danx0r
 * Dalien
 * Darok
-* chi11ken (3Di)
-* adjohn (3Di)
+* chi11ken (Genkii)
+* adjohn (Genkii)
 * Alondria
+* Dr Scofield (IBM)
 
 
 Patches
@@ -38,7 +39,6 @@ Patches
 * daTwitch 
 * mikkopa/_someone - RealXtend
 * openlifegrid.com
-* Dr Scofield (IBM)
 * Daedius
 * alex_carnell
 * webmage (IBM)
@@ -81,8 +81,8 @@ This software uses components from the following developers:
 * NUnit (http://www.nunit.org)
 * AGEIA Inc. (PhysX)
 * Russel L. Smith (ODE)
-* Prebuild ( http://sourceforge.net/projects/dnpb/ )
-* LibSecondLife ( http://www.libsecondlife.org/wiki/Main_Page )
+* Prebuild (http://sourceforge.net/projects/dnpb/)
+* LibSecondLife (http://www.libsecondlife.org/wiki/Main_Page)
 
 
 In addition, we would like to thank:

+ 7 - 5
OpenSim/Data/MySQL/MySQLGridData.cs

@@ -53,9 +53,12 @@ namespace OpenSim.Data.MySQL
         /// </summary>
         override public void Initialise(string connect)
         {
-            if (connect != String.Empty) {
+            if (connect != String.Empty)
+            {
                 database = new MySQLManager(connect);
-            } else {
+            }
+            else
+            {
                 m_log.Warn("Using deprecated mysql_connection.ini.  Please update database_connect in GridServer_Config.xml and we'll use that instead");
                 IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini");
                 string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname");
@@ -65,9 +68,8 @@ namespace OpenSim.Data.MySQL
                 string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling");
                 string settingPort = GridDataMySqlFile.ParseFileReadValue("port");
 
-                database =
-                    new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling,
-                                     settingPort);
+                database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword,
+                                            settingPooling, settingPort);
             }
 
             TestTables();

+ 1 - 1
OpenSim/Data/MySQL/MySQLInventoryData.cs

@@ -50,7 +50,7 @@ namespace OpenSim.Data.MySQL
 
         public void Initialise(string connect)
         {
-            if(connect != String.Empty)
+            if (connect != String.Empty)
             {
                 database = new MySQLManager(connect);
             }

+ 8 - 6
OpenSim/Data/MySQL/MySQLLogData.cs

@@ -34,7 +34,7 @@ namespace OpenSim.Data.MySQL
     /// An interface to the log database for MySQL
     /// </summary>
     internal class MySQLLogData : ILogData
-    { 
+    {
         private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
         /// <summary>
         /// The database manager
@@ -46,9 +46,12 @@ namespace OpenSim.Data.MySQL
         /// </summary>
         public void Initialise(string connect)
         {
-            if (connect != String.Empty) {
+            if (connect != String.Empty)
+            {
                 database = new MySQLManager(connect);
-            } else {
+            }
+            else
+            {
                 m_log.Warn("Using deprecated mysql_connection.ini.  Please update database_connect in GridServer_Config.xml and we'll use that instead");
 
                 IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini");
@@ -59,9 +62,8 @@ namespace OpenSim.Data.MySQL
                 string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling");
                 string settingPort = GridDataMySqlFile.ParseFileReadValue("port");
 
-                database =
-                    new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling,
-                                     settingPort);
+                database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword,
+                                            settingPooling, settingPort);
             }
         }
 

+ 7 - 7
OpenSim/Framework/Communications/CommunicationsManager.cs

@@ -255,28 +255,28 @@ namespace OpenSim.Framework.Communications
                     remote_client.SendNameReply(uuid, names[0], names[1]);
                 }
 
-            }  
+            }
         }
 
         private string[] doUUIDNameRequest(LLUUID uuid)
         {
             string[] returnstring = new string[0];
             bool doLookup = false;
-            
-            
+
+
             lock (m_nameRequestCache)
             {
                 if (m_nameRequestCache.ContainsKey(uuid))
                 {
                     returnstring = m_nameRequestCache[uuid];
                 }
-                else 
+                else
                 {
                     // we don't want to lock the dictionary while we're doing the lookup
                     doLookup = true;
                 }
             }
-                
+
             if (doLookup) {
                 UserProfileData profileData = m_userService.GetUserProfile(uuid);
                 if (profileData != null)
@@ -293,7 +293,7 @@ namespace OpenSim.Framework.Communications
                 }
             }
             return returnstring;
-            
+
         }
 
         public bool UUIDNameCachedTest(LLUUID uuid)
@@ -311,7 +311,7 @@ namespace OpenSim.Framework.Communications
                 string lastname = names[1];
 
                 return firstname + " " + lastname;
-            
+
             }
             return "(hippos)";
         }

+ 10 - 5
OpenSim/Framework/Servers/BaseHttpServer.cs

@@ -84,7 +84,8 @@ namespace OpenSim.Framework.Servers
 
             string handlerKey = GetHandlerKey(httpMethod, path);
 
-            lock(m_streamHandlers) {
+            lock (m_streamHandlers)
+            {
                 if (!m_streamHandlers.ContainsKey(handlerKey))
                 {
                     //m_log.DebugFormat("[BASE HTTP SERVER]: Adding handler key {0}", handlerKey);
@@ -100,7 +101,8 @@ namespace OpenSim.Framework.Servers
 
         public bool AddXmlRPCHandler(string method, XmlRpcMethod handler)
         {
-            lock(m_rpcHandlers) {
+            lock (m_rpcHandlers)
+            {
                 if (!m_rpcHandlers.ContainsKey(method))
                 {
                     m_rpcHandlers.Add(method, handler);
@@ -114,7 +116,8 @@ namespace OpenSim.Framework.Servers
 
         public bool AddHTTPHandler(string method, GenericHTTPMethod handler)
         {
-            lock(m_HTTPHandlers) {
+            lock (m_HTTPHandlers)
+            {
                 if (!m_HTTPHandlers.ContainsKey(method))
                 {
                     m_HTTPHandlers.Add(method, handler);
@@ -132,7 +135,8 @@ namespace OpenSim.Framework.Servers
 
         public bool AddAgentHandler(string agent, IHttpAgentHandler handler)
         {
-            lock(m_agentHandlers) {
+            lock (m_agentHandlers)
+            {
                 if (!m_agentHandlers.ContainsKey(agent))
                 {
                     m_agentHandlers.Add(agent, handler);
@@ -171,7 +175,8 @@ namespace OpenSim.Framework.Servers
 
                     if (TryGetAgentHandler(request, response, out agentHandler))
                     {
-                        if (HandleAgentRequest(agentHandler, request, response)) {
+                        if (HandleAgentRequest(agentHandler, request, response))
+                        {
                             m_log.DebugFormat("[HTTP-AGENT] Handler located for {0}", request.UserAgent);
                             return;
                         }

+ 1 - 1
OpenSim/Framework/Servers/OSHttpRequestPump.cs

@@ -47,7 +47,7 @@ namespace OpenSim.Framework.Servers
         public static OSHttpRequestPump[] Pumps(OSHttpServer server, int poolSize)
         {
             OSHttpRequestPump[] pumps = new OSHttpRequestPump[poolSize];
-            for(int i = 0; i < pumps.Length; i++)
+            for (int i = 0; i < pumps.Length; i++)
             {
                 pumps[i]._httpServer = server;
             }

+ 6 - 6
OpenSim/Framework/Servers/OSHttpServer.cs

@@ -58,7 +58,7 @@ namespace OpenSim.Framework.Servers
 
         // thread identifier
         protected string _engineId;
-        public string EngineID 
+        public string EngineID
         {
             get { return _engineId; }
         }
@@ -86,7 +86,7 @@ namespace OpenSim.Framework.Servers
         /// <summary>
         /// Instantiate an HTTPS server.
         /// </summary>
-        public OSHttpServer(IPAddress address, int port, X509Certificate certificate, int poolSize) : 
+        public OSHttpServer(IPAddress address, int port, X509Certificate certificate, int poolSize) :
         this(address, port, poolSize)
         {
             _engineId = String.Format("OSHttpServer [HTTPS:{0}/ps:{1}]", port, poolSize);
@@ -96,7 +96,7 @@ namespace OpenSim.Framework.Servers
         /// <summary>
         /// Start the HTTP server engine.
         /// </summary>
-        public void Start() 
+        public void Start()
         {
             _engine = new Thread(new ThreadStart(Engine));
             _engine.Name = _engineId;
@@ -107,13 +107,13 @@ namespace OpenSim.Framework.Servers
 
         /// <summary>
         /// </summary>
-        private void Engine() 
+        private void Engine()
         {
-            while (true) 
+            while (true)
             {
                 // do stuff
             }
         }
-        
+
     }
 }

+ 134 - 176
OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs

@@ -47,7 +47,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
 {
     public delegate bool PacketMethod(IClientAPI simClient, Packet packet);
 
-    public class PacketDupeLimiter 
+    public class PacketDupeLimiter
     {
         public PacketType pktype;
         public int timeIn;
@@ -658,7 +658,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                 {
                     // this will normally trigger at least one packet (ping response)
                     SendStartPingCheck(0);
-
                 }
             }
             else
@@ -666,7 +665,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                 // Something received in the meantime - we can reset the counters
                 m_probesWithNoIngressPackets = 0;
                 m_lastPacketsReceived = m_packetsReceived;
-
             }
             //SendPacketStats();
         }
@@ -726,7 +724,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
         // Previously ClientView.API partial class
         public event Action<IClientAPI> OnLogout;
         public event ObjectPermissions OnObjectPermissions;
-
         public event Action<IClientAPI> OnConnectionClosed;
         public event ViewerEffectEventHandler OnViewerEffect;
         public event ImprovedInstantMessage OnInstantMessage;
@@ -788,12 +785,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
         public event DisconnectUser OnDisconnectUser;
         public event RequestAvatarProperties OnRequestAvatarProperties;
         public event SetAlwaysRun OnSetAlwaysRun;
-
         public event FetchInventory OnAgentDataUpdateRequest;
         public event FetchInventory OnUserInfoRequest;
         public event TeleportLocationRequest OnSetStartLocationRequest;
         public event UpdateAvatarProperties OnUpdateAvatarProperties;
-
         public event CreateNewInventoryItem OnCreateNewInventoryItem;
         public event CreateInventoryFolder OnCreateNewInventoryFolder;
         public event UpdateInventoryFolder OnUpdateInventoryFolder;
@@ -816,9 +811,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
         public event MoveTaskInventory OnMoveTaskItem;
         public event RemoveTaskInventory OnRemoveTaskItem;
         public event RequestAsset OnRequestAsset;
-
         public event UUIDNameRequest OnNameFromUUIDRequest;
-
         public event ParcelAccessListRequest OnParcelAccessListRequest;
         public event ParcelAccessListUpdateRequest OnParcelAccessListUpdateRequest;
         public event ParcelPropertiesRequest OnParcelPropertiesRequest;
@@ -829,36 +822,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP
         public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest;
         public event ParcelAbandonRequest OnParcelAbandonRequest;
         public event ParcelReturnObjectsRequest OnParcelReturnObjectsRequest;
-
         public event RegionInfoRequest OnRegionInfoRequest;
         public event EstateCovenantRequest OnEstateCovenantRequest;
-
         public event FriendActionDelegate OnApproveFriendRequest;
         public event FriendActionDelegate OnDenyFriendRequest;
         public event FriendshipTermination OnTerminateFriendship;
-
         public event PacketStats OnPacketStats;
-
         public event MoneyTransferRequest OnMoneyTransferRequest;
         public event EconomyDataRequest OnEconomyDataRequest;
-
         public event MoneyBalanceRequest OnMoneyBalanceRequest;
         public event ParcelBuy OnParcelBuy;
-
         public event UUIDNameRequest OnTeleportHomeRequest;
-
         public event UUIDNameRequest OnUUIDGroupNameRequest;
-
         public event ScriptAnswer OnScriptAnswer;
         public event RequestPayPrice OnRequestPayPrice;
         public event AgentSit OnUndo;
-
         public event ForceReleaseControls OnForceReleaseControls;
-
         public event GodLandStatRequest OnLandStatRequest;
-
         public event RequestObjectPropertiesFamily OnObjectGroupRequest;
-
         public event DetailedEstateDataRequest OnDetailedEstateDataRequest;
         public event SetEstateFlagsRequest OnSetEstateFlagsRequest;
         public event SetEstateTerrainBaseTexture OnSetEstateTerrainBaseTexture;
@@ -1049,7 +1030,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
             //}
         }
 
-
         private void DoSendLayerData(object o)
         {
             float[] map = (float[])o;
@@ -1083,7 +1063,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
             OutPacket(layerpack, ThrottleOutPacketType.Land);
         }
 
-
         /// <summary>
         /// Sends a specified patch to a client
         /// </summary>
@@ -1449,7 +1428,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
 
                 if (i < MAX_ITEMS_PER_PACKET)
                 {
-
                     OutPacket(descend, ThrottleOutPacketType.Asset);
                 }
             }
@@ -1748,7 +1726,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
             economyData.Info.TeleportPriceExponent = TeleportPriceExponent;
             economyData.Header.Reliable = true;
             OutPacket(economyData, ThrottleOutPacketType.Unknown);
-
         }
 
         public void SendAvatarPickerReply(AvatarPickerReplyAgentDataArgs AgentData, List<AvatarPickerReplyDataArgs> Data)
@@ -2209,7 +2186,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
 
             ObjectUpdatePacket outPacket = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate);
 
-            
+
 
             // TODO: don't create new blocks if recycling an old packet
             outPacket.RegionData.RegionHandle = regionHandle;
@@ -2256,8 +2233,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
             outPacket.ObjectData[0].OwnerID = ownerID;
             outPacket.ObjectData[0].Gain    = (float) SoundGain;
             outPacket.ObjectData[0].Radius  = (float) SoundRadius;
-            outPacket.ObjectData[0].Flags   = SoundFlags; 
-
+            outPacket.ObjectData[0].Flags   = SoundFlags;
 
             byte[] pb = pos.GetBytes();
             Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
@@ -2318,6 +2294,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
             terse.Header.Zerocoded = true;
             OutPacket(terse, ThrottleOutPacketType.Task);
         }
+
         public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, LLUUID AssetFullID)
         {
             AssetUploadCompletePacket newPack = new AssetUploadCompletePacket();
@@ -2327,6 +2304,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
             newPack.Header.Zerocoded = true;
             OutPacket(newPack, ThrottleOutPacketType.Asset);
         }
+
         public void SendXferRequest(ulong XferID, short AssetType, LLUUID vFileID, byte FilePath, byte[] FileName)
         {
             RequestXferPacket newPack = new RequestXferPacket();
@@ -2337,8 +2315,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
             newPack.XferID.Filename = FileName;
             newPack.Header.Zerocoded = true;
             OutPacket(newPack, ThrottleOutPacketType.Asset);
-
         }
+
         public void SendConfirmXfer(ulong xferID, uint PacketID)
         {
             ConfirmXferPacketPacket newPack = new ConfirmXferPacketPacket();
@@ -2347,6 +2325,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
             newPack.Header.Zerocoded = true;
             OutPacket(newPack, ThrottleOutPacketType.Asset);
         }
+
         public void SendImagePart(ushort numParts, LLUUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec)
         {
             ImageDataPacket im = new ImageDataPacket();
@@ -2362,6 +2341,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
             im.Header.Zerocoded = true;
             OutPacket(im, ThrottleOutPacketType.Texture);
         }
+
         public void SendShutdownConnectionNotice()
         {
             OutPacket(PacketPool.Instance.GetPacket(PacketType.DisableSimulator), ThrottleOutPacketType.Unknown);
@@ -2449,125 +2429,126 @@ namespace OpenSim.Region.ClientStack.LindenUDP
         #endregion
 
         #region Estate Data Sending Methods
-            private bool convertParamStringToBool(byte[] field)
-            {
-                string s = Helpers.FieldToUTF8String(field);
-                if (s == "1" || s.ToLower() == "y" || s.ToLower() == "yes" || s.ToLower() == "t" || s.ToLower() == "true")
-                {
-                    return true;
-                }
-                return false;
-            }
 
-            public void sendEstateManagersList(LLUUID invoice, LLUUID[] EstateManagers, uint estateID)
+        private bool convertParamStringToBool(byte[] field)
+        {
+            string s = Helpers.FieldToUTF8String(field);
+            if (s == "1" || s.ToLower() == "y" || s.ToLower() == "yes" || s.ToLower() == "t" || s.ToLower() == "true")
             {
-                EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket();
-                packet.AgentData.TransactionID = LLUUID.Random();
-                packet.AgentData.AgentID = this.AgentId;
-                packet.AgentData.SessionID = this.SessionId;
-                packet.MethodData.Invoice = invoice;
-                packet.MethodData.Method = Helpers.StringToField("setaccess");
+                return true;
+            }
+            return false;
+        }
 
-                EstateOwnerMessagePacket.ParamListBlock[] returnblock = new EstateOwnerMessagePacket.ParamListBlock[6 + EstateManagers.Length];
+        public void sendEstateManagersList(LLUUID invoice, LLUUID[] EstateManagers, uint estateID)
+        {
+            EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket();
+            packet.AgentData.TransactionID = LLUUID.Random();
+            packet.AgentData.AgentID = this.AgentId;
+            packet.AgentData.SessionID = this.SessionId;
+            packet.MethodData.Invoice = invoice;
+            packet.MethodData.Method = Helpers.StringToField("setaccess");
 
-                for (int i = 0; i < (6 + EstateManagers.Length); i++)
-                {
-                    returnblock[i] = new EstateOwnerMessagePacket.ParamListBlock();
-                }
-                int j = 0;
-
-                returnblock[j].Parameter = Helpers.StringToField(estateID.ToString()); j++;
-                returnblock[j].Parameter = Helpers.StringToField(((int)Constants.EstateAccessCodex.EstateManagers).ToString()); j++;
-                returnblock[j].Parameter = Helpers.StringToField("0"); j++;
-                returnblock[j].Parameter = Helpers.StringToField("0"); j++;
-                returnblock[j].Parameter = Helpers.StringToField("0"); j++;
-                returnblock[j].Parameter = Helpers.StringToField(EstateManagers.Length.ToString()); j++;
-                for (int i = 0; i < EstateManagers.Length; i++)
-                {
-                    returnblock[j].Parameter = EstateManagers[i].GetBytes(); j++;
-                }
-                packet.ParamList = returnblock;
-                packet.Header.Reliable = false;
-                this.OutPacket(packet, ThrottleOutPacketType.Task);
-            }
+            EstateOwnerMessagePacket.ParamListBlock[] returnblock = new EstateOwnerMessagePacket.ParamListBlock[6 + EstateManagers.Length];
 
-            public void sendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args)
+            for (int i = 0; i < (6 + EstateManagers.Length); i++)
             {
-                RegionInfoPacket rinfopack = new RegionInfoPacket();
-                RegionInfoPacket.RegionInfoBlock rinfoblk = new RegionInfoPacket.RegionInfoBlock();
-                rinfopack.AgentData.AgentID = this.AgentId;
-                rinfopack.AgentData.SessionID = this.SessionId;
-                rinfoblk.BillableFactor =args.billableFactor;
-                rinfoblk.EstateID = args.estateID;
-                rinfoblk.MaxAgents = args.maxAgents;
-                rinfoblk.ObjectBonusFactor =args.objectBonusFactor;
-                rinfoblk.ParentEstateID = args.parentEstateID;
-                rinfoblk.PricePerMeter = args.pricePerMeter;
-                rinfoblk.RedirectGridX = args.redirectGridX;
-                rinfoblk.RedirectGridY = args.redirectGridY;
-                rinfoblk.RegionFlags = args.regionFlags;
-                rinfoblk.SimAccess = args.simAccess;
-                rinfoblk.SunHour = args.sunHour;
-                rinfoblk.TerrainLowerLimit = args.terrainLowerLimit;
-                rinfoblk.TerrainRaiseLimit = args.terrainRaiseLimit;
-                rinfoblk.UseEstateSun = args.useEstateSun;
-                rinfoblk.WaterHeight = args.waterHeight;
-                rinfoblk.SimName = Helpers.StringToField(args.simName);
-
-
-                rinfopack.RegionInfo = rinfoblk;
-
-                this.OutPacket(rinfopack, ThrottleOutPacketType.Task);
+                returnblock[i] = new EstateOwnerMessagePacket.ParamListBlock();
             }
-
-            public void sendEstateCovenantInformation()
+            int j = 0;
+
+            returnblock[j].Parameter = Helpers.StringToField(estateID.ToString()); j++;
+            returnblock[j].Parameter = Helpers.StringToField(((int)Constants.EstateAccessCodex.EstateManagers).ToString()); j++;
+            returnblock[j].Parameter = Helpers.StringToField("0"); j++;
+            returnblock[j].Parameter = Helpers.StringToField("0"); j++;
+            returnblock[j].Parameter = Helpers.StringToField("0"); j++;
+            returnblock[j].Parameter = Helpers.StringToField(EstateManagers.Length.ToString()); j++;
+            for (int i = 0; i < EstateManagers.Length; i++)
             {
-                EstateCovenantReplyPacket einfopack = new EstateCovenantReplyPacket();
-                EstateCovenantReplyPacket.DataBlock edata = new EstateCovenantReplyPacket.DataBlock();
-                edata.CovenantID = m_scene.RegionInfo.CovenantID;
-                edata.CovenantTimestamp = 0;
-                edata.EstateOwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;
-                edata.EstateName =
-                    Helpers.StringToField(m_scene.RegionInfo.MasterAvatarFirstName + " " + m_scene.RegionInfo.MasterAvatarLastName);
-                einfopack.Data = edata;
-                this.OutPacket(einfopack, ThrottleOutPacketType.Task);
+                returnblock[j].Parameter = EstateManagers[i].GetBytes(); j++;
             }
+            packet.ParamList = returnblock;
+            packet.Header.Reliable = false;
+            this.OutPacket(packet, ThrottleOutPacketType.Task);
+        }
 
-            public void sendDetailedEstateData(LLUUID invoice, string estateName, uint estateID)
+        public void sendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args)
+        {
+            RegionInfoPacket rinfopack = new RegionInfoPacket();
+            RegionInfoPacket.RegionInfoBlock rinfoblk = new RegionInfoPacket.RegionInfoBlock();
+            rinfopack.AgentData.AgentID = this.AgentId;
+            rinfopack.AgentData.SessionID = this.SessionId;
+            rinfoblk.BillableFactor =args.billableFactor;
+            rinfoblk.EstateID = args.estateID;
+            rinfoblk.MaxAgents = args.maxAgents;
+            rinfoblk.ObjectBonusFactor =args.objectBonusFactor;
+            rinfoblk.ParentEstateID = args.parentEstateID;
+            rinfoblk.PricePerMeter = args.pricePerMeter;
+            rinfoblk.RedirectGridX = args.redirectGridX;
+            rinfoblk.RedirectGridY = args.redirectGridY;
+            rinfoblk.RegionFlags = args.regionFlags;
+            rinfoblk.SimAccess = args.simAccess;
+            rinfoblk.SunHour = args.sunHour;
+            rinfoblk.TerrainLowerLimit = args.terrainLowerLimit;
+            rinfoblk.TerrainRaiseLimit = args.terrainRaiseLimit;
+            rinfoblk.UseEstateSun = args.useEstateSun;
+            rinfoblk.WaterHeight = args.waterHeight;
+            rinfoblk.SimName = Helpers.StringToField(args.simName);
+
+            rinfopack.RegionInfo = rinfoblk;
+
+            this.OutPacket(rinfopack, ThrottleOutPacketType.Task);
+        }
+
+        public void sendEstateCovenantInformation()
+        {
+            EstateCovenantReplyPacket einfopack = new EstateCovenantReplyPacket();
+            EstateCovenantReplyPacket.DataBlock edata = new EstateCovenantReplyPacket.DataBlock();
+            edata.CovenantID = m_scene.RegionInfo.CovenantID;
+            edata.CovenantTimestamp = 0;
+            edata.EstateOwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;
+            edata.EstateName =
+                Helpers.StringToField(m_scene.RegionInfo.MasterAvatarFirstName + " " + m_scene.RegionInfo.MasterAvatarLastName);
+            einfopack.Data = edata;
+            this.OutPacket(einfopack, ThrottleOutPacketType.Task);
+        }
+
+        public void sendDetailedEstateData(LLUUID invoice, string estateName, uint estateID)
+        {
+            EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket();
+            packet.MethodData.Invoice = invoice;
+            packet.AgentData.TransactionID = LLUUID.Random();
+            packet.MethodData.Method = Helpers.StringToField("estateupdateinfo");
+            EstateOwnerMessagePacket.ParamListBlock[] returnblock = new EstateOwnerMessagePacket.ParamListBlock[9];
+
+            for (int i = 0; i < 9; i++)
             {
-                EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket();
-                packet.MethodData.Invoice = invoice;
-                packet.AgentData.TransactionID = LLUUID.Random();
-                packet.MethodData.Method = Helpers.StringToField("estateupdateinfo");
-                EstateOwnerMessagePacket.ParamListBlock[] returnblock = new EstateOwnerMessagePacket.ParamListBlock[9];
-
-                for (int i = 0; i < 9; i++)
-                {
-                    returnblock[i] = new EstateOwnerMessagePacket.ParamListBlock();
-                }
-
-                //Sending Estate Settings
-                returnblock[0].Parameter = Helpers.StringToField(estateName);
-                returnblock[1].Parameter = Helpers.StringToField(m_scene.RegionInfo.MasterAvatarAssignedUUID.ToString());
-                returnblock[2].Parameter = Helpers.StringToField(estateID.ToString());
-
-                // TODO: Resolve Magic numbers here
-                returnblock[3].Parameter = Helpers.StringToField("269516800");
-                returnblock[4].Parameter = Helpers.StringToField("0");
-                returnblock[5].Parameter = Helpers.StringToField("1");
-                returnblock[6].Parameter = Helpers.StringToField(m_scene.RegionInfo.RegionID.ToString());
-                returnblock[7].Parameter = Helpers.StringToField("1160895077");
-                returnblock[8].Parameter = Helpers.StringToField("1");
-
-                packet.ParamList = returnblock;
-                packet.Header.Reliable = false;
-                //System.Console.WriteLine("[ESTATE]: SIM--->" + packet.ToString());
-                this.OutPacket(packet, ThrottleOutPacketType.Task);
+                returnblock[i] = new EstateOwnerMessagePacket.ParamListBlock();
             }
 
+            //Sending Estate Settings
+            returnblock[0].Parameter = Helpers.StringToField(estateName);
+            returnblock[1].Parameter = Helpers.StringToField(m_scene.RegionInfo.MasterAvatarAssignedUUID.ToString());
+            returnblock[2].Parameter = Helpers.StringToField(estateID.ToString());
+
+            // TODO: Resolve Magic numbers here
+            returnblock[3].Parameter = Helpers.StringToField("269516800");
+            returnblock[4].Parameter = Helpers.StringToField("0");
+            returnblock[5].Parameter = Helpers.StringToField("1");
+            returnblock[6].Parameter = Helpers.StringToField(m_scene.RegionInfo.RegionID.ToString());
+            returnblock[7].Parameter = Helpers.StringToField("1160895077");
+            returnblock[8].Parameter = Helpers.StringToField("1");
+
+            packet.ParamList = returnblock;
+            packet.Header.Reliable = false;
+            //System.Console.WriteLine("[ESTATE]: SIM--->" + packet.ToString());
+            this.OutPacket(packet, ThrottleOutPacketType.Task);
+        }
+
         #endregion
 
         #region Land Data Sending Methods
+
         public void sendLandParcelOverlay(byte[] data, int sequence_id)
         {
 
@@ -2578,6 +2559,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
             packet.Header.Zerocoded = true;
             this.OutPacket(packet, ThrottleOutPacketType.Task);
         }
+
         public void sendLandProperties(IClientAPI remote_client,int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int simObjectCapacity, uint regionFlags)
         {
             ParcelPropertiesPacket updatePacket = (ParcelPropertiesPacket) PacketPool.Instance.GetPacket(PacketType.ParcelProperties);
@@ -2743,8 +2725,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                     notifyCount = 32;
                 }
 
-
-
                 ParcelObjectOwnersReplyPacket.DataBlock[] dataBlock
                     = new ParcelObjectOwnersReplyPacket.DataBlock[notifyCount];
 
@@ -2773,9 +2753,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
 
         #endregion
 
-            #region Helper Methods
+        #region Helper Methods
 
-            protected ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateAvatarImprovedBlock(uint localID, LLVector3 pos,
+        protected ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateAvatarImprovedBlock(uint localID, LLVector3 pos,
                                                                                             LLVector3 velocity,
                                                                                             LLQuaternion rotation)
         {
@@ -2958,7 +2938,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
             bytes[i++] = (byte)((rvelz >> 8) % 256);
             dat.Data = bytes;
 
-
             return dat;
         }
 
@@ -3034,7 +3013,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
             objdata.ObjectData[47] = 63;
         }
 
-
         /// <summary>
         ///
         /// </summary>
@@ -3165,13 +3143,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                                      false);
                 }
                 return true;
-
             }
             else
             {
                 return false;
             }
-
         }
 
         private bool HandleUUIDGroupNameRequest(IClientAPI sender, Packet Pack)
@@ -3205,8 +3181,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
             return true;
         }
 
-
-
         private bool HandleViewerEffect(IClientAPI sender, Packet Pack)
         {
             ViewerEffectPacket viewer = (ViewerEffectPacket)Pack;
@@ -3346,7 +3320,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                                 handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition;
                                 if (handlerUpdatePrimSinglePosition != null)
                                 {
-
                                     // Console.WriteLine("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z);
                                     handlerUpdatePrimSinglePosition(localId, pos1, this);
                                 }
@@ -3357,7 +3330,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                                 handlerUpdatePrimSingleRotation = OnUpdatePrimSingleRotation;
                                 if (handlerUpdatePrimSingleRotation != null)
                                 {
-
                                     //Console.WriteLine("new tab rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W);
                                     handlerUpdatePrimSingleRotation(localId, rot1, this);
                                 }
@@ -3368,7 +3340,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                                 handlerUpdatePrimSingleRotation = OnUpdatePrimSingleRotation;
                                 if (handlerUpdatePrimSingleRotation != null)
                                 {
-
                                     //Console.WriteLine("new mouse rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W);
                                     handlerUpdatePrimSingleRotation(localId, rot2, this);
                                 }
@@ -3381,11 +3352,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                                 handlerUpdatePrimScale = OnUpdatePrimScale;
                                 if (handlerUpdatePrimScale != null)
                                 {
-
                                     // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z);
                                     handlerUpdatePrimScale(localId, scale1, this);
 
-
                                     handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition;
                                     if (handlerUpdatePrimSinglePosition != null)
                                     {
@@ -3405,40 +3374,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                                 }
                                 break;
                             case 10:
-
                                 LLQuaternion rot3 = new LLQuaternion(block.Data, 0, true);
 
                                 handlerUpdatePrimRotation = OnUpdatePrimGroupRotation;
                                 if (handlerUpdatePrimRotation != null)
                                 {
-
                                     //  Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W);
                                     handlerUpdatePrimRotation(localId, rot3, this);
                                 }
                                 break;
                             case 11:
-
                                 LLVector3 pos3 = new LLVector3(block.Data, 0);
                                 LLQuaternion rot4 = new LLQuaternion(block.Data, 12, true);
 
                                 handlerUpdatePrimGroupRotation = OnUpdatePrimGroupMouseRotation;
                                 if (handlerUpdatePrimGroupRotation != null)
                                 {
-
                                     //Console.WriteLine("new rotation position is " + pos.X + " , " + pos.Y + " , " + pos.Z);
                                     // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W);
                                     handlerUpdatePrimGroupRotation(localId, pos3, rot4, this);
                                 }
                                 break;
                             case 13:
-
                                 LLVector3 scale2 = new LLVector3(block.Data, 12);
                                 LLVector3 pos4 = new LLVector3(block.Data, 0);
 
                                 handlerUpdatePrimScale = OnUpdatePrimScale;
                                 if (handlerUpdatePrimScale != null)
                                 {
-
                                     //Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z);
                                     handlerUpdatePrimScale(localId, scale2, this);
 
@@ -3464,7 +3427,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
 
                                     if (handlerUpdateVector != null)
                                     {
-
                                         handlerUpdateVector(localId, pos5, this);
                                     }
                                 }
@@ -3841,11 +3803,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
 
         protected void AckTimer_Elapsed(object sender, ElapsedEventArgs ea)
         {
-
             SendAcks();
             ResendUnacked();
             SendPacketStats();
-
         }
 
         protected void SendPacketStats()
@@ -3858,6 +3818,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                 m_lastPacketsSentSentToScene = m_packetsSent;
             }
         }
+
         protected void ClearOldPacketDupeTracking()
         {
             lock (m_dupeLimiter)
@@ -3865,7 +3826,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                 List<uint> toEliminate = new List<uint>();
                 try
                 {
-
                     foreach (uint seq in m_dupeLimiter.Keys)
                     {
                         PacketDupeLimiter pkdata = null;
@@ -3913,7 +3873,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
 
         private bool m_packetProcessingEnabled = true;
 
-        public bool IsActive {
+        public bool IsActive
+        {
             get { return m_packetProcessingEnabled; }
             set { m_packetProcessingEnabled = value; }
         }
@@ -3945,10 +3906,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
             }
             else
             {
-
                 switch (Pack.Type)
                 {
-                        #region  Scene/Avatar
+                    #region Scene/Avatar
 
                     case PacketType.AvatarPropertiesRequest:
                         AvatarPropertiesRequestPacket avatarProperties = (AvatarPropertiesRequestPacket)Pack;
@@ -4425,9 +4385,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                         }
                         break;
 
-                        #endregion
+                    #endregion
 
-                        #region Objects/m_sceneObjects
+                    #region Objects/m_sceneObjects
 
                     case PacketType.ObjectLink:
                         ObjectLinkPacket link = (ObjectLinkPacket)Pack;
@@ -4816,9 +4776,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                         }
                         break;
 
-                        #endregion
+                    #endregion
 
-                        #region Inventory/Asset/Other related packets
+                    #region Inventory/Asset/Other related packets
 
                     case PacketType.RequestImage:
                         RequestImagePacket imageRequest = (RequestImagePacket)Pack;
@@ -5346,8 +5306,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                         }
                         break;
 
-                        #endregion
-
+                    #endregion
 
                     case PacketType.UUIDNameRequest:
                         UUIDNameRequestPacket incoming = (UUIDNameRequestPacket)Pack;
@@ -5361,7 +5320,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                         }
                         break;
 
-                        #region Parcel related packets
+                    #region Parcel related packets
 
                     case PacketType.ParcelAccessListRequest:
                         ParcelAccessListRequestPacket requestPacket = (ParcelAccessListRequestPacket)Pack;
@@ -5518,14 +5477,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                         }
                         break;
 
-                        #endregion
+                    #endregion
 
-                        #region Estate Packets
+                    #region Estate Packets
 
                     case PacketType.EstateOwnerMessage:
                         EstateOwnerMessagePacket messagePacket = (EstateOwnerMessagePacket)Pack;
 
-
                         switch (Helpers.FieldToUTF8String(messagePacket.MethodData.Method))
                         {
                             case "getinfo":
@@ -5772,9 +5730,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                         }
                         break;
 
-                        #endregion
+                    #endregion
 
-                        #region GodPackets
+                    #region GodPackets
 
                     case PacketType.RequestGodlikePowers:
                         RequestGodlikePowersPacket rglpPack = (RequestGodlikePowersPacket)Pack;
@@ -5822,9 +5780,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                         //OutPacket(kupack, ThrottleOutPacketType.Task);
                         break;
 
-                        #endregion
+                    #endregion
 
-                        #region Economy/Transaction Packets
+                    #region Economy/Transaction Packets
 
                     case PacketType.MoneyBalanceRequest:
                         MoneyBalanceRequestPacket moneybalancerequestpacket = (MoneyBalanceRequestPacket)Pack;
@@ -5856,9 +5814,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                         }
                         break;
 
-                        #endregion
+                    #endregion
 
-                        #region unimplemented handlers
+                    #region unimplemented handlers
 
                     case PacketType.StartPingCheck:
                         // Send the client the ping response back
@@ -5935,7 +5893,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                         m_log.Warn("[CLIENT]: unhandled packet " + Pack.ToString());
                         break;
 
-                        #endregion
+                    #endregion
                 }
             }
 

+ 4 - 2
OpenSim/Region/Communications/OGS1/OGS1GridServices.cs

@@ -398,8 +398,10 @@ namespace OpenSim.Region.Communications.OGS1
         public RegionInfo RequestClosestRegion(string regionName)
         {
             foreach (RegionInfo ri in m_remoteRegionInfoCache.Values)
-                if(ri.RegionName == regionName)
+            {
+                if (ri.RegionName == regionName)
                     return ri;
+            }
 
             RegionInfo regionInfo = null;
             try
@@ -441,7 +443,7 @@ namespace OpenSim.Region.Communications.OGS1
                 regionInfo.RegionID = new LLUUID((string) responseData["region_UUID"]);
                 regionInfo.RegionName = (string) responseData["region_name"];
 
-                if(!m_remoteRegionInfoCache.ContainsKey(regionInfo.RegionHandle))
+                if (!m_remoteRegionInfoCache.ContainsKey(regionInfo.RegionHandle))
                     m_remoteRegionInfoCache.Add(regionInfo.RegionHandle, regionInfo);
             }
             catch (WebException)

+ 66 - 66
OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs

@@ -1,66 +1,66 @@
-/*
- * Copyright (c) Contributors, http://opensimulator.org/
- * See CONTRIBUTORS.TXT for a full list of copyright holders.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the OpenSim Project nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-using OpenSim.Region.Environment.Scenes;
-using System.Reflection;
-using log4net;
-
-namespace OpenSim.Region.Environment.Modules.World.Archiver
-{
-    /// <summary>
-    /// Handles an individual archive read request
-    /// </summary>
-    public class ArchiveReadRequest
-    {
-        private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);        
-        
-        private Scene m_scene;
-        private string m_loadPath;
-
-        public ArchiveReadRequest(Scene scene, string loadPath)
-        {
-            m_scene = scene;
-            m_loadPath = loadPath;
-
-            DearchiveRegion();
-        }
-        
-        protected void DearchiveRegion()
-        {   
-            TarArchiveReader archive = new TarArchiveReader(m_loadPath);
-            
-            // Just test for now by reading first file
-            string filePath = "ERROR";
-            
-            byte[] data = archive.Read(out filePath);
-            
-            m_log.DebugFormat("[ARCHIVER]: Successfully read {0} ({1} bytes) from archive {2}", filePath, data.Length, m_loadPath);
-            
-            archive.Close();
-        }
-    }
-}
+/*
+ * Copyright (c) Contributors, http://opensimulator.org/
+ * See CONTRIBUTORS.TXT for a full list of copyright holders.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of the OpenSim Project nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using OpenSim.Region.Environment.Scenes;
+using System.Reflection;
+using log4net;
+
+namespace OpenSim.Region.Environment.Modules.World.Archiver
+{
+    /// <summary>
+    /// Handles an individual archive read request
+    /// </summary>
+    public class ArchiveReadRequest
+    {
+        private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);        
+        
+        private Scene m_scene;
+        private string m_loadPath;
+
+        public ArchiveReadRequest(Scene scene, string loadPath)
+        {
+            m_scene = scene;
+            m_loadPath = loadPath;
+
+            DearchiveRegion();
+        }
+        
+        protected void DearchiveRegion()
+        {   
+            TarArchiveReader archive = new TarArchiveReader(m_loadPath);
+            
+            // Just test for now by reading first file
+            string filePath = "ERROR";
+            
+            byte[] data = archive.Read(out filePath);
+            
+            m_log.DebugFormat("[ARCHIVER]: Successfully read {0} ({1} bytes) from archive {2}", filePath, data.Length, m_loadPath);
+            
+            archive.Close();
+        }
+    }
+}

+ 108 - 108
OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs

@@ -1,108 +1,108 @@
-/*
- * Copyright (c) Contributors, http://opensimulator.org/
- * See CONTRIBUTORS.TXT for a full list of copyright holders.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the OpenSim Project nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.IO;
-//using System.Reflection;
-//using log4net;
-
-namespace OpenSim.Region.Environment.Modules.World.Archiver
-{
-    /// <summary>
-    /// Temporary code to do the bare minimum required to read a tar archive for our purposes
-    /// </summary>
-    public class TarArchiveReader
-    {
-//        private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-        
-        protected static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding();
-        
-        /// <summary>
-        /// Binary reader for the underlying stream
-        /// </summary>
-        protected BinaryReader m_br;
-        
-        public TarArchiveReader(string archivePath)
-        {
-            m_br = new BinaryReader(new FileStream(archivePath, FileMode.Open));
-        }
-        
-        public byte[] Read(out string filePath)
-        {
-            TarHeader header = ReadHeader();
-            filePath = header.FilePath;
-            return m_br.ReadBytes(header.FileSize);
-        }
-
-        /// <summary>
-        /// Read the next 512 byte chunk of data as a tar header.
-        /// </summary>
-        /// <returns>A tar header struct</returns>
-        protected TarHeader ReadHeader()
-        {
-            TarHeader tarHeader = new TarHeader();
-            
-            byte[] header = m_br.ReadBytes(512);
-            
-            tarHeader.FilePath = m_asciiEncoding.GetString(header, 0, 100);
-            tarHeader.FileSize = ConvertOctalBytesToDecimal(header, 124, 11);
-            
-            return tarHeader;
-        }
-        
-        public void Close()
-        {
-            m_br.Close();
-        }
-        
-        /// <summary>
-        /// Convert octal bytes to a decimal representation
-        /// </summary>
-        /// <param name="bytes"></param>
-        /// <returns></returns>
-        public static int ConvertOctalBytesToDecimal(byte[] bytes, int startIndex, int count)
-        {           
-            string oString = m_asciiEncoding.GetString(bytes, startIndex, count);            
-            
-            int d = 0;
-                        
-            foreach (char c in oString)
-            {
-                d <<= 3;                
-                d |= c - '0';               
-            }
-
-            return d;
-        }        
-    }
-    
-    public struct TarHeader
-    {
-        public string FilePath;
-        public int FileSize;
-    }
-}
+/*
+ * Copyright (c) Contributors, http://opensimulator.org/
+ * See CONTRIBUTORS.TXT for a full list of copyright holders.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of the OpenSim Project nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System;
+using System.IO;
+//using System.Reflection;
+//using log4net;
+
+namespace OpenSim.Region.Environment.Modules.World.Archiver
+{
+    /// <summary>
+    /// Temporary code to do the bare minimum required to read a tar archive for our purposes
+    /// </summary>
+    public class TarArchiveReader
+    {
+//        private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+        
+        protected static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding();
+        
+        /// <summary>
+        /// Binary reader for the underlying stream
+        /// </summary>
+        protected BinaryReader m_br;
+        
+        public TarArchiveReader(string archivePath)
+        {
+            m_br = new BinaryReader(new FileStream(archivePath, FileMode.Open));
+        }
+        
+        public byte[] Read(out string filePath)
+        {
+            TarHeader header = ReadHeader();
+            filePath = header.FilePath;
+            return m_br.ReadBytes(header.FileSize);
+        }
+
+        /// <summary>
+        /// Read the next 512 byte chunk of data as a tar header.
+        /// </summary>
+        /// <returns>A tar header struct</returns>
+        protected TarHeader ReadHeader()
+        {
+            TarHeader tarHeader = new TarHeader();
+            
+            byte[] header = m_br.ReadBytes(512);
+            
+            tarHeader.FilePath = m_asciiEncoding.GetString(header, 0, 100);
+            tarHeader.FileSize = ConvertOctalBytesToDecimal(header, 124, 11);
+            
+            return tarHeader;
+        }
+        
+        public void Close()
+        {
+            m_br.Close();
+        }
+        
+        /// <summary>
+        /// Convert octal bytes to a decimal representation
+        /// </summary>
+        /// <param name="bytes"></param>
+        /// <returns></returns>
+        public static int ConvertOctalBytesToDecimal(byte[] bytes, int startIndex, int count)
+        {           
+            string oString = m_asciiEncoding.GetString(bytes, startIndex, count);            
+            
+            int d = 0;
+                        
+            foreach (char c in oString)
+            {
+                d <<= 3;                
+                d |= c - '0';               
+            }
+
+            return d;
+        }        
+    }
+    
+    public struct TarHeader
+    {
+        public string FilePath;
+        public int FileSize;
+    }
+}

+ 1 - 1
OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs

@@ -357,7 +357,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
                                 else
                                 {
                                     lsri.OwnerName = "waiting";
-                                    lock(uuidNameLookupList)
+                                    lock (uuidNameLookupList)
                                         uuidNameLookupList.Add(sog.OwnerID);
                                 }
 

+ 2 - 2
OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs

@@ -104,7 +104,7 @@ namespace OpenSim.Region.Environment.Modules
         private ulong CurrentTime
         {
             get {
-                
+
                 return (ulong)(((System.DateTime.Now.Ticks) - TicksToEpoch + TicksOffset)/10000000);
             }
         }
@@ -346,7 +346,7 @@ namespace OpenSim.Region.Environment.Modules
             {
                 if (m_rootAgents.ContainsKey(avatar.UUID))
                 {
-                    m_rootAgents[avatar.UUID] = avatar.RegionHandle; 
+                    m_rootAgents[avatar.UUID] = avatar.RegionHandle;
                 }
                 else
                 {

+ 1 - 1
OpenSim/Region/Environment/Scenes/SceneManager.cs

@@ -192,7 +192,7 @@ namespace OpenSim.Region.Environment.Scenes
         public void LoadCurrentSceneFromXml2(string filename)
         {
             CurrentOrFirstScene.LoadPrimsFromXml2(filename);
-        }        
+        }
 
         /// <summary>
         /// Save the current scene to an OpenSimulator archive.  This archive will eventually include the prim's assets

+ 6 - 21
OpenSim/Region/Physics/Meshing/Extruder.cs

@@ -62,7 +62,6 @@ namespace OpenSim.Region.Physics.Meshing
         public float pathTaperX = 0.0f;
         public float pathTaperY = 0.0f;
 
-
         public Mesh Extrude(Mesh m)
         {
             startParameter = float.MinValue;
@@ -129,8 +128,8 @@ namespace OpenSim.Region.Physics.Meshing
                     v.Y = v2.Y;
                     v.Z = v2.Z;
                 }
-              
             }
+
             foreach (Vertex v in workingMinus.vertices)
             {
                 if (v == null)
@@ -159,10 +158,8 @@ namespace OpenSim.Region.Physics.Meshing
             }
 
             result.Append(workingMinus);
-
             result.Append(workingMiddle);
 
-
             int iLastNull = 0;
 
             for (int i = 0; i < workingMiddle.vertices.Count; i++)
@@ -228,6 +225,7 @@ namespace OpenSim.Region.Physics.Meshing
                     new Triangle(workingPlus.vertices[iNext], workingMiddle.vertices[i], workingMiddle.vertices[iNext]);
                 result.Add(tSide);
             }
+
             if (twistMid != 0)
             {
                 foreach (Vertex v in result.vertices)
@@ -245,6 +243,7 @@ namespace OpenSim.Region.Physics.Meshing
             }
             return result;
         }
+
         public Mesh ExtrudeCircularPath(Mesh m)
         {
             //startParameter = float.MinValue;
@@ -294,8 +293,6 @@ namespace OpenSim.Region.Physics.Meshing
             //System.Console.WriteLine("taperBotFactorX: " + taperBotFactorX.ToString() + " taperBotFactorY: " + taperBotFactorY.ToString()
             //    + " taperTopFactorX: " + taperTopFactorX.ToString() + " taperTopFactorY: " + taperTopFactorY.ToString());
 
-
-
             do
             {
                 float percentOfPath = 1.0f;
@@ -328,10 +325,6 @@ namespace OpenSim.Region.Physics.Meshing
 
                 //System.Console.WriteLine("Extruder: radius: " + radius.ToString() + " radiusScale: " + radiusScale.ToString());
 
-
-
-
-
                 float twist = twistBot + (twistTotal * (float)percentOfPath);
 
                 float zOffset = (float)(System.Math.Sin(angle) * (0.5f - yPathScale)) * radiusScale;
@@ -404,13 +397,6 @@ namespace OpenSim.Region.Physics.Meshing
                 }
                 lastLayer = newLayer;
 
-
-
-
-
-
-
-
                 // calc next angle
 
                 if (angle >= endAngle)
@@ -421,10 +407,7 @@ namespace OpenSim.Region.Physics.Meshing
                     if (angle > endAngle)
                         angle = endAngle;
                 }
-            }
-            while (!done);
-
-
+            } while (!done);
 
             // scale the mesh to the desired size
             float xScale = size.X;
@@ -432,12 +415,14 @@ namespace OpenSim.Region.Physics.Meshing
             float zScale = size.Z;
 
             foreach (Vertex v in result.vertices)
+            {
                 if (v != null)
                 {
                     v.X *= xScale;
                     v.Y *= yScale;
                     v.Z *= zScale;
                 }
+            }
 
             return result;
         }

+ 4 - 4
OpenSim/Region/Physics/Meshing/Meshmerizer.cs

@@ -255,7 +255,7 @@ namespace OpenSim.Region.Physics.Meshing
                 holeHull.AddVertex(IPM);
             }
             //if (hshape == HollowShape.Circle && pbs.PathCurve == (byte)Extrusion.Straight)
-            if ( hshape == HollowShape.Circle )
+            if (hshape == HollowShape.Circle)
             {
                 float hollowFactorF = (float)fhollowFactor / (float)50000;
 
@@ -1346,7 +1346,7 @@ namespace OpenSim.Region.Physics.Meshing
             //    || (primShape.ProfileCurve & 0x07) == (byte) ProfileShape.Square)
             {
                 //Console.WriteLine("Meshmerizer thinks " + primName + " is a TORUS");
-                if ( hollowShape == HollowShape.Same )
+                if (hollowShape == HollowShape.Same)
                     hollowShape = HollowShape.Circle;
 
                 // build the profile shape
@@ -1381,7 +1381,7 @@ namespace OpenSim.Region.Physics.Meshing
             else if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.Square) // a ring
             {
                 //Console.WriteLine("Meshmerizer thinks " + primName + " is a TUBE");
-                if ( hollowShape == HollowShape.Same )
+                if (hollowShape == HollowShape.Same)
                     hollowShape = HollowShape.Square;
 
                 outerHull.AddVertex(new Vertex(+0.5f, +0.5f, 0.0f));
@@ -1393,7 +1393,7 @@ namespace OpenSim.Region.Physics.Meshing
             else if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.EquilateralTriangle)
             {
                 //Console.WriteLine("Meshmerizer thinks " + primName + " is a RING");
-                if ( hollowShape == HollowShape.Same )
+                if (hollowShape == HollowShape.Same)
                     hollowShape = HollowShape.Triangle;
 
                 outerHull.AddVertex(new Vertex(+0.255f, -0.375f, 0.0f));

+ 9 - 9
OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs

@@ -1432,7 +1432,7 @@ namespace OpenSim.Region.ScriptEngine.Common
                 m_host.Sound = key;
             }
             // else try to locate the name in inventory of object. found returns key,
-            // not found returns LLUUID.Zero 
+            // not found returns LLUUID.Zero
             else
             {
                 m_host.Sound = InventoryKey(sound.ToString());
@@ -1477,7 +1477,7 @@ namespace OpenSim.Region.ScriptEngine.Common
             m_host.Sound = LLUUID.Zero;
             m_host.SoundGain = 0;
             m_host.SoundFlags = 0;
-            m_host.SoundRadius = 0; 
+            m_host.SoundRadius = 0;
 
             m_host.SendFullUpdateToAllClients();
 
@@ -3871,7 +3871,7 @@ namespace OpenSim.Region.ScriptEngine.Common
                             {
                                 // Finally got to the first line of the notecard
                                 // now find the end of the notecard text delimited by }<LF>
-                                // parse the lines, delimited by <LF>                  
+                                // parse the lines, delimited by <LF>
                                 notecardIndex = dataString.IndexOf("\n", notecardIndex);
                                 notecardIndex++; // get past delimiter
 
@@ -5627,10 +5627,10 @@ namespace OpenSim.Region.ScriptEngine.Common
 
             RegionInfo info = m_ScriptEngine.World.RequestClosestRegion(simulator);
 
-            switch(data)
+            switch (data)
             {
             case 5: // DATA_SIM_POS
-                if(info == null)
+                if (info == null)
                     return LLUUID.Zero.ToString();
                 reply = new LSL_Types.Vector3(
                         info.RegionLocX * Constants.RegionSize,
@@ -5638,18 +5638,18 @@ namespace OpenSim.Region.ScriptEngine.Common
                         0).ToString();
                 break;
             case 6: // DATA_SIM_STATUS
-                if(info != null)
+                if (info != null)
                     reply = "up"; // Duh!
                 else
                     reply = "unknown";
                 break;
             case 7: // DATA_SIM_RATING
-                if(info == null)
+                if (info == null)
                     return LLUUID.Zero.ToString();
                 int access = (int)info.EstateSettings.simAccess;
-                if(access == 21)
+                if (access == 21)
                     reply = "MATURE";
-                else if(access == 13)
+                else if (access == 13)
                     reply = "MATURE";
                 else
                     reply = "UNKNOWN";

+ 8 - 8
OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/Dataserver.cs

@@ -59,9 +59,9 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin
         public LLUUID RegisterRequest(uint localID, LLUUID itemID,
                 string identifier)
         {
-            lock(DataserverRequests)
+            lock (DataserverRequests)
             {
-                if(DataserverRequests.ContainsKey(identifier))
+                if (DataserverRequests.ContainsKey(identifier))
                     return LLUUID.Zero;
 
                 DataserverRequest ds = new DataserverRequest();
@@ -84,9 +84,9 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin
         {
             DataserverRequest ds;
 
-            lock(DataserverRequests)
+            lock (DataserverRequests)
             {
-                if(!DataserverRequests.ContainsKey(identifier))
+                if (!DataserverRequests.ContainsKey(identifier))
                     return;
                 
                 ds=DataserverRequests[identifier];
@@ -101,11 +101,11 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin
 
         public void RemoveEvents(uint localID, LLUUID itemID)
         {
-            lock(DataserverRequests)
+            lock (DataserverRequests)
             {
                 foreach (DataserverRequest ds in new List<DataserverRequest>(DataserverRequests.Values))
                 {
-                    if(ds.itemID == itemID)
+                    if (ds.itemID == itemID)
                         DataserverRequests.Remove(ds.handle);
                 }
             }
@@ -113,11 +113,11 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin
 
         public void ExpireRequests()
         {
-            lock(DataserverRequests)
+            lock (DataserverRequests)
             {
                 foreach (DataserverRequest ds in new List<DataserverRequest>(DataserverRequests.Values))
                 {
-                    if(ds.startTime > DateTime.Now.AddSeconds(30))
+                    if (ds.startTime > DateTime.Now.AddSeconds(30))
                         DataserverRequests.Remove(ds.handle);
                 }
             }

+ 4 - 4
OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/XmlRequest.cs

@@ -57,7 +57,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin
                 bool handled = false;
 
                 // Request must be taken out of the queue in case there is no handler, otherwise we loop infinitely
-                xmlrpc.RemoveCompletedRequest(rInfo.GetMessageID()); 
+                xmlrpc.RemoveCompletedRequest(rInfo.GetMessageID());
 
                 // And since the xmlrpc request queue is actually shared among all regions on the simulator, we need
                 // to look in each one for the appropriate handler
@@ -96,9 +96,9 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin
 
                 // Request must be taken out of the queue in case there is no handler, otherwise we loop infinitely
                 xmlrpc.RemoveCompletedSRDRequest(srdInfo.GetReqID());
-                
+
                 // And this is another shared queue... so we check each of the script engines for a handler
-                foreach (ScriptEngine sman in ScriptEngine.ScriptEngines)               
+                foreach (ScriptEngine sman in ScriptEngine.ScriptEngines)
                 {
                     if (sman.m_ScriptManager.GetScript(srdInfo.m_localID,srdInfo.m_itemID) != null) {
 
@@ -116,7 +116,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin
                         handled = true;
                     }
                 }
-                
+
                 if (! handled)
                 {
                     Console.WriteLine("Unhandled xml_srdrequest: " + srdInfo.GetReqID());

+ 4 - 4
OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs

@@ -87,9 +87,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
             string quote = String.Empty;
             bool last_was_escape = false;
             int quote_replaced_count = 0;
-            
+
             string removefwnoncomments = nonCommentFwsl.Replace(Script, "\"\";");
-            
+
             string removecomments = conelinecomments.Replace(removefwnoncomments, "");
             removecomments = cstylecomments.Replace(removecomments, "");
             string[] localscript = removecomments.Split('"');
@@ -121,9 +121,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
             // ignores alpha.x alpha.y, alpha.z for refering to vector components
             Match SecurityM;
 
-            
+
             SecurityM = Regex.Match(checkscript, @"([a-zA-Z])\.(?:[a-wA-Z]|[a-zA-Z][a-zA-Z])", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
-            if (SecurityM.Success) 
+            if (SecurityM.Success)
                throw new Exception("CS0103: 'The . symbol cannot be used in LSL except in float values or vector components'.  Detected around: " + SecurityM.Captures[0].Value);
 
             SecurityM = Regex.Match(checkscript, @"typeof\s", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);