From 730458be1f8c74da1c112df36ec54233b30caed0 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 25 Sep 2009 14:31:29 +0100 Subject: [PATCH 1/7] minor: remove some mono compiler warnings --- .../CoreModules/Scripting/LSLHttp/UrlModule.cs | 7 +++---- .../Framework/Scenes/Hypergrid/HGAssetMapper.cs | 17 ++++++++--------- .../AuthorizationServerPostHandler.cs | 2 +- .../AuthenticationServiceBase.cs | 6 +++--- .../PasswordAuthenticationService.cs | 6 +++--- .../WebkeyAuthenticationService.cs | 6 +++--- 6 files changed, 21 insertions(+), 23 deletions(-) diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index 8b7a878da6..b885420081 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs @@ -200,11 +200,10 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp if (m_RequestMap.ContainsKey(request)) { UrlData urlData = m_RequestMap[request]; - RequestData requestData=urlData.requests[request]; urlData.requests[request].responseCode = status; urlData.requests[request].responseBody = body; //urlData.requests[request].ev.Set(); - urlData.requests[request].requestDone=true; + urlData.requests[request].requestDone =true; } else { @@ -397,7 +396,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp { Hashtable headers = (Hashtable)request["headers"]; - string uri_full = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri;// "/lslhttp/" + urlcode.ToString() + "/"; +// string uri_full = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri;// "/lslhttp/" + urlcode.ToString() + "/"; int pos1 = uri.IndexOf("/");// /lslhttp int pos2 = uri.IndexOf("/", pos1 + 1);// /lslhttp/ @@ -471,7 +470,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp url.engine.PostScriptEvent(url.itemID, "http_request", new Object[] { requestID.ToString(), request["http-method"].ToString(), request["body"].ToString() }); //send initial response? - Hashtable response = new Hashtable(); +// Hashtable response = new Hashtable(); return; diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs index 5d65f988ce..62efd60506 100644 --- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs +++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs @@ -47,8 +47,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // This maps between inventory server urls and inventory server clients - private Dictionary m_inventoryServers = new Dictionary(); - +// private Dictionary m_inventoryServers = new Dictionary(); private Scene m_scene; #endregion @@ -72,13 +71,13 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid return null; } - private string UserInventoryURL(UUID userID) - { - CachedUserInfo uinfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(userID); - if (uinfo != null) - return (uinfo.UserProfile.UserInventoryURI == "") ? null : uinfo.UserProfile.UserInventoryURI; - return null; - } +// private string UserInventoryURL(UUID userID) +// { +// CachedUserInfo uinfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(userID); +// if (uinfo != null) +// return (uinfo.UserProfile.UserInventoryURI == "") ? null : uinfo.UserProfile.UserInventoryURI; +// return null; +// } private bool IsLocalUser(UUID userID) { diff --git a/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs b/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs index 69acd25bd0..f987de4ef1 100644 --- a/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs @@ -44,7 +44,7 @@ namespace OpenSim.Server.Handlers.Authorization { public class AuthorizationServerPostHandler : BaseStreamHandler { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private IAuthorizationService m_AuthorizationService; diff --git a/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs b/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs index 8904461a4c..dcf090e0f2 100644 --- a/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs +++ b/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs @@ -43,9 +43,9 @@ namespace OpenSim.Services.AuthenticationService // public class AuthenticationServiceBase : ServiceBase { - private static readonly ILog m_log = - LogManager.GetLogger( - MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = +// LogManager.GetLogger( +// MethodBase.GetCurrentMethod().DeclaringType); protected IAuthenticationData m_Database; diff --git a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs index 6c99b6610b..d65665a1ae 100644 --- a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs +++ b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs @@ -47,9 +47,9 @@ namespace OpenSim.Services.AuthenticationService public class PasswordAuthenticationService : AuthenticationServiceBase, IAuthenticationService { - private static readonly ILog m_log = - LogManager.GetLogger( - MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = +// LogManager.GetLogger( +// MethodBase.GetCurrentMethod().DeclaringType); public PasswordAuthenticationService(IConfigSource config) : base(config) diff --git a/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs b/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs index 8831c8a0b7..d1a5b0f041 100644 --- a/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs +++ b/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs @@ -43,9 +43,9 @@ namespace OpenSim.Services.AuthenticationService public class WebkeyAuthenticationService : AuthenticationServiceBase, IAuthenticationService { - private static readonly ILog m_log = - LogManager.GetLogger( - MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = +// LogManager.GetLogger( +// MethodBase.GetCurrentMethod().DeclaringType); public WebkeyAuthenticationService(IConfigSource config) : base(config) From 613cb417c01fbca0cc28c3ef0313bf46e8d7c586 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 25 Sep 2009 14:52:53 +0100 Subject: [PATCH 2/7] add control files containing version info to iars --- .../Archiver/InventoryArchiveWriteRequest.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index 7b4a9eb8e5..fd42586ad6 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs @@ -118,6 +118,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver protected void ReceivedAllAssets(ICollection assetsFoundUuids, ICollection assetsNotFoundUuids) { + // We're almost done. Just need to write out the control file now + m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile()); + m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); + Exception reportedException = null; bool succeeded = true; @@ -409,5 +413,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, id); } + + /// + /// Create the control file for a 0.1 version archive + /// + /// + public static string Create0p1ControlFile() + { + StringWriter sw = new StringWriter(); + XmlTextWriter xtw = new XmlTextWriter(sw); + xtw.Formatting = Formatting.Indented; + xtw.WriteStartDocument(); + xtw.WriteStartElement("archive"); + xtw.WriteAttributeString("major_version", "0"); + xtw.WriteAttributeString("minor_version", "1"); + xtw.WriteEndElement(); + + xtw.Flush(); + xtw.Close(); + + String s = sw.ToString(); + sw.Close(); + + return s; + } } } \ No newline at end of file From 9249c026f25a0a24c62ca76fca37b1d23bcc3494 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 25 Sep 2009 16:22:43 +0100 Subject: [PATCH 3/7] Don't preserve full user profile details within iars for now This information was not being used in the load process --- .../Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index fd42586ad6..c6ebb24c34 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs @@ -324,7 +324,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !foundStar); } - SaveUsers(); + // Don't put all this profile information into the archive right now. + //SaveUsers(); + new AssetsRequest( new AssetsArchiver(m_archiveWriter), m_assetUuids.Keys, m_scene.AssetService, ReceivedAllAssets).Execute(); From 2995d87d75e3f65b9872aa02edbff0dda70bc03c Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 25 Sep 2009 19:29:40 +0100 Subject: [PATCH 4/7] minor: remove some mono compiler warnings --- OpenSim/Data/MySQL/MySQLRegionData.cs | 2 +- OpenSim/Data/MySQL/MySQLUserAccountData.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index e13e12caf4..e8cab4d676 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs @@ -39,7 +39,7 @@ namespace OpenSim.Data.MySQL { private string m_Realm; private List m_ColumnNames = null; - private int m_LastExpire = 0; +// private int m_LastExpire = 0; public MySqlRegionData(string connectionString, string realm) : base(connectionString) diff --git a/OpenSim/Data/MySQL/MySQLUserAccountData.cs b/OpenSim/Data/MySQL/MySQLUserAccountData.cs index 39d60ca6c0..5352727bc2 100644 --- a/OpenSim/Data/MySQL/MySQLUserAccountData.cs +++ b/OpenSim/Data/MySQL/MySQLUserAccountData.cs @@ -39,7 +39,7 @@ namespace OpenSim.Data.MySQL { private string m_Realm; private List m_ColumnNames = null; - private int m_LastExpire = 0; +// private int m_LastExpire = 0; public MySqlUserAccountData(string connectionString, string realm) : base(connectionString) From 0a0b532270d7cc952648b99ed7ab7ec3b0f99676 Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Fri, 25 Sep 2009 15:31:19 -0400 Subject: [PATCH 5/7] * Fixes teleporting within megaregions on HG enabled regions. You can teleport around now. (but it still doesn't fix the inconsistent attachment state when teleporting into region slots that are not the south west region on megaregions) --- .../Scenes/Hypergrid/HGSceneCommunicationService.cs | 10 ++++++++-- .../Framework/Scenes/SceneCommunicationService.cs | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs index 5c99d7342c..efc644dbd4 100644 --- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs @@ -77,7 +77,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid if (regionHandle == m_regionInfo.RegionHandle) { // Teleport within the same region - if (position.X < 0 || position.X > Constants.RegionSize || position.Y < 0 || position.Y > Constants.RegionSize || position.Z < 0) + if (IsOutsideRegion(avatar.Scene, position) || position.Z < 0) { Vector3 emergencyPos = new Vector3(128, 128, 128); @@ -89,7 +89,13 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid // TODO: Get proper AVG Height float localAVHeight = 1.56f; - float posZLimit = (float)avatar.Scene.Heightmap[(int)position.X, (int)position.Y]; + float posZLimit = 22; + + if (position.X > 0 && position.X <= (int)Constants.RegionSize && position.Y > 0 && position.Y <= (int)Constants.RegionSize) + { + posZLimit = (float) avatar.Scene.Heightmap[(int) position.X, (int) position.Y]; + } + float newPosZ = posZLimit + localAVHeight; if (posZLimit >= (position.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) { diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 56cd87df92..5f2333e66c 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -1170,7 +1170,7 @@ namespace OpenSim.Region.Framework.Scenes } } - private bool IsOutsideRegion(Scene s, Vector3 pos) + protected bool IsOutsideRegion(Scene s, Vector3 pos) { if (s.TestBorderCross(pos,Cardinals.N)) From fb2cabd6b35bdbc966598de361044e2ff0164e5c Mon Sep 17 00:00:00 2001 From: dahlia Date: Fri, 25 Sep 2009 13:00:49 -0700 Subject: [PATCH 6/7] corrections to viewerMode AddPos() --- OpenSim/Region/Physics/Meshing/PrimMesher.cs | 27 ++++++++++++++++++++ OpenSim/Region/Physics/Meshing/SculptMesh.cs | 14 +++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Physics/Meshing/PrimMesher.cs b/OpenSim/Region/Physics/Meshing/PrimMesher.cs index 0d19c0116e..abfd400e96 100644 --- a/OpenSim/Region/Physics/Meshing/PrimMesher.cs +++ b/OpenSim/Region/Physics/Meshing/PrimMesher.cs @@ -345,6 +345,21 @@ namespace PrimMesher this.v3.Z *= z; } + public void AddPos(float x, float y, float z) + { + this.v1.X += x; + this.v2.X += x; + this.v3.X += x; + + this.v1.Y += y; + this.v2.Y += y; + this.v3.Y += y; + + this.v1.Z += z; + this.v2.Z += z; + this.v3.Z += z; + } + public void AddRot(Quat q) { this.v1 *= q; @@ -2141,6 +2156,18 @@ namespace PrimMesher vert.Z += z; this.coords[i] = vert; } + + if (this.viewerFaces != null) + { + int numViewerFaces = this.viewerFaces.Count; + + for (i = 0; i < numViewerFaces; i++) + { + ViewerFace v = this.viewerFaces[i]; + v.AddPos(x, y, z); + this.viewerFaces[i] = v; + } + } } /// diff --git a/OpenSim/Region/Physics/Meshing/SculptMesh.cs b/OpenSim/Region/Physics/Meshing/SculptMesh.cs index bf42feeda7..bd63aef25c 100644 --- a/OpenSim/Region/Physics/Meshing/SculptMesh.cs +++ b/OpenSim/Region/Physics/Meshing/SculptMesh.cs @@ -494,6 +494,18 @@ namespace PrimMesher vert.Z += z; this.coords[i] = vert; } + + if (this.viewerFaces != null) + { + int numViewerFaces = this.viewerFaces.Count; + + for (i = 0; i < numViewerFaces; i++) + { + ViewerFace v = this.viewerFaces[i]; + v.AddPos(x, y, z); + this.viewerFaces[i] = v; + } + } } /// @@ -556,7 +568,7 @@ namespace PrimMesher if (path == null) return; String fileName = name + "_" + title + ".raw"; - String completePath = Path.Combine(path, fileName); + String completePath = System.IO.Path.Combine(path, fileName); StreamWriter sw = new StreamWriter(completePath); for (int i = 0; i < this.faces.Count; i++) From 2bb513329ac98914ff13a2817aa83b60d85603d9 Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Fri, 25 Sep 2009 16:06:04 -0400 Subject: [PATCH 7/7] * Does a full battery of tests to ensure that the object isn't an attachment before border crossing * Fixes 'Inconsistent Attachment State' when teleporting into another region besides the SW most region slot on a MegaRegion. * Fixes a host of other unintended attachment border cross edge cases that lead to Inconsistent attachment state. --- .../Region/CoreModules/World/Land/RegionCombinerModule.cs | 6 +++--- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs b/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs index 1436912b2e..181c5ae3e4 100644 --- a/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs @@ -79,12 +79,12 @@ namespace OpenSim.Region.CoreModules.World.Land { if (!enabledYN) return; - +/* // For testing on a single instance if (scene.RegionInfo.RegionLocX == 1004 && scene.RegionInfo.RegionLocY == 1000) return; - // - + // +*/ lock (m_startingScenes) m_startingScenes.Add(scene.RegionInfo.originRegionID, scene); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 3c17bbe9dd..ad5d56fcaf 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -245,6 +245,11 @@ namespace OpenSim.Region.Framework.Scenes } } + private bool IsAttachmentCheckFull() + { + return (IsAttachment || (m_rootPart.Shape.PCode == 9 && m_rootPart.Shape.State != 0)); + } + /// /// The absolute position of this scene object in the scene /// @@ -257,7 +262,7 @@ namespace OpenSim.Region.Framework.Scenes if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W) || m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S)) - && !IsAttachment) + && !IsAttachmentCheckFull()) { m_scene.CrossPrimGroupIntoNewRegion(val, this, true); }