Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

This commit is contained in:
Justin Clark-Casey (justincc)
2014-03-25 00:20:38 +00:00
54 changed files with 1020 additions and 477 deletions

View File

@@ -110,7 +110,15 @@ namespace OpenSim.Groups
m_messageOnlineAgentsOnly = groupsConfig.GetBoolean("MessageOnlineUsersOnly", false);
if (m_messageOnlineAgentsOnly)
{
m_usersOnlineCache = new ExpiringCache<UUID, PresenceInfo[]>();
}
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<string>(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))

View File

@@ -101,7 +101,7 @@ namespace OpenSim.Groups
{
scene.RegisterModuleInterface<IGroupsModule>(this);
scene.AddCommand(
"debug",
"Debug",
this,
"debug groups verbose",
"debug groups verbose <true|false>",

View File

@@ -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();

View File

@@ -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();

View File

@@ -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();

View File

@@ -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)

View File

@@ -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();

View File

@@ -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;
/// <value>
/// The CreatorId expressed as a UUID.tely
/// The CreatorId expressed as a UUID.
/// </value>
public UUID CreatorIdAsUuid
{

View File

@@ -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)
{

View File

@@ -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;
}
}
}
}

View File

@@ -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);
}

View File

@@ -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;
}
/// <summary>
@@ -2288,6 +2293,38 @@ namespace OpenSim.Framework
{
return str.Replace("_", "\\_").Replace("%", "\\%");
}
/// <summary>
/// Returns the name of the user's viewer.
/// </summary>
/// <remarks>
/// 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"
/// </remarks>
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<T> where T:class

View File

@@ -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());

View File

@@ -158,10 +158,27 @@ namespace OpenSim
protected virtual void LoadPlugins()
{
using (PluginLoader<IApplicationPlugin> loader = new PluginLoader<IApplicationPlugin>(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<IApplicationPlugin> loader = new PluginLoader<IApplicationPlugin>(new ApplicationPluginInitialiser(this)))
{
loader.Load("/OpenSim/Startup");
m_plugins = loader.Plugins;
}
}
else
{
using (PluginLoader<IApplicationPlugin> loader = new PluginLoader<IApplicationPlugin>(new ApplicationPluginInitialiser(this), registryLocation))
{
loader.Load("/OpenSim/Startup");
m_plugins = loader.Plugins;
}
}
}
@@ -1049,4 +1066,4 @@ namespace OpenSim
{
public IConfigSource Source;
}
}
}

View File

@@ -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);
}

View File

@@ -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);
}
}
}

View File

@@ -483,52 +483,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{
if (m_creatorIdForAssetId.ContainsKey(assetId))
{
string xmlData = Utils.BytesToString(data);
List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
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;
}
}
/// <summary>
/// Load control file
/// </summary>
@@ -656,4 +628,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
m_assetsLoaded = true;
}
}
}
}

View File

@@ -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
}
}
}

View File

@@ -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
}
}
}

View File

@@ -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<IGroupsModule>();
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<UUID, TaskInventoryItem> 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();
}
}
/// <summary>
/// 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.
/// </summary>
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<UUID, TaskInventoryItem> 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;
}
}
}
}
/// <summary>
/// Load serialized parcels.
@@ -695,9 +706,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
/// <returns></returns>
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;
}
}
}
}

View File

@@ -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)

View File

@@ -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);
}
}
}

View File

@@ -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;
}

View File

@@ -150,12 +150,27 @@ namespace OpenSim.Region.Framework.Scenes
get { return m_hasGroupChanged; }
}
private bool m_groupContainsForeignPrims = false;
/// <summary>
/// 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.
/// </summary>
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<OpenMetaverse.UUID, SceneObjectPart>();
// 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<UUID>();
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;
}

View File

@@ -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

View File

@@ -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;
}
}
}
}

View File

@@ -299,6 +299,73 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
}
}
/// <summary>
/// Modifies a SceneObjectGroup.
/// </summary>
/// <param name="sog">The object</param>
/// <returns>Whether the object was actually modified</returns>
public delegate bool SceneObjectModifier(SceneObjectGroup sog);
/// <summary>
/// Modifies an object by deserializing it; applying 'modifier' to each SceneObjectGroup; and reserializing.
/// </summary>
/// <param name="assetId">The object's UUID</param>
/// <param name="data">Serialized data</param>
/// <param name="modifier">The function to run on each SceneObjectGroup</param>
/// <returns>The new serialized object's data, or null if an error occurred</returns>
public static byte[] ModifySerializedObject(UUID assetId, byte[] data, SceneObjectModifier modifier)
{
List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
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<IUserManagement>();
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<IUserManagement>();
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);

View File

@@ -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<SceneObjectGroup> 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));
}
}
}

View File

@@ -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);
}
}
}
}

View File

@@ -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;

View File

@@ -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 */);

View File

@@ -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;
}
}
}
}

View File

@@ -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;

View File

@@ -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();

View File

@@ -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)

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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;
}
}

View File

@@ -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<string>(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);

View File

@@ -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)

View File

@@ -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<IUserAgentService>(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<IInventoryService>(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<InventoryFolderBase> inventorySkel = m_InventoryService.GetInventorySkeleton(account.PrincipalID);
if (m_RequireInventory && ((inventorySkel == null) || (inventorySkel != null && inventorySkel.Count == 0)))
{