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')
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
---
.../Servers/HttpServer/JsonRpcRequestManager.cs | 24 +++++++++++-----------
.../Avatar/UserProfiles/UserProfileModule.cs | 9 ++++++++
2 files changed, 21 insertions(+), 12 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Framework/Servers/HttpServer/JsonRpcRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/JsonRpcRequestManager.cs
index ed6a14c..2fe1a7d 100644
--- a/OpenSim/Framework/Servers/HttpServer/JsonRpcRequestManager.cs
+++ b/OpenSim/Framework/Servers/HttpServer/JsonRpcRequestManager.cs
@@ -90,14 +90,14 @@ namespace OpenSim.Framework.Servers.HttpServer
}
catch (Exception e)
{
- m_log.Debug(string.Format("JsonRpc request '{0}' failed", method), e);
+ m_log.Debug(string.Format("JsonRpc request '{0}' to {1} failed", method, uri), e);
return false;
}
if (!response.ContainsKey("_Result"))
{
- m_log.DebugFormat("JsonRpc request '{0}' returned an invalid response: {1}",
- method, OSDParser.SerializeJsonString(response));
+ m_log.DebugFormat("JsonRpc request '{0}' to {1} returned an invalid response: {2}",
+ method, uri, OSDParser.SerializeJsonString(response));
return false;
}
response = (OSDMap)response["_Result"];
@@ -107,15 +107,15 @@ namespace OpenSim.Framework.Servers.HttpServer
if (response.ContainsKey("error"))
{
data = response["error"];
- m_log.DebugFormat("JsonRpc request '{0}' returned an error: {1}",
- method, OSDParser.SerializeJsonString(data));
+ m_log.DebugFormat("JsonRpc request '{0}' to {1} returned an error: {2}",
+ method, uri, OSDParser.SerializeJsonString(data));
return false;
}
if (!response.ContainsKey("result"))
{
- m_log.DebugFormat("JsonRpc request '{0}' returned an invalid response: {1}",
- method, OSDParser.SerializeJsonString(response));
+ m_log.DebugFormat("JsonRpc request '{0}' to {1} returned an invalid response: {2}",
+ method, uri, OSDParser.SerializeJsonString(response));
return false;
}
@@ -161,14 +161,14 @@ namespace OpenSim.Framework.Servers.HttpServer
}
catch (Exception e)
{
- m_log.Debug(string.Format("JsonRpc request '{0}' failed", method), e);
+ m_log.Debug(string.Format("JsonRpc request '{0}' to {1} failed", method, uri), e);
return false;
}
if (!response.ContainsKey("_Result"))
{
- m_log.DebugFormat("JsonRpc request '{0}' returned an invalid response: {1}",
- method, OSDParser.SerializeJsonString(response));
+ m_log.DebugFormat("JsonRpc request '{0}' to {1} returned an invalid response: {2}",
+ method, uri, OSDParser.SerializeJsonString(response));
return false;
}
response = (OSDMap)response["_Result"];
@@ -176,8 +176,8 @@ namespace OpenSim.Framework.Servers.HttpServer
if (response.ContainsKey("error"))
{
data = response["error"];
- m_log.DebugFormat("JsonRpc request '{0}' returned an error: {1}",
- method, OSDParser.SerializeJsonString(data));
+ m_log.DebugFormat("JsonRpc request '{0}' to {1} returned an error: {2}",
+ method, uri, OSDParser.SerializeJsonString(data));
return false;
}
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 ++++++++--
.../AuthorizationServicesConnector.cs | 2 +-
4 files changed, 36 insertions(+), 17 deletions(-)
(limited to 'OpenSim')
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;
diff --git a/OpenSim/Services/Connectors/Authorization/AuthorizationServicesConnector.cs b/OpenSim/Services/Connectors/Authorization/AuthorizationServicesConnector.cs
index 35b7109..63730b3 100644
--- a/OpenSim/Services/Connectors/Authorization/AuthorizationServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Authorization/AuthorizationServicesConnector.cs
@@ -105,7 +105,7 @@ namespace OpenSim.Services.Connectors
catch (Exception e)
{
m_log.WarnFormat("[AUTHORIZATION CONNECTOR]: Unable to send authorize {0} for region {1} error thrown during comms with remote server. Reason: {2}", userID, regionID, e.Message);
- message = "";
+ message = e.Message;
return m_ResponseOnFailure;
}
if (response == null)
--
cgit v1.1
From 78733b979fa2f34ef0a0066fc019cb698239e9f5 Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Sun, 18 May 2014 18:52:57 +0300
Subject: Log the user when an inventory operation is blocked because the
item/folder isn't in the Suitcase
---
.../HypergridService/HGSuitcaseInventoryService.cs | 28 +++++++++++-----------
1 file changed, 14 insertions(+), 14 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs
index 4416995..649e66c 100644
--- a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs
+++ b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs
@@ -249,7 +249,7 @@ namespace OpenSim.Services.HypergridService
if (!IsWithinSuitcaseTree(principalID, folderID))
{
- m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: GetFolderContent: folder {0} is not within Suitcase tree", folderID);
+ m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: GetFolderContent: folder {0} (user {1}) is not within Suitcase tree", folderID, principalID);
return new InventoryCollection();
}
@@ -269,7 +269,7 @@ namespace OpenSim.Services.HypergridService
// make sure the given folder exists under the suitcase tree of this user
if (!IsWithinSuitcaseTree(principalID, folderID))
{
- m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: GetFolderItems: folder {0} is not within Suitcase tree", folderID);
+ m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: GetFolderItems: folder {0} (user {1}) is not within Suitcase tree", folderID, principalID);
return new List();
}
@@ -284,7 +284,7 @@ namespace OpenSim.Services.HypergridService
if (!IsWithinSuitcaseTree(folder.Owner, folder.ParentID))
{
- m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: AddFolder: folder {0} is not within Suitcase tree", folder.ParentID);
+ m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: AddFolder: folder {0} (user {1}) is not within Suitcase tree", folder.ParentID, folder.Owner);
return false;
}
@@ -306,7 +306,7 @@ namespace OpenSim.Services.HypergridService
//m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Update folder {0}, version {1}", folder.ID, folder.Version);
if (!IsWithinSuitcaseTree(folder.Owner, folder.ID))
{
- m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: UpdateFolder: folder {0}/{1} is not within Suitcase tree", folder.Name, folder.ID);
+ m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: UpdateFolder: folder {0}/{1} (user {2}) is not within Suitcase tree", folder.Name, folder.ID, folder.Owner);
return false;
}
@@ -318,13 +318,13 @@ namespace OpenSim.Services.HypergridService
{
if (!IsWithinSuitcaseTree(folder.Owner, folder.ID))
{
- m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: MoveFolder: folder {0} is not within Suitcase tree", folder.ID);
+ m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: MoveFolder: folder {0} (user {1}) is not within Suitcase tree", folder.ID, folder.Owner);
return false;
}
if (!IsWithinSuitcaseTree(folder.Owner, folder.ParentID))
{
- m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: MoveFolder: folder {0} is not within Suitcase tree", folder.ParentID);
+ m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: MoveFolder: folder {0} (user {1}) is not within Suitcase tree", folder.ParentID, folder.Owner);
return false;
}
@@ -349,7 +349,7 @@ namespace OpenSim.Services.HypergridService
// make sure the given folder's parent folder exists under the suitcase tree of this user
if (!IsWithinSuitcaseTree(item.Owner, item.Folder))
{
- m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: AddItem: folder {0} is not within Suitcase tree", item.Folder);
+ m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: AddItem: folder {0} (user {1}) is not within Suitcase tree", item.Folder, item.Owner);
return false;
}
@@ -362,7 +362,7 @@ namespace OpenSim.Services.HypergridService
{
if (!IsWithinSuitcaseTree(item.Owner, item.Folder))
{
- m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: UpdateItem: folder {0} is not within Suitcase tree", item.Folder);
+ m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: UpdateItem: folder {0} (user {1}) is not within Suitcase tree", item.Folder, item.Owner);
return false;
}
@@ -378,7 +378,7 @@ namespace OpenSim.Services.HypergridService
{
if (!IsWithinSuitcaseTree(item.Owner, item.Folder))
{
- m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: MoveItems: folder {0} is not within Suitcase tree", item.Folder);
+ m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: MoveItems: folder {0} (user {1}) is not within Suitcase tree", item.Folder, item.Owner);
return false;
}
}
@@ -389,7 +389,7 @@ namespace OpenSim.Services.HypergridService
InventoryItemBase originalItem = base.GetItem(item);
if (!IsWithinSuitcaseTree(originalItem.Owner, originalItem.Folder))
{
- m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: MoveItems: folder {0} is not within Suitcase tree", originalItem.Folder);
+ m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: MoveItems: folder {0} (user {1}) is not within Suitcase tree", item.Folder, item.Owner);
return false;
}
}
@@ -414,8 +414,8 @@ namespace OpenSim.Services.HypergridService
if (!IsWithinSuitcaseTree(it.Owner, it.Folder) && !IsPartOfAppearance(it.Owner, it.ID))
{
- m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Item {0}/{1} (folder {2}) is not within Suitcase tree or Appearance",
- it.Name, it.ID, it.Folder);
+ m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: GetItem: item {0}/{1} (folder {2}) (user {3}) is not within Suitcase tree or Appearance",
+ it.Name, it.ID, it.Folder, it.Owner);
return null;
}
@@ -437,8 +437,8 @@ namespace OpenSim.Services.HypergridService
{
if (!IsWithinSuitcaseTree(f.Owner, f.ID))
{
- m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Folder {0}/{1} is not within Suitcase tree",
- f.Name, f.ID);
+ m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: GetFolder: folder {0}/{1} (user {2}) is not within Suitcase tree",
+ f.Name, f.ID, f.Owner);
return null;
}
}
--
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 ++--
OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 6 +++++-
.../Services/Connectors/Simulation/SimulationServiceConnector.cs | 3 ++-
OpenSim/Services/Interfaces/ISimulationService.cs | 3 ++-
7 files changed, 18 insertions(+), 12 deletions(-)
(limited to 'OpenSim')
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)
{
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index 06392f7..7291931 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -132,6 +132,10 @@ namespace OpenSim.Server.Handlers.Simulation
// m_log.DebugFormat("[AGENT HANDLER]: Received QUERYACCESS with {0}", (string)request["body"]);
OSDMap args = Utils.GetOSDMap((string)request["body"]);
+ bool viaTeleport = true;
+ if (args.ContainsKey("viaTeleport"))
+ viaTeleport = args["viaTeleport"].AsBoolean();
+
Vector3 position = Vector3.Zero;
if (args.ContainsKey("position"))
position = Vector3.Parse(args["position"].AsString());
@@ -145,7 +149,7 @@ namespace OpenSim.Server.Handlers.Simulation
string reason;
string version;
- bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, position, out version, out reason);
+ bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, out version, out reason);
responsedata["int_response_code"] = HttpStatusCode.OK;
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index d9fe5a0..099ba98 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -282,7 +282,7 @@ namespace OpenSim.Services.Connectors.Simulation
}
- 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 = "Failed to contact destination";
version = "Unknown";
@@ -296,6 +296,7 @@ namespace OpenSim.Services.Connectors.Simulation
string uri = destination.ServerURI + AgentPath() + agentID + "/" + destination.RegionID.ToString() + "/";
OSDMap request = new OSDMap();
+ request.Add("viaTeleport", OSD.FromBoolean(viaTeleport));
request.Add("position", OSD.FromString(position.ToString()));
if (agentHomeURI != null)
request.Add("agent_home_uri", OSD.FromString(agentHomeURI));
diff --git a/OpenSim/Services/Interfaces/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs
index 375a35c..8b87ac0 100644
--- a/OpenSim/Services/Interfaces/ISimulationService.cs
+++ b/OpenSim/Services/Interfaces/ISimulationService.cs
@@ -83,11 +83,12 @@ namespace OpenSim.Services.Interfaces
/// Desired destination
/// The visitor's User ID
/// The visitor's Home URI. Will be missing (null) in older OpenSims.
+ /// True: via teleport; False: via cross (walking)
/// Position in the region
///
/// [out] Optional error message
/// True: ok; False: not allowed
- bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, Vector3 position, out string version, out string reason);
+ bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, out string version, out string reason);
///
/// Message from receiving region to departing region, telling it got contacted by the client.
--
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 +++++--
.../Avatar/XmlRpcGroups/GroupsModule.cs | 15 +++++++++++++-
.../Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs | 9 +++++++-
.../Common/Mock/MockGroupsServicesConnector.cs | 24 +++++++++++++++++++++-
4 files changed, 50 insertions(+), 5 deletions(-)
(limited to 'OpenSim')
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));
}
diff --git a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs
index b3f8c36..5a257e9 100644
--- a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs
+++ b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs
@@ -324,7 +324,29 @@ namespace OpenSim.Tests.Common.Mock
public List GetGroupNotices(UUID requestingAgentID, UUID groupID)
{
- return null;
+ XGroup group = GetXGroup(groupID, null);
+
+ if (group == null)
+ return null;
+
+ List notices = new List();
+
+ foreach (XGroupNotice notice in group.notices.Values)
+ {
+ GroupNoticeData gnd = new GroupNoticeData()
+ {
+ NoticeID = notice.noticeID,
+ Timestamp = notice.timestamp,
+ FromName = notice.fromName,
+ Subject = notice.subject,
+ HasAttachment = notice.hasAttachment,
+ AssetType = (byte)notice.assetType
+ };
+
+ notices.Add(gnd);
+ }
+
+ return notices;
}
public GroupNoticeInfo GetGroupNotice(UUID requestingAgentID, UUID noticeID)
--
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.
---
OpenSim/Addons/Groups/GroupsMessagingModule.cs | 34 ++++++-
.../Avatar/XmlRpcGroups/GroupsMessagingModule.cs | 100 ++++++++++++++++-----
2 files changed, 108 insertions(+), 26 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Addons/Groups/GroupsMessagingModule.cs b/OpenSim/Addons/Groups/GroupsMessagingModule.cs
index bbb5e05..bd8db32 100644
--- a/OpenSim/Addons/Groups/GroupsMessagingModule.cs
+++ b/OpenSim/Addons/Groups/GroupsMessagingModule.cs
@@ -56,8 +56,8 @@ namespace OpenSim.Groups
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.
@@ -120,7 +120,7 @@ namespace OpenSim.Groups
return;
}
- m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", true);
+ m_debugEnabled = groupsConfig.GetBoolean("MessagingDebugEnabled", m_debugEnabled);
m_log.InfoFormat(
"[Groups.Messaging]: GroupsMessagingModule enabled with MessageOnlineOnly = {0}, DebugEnabled = {1}",
@@ -140,6 +140,14 @@ namespace OpenSim.Groups
scene.EventManager.OnMakeChildAgent += OnMakeChildAgent;
scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
scene.EventManager.OnClientLogin += OnClientLogin;
+
+ 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)
@@ -227,6 +235,26 @@ namespace OpenSim.Groups
#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.
///
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
---
OpenSim/Addons/Groups/GroupsMessagingModule.cs | 4 ++--
.../OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Addons/Groups/GroupsMessagingModule.cs b/OpenSim/Addons/Groups/GroupsMessagingModule.cs
index bd8db32..e6a4765 100644
--- a/OpenSim/Addons/Groups/GroupsMessagingModule.cs
+++ b/OpenSim/Addons/Groups/GroupsMessagingModule.cs
@@ -283,6 +283,8 @@ namespace OpenSim.Groups
public void SendMessageToGroup(
GridInstantMessage im, UUID groupID, UUID sendingAgentForGroupCalls, Func sendCondition)
{
+ int requestStartTick = Environment.TickCount;
+
UUID fromAgentID = new UUID(im.fromAgentID);
// Unlike current XmlRpcGroups, Groups V2 can accept UUID.Zero when a perms check for the requesting agent
@@ -315,8 +317,6 @@ namespace OpenSim.Groups
// "[Groups.Messaging]: SendMessageToGroup called for group {0} with {1} visible members, {2} online",
// groupID, groupMembersCount, groupMembers.Count());
- int requestStartTick = Environment.TickCount;
-
im.imSessionID = groupID.Guid;
im.fromGroup = true;
IClientAPI thisClient = GetActiveClient(fromAgentID);
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')
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')
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')
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')
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')
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 251b93d97eb6d8d56c4deb1f6f56dbe2092c2976 Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Wed, 21 May 2014 19:05:20 +0300
Subject: Store the Teleport Flags in the Circuit. This doesn't seem to be
necessary, because everything has worked so far, but it's the right thing to
do.
---
OpenSim/Framework/AgentCircuitData.cs | 2 ++
1 file changed, 2 insertions(+)
(limited to 'OpenSim')
diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs
index f2fe494..0d053e4 100644
--- a/OpenSim/Framework/AgentCircuitData.cs
+++ b/OpenSim/Framework/AgentCircuitData.cs
@@ -321,6 +321,8 @@ namespace OpenSim.Framework
Mac = args["mac"].AsString();
if (args["id0"] != null)
Id0 = args["id0"].AsString();
+ if (args["teleport_flags"] != null)
+ teleportFlags = args["teleport_flags"].AsUInteger();
if (args["start_pos"] != null)
Vector3.TryParse(args["start_pos"].AsString(), out startpos);
--
cgit v1.1
From 04aa13a086239b8d628821809bef9c9585c35f8f Mon Sep 17 00:00:00 2001
From: AliciaRaven
Date: Thu, 22 May 2014 00:51:33 +0100
Subject: Fix mantis 6973. Prevent BOM being prefixed to message XML which was
causing an exception when the service tried to read the data later on.
Signed-off-by: Oren Hurvitz
---
OpenSim/Addons/OfflineIM/Service/OfflineIMService.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Addons/OfflineIM/Service/OfflineIMService.cs b/OpenSim/Addons/OfflineIM/Service/OfflineIMService.cs
index 690c955..02084ff 100644
--- a/OpenSim/Addons/OfflineIM/Service/OfflineIMService.cs
+++ b/OpenSim/Addons/OfflineIM/Service/OfflineIMService.cs
@@ -104,7 +104,7 @@ namespace OpenSim.OfflineIM
using (MemoryStream mstream = new MemoryStream())
{
XmlWriterSettings settings = new XmlWriterSettings();
- settings.Encoding = Encoding.UTF8;
+ settings.Encoding = Util.UTF8NoBomEncoding;
using (XmlWriter writer = XmlWriter.Create(mstream, settings))
{
@@ -112,7 +112,7 @@ namespace OpenSim.OfflineIM
writer.Flush();
}
- imXml = Util.UTF8.GetString(mstream.ToArray());
+ imXml = Util.UTF8NoBomEncoding.GetString(mstream.ToArray());
}
OfflineIMData data = new OfflineIMData();
--
cgit v1.1