From 13b2ac14253a5f9ec75ec9712d1fd2fe17d1d005 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sun, 4 May 2014 20:54:42 -0700
Subject: Makes it possible to support grids in which all the simulators share
all central services of a Robust server EXCEPT assets. In other words, grids
where the simulators' assets are kept in one DB and the users' inventory
assets are kept on another. When users rez items from inventory or take
objects from world, an HG-like asset copy takes place between the 2 servers,
the world asset server and the user's asset server. This makes the simulators
independent of the central asset server.
Note that this an advanced configuration and requires some security strengthening coming up.
---
.../InventoryAccess/HGInventoryAccessModule.cs | 100 +++++++++++++++++----
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 15 +++-
2 files changed, 93 insertions(+), 22 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index ce7ed26..283a0cf 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -64,6 +64,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
private bool m_bypassPermissions = true;
+ // This simple check makes it possible to support grids in which all the simulators
+ // share all central services of the Robust server EXCEPT assets. In other words,
+ // grids where the simulators' assets are kept in one DB and the users' inventory assets
+ // are kept on another. When users rez items from inventory or take objects from world,
+ // an HG-like asset copy takes place between the 2 servers, the world asset server and
+ // the user's asset server.
+ private bool m_CheckSeparateAssets = false;
+ private string m_LocalAssetsURL = string.Empty;
+
// private bool m_Initialized = false;
#region INonSharedRegionModule
@@ -99,6 +108,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
m_OutboundPermission = thisModuleConfig.GetBoolean("OutboundPermission", true);
m_RestrictInventoryAccessAbroad = thisModuleConfig.GetBoolean("RestrictInventoryAccessAbroad", true);
+ m_CheckSeparateAssets = thisModuleConfig.GetBoolean("CheckSeparateAssets", false);
+ m_LocalAssetsURL = thisModuleConfig.GetString("RegionHGAssetServerURI", string.Empty);
+ m_LocalAssetsURL = m_LocalAssetsURL.Trim(new char[] { '/' });
+
}
else
m_log.Warn("[HG INVENTORY ACCESS MODULE]: HGInventoryAccessModule configs not found. ProfileServerURI not set!");
@@ -293,41 +306,92 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
public override void TransferInventoryAssets(InventoryItemBase item, UUID sender, UUID receiver)
{
- string userAssetServer = string.Empty;
- if (IsForeignUser(sender, out userAssetServer) && userAssetServer != string.Empty)
- m_assMapper.Get(item.AssetID, sender, userAssetServer);
+ string senderAssetServer = string.Empty;
+ string receiverAssetServer = string.Empty;
+ bool isForeignSender, isForeignReceiver;
+ isForeignSender = IsForeignUser(sender, out senderAssetServer);
+ isForeignReceiver = IsForeignUser(receiver, out receiverAssetServer);
+
+ // They're both local. Nothing to do.
+ if (!isForeignSender && !isForeignReceiver)
+ return;
+
+ // At least one of them is foreign.
+ // If both users have the same asset server, no need to transfer the asset
+ if (senderAssetServer.Equals(receiverAssetServer))
+ {
+ m_log.DebugFormat("[HGScene]: Asset transfer between foreign users, but they have the same server. No transfer.");
+ return;
+ }
- if (IsForeignUser(receiver, out userAssetServer) && userAssetServer != string.Empty && m_OutboundPermission)
- m_assMapper.Post(item.AssetID, receiver, userAssetServer);
+ if (isForeignSender && senderAssetServer != string.Empty)
+ m_assMapper.Get(item.AssetID, sender, senderAssetServer);
+
+ if (isForeignReceiver && receiverAssetServer != string.Empty && m_OutboundPermission)
+ m_assMapper.Post(item.AssetID, receiver, receiverAssetServer);
}
public override bool IsForeignUser(UUID userID, out string assetServerURL)
{
assetServerURL = string.Empty;
- if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(userID))
- { // foreign
- ScenePresence sp = null;
- if (m_Scene.TryGetScenePresence(userID, out sp))
+ if (UserManagementModule != null)
+ {
+ if (!m_CheckSeparateAssets)
{
- AgentCircuitData aCircuit = m_Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
- if (aCircuit != null && aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServerURI"))
- {
- assetServerURL = aCircuit.ServiceURLs["AssetServerURI"].ToString();
- assetServerURL = assetServerURL.Trim(new char[] { '/' });
+ if (!UserManagementModule.IsLocalGridUser(userID))
+ { // foreign
+ ScenePresence sp = null;
+ if (m_Scene.TryGetScenePresence(userID, out sp))
+ {
+ AgentCircuitData aCircuit = m_Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
+ if (aCircuit != null && aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServerURI"))
+ {
+ assetServerURL = aCircuit.ServiceURLs["AssetServerURI"].ToString();
+ assetServerURL = assetServerURL.Trim(new char[] { '/' });
+ }
+ }
+ else
+ {
+ assetServerURL = UserManagementModule.GetUserServerURL(userID, "AssetServerURI");
+ assetServerURL = assetServerURL.Trim(new char[] { '/' });
+ }
+ return true;
}
}
else
{
- assetServerURL = UserManagementModule.GetUserServerURL(userID, "AssetServerURI");
- assetServerURL = assetServerURL.Trim(new char[] { '/' });
+ if (IsLocalInventoryAssetsUser(userID, out assetServerURL))
+ {
+ m_log.DebugFormat("[HGScene]: user {0} has local assets {1}", userID, assetServerURL);
+ return false;
+ }
+ else
+ {
+ m_log.DebugFormat("[HGScene]: user {0} has foreign assets {1}", userID, assetServerURL);
+ return true;
+ }
}
- return true;
}
-
return false;
}
+ private bool IsLocalInventoryAssetsUser(UUID uuid, out string assetsURL)
+ {
+ assetsURL = UserManagementModule.GetUserServerURL(uuid, "AssetServerURI");
+ if (assetsURL == string.Empty)
+ {
+ AgentCircuitData agent = m_Scene.AuthenticateHandler.GetAgentCircuitData(uuid);
+ if (agent != null)
+ {
+ assetsURL = agent.ServiceURLs["AssetServerURI"].ToString();
+ assetsURL = assetsURL.Trim(new char[] { '/' });
+ }
+ }
+ return m_LocalAssetsURL.Equals(assetsURL);
+ }
+
+
protected override InventoryItemBase GetItem(UUID agentID, UUID itemID)
{
InventoryItemBase item = base.GetItem(agentID, itemID);
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index bb9f457..64da5f6 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -125,13 +125,18 @@ namespace OpenSim.Region.Framework.Scenes
return false;
}
+ }
+
+ public bool AddInventoryItem(InventoryItemBase item)
+ {
+ return AddInventoryItem(item, true);
}
///
/// Add the given inventory item to a user's inventory.
///
///
- public bool AddInventoryItem(InventoryItemBase item)
+ public bool AddInventoryItem(InventoryItemBase item, bool trigger)
{
if (item.Folder != UUID.Zero && InventoryService.AddItem(item))
{
@@ -140,7 +145,8 @@ namespace OpenSim.Region.Framework.Scenes
{
userlevel = 1;
}
- EventManager.TriggerOnNewInventoryItemUploadComplete(item.Owner, (AssetType)item.AssetType, item.AssetID, item.Name, userlevel);
+ if (trigger)
+ EventManager.TriggerOnNewInventoryItemUploadComplete(item.Owner, (AssetType)item.AssetType, item.AssetID, item.Name, userlevel);
return true;
}
@@ -179,7 +185,8 @@ namespace OpenSim.Region.Framework.Scenes
{
userlevel = 1;
}
- EventManager.TriggerOnNewInventoryItemUploadComplete(item.Owner, (AssetType)item.AssetType, item.AssetID, item.Name, userlevel);
+ if (trigger)
+ EventManager.TriggerOnNewInventoryItemUploadComplete(item.Owner, (AssetType)item.AssetType, item.AssetID, item.Name, userlevel);
if (originalFolder != UUID.Zero)
{
@@ -751,7 +758,7 @@ namespace OpenSim.Region.Framework.Scenes
IInventoryAccessModule invAccess = RequestModuleInterface();
if (invAccess != null)
invAccess.TransferInventoryAssets(itemCopy, senderId, recipient);
- AddInventoryItem(itemCopy);
+ AddInventoryItem(itemCopy, false);
if (!Permissions.BypassPermissions())
{
--
cgit v1.1
From a845c1a893a203f1a9bc38dc754a6f94e4c02ea5 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Wed, 7 May 2014 19:38:33 -0700
Subject: Finished implementing redirects in GetTexture.
---
OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
index 54cf285..bb932f2 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
@@ -63,7 +63,7 @@ namespace OpenSim.Region.ClientStack.Linden
private bool m_Enabled = false;
// TODO: Change this to a config option
- const string REDIRECT_URL = null;
+ private string m_RedirectURL = null;
private string m_URL;
@@ -78,7 +78,10 @@ namespace OpenSim.Region.ClientStack.Linden
m_URL = config.GetString("Cap_GetTexture", string.Empty);
// Cap doesn't exist
if (m_URL != string.Empty)
+ {
m_Enabled = true;
+ m_RedirectURL = config.GetString("GetTextureRedirectURL");
+ }
}
public void AddRegion(Scene s)
@@ -132,14 +135,14 @@ namespace OpenSim.Region.ClientStack.Linden
// m_log.DebugFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
caps.RegisterHandler(
"GetTexture",
- new GetTextureHandler("/CAPS/" + capID + "/", m_assetService, "GetTexture", agentID.ToString()));
+ new GetTextureHandler("/CAPS/" + capID + "/", m_assetService, "GetTexture", agentID.ToString(), m_RedirectURL));
}
else
{
// m_log.DebugFormat("[GETTEXTURE]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
IExternalCapsModule handler = m_scene.RequestModuleInterface();
if (handler != null)
- handler.RegisterExternalUserCapsHandler(agentID,caps,"GetTexture",m_URL);
+ handler.RegisterExternalUserCapsHandler(agentID,caps,"GetTexture", m_URL);
else
caps.RegisterHandler("GetTexture", m_URL);
}
--
cgit v1.1
From 667a272cce75dbfd39c30bff9a5d9999bbacb460 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Fri, 9 May 2014 11:06:03 -0700
Subject: This little sucker had evaded my attention forever. As a consequence
some assets associated with foreign users were being missed.
---
.../Region/ClientStack/Linden/UDP/LLClientView.cs | 38 ++++++++++++++++------
1 file changed, 28 insertions(+), 10 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 53217a0..c28e58d 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -8949,7 +8949,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (aCircuit != null && aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServerURI"))
{
string assetServer = aCircuit.ServiceURLs["AssetServerURI"].ToString();
- return ((Scene)Scene).AssetService.Get(assetServer + "/" + id);
+ if (!string.IsNullOrEmpty(assetServer))
+ return ((Scene)Scene).AssetService.Get(assetServer + "/" + id);
}
return null;
@@ -12658,16 +12659,33 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (asset == null)
{
- req.AssetInf = null;
- req.AssetRequestSource = source;
- req.IsTextureRequest = false;
- req.NumPackets = 0;
- req.Params = transferRequest.TransferInfo.Params;
- req.RequestAssetID = requestID;
- req.TransferRequestID = transferRequest.TransferInfo.TransferID;
+ // Try the user's asset server
+ IInventoryAccessModule inventoryAccessModule = Scene.RequestModuleInterface();
+
+ string assetServerURL = string.Empty;
+ if (inventoryAccessModule.IsForeignUser(AgentId, out assetServerURL) && !string.IsNullOrEmpty(assetServerURL))
+ {
+ if (!assetServerURL.EndsWith("/") && !assetServerURL.EndsWith("="))
+ assetServerURL = assetServerURL + "/";
+
+ //m_log.DebugFormat("[LLCLIENTVIEW]: asset {0} not found in local storage. Trying user's storage.", assetServerURL + id);
+ asset = m_scene.AssetService.Get(assetServerURL + id);
+ }
+
+ if (asset == null)
+ {
+ req.AssetInf = null;
+ req.AssetRequestSource = source;
+ req.IsTextureRequest = false;
+ req.NumPackets = 0;
+ req.Params = transferRequest.TransferInfo.Params;
+ req.RequestAssetID = requestID;
+ req.TransferRequestID = transferRequest.TransferInfo.TransferID;
+
+ SendAssetNotFound(req);
+ return;
+ }
- SendAssetNotFound(req);
- return;
}
if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset)
--
cgit v1.1
From 19d8f05584f67d73539616235a5de2d9f4f56cd4 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 12 May 2014 22:15:01 +0100
Subject: minor: eliminate unused UUID in xmlrpc
GroupsMessagingModule.ProcessMessageFromGroupSession()
---
.../Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs | 2 --
1 file changed, 2 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
index fd804cd..f8fcd65 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
@@ -431,8 +431,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
// Add them to the session for now, and Invite them
m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID);
- UUID toAgentID = new UUID(msg.toAgentID);
-
GroupRecord groupInfo = m_groupData.GetGroupRecord(UUID.Zero, GroupID, null);
if (groupInfo != null)
{
--
cgit v1.1
From 8457044b2f46e477442e3dec520c9a47ca20dd6b Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 12 May 2014 22:23:24 +0100
Subject: Eliminate subsequently unused scene finding in UndeliveredMessage()
method of xmlrpc and core offline IM modules
---
.../Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs | 4 ----
1 file changed, 4 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs
index 7f3d0a2..bd2b2fe 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs
@@ -226,10 +226,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
return;
}
- Scene scene = FindScene(new UUID(im.fromAgentID));
- if (scene == null)
- scene = m_SceneList[0];
-
bool success = SynchronousRestObjectRequester.MakeRequest(
"POST", m_RestURL+"/SaveMessage/", im);
--
cgit v1.1
From 515d373a8e5204410797d450def00e87f7c9cd74 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 12 May 2014 22:54:54 +0100
Subject: Add send group notice regression test for when
MessageOnlineUsersOnly=true
---
.../Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs | 71 ++++++++++++++++++++++
1 file changed, 71 insertions(+)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
index 71f1098..b5a10af 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
@@ -187,5 +187,76 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests
Assert.That(sp2ReceivedMessages.Count, Is.EqualTo(0));
}
+
+ ///
+ /// Run test with the MessageOnlineUsersOnly flag set.
+ ///
+ [Test]
+ public void TestSendGroupNoticeOnlineOnly()
+ {
+ TestHelpers.InMethod();
+ // TestHelpers.EnableLogging();
+
+ TestScene scene = new SceneHelpers().SetupScene();
+
+ MessageTransferModule mtm = new MessageTransferModule();
+ GroupsModule gm = new GroupsModule();
+ GroupsMessagingModule gmm = new GroupsMessagingModule();
+
+ IConfigSource configSource = new IniConfigSource();
+
+ {
+ IConfig config = configSource.AddConfig("Messaging");
+ config.Set("MessageTransferModule", mtm.Name);
+ }
+
+ {
+ IConfig config = configSource.AddConfig("Groups");
+ config.Set("Enabled", true);
+ config.Set("Module", gm.Name);
+ config.Set("DebugEnabled", true);
+ config.Set("MessagingModule", gmm.Name);
+ config.Set("MessagingEnabled", true);
+ config.Set("MessageOnlineUsersOnly", true);
+ }
+
+ SceneHelpers.SetupSceneModules(scene, configSource, new MockGroupsServicesConnector(), mtm, gm, gmm);
+
+ UUID userId = TestHelpers.ParseTail(0x1);
+ string subjectText = "newman";
+ string messageText = "Hello";
+ string combinedSubjectMessage = string.Format("{0}|{1}", subjectText, messageText);
+
+ ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));
+ TestClient tc = (TestClient)sp.ControllingClient;
+
+ UUID groupID = gm.CreateGroup(tc, "group1", null, true, UUID.Zero, 0, true, true, true);
+ gm.JoinGroupRequest(tc, groupID);
+
+ // Create a second user who doesn't want to receive notices
+ ScenePresence sp2 = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x2));
+ TestClient tc2 = (TestClient)sp2.ControllingClient;
+ gm.JoinGroupRequest(tc2, groupID);
+ gm.SetGroupAcceptNotices(tc2, groupID, false, true);
+
+ List spReceivedMessages = new List();
+ tc.OnReceivedInstantMessage += im => spReceivedMessages.Add(im);
+
+ List sp2ReceivedMessages = new List();
+ tc2.OnReceivedInstantMessage += im => sp2ReceivedMessages.Add(im);
+
+ GridInstantMessage noticeIm = new GridInstantMessage();
+ noticeIm.fromAgentID = userId.Guid;
+ noticeIm.toAgentID = groupID.Guid;
+ noticeIm.message = combinedSubjectMessage;
+ noticeIm.dialog = (byte)InstantMessageDialog.GroupNotice;
+
+ tc.HandleImprovedInstantMessage(noticeIm);
+
+ Assert.That(spReceivedMessages.Count, Is.EqualTo(1));
+ Assert.That(spReceivedMessages[0].message, Is.EqualTo(combinedSubjectMessage));
+
+ Assert.That(sp2ReceivedMessages.Count, Is.EqualTo(0));
+ }
}
}
\ No newline at end of file
--
cgit v1.1
From 87e2668529af4479e3dd94215193ff63ae685148 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 12 May 2014 23:30:44 +0100
Subject: For XmlRpcGroups (Flotsam) module, when MessageOnlineUsersOnly =
true, handle notices to offline users directly as known undeliverable
messages rather than discarding or attempting delivery.
Offline notices can still be controlled with the [Messaging] ForwardOfflineGroupMessages setting.
Looks to address more of http://opensimulator.org/mantis/view.php?id=7037
Only for Flotsam now for testing, but if approach works should be possible with core offline notices as well.
---
.../InstantMessage/HGMessageTransferModule.cs | 4 +--
.../Avatar/InstantMessage/MessageTransferModule.cs | 10 +++---
.../Framework/Interfaces/IMessageTransferModule.cs | 2 ++
.../Avatar/XmlRpcGroups/GroupsMessagingModule.cs | 39 ++++++++++++++--------
4 files changed, 35 insertions(+), 20 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs
index c51b30f..6f3c80a 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs
@@ -210,7 +210,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
success = m_IMService.OutgoingInstantMessage(im, url, foreigner);
if (!success && !foreigner)
- HandleUndeliveredMessage(im, result);
+ HandleUndeliverableMessage(im, result);
else
result(success);
});
@@ -246,7 +246,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
return successful;
}
- protected void HandleUndeliveredMessage(GridInstantMessage im, MessageResultNotification result)
+ public void HandleUndeliverableMessage(GridInstantMessage im, MessageResultNotification result)
{
UndeliveredMessage handlerUndeliveredMessage = OnUndeliveredMessage;
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
index 40a400f..7aa7123 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
@@ -181,7 +181,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
SendGridInstantMessageViaXMLRPC(im, result);
}
- private void HandleUndeliveredMessage(GridInstantMessage im, MessageResultNotification result)
+ public void HandleUndeliverableMessage(GridInstantMessage im, MessageResultNotification result)
{
UndeliveredMessage handlerUndeliveredMessage = OnUndeliveredMessage;
@@ -511,14 +511,14 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
if (upd.RegionID == prevRegionID)
{
// m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message");
- HandleUndeliveredMessage(im, result);
+ HandleUndeliverableMessage(im, result);
return;
}
}
else
{
// m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message");
- HandleUndeliveredMessage(im, result);
+ HandleUndeliverableMessage(im, result);
return;
}
}
@@ -567,12 +567,12 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
else
{
m_log.WarnFormat("[GRID INSTANT MESSAGE]: Unable to find region {0}", upd.RegionID);
- HandleUndeliveredMessage(im, result);
+ HandleUndeliverableMessage(im, result);
}
}
else
{
- HandleUndeliveredMessage(im, result);
+ HandleUndeliverableMessage(im, result);
}
}
diff --git a/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs b/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs
index b0b47a7..379c769 100644
--- a/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs
@@ -37,5 +37,7 @@ namespace OpenSim.Region.Framework.Interfaces
event UndeliveredMessage OnUndeliveredMessage;
void SendInstantMessage(GridInstantMessage im, MessageResultNotification result);
+
+ void HandleUndeliverableMessage(GridInstantMessage im, MessageResultNotification result);
}
}
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
index f8fcd65..26b70a1 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
@@ -248,6 +248,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
{
List groupMembers = m_groupData.GetGroupMembers(sendingAgentForGroupCalls, groupID);
int groupMembersCount = groupMembers.Count;
+ HashSet attemptDeliveryUuidSet = null;
if (m_messageOnlineAgentsOnly)
{
@@ -263,10 +264,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
m_usersOnlineCache.Add(groupID, onlineAgents, m_usersOnlineCacheExpirySeconds);
}
- HashSet onlineAgentsUuidSet = new HashSet();
- Array.ForEach(onlineAgents, pi => onlineAgentsUuidSet.Add(pi.UserID));
+ attemptDeliveryUuidSet
+ = new HashSet(Array.ConvertAll(onlineAgents, pi => pi.UserID));
- groupMembers = groupMembers.Where(gmd => onlineAgentsUuidSet.Contains(gmd.AgentID.ToString())).ToList();
+ //Array.ForEach(onlineAgents, pi => attemptDeliveryUuidSet.Add(pi.UserID));
+
+ //groupMembers = groupMembers.Where(gmd => onlineAgentsUuidSet.Contains(gmd.AgentID.ToString())).ToList();
// if (m_debugEnabled)
// m_log.DebugFormat(
@@ -275,6 +278,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
}
else
{
+ attemptDeliveryUuidSet
+ = new HashSet(groupMembers.ConvertAll(gmd => gmd.AgentID.ToString()));
+
if (m_debugEnabled)
m_log.DebugFormat(
"[GROUPS-MESSAGING]: SendMessageToGroup called for group {0} with {1} visible members",
@@ -325,26 +331,33 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
msg.toAgentID = member.AgentID.Guid;
- IClientAPI client = GetActiveClient(member.AgentID);
- if (client == null)
+ if (attemptDeliveryUuidSet.Contains(member.AgentID.ToString()))
{
- // If they're not local, forward across the grid
- if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Delivering to {0} via Grid", member.AgentID);
- m_msgTransferModule.SendInstantMessage(msg, delegate(bool success) { });
+ IClientAPI client = GetActiveClient(member.AgentID);
+ if (client == null)
+ {
+ // If they're not local, forward across the grid
+ if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Delivering to {0} via Grid", member.AgentID);
+ m_msgTransferModule.SendInstantMessage(msg, delegate(bool success) { });
+ }
+ else
+ {
+ // Deliver locally, directly
+ if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Passing to ProcessMessageFromGroupSession to deliver to {0} locally", client.Name);
+ ProcessMessageFromGroupSession(msg, client);
+ }
}
else
{
- // Deliver locally, directly
- if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Passing to ProcessMessageFromGroupSession to deliver to {0} locally", client.Name);
- ProcessMessageFromGroupSession(msg, client);
+ m_msgTransferModule.HandleUndeliverableMessage(msg, delegate(bool success) { });
}
}
// Temporary for assessing how long it still takes to send messages to large online groups.
if (m_messageOnlineAgentsOnly)
m_log.DebugFormat(
- "[GROUPS-MESSAGING]: SendMessageToGroup for group {0} with {1} visible members, {2} online took {3}ms",
- groupID, groupMembersCount, groupMembers.Count(), Environment.TickCount - requestStartTick);
+ "[GROUPS-MESSAGING]: SendMessageToGroup for group {0} with {1} members, {2} candidates for delivery took {3}ms",
+ groupID, groupMembersCount, attemptDeliveryUuidSet.Count(), Environment.TickCount - requestStartTick);
}
#region SimGridEventHandlers
--
cgit v1.1
From 8ad29fc5c831fb5e02acaf140cb7fb7a7f5b1f08 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 12 May 2014 23:42:47 +0100
Subject: Make offline IM delivery to URL (pre recent Addons code) have a 10
second rather than infinite timeout.
This both signals a problem with the URL and eventually frees the thread, rather than hanging indefinitely with no information.
---
.../Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs
index bd2b2fe..c75920d 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs
@@ -227,7 +227,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
}
bool success = SynchronousRestObjectRequester.MakeRequest(
- "POST", m_RestURL+"/SaveMessage/", im);
+ "POST", m_RestURL+"/SaveMessage/", im, 10000);
if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent)
{
--
cgit v1.1
From 484aa72ff893df31d7f0ecc186039905ceee7f24 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 12 May 2014 23:49:37 +0100
Subject: minor: Add some method doc to IMessageTransferModule
---
.../Framework/Interfaces/IMessageTransferModule.cs | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs b/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs
index 379c769..290b826 100644
--- a/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IMessageTransferModule.cs
@@ -36,8 +36,26 @@ namespace OpenSim.Region.Framework.Interfaces
{
event UndeliveredMessage OnUndeliveredMessage;
+ ///
+ /// Attempt to send an instant message to a given destination.
+ ///
+ ///
+ /// If the message cannot be delivered for any reason, this will be signalled on the OnUndeliveredMessage
+ /// event. result(false) will also be called if the message cannot be delievered unless the type is
+ /// InstantMessageDialog.MessageFromAgent. For successful message delivery, result(true) is called.
+ ///
+ ///
+ ///
void SendInstantMessage(GridInstantMessage im, MessageResultNotification result);
+ ///
+ /// Appropriately handle a known undeliverable message without attempting a send.
+ ///
+ ///
+ /// Essentially, this invokes the OnUndeliveredMessage event.
+ ///
+ ///
+ ///
void HandleUndeliverableMessage(GridInstantMessage im, MessageResultNotification result);
}
}
--
cgit v1.1
From 0c0ee95bd8313ecadd828c2e3b1a168984b7ea30 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 14 May 2014 19:22:55 +0100
Subject: minor: Clean up and make consistent some log file messages in
EstateManagementModule relating to RAW file uploading.
---
.../CoreModules/World/Estate/EstateManagementModule.cs | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index a032bc7..eecc478 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -1106,13 +1106,14 @@ namespace OpenSim.Region.CoreModules.World.Estate
TerrainUploader = null;
}
+
+ m_log.DebugFormat("[CLIENT]: Terrain upload from {0} to {1} complete.", remoteClient.Name, Scene.Name);
remoteClient.SendAlertMessage("Terrain Upload Complete. Loading....");
+
ITerrainModule terr = Scene.RequestModuleInterface();
if (terr != null)
{
- m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + Scene.RegionInfo.RegionName);
-
try
{
MemoryStream terrainStream = new MemoryStream(terrainData);
@@ -1161,7 +1162,10 @@ namespace OpenSim.Region.CoreModules.World.Estate
{
if (TerrainUploader == null)
{
- m_log.DebugFormat("Starting to receive uploaded terrain");
+ m_log.DebugFormat(
+ "[TERRAIN]: Started receiving terrain upload for region {0} from {1}",
+ Scene.Name, remote_client.Name);
+
TerrainUploader = new EstateTerrainXferHandler(remote_client, clientFileName);
remote_client.OnXferReceive += TerrainUploader.XferReceive;
remote_client.OnAbortXfer += AbortTerrainXferHandler;
@@ -1182,7 +1186,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
if (terr != null)
{
- m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + Scene.RegionInfo.RegionName);
+// m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + Scene.RegionInfo.RegionName);
if (File.Exists(Util.dataDir() + "/terrain.raw"))
{
File.Delete(Util.dataDir() + "/terrain.raw");
@@ -1194,8 +1198,9 @@ namespace OpenSim.Region.CoreModules.World.Estate
input.Read(bdata, 0, (int)input.Length);
remote_client.SendAlertMessage("Terrain file written, starting download...");
Scene.XferManager.AddNewFile("terrain.raw", bdata);
- // Tell client about it
- m_log.Warn("[CLIENT]: Sending Terrain to " + remote_client.Name);
+
+ m_log.DebugFormat("[CLIENT]: Sending terrain for region {0} to {1}", Scene.Name, remote_client.Name);
+
remote_client.SendInitiateDownload("terrain.raw", clientFileName);
}
}
--
cgit v1.1
From 2f7539a25b859d3983ad78106d9cac78abda2b4d Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 14 May 2014 21:49:29 +0100
Subject: Remove a race where the client's SP.CompleteMovement() thread could
attempt to restart attachment scripts before the source simulator's
SP.UpdateAgent() thread had added them.
This commit changes the order of code so that attachments are re-added before the CompleteMovement() thread is released.
Relates to http://opensimulator.org/mantis/view.php?id=7148
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 8c56975..6020a9e 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3876,9 +3876,6 @@ namespace OpenSim.Region.Framework.Scenes
private void CopyFrom(AgentData cAgent)
{
- lock (m_originRegionIDAccessLock)
- m_originRegionID = cAgent.RegionID;
-
m_callbackURI = cAgent.CallbackURI;
// m_log.DebugFormat(
// "[SCENE PRESENCE]: Set callback for {0} in {1} to {2} in CopyFrom()",
@@ -3951,6 +3948,12 @@ namespace OpenSim.Region.Framework.Scenes
if (Scene.AttachmentsModule != null)
Scene.AttachmentsModule.CopyAttachments(cAgent, this);
+
+ // This must occur after attachments are copied, as it releases the CompleteMovement() calling thread
+ // originating from the client completing a teleport. Otherwise, CompleteMovement() code to restart
+ // script attachments can outrace this thread.
+ lock (m_originRegionIDAccessLock)
+ m_originRegionID = cAgent.RegionID;
}
public bool CopyAgent(out IAgentData agent)
--
cgit v1.1
From 7c12dfe18573ab9fa2484fd3402b0fe480e97074 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 14 May 2014 22:08:06 +0100
Subject: On ScenePresence.MakeChildAgent(), reset the m_originRegionID as this
is currently being used as a flag to orchestrate destination simulator
threads on teleport.
If not reset, it's possible that teleports back and forth between simulators may not restart scripts in attachments.
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 5 +++++
1 file changed, 5 insertions(+)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 6020a9e..dd4bbe9 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1328,6 +1328,11 @@ namespace OpenSim.Region.Framework.Scenes
m_log.DebugFormat("[SCENE PRESENCE]: Making {0} a child agent in {1}", Name, Scene.RegionInfo.RegionName);
+ // Reset the m_originRegionID as it has dual use as a flag to signal that the UpdateAgent() call orignating
+ // from the source simulator has completed on a V2 teleport.
+ lock (m_originRegionIDAccessLock)
+ m_originRegionID = UUID.Zero;
+
// Reset these so that teleporting in and walking out isn't seen
// as teleporting back
TeleportFlags = TeleportFlags.Default;
--
cgit v1.1
From 0be9e3b079088829eec49d856980f14a6372fda4 Mon Sep 17 00:00:00 2001
From: Robert Adams
Date: Sat, 17 May 2014 20:11:22 -0700
Subject: BulletSim: adjust avatar step up parameters to better walk up small
staircases. This change is required because of the change in the avatar
default shape from the capsule to the rectangle.
---
OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs | 4 ++--
OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs b/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs
index 1bcf879..1b8a454 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs
@@ -399,8 +399,8 @@ public class BSActorAvatarMove : BSActor
m_controllingPrim.ForcePosition = m_controllingPrim.RawPosition + displacement;
}
}
- m_physicsScene.DetailLog("{0},BSCharacter.WalkUpStairs.ComputeStairCorrection,disp={1},force={2}",
- m_controllingPrim.LocalID, displacement, ret);
+ m_physicsScene.DetailLog("{0},BSCharacter.WalkUpStairs.ComputeStairCorrection,stepUp={1},isp={2},force={3}",
+ m_controllingPrim.LocalID, stepUp, displacement, ret);
}
return ret;
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
index 6683446..de42a4c 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
@@ -598,9 +598,9 @@ public static class BSParam
new ParameterDefn("AvatarStepForceFactor", "Controls the amount of force up applied to step up onto a step",
1.0f ),
new ParameterDefn("AvatarStepUpCorrectionFactor", "Multiplied by height of step collision to create up movement at step",
- 1.0f ),
+ 2.0f ),
new ParameterDefn("AvatarStepSmoothingSteps", "Number of frames after a step collision that we continue walking up stairs",
- 2 ),
+ 1 ),
new ParameterDefn("VehicleMaxLinearVelocity", "Maximum velocity magnitude that can be assigned to a vehicle",
1000.0f,
--
cgit v1.1
From 922f76a3a766220592bc4ccad3911a66728329a0 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sun, 18 May 2014 07:49:01 -0700
Subject: Don't fetch assets from the server when doing simple inventory
operations like copy-paste items in inventory.
---
.../InventoryAccess/InventoryAccessModule.cs | 2 +-
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 79 ++++++++--------------
2 files changed, 29 insertions(+), 52 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index d30ce72..a116f0f 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -203,7 +203,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
m_Scene.AssetService.Store(asset);
m_Scene.CreateNewInventoryItem(
remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID,
- name, description, 0, callbackID, asset, invType, nextOwnerMask, creationDate);
+ name, description, 0, callbackID, asset.FullID, asset.Type, invType, nextOwnerMask, creationDate);
}
else
{
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 3c3d077..71e3032 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -879,50 +879,33 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
- AssetBase asset = AssetService.Get(item.AssetID.ToString());
+ if (newName == String.Empty)
+ newName = item.Name;
- if (asset != null)
+ if (remoteClient.AgentId == oldAgentID
+ || (LibraryService != null
+ && LibraryService.LibraryRootFolder != null
+ && oldAgentID == LibraryService.LibraryRootFolder.Owner))
{
- if (newName != String.Empty)
- {
- asset.Name = newName;
- }
- else
- {
- newName = item.Name;
- }
-
- if (remoteClient.AgentId == oldAgentID
- || (LibraryService != null
- && LibraryService.LibraryRootFolder != null
- && oldAgentID == LibraryService.LibraryRootFolder.Owner))
+ CreateNewInventoryItem(
+ remoteClient, item.CreatorId, item.CreatorData, newFolderID,
+ newName, item.Description, item.Flags, callbackID, item.AssetID, (sbyte)item.AssetType, (sbyte)item.InvType,
+ item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions,
+ item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch());
+ }
+ else
+ {
+ // If item is transfer or permissions are off or calling agent is allowed to copy item owner's inventory item.
+ if (((item.CurrentPermissions & (uint)PermissionMask.Transfer) != 0)
+ && (m_permissions.BypassPermissions()
+ || m_permissions.CanCopyUserInventory(remoteClient.AgentId, oldItemID)))
{
CreateNewInventoryItem(
- remoteClient, item.CreatorId, item.CreatorData, newFolderID,
- newName, item.Description, item.Flags, callbackID, asset, (sbyte)item.InvType,
- item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions,
+ remoteClient, item.CreatorId, item.CreatorData, newFolderID, newName, item.Description, item.Flags, callbackID,
+ item.AssetID, (sbyte)item.AssetType, (sbyte) item.InvType,
+ item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions,
item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch());
}
- else
- {
- // If item is transfer or permissions are off or calling agent is allowed to copy item owner's inventory item.
- if (((item.CurrentPermissions & (uint)PermissionMask.Transfer) != 0)
- && (m_permissions.BypassPermissions()
- || m_permissions.CanCopyUserInventory(remoteClient.AgentId, oldItemID)))
- {
- CreateNewInventoryItem(
- remoteClient, item.CreatorId, item.CreatorData, newFolderID, newName, item.Description, item.Flags, callbackID,
- asset, (sbyte) item.InvType,
- item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions,
- item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch());
- }
- }
- }
- else
- {
- m_log.ErrorFormat(
- "[AGENT INVENTORY]: Could not copy item {0} since asset {1} could not be found",
- item.Name, item.AssetID);
}
}
@@ -973,10 +956,10 @@ namespace OpenSim.Region.Framework.Scenes
public void CreateNewInventoryItem(
IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID,
string name, string description, uint flags, uint callbackID,
- AssetBase asset, sbyte invType, uint nextOwnerMask, int creationDate)
+ UUID assetID, sbyte assetType, sbyte invType, uint nextOwnerMask, int creationDate)
{
CreateNewInventoryItem(
- remoteClient, creatorID, creatorData, folderID, name, description, flags, callbackID, asset, invType,
+ remoteClient, creatorID, creatorData, folderID, name, description, flags, callbackID, assetID, assetType, invType,
(uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, 0, nextOwnerMask, 0, creationDate);
}
@@ -1001,7 +984,7 @@ namespace OpenSim.Region.Framework.Scenes
/// Unix timestamp at which this item was created.
private void CreateNewInventoryItem(
IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID,
- string name, string description, uint flags, uint callbackID, AssetBase asset, sbyte invType,
+ string name, string description, uint flags, uint callbackID, UUID assetID, sbyte assetType, sbyte invType,
uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, uint groupMask, int creationDate)
{
InventoryItemBase item = new InventoryItemBase();
@@ -1009,11 +992,11 @@ namespace OpenSim.Region.Framework.Scenes
item.CreatorId = creatorID;
item.CreatorData = creatorData;
item.ID = UUID.Random();
- item.AssetID = asset.FullID;
+ item.AssetID = assetID;
item.Name = name;
item.Description = description;
item.Flags = flags;
- item.AssetType = asset.Type;
+ item.AssetType = assetType;
item.InvType = invType;
item.Folder = folderID;
item.CurrentPermissions = currentMask;
@@ -1086,15 +1069,9 @@ namespace OpenSim.Region.Framework.Scenes
// return;
// }
- AssetBase asset = new AssetBase();
- asset.FullID = olditemID;
- asset.Type = type;
- asset.Name = name;
- asset.Description = description;
-
CreateNewInventoryItem(
- remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID,
- name, description, 0, callbackID, asset, invType,
+ remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID,
+ name, description, 0, callbackID, olditemID, type, invType,
(uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All,
(uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, Util.UnixTimeSinceEpoch());
}
--
cgit v1.1
From ab1472e5b7649702aec0585fa4b9d6a5d87948a4 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sun, 18 May 2014 23:01:55 -0700
Subject: Don't trigger ItemUploaded when no item has been uploaded.
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 71e3032..542d454 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -891,7 +891,7 @@ namespace OpenSim.Region.Framework.Scenes
remoteClient, item.CreatorId, item.CreatorData, newFolderID,
newName, item.Description, item.Flags, callbackID, item.AssetID, (sbyte)item.AssetType, (sbyte)item.InvType,
item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions,
- item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch());
+ item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch(), false);
}
else
{
@@ -904,7 +904,7 @@ namespace OpenSim.Region.Framework.Scenes
remoteClient, item.CreatorId, item.CreatorData, newFolderID, newName, item.Description, item.Flags, callbackID,
item.AssetID, (sbyte)item.AssetType, (sbyte) item.InvType,
item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions,
- item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch());
+ item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch(), false);
}
}
}
@@ -960,7 +960,8 @@ namespace OpenSim.Region.Framework.Scenes
{
CreateNewInventoryItem(
remoteClient, creatorID, creatorData, folderID, name, description, flags, callbackID, assetID, assetType, invType,
- (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, 0, nextOwnerMask, 0, creationDate);
+ (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, 0, nextOwnerMask, 0,
+ creationDate, true);
}
///
@@ -985,7 +986,8 @@ namespace OpenSim.Region.Framework.Scenes
private void CreateNewInventoryItem(
IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID,
string name, string description, uint flags, uint callbackID, UUID assetID, sbyte assetType, sbyte invType,
- uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, uint groupMask, int creationDate)
+ uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, uint groupMask, int creationDate,
+ bool assetUpload)
{
InventoryItemBase item = new InventoryItemBase();
item.Owner = remoteClient.AgentId;
@@ -1006,7 +1008,7 @@ namespace OpenSim.Region.Framework.Scenes
item.BasePermissions = baseMask;
item.CreationDate = creationDate;
- if (AddInventoryItem(item))
+ if (AddInventoryItem(item, assetUpload))
{
remoteClient.SendInventoryItemCreateUpdate(item, callbackID);
}
@@ -1073,7 +1075,8 @@ namespace OpenSim.Region.Framework.Scenes
remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID,
name, description, 0, callbackID, olditemID, type, invType,
(uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All,
- (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, Util.UnixTimeSinceEpoch());
+ (uint)PermissionMask.All | (uint)PermissionMask.Export, (uint)PermissionMask.All | (uint)PermissionMask.Export, Util.UnixTimeSinceEpoch(),
+ false);
}
else
{
--
cgit v1.1
From 96e5836b50f6615bcea4ae43b238147b027fd5f7 Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Thu, 15 May 2014 16:09:44 +0300
Subject: When can't rez, show only one error message; not two. And show more
specific error messages.
---
.../CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs | 3 ---
.../CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 2 ++
2 files changed, 2 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index 283a0cf..b7de0dc 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -297,9 +297,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
SceneObjectGroup sog = base.RezObject(remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection,
RezSelected, RemoveItem, fromTaskID, attachment);
- if (sog == null)
- remoteClient.SendAgentAlertMessage("Unable to rez: problem accessing inventory or locating assets", false);
-
return sog;
}
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index a116f0f..5cdb70b 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -773,12 +773,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
m_log.WarnFormat(
"[InventoryAccessModule]: Could not find asset {0} for item {1} {2} for {3} in RezObject()",
assetID, item.Name, item.ID, remoteClient.Name);
+ remoteClient.SendAgentAlertMessage(string.Format("Unable to rez: could not find asset {0} for item {1}.", assetID, item.Name), false);
}
else
{
m_log.WarnFormat(
"[INVENTORY ACCESS MODULE]: Could not find asset {0} for {1} in RezObject()",
assetID, remoteClient.Name);
+ remoteClient.SendAgentAlertMessage(string.Format("Unable to rez: could not find asset {0}.", assetID), false);
}
return null;
--
cgit v1.1
From 882af7195ca6d7ac5f36f4121f65aab1302ad272 Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Fri, 16 May 2014 13:18:04 +0300
Subject: Better error-handling and logging in case User Profile requests fail
---
.../Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs | 9 +++++++++
1 file changed, 9 insertions(+)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
index 1ee2a7b..c4b5aac 100644
--- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
@@ -484,6 +484,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{
remoteClient.SendAgentAlertMessage(
"Error updating classified", false);
+ return;
}
}
@@ -510,6 +511,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{
remoteClient.SendAgentAlertMessage(
"Error classified delete", false);
+ return;
}
parameters = (OSDMap)Params;
@@ -612,6 +614,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{
remoteClient.SendAgentAlertMessage(
"Error selecting pick", false);
+ return;
}
pick = (UserProfilePick) Pick;
@@ -714,6 +717,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{
remoteClient.SendAgentAlertMessage(
"Error updating pick", false);
+ return;
}
m_log.DebugFormat("[PROFILES]: Finish PickInfoUpdate {0} {1}", pick.Name, pick.PickId.ToString());
@@ -740,6 +744,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{
remoteClient.SendAgentAlertMessage(
"Error picks delete", false);
+ return;
}
}
#endregion Picks
@@ -807,6 +812,8 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
object Note = note;
if(!rpc.JsonRpcRequest(ref Note, "avatar_notes_update", serverURI, UUID.Random().ToString()))
{
+ remoteClient.SendAgentAlertMessage(
+ "Error updating note", false);
return;
}
}
@@ -916,6 +923,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{
remoteClient.SendAgentAlertMessage(
"Error updating interests", false);
+ return;
}
}
@@ -1044,6 +1052,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{
remoteClient.SendAgentAlertMessage(
"Error updating properties", false);
+ return;
}
RequestAvatarProperties(remoteClient, newProfile.ID);
--
cgit v1.1
From dd30a29ba07a181d5c8f5773140a7247a0066510 Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Sun, 18 May 2014 16:10:18 +0300
Subject: Return more specific error messages if an attempt to enter a region
fails due to permissions (in QueryAccess and IsAuthorizedForRegion)
---
.../EntityTransfer/EntityTransferModule.cs | 2 +-
.../Authorization/AuthorizationService.cs | 34 +++++++++++++---------
OpenSim/Region/Framework/Scenes/Scene.cs | 15 ++++++++--
3 files changed, 35 insertions(+), 16 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 539367d..3830791 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -766,7 +766,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
sp.ControllingClient.SendTeleportFailed(reason);
m_log.DebugFormat(
- "[ENTITY TRANSFER MODULE]: {0} was stopped from teleporting from {1} to {2} because {3}",
+ "[ENTITY TRANSFER MODULE]: {0} was stopped from teleporting from {1} to {2} because: {3}",
sp.Name, sp.Scene.Name, finalDestination.RegionName, reason);
return;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/AuthorizationService.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/AuthorizationService.cs
index 4470799..93dff1f 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/AuthorizationService.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/AuthorizationService.cs
@@ -89,35 +89,43 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization
public bool IsAuthorizedForRegion(
string user, string firstName, string lastName, string regionID, out string message)
{
- message = "authorized";
-
// This should not happen
if (m_Scene.RegionInfo.RegionID.ToString() != regionID)
{
m_log.WarnFormat("[AuthorizationService]: Service for region {0} received request to authorize for region {1}",
m_Scene.RegionInfo.RegionID, regionID);
- return true;
+ message = string.Format("Region {0} received request to authorize for region {1}", m_Scene.RegionInfo.RegionID, regionID);
+ return false;
}
if (m_accessValue == AccessFlags.None)
+ {
+ message = "Authorized";
return true;
+ }
UUID userID = new UUID(user);
- bool authorized = true;
- if ((m_accessValue & AccessFlags.DisallowForeigners) == AccessFlags.DisallowForeigners)
+
+ if ((m_accessValue & AccessFlags.DisallowForeigners) != 0)
{
- authorized = m_UserManagement.IsLocalGridUser(userID);
- if (!authorized)
- message = "no foreigner users allowed in this region";
+ if (!m_UserManagement.IsLocalGridUser(userID))
+ {
+ message = "No foreign users allowed in this region";
+ return false;
+ }
}
- if (authorized && (m_accessValue & AccessFlags.DisallowResidents) == AccessFlags.DisallowResidents)
+
+ if ((m_accessValue & AccessFlags.DisallowResidents) != 0)
{
- authorized = m_Scene.Permissions.IsGod(userID) | m_Scene.Permissions.IsAdministrator(userID);
- if (!authorized)
- message = "only Admins and Managers allowed in this region";
+ if (!(m_Scene.Permissions.IsGod(userID) || m_Scene.Permissions.IsAdministrator(userID)))
+ {
+ message = "Only Admins and Managers allowed in this region";
+ return false;
+ }
}
- return authorized;
+ message = "Authorized";
+ return true;
}
}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index e6887b4..1115399 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3865,7 +3865,7 @@ namespace OpenSim.Region.Framework.Scenes
if (!AuthorizationService.IsAuthorizedForRegion(
agent.AgentID.ToString(), agent.firstname, agent.lastname, RegionInfo.RegionID.ToString(), out reason))
{
- m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because {4}",
+ m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because: {4}",
agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName, reason);
return false;
@@ -5465,7 +5465,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public bool QueryAccess(UUID agentID, string agentHomeURI, Vector3 position, out string reason)
{
- reason = "You are banned from the region";
+ reason = string.Empty;
if (Permissions.IsGod(agentID))
{
@@ -5525,6 +5525,7 @@ namespace OpenSim.Region.Framework.Scenes
catch (Exception e)
{
m_log.DebugFormat("[SCENE]: Exception authorizing agent: {0} "+ e.StackTrace, e.Message);
+ reason = "Error authorizing agent: " + e.Message;
return false;
}
@@ -5568,6 +5569,7 @@ namespace OpenSim.Region.Framework.Scenes
if (!TestLandRestrictions(agentID, out reason, ref posX, ref posY))
{
// m_log.DebugFormat("[SCENE]: Denying {0} because they are banned on all parcels", agentID);
+ reason = "You are banned from the region on all parcels";
return false;
}
}
@@ -5575,13 +5577,22 @@ namespace OpenSim.Region.Framework.Scenes
{
ILandObject land = LandChannel.GetLandObject(position.X, position.Y);
if (land == null)
+ {
+ reason = "No parcel found";
return false;
+ }
bool banned = land.IsBannedFromLand(agentID);
bool restricted = land.IsRestrictedFromLand(agentID);
if (banned || restricted)
+ {
+ if (banned)
+ reason = "You are banned from the parcel";
+ else
+ reason = "The parcel is restricted";
return false;
+ }
}
reason = String.Empty;
--
cgit v1.1
From 47b84875fd2b9f01140288a2695c33f5ef4466c0 Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Sun, 18 May 2014 19:45:27 +0300
Subject: Tell QueryAccess explicitly whether the user is coming in via
Teleport or Cross, because the permission checks are different.
Previously we used a heuristic of checking if the entry position is 0 to differentiate between Teleport and Cross, but that doesn't work anymore since we've started providing the precise entry position for cross, too. That's required in order to ensure that the user is allowed to enter the parcel that he's walking into.
---
.../CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 4 ++--
.../ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | 4 ++--
.../ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | 6 +++---
OpenSim/Region/Framework/Scenes/Scene.cs | 4 ++--
4 files changed, 9 insertions(+), 9 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 3830791..e583590 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -761,7 +761,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
string reason;
string version;
if (!Scene.SimulationService.QueryAccess(
- finalDestination, sp.ControllingClient.AgentId, homeURI, position, out version, out reason))
+ finalDestination, sp.ControllingClient.AgentId, homeURI, true, position, out version, out reason))
{
sp.ControllingClient.SendTeleportFailed(reason);
@@ -1510,7 +1510,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// Check to see if we have access to the target region.
if (neighbourRegion != null
- && !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, newpos, out version, out failureReason))
+ && !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, false, newpos, out version, out failureReason))
{
// remember banned
m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID);
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
index 3348b42..926ef05 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
@@ -264,7 +264,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
return true;
}
- public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, Vector3 position, out string version, out string reason)
+ public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, out string version, out string reason)
{
reason = "Communications failure";
version = ServiceVersion;
@@ -277,7 +277,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate",
// s.RegionInfo.RegionName, destination.RegionHandle);
- return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, position, out reason);
+ return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, viaTeleport, position, out reason);
}
//m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess");
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
index 8436488..0444e49 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
@@ -207,7 +207,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
return m_remoteConnector.UpdateAgent(destination, cAgentData);
}
- public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, Vector3 position, out string version, out string reason)
+ public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, out string version, out string reason)
{
reason = "Communications failure";
version = "Unknown";
@@ -216,12 +216,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
return false;
// Try local first
- if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, position, out version, out reason))
+ if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, out version, out reason))
return true;
// else do the remote thing
if (!m_localBackend.IsLocalRegion(destination.RegionID))
- return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, position, out version, out reason);
+ return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, out version, out reason);
return false;
}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 1115399..3b8fbfd 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -5463,7 +5463,7 @@ namespace OpenSim.Region.Framework.Scenes
///
///
///
- public bool QueryAccess(UUID agentID, string agentHomeURI, Vector3 position, out string reason)
+ public bool QueryAccess(UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, out string reason)
{
reason = string.Empty;
@@ -5529,7 +5529,7 @@ namespace OpenSim.Region.Framework.Scenes
return false;
}
- if (position == Vector3.Zero) // Teleport
+ if (viaTeleport)
{
if (!RegionInfo.EstateSettings.AllowDirectTeleport)
{
--
cgit v1.1
From 3a6f3124841ee91778df1d7fa2fbda9893079c6d Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 19 May 2014 22:06:41 +0100
Subject: Fix recent regression from 77e7bbc where an attachment on a received
group notice with XmlRpcGroups messaging did not appear in the user's
inventory.
This was because the "session ID" when the message template was copied was always replaced with the group ID, whereas a notice requires this to be the notice ID.
Instead just copy the "session ID" as is - other callers already have this set properly so replacing with group ID was redundant anyway.
Relates to http://opensimulator.org/mantis/view.php?id=7037
---
.../Avatar/XmlRpcGroups/GroupsMessagingModule.cs | 7 +++++--
.../OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | 15 ++++++++++++++-
.../Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs | 9 ++++++++-
3 files changed, 27 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
index 26b70a1..3724a2c 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
@@ -315,7 +315,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
// Copy Message
GridInstantMessage msg = new GridInstantMessage();
- msg.imSessionID = groupID.Guid;
+ msg.imSessionID = im.imSessionID;
msg.fromAgentName = im.fromAgentName;
msg.message = im.message;
msg.dialog = im.dialog;
@@ -420,7 +420,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
private void ProcessMessageFromGroupSession(GridInstantMessage msg, IClientAPI client)
{
- if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Session message from {0} going to agent {1}", msg.fromAgentName, msg.toAgentID);
+ if (m_debugEnabled)
+ m_log.DebugFormat(
+ "[GROUPS-MESSAGING]: Session message from {0} going to agent {1}, sessionID {2}, type {3}",
+ msg.fromAgentName, msg.toAgentID, msg.imSessionID, (InstantMessageDialog)msg.dialog);
UUID AgentID = new UUID(msg.fromAgentID);
UUID GroupID = new UUID(msg.imSessionID);
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index f34152c..8a9e4d2 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -357,7 +357,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im)
{
- if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
+ if (m_debugEnabled)
+ m_log.DebugFormat(
+ "[GROUPS]: {0} called for {1}, message type {2}",
+ System.Reflection.MethodBase.GetCurrentMethod().Name, remoteClient.Name, (InstantMessageDialog)im.dialog);
// Group invitations
if ((im.dialog == (byte)InstantMessageDialog.GroupInvitationAccept) || (im.dialog == (byte)InstantMessageDialog.GroupInvitationDecline))
@@ -551,6 +554,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
UUID noticeID = new UUID(im.imSessionID);
+ if (m_debugEnabled)
+ m_log.DebugFormat("[GROUPS]: Requesting notice {0} for {1}", noticeID, remoteClient.AgentId);
+
GroupNoticeInfo notice = m_groupData.GetGroupNotice(GetRequestingAgentID(remoteClient), noticeID);
if (notice != null)
{
@@ -572,6 +578,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
remoteClient.SendInventoryItemCreateUpdate(itemCopy, 0);
}
+ else
+ {
+ if (m_debugEnabled)
+ m_log.DebugFormat(
+ "[GROUPS]: Could not find notice {0} for {1} on GroupNoticeInventoryAccepted.",
+ noticeID, remoteClient.AgentId);
+ }
}
// Interop, received special 210 code for ejecting a group member
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
index b5a10af..d944087 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
@@ -132,6 +132,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests
MessageTransferModule mtm = new MessageTransferModule();
GroupsModule gm = new GroupsModule();
GroupsMessagingModule gmm = new GroupsMessagingModule();
+ MockGroupsServicesConnector mgsc = new MockGroupsServicesConnector();
IConfigSource configSource = new IniConfigSource();
@@ -149,7 +150,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests
config.Set("MessagingEnabled", true);
}
- SceneHelpers.SetupSceneModules(scene, configSource, new MockGroupsServicesConnector(), mtm, gm, gmm);
+ SceneHelpers.SetupSceneModules(scene, configSource, mgsc, mtm, gm, gmm);
UUID userId = TestHelpers.ParseTail(0x1);
string subjectText = "newman";
@@ -185,6 +186,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests
Assert.That(spReceivedMessages.Count, Is.EqualTo(1));
Assert.That(spReceivedMessages[0].message, Is.EqualTo(combinedSubjectMessage));
+ List notices = mgsc.GetGroupNotices(UUID.Zero, groupID);
+ Assert.AreEqual(1, notices.Count);
+
+ // OpenSimulator (possibly also SL) transport the notice ID as the session ID!
+ Assert.AreEqual(notices[0].NoticeID.Guid, spReceivedMessages[0].imSessionID);
+
Assert.That(sp2ReceivedMessages.Count, Is.EqualTo(0));
}
--
cgit v1.1
From b46be88db62bcfa7dcf70c3677a1a1270d177a22 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 19 May 2014 22:45:17 +0100
Subject: Split verbose groups messaging logging into its own setting separate
from that of the groups module.
This is to allow us to get useful information on messaging without being overwhelmed by the rest of groups debug.
Enabled with [Groups] DebugMessagingEnabled = true in config (default false)
Or "debug groups messaging verbose true|false on the console" (similar to existing groups setting).
Done for both xmlrpc and V2 groups.
---
.../Avatar/XmlRpcGroups/GroupsMessagingModule.cs | 100 ++++++++++++++++-----
1 file changed, 77 insertions(+), 23 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
index 3724a2c..09bbec2 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
@@ -55,8 +55,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
private IGroupsServicesConnector m_groupData = null;
// Config Options
- private bool m_groupMessagingEnabled = false;
- private bool m_debugEnabled = true;
+ private bool m_groupMessagingEnabled;
+ private bool m_debugEnabled;
///
/// If enabled, module only tries to send group IMs to online users by querying cached presence information.
@@ -113,7 +113,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
if (m_messageOnlineAgentsOnly)
m_usersOnlineCache = new ExpiringCache();
- m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", true);
+ m_debugEnabled = groupsConfig.GetBoolean("MessagingDebugEnabled", m_debugEnabled);
}
m_log.InfoFormat(
@@ -127,6 +127,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
return;
scene.RegisterModuleInterface(this);
+
+ scene.AddCommand(
+ "Debug",
+ this,
+ "debug groups messaging verbose",
+ "debug groups messaging verbose ",
+ "This setting turns on very verbose groups messaging debugging",
+ HandleDebugGroupsMessagingVerbose);
}
public void RegionLoaded(Scene scene)
@@ -218,6 +226,26 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
#endregion
+ private void HandleDebugGroupsMessagingVerbose(object modules, string[] args)
+ {
+ if (args.Length < 5)
+ {
+ MainConsole.Instance.Output("Usage: debug groups messaging verbose ");
+ return;
+ }
+
+ bool verbose = false;
+ if (!bool.TryParse(args[4], out verbose))
+ {
+ MainConsole.Instance.Output("Usage: debug groups messaging verbose ");
+ return;
+ }
+
+ m_debugEnabled = verbose;
+
+ MainConsole.Instance.OutputFormat("{0} verbose logging set to {1}", Name, m_debugEnabled);
+ }
+
///
/// Not really needed, but does confirm that the group exists.
///
@@ -336,27 +364,45 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
IClientAPI client = GetActiveClient(member.AgentID);
if (client == null)
{
+ int startTick = Environment.TickCount;
+
// If they're not local, forward across the grid
- if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Delivering to {0} via Grid", member.AgentID);
m_msgTransferModule.SendInstantMessage(msg, delegate(bool success) { });
+
+ if (m_debugEnabled)
+ m_log.DebugFormat(
+ "[GROUPS-MESSAGING]: Delivering to {0} via grid took {1} ms",
+ member.AgentID, Environment.TickCount - startTick);
}
else
{
- // Deliver locally, directly
- if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Passing to ProcessMessageFromGroupSession to deliver to {0} locally", client.Name);
+ int startTick = Environment.TickCount;
+
ProcessMessageFromGroupSession(msg, client);
+
+ // Deliver locally, directly
+ if (m_debugEnabled)
+ m_log.DebugFormat(
+ "[GROUPS-MESSAGING]: Delivering to {0} locally took {1} ms",
+ member.AgentID, Environment.TickCount - startTick);
}
}
else
{
+ int startTick = Environment.TickCount;
+
m_msgTransferModule.HandleUndeliverableMessage(msg, delegate(bool success) { });
+
+ if (m_debugEnabled)
+ m_log.DebugFormat(
+ "[GROUPS-MESSAGING]: Handling undeliverable message for {0} took {1} ms",
+ member.AgentID, Environment.TickCount - startTick);
}
}
- // Temporary for assessing how long it still takes to send messages to large online groups.
- if (m_messageOnlineAgentsOnly)
+ if (m_debugEnabled)
m_log.DebugFormat(
- "[GROUPS-MESSAGING]: SendMessageToGroup for group {0} with {1} members, {2} candidates for delivery took {3}ms",
+ "[GROUPS-MESSAGING]: Total SendMessageToGroup for group {0} with {1} members, {2} candidates for delivery took {3} ms",
groupID, groupMembersCount, attemptDeliveryUuidSet.Count(), Environment.TickCount - requestStartTick);
}
@@ -591,15 +637,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
// Don't log any normal IMs (privacy!)
if (m_debugEnabled && im.dialog != (byte)InstantMessageDialog.MessageFromAgent)
{
- m_log.WarnFormat("[GROUPS-MESSAGING]: IM: fromGroup({0})", im.fromGroup ? "True" : "False");
- m_log.WarnFormat("[GROUPS-MESSAGING]: IM: Dialog({0})", (InstantMessageDialog)im.dialog);
- m_log.WarnFormat("[GROUPS-MESSAGING]: IM: fromAgentID({0})", im.fromAgentID);
- m_log.WarnFormat("[GROUPS-MESSAGING]: IM: fromAgentName({0})", im.fromAgentName);
- m_log.WarnFormat("[GROUPS-MESSAGING]: IM: imSessionID({0})", im.imSessionID);
- m_log.WarnFormat("[GROUPS-MESSAGING]: IM: message({0})", im.message);
- m_log.WarnFormat("[GROUPS-MESSAGING]: IM: offline({0})", im.offline);
- m_log.WarnFormat("[GROUPS-MESSAGING]: IM: toAgentID({0})", im.toAgentID);
- m_log.WarnFormat("[GROUPS-MESSAGING]: IM: binaryBucket({0})", OpenMetaverse.Utils.BytesToHexString(im.binaryBucket, "BinaryBucket"));
+ m_log.DebugFormat("[GROUPS-MESSAGING]: IM: fromGroup({0})", im.fromGroup ? "True" : "False");
+ m_log.DebugFormat("[GROUPS-MESSAGING]: IM: Dialog({0})", (InstantMessageDialog)im.dialog);
+ m_log.DebugFormat("[GROUPS-MESSAGING]: IM: fromAgentID({0})", im.fromAgentID);
+ m_log.DebugFormat("[GROUPS-MESSAGING]: IM: fromAgentName({0})", im.fromAgentName);
+ m_log.DebugFormat("[GROUPS-MESSAGING]: IM: imSessionID({0})", im.imSessionID);
+ m_log.DebugFormat("[GROUPS-MESSAGING]: IM: message({0})", im.message);
+ m_log.DebugFormat("[GROUPS-MESSAGING]: IM: offline({0})", im.offline);
+ m_log.DebugFormat("[GROUPS-MESSAGING]: IM: toAgentID({0})", im.toAgentID);
+ m_log.DebugFormat("[GROUPS-MESSAGING]: IM: binaryBucket({0})", OpenMetaverse.Utils.BytesToHexString(im.binaryBucket, "BinaryBucket"));
}
}
@@ -610,7 +656,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
///
private IClientAPI GetActiveClient(UUID agentID)
{
- if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Looking for local client {0}", agentID);
+ if (m_debugEnabled)
+ m_log.DebugFormat("[GROUPS-MESSAGING]: Looking for local client {0}", agentID);
IClientAPI child = null;
@@ -622,12 +669,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
{
if (!sp.IsChildAgent)
{
- if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Found root agent for client : {0}", sp.ControllingClient.Name);
+ if (m_debugEnabled)
+ m_log.DebugFormat("[GROUPS-MESSAGING]: Found root agent for client : {0}", sp.ControllingClient.Name);
+
return sp.ControllingClient;
}
else
{
- if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Found child agent for client : {0}", sp.ControllingClient.Name);
+ if (m_debugEnabled)
+ m_log.DebugFormat("[GROUPS-MESSAGING]: Found child agent for client : {0}", sp.ControllingClient.Name);
+
child = sp.ControllingClient;
}
}
@@ -636,12 +687,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
// If we didn't find a root, then just return whichever child we found, or null if none
if (child == null)
{
- if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Could not find local client for agent : {0}", agentID);
+ if (m_debugEnabled)
+ m_log.DebugFormat("[GROUPS-MESSAGING]: Could not find local client for agent : {0}", agentID);
}
else
{
- if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Returning child agent for client : {0}", child.Name);
+ if (m_debugEnabled)
+ m_log.DebugFormat("[GROUPS-MESSAGING]: Returning child agent for client : {0}", child.Name);
}
+
return child;
}
--
cgit v1.1
From 5ec3429843ecb8058698f663556ae1d4cae53434 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 19 May 2014 23:01:48 +0100
Subject: On verbose groups messaging logging, count all operations in reported
time when sending group messages, not just those after get group members and
get presence status, as applicable
---
.../OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
index 09bbec2..e1b6abb 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
@@ -274,6 +274,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
public void SendMessageToGroup(
GridInstantMessage im, UUID groupID, UUID sendingAgentForGroupCalls, Func sendCondition)
{
+ int requestStartTick = Environment.TickCount;
+
List groupMembers = m_groupData.GetGroupMembers(sendingAgentForGroupCalls, groupID);
int groupMembersCount = groupMembers.Count;
HashSet attemptDeliveryUuidSet = null;
@@ -313,9 +315,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
m_log.DebugFormat(
"[GROUPS-MESSAGING]: SendMessageToGroup called for group {0} with {1} visible members",
groupID, groupMembers.Count);
- }
-
- int requestStartTick = Environment.TickCount;
+ }
foreach (GroupMembersData member in groupMembers)
{
--
cgit v1.1
From 9479f647781184d39d174fd708650da1e847c18c Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 20 May 2014 23:48:10 +0100
Subject: Fix issue where avatar and script chat could sometimes be heard from
anywhere in neighbouring regions.
This was due to a silent uint overflow in ScenePresence.UpdateChildAgent() corrupting child agent positions
when the child agent was in a region with a greater x or y map co-ord than the root agent region
Probably introduced in beeec1c.
This still will not function properly with very high region map co-ords (in the millions) but other parts of the code don't handle this properly anyway.
Looks to address http://opensimulator.org/mantis/view.php?id=7163
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index dd4bbe9..28b5b46 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3777,10 +3777,15 @@ namespace OpenSim.Region.Framework.Scenes
if (!IsChildAgent)
return;
- //m_log.Debug(" >>> ChildAgentPositionUpdate <<< " + rRegionX + "-" + rRegionY);
+// m_log.DebugFormat(
+// "[SCENE PRESENCE]: ChildAgentPositionUpdate for {0} in {1}, tRegion {2},{3}, rRegion {4},{5}, pos {6}",
+// Name, Scene.Name, tRegionX, tRegionY, rRegionX, rRegionY, cAgentData.Position);
+
// Find the distance (in meters) between the two regions
- uint shiftx = Util.RegionToWorldLoc(rRegionX - tRegionX);
- uint shifty = Util.RegionToWorldLoc(rRegionY - tRegionY);
+ // XXX: We cannot use Util.RegionLocToHandle() here because a negative value will silently overflow the
+ // uint
+ int shiftx = (int)(((int)rRegionX - (int)tRegionX) * Constants.RegionSize);
+ int shifty = (int)(((int)rRegionY - (int)tRegionY) * Constants.RegionSize);
Vector3 offset = new Vector3(shiftx, shifty, 0f);
--
cgit v1.1
From 32070fa5f40aaad6da3624de7dfce724ee482643 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 20 May 2014 23:54:49 +0100
Subject: minor: remove compiler warning in SceneObjectPartInventory
---
OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index fb8ecd5..75e1cbb 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -751,7 +751,7 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 bbox;
float offsetHeight;
- bool single = m_part.ParentGroup.Scene.GetObjectsToRez(rezAsset.Data, false, out objlist, out veclist, out bbox, out offsetHeight);
+ m_part.ParentGroup.Scene.GetObjectsToRez(rezAsset.Data, false, out objlist, out veclist, out bbox, out offsetHeight);
for (int i = 0; i < objlist.Count; i++)
{
--
cgit v1.1
From d93275745b8944ecb62ad34914af1c7f21103f51 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 20 May 2014 23:57:03 +0100
Subject: minor: Remove some unused fields in ScenePresence
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 3 ---
1 file changed, 3 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 28b5b46..398d394 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -208,7 +208,6 @@ namespace OpenSim.Region.Framework.Scenes
// private int m_lastColCount = -1; //KF: Look for Collision chnages
// private int m_updateCount = 0; //KF: Update Anims for a while
// private static readonly int UPDATE_COUNT = 10; // how many frames to update for
- private List m_lastColliders = new List();
private TeleportFlags m_teleportFlags;
public TeleportFlags TeleportFlags
@@ -271,8 +270,6 @@ namespace OpenSim.Region.Framework.Scenes
//private int m_moveToPositionStateStatus;
//*****************************************************
- private object m_collisionEventLock = new Object();
-
private int m_movementAnimationUpdateCounter = 0;
public Vector3 PrevSitOffset { get; set; }
--
cgit v1.1
From 5b433e101d178817d0127f568b5ff1b68fa70c09 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 20 May 2014 23:59:08 +0100
Subject: minor: Comment out currently unused log setup in TerrainCompressor
---
OpenSim/Region/Framework/Scenes/TerrainCompressor.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/TerrainCompressor.cs b/OpenSim/Region/Framework/Scenes/TerrainCompressor.cs
index e797207..396f1e8 100644
--- a/OpenSim/Region/Framework/Scenes/TerrainCompressor.cs
+++ b/OpenSim/Region/Framework/Scenes/TerrainCompressor.cs
@@ -45,7 +45,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
public static class OpenSimTerrainCompressor
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
#pragma warning disable 414
private static string LogHeader = "[TERRAIN COMPRESSOR]";
--
cgit v1.1
From a1b291c88966de86a083b60d9784a8bf2f7ae3ba Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Wed, 21 May 2014 09:34:57 +0300
Subject: Allow map searches for regions that contain the characters "!+|"
These characters are used as placeholders for other characters: ": /". But we should search first for the exact string the user entered, and only if that fails then replace the characters and search again.
---
.../CoreModules/World/WorldMap/MapSearchModule.cs | 44 ++++++++++++----------
1 file changed, 24 insertions(+), 20 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
index c35f6b7..1437b1b 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
@@ -143,28 +143,32 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
}
- //m_log.DebugFormat("MAP NAME=({0})", mapName);
-
- // Hack to get around the fact that ll V3 now drops the port from the
- // map name. See https://jira.secondlife.com/browse/VWR-28570
- //
- // Caller, use this magic form instead:
- // secondlife://http|!!mygrid.com|8002|Region+Name/128/128
- // or url encode if possible.
- // the hacks we do with this viewer...
- //
+ List regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20);
+
string mapNameOrig = mapName;
- if (mapName.Contains("|"))
- mapName = mapName.Replace('|', ':');
- if (mapName.Contains("+"))
- mapName = mapName.Replace('+', ' ');
- if (mapName.Contains("!"))
- mapName = mapName.Replace('!', '/');
+ if (regionInfos.Count == 0)
+ {
+ // Hack to get around the fact that ll V3 now drops the port from the
+ // map name. See https://jira.secondlife.com/browse/VWR-28570
+ //
+ // Caller, use this magic form instead:
+ // secondlife://http|!!mygrid.com|8002|Region+Name/128/128
+ // or url encode if possible.
+ // the hacks we do with this viewer...
+ //
+ if (mapName.Contains("|"))
+ mapName = mapName.Replace('|', ':');
+ if (mapName.Contains("+"))
+ mapName = mapName.Replace('+', ' ');
+ if (mapName.Contains("!"))
+ mapName = mapName.Replace('!', '/');
+
+ if (mapName != mapNameOrig)
+ regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20);
+ }
- // try to fetch from GridServer
- List regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20);
-
m_log.DebugFormat("[MAPSEARCHMODULE]: search {0} returned {1} regions. Flags={2}", mapName, regionInfos.Count, flags);
+
if (regionInfos.Count > 0)
{
foreach (GridRegion info in regionInfos)
@@ -178,7 +182,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
data.MapImageId = info.TerrainImage;
// ugh! V2-3 is very sensitive about the result being
// exactly the same as the requested name
- if (regionInfos.Count == 1 && mapNameOrig.Contains("|") || mapNameOrig.Contains("+"))
+ if (regionInfos.Count == 1 && (mapName != mapNameOrig))
data.Name = mapNameOrig;
else
data.Name = info.RegionName;
--
cgit v1.1
From f7b2aa0f49f5eca0a58c20b903103d19742220e9 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Thu, 22 May 2014 10:16:01 -0700
Subject: Fixed a problem with detaching attachments in situations where the
user's asset server is not the same as the simulator's asset server.
Unfortunately this still continues to be wasteful -- new assets are created
every time an attachment is detached, but the process of storing the new
asset goes through the InventoryAccess module, which does all sorts of checks
regarding the users' inventory.
---
.../Avatar/Attachments/AttachmentsModule.cs | 9 ++------
.../InventoryAccess/HGInventoryAccessModule.cs | 14 ++++++++++++
.../InventoryAccess/InventoryAccessModule.cs | 26 +++++++++++++++++++++-
.../Framework/Interfaces/IInventoryAccessModule.cs | 4 +++-
4 files changed, 44 insertions(+), 9 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index e9b2f4f..7333769 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -774,15 +774,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
(sbyte)AssetType.Object,
Utils.StringToBytes(sceneObjectXml),
sp.UUID);
- m_scene.AssetService.Store(asset);
- item.AssetID = asset.FullID;
- item.Description = asset.Description;
- item.Name = asset.Name;
- item.AssetType = asset.Type;
- item.InvType = (int)InventoryType.Object;
+ IInventoryAccessModule invAccess = m_scene.RequestModuleInterface();
- m_scene.InventoryService.UpdateItem(item);
+ invAccess.UpdateInventoryItemAsset(sp.UUID, item, asset);
// If the name of the object has been changed whilst attached then we want to update the inventory
// item in the viewer.
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index 283a0cf..71570da 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -253,6 +253,20 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
return newAssetID;
}
+ ///
+ /// UpdateInventoryItemAsset
+ ///
+ public override bool UpdateInventoryItemAsset(UUID ownerID, InventoryItemBase item, AssetBase asset)
+ {
+ if (base.UpdateInventoryItemAsset(ownerID, item, asset))
+ {
+ UploadInventoryItem(ownerID, (AssetType)asset.Type, asset.FullID, asset.Name, 0);
+ return true;
+ }
+
+ return false;
+ }
+
///
/// Used in DeleteToInventory
///
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index a116f0f..6e48fcc 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -292,7 +292,31 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
return UUID.Zero;
}
-
+
+ public virtual bool UpdateInventoryItemAsset(UUID ownerID, InventoryItemBase item, AssetBase asset)
+ {
+ if (item != null && item.Owner == ownerID && asset != null)
+ {
+ item.AssetID = asset.FullID;
+ item.Description = asset.Description;
+ item.Name = asset.Name;
+ item.AssetType = asset.Type;
+ item.InvType = (int)InventoryType.Object;
+
+ m_Scene.AssetService.Store(asset);
+ m_Scene.InventoryService.UpdateItem(item);
+
+ return true;
+ }
+ else
+ {
+ m_log.ErrorFormat("[INVENTORY ACCESS MODULE]: Given invalid item for inventory update: {0}",
+ (item == null || asset == null? "null item or asset" : "wrong owner"));
+ return false;
+ }
+
+ }
+
public virtual List CopyToInventory(
DeRezAction action, UUID folderID,
List objectGroups, IClientAPI remoteClient, bool asAttachment)
diff --git a/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs b/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs
index 3576e35..6bad018 100644
--- a/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs
@@ -38,7 +38,9 @@ namespace OpenSim.Region.Framework.Interfaces
public interface IInventoryAccessModule
{
UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data);
-
+
+ bool UpdateInventoryItemAsset(UUID ownerID, InventoryItemBase item, AssetBase asset);
+
///
/// Copy objects to a user's inventory.
///
--
cgit v1.1
From 1b156b7fe84bf132b51ff198d6d730708f5930b7 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 22 May 2014 19:18:24 +0100
Subject: Add regression test for in-range chat between neighbouring regions
from east to west.
---
.../Avatar/Chat/Tests/ChatModuleTests.cs | 158 +++++++++++++++++++++
OpenSim/Region/Framework/Scenes/Scene.cs | 5 +-
.../BasicPhysicsPlugin/BasicPhysicsScene.cs | 1 +
3 files changed, 163 insertions(+), 1 deletion(-)
create mode 100644 OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs
new file mode 100644
index 0000000..315cc19
--- /dev/null
+++ b/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.org/
+ * See CONTRIBUTORS.TXT for a full list of copyright holders.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the OpenSimulator Project nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System;
+using System.Collections.Generic;
+using log4net.Config;
+using Nini.Config;
+using NUnit.Framework;
+using OpenMetaverse;
+using OpenSim.Framework;
+using OpenSim.Framework.Servers;
+using OpenSim.Framework.Servers.HttpServer;
+using OpenSim.Region.CoreModules.Avatar.Chat;
+using OpenSim.Region.CoreModules.Framework;
+using OpenSim.Region.CoreModules.Framework.EntityTransfer;
+using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
+using OpenSim.Region.Framework.Scenes;
+using OpenSim.Services.Interfaces;
+using OpenSim.Tests.Common;
+using OpenSim.Tests.Common.Mock;
+
+namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests
+{
+ [TestFixture]
+ public class ChatModuleTests : OpenSimTestCase
+ {
+ [TestFixtureSetUp]
+ public void FixtureInit()
+ {
+ // Don't allow tests to be bamboozled by asynchronous events. Execute everything on the same thread.
+ // We must do this here so that child agent positions are updated in a predictable manner.
+ Util.FireAndForgetMethod = FireAndForgetMethod.RegressionTest;
+ }
+
+ [TestFixtureTearDown]
+ public void TearDown()
+ {
+ // We must set this back afterwards, otherwise later tests will fail since they're expecting multiple
+ // threads. Possibly, later tests should be rewritten so none of them require async stuff (which regression
+ // tests really shouldn't).
+ Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod;
+ }
+
+ ///
+ /// Tests chat between neighbour regions on the east-west axis
+ ///
+ ///
+ /// Really, this is a combination of a child agent position update test and a chat range test. These need
+ /// to be separated later on.
+ ///
+ [Test]
+ public void TestInterRegionChatDistanceEastWest()
+ {
+ TestHelpers.InMethod();
+// TestHelpers.EnableLogging();
+
+ UUID sp1Uuid = TestHelpers.ParseTail(0x11);
+ UUID sp2Uuid = TestHelpers.ParseTail(0x12);
+
+ Vector3 sp1Position = new Vector3(6, 128, 20);
+ Vector3 sp2Position = new Vector3(250, 128, 20);
+
+ // XXX: HTTP server is not (and should not be) necessary for this test, though it's absence makes the
+ // CapabilitiesModule complain when it can't set up HTTP endpoints.
+// BaseHttpServer httpServer = new BaseHttpServer(99999);
+// MainServer.AddHttpServer(httpServer);
+// MainServer.Instance = httpServer;
+
+ // We need entity transfer modules so that when sp2 logs into the east region, the region calls
+ // EntityTransferModuleto set up a child agent on the west region.
+ // XXX: However, this is not an entity transfer so is misleading.
+ EntityTransferModule etmA = new EntityTransferModule();
+ EntityTransferModule etmB = new EntityTransferModule();
+ LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule();
+
+ IConfigSource config = new IniConfigSource();
+ config.AddConfig("Chat");
+ IConfig modulesConfig = config.AddConfig("Modules");
+ modulesConfig.Set("EntityTransferModule", etmA.Name);
+ modulesConfig.Set("SimulationServices", lscm.Name);
+
+ SceneHelpers sh = new SceneHelpers();
+
+ TestScene sceneWest = sh.SetupScene("sceneWest", TestHelpers.ParseTail(0x1), 1000, 1000);
+ TestScene sceneEast = sh.SetupScene("sceneEast", TestHelpers.ParseTail(0x2), 1001, 1000);
+ SceneHelpers.SetupSceneModules(new Scene[] { sceneWest, sceneEast }, config, lscm);
+
+ SceneHelpers.SetupSceneModules(sceneWest, config, new CapabilitiesModule(), etmA, new ChatModule());
+ SceneHelpers.SetupSceneModules(sceneEast, config, new CapabilitiesModule(), etmB, new ChatModule());
+
+ ScenePresence sp1 = SceneHelpers.AddScenePresence(sceneEast, sp1Uuid);
+ TestClient sp1Client = (TestClient)sp1.ControllingClient;
+
+ // If we don't set agents to flying, test will go wrong as they instantly fall to z = 0.
+ // TODO: May need to create special complete no-op test physics module rather than basic physics, since
+ // physics is irrelevant to this test.
+ sp1.Flying = true;
+ sp1.AbsolutePosition = sp1Position;
+
+ AgentCircuitData acd = SceneHelpers.GenerateAgentData(sp2Uuid);
+ TestClient tc = new TestClient(acd, sceneEast);
+ List destinationTestClients = new List();
+ EntityTransferHelpers.SetupInformClientOfNeighbourTriggersNeighbourClientCreate(tc, destinationTestClients);
+
+ ScenePresence sp2 = SceneHelpers.AddScenePresence(sceneWest, tc, acd);
+ TestClient sp2Client = (TestClient)sp2.ControllingClient;
+
+ sp2.Flying = true;
+ sp2.AbsolutePosition = sp2Position;
+
+ TestClient sp2ChildClient = destinationTestClients[0];
+
+ // We must update the scene in order to make the new root agent sp2 in sceneWest trigger a position update to its
+ // child in sceneEast.
+ sceneWest.Update(1);
+
+ // Check child position is correct.
+ Assert.AreEqual(
+ new Vector3(sp2Position.X - sceneWest.RegionInfo.RegionSizeX, sp2Position.Y, sp2Position.Z),
+ sp2ChildClient.SceneAgent.AbsolutePosition);
+
+ // Check chat received
+ string receivedChatMessage = "";
+
+ sp2ChildClient.OnReceivedChatMessage
+ += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedChatMessage = message;
+
+ string testMessage = "'ello darling";
+ sp1Client.Chat(0, ChatTypeEnum.Say, testMessage);
+
+ Assert.AreEqual(testMessage, receivedChatMessage);
+ }
+ }
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 3b8fbfd..7005c0a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -4133,7 +4133,10 @@ namespace OpenSim.Region.Framework.Scenes
/// true if we handled it.
public virtual bool IncomingUpdateChildAgent(AgentPosition cAgentData)
{
- //m_log.Debug(" XXX Scene IncomingChildAgentDataUpdate POSITION in " + RegionInfo.RegionName);
+// m_log.DebugFormat(
+// "[SCENE PRESENCE]: IncomingChildAgentDataUpdate POSITION for {0} in {1}, position {2}",
+// cAgentData.AgentID, Name, cAgentData.Position);
+
ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID);
if (childAgentUpdate != null)
{
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs
index 8e40561..f53adcb 100644
--- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs
+++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs
@@ -147,6 +147,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
terrainHeight = _heightMap[(int)actor.Position.Y * (int)m_regionExtent.Y + (int)actor.Position.X];
float height = terrainHeight + actor.Size.Z;
+// Console.WriteLine("height {0}, actorPosition {1}", height, actorPosition);
if (actor.Flying)
{
--
cgit v1.1
From 65a135f4d33fc0be3738f11c51a6c27c344a10aa Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 22 May 2014 19:47:33 +0100
Subject: Simplify regression TestInterRegionChatDistanceEastWest() by making
the child presence connection directly rather than routing through
TestClient.
This code isn't relevant to this test and is already exercised by other tests.
---
.../Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs
index 315cc19..c5eb2ad 100644
--- a/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs
@@ -121,18 +121,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests
sp1.Flying = true;
sp1.AbsolutePosition = sp1Position;
- AgentCircuitData acd = SceneHelpers.GenerateAgentData(sp2Uuid);
- TestClient tc = new TestClient(acd, sceneEast);
- List destinationTestClients = new List();
- EntityTransferHelpers.SetupInformClientOfNeighbourTriggersNeighbourClientCreate(tc, destinationTestClients);
-
- ScenePresence sp2 = SceneHelpers.AddScenePresence(sceneWest, tc, acd);
+ ScenePresence sp2 = SceneHelpers.AddScenePresence(sceneWest, sp2Uuid);
TestClient sp2Client = (TestClient)sp2.ControllingClient;
+ // When sp2 logs in to sceneWest, it sets up a child agent in sceneEast and informs the sp2 client to
+ // make the connection. For this test, will simplify this chain by making the connection separately here.
+ ScenePresence sp2Child = SceneHelpers.AddChildScenePresence(sceneEast, sp2Uuid);
+
sp2.Flying = true;
sp2.AbsolutePosition = sp2Position;
- TestClient sp2ChildClient = destinationTestClients[0];
+ TestClient sp2ChildClient = (TestClient)sp2Child.ControllingClient;
// We must update the scene in order to make the new root agent sp2 in sceneWest trigger a position update to its
// child in sceneEast.
--
cgit v1.1
From 15b50ae737cf316cfe9db6843f06f7b3799f139e Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 22 May 2014 19:55:34 +0100
Subject: Extend regression TestInterRegionChatDistanceEastWest() to test in
range chat both ways.
---
.../Avatar/Chat/Tests/ChatModuleTests.cs | 55 +++++++++++++++-------
1 file changed, 38 insertions(+), 17 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs
index c5eb2ad..fac9bd4 100644
--- a/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs
@@ -119,39 +119,60 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests
// TODO: May need to create special complete no-op test physics module rather than basic physics, since
// physics is irrelevant to this test.
sp1.Flying = true;
+
+ // When sp1 logs in to sceneEast, it sets up a child agent in sceneWest and informs the sp2 client to
+ // make the connection. For this test, will simplify this chain by making the connection directly.
+ ScenePresence sp1Child = SceneHelpers.AddChildScenePresence(sceneWest, sp1Uuid);
+ TestClient sp1ChildClient = (TestClient)sp1Child.ControllingClient;
+
sp1.AbsolutePosition = sp1Position;
ScenePresence sp2 = SceneHelpers.AddScenePresence(sceneWest, sp2Uuid);
TestClient sp2Client = (TestClient)sp2.ControllingClient;
-
- // When sp2 logs in to sceneWest, it sets up a child agent in sceneEast and informs the sp2 client to
- // make the connection. For this test, will simplify this chain by making the connection separately here.
- ScenePresence sp2Child = SceneHelpers.AddChildScenePresence(sceneEast, sp2Uuid);
-
sp2.Flying = true;
- sp2.AbsolutePosition = sp2Position;
+ ScenePresence sp2Child = SceneHelpers.AddChildScenePresence(sceneEast, sp2Uuid);
TestClient sp2ChildClient = (TestClient)sp2Child.ControllingClient;
- // We must update the scene in order to make the new root agent sp2 in sceneWest trigger a position update to its
- // child in sceneEast.
+ sp2.AbsolutePosition = sp2Position;
+
+ // We must update the scenes in order to make the root new root agents trigger position updates in their
+ // children.
sceneWest.Update(1);
+ sceneEast.Update(1);
+
+ // Check child positions are correct.
+ Assert.AreEqual(
+ new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z),
+ sp1ChildClient.SceneAgent.AbsolutePosition);
- // Check child position is correct.
Assert.AreEqual(
new Vector3(sp2Position.X - sceneWest.RegionInfo.RegionSizeX, sp2Position.Y, sp2Position.Z),
sp2ChildClient.SceneAgent.AbsolutePosition);
- // Check chat received
- string receivedChatMessage = "";
+ // Check chat from sp1
+ {
+ string receivedChatMessage = "";
+
+ sp2ChildClient.OnReceivedChatMessage
+ += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedChatMessage = message;
+
+ string testMessage = "'ello darling";
+ sp1Client.Chat(0, ChatTypeEnum.Say, testMessage);
+ }
+
+ // Check chat from sp2
+ {
+ string receivedChatMessage = "";
- sp2ChildClient.OnReceivedChatMessage
- += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedChatMessage = message;
+ sp1ChildClient.OnReceivedChatMessage
+ += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedChatMessage = message;
- string testMessage = "'ello darling";
- sp1Client.Chat(0, ChatTypeEnum.Say, testMessage);
-
- Assert.AreEqual(testMessage, receivedChatMessage);
+ string testMessage = "fantastic cats";
+ sp2Client.Chat(0, ChatTypeEnum.Say, testMessage);
+
+ Assert.AreEqual(testMessage, receivedChatMessage);
+ }
}
}
}
\ No newline at end of file
--
cgit v1.1
From bffc9ad18471076360692731597f89d232bb07b9 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 22 May 2014 20:04:32 +0100
Subject: Extend regression TestInterRegionChatDistanceEastWest() to test out
of range chat
---
.../Avatar/Chat/Tests/ChatModuleTests.cs | 49 +++++++++++++++++-----
1 file changed, 38 insertions(+), 11 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs
index fac9bd4..bdaa97b 100644
--- a/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs
@@ -150,28 +150,55 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests
new Vector3(sp2Position.X - sceneWest.RegionInfo.RegionSizeX, sp2Position.Y, sp2Position.Z),
sp2ChildClient.SceneAgent.AbsolutePosition);
- // Check chat from sp1
- {
- string receivedChatMessage = "";
+ string receivedSp1ChatMessage = "";
+ string receivedSp2ChatMessage = "";
- sp2ChildClient.OnReceivedChatMessage
- += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedChatMessage = message;
+ sp1ChildClient.OnReceivedChatMessage
+ += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp1ChatMessage = message;
+ sp2ChildClient.OnReceivedChatMessage
+ += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp2ChatMessage = message;
+ // Check chat from sp1
+ {
string testMessage = "'ello darling";
sp1Client.Chat(0, ChatTypeEnum.Say, testMessage);
+
+// Assert.AreEqual(testMessage, receivedSp1ChatMessage);
+ Assert.AreEqual(testMessage, receivedSp2ChatMessage);
}
// Check chat from sp2
+ {
+ string testMessage = "fantastic cats";
+ sp2Client.Chat(0, ChatTypeEnum.Say, testMessage);
+
+ Assert.AreEqual(testMessage, receivedSp1ChatMessage);
+// Assert.AreEqual(testMessage, receivedSp2ChatMessage);
+ }
+
+ sp1Position = new Vector3(30, 128, 20);
+ sp1.AbsolutePosition = sp1Position;
+ sceneEast.Update(1);
+
+ // Check child position is correct.
+ Assert.AreEqual(
+ new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z),
+ sp1ChildClient.SceneAgent.AbsolutePosition);
+
+ // sp2 should now be out of range for chat from sp1
{
- string receivedChatMessage = "";
+ string testMessage = "beef";
+ sp1Client.Chat(0, ChatTypeEnum.Say, testMessage);
- sp1ChildClient.OnReceivedChatMessage
- += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedChatMessage = message;
+ Assert.AreNotEqual(testMessage, receivedSp2ChatMessage);
+ }
- string testMessage = "fantastic cats";
+ // sp1 should now be out of range for chat from sp2
+ {
+ string testMessage = "lentils";
sp2Client.Chat(0, ChatTypeEnum.Say, testMessage);
-
- Assert.AreEqual(testMessage, receivedChatMessage);
+
+ Assert.AreNotEqual(testMessage, receivedSp1ChatMessage);
}
}
}
--
cgit v1.1
From f8b824123970418211bbc5ea501ead98a1781084 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 22 May 2014 20:28:26 +0100
Subject: Add regression test for north-south chat across neighbour regions.
---
.../Avatar/Chat/Tests/ChatModuleTests.cs | 185 +++++++++++++++------
1 file changed, 133 insertions(+), 52 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs
index bdaa97b..7b8c418 100644
--- a/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs
@@ -65,6 +65,32 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests
Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod;
}
+ private void SetupNeighbourRegions(TestScene sceneA, TestScene sceneB)
+ {
+ // XXX: HTTP server is not (and should not be) necessary for this test, though it's absence makes the
+ // CapabilitiesModule complain when it can't set up HTTP endpoints.
+ // BaseHttpServer httpServer = new BaseHttpServer(99999);
+ // MainServer.AddHttpServer(httpServer);
+ // MainServer.Instance = httpServer;
+
+ // We need entity transfer modules so that when sp2 logs into the east region, the region calls
+ // EntityTransferModuleto set up a child agent on the west region.
+ // XXX: However, this is not an entity transfer so is misleading.
+ EntityTransferModule etmA = new EntityTransferModule();
+ EntityTransferModule etmB = new EntityTransferModule();
+ LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule();
+
+ IConfigSource config = new IniConfigSource();
+ config.AddConfig("Chat");
+ IConfig modulesConfig = config.AddConfig("Modules");
+ modulesConfig.Set("EntityTransferModule", etmA.Name);
+ modulesConfig.Set("SimulationServices", lscm.Name);
+
+ SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm);
+ SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA, new ChatModule());
+ SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB, new ChatModule());
+ }
+
///
/// Tests chat between neighbour regions on the east-west axis
///
@@ -84,33 +110,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests
Vector3 sp1Position = new Vector3(6, 128, 20);
Vector3 sp2Position = new Vector3(250, 128, 20);
- // XXX: HTTP server is not (and should not be) necessary for this test, though it's absence makes the
- // CapabilitiesModule complain when it can't set up HTTP endpoints.
-// BaseHttpServer httpServer = new BaseHttpServer(99999);
-// MainServer.AddHttpServer(httpServer);
-// MainServer.Instance = httpServer;
-
- // We need entity transfer modules so that when sp2 logs into the east region, the region calls
- // EntityTransferModuleto set up a child agent on the west region.
- // XXX: However, this is not an entity transfer so is misleading.
- EntityTransferModule etmA = new EntityTransferModule();
- EntityTransferModule etmB = new EntityTransferModule();
- LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule();
-
- IConfigSource config = new IniConfigSource();
- config.AddConfig("Chat");
- IConfig modulesConfig = config.AddConfig("Modules");
- modulesConfig.Set("EntityTransferModule", etmA.Name);
- modulesConfig.Set("SimulationServices", lscm.Name);
-
SceneHelpers sh = new SceneHelpers();
-
TestScene sceneWest = sh.SetupScene("sceneWest", TestHelpers.ParseTail(0x1), 1000, 1000);
TestScene sceneEast = sh.SetupScene("sceneEast", TestHelpers.ParseTail(0x2), 1001, 1000);
- SceneHelpers.SetupSceneModules(new Scene[] { sceneWest, sceneEast }, config, lscm);
- SceneHelpers.SetupSceneModules(sceneWest, config, new CapabilitiesModule(), etmA, new ChatModule());
- SceneHelpers.SetupSceneModules(sceneEast, config, new CapabilitiesModule(), etmB, new ChatModule());
+ SetupNeighbourRegions(sceneWest, sceneEast);
ScenePresence sp1 = SceneHelpers.AddScenePresence(sceneEast, sp1Uuid);
TestClient sp1Client = (TestClient)sp1.ControllingClient;
@@ -158,23 +162,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests
sp2ChildClient.OnReceivedChatMessage
+= (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp2ChatMessage = message;
- // Check chat from sp1
- {
- string testMessage = "'ello darling";
- sp1Client.Chat(0, ChatTypeEnum.Say, testMessage);
-
-// Assert.AreEqual(testMessage, receivedSp1ChatMessage);
- Assert.AreEqual(testMessage, receivedSp2ChatMessage);
- }
-
- // Check chat from sp2
- {
- string testMessage = "fantastic cats";
- sp2Client.Chat(0, ChatTypeEnum.Say, testMessage);
-
- Assert.AreEqual(testMessage, receivedSp1ChatMessage);
-// Assert.AreEqual(testMessage, receivedSp2ChatMessage);
- }
+ TestUserInRange(sp1Client, "ello darling", ref receivedSp2ChatMessage);
+ TestUserInRange(sp2Client, "fantastic cats", ref receivedSp1ChatMessage);
sp1Position = new Vector3(30, 128, 20);
sp1.AbsolutePosition = sp1Position;
@@ -185,21 +174,113 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests
new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z),
sp1ChildClient.SceneAgent.AbsolutePosition);
- // sp2 should now be out of range for chat from sp1
- {
- string testMessage = "beef";
- sp1Client.Chat(0, ChatTypeEnum.Say, testMessage);
+ TestUserOutOfRange(sp1Client, "beef", ref receivedSp2ChatMessage);
+ TestUserOutOfRange(sp2Client, "lentils", ref receivedSp1ChatMessage);
+ }
+
+ ///
+ /// Tests chat between neighbour regions on the north-south axis
+ ///
+ ///
+ /// Really, this is a combination of a child agent position update test and a chat range test. These need
+ /// to be separated later on.
+ ///
+ [Test]
+ public void TestInterRegionChatDistanceNorthSouth()
+ {
+ TestHelpers.InMethod();
+ // TestHelpers.EnableLogging();
+
+ UUID sp1Uuid = TestHelpers.ParseTail(0x11);
+ UUID sp2Uuid = TestHelpers.ParseTail(0x12);
+
+ Vector3 sp1Position = new Vector3(128, 250, 20);
+ Vector3 sp2Position = new Vector3(128, 6, 20);
+
+ SceneHelpers sh = new SceneHelpers();
+ TestScene sceneNorth = sh.SetupScene("sceneNorth", TestHelpers.ParseTail(0x1), 1000, 1000);
+ TestScene sceneSouth = sh.SetupScene("sceneSouth", TestHelpers.ParseTail(0x2), 1000, 1001);
- Assert.AreNotEqual(testMessage, receivedSp2ChatMessage);
- }
+ SetupNeighbourRegions(sceneNorth, sceneSouth);
+
+ ScenePresence sp1 = SceneHelpers.AddScenePresence(sceneNorth, sp1Uuid);
+ TestClient sp1Client = (TestClient)sp1.ControllingClient;
+
+ // If we don't set agents to flying, test will go wrong as they instantly fall to z = 0.
+ // TODO: May need to create special complete no-op test physics module rather than basic physics, since
+ // physics is irrelevant to this test.
+ sp1.Flying = true;
+
+ // When sp1 logs in to sceneEast, it sets up a child agent in sceneNorth and informs the sp2 client to
+ // make the connection. For this test, will simplify this chain by making the connection directly.
+ ScenePresence sp1Child = SceneHelpers.AddChildScenePresence(sceneSouth, sp1Uuid);
+ TestClient sp1ChildClient = (TestClient)sp1Child.ControllingClient;
+
+ sp1.AbsolutePosition = sp1Position;
+
+ ScenePresence sp2 = SceneHelpers.AddScenePresence(sceneSouth, sp2Uuid);
+ TestClient sp2Client = (TestClient)sp2.ControllingClient;
+ sp2.Flying = true;
+
+ ScenePresence sp2Child = SceneHelpers.AddChildScenePresence(sceneNorth, sp2Uuid);
+ TestClient sp2ChildClient = (TestClient)sp2Child.ControllingClient;
+
+ sp2.AbsolutePosition = sp2Position;
+
+ // We must update the scenes in order to make the root new root agents trigger position updates in their
+ // children.
+ sceneNorth.Update(1);
+ sceneSouth.Update(1);
+
+ // Check child positions are correct.
+ Assert.AreEqual(
+ new Vector3(sp1Position.X, sp1Position.Y - sceneNorth.RegionInfo.RegionSizeY, sp1Position.Z),
+ sp1ChildClient.SceneAgent.AbsolutePosition);
+
+ Assert.AreEqual(
+ new Vector3(sp2Position.X, sp2Position.Y + sceneSouth.RegionInfo.RegionSizeY, sp2Position.Z),
+ sp2ChildClient.SceneAgent.AbsolutePosition);
+
+ string receivedSp1ChatMessage = "";
+ string receivedSp2ChatMessage = "";
+
+ sp1ChildClient.OnReceivedChatMessage
+ += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp1ChatMessage = message;
+ sp2ChildClient.OnReceivedChatMessage
+ += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp2ChatMessage = message;
+
+ TestUserInRange(sp1Client, "ello darling", ref receivedSp2ChatMessage);
+ TestUserInRange(sp2Client, "fantastic cats", ref receivedSp1ChatMessage);
+
+ sp1Position = new Vector3(30, 128, 20);
+ sp1.AbsolutePosition = sp1Position;
+ sceneNorth.Update(1);
+
+ // Check child position is correct.
+ Assert.AreEqual(
+ new Vector3(sp1Position.X, sp1Position.Y - sceneNorth.RegionInfo.RegionSizeY, sp1Position.Z),
+ sp1ChildClient.SceneAgent.AbsolutePosition);
+
+ TestUserOutOfRange(sp1Client, "beef", ref receivedSp2ChatMessage);
+ TestUserOutOfRange(sp2Client, "lentils", ref receivedSp1ChatMessage);
+ }
+
+ private void TestUserInRange(TestClient speakClient, string testMessage, ref string receivedMessage)
+ {
+ receivedMessage = "";
+
+ speakClient.Chat(0, ChatTypeEnum.Say, testMessage);
+
+ Assert.AreEqual(testMessage, receivedMessage);
+ }
+
+ private void TestUserOutOfRange(TestClient speakClient, string testMessage, ref string receivedMessage)
+ {
+ receivedMessage = "";
- // sp1 should now be out of range for chat from sp2
- {
- string testMessage = "lentils";
- sp2Client.Chat(0, ChatTypeEnum.Say, testMessage);
+ speakClient.Chat(0, ChatTypeEnum.Say, testMessage);
- Assert.AreNotEqual(testMessage, receivedSp1ChatMessage);
- }
+ Assert.AreNotEqual(testMessage, receivedMessage);
}
}
}
\ No newline at end of file
--
cgit v1.1
From 16bf38e1abd3a6235008a38ba7ca29e836c925c7 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 22 May 2014 23:39:22 +0100
Subject: Fix issue where llSetCameraAtOffset() and llSetCameraEyeOffset() in
non-root prims moved camera/focus to wrong position.
For non-root prim, eye offsets now need to be made relative to root prim if either camera-at or camera-eye are set.
Probably a regression since November 2013 when all sits were made relative to root prim to match viewer expections (and fix other bugs).
Addresses http://opensimulator.org/mantis/view.php?id=7176
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 398d394..ed107e4 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2755,6 +2755,10 @@ namespace OpenSim.Region.Framework.Scenes
cameraAtOffset = part.GetCameraAtOffset();
cameraEyeOffset = part.GetCameraEyeOffset();
+
+ if (cameraEyeOffset != Vector3.Zero || cameraAtOffset != Vector3.Zero)
+ cameraEyeOffset += part.OffsetPosition;
+
forceMouselook = part.GetForceMouselook();
// An viewer expects to specify sit positions as offsets to the root prim, even if a child prim is
--
cgit v1.1
From 3fbaef9275dbb1767dc734e2d8dbe1d2cabfb566 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 22 May 2014 23:52:28 +0100
Subject: If the root prim has a camera-at or camera-eye setting and a sat upon
child prim does not, use the root prim offsets.
This matches behaviour just tested on the Linden Lab grid.
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 7 +++++++
1 file changed, 7 insertions(+)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index ed107e4..026b0b6 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2754,8 +2754,15 @@ namespace OpenSim.Region.Framework.Scenes
part.AddSittingAvatar(this);
cameraAtOffset = part.GetCameraAtOffset();
+
+ if (cameraAtOffset == Vector3.Zero)
+ cameraAtOffset = part.ParentGroup.RootPart.GetCameraAtOffset();
+
cameraEyeOffset = part.GetCameraEyeOffset();
+ if (cameraEyeOffset == Vector3.Zero)
+ cameraEyeOffset = part.ParentGroup.RootPart.GetCameraEyeOffset();
+
if (cameraEyeOffset != Vector3.Zero || cameraAtOffset != Vector3.Zero)
cameraEyeOffset += part.OffsetPosition;
--
cgit v1.1
From 174df941720bc45c1e73224919c34f059129b9e1 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 22 May 2014 23:58:28 +0100
Subject: If a script calls llSetCameraAtOffset() or llSetCameraEyeOffset() on
a child prim and the root prim has no corresponding value set, then also set
the root prim.
This matches behaviour just tested on the Linden Lab grid.
---
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 6 ++++++
1 file changed, 6 insertions(+)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 5590cd5..7d8821c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -6846,12 +6846,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
m_host.AddScriptLPS(1);
m_host.SetCameraEyeOffset(offset);
+
+ if (m_host.ParentGroup.RootPart.GetCameraEyeOffset() == Vector3.Zero)
+ m_host.ParentGroup.RootPart.SetCameraEyeOffset(offset);
}
public void llSetCameraAtOffset(LSL_Vector offset)
{
m_host.AddScriptLPS(1);
m_host.SetCameraAtOffset(offset);
+
+ if (m_host.ParentGroup.RootPart.GetCameraAtOffset() == Vector3.Zero)
+ m_host.ParentGroup.RootPart.SetCameraAtOffset(offset);
}
public void llSetLinkCamera(LSL_Integer link, LSL_Vector eye, LSL_Vector at)
--
cgit v1.1
From fbed2455965283e7cec92f8cceb89a333e1dca14 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 23 May 2014 01:34:02 +0100
Subject: Compensate camera-at and camera-eye for child prim rotation when
sitting on child prim with camera-eye set
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 12 ++++++++++++
1 file changed, 12 insertions(+)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 026b0b6..eaac71d 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2764,7 +2764,19 @@ namespace OpenSim.Region.Framework.Scenes
cameraEyeOffset = part.ParentGroup.RootPart.GetCameraEyeOffset();
if (cameraEyeOffset != Vector3.Zero || cameraAtOffset != Vector3.Zero)
+ {
+ if (!part.IsRoot)
+ {
+ cameraEyeOffset = cameraEyeOffset * part.RotationOffset;
+ cameraAtOffset = part.OffsetPosition;
+ }
+
cameraEyeOffset += part.OffsetPosition;
+ }
+
+// m_log.DebugFormat(
+// "[SCENE PRESENCE]: Using cameraAtOffset {0}, cameraEyeOffset {1} for sit on {2} by {3} in {4}",
+// cameraAtOffset, cameraEyeOffset, part.Name, Name, Scene.Name);
forceMouselook = part.GetForceMouselook();
--
cgit v1.1
From c78a8271c44c581e4c939fa6347fd967ffdee847 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 23 May 2014 01:38:05 +0100
Subject: Add any camera at compensation for sat upon child prims to any
existing camera-at value, rather than replace.
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index eaac71d..f067f9d 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2768,7 +2768,7 @@ namespace OpenSim.Region.Framework.Scenes
if (!part.IsRoot)
{
cameraEyeOffset = cameraEyeOffset * part.RotationOffset;
- cameraAtOffset = part.OffsetPosition;
+ cameraAtOffset += part.OffsetPosition;
}
cameraEyeOffset += part.OffsetPosition;
--
cgit v1.1
From 5015b0b485058db5bf1f2b56cf375c23349749ad Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 23 May 2014 01:55:05 +0100
Subject: If one is sitting on a child with an unset camera-eye and so using
one set in a root prim, the focus should remain on the root prim.
Matches behaviour just tested on the Linden grid.
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index f067f9d..17f54c2 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2755,15 +2755,19 @@ namespace OpenSim.Region.Framework.Scenes
cameraAtOffset = part.GetCameraAtOffset();
- if (cameraAtOffset == Vector3.Zero)
+ if (!part.IsRoot && cameraAtOffset == Vector3.Zero)
cameraAtOffset = part.ParentGroup.RootPart.GetCameraAtOffset();
+ bool cameraEyeOffsetFromRootForChild = false;
cameraEyeOffset = part.GetCameraEyeOffset();
- if (cameraEyeOffset == Vector3.Zero)
+ if (!part.IsRoot && cameraEyeOffset == Vector3.Zero)
+ {
cameraEyeOffset = part.ParentGroup.RootPart.GetCameraEyeOffset();
+ cameraEyeOffsetFromRootForChild = true;
+ }
- if (cameraEyeOffset != Vector3.Zero || cameraAtOffset != Vector3.Zero)
+ if ((cameraEyeOffset != Vector3.Zero && !cameraEyeOffsetFromRootForChild) || cameraAtOffset != Vector3.Zero)
{
if (!part.IsRoot)
{
--
cgit v1.1
From 72c67c50911e31937826314c825fdf13baa1cc28 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 23 May 2014 20:14:49 +0100
Subject: Fix possible infinite recursion in
MessageTransferModule.SendGridInstantMessageViaXMLRPCAsync() whilst
preserving retry lookup behaviour.
This is based on heavily mikemig's original patch in http://opensimulator.org/mantis/view.php?id=7149
but instead of exiting after the first IM delivery failure to presence information retrieved from the presence service
it will retry the lookup until the result matches the previous lookup.
This is to deal with the case where the agent is sent an IM whilst they are teleporting.
---
.../Avatar/InstantMessage/MessageTransferModule.cs | 164 +++++++--------------
1 file changed, 56 insertions(+), 108 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
index 7aa7123..2462ff8 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
@@ -428,7 +428,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
///
/// delegate for sending a grid instant message asynchronously
///
- public delegate void GridInstantMessageDelegate(GridInstantMessage im, MessageResultNotification result, UUID prevRegionID);
+ public delegate void GridInstantMessageDelegate(GridInstantMessage im, MessageResultNotification result);
protected virtual void GridInstantMessageCompleted(IAsyncResult iar)
{
@@ -442,138 +442,87 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
{
GridInstantMessageDelegate d = SendGridInstantMessageViaXMLRPCAsync;
- d.BeginInvoke(im, result, UUID.Zero, GridInstantMessageCompleted, d);
+ d.BeginInvoke(im, result, GridInstantMessageCompleted, d);
}
///
- /// Recursive SendGridInstantMessage over XMLRPC method.
- /// This is called from within a dedicated thread.
- /// The first time this is called, prevRegionHandle will be 0 Subsequent times this is called from
- /// itself, prevRegionHandle will be the last region handle that we tried to send.
- /// If the handles are the same, we look up the user's location using the grid.
- /// If the handles are still the same, we end. The send failed.
+ /// Internal SendGridInstantMessage over XMLRPC method.
///
- ///
- /// Pass in 0 the first time this method is called. It will be called recursively with the last
- /// regionhandle tried
- ///
- protected virtual void SendGridInstantMessageViaXMLRPCAsync(GridInstantMessage im, MessageResultNotification result, UUID prevRegionID)
+ ///
+ /// This is called from within a dedicated thread.
+ ///
+ private void SendGridInstantMessageViaXMLRPCAsync(GridInstantMessage im, MessageResultNotification result)
{
UUID toAgentID = new UUID(im.toAgentID);
-
- PresenceInfo upd = null;
-
- bool lookupAgent = false;
+ UUID regionID;
+ bool needToLookupAgent;
lock (m_UserRegionMap)
+ needToLookupAgent = !m_UserRegionMap.TryGetValue(toAgentID, out regionID);
+
+ while (true)
{
- if (m_UserRegionMap.ContainsKey(toAgentID))
+ if (needToLookupAgent)
{
- upd = new PresenceInfo();
- upd.RegionID = m_UserRegionMap[toAgentID];
+ PresenceInfo[] presences = PresenceService.GetAgents(new string[] { toAgentID.ToString() });
- // We need to compare the current regionhandle with the previous region handle
- // or the recursive loop will never end because it will never try to lookup the agent again
- if (prevRegionID == upd.RegionID)
- {
- lookupAgent = true;
- }
- }
- else
- {
- lookupAgent = true;
- }
- }
-
+ UUID foundRegionID = UUID.Zero;
- // Are we needing to look-up an agent?
- if (lookupAgent)
- {
- // Non-cached user agent lookup.
- PresenceInfo[] presences = PresenceService.GetAgents(new string[] { toAgentID.ToString() });
- if (presences != null && presences.Length > 0)
- {
- foreach (PresenceInfo p in presences)
+ if (presences != null)
{
- if (p.RegionID != UUID.Zero)
+ foreach (PresenceInfo p in presences)
{
- upd = p;
- break;
+ if (p.RegionID != UUID.Zero)
+ {
+ foundRegionID = p.RegionID;
+ break;
+ }
}
}
- }
- if (upd != null)
- {
- // check if we've tried this before..
- // This is one way to end the recursive loop
- //
- if (upd.RegionID == prevRegionID)
- {
- // m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message");
- HandleUndeliverableMessage(im, result);
- return;
- }
+ // If not found or the found region is the same as the last lookup, then message is undeliverable
+ if (foundRegionID == UUID.Zero || foundRegionID == regionID)
+ break;
+ else
+ regionID = foundRegionID;
}
- else
+
+ GridRegion reginfo = m_Scenes[0].GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, regionID);
+ if (reginfo == null)
{
- // m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message");
- HandleUndeliverableMessage(im, result);
- return;
+ m_log.WarnFormat("[GRID INSTANT MESSAGE]: Unable to find region {0}", regionID);
+ break;
}
- }
- if (upd != null)
- {
- GridRegion reginfo = m_Scenes[0].GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID,
- upd.RegionID);
- if (reginfo != null)
+ // Try to send the message to the agent via the retrieved region.
+ Hashtable msgdata = ConvertGridInstantMessageToXMLRPC(im);
+ msgdata["region_handle"] = 0;
+ bool imresult = doIMSending(reginfo, msgdata);
+
+ // If the message delivery was successful, then cache the entry.
+ if (imresult)
{
- Hashtable msgdata = ConvertGridInstantMessageToXMLRPC(im);
- // Not actually used anymore, left in for compatibility
- // Remove at next interface change
- //
- msgdata["region_handle"] = 0;
- bool imresult = doIMSending(reginfo, msgdata);
- if (imresult)
- {
- // IM delivery successful, so store the Agent's location in our local cache.
- lock (m_UserRegionMap)
- {
- if (m_UserRegionMap.ContainsKey(toAgentID))
- {
- m_UserRegionMap[toAgentID] = upd.RegionID;
- }
- else
- {
- m_UserRegionMap.Add(toAgentID, upd.RegionID);
- }
- }
- result(true);
- }
- else
+ lock (m_UserRegionMap)
{
- // try again, but lookup user this time.
- // Warning, this must call the Async version
- // of this method or we'll be making thousands of threads
- // The version within the spawned thread is SendGridInstantMessageViaXMLRPCAsync
- // The version that spawns the thread is SendGridInstantMessageViaXMLRPC
-
- // This is recursive!!!!!
- SendGridInstantMessageViaXMLRPCAsync(im, result,
- upd.RegionID);
+ m_UserRegionMap[toAgentID] = regionID;
}
+ result(true);
+ return;
}
- else
- {
- m_log.WarnFormat("[GRID INSTANT MESSAGE]: Unable to find region {0}", upd.RegionID);
- HandleUndeliverableMessage(im, result);
- }
- }
- else
- {
- HandleUndeliverableMessage(im, result);
+
+ // If we reach this point in the first iteration of the while, then we may have unsuccessfully tried
+ // to use a locally cached region ID. All subsequent attempts need to lookup agent details from
+ // the presence service.
+ needToLookupAgent = true;
}
+
+ // If we reached this point then the message was not deliverable. Remove the bad cache entry and
+ // signal the delivery failure.
+ lock (m_UserRegionMap)
+ m_UserRegionMap.Remove(toAgentID);
+
+ // m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message");
+ HandleUndeliverableMessage(im, result);
}
///
@@ -584,7 +533,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
/// Bool if the message was successfully delivered at the other side.
protected virtual bool doIMSending(GridRegion reginfo, Hashtable xmlrpcdata)
{
-
ArrayList SendParams = new ArrayList();
SendParams.Add(xmlrpcdata);
XmlRpcRequest GridReq = new XmlRpcRequest("grid_instant_message", SendParams);
--
cgit v1.1
From 250ea09328253422ff2a0e4877ee9968556328f0 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 23 May 2014 22:12:49 +0100
Subject: Reactivate regression test TestCastAndConcatString() in
CompilerTests.
---
.../ScriptEngine/Shared/CodeTools/Compiler.cs | 4 ++--
.../Shared/CodeTools/Tests/CompilerTest.cs | 24 ++++++++++++++--------
2 files changed, 18 insertions(+), 10 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
index b4640ef..1efe798 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
@@ -444,7 +444,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
// return compileScript;
// }
- private static string CreateCSCompilerScript(
+ public static string CreateCSCompilerScript(
string compileScript, string className, string baseClassName, ParameterInfo[] constructorParameters)
{
compileScript = string.Format(
@@ -472,7 +472,7 @@ namespace SecondLife
return compileScript;
}
- private static string CreateVBCompilerScript(string compileScript, string className, string baseClassName)
+ public static string CreateVBCompilerScript(string compileScript, string className, string baseClassName)
{
compileScript = String.Empty +
"Imports OpenSim.Region.ScriptEngine.Shared: Imports System.Collections.Generic: " +
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
index 05a8756..29b6006 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
@@ -31,6 +31,7 @@ using System.Collections.Generic;
using Microsoft.CSharp;
using NUnit.Framework;
using OpenSim.Region.ScriptEngine.Shared.CodeTools;
+using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
using OpenSim.Tests.Common;
namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
@@ -66,9 +67,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
m_CSCodeProvider = new CSharpCodeProvider();
m_compilerParameters = new CompilerParameters();
- string rootPath = Path.Combine(Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory), "bin");
+ string rootPath = Path.Combine(Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory));
m_compilerParameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Shared.dll"));
m_compilerParameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Shared.Api.Runtime.dll"));
+ m_compilerParameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenMetaverseTypes.dll"));
m_compilerParameters.GenerateExecutable = false;
}
@@ -112,6 +114,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
"public Script() { } " +
cg.Convert(input) +
"} }\n";
+
Dictionary, KeyValuePair> positionMap = cg.PositionMap;
m_compilerResults = m_CSCodeProvider.CompileAssemblyFromSource(m_compilerParameters, output);
@@ -124,7 +127,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
/// Test that a string can be cast to string and another string
/// concatenated.
///
- //[Test]
+ [Test]
public void TestCastAndConcatString()
{
TestHelpers.InMethod();
@@ -143,15 +146,20 @@ default
}
}";
+// System.Console.WriteLine(input);
CSCodeGenerator cg = new CSCodeGenerator();
- string output = "using OpenSim.Region.ScriptEngine.Shared; using System.Collections.Generic;\n" +
- "namespace SecondLife { " +
- "public class Script : OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass {\n" +
- "public Script() { } " +
- cg.Convert(input) +
- "} }\n";
+ string output = cg.Convert(input);
+
+ output = Compiler.CreateCSCompilerScript(output, "script1", typeof(ScriptBaseClass).FullName, null);
+// System.Console.WriteLine(output);
+
m_compilerResults = m_CSCodeProvider.CompileAssemblyFromSource(m_compilerParameters, output);
+// foreach (CompilerError compErr in m_compilerResults.Errors)
+// {
+// System.Console.WriteLine("Error: {0}", compErr);
+// }
+
Assert.AreEqual(0, m_compilerResults.Errors.Count);
}
}
--
cgit v1.1
From cf95b65c10c285b297257db492fbeb9dc19d1d4c Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 23 May 2014 22:29:47 +0100
Subject: Get regression test TestUseUndeclaredVariable() functional again,
though not yet enabled.
This reveals the position map problems and will make the fix (and subsequent continual checking) easier.
---
.../Shared/CodeTools/Tests/CompilerTest.cs | 27 +++++++++++++++-------
1 file changed, 19 insertions(+), 8 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
index 29b6006..ab68793 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
@@ -108,19 +108,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
}";
CSCodeGenerator cg = new CSCodeGenerator();
- string output = "using OpenSim.Region.ScriptEngine.Shared; using System.Collections.Generic;\n" +
- "namespace SecondLife { " +
- "public class Script : OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass {\n" +
- "public Script() { } " +
- cg.Convert(input) +
- "} }\n";
+ string output = cg.Convert(input);
+
+ output = Compiler.CreateCSCompilerScript(output, "script1", typeof(ScriptBaseClass).FullName, null);
+ System.Console.WriteLine(output);
Dictionary, KeyValuePair> positionMap = cg.PositionMap;
m_compilerResults = m_CSCodeProvider.CompileAssemblyFromSource(m_compilerParameters, output);
- Assert.AreEqual(new KeyValuePair(5, 21),
- positionMap[new KeyValuePair(m_compilerResults.Errors[0].Line, m_compilerResults.Errors[0].Column)]);
+ foreach (KeyValuePair key in positionMap.Keys)
+ {
+ KeyValuePair val = positionMap[key];
+
+ System.Console.WriteLine("{0},{1} => {2},{3}", key.Key, key.Value, val.Key, val.Value);
+ }
+
+ foreach (CompilerError compErr in m_compilerResults.Errors)
+ {
+ System.Console.WriteLine("Error: {0},{1} => {2}", compErr.Line, compErr.Column, compErr);
+ }
+
+ Assert.AreEqual(
+ new KeyValuePair(5, 21),
+ positionMap[new KeyValuePair(m_compilerResults.Errors[0].Line, m_compilerResults.Errors[0].Column)]);
}
///
--
cgit v1.1
From 9bae636ff0dc426e913e26c45b6936f16131f6d5 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 24 May 2014 00:12:23 +0100
Subject: Fix issues where reported LSL compiler error line numbers do not
match the script.
This is probably due to changes in the layout of the generated script preamble (using statements etc, ) in c8afc852 (Jan 17 2013).
Re-enabled existing regression test that exercises at least one case of this.
---
.../Shared/CodeTools/CSCodeGenerator.cs | 2 +-
.../Shared/CodeTools/Tests/CompilerTest.cs | 30 +++++++++++-----------
2 files changed, 16 insertions(+), 16 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs
index 6aa717d..8b8e038 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs
@@ -162,7 +162,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
m_braceCount++;
// line number
- m_CSharpLine += 3;
+ m_CSharpLine += 9;
// here's the payload
retstr += GenerateLine();
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
index ab68793..badf82a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
@@ -92,7 +92,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
/// Test the C# compiler error message can be mapped to the correct
/// line/column in the LSL source when an undeclared variable is used.
///
- //[Test]
+ [Test]
public void TestUseUndeclaredVariable()
{
TestHelpers.InMethod();
@@ -110,24 +110,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
CSCodeGenerator cg = new CSCodeGenerator();
string output = cg.Convert(input);
- output = Compiler.CreateCSCompilerScript(output, "script1", typeof(ScriptBaseClass).FullName, null);
- System.Console.WriteLine(output);
+ output = Compiler.CreateCSCompilerScript(output, "script1", typeof(ScriptBaseClass).FullName, null);
+// System.Console.WriteLine(output);
Dictionary, KeyValuePair> positionMap = cg.PositionMap;
m_compilerResults = m_CSCodeProvider.CompileAssemblyFromSource(m_compilerParameters, output);
-
- foreach (KeyValuePair key in positionMap.Keys)
- {
- KeyValuePair val = positionMap[key];
-
- System.Console.WriteLine("{0},{1} => {2},{3}", key.Key, key.Value, val.Key, val.Value);
- }
-
- foreach (CompilerError compErr in m_compilerResults.Errors)
- {
- System.Console.WriteLine("Error: {0},{1} => {2}", compErr.Line, compErr.Column, compErr);
- }
+//
+// foreach (KeyValuePair key in positionMap.Keys)
+// {
+// KeyValuePair val = positionMap[key];
+//
+// System.Console.WriteLine("{0},{1} => {2},{3}", key.Key, key.Value, val.Key, val.Value);
+// }
+//
+// foreach (CompilerError compErr in m_compilerResults.Errors)
+// {
+// System.Console.WriteLine("Error: {0},{1} => {2}", compErr.Line, compErr.Column, compErr);
+// }
Assert.AreEqual(
new KeyValuePair(5, 21),
--
cgit v1.1
From 20f20895cf1444071d5edc42e11a1fb94b1b1079 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Fri, 23 May 2014 16:19:43 -0700
Subject: Adds optional HTTP Basic Authentication to Robust service connectors.
---
OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs | 8 +++++---
OpenSim/Region/DataSnapshot/DataSnapshotManager.cs | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs b/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs
index af8a0c1..780d17b 100644
--- a/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs
@@ -37,6 +37,7 @@ using System.Collections.Generic;
using System.Reflection;
using log4net;
using OpenSim.Framework;
+using OpenSim.Framework.ServiceAuth;
using OpenSim.Framework.Communications;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
@@ -54,7 +55,7 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures
private string m_URL = String.Empty;
private static XmlSerializer m_serializer = new XmlSerializer(typeof(AssetBase));
-
+ private static IServiceAuth m_Auth;
public void Initialise(IConfigSource configSource)
{
@@ -63,6 +64,7 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures
return;
m_URL = config.GetString("URL", String.Empty);
+ m_Auth = ServiceAuth.Create(configSource, "XBakes");
}
public void AddRegion(Scene scene)
@@ -110,7 +112,7 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures
try
{
- Stream s = rc.Request();
+ Stream s = rc.Request(m_Auth);
XmlTextReader sr = new XmlTextReader(s);
sr.ReadStartElement("BakedAppearance");
@@ -183,7 +185,7 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures
Util.FireAndForget(
delegate
{
- rc.Request(reqStream);
+ rc.Request(reqStream, m_Auth);
}
);
}
diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs
index 0c0a7aa..4a06f6e 100644
--- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs
+++ b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs
@@ -381,7 +381,7 @@ namespace OpenSim.Region.DataSnapshot
cli.RequestMethod = "GET";
try
{
- reply = cli.Request();
+ reply = cli.Request(null);
}
catch (WebException)
{
--
cgit v1.1
From e68867c9b6efd72a72d158deab16484b37faab46 Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Sun, 25 May 2014 11:47:04 +0300
Subject: When taking an object into inventory, set the inventory item's "Next
Owner" permissions according to the permissions of the items in the object
---
.../Framework/InventoryAccess/InventoryAccessModule.cs | 10 ++++++++++
1 file changed, 10 insertions(+)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index c4a42bc..b4771fd 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -556,6 +556,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
if (remoteClient != null && (remoteClient.AgentId != so.RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions())
{
+ // Changing ownership, so apply the "Next Owner" permissions to all of the
+ // inventory item's permissions.
+
uint perms = effectivePerms;
PermissionsUtil.ApplyFoldedPermissions(effectivePerms, ref perms);
@@ -570,6 +573,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
}
else
{
+ // Not changing ownership.
+ // In this case we apply the permissions in the object's items ONLY to the inventory
+ // item's "Next Owner" permissions, but NOT to its "Current", "Base", etc. permissions.
+ // E.g., if the object contains a No-Transfer item then the item's "Next Owner"
+ // permissions are also No-Transfer.
+ PermissionsUtil.ApplyFoldedPermissions(effectivePerms, ref allObjectsNextOwnerPerms);
+
item.BasePermissions = effectivePerms;
item.CurrentPermissions = effectivePerms;
item.NextPermissions = allObjectsNextOwnerPerms & effectivePerms;
--
cgit v1.1
From 5aeaa7fcdd733181454095a50f077d203f674668 Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Sun, 25 May 2014 17:01:39 +0300
Subject: Prevent login to a region if the Telehub or Landing Point are in a
banned parcel
---
OpenSim/Region/Framework/Scenes/Scene.cs | 37 ++++++++++++++++++++++++++++----
1 file changed, 33 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 7005c0a..eff24f8 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3751,6 +3751,13 @@ namespace OpenSim.Region.Framework.Scenes
RegionInfo.RegionSettings.TelehubObject, acd.Name, Name);
}
+ // Final permissions check; this time we don't allow changing the position
+ if (!IsPositionAllowed(acd.AgentID, acd.startpos, ref reason))
+ {
+ m_authenticateHandler.RemoveCircuit(acd.circuitcode);
+ return false;
+ }
+
return true;
}
@@ -3760,6 +3767,13 @@ namespace OpenSim.Region.Framework.Scenes
if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero)
{
acd.startpos = land.LandData.UserLocation;
+
+ // Final permissions check; this time we don't allow changing the position
+ if (!IsPositionAllowed(acd.AgentID, acd.startpos, ref reason))
+ {
+ m_authenticateHandler.RemoveCircuit(acd.circuitcode);
+ return false;
+ }
}
}
}
@@ -3767,6 +3781,21 @@ namespace OpenSim.Region.Framework.Scenes
return true;
}
+ private bool IsPositionAllowed(UUID agentID, Vector3 pos, ref string reason)
+ {
+ ILandObject land = LandChannel.GetLandObject(pos);
+ if (land == null)
+ return true;
+
+ if (land.IsBannedFromLand(agentID) || land.IsRestrictedFromLand(agentID))
+ {
+ reason = "You are banned from the region.";
+ return false;
+ }
+
+ return true;
+ }
+
public bool TestLandRestrictions(UUID agentID, out string reason, ref float posX, ref float posY)
{
if (posX < 0)
@@ -5153,7 +5182,7 @@ namespace OpenSim.Region.Framework.Scenes
Vector3? nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel);
if (nearestPoint != null)
{
- Debug.WriteLine("Found a sane previous position based on velocity, sending them to: " + nearestPoint.ToString());
+ m_log.Debug("Found a sane previous position based on velocity, sending them to: " + nearestPoint.ToString());
return nearestPoint.Value;
}
@@ -5163,7 +5192,7 @@ namespace OpenSim.Region.Framework.Scenes
nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel);
if (nearestPoint != null)
{
- Debug.WriteLine("They had a zero velocity, sending them to: " + nearestPoint.ToString());
+ m_log.Debug("They had a zero velocity, sending them to: " + nearestPoint.ToString());
return nearestPoint.Value;
}
@@ -5172,7 +5201,7 @@ namespace OpenSim.Region.Framework.Scenes
{
// Ultimate backup if we have no idea where they are and
// the last allowed position was in another parcel
- Debug.WriteLine("Have no idea where they are, sending them to: " + avatar.lastKnownAllowedPosition.ToString());
+ m_log.Debug("Have no idea where they are, sending them to: " + avatar.lastKnownAllowedPosition.ToString());
return avatar.lastKnownAllowedPosition;
}
@@ -5182,7 +5211,7 @@ namespace OpenSim.Region.Framework.Scenes
//Go to the edge, this happens in teleporting to a region with no available parcels
Vector3 nearestRegionEdgePoint = GetNearestRegionEdgePosition(avatar);
- //Debug.WriteLine("They are really in a place they don't belong, sending them to: " + nearestRegionEdgePoint.ToString());
+ //m_log.Debug("They are really in a place they don't belong, sending them to: " + nearestRegionEdgePoint.ToString());
return nearestRegionEdgePoint;
}
--
cgit v1.1
From 33cc847c4ac78b890f8ac175c479ab1b1c56cbbf Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Mon, 26 May 2014 15:19:20 +0300
Subject: When saving an OAR in "Publish" mode, also discard Group information
---
.../CoreModules/World/Archiver/Tests/ArchiverTests.cs | 3 ++-
.../Framework/Scenes/Serialization/SceneObjectSerializer.cs | 13 ++++++++++---
2 files changed, 12 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
index e08a42d..b31257d 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
@@ -585,7 +585,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
ld.GlobalID = landID;
string ldPath = ArchiveConstants.CreateOarLandDataPath(ld);
- tar.WriteFile(ldPath, LandDataSerializer.Serialize(ld, null));
+ Dictionary options = new Dictionary();
+ tar.WriteFile(ldPath, LandDataSerializer.Serialize(ld, options));
tar.Close();
oarStream = new MemoryStream(oarStream.ToArray());
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 85650d6..e68f954 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -1343,7 +1343,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
writer.WriteElementString("SalePrice", sop.SalePrice.ToString());
writer.WriteElementString("ObjectSaleType", sop.ObjectSaleType.ToString());
writer.WriteElementString("OwnershipCost", sop.OwnershipCost.ToString());
- WriteUUID(writer, "GroupID", sop.GroupID, options);
+
+ UUID groupID = options.ContainsKey("wipe-owners") ? UUID.Zero : sop.GroupID;
+ WriteUUID(writer, "GroupID", groupID, options);
UUID ownerID = options.ContainsKey("wipe-owners") ? UUID.Zero : sop.OwnerID;
WriteUUID(writer, "OwnerID", ownerID, options);
@@ -1469,7 +1471,10 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
writer.WriteElementString("Description", item.Description);
writer.WriteElementString("EveryonePermissions", item.EveryonePermissions.ToString());
writer.WriteElementString("Flags", item.Flags.ToString());
- WriteUUID(writer, "GroupID", item.GroupID, options);
+
+ UUID groupID = options.ContainsKey("wipe-owners") ? UUID.Zero : item.GroupID;
+ WriteUUID(writer, "GroupID", groupID, options);
+
writer.WriteElementString("GroupPermissions", item.GroupPermissions.ToString());
writer.WriteElementString("InvType", item.InvType.ToString());
WriteUUID(writer, "ItemID", item.ItemID, options);
@@ -1490,7 +1495,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
WriteUUID(writer, "PermsGranter", item.PermsGranter, options);
writer.WriteElementString("PermsMask", item.PermsMask.ToString());
writer.WriteElementString("Type", item.Type.ToString());
- writer.WriteElementString("OwnerChanged", item.OwnerChanged.ToString().ToLower());
+
+ bool ownerChanged = options.ContainsKey("wipe-owners") ? false : item.OwnerChanged;
+ writer.WriteElementString("OwnerChanged", ownerChanged.ToString().ToLower());
writer.WriteEndElement(); // TaskInventoryItem
}
--
cgit v1.1
From d2877b9cd4749dd02c0040480db4f0a32b5fb17d Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Mon, 26 May 2014 10:28:31 -0700
Subject: Don't report NPC presences.
---
.../CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs
index 516ad40..50c252c 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs
@@ -69,7 +69,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
public void OnMakeRootAgent(ScenePresence sp)
{
// m_log.DebugFormat("[PRESENCE DETECTOR]: Detected root presence {0} in {1}", sp.UUID, sp.Scene.RegionInfo.RegionName);
- m_PresenceService.ReportAgent(sp.ControllingClient.SessionId, sp.Scene.RegionInfo.RegionID);
+ if (sp.PresenceType != PresenceType.Npc)
+ m_PresenceService.ReportAgent(sp.ControllingClient.SessionId, sp.Scene.RegionInfo.RegionID);
}
public void OnNewClient(IClientAPI client)
--
cgit v1.1
From fab0389cb17cd74e47156c58b52dd62b098c8494 Mon Sep 17 00:00:00 2001
From: Robert Adams
Date: Mon, 26 May 2014 20:29:45 -0700
Subject: BulletSim: add locking of PhysObjects while processing simulation
step updates and collisions. This is an attempt to fix a crash reported by
Justin when doing high velocity teleports.
---
OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 34 +++++++++++++++----------
1 file changed, 20 insertions(+), 14 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index 9fa55ce..23bada9 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -639,15 +639,18 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
{
if (collidersCount > 0)
{
- for (int ii = 0; ii < collidersCount; ii++)
+ lock (PhysObjects)
{
- uint cA = m_collisionArray[ii].aID;
- uint cB = m_collisionArray[ii].bID;
- Vector3 point = m_collisionArray[ii].point;
- Vector3 normal = m_collisionArray[ii].normal;
- float penetration = m_collisionArray[ii].penetration;
- SendCollision(cA, cB, point, normal, penetration);
- SendCollision(cB, cA, point, -normal, penetration);
+ for (int ii = 0; ii < collidersCount; ii++)
+ {
+ uint cA = m_collisionArray[ii].aID;
+ uint cB = m_collisionArray[ii].bID;
+ Vector3 point = m_collisionArray[ii].point;
+ Vector3 normal = m_collisionArray[ii].normal;
+ float penetration = m_collisionArray[ii].penetration;
+ SendCollision(cA, cB, point, normal, penetration);
+ SendCollision(cB, cA, point, -normal, penetration);
+ }
}
}
}
@@ -658,14 +661,17 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
{
if (updatedEntityCount > 0)
{
- for (int ii = 0; ii < updatedEntityCount; ii++)
+ lock (PhysObjects)
{
- EntityProperties entprop = m_updateArray[ii];
- BSPhysObject pobj;
- if (PhysObjects.TryGetValue(entprop.ID, out pobj))
+ for (int ii = 0; ii < updatedEntityCount; ii++)
{
- if (pobj.IsInitialized)
- pobj.UpdateProperties(entprop);
+ EntityProperties entprop = m_updateArray[ii];
+ BSPhysObject pobj;
+ if (PhysObjects.TryGetValue(entprop.ID, out pobj))
+ {
+ if (pobj.IsInitialized)
+ pobj.UpdateProperties(entprop);
+ }
}
}
}
--
cgit v1.1
From e19c830a6cc3e9bf20bcd5208563628923689184 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Tue, 27 May 2014 10:13:24 -0700
Subject: Fixes a bug where map search results pertaining to varregions would
only send the SW-most corner of the varregions; the other areas, when
clicked, would result a blue circle, meaning that the viewer didn't know
about those areas. This is still not quite right, as all the areas appear to
be in the same coordinates, but it's good enough for now.
---
.../CoreModules/World/WorldMap/MapSearchModule.cs | 44 +++++++++++++---------
.../CoreModules/World/WorldMap/WorldMapModule.cs | 4 +-
.../Region/Framework/Interfaces/IWorldMapModule.cs | 5 +++
3 files changed, 33 insertions(+), 20 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
index 1437b1b..de7ea6d 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
@@ -49,6 +49,18 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
List m_scenes = new List();
List m_Clients;
+ IWorldMapModule m_WorldMap;
+ IWorldMapModule WorldMap
+ {
+ get
+ {
+ if (m_WorldMap == null)
+ m_WorldMap = m_scene.RequestModuleInterface();
+ return m_WorldMap;
+ }
+
+ }
+
#region ISharedRegionModule Members
public void Initialise(IConfigSource source)
{
@@ -64,6 +76,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
m_scenes.Add(scene);
scene.EventManager.OnNewClient += OnNewClient;
m_Clients = new List();
+
}
public void RemoveRegion(Scene scene)
@@ -129,7 +142,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
private void OnMapNameRequest(IClientAPI remoteClient, string mapName, uint flags)
{
List blocks = new List();
- MapBlockData data;
if (mapName.Length < 3 || (mapName.EndsWith("#") && mapName.Length < 4))
{
// final block, closing the search result
@@ -173,24 +185,20 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
{
foreach (GridRegion info in regionInfos)
{
- data = new MapBlockData();
- data.Agents = 0;
- data.Access = info.Access;
- if (flags == 2) // V2 sends this
- data.MapImageId = UUID.Zero;
- else
- data.MapImageId = info.TerrainImage;
- // ugh! V2-3 is very sensitive about the result being
- // exactly the same as the requested name
- if (regionInfos.Count == 1 && (mapName != mapNameOrig))
- data.Name = mapNameOrig;
+ if ((flags & 2) == 2) // V2 sends this
+ {
+ List datas = WorldMap.Map2BlockFromGridRegion(info, flags);
+ // ugh! V2-3 is very sensitive about the result being
+ // exactly the same as the requested name
+ if (regionInfos.Count == 1 && (mapName != mapNameOrig))
+ datas.ForEach(d => d.Name = mapNameOrig);
+
+ blocks.AddRange(datas);
+ }
else
- data.Name = info.RegionName;
- data.RegionFlags = 0; // TODO not used?
- data.WaterHeight = 0; // not used
- data.X = (ushort)Util.WorldToRegionLoc((uint)info.RegionLocX);
- data.Y = (ushort)Util.WorldToRegionLoc((uint)info.RegionLocY);
- blocks.Add(data);
+ {
+ MapBlockData data = WorldMap.MapBlockFromGridRegion(info, flags);
+ }
}
}
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index a3b0f39..b98afbc 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -1064,7 +1064,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
}
// Fill a passed MapBlockData from a GridRegion
- protected MapBlockData MapBlockFromGridRegion(GridRegion r, uint flag)
+ public MapBlockData MapBlockFromGridRegion(GridRegion r, uint flag)
{
MapBlockData block = new MapBlockData();
@@ -1090,7 +1090,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
return block;
}
- protected List Map2BlockFromGridRegion(GridRegion r, uint flag)
+ public List Map2BlockFromGridRegion(GridRegion r, uint flag)
{
List blocks = new List();
MapBlockData block = new MapBlockData();
diff --git a/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs b/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs
index 65c57a6..9c781e1 100644
--- a/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs
@@ -24,6 +24,9 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+using System.Collections.Generic;
+using OpenSim.Framework;
+using OpenSim.Services.Interfaces;
namespace OpenSim.Region.Framework.Interfaces
{
@@ -33,5 +36,7 @@ namespace OpenSim.Region.Framework.Interfaces
/// Generate a map tile for the scene. a terrain texture for this scene
///
void GenerateMaptile();
+ List Map2BlockFromGridRegion(GridRegion r, uint flag);
+ MapBlockData MapBlockFromGridRegion(GridRegion r, uint flag);
}
}
--
cgit v1.1
From d131c5797818f33a02acc2c98b096d51935fc963 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 27 May 2014 18:11:01 +0100
Subject: Update regression TestInventoryDescendentsFetch() to account for
recent commit 1fa3a6f
This was hidden in continuous integration because of another regression test issue.
---
.../Region/ClientStack/Linden/Caps/Tests/WebFetchInvDescModuleTests.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/Tests/WebFetchInvDescModuleTests.cs b/OpenSim/Region/ClientStack/Linden/Caps/Tests/WebFetchInvDescModuleTests.cs
index edc5016..ee1ea1a 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/Tests/WebFetchInvDescModuleTests.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/Tests/WebFetchInvDescModuleTests.cs
@@ -152,7 +152,7 @@ namespace OpenSim.Region.ClientStack.Linden.Caps.Tests
// A sanity check that the response has the expected number of descendents for a default inventory
// TODO: Need a more thorough check.
- Assert.That((int)folderOsd["descendents"], Is.EqualTo(14));
+ Assert.That((int)folderOsd["descendents"], Is.EqualTo(16));
}
}
}
\ No newline at end of file
--
cgit v1.1
From bcaacb4e41f10f4ebadc25d4aef98d60fe970770 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 27 May 2014 18:19:08 +0100
Subject: Temporarily print regression TestCastAndConcatString() script compile
errors out to console to get a handle on what's going wrong.
Does not fail for me locally and I failed to notice this test was failing on Jenkins.
---
.../Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
index badf82a..3647467 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
@@ -166,10 +166,11 @@ default
m_compilerResults = m_CSCodeProvider.CompileAssemblyFromSource(m_compilerParameters, output);
-// foreach (CompilerError compErr in m_compilerResults.Errors)
-// {
-// System.Console.WriteLine("Error: {0}", compErr);
-// }
+ System.Console.WriteLine("ERRORS: {0}", m_compilerResults.Errors.Count);
+ foreach (CompilerError compErr in m_compilerResults.Errors)
+ {
+ System.Console.WriteLine("Error: {0}", compErr);
+ }
Assert.AreEqual(0, m_compilerResults.Errors.Count);
}
--
cgit v1.1
From 394ec508f6b0b8c2731448d49cafedaaded273b7 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 27 May 2014 18:37:16 +0100
Subject: Make CompilerTest add same AssemblyResolver as XEngine to see if this
solves the issue with different AppDomain BaseDirectory in local and Jenkins
test runs
---
.../Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
index 3647467..75b7244 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
@@ -25,6 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+using System;
using System.IO;
using System.CodeDom.Compiler;
using System.Collections.Generic;
@@ -67,7 +68,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
m_CSCodeProvider = new CSharpCodeProvider();
m_compilerParameters = new CompilerParameters();
- string rootPath = Path.Combine(Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory));
+ string rootPath = System.AppDomain.CurrentDomain.BaseDirectory;
+
+ System.AppDomain.CurrentDomain.AssemblyResolve +=
+ new ResolveEventHandler(
+ AssemblyResolver.OnAssemblyResolve);
+
m_compilerParameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Shared.dll"));
m_compilerParameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Shared.Api.Runtime.dll"));
m_compilerParameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenMetaverseTypes.dll"));
--
cgit v1.1
From 5622cf68aad44d710648e63e879e597fd12402f6 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 27 May 2014 18:47:25 +0100
Subject: In compiler tests, remove the ResolveEventHandlers after test exit
---
.../Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
index 75b7244..713b280 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
@@ -49,6 +49,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
private CSharpCodeProvider m_CSCodeProvider;
private CompilerParameters m_compilerParameters;
private CompilerResults m_compilerResults;
+ private ResolveEventHandler m_resolveEventHandler;
///
/// Creates a temporary directory where build artifacts are stored.
@@ -70,10 +71,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
string rootPath = System.AppDomain.CurrentDomain.BaseDirectory;
- System.AppDomain.CurrentDomain.AssemblyResolve +=
- new ResolveEventHandler(
- AssemblyResolver.OnAssemblyResolve);
+ m_resolveEventHandler = new ResolveEventHandler(AssemblyResolver.OnAssemblyResolve);
+ System.AppDomain.CurrentDomain.AssemblyResolve += m_resolveEventHandler;
+
m_compilerParameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Shared.dll"));
m_compilerParameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Shared.Api.Runtime.dll"));
m_compilerParameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenMetaverseTypes.dll"));
@@ -87,6 +88,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
[TestFixtureTearDown]
public void CleanUp()
{
+ System.AppDomain.CurrentDomain.AssemblyResolve -= m_resolveEventHandler;
+
if (Directory.Exists(m_testDir))
{
// Blow away the temporary directory with artifacts.
--
cgit v1.1
From 9ca86664bb6cd09e2f619ab882aaca30c08dc379 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 27 May 2014 23:15:50 +0100
Subject: Make RegionReady login disabled during initialization message a
console messages instead of a warning message.
Same justification as earlier commit 996a6c2. These are not warnings but should still be visible to the user at any log level.
---
.../Scripting/RegionReadyModule/RegionReadyModule.cs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
index d059b97..870c0bb 100644
--- a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
@@ -105,8 +105,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
m_scene.LoginLock = true;
m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue;
- // Warn level because the region cannot be used while logins are disabled
- m_log.WarnFormat("[RegionReady]: Region {0} - LOGINS DISABLED DURING INITIALIZATION.", m_scene.Name);
+ // This should always show up to the user but should not trigger warn/errors as these messages are
+ // expected and are not simulator problems. Ideally, there would be a status level in log4net but
+ // failing that, we will print out to console instead.
+ MainConsole.Instance.OutputFormat("Region {0} - LOGINS DISABLED DURING INITIALIZATION.", m_scene.Name);
if (m_uri != string.Empty)
{
--
cgit v1.1