diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 0d96ed6595..f6071f241f 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -17,6 +17,7 @@ people that make the day to day of OpenSim happen. * Snoopy Pfeffer * Robert Adams (Intel) * Oren Hurvitz (Kitely) +* Kevin Cozens = Core Developers Following the White Rabbit = Core developers who have temporarily (we hope) gone chasing the white rabbit. @@ -111,7 +112,6 @@ what it is today. * Jon Cundill * Junta Kohime * Kayne -* Kevin Cozens * kinoc (Daxtron Labs) * Kira * Kitto Flora diff --git a/OpenSim/Addons/Groups/GroupsMessagingModule.cs b/OpenSim/Addons/Groups/GroupsMessagingModule.cs index 92528a2dc9..bbb5e059d3 100644 --- a/OpenSim/Addons/Groups/GroupsMessagingModule.cs +++ b/OpenSim/Addons/Groups/GroupsMessagingModule.cs @@ -110,7 +110,15 @@ namespace OpenSim.Groups m_messageOnlineAgentsOnly = groupsConfig.GetBoolean("MessageOnlineUsersOnly", false); if (m_messageOnlineAgentsOnly) + { m_usersOnlineCache = new ExpiringCache(); + } + else + { + m_log.Error("[Groups.Messaging]: GroupsMessagingModule V2 requires MessageOnlineUsersOnly = true"); + m_groupMessagingEnabled = false; + return; + } m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", true); @@ -260,7 +268,7 @@ namespace OpenSim.Groups // Sending to offline members is not an option. string[] t1 = groupMembers.ConvertAll(gmd => gmd.AgentID.ToString()).ToArray(); - // We cache in order not to overwhlem the presence service on large grids with many groups. This does + // We cache in order not to overwhelm the presence service on large grids with many groups. This does // mean that members coming online will not see all group members until after m_usersOnlineCacheExpirySeconds has elapsed. // (assuming this is the same across all grid simulators). if (!m_usersOnlineCache.TryGetValue(groupID, out onlineAgents)) diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs index 7f453dbf8c..f11606a7b4 100644 --- a/OpenSim/Addons/Groups/GroupsModule.cs +++ b/OpenSim/Addons/Groups/GroupsModule.cs @@ -101,7 +101,7 @@ namespace OpenSim.Groups { scene.RegisterModuleInterface(this); scene.AddCommand( - "debug", + "Debug", this, "debug groups verbose", "debug groups verbose ", diff --git a/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs b/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs index d2bcba5c4b..dc36787836 100644 --- a/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs +++ b/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -158,7 +158,7 @@ namespace OpenSim.Groups } catch (Exception e) { - m_log.DebugFormat("[Groups.RobustHGConnector]: Exception {0}", e.StackTrace); + m_log.Error(string.Format("[Groups.RobustHGConnector]: Exception {0} ", e.Message), e); } return FailureResult(); diff --git a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs index 249d974630..616afa9061 100644 --- a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs +++ b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs @@ -140,7 +140,7 @@ namespace OpenSim.Groups } catch (Exception e) { - m_log.DebugFormat("[GROUPS HANDLER]: Exception {0}", e.StackTrace); + m_log.Error(string.Format("[GROUPS HANDLER]: Exception {0} ", e.Message), e); } return FailureResult(); diff --git a/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs b/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs index 13b0e7e6a8..ed5c742b78 100644 --- a/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs +++ b/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs @@ -109,7 +109,7 @@ namespace OpenSim.OfflineIM } catch (Exception e) { - m_log.DebugFormat("[OFFLINE IM HANDLER]: Exception {0}", e.StackTrace); + m_log.Error(string.Format("[OFFLINE IM HANDLER]: Exception {0} ", e.Message), e); } return FailureResult(); diff --git a/OpenSim/Data/MySQL/MySQLGroupsData.cs b/OpenSim/Data/MySQL/MySQLGroupsData.cs index 03182849c7..8e39229939 100644 --- a/OpenSim/Data/MySQL/MySQLGroupsData.cs +++ b/OpenSim/Data/MySQL/MySQLGroupsData.cs @@ -86,11 +86,11 @@ namespace OpenSim.Data.MySQL public GroupData[] RetrieveGroups(string pattern) { if (string.IsNullOrEmpty(pattern)) - pattern = "1 ORDER BY Name LIMIT 100"; + pattern = "1"; else - pattern = string.Format("Name LIKE '%{0}%' ORDER BY Name LIMIT 100", pattern); + pattern = string.Format("Name LIKE '%{0}%'", pattern); - return m_Groups.Get(pattern); + return m_Groups.Get(string.Format("ShowInList=1 AND ({0}) ORDER BY Name LIMIT 100", pattern)); } public bool DeleteGroup(UUID groupID) diff --git a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs index 6ed3b06a2a..cc4c5b0576 100644 --- a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs +++ b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs @@ -974,8 +974,8 @@ namespace OpenSim.Data.MySQL dbcon.Open(); using (MySqlCommand cmd = new MySqlCommand(query, dbcon)) { - cmd.Parameters.AddWithValue("?ImViaEmail", pref.IMViaEmail); - cmd.Parameters.AddWithValue("?Visible", pref.Visible); + cmd.Parameters.AddWithValue("?ImViaEmail", pref.IMViaEmail.ToString().ToLower()); + cmd.Parameters.AddWithValue("?Visible", pref.Visible.ToString().ToLower()); cmd.Parameters.AddWithValue("?uuid", pref.UserId.ToString()); cmd.ExecuteNonQuery(); diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs index 558dfd0e4c..57612005a1 100644 --- a/OpenSim/Framework/InventoryItemBase.cs +++ b/OpenSim/Framework/InventoryItemBase.cs @@ -82,12 +82,15 @@ namespace OpenSim.Framework set { m_creatorId = value; + + if ((m_creatorId == null) || !UUID.TryParse(m_creatorId, out m_creatorIdAsUuid)) + m_creatorIdAsUuid = UUID.Zero; } } protected string m_creatorId; /// - /// The CreatorId expressed as a UUID.tely + /// The CreatorId expressed as a UUID. /// public UUID CreatorIdAsUuid { diff --git a/OpenSim/Framework/PluginLoader.cs b/OpenSim/Framework/PluginLoader.cs index 819cb7babb..a2bf9f34ef 100644 --- a/OpenSim/Framework/PluginLoader.cs +++ b/OpenSim/Framework/PluginLoader.cs @@ -215,7 +215,7 @@ namespace OpenSim.Framework AddinManager.AddinLoadError += on_addinloaderror_; AddinManager.AddinLoaded += on_addinloaded_; - clear_registry_(); + clear_registry_(dir); suppress_console_output_(true); AddinManager.Initialize(dir); @@ -239,18 +239,19 @@ namespace OpenSim.Framework + args.Exception.StackTrace); } - private void clear_registry_() + private void clear_registry_(string dir) { // The Mono addin manager (in Mono.Addins.dll version 0.2.0.0) // occasionally seems to corrupt its addin cache // Hence, as a temporary solution we'll remove it before each startup + try { - if (Directory.Exists("addin-db-000")) - Directory.Delete("addin-db-000", true); + if (Directory.Exists(dir + "/addin-db-000")) + Directory.Delete(dir + "/addin-db-000", true); - if (Directory.Exists("addin-db-001")) - Directory.Delete("addin-db-001", true); + if (Directory.Exists(dir + "/addin-db-001")) + Directory.Delete(dir + "/addin-db-001", true); } catch (IOException) { diff --git a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs index c56f21367f..db46ea8735 100644 --- a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs +++ b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -161,7 +161,7 @@ namespace OpenSim.Framework.Serialization.External if (!hasCreatorData && creator != null) { XmlElement creatorData = doc.CreateElement("CreatorData"); - creatorData.InnerText = homeURL + ";" + creator.FirstName + " " + creator.LastName; + creatorData.InnerText = CalcCreatorData(homeURL, creator.FirstName + " " + creator.LastName); sop.AppendChild(creatorData); } } @@ -172,5 +172,15 @@ namespace OpenSim.Framework.Serialization.External return wr.ToString(); } } + + public static string CalcCreatorData(string homeURL, string name) + { + return homeURL + ";" + name; + } + + internal static string CalcCreatorData(string homeURL, UUID uuid, string name) + { + return homeURL + "/" + uuid + ";" + name; + } } -} \ No newline at end of file +} diff --git a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs index f2a6b8b87a..135cefb616 100644 --- a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs @@ -286,7 +286,8 @@ namespace OpenSim.Framework.Serialization.External UserAccount account = userAccountService.GetUserAccount(UUID.Zero, inventoryItem.CreatorIdAsUuid); if (account != null) { - writer.WriteElementString("CreatorData", (string)options["home"] + "/" + inventoryItem.CreatorIdAsUuid + ";" + account.FirstName + " " + account.LastName); + string creatorData = ExternalRepresentationUtils.CalcCreatorData((string)options["home"], inventoryItem.CreatorIdAsUuid, account.FirstName + " " + account.LastName); + writer.WriteElementString("CreatorData", creatorData); } writer.WriteElementString("CreatorID", inventoryItem.CreatorId); } diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index efaed6220c..c2c96981bb 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -2250,10 +2250,15 @@ namespace OpenSim.Framework { string[] parts = firstName.Split(new char[] { '.' }); if (parts.Length == 2) - return id.ToString() + ";" + agentsURI + ";" + parts[0] + " " + parts[1]; + return CalcUniversalIdentifier(id, agentsURI, parts[0] + " " + parts[1]); } - return id.ToString() + ";" + agentsURI + ";" + firstName + " " + lastName; + + return CalcUniversalIdentifier(id, agentsURI, firstName + " " + lastName); + } + private static string CalcUniversalIdentifier(UUID id, string agentsURI, string name) + { + return id.ToString() + ";" + agentsURI + ";" + name; } /// @@ -2288,6 +2293,38 @@ namespace OpenSim.Framework { return str.Replace("_", "\\_").Replace("%", "\\%"); } + + /// + /// Returns the name of the user's viewer. + /// + /// + /// This method handles two ways that viewers specify their name: + /// 1. Viewer = "Firestorm-Release 4.4.2.34167", Channel = "(don't care)" -> "Firestorm-Release 4.4.2.34167" + /// 2. Viewer = "4.5.1.38838", Channel = "Firestorm-Beta" -> "Firestorm-Beta 4.5.1.38838" + /// + public static string GetViewerName(AgentCircuitData agent) + { + string name = agent.Viewer; + if (name == null) + name = ""; + else + name = name.Trim(); + + // Check if 'Viewer' is just a version number. If it's *not*, then we + // assume that it contains the real viewer name, and we return it. + foreach (char c in name) + { + if (Char.IsLetter(c)) + return name; + } + + // The 'Viewer' string contains just a version number. If there's anything in + // 'Channel' then assume that it's the viewer name. + if ((agent.Channel != null) && (agent.Channel.Length > 0)) + name = agent.Channel.Trim() + " " + name; + + return name; + } } public class DoubleQueue where T:class diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 6d3331b0ad..5c3039d9d9 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -982,7 +982,7 @@ namespace OpenSim aCircuit.child ? "child" : "root", aCircuit.circuitcode.ToString(), aCircuit.IPAddress != null ? aCircuit.IPAddress.ToString() : "not set", - aCircuit.Viewer); + Util.GetViewerName(aCircuit)); }); MainConsole.Instance.Output(cdt.ToString()); diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 0dc9306536..9d36986e73 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -158,10 +158,27 @@ namespace OpenSim protected virtual void LoadPlugins() { - using (PluginLoader loader = new PluginLoader(new ApplicationPluginInitialiser(this))) + IConfig startupConfig = Config.Configs["Startup"]; + string registryLocation = (startupConfig != null) ? startupConfig.GetString("RegistryLocation", String.Empty) : String.Empty; + + // The location can also be specified in the environment. If there + // is no location in the configuration, we must call the constructor + // without a location parameter to allow that to happen. + if (registryLocation == String.Empty) { - loader.Load("/OpenSim/Startup"); - m_plugins = loader.Plugins; + using (PluginLoader loader = new PluginLoader(new ApplicationPluginInitialiser(this))) + { + loader.Load("/OpenSim/Startup"); + m_plugins = loader.Plugins; + } + } + else + { + using (PluginLoader loader = new PluginLoader(new ApplicationPluginInitialiser(this), registryLocation)) + { + loader.Load("/OpenSim/Startup"); + m_plugins = loader.Plugins; + } } } @@ -1049,4 +1066,4 @@ namespace OpenSim { public IConfigSource Source; } -} \ No newline at end of file +} diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 05dd764746..86161c9180 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -10387,7 +10387,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerDirFindQuery(this, dirFindQueryPacket.QueryData.QueryID, Utils.BytesToString( - dirFindQueryPacket.QueryData.QueryText), + dirFindQueryPacket.QueryData.QueryText).Trim(), dirFindQueryPacket.QueryData.QueryFlags, dirFindQueryPacket.QueryData.QueryStart); } diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 1ca142e62c..c3846d9db6 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -245,8 +245,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments string state = sog.GetStateSnapshot(); ad.AttachmentObjectStates.Add(state); sp.InTransitScriptStates.Add(state); - // Let's remove the scripts of the original object here - sog.RemoveScriptInstances(true); + + // Scripts of the originals will be removed when the Agent is successfully removed. + // sog.RemoveScriptInstances(true); } } } diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index f7057fef2b..9963521a4f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs @@ -483,52 +483,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver { if (m_creatorIdForAssetId.ContainsKey(assetId)) { - string xmlData = Utils.BytesToString(data); - List sceneObjects = new List(); + data = SceneObjectSerializer.ModifySerializedObject(assetId, data, + sog => { + bool modified = false; + + foreach (SceneObjectPart sop in sog.Parts) + { + if (string.IsNullOrEmpty(sop.CreatorData)) + { + sop.CreatorID = m_creatorIdForAssetId[assetId]; + modified = true; + } + } + + return modified; + }); - CoalescedSceneObjects coa = null; - if (CoalescedSceneObjectsSerializer.TryFromXml(xmlData, out coa)) - { -// m_log.DebugFormat( -// "[INVENTORY ARCHIVER]: Loaded coalescence {0} has {1} objects", assetId, coa.Count); - - if (coa.Objects.Count == 0) - { - m_log.WarnFormat( - "[INVENTORY ARCHIVE READ REQUEST]: Aborting load of coalesced object from asset {0} as it has zero loaded components", - assetId); - return false; - } - - sceneObjects.AddRange(coa.Objects); - } - else - { - SceneObjectGroup deserializedObject = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); - - if (deserializedObject != null) - { - sceneObjects.Add(deserializedObject); - } - else - { - m_log.WarnFormat( - "[INVENTORY ARCHIVE READ REQUEST]: Aborting load of object from asset {0} as deserialization failed", - assetId); - - return false; - } - } - - foreach (SceneObjectGroup sog in sceneObjects) - foreach (SceneObjectPart sop in sog.Parts) - if (string.IsNullOrEmpty(sop.CreatorData)) - sop.CreatorID = m_creatorIdForAssetId[assetId]; - - if (coa != null) - data = Utils.StringToBytes(CoalescedSceneObjectsSerializer.ToXml(coa)); - else - data = Utils.StringToBytes(SceneObjectSerializer.ToOriginalXmlFormat(sceneObjects[0])); + if (data == null) + return false; } } @@ -550,7 +522,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver return false; } } - + /// /// Load control file /// @@ -656,4 +628,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver m_assetsLoaded = true; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs b/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs index 88386129b8..3849996d4c 100644 --- a/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs @@ -150,6 +150,8 @@ namespace OpenSim.Region.CoreModules.Framework.Search void OnDirFindQuery(IClientAPI remoteClient, UUID queryID, string queryText, uint queryFlags, int queryStart) { + queryText = queryText.Trim(); + if (((DirFindFlags)queryFlags & DirFindFlags.People) == DirFindFlags.People) { if (string.IsNullOrEmpty(queryText)) @@ -194,4 +196,4 @@ namespace OpenSim.Region.CoreModules.Framework.Search } -} \ No newline at end of file +} diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index 9f0a7198ab..3455e2c956 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs @@ -278,7 +278,8 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement { foreach (UserData data in m_UserCache.Values) { - if (users.Find(delegate(UserData d) { return d.Id == data.Id; }) == null && + if (data.Id != UUID.Zero && + users.Find(delegate(UserData d) { return d.Id == data.Id; }) == null && (data.FirstName.ToLower().StartsWith(query.ToLower()) || data.LastName.ToLower().StartsWith(query.ToLower()))) users.Add(data); } @@ -725,4 +726,4 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement } -} \ No newline at end of file +} diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 2e638d4cc2..7920748f23 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs @@ -189,8 +189,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver m_rotationCenter = options.ContainsKey("rotation-center") ? (Vector3)options["rotation-center"] : new Vector3(scene.RegionInfo.RegionSizeX / 2f, scene.RegionInfo.RegionSizeY / 2f, 0f); - // Zero can never be a valid user id + // Zero can never be a valid user or group id m_validUserUuids[UUID.Zero] = false; + m_validGroupUuids[UUID.Zero] = false; m_groupsModule = m_rootScene.RequestModuleInterface(); m_assetService = m_rootScene.AssetService; @@ -523,58 +524,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver oldTelehubUUID = UUID.Zero; } - // Try to retain the original creator/owner/lastowner if their uuid is present on this grid - // or creator data is present. Otherwise, use the estate owner instead. - foreach (SceneObjectPart part in sceneObject.Parts) - { - if (string.IsNullOrEmpty(part.CreatorData)) - { - if (!ResolveUserUuid(scene, part.CreatorID)) - part.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner; - } - if (UserManager != null) - UserManager.AddUser(part.CreatorID, part.CreatorData); - - if (!ResolveUserUuid(scene, part.OwnerID)) - part.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner; - - if (!ResolveUserUuid(scene, part.LastOwnerID)) - part.LastOwnerID = scene.RegionInfo.EstateSettings.EstateOwner; - - if (!ResolveGroupUuid(part.GroupID)) - part.GroupID = UUID.Zero; - - // And zap any troublesome sit target information -// part.SitTargetOrientation = new Quaternion(0, 0, 0, 1); -// part.SitTargetPosition = new Vector3(0, 0, 0); - - // Fix ownership/creator of inventory items - // Not doing so results in inventory items - // being no copy/no mod for everyone - lock (part.TaskInventory) - { - TaskInventoryDictionary inv = part.TaskInventory; - foreach (KeyValuePair kvp in inv) - { - if (!ResolveUserUuid(scene, kvp.Value.OwnerID)) - { - kvp.Value.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner; - } - - if (string.IsNullOrEmpty(kvp.Value.CreatorData)) - { - if (!ResolveUserUuid(scene, kvp.Value.CreatorID)) - kvp.Value.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner; - } - - if (UserManager != null) - UserManager.AddUser(kvp.Value.CreatorID, kvp.Value.CreatorData); - - if (!ResolveGroupUuid(kvp.Value.GroupID)) - kvp.Value.GroupID = UUID.Zero; - } - } - } + ModifySceneObject(scene, sceneObject); if (scene.AddRestoredSceneObject(sceneObject, true, false)) { @@ -598,6 +548,67 @@ namespace OpenSim.Region.CoreModules.World.Archiver scene.RegionInfo.RegionSettings.ClearSpawnPoints(); } } + + /// + /// Optionally modify a loaded SceneObjectGroup. Currently this just ensures that the + /// User IDs and Group IDs are valid, but other manipulations could be done as well. + /// + private void ModifySceneObject(Scene scene, SceneObjectGroup sceneObject) + { + // Try to retain the original creator/owner/lastowner if their uuid is present on this grid + // or creator data is present. Otherwise, use the estate owner instead. + foreach (SceneObjectPart part in sceneObject.Parts) + { + if (string.IsNullOrEmpty(part.CreatorData)) + { + if (!ResolveUserUuid(scene, part.CreatorID)) + part.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner; + } + if (UserManager != null) + UserManager.AddUser(part.CreatorID, part.CreatorData); + + if (!(ResolveUserUuid(scene, part.OwnerID) || ResolveGroupUuid(part.OwnerID))) + part.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner; + + if (!(ResolveUserUuid(scene, part.LastOwnerID) || ResolveGroupUuid(part.LastOwnerID))) + part.LastOwnerID = scene.RegionInfo.EstateSettings.EstateOwner; + + if (!ResolveGroupUuid(part.GroupID)) + part.GroupID = UUID.Zero; + + // And zap any troublesome sit target information + // part.SitTargetOrientation = new Quaternion(0, 0, 0, 1); + // part.SitTargetPosition = new Vector3(0, 0, 0); + + // Fix ownership/creator of inventory items + // Not doing so results in inventory items + // being no copy/no mod for everyone + lock (part.TaskInventory) + { + TaskInventoryDictionary inv = part.TaskInventory; + foreach (KeyValuePair kvp in inv) + { + if (!(ResolveUserUuid(scene, kvp.Value.OwnerID) || ResolveGroupUuid(kvp.Value.OwnerID))) + { + kvp.Value.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner; + } + + if (string.IsNullOrEmpty(kvp.Value.CreatorData)) + { + if (!ResolveUserUuid(scene, kvp.Value.CreatorID)) + kvp.Value.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner; + } + + if (UserManager != null) + UserManager.AddUser(kvp.Value.CreatorID, kvp.Value.CreatorData); + + if (!ResolveGroupUuid(kvp.Value.GroupID)) + kvp.Value.GroupID = UUID.Zero; + } + } + } + } + /// /// Load serialized parcels. @@ -695,9 +706,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// private bool ResolveGroupUuid(UUID uuid) { - if (uuid == UUID.Zero) - return true; // this means the object has no group - lock (m_validGroupUuids) { if (!m_validGroupUuids.ContainsKey(uuid)) @@ -754,7 +762,21 @@ namespace OpenSim.Region.CoreModules.World.Archiver sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; if (assetType == (sbyte)AssetType.Unknown) + { m_log.WarnFormat("[ARCHIVER]: Importing {0} byte asset {1} with unknown type", data.Length, uuid); + } + else if (assetType == (sbyte)AssetType.Object) + { + data = SceneObjectSerializer.ModifySerializedObject(UUID.Parse(uuid), data, + sog => + { + ModifySceneObject(m_rootScene, sog); + return true; + }); + + if (data == null) + return false; + } //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); @@ -977,4 +999,4 @@ namespace OpenSim.Region.CoreModules.World.Archiver return dearchivedScenes; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 3bd7b4a218..cb9ad4a786 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -1342,10 +1342,7 @@ namespace OpenSim.Region.CoreModules.World.Estate { m_regionChangeTimer.Stop(); m_regionChangeTimer.Start(); - } - protected void RaiseRegionInfoChange(object sender, ElapsedEventArgs e) - { ChangeDelegate change = OnRegionInfoChange; if (change != null) diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 7f17aff66d..0ecf13bc36 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -1340,6 +1340,7 @@ namespace OpenSim.Region.CoreModules.World.Land m_scene.ForEachClient(SendParcelOverlay); land.SendLandUpdateToClient(true, remote_client); + UpdateLandObject(land.LandData.LocalID, land.LandData); } } } @@ -1360,8 +1361,10 @@ namespace OpenSim.Region.CoreModules.World.Land land.LandData.GroupID = UUID.Zero; land.LandData.IsGroupOwned = false; land.LandData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory); + m_scene.ForEachClient(SendParcelOverlay); land.SendLandUpdateToClient(true, remote_client); + UpdateLandObject(land.LandData.LocalID, land.LandData); } } } @@ -1388,6 +1391,7 @@ namespace OpenSim.Region.CoreModules.World.Land m_scene.ForEachClient(SendParcelOverlay); land.SendLandUpdateToClient(true, remote_client); + UpdateLandObject(land.LandData.LocalID, land.LandData); } } } diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index d16b73bbc0..51f6c5e6b8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1757,6 +1757,7 @@ namespace OpenSim.Region.Framework.Scenes { if (group != null) { + group.HasGroupChanged = true; group.ProcessBackup(SimulationDataService, true); } } @@ -2345,13 +2346,12 @@ namespace OpenSim.Region.Framework.Scenes { if (!softDelete) { - // Force a database update so that the scene object group ID is accurate. It's possible that the - // group has recently been delinked from another group but that this change has not been persisted - // to the DB. + // If the group contains prims whose SceneGroupID is incorrect then force a + // database update, because RemoveObject() works by searching on the SceneGroupID. // This is an expensive thing to do so only do it if absolutely necessary. - if (so.HasGroupChangedDueToDelink) - ForceSceneObjectBackup(so); - + if (so.GroupContainsForeignPrims) + ForceSceneObjectBackup(so); + so.DetachFromBackup(); SimulationDataService.RemoveObject(so.UUID, RegionInfo.RegionID); } @@ -3413,6 +3413,7 @@ namespace OpenSim.Region.Framework.Scenes // TeleportFlags.ViaLandmark | TeleportFlags.ViaLocation | TeleportFlags.ViaLandmark | TeleportFlags.Default - Regular Teleport // Don't disable this log message - it's too helpful + string curViewer = Util.GetViewerName(acd); m_log.DebugFormat( "[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, IP {6}, viewer {7}, teleportflags ({8}), position {9})", RegionInfo.RegionName, @@ -3422,7 +3423,7 @@ namespace OpenSim.Region.Framework.Scenes acd.AgentID, acd.circuitcode, acd.IPAddress, - acd.Viewer, + curViewer, ((TPFlags)teleportFlags).ToString(), acd.startpos ); @@ -3442,7 +3443,7 @@ namespace OpenSim.Region.Framework.Scenes { foreach (string viewer in m_AllowedViewers) { - if (viewer == acd.Viewer.Substring(0, viewer.Length).Trim().ToLower()) + if (viewer == curViewer.Substring(0, viewer.Length).Trim().ToLower()) { ViewerDenied = false; break; @@ -3459,7 +3460,7 @@ namespace OpenSim.Region.Framework.Scenes { foreach (string viewer in m_BannedViewers) { - if (viewer == acd.Viewer.Substring(0, viewer.Length).Trim().ToLower()) + if (viewer == curViewer.Substring(0, viewer.Length).Trim().ToLower()) { ViewerDenied = true; break; @@ -3471,7 +3472,7 @@ namespace OpenSim.Region.Framework.Scenes { m_log.DebugFormat( "[SCENE]: Access denied for {0} {1} using {2}", - acd.firstname, acd.lastname, acd.Viewer); + acd.firstname, acd.lastname, curViewer); reason = "Access denied, your viewer is banned by the region owner"; return false; } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 6f2617602e..b70e9df0ac 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -150,12 +150,27 @@ namespace OpenSim.Region.Framework.Scenes get { return m_hasGroupChanged; } } + + private bool m_groupContainsForeignPrims = false; /// - /// Has the group changed due to an unlink operation? We record this in order to optimize deletion, since - /// an unlinked group currently has to be persisted to the database before we can perform an unlink operation. + /// Whether the group contains prims that came from a different group. This happens when + /// linking or delinking groups. The implication is that until the group is persisted, + /// the prims in the database still use the old SceneGroupID. That's a problem if the group + /// is deleted, because we delete groups by searching for prims by their SceneGroupID. /// - public bool HasGroupChangedDueToDelink { get; private set; } + public bool GroupContainsForeignPrims + { + private set + { + m_groupContainsForeignPrims = value; + if (m_groupContainsForeignPrims) + HasGroupChanged = true; + } + + get { return m_groupContainsForeignPrims; } + } + private bool isTimeToPersist() { @@ -1624,7 +1639,7 @@ namespace OpenSim.Region.Framework.Scenes backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity; backup_group.RootPart.ParticleSystem = RootPart.ParticleSystem; HasGroupChanged = false; - HasGroupChangedDueToDelink = false; + GroupContainsForeignPrims = false; m_scene.EventManager.TriggerOnSceneObjectPreSave(backup_group, this); datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID); @@ -1686,28 +1701,7 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone(); dupe.Backup = false; dupe.m_parts = new MapAndArray(); - - // Warning, The following code related to previousAttachmentStatus is needed so that clones of - // attachments do not bordercross while they're being duplicated. This is hacktastic! - // Normally, setting AbsolutePosition will bordercross a prim if it's outside the region! - // unless IsAttachment is true!, so to prevent border crossing, we save it's attachment state - // (which should be false anyway) set it as an Attachment and then set it's Absolute Position, - // then restore it's attachment state - - // This is only necessary when userExposed is false! - - bool previousAttachmentStatus = dupe.IsAttachment; - - if (!userExposed) - dupe.IsAttachment = true; - dupe.m_sittingAvatars = new List(); - - if (!userExposed) - { - dupe.IsAttachment = previousAttachmentStatus; - } - dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed); dupe.m_rootPart.LinkNum = m_rootPart.LinkNum; @@ -2388,6 +2382,8 @@ namespace OpenSim.Region.Framework.Scenes // If linking prims with different permissions, fix them AdjustChildPrimPermissions(); + GroupContainsForeignPrims = true; + AttachToBackup(); // Here's the deal, this is ABSOLUTELY CRITICAL so the physics scene gets the update about the @@ -2531,9 +2527,16 @@ namespace OpenSim.Region.Framework.Scenes linkPart.Rezzed = RootPart.Rezzed; - // When we delete a group, we currently have to force persist to the database if the object id has changed - // (since delete works by deleting all rows which have a given object id) - objectGroup.HasGroupChangedDueToDelink = true; + // We must persist the delinked group to the database immediately, for safety. The problem + // is that although in memory the new group has a new SceneGroupID, in the database it + // still has the parent group's SceneGroupID (until the next backup). This means that if the + // parent group is deleted then the delinked group will also be deleted from the database. + // This problem will disappear if the region remains alive long enough for another backup, + // since at that time the delinked group's new SceneGroupID will be written to the database. + // But if the region crashes before that then the prims will be permanently gone, and this must + // not happen. (We can't use a just-in-time trick like GroupContainsForeignPrims in this case + // because the delinked group doesn't know when the source group is deleted.) + m_scene.ForceSceneObjectBackup(objectGroup); return objectGroup; } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 491d0bf380..64c464d761 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -848,7 +848,7 @@ namespace OpenSim.Region.Framework.Scenes public string Viewer { - get { return m_scene.AuthenticateHandler.GetAgentCircuitData(ControllingClient.CircuitCode).Viewer; } + get { return Util.GetViewerName(m_scene.AuthenticateHandler.GetAgentCircuitData(ControllingClient.CircuitCode)); } } #endregion diff --git a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs index 5cb271ddad..a556f9d0b9 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs @@ -119,21 +119,22 @@ namespace OpenSim.Region.Framework.Scenes.Serialization return output; } } - + public static bool TryFromXml(string xml, out CoalescedSceneObjects coa) { // m_log.DebugFormat("[COALESCED SCENE OBJECTS SERIALIZER]: TryFromXml() deserializing {0}", xml); coa = null; - int i = 0; - using (StringReader sr = new StringReader(xml)) - { - using (XmlTextReader reader = new XmlTextReader(sr)) - { - try + try + { + // Quickly check if this is a coalesced object, without fully parsing the XML + using (StringReader sr = new StringReader(xml)) + { + using (XmlTextReader reader = new XmlTextReader(sr)) { - reader.Read(); + reader.MoveToContent(); // skip possible xml declaration + if (reader.Name != "CoalescedObject") { // m_log.DebugFormat( @@ -142,49 +143,49 @@ namespace OpenSim.Region.Framework.Scenes.Serialization return false; } - - coa = new CoalescedSceneObjects(UUID.Zero); - reader.Read(); - - while (reader.NodeType != XmlNodeType.EndElement && reader.Name != "CoalescedObject") - { - if (reader.Name == "SceneObjectGroup") - { - string soXml = reader.ReadOuterXml(); - - SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(soXml); - - if (so != null) - { - coa.Add(so); - } - else - { - // XXX: Possibly we should fail outright here rather than continuing if a particular component of the - // coalesced object fails to load. - m_log.WarnFormat( - "[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml for component {0} failed. Continuing.", - i); - } - - i++; - } - } - - reader.ReadEndElement(); // CoalescedObject } - catch (Exception e) - { - m_log.ErrorFormat( - "[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml failed with {0} {1}", - e.Message, e.StackTrace); + } + + XmlDocument doc = new XmlDocument(); + doc.LoadXml(xml); + XmlElement e = (XmlElement)doc.SelectSingleNode("/CoalescedObject"); + if (e == null) + return false; - return false; - } + coa = new CoalescedSceneObjects(UUID.Zero); + + XmlNodeList groups = e.SelectNodes("SceneObjectGroup"); + int i = 0; + + foreach (XmlNode n in groups) + { + SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(n.OuterXml); + if (so != null) + { + coa.Add(so); + } + else + { + // XXX: Possibly we should fail outright here rather than continuing if a particular component of the + // coalesced object fails to load. + m_log.WarnFormat( + "[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml for component {0} failed. Continuing.", + i); + } + + i++; } } + catch (Exception e) + { + m_log.Error(string.Format( + "[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml failed with {0} ", + e.Message), e); + + return false; + } return true; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index f07dee959a..a93f3c8a85 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs @@ -299,6 +299,73 @@ namespace OpenSim.Region.Framework.Scenes.Serialization } } + + /// + /// Modifies a SceneObjectGroup. + /// + /// The object + /// Whether the object was actually modified + public delegate bool SceneObjectModifier(SceneObjectGroup sog); + + /// + /// Modifies an object by deserializing it; applying 'modifier' to each SceneObjectGroup; and reserializing. + /// + /// The object's UUID + /// Serialized data + /// The function to run on each SceneObjectGroup + /// The new serialized object's data, or null if an error occurred + public static byte[] ModifySerializedObject(UUID assetId, byte[] data, SceneObjectModifier modifier) + { + List sceneObjects = new List(); + CoalescedSceneObjects coa = null; + + string xmlData = Utils.BytesToString(data); + + if (CoalescedSceneObjectsSerializer.TryFromXml(xmlData, out coa)) + { + // m_log.DebugFormat("[SERIALIZER]: Loaded coalescence {0} has {1} objects", assetId, coa.Count); + + if (coa.Objects.Count == 0) + { + m_log.WarnFormat("[SERIALIZER]: Aborting load of coalesced object from asset {0} as it has zero loaded components", assetId); + return null; + } + + sceneObjects.AddRange(coa.Objects); + } + else + { + SceneObjectGroup deserializedObject = FromOriginalXmlFormat(xmlData); + + if (deserializedObject != null) + { + sceneObjects.Add(deserializedObject); + } + else + { + m_log.WarnFormat("[SERIALIZER]: Aborting load of object from asset {0} as deserialization failed", assetId); + return null; + } + } + + bool modified = false; + foreach (SceneObjectGroup sog in sceneObjects) + { + if (modifier(sog)) + modified = true; + } + + if (modified) + { + if (coa != null) + data = Utils.StringToBytes(CoalescedSceneObjectsSerializer.ToXml(coa)); + else + data = Utils.StringToBytes(ToOriginalXmlFormat(sceneObjects[0])); + } + + return data; + } + #region manual serialization @@ -1230,7 +1297,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization if (m_UserManagement == null) m_UserManagement = sop.ParentGroup.Scene.RequestModuleInterface(); string name = m_UserManagement.GetUserName(sop.CreatorID); - writer.WriteElementString("CreatorData", (string)options["home"] + ";" + name); + writer.WriteElementString("CreatorData", ExternalRepresentationUtils.CalcCreatorData((string)options["home"], name)); } WriteUUID(writer, "FolderID", sop.FolderID, options); @@ -1403,7 +1470,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization if (m_UserManagement == null) m_UserManagement = scene.RequestModuleInterface(); string name = m_UserManagement.GetUserName(item.CreatorID); - writer.WriteElementString("CreatorData", (string)options["home"] + ";" + name); + writer.WriteElementString("CreatorData", ExternalRepresentationUtils.CalcCreatorData((string)options["home"], name)); } writer.WriteElementString("Description", item.Description); diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs index 9378e2010d..c928b1e34c 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs @@ -91,7 +91,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests grp2.RootPart.ClearUpdateSchedule(); // Link grp2 to grp1. part2 becomes child prim to grp1. grp2 is eliminated. + Assert.IsFalse(grp1.GroupContainsForeignPrims); grp1.LinkToGroup(grp2); + Assert.IsTrue(grp1.GroupContainsForeignPrims); + + scene.Backup(true); + Assert.IsFalse(grp1.GroupContainsForeignPrims); // FIXME: Can't do this test yet since group 2 still has its root part! We can't yet null this since // it might cause SOG.ProcessBackup() to fail due to the race condition. This really needs to be fixed. @@ -143,7 +148,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(grp1.Parts.Length, Is.EqualTo(1), "Group 1 still contained part2 after delink."); Assert.That(part2.AbsolutePosition == Vector3.Zero, "The absolute position should be zero"); - Assert.That(grp3.HasGroupChangedDueToDelink, Is.True); } [Test] @@ -335,30 +339,34 @@ namespace OpenSim.Region.Framework.Scenes.Tests SceneObjectPart rootPart = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) { Name = rootPartName, UUID = rootPartUuid }; + SceneObjectPart linkPart = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) { Name = linkPartName, UUID = linkPartUuid }; + SceneObjectGroup linkGroup = new SceneObjectGroup(linkPart); + scene.AddNewSceneObject(linkGroup, true); SceneObjectGroup sog = new SceneObjectGroup(rootPart); - sog.AddPart(linkPart); - scene.AddNewSceneObject(sog, true); - - // In a test, we have to crank the backup handle manually. Normally this would be done by the timer invoked - // scene backup thread. + scene.AddNewSceneObject(sog, true); + + Assert.IsFalse(sog.GroupContainsForeignPrims); + sog.LinkToGroup(linkGroup); + Assert.IsTrue(sog.GroupContainsForeignPrims); + scene.Backup(true); - + Assert.AreEqual(1, scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID).Count); + // These changes should occur immediately without waiting for a backup pass SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false); - - Assert.That(groupToDelete.HasGroupChangedDueToDelink, Is.True); + Assert.IsFalse(groupToDelete.GroupContainsForeignPrims); + scene.DeleteSceneObject(groupToDelete, false); - Assert.That(groupToDelete.HasGroupChangedDueToDelink, Is.False); List storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID); - - Assert.That(storedObjects.Count, Is.EqualTo(1)); - Assert.That(storedObjects[0].Parts.Length, Is.EqualTo(1)); - Assert.That(storedObjects[0].ContainsPart(rootPartUuid)); + + Assert.AreEqual(1, storedObjects.Count); + Assert.AreEqual(1, storedObjects[0].Parts.Length); + Assert.IsTrue(storedObjects[0].ContainsPart(rootPartUuid)); } } } diff --git a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs index ec18db0aa8..44d4e93466 100644 --- a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs +++ b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs @@ -669,7 +669,7 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden aCircuit = new AgentCircuitData(); if (!llClient.SceneAgent.IsChildAgent) - m_log.InfoFormat("[INFO]: {0} # {1} # {2}", llClient.Name, aCircuit.Viewer, aCircuit.Id0); + m_log.InfoFormat("[INFO]: {0} # {1} # {2}", llClient.Name, Util.GetViewerName(aCircuit), aCircuit.Id0); int avg_reqs = cinfo.AsyncRequests.Values.Sum() + cinfo.GenericRequests.Values.Sum() + cinfo.SyncRequests.Values.Sum(); avg_reqs = avg_reqs / ((DateTime.Now - cinfo.StartedTime).Minutes + 1); @@ -706,4 +706,4 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden m_log.InfoFormat("[INFO]: {0,25} {1,-6}", "Total", sum); } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSActorLockAxis.cs b/OpenSim/Region/Physics/BulletSPlugin/BSActorLockAxis.cs index 8b0fdeb7f2..7e610075ee 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSActorLockAxis.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSActorLockAxis.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -121,8 +121,10 @@ public class BSActorLockAxis : BSActor // The constraint is tied to the world and oriented to the prim. // Free to move linearly in the region - OMV.Vector3 linearLow = OMV.Vector3.Zero; - OMV.Vector3 linearHigh = m_physicsScene.TerrainManager.DefaultRegionSize; + // OMV.Vector3 linearLow = OMV.Vector3.Zero; + // OMV.Vector3 linearHigh = m_physicsScene.TerrainManager.DefaultRegionSize; + OMV.Vector3 linearLow = new OMV.Vector3(-10000f, -10000f, -10000f); + OMV.Vector3 linearHigh = new OMV.Vector3(10000f, 10000f, 10000f); if (m_controllingPrim.LockedLinearAxis.X != BSPhysObject.FreeAxis) { linearLow.X = m_controllingPrim.RawPosition.X; diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index fc1896027d..c9b134cc4e 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs @@ -426,7 +426,7 @@ public sealed class BSCharacter : BSPhysObject m_targetVelocity = value; OMV.Vector3 targetVel = value; if (_setAlwaysRun && !_flying) - targetVel *= new OMV.Vector3(BSParam.AvatarAlwaysRunFactor, BSParam.AvatarAlwaysRunFactor, 0f); + targetVel *= new OMV.Vector3(BSParam.AvatarAlwaysRunFactor, BSParam.AvatarAlwaysRunFactor, 1f); if (m_moveActor != null) m_moveActor.SetVelocityAndTarget(RawVelocity, targetVel, false /* inTaintTime */); diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 6264f5d75c..978e5671da 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -897,15 +897,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance Part.Name, Part.UUID, false); - m_log.DebugFormat( - "[SCRIPT INSTANCE]: Runtime error in script {0}, part {1} {2} at {3} in {4}, displayed error {5}, actual exception {6}", + m_log.Debug(string.Format( + "[SCRIPT INSTANCE]: Runtime error in script {0}, part {1} {2} at {3} in {4} ", ScriptName, PrimName, Part.UUID, Part.AbsolutePosition, - Part.ParentGroup.Scene.Name, - text.Replace("\n", "\\n"), - e.InnerException); + Part.ParentGroup.Scene.Name), + e); } catch (Exception) { @@ -1220,4 +1219,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance return null; } } -} \ No newline at end of file +} diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs index 08ba50d488..c92e23ca1b 100644 --- a/OpenSim/Server/Base/ServerUtils.cs +++ b/OpenSim/Server/Base/ServerUtils.cs @@ -280,11 +280,11 @@ namespace OpenSim.Server.Base { if (!(e is System.MissingMethodException)) { - m_log.ErrorFormat("[SERVER UTILS]: Error loading plugin {0} from {1}. Exception: {2}, {3}", + m_log.Error(string.Format("[SERVER UTILS]: Error loading plugin {0} from {1}. Exception: {2}", interfaceName, dllName, - e.InnerException == null ? e.Message : e.InnerException.Message, - e.StackTrace); + e.InnerException == null ? e.Message : e.InnerException.Message), + e); } m_log.ErrorFormat("[SERVER UTILS]: Error loading plugin {0}: {1} args.Length {2}", dllName, e.Message, args.Length); return null; diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs index 0d7c13669c..5df3ddaee9 100644 --- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs @@ -155,7 +155,7 @@ namespace OpenSim.Server.Handlers.Asset } catch (Exception e) { - m_log.ErrorFormat("[XINVENTORY HANDLER]: Exception {0}", e.StackTrace); + m_log.Error(string.Format("[XINVENTORY HANDLER]: Exception {0} ", e.Message), e); } return FailureResult(); diff --git a/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs b/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs index d30cc228b0..d55142efc6 100644 --- a/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs +++ b/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs @@ -273,10 +273,10 @@ namespace OpenSim.Server.Handlers response.Result = OSD.SerializeMembers(note); return true; } - - object Notes = (object) note; - OSD.DeserializeMembers(ref Notes, (OSDMap)json["params"]); - return true; + + response.Error.Code = ErrorCode.InternalError; + response.Error.Message = "Error reading notes"; + return false; } public bool NotesUpdate(OSDMap json, ref JsonRpcResponse response) diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index f869060177..54191f6eec 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs @@ -50,6 +50,7 @@ namespace OpenSim.Services.Connectors.Hypergrid LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); + private string m_ServerURLHost; private string m_ServerURL; private GridRegion m_Gatekeeper; @@ -59,7 +60,7 @@ namespace OpenSim.Services.Connectors.Hypergrid public UserAgentServiceConnector(string url, bool dnsLookup) { - m_ServerURL = url; + m_ServerURL = m_ServerURLHost = url; if (dnsLookup) { @@ -75,7 +76,7 @@ namespace OpenSim.Services.Connectors.Hypergrid } catch (Exception e) { - m_log.DebugFormat("[USER AGENT CONNECTOR]: Malformed Uri {0}: {1}", m_ServerURL, e.Message); + m_log.DebugFormat("[USER AGENT CONNECTOR]: Malformed Uri {0}: {1}", url, e.Message); } } @@ -99,11 +100,12 @@ namespace OpenSim.Services.Connectors.Hypergrid m_log.Error("[USER AGENT CONNECTOR]: No Server URI named in section UserAgentService"); throw new Exception("UserAgent connector init error"); } - m_ServerURL = serviceURI; + + m_ServerURL = m_ServerURLHost = serviceURI; if (!m_ServerURL.EndsWith("/")) m_ServerURL += "/"; - m_log.DebugFormat("[USER AGENT CONNECTOR]: UserAgentServiceConnector started for {0}", m_ServerURL); + //m_log.DebugFormat("[USER AGENT CONNECTOR]: new connector to {0}", m_ServerURL); } protected override string AgentPath() @@ -206,20 +208,20 @@ namespace OpenSim.Services.Connectors.Hypergrid } catch (Exception e) { - m_log.DebugFormat("[USER AGENT CONNECTOR]: {0} call to {1} failed: {2}", methodName, m_ServerURL, e.Message); + m_log.DebugFormat("[USER AGENT CONNECTOR]: {0} call to {1} failed: {2}", methodName, m_ServerURLHost, e.Message); throw; } if (response.IsFault) { - throw new Exception(string.Format("[USER AGENT CONNECTOR]: {0} call to {1} returned an error: {2}", methodName, m_ServerURL, response.FaultString)); + throw new Exception(string.Format("[USER AGENT CONNECTOR]: {0} call to {1} returned an error: {2}", methodName, m_ServerURLHost, response.FaultString)); } hash = (Hashtable)response.Value; if (hash == null) { - throw new Exception(string.Format("[USER AGENT CONNECTOR]: {0} call to {1} returned null", methodName, m_ServerURL)); + throw new Exception(string.Format("[USER AGENT CONNECTOR]: {0} call to {1} returned null", methodName, m_ServerURLHost)); } return hash; @@ -370,14 +372,14 @@ namespace OpenSim.Services.Connectors.Hypergrid } catch { - m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for StatusNotification", m_ServerURL); + m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for StatusNotification", m_ServerURLHost); // reason = "Exception: " + e.Message; return friendsOnline; } if (response.IsFault) { - m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for StatusNotification returned an error: {1}", m_ServerURL, response.FaultString); + m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for StatusNotification returned an error: {1}", m_ServerURLHost, response.FaultString); // reason = "XMLRPC Fault"; return friendsOnline; } @@ -389,7 +391,7 @@ namespace OpenSim.Services.Connectors.Hypergrid { if (hash == null) { - m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetOnlineFriends Got null response from {0}! THIS IS BAAAAD", m_ServerURL); + m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetOnlineFriends Got null response from {0}! THIS IS BAAAAD", m_ServerURLHost); // reason = "Internal error 1"; return friendsOnline; } @@ -442,14 +444,14 @@ namespace OpenSim.Services.Connectors.Hypergrid } catch { - m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetOnlineFriends", m_ServerURL); + m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetOnlineFriends", m_ServerURLHost); // reason = "Exception: " + e.Message; return online; } if (response.IsFault) { - m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetOnlineFriends returned an error: {1}", m_ServerURL, response.FaultString); + m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetOnlineFriends returned an error: {1}", m_ServerURLHost, response.FaultString); // reason = "XMLRPC Fault"; return online; } @@ -461,7 +463,7 @@ namespace OpenSim.Services.Connectors.Hypergrid { if (hash == null) { - m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetOnlineFriends Got null response from {0}! THIS IS BAAAAD", m_ServerURL); + m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetOnlineFriends Got null response from {0}! THIS IS BAAAAD", m_ServerURLHost); // reason = "Internal error 1"; return online; } @@ -570,13 +572,13 @@ namespace OpenSim.Services.Connectors.Hypergrid if (!hash.ContainsKey("UUID")) { - throw new Exception(string.Format("[USER AGENT CONNECTOR]: get_uuid call to {0} didn't return a UUID", m_ServerURL)); + throw new Exception(string.Format("[USER AGENT CONNECTOR]: get_uuid call to {0} didn't return a UUID", m_ServerURLHost)); } UUID uuid; if (!UUID.TryParse(hash["UUID"].ToString(), out uuid)) { - throw new Exception(string.Format("[USER AGENT CONNECTOR]: get_uuid call to {0} returned an invalid UUID: {1}", m_ServerURL, hash["UUID"].ToString())); + throw new Exception(string.Format("[USER AGENT CONNECTOR]: get_uuid call to {0} returned an invalid UUID: {1}", m_ServerURLHost, hash["UUID"].ToString())); } return uuid; @@ -584,7 +586,7 @@ namespace OpenSim.Services.Connectors.Hypergrid private bool GetBoolResponse(XmlRpcRequest request, out string reason) { - //m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURL); + //m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURLHost); XmlRpcResponse response = null; try { @@ -592,14 +594,14 @@ namespace OpenSim.Services.Connectors.Hypergrid } catch (Exception e) { - m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetBoolResponse", m_ServerURL); + m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetBoolResponse", m_ServerURLHost); reason = "Exception: " + e.Message; return false; } if (response.IsFault) { - m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetBoolResponse returned an error: {1}", m_ServerURL, response.FaultString); + m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetBoolResponse returned an error: {1}", m_ServerURLHost, response.FaultString); reason = "XMLRPC Fault"; return false; } @@ -611,7 +613,7 @@ namespace OpenSim.Services.Connectors.Hypergrid { if (hash == null) { - m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got null response from {0}! THIS IS BAAAAD", m_ServerURL); + m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got null response from {0}! THIS IS BAAAAD", m_ServerURLHost); reason = "Internal error 1"; return false; } @@ -622,7 +624,7 @@ namespace OpenSim.Services.Connectors.Hypergrid else { reason = "Internal error 2"; - m_log.WarnFormat("[USER AGENT CONNECTOR]: response from {0} does not have expected key 'result'", m_ServerURL); + m_log.WarnFormat("[USER AGENT CONNECTOR]: response from {0} does not have expected key 'result'", m_ServerURLHost); } return success; diff --git a/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs index 0f8033d614..eecf096e2f 100644 --- a/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs +++ b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs @@ -97,9 +97,9 @@ namespace OpenSim.Services.Connectors } catch (Exception e) { - m_log.WarnFormat( - "[NEIGHBOUR SERVICES CONNECTOR]: Unable to parse uri {0} to send HelloNeighbour from {1} to {2}. Exception {3}{4}", - uri, thisRegion.RegionName, region.RegionName, e.Message, e.StackTrace); + m_log.Warn(string.Format( + "[NEIGHBOUR SERVICES CONNECTOR]: Unable to parse uri {0} to send HelloNeighbour from {1} to {2}. Exception {3} ", + uri, thisRegion.RegionName, region.RegionName, e.Message), e); return false; } @@ -116,9 +116,9 @@ namespace OpenSim.Services.Connectors } catch (Exception e) { - m_log.WarnFormat( - "[NEIGHBOUR SERVICES CONNECTOR]: PackRegionInfoData failed for HelloNeighbour from {0} to {1}. Exception {2}{3}", - thisRegion.RegionName, region.RegionName, e.Message, e.StackTrace); + m_log.Warn(string.Format( + "[NEIGHBOUR SERVICES CONNECTOR]: PackRegionInfoData failed for HelloNeighbour from {0} to {1}. Exception {2} ", + thisRegion.RegionName, region.RegionName, e.Message), e); return false; } @@ -136,9 +136,9 @@ namespace OpenSim.Services.Connectors } catch (Exception e) { - m_log.WarnFormat( - "[NEIGHBOUR SERVICES CONNECTOR]: Exception thrown on serialization of HelloNeighbour from {0} to {1}. Exception {2}{3}", - thisRegion.RegionName, region.RegionName, e.Message, e.StackTrace); + m_log.Warn(string.Format( + "[NEIGHBOUR SERVICES CONNECTOR]: Exception thrown on serialization of HelloNeighbour from {0} to {1}. Exception {2} ", + thisRegion.RegionName, region.RegionName, e.Message), e); return false; } @@ -153,9 +153,9 @@ namespace OpenSim.Services.Connectors } catch (Exception e) { - m_log.WarnFormat( - "[NEIGHBOUR SERVICES CONNECTOR]: Unable to send HelloNeighbour from {0} to {1}. Exception {2}{3}", - thisRegion.RegionName, region.RegionName, e.Message, e.StackTrace); + m_log.Warn(string.Format( + "[NEIGHBOUR SERVICES CONNECTOR]: Unable to send HelloNeighbour from {0} to {1} (uri {2}). Exception {3} ", + thisRegion.RegionName, region.RegionName, uri, e.Message), e); return false; } @@ -192,9 +192,9 @@ namespace OpenSim.Services.Connectors } catch (Exception e) { - m_log.WarnFormat( - "[NEIGHBOUR SERVICES CONNECTOR]: Exception on reply of DoHelloNeighbourCall from {0} back to {1}. Exception {2}{3}", - region.RegionName, thisRegion.RegionName, e.Message, e.StackTrace); + m_log.Warn(string.Format( + "[NEIGHBOUR SERVICES CONNECTOR]: Exception on reply of DoHelloNeighbourCall from {0} back to {1}. Exception {2} ", + region.RegionName, thisRegion.RegionName, e.Message), e); return false; } diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index aca414b82c..171beaa096 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -421,11 +421,18 @@ namespace OpenSim.Services.Connectors.Simulation args["destination_name"] = OSD.FromString(destination.RegionName); args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); - WebUtil.PostToService(uri, args, 40000); + OSDMap result = WebUtil.PostToService(uri, args, 40000); + + if (result == null) + return false; + bool success = result["success"].AsBoolean(); + if (!success) + return false; } catch (Exception e) { m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR] CreateObject failed with exception; {0}",e.ToString()); + return false; } return true; diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index f6136b5843..7a0228b75e 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -228,17 +228,19 @@ namespace OpenSim.Services.HypergridService aCircuit.firstname, aCircuit.lastname, authURL, aCircuit.AgentID, destination.RegionName, aCircuit.Viewer, aCircuit.Channel, aCircuit.IPAddress, aCircuit.Mac, aCircuit.Id0, aCircuit.teleportFlags.ToString()); + string curViewer = Util.GetViewerName(aCircuit); + // // Check client // if (m_AllowedClients != string.Empty) { Regex arx = new Regex(m_AllowedClients); - Match am = arx.Match(aCircuit.Viewer); + Match am = arx.Match(curViewer); if (!am.Success) { - m_log.InfoFormat("[GATEKEEPER SERVICE]: Login failed, reason: client {0} is not allowed", aCircuit.Viewer); + m_log.InfoFormat("[GATEKEEPER SERVICE]: Login failed, reason: client {0} is not allowed", curViewer); return false; } } @@ -246,11 +248,11 @@ namespace OpenSim.Services.HypergridService if (m_DeniedClients != string.Empty) { Regex drx = new Regex(m_DeniedClients); - Match dm = drx.Match(aCircuit.Viewer); + Match dm = drx.Match(curViewer); if (dm.Success) { - m_log.InfoFormat("[GATEKEEPER SERVICE]: Login failed, reason: client {0} is denied", aCircuit.Viewer); + m_log.InfoFormat("[GATEKEEPER SERVICE]: Login failed, reason: client {0} is denied", curViewer); return false; } } diff --git a/OpenSim/Services/HypergridService/HGAssetService.cs b/OpenSim/Services/HypergridService/HGAssetService.cs index 84dec8d389..5c804d47b5 100644 --- a/OpenSim/Services/HypergridService/HGAssetService.cs +++ b/OpenSim/Services/HypergridService/HGAssetService.cs @@ -76,10 +76,10 @@ namespace OpenSim.Services.HypergridService if (m_UserAccountService == null) throw new Exception(String.Format("Unable to create UserAccountService from {0}", userAccountsDll)); - // legacy configuration [obsolete] - m_HomeURL = assetConfig.GetString("ProfileServerURI", string.Empty); - // Preferred - m_HomeURL = assetConfig.GetString("HomeURI", m_HomeURL); + m_HomeURL = Util.GetConfigVarFromSections(config, "HomeURI", + new string[] { "Startup", "Hypergrid", configName }, string.Empty); + if (m_HomeURL == string.Empty) + throw new Exception("[HGAssetService] No HomeURI specified"); m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService); diff --git a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs index 90ce44a65b..1608039517 100644 --- a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs +++ b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs @@ -215,25 +215,17 @@ namespace OpenSim.Services.HypergridService if (suitcase == null) { m_log.ErrorFormat("[HG SUITCASE INVENTORY SERVICE]: Unable to create suitcase folder"); + return null; } - else - { - m_Database.StoreFolder(suitcase); + + m_Database.StoreFolder(suitcase); - // Create System folders - CreateSystemFolders(principalID, suitcase.folderID); - - SetAsNormalFolder(suitcase); - - return ConvertToOpenSim(suitcase); - } - } - else - { - return ConvertToOpenSim(suitcase); + CreateSystemFolders(principalID, suitcase.folderID); } - return null; + SetAsNormalFolder(suitcase); + + return ConvertToOpenSim(suitcase); } protected void CreateSystemFolders(UUID principalID, UUID rootID) diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 46a5c180e6..b61b5e8466 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -58,6 +58,7 @@ namespace OpenSim.Services.LLLoginService protected IGridUserService m_GridUserService; protected IAuthenticationService m_AuthenticationService; protected IInventoryService m_InventoryService; + protected IInventoryService m_HGInventoryService; protected IGridService m_GridService; protected IPresenceService m_PresenceService; protected ISimulationService m_LocalSimulationService; @@ -165,6 +166,15 @@ namespace OpenSim.Services.LLLoginService if (agentService != string.Empty) m_UserAgentService = ServerUtils.LoadPlugin(agentService, args); + // Get the Hypergrid inventory service (exists only if Hypergrid is enabled) + string hgInvServicePlugin = m_LoginServerConfig.GetString("HGInventoryServicePlugin", String.Empty); + if (hgInvServicePlugin != string.Empty) + { + string hgInvServiceArg = m_LoginServerConfig.GetString("HGInventoryServiceConstructorArg", String.Empty); + Object[] args2 = new Object[] { config, hgInvServiceArg }; + m_HGInventoryService = ServerUtils.LoadPlugin(hgInvServicePlugin, args2); + } + // // deal with the services given as argument // @@ -350,6 +360,13 @@ namespace OpenSim.Services.LLLoginService return LLFailedLoginResponse.InventoryProblem; } + if (m_HGInventoryService != null) + { + // Give the Suitcase service a chance to create the suitcase folder. + // (If we're not using the Suitcase inventory service then this won't do anything.) + m_HGInventoryService.GetRootFolder(account.PrincipalID); + } + List inventorySkel = m_InventoryService.GetInventorySkeleton(account.PrincipalID); if (m_RequireInventory && ((inventorySkel == null) || (inventorySkel != null && inventorySkel.Count == 0))) { diff --git a/Prebuild/prebuild.xml b/Prebuild/prebuild.xml index 588d7884ae..f39175b52c 100644 --- a/Prebuild/prebuild.xml +++ b/Prebuild/prebuild.xml @@ -1,6 +1,6 @@ - - + + DEBUG;TRACE @@ -31,7 +31,7 @@ type="Exe" rootNamespace="Prebuild" startupObject="Prebuild.Prebuild" - version="2.0.5" + version="2.0.6" frameworkVersion="v3_5" > Matthew Holmes (matthew@wildfiregames.com) @@ -66,7 +66,7 @@ - + diff --git a/Prebuild/src/Core/Kernel.cs b/Prebuild/src/Core/Kernel.cs index 67051d5747..761962e0a5 100644 --- a/Prebuild/src/Core/Kernel.cs +++ b/Prebuild/src/Core/Kernel.cs @@ -73,7 +73,7 @@ namespace Prebuild.Core /// /// This must match the version of the schema that is embeeded /// - private const string m_SchemaVersion = "1.9"; + private const string m_SchemaVersion = "1.10"; private const string m_Schema = "prebuild-" + m_SchemaVersion + ".xsd"; private const string m_SchemaURI = "http://dnpb.sourceforge.net/schemas/" + m_Schema; bool disposed; diff --git a/Prebuild/src/Core/Nodes/ProjectNode.cs b/Prebuild/src/Core/Nodes/ProjectNode.cs index fb92b32e73..a8227042c4 100644 --- a/Prebuild/src/Core/Nodes/ProjectNode.cs +++ b/Prebuild/src/Core/Nodes/ProjectNode.cs @@ -93,7 +93,15 @@ namespace Prebuild.Core.Nodes /// .NET 4.0 /// v4_0, - } + /// + /// .NET 4.5 + /// + v4_5, + /// + /// .NET 4.5.1 + /// + v4_5_1 + } /// /// The Node object representing /Prebuild/Solution/Project elements /// diff --git a/Prebuild/src/Core/Targets/VS2010Target.cs b/Prebuild/src/Core/Targets/VS2010Target.cs index ea9f736475..e8aeab5b01 100644 --- a/Prebuild/src/Core/Targets/VS2010Target.cs +++ b/Prebuild/src/Core/Targets/VS2010Target.cs @@ -1,138 +1,140 @@ -using System; -using System.IO; -using System.Text; - -using Prebuild.Core.Attributes; -using Prebuild.Core.Interfaces; -using Prebuild.Core.Nodes; -using Prebuild.Core.Utilities; -using System.CodeDom.Compiler; - -namespace Prebuild.Core.Targets -{ - - /// - /// - /// - [Target("vs2010")] - public class VS2010Target : VSGenericTarget - { - #region Fields - - string solutionVersion = "11.00"; - string productVersion = "9.0.30729"; - string schemaVersion = "2.0"; - string versionName = "Visual Studio 2010"; - string name = "vs2010"; - VSVersion version = VSVersion.VS10; - - #endregion - - #region Properties - - /// - /// Gets or sets the solution version. - /// - /// The solution version. - public override string SolutionVersion - { - get - { - return solutionVersion; - } - } - - /// - /// Gets or sets the product version. - /// - /// The product version. - public override string ProductVersion - { - get - { - return productVersion; - } - } - - /// - /// Gets or sets the schema version. - /// - /// The schema version. - public override string SchemaVersion - { - get - { - return schemaVersion; - } - } - - /// - /// Gets or sets the name of the version. - /// - /// The name of the version. - public override string VersionName - { - get - { - return versionName; - } - } - - /// - /// Gets or sets the version. - /// - /// The version. - public override VSVersion Version - { - get - { - return version; - } - } - - /// - /// Gets the name. - /// - /// The name. - public override string Name - { - get - { - return name; - } - } - - protected override string GetToolsVersionXml(FrameworkVersion frameworkVersion) - { - switch (frameworkVersion) - { - case FrameworkVersion.v4_0: - case FrameworkVersion.v3_5: - return "ToolsVersion=\"4.0\""; - case FrameworkVersion.v3_0: - return "ToolsVersion=\"3.0\""; - default: - return "ToolsVersion=\"2.0\""; - } - } - - public override string SolutionTag - { - get { return "# Visual Studio 2010"; } - } - - #endregion - - #region Constructors - - /// - /// Initializes a new instance of the class. - /// - public VS2010Target() - : base() - { - } - - #endregion - } -} +using System; +using System.IO; +using System.Text; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +using Prebuild.Core.Nodes; +using Prebuild.Core.Utilities; +using System.CodeDom.Compiler; + +namespace Prebuild.Core.Targets +{ + + /// + /// + /// + [Target("vs2010")] + public class VS2010Target : VSGenericTarget + { + #region Fields + + string solutionVersion = "11.00"; + string productVersion = "9.0.30729"; + string schemaVersion = "2.0"; + string versionName = "Visual Studio 2010"; + string name = "vs2010"; + VSVersion version = VSVersion.VS10; + + #endregion + + #region Properties + + /// + /// Gets or sets the solution version. + /// + /// The solution version. + public override string SolutionVersion + { + get + { + return solutionVersion; + } + } + + /// + /// Gets or sets the product version. + /// + /// The product version. + public override string ProductVersion + { + get + { + return productVersion; + } + } + + /// + /// Gets or sets the schema version. + /// + /// The schema version. + public override string SchemaVersion + { + get + { + return schemaVersion; + } + } + + /// + /// Gets or sets the name of the version. + /// + /// The name of the version. + public override string VersionName + { + get + { + return versionName; + } + } + + /// + /// Gets or sets the version. + /// + /// The version. + public override VSVersion Version + { + get + { + return version; + } + } + + /// + /// Gets the name. + /// + /// The name. + public override string Name + { + get + { + return name; + } + } + + protected override string GetToolsVersionXml(FrameworkVersion frameworkVersion) + { + switch (frameworkVersion) + { + case FrameworkVersion.v4_5_1: + case FrameworkVersion.v4_5: + case FrameworkVersion.v4_0: + case FrameworkVersion.v3_5: + return "ToolsVersion=\"4.0\""; + case FrameworkVersion.v3_0: + return "ToolsVersion=\"3.0\""; + default: + return "ToolsVersion=\"2.0\""; + } + } + + public override string SolutionTag + { + get { return "# Visual Studio 2010"; } + } + + #endregion + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + public VS2010Target() + : base() + { + } + + #endregion + } +} diff --git a/Prebuild/src/Properties/AssemblyInfo.cs b/Prebuild/src/Properties/AssemblyInfo.cs index f3ac30f39d..013743d665 100644 --- a/Prebuild/src/Properties/AssemblyInfo.cs +++ b/Prebuild/src/Properties/AssemblyInfo.cs @@ -61,7 +61,7 @@ using System.Resources; [assembly: AssemblyConfiguration(".NET CLR")] [assembly: AssemblyCompany("The Prebuild Project")] [assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("Copyright 2004-2010 " + +[assembly: AssemblyCopyright("Copyright 2004-2013 " + "Matthew Holmes, " + "Dan Moorehead, " + "C.J. Adams-Collier, " + @@ -71,7 +71,7 @@ using System.Resources; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguageAttribute("en-US")] -[assembly: AssemblyVersion("2.0.5.*")] +[assembly: AssemblyVersion("2.0.6.*")] // // Version information for an assembly consists of the following four values: diff --git a/Prebuild/src/data/prebuild-1.10.xsd b/Prebuild/src/data/prebuild-1.10.xsd new file mode 100644 index 0000000000..eee07a8f01 --- /dev/null +++ b/Prebuild/src/data/prebuild-1.10.xsd @@ -0,0 +1,338 @@ + + + + + Copyright (c) 2004-2007 + Matthew Holmes (calefaction at houston . rr . com), + Dan Moorehead (dan05a at gmail . com), + David Hudson (jendave at yahoo dot com), + C.J. Adams-Collier (cjac at colliertech dot com) + + .NET Prebuild is a cross-platform XML-driven pre-build tool which + allows developers to easily generate project or make files for major + IDE's and .NET development tools including: Visual Studio .NET 2002, + 2003, and 2005, SharpDevelop, MonoDevelop, NAnt, Xcode and the GNU Autotools. + + BSD License: + + 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. + * The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR '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 AUTHOR 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. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index d8474d3d37..4f2563c297 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -57,6 +57,12 @@ ; when running with the SmartThreadPool option above MaxPoolThreads = 15 + ; Plugin Registry Location + ; Set path to directory for plugin registry. Information about the + ; registered repositories and installed plugins will be stored here. + ; The OpenSim.exe process must have R/W access to the location. + ; RegistryLocation = "." + ; ## ; ## CLIENTS ; ## diff --git a/bin/Prebuild.exe b/bin/Prebuild.exe index 1d4a8e82b7..cc6470689d 100755 Binary files a/bin/Prebuild.exe and b/bin/Prebuild.exe differ diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example index 245f363b38..14e9bff296 100644 --- a/bin/Robust.HG.ini.example +++ b/bin/Robust.HG.ini.example @@ -335,6 +335,10 @@ HGAssetServiceConnector = "HGAssetService@8002/OpenSim.Server.Handlers.dll:Asset UserAgentService = "OpenSim.Services.HypergridService.dll:UserAgentService" FriendsService = "OpenSim.Services.FriendsService.dll:FriendsService" + ; This inventory service will be used to initialize the user's inventory + HGInventoryServicePlugin = "OpenSim.Services.HypergridService.dll:HGSuitcaseInventoryService" + HGInventoryServiceConstructorArg = "HGInventoryService" + ;; Ask co-operative viewers to use a different currency name ;Currency = "" @@ -634,7 +638,7 @@ HGAssetServiceConnector = "HGAssetService@8002/OpenSim.Server.Handlers.dll:Asset ;; ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;Old Guids=true;" ;; Realm = UserProfiles UserAccountService = OpenSim.Services.UserAccountService.dll:UserAccountService - AuthenticationServiceModule = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService + AuthenticationServiceModule = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" [BakedTextureService] LocalServiceModule = "OpenSim.Server.Handlers.dll:XBakes" diff --git a/prebuild.xml b/prebuild.xml index c16d6e6e81..80ee2c0def 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -1,5 +1,5 @@ - + diff --git a/runprebuild.bat b/runprebuild.bat index 5f75982e79..ed2def1d57 100755 --- a/runprebuild.bat +++ b/runprebuild.bat @@ -7,11 +7,19 @@ setlocal ENABLEEXTENSIONS set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0" set VALUE_NAME=MSBuildToolsPath -rem We have to use find here as req query spits out 4 lines before Windows 7 -rem But 2 lines after Windows 7. Unfortunately, this screws up cygwin -rem as it uses its own find command. This could be fixed but it could be -rem complex to find the location of find on all windows systems -FOR /F "usebackq tokens=1-3" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul ^| FIND "%VALUE_NAME%"`) DO ( +rem We have to use grep or find to locate the correct line, because reg query spits +rem out 4 lines before Windows 7 but 2 lines after Windows 7. +rem We use grep if it's on the path; otherwise we use the built-in find command +rem from Windows. (We must use grep on Cygwin because it overrides the "find" command.) + +for %%X in (grep.exe) do (set FOUNDGREP=%%~$PATH:X) +if defined FOUNDGREP ( + set FINDCMD=grep +) else ( + set FINDCMD=find +) + +FOR /F "usebackq tokens=1-3" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul ^| %FINDCMD% "%VALUE_NAME%"`) DO ( set ValueName=%%A set ValueType=%%B set ValueValue=%%C