From 69666be28c5700b94be54d6165c9f59d681a4f4f Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 13 Jan 2011 16:05:17 +0100
Subject: Implement kicking, freezing and unfreezing users in the same sim via
profile god buttons.
---
.../Region/CoreModules/Avatar/Gods/GodsModule.cs | 175 ++++++++++++++-------
1 file changed, 117 insertions(+), 58 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
index 5ec64d5..9fd3318 100644
--- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
@@ -31,16 +31,40 @@ using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Interfaces;
+using System;
+using System.Reflection;
+using System.Collections;
+using System.Collections.Specialized;
+using System.Reflection;
+using System.IO;
+using System.Web;
+using System.Xml;
+using log4net;
+using Mono.Addins;
+using OpenMetaverse.Messages.Linden;
+using OpenMetaverse.StructuredData;
+using OpenSim.Framework.Capabilities;
+using OpenSim.Framework.Servers;
+using OpenSim.Framework.Servers.HttpServer;
+using Caps = OpenSim.Framework.Capabilities.Caps;
+using OSDArray = OpenMetaverse.StructuredData.OSDArray;
+using OSDMap = OpenMetaverse.StructuredData.OSDMap;
namespace OpenSim.Region.CoreModules.Avatar.Gods
{
public class GodsModule : IRegionModule, IGodsModule
{
+ private static readonly ILog m_log =
+ LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+
/// Special UUID for actions that apply to all agents
private static readonly UUID ALL_AGENTS = new UUID("44e87126-e794-4ded-05b3-7c42da3d5cdb");
protected Scene m_scene;
protected IDialogModule m_dialogModule;
+
+ protected Dictionary m_capsDict =
+ new Dictionary();
public void Initialise(Scene scene, IConfigSource source)
{
@@ -48,6 +72,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
m_dialogModule = m_scene.RequestModuleInterface();
m_scene.RegisterModuleInterface(this);
m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
+ m_scene.EventManager.OnRegisterCaps += OnRegisterCaps;
+ m_scene.EventManager.OnClientClosed += OnClientClosed;
}
public void PostInitialise() {}
@@ -67,6 +93,50 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
client.OnRequestGodlikePowers -= RequestGodlikePowers;
}
+ private void OnClientClosed(UUID agentID, Scene scene)
+ {
+ m_capsDict.Remove(agentID);
+ }
+
+ private void OnRegisterCaps(UUID agentID, Caps caps)
+ {
+ string uri = "/CAPS/" + UUID.Random();
+ m_capsDict[agentID] = uri;
+
+ caps.RegisterHandler("UntrustedSimulatorMessage",
+ new RestStreamHandler("POST", uri,
+ HandleUntrustedSimulatorMessage));
+ }
+
+ private string HandleUntrustedSimulatorMessage(string request,
+ string path, string param, OSHttpRequest httpRequest,
+ OSHttpResponse httpResponse)
+ {
+ OSDMap osd = (OSDMap)OSDParser.DeserializeLLSDXml(request);
+
+ string message = osd["message"].AsString();
+
+ if (message == "GodKickUser")
+ {
+ OSDMap body = (OSDMap)osd["body"];
+ OSDArray userInfo = (OSDArray)body["UserInfo"];
+ OSDMap userData = (OSDMap)userInfo[0];
+
+ UUID agentID = userData["AgentID"].AsUUID();
+ UUID godID = userData["GodID"].AsUUID();
+ UUID godSessionID = userData["GodSessionID"].AsUUID();
+ uint kickFlags = userData["KickFlags"].AsUInteger();
+ string reason = userData["Reason"].AsString();
+
+ KickUser(godID, godSessionID, agentID, kickFlags, Util.StringToBytes1024(reason));
+ }
+ else
+ {
+ m_log.ErrorFormat("[GOD]: Unhandled UntrustedSimulatorMessage: {0}", message);
+ }
+ return String.Empty;
+ }
+
public void RequestGodlikePowers(
UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient)
{
@@ -115,71 +185,60 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
/// The message to send to the user after it's been turned into a field
public void KickUser(UUID godID, UUID sessionID, UUID agentID, uint kickflags, byte[] reason)
{
- UUID kickUserID = ALL_AGENTS;
-
+ if (!m_scene.Permissions.IsGod(godID))
+ return;
+
+ ScenePresence god = m_scene.GetScenePresence(godID);
+ if (god == null || god.ControllingClient.SessionId != sessionID)
+ return;
+
ScenePresence sp = m_scene.GetScenePresence(agentID);
- if (sp != null || agentID == kickUserID)
+ switch (kickflags)
{
- if (m_scene.Permissions.IsGod(godID))
+ case 0:
+ if (sp != null)
{
- if (kickflags == 0)
- {
- if (agentID == kickUserID)
- {
- string reasonStr = Utils.BytesToString(reason);
-
- m_scene.ForEachClient(
- delegate(IClientAPI controller)
- {
- if (controller.AgentId != godID)
- controller.Kick(reasonStr);
- }
- );
-
- // This is a bit crude. It seems the client will be null before it actually stops the thread
- // The thread will kill itself eventually :/
- // Is there another way to make sure *all* clients get this 'inter region' message?
- m_scene.ForEachScenePresence(
- delegate(ScenePresence p)
- {
- if (p.UUID != godID && !p.IsChildAgent)
- {
- // Possibly this should really be p.Close() though that method doesn't send a close
- // to the client
- p.ControllingClient.Close();
- }
- }
- );
- }
- else
- {
- m_scene.SceneGraph.removeUserCount(!sp.IsChildAgent);
-
- sp.ControllingClient.Kick(Utils.BytesToString(reason));
- sp.ControllingClient.Close();
- }
- }
-
- if (kickflags == 1)
- {
- sp.AllowMovement = false;
- m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason));
- m_dialogModule.SendAlertToUser(godID, "User Frozen");
- }
-
- if (kickflags == 2)
- {
- sp.AllowMovement = true;
- m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason));
- m_dialogModule.SendAlertToUser(godID, "User Unfrozen");
- }
+ KickPresence(sp, Utils.BytesToString(reason));
}
- else
+ else if (agentID == ALL_AGENTS)
+ {
+ m_scene.ForEachScenePresence(
+ delegate(ScenePresence p)
+ {
+ if (p.UUID != godID && (!m_scene.Permissions.IsGod(p.UUID)))
+ KickPresence(p, Utils.BytesToString(reason));
+ }
+ );
+ }
+ break;
+ case 1:
+ if (sp != null)
{
- m_dialogModule.SendAlertToUser(godID, "Kick request denied");
+ sp.AllowMovement = false;
+ m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason));
+ m_dialogModule.SendAlertToUser(godID, "User Frozen");
}
+ break;
+ case 2:
+ if (sp != null)
+ {
+ sp.AllowMovement = true;
+ m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason));
+ m_dialogModule.SendAlertToUser(godID, "User Unfrozen");
+ }
+ break;
+ default:
+ break;
}
}
+
+ private void KickPresence(ScenePresence sp, string reason)
+ {
+ if (sp.IsChildAgent)
+ return;
+ sp.ControllingClient.Kick(reason);
+ sp.Scene.IncomingCloseAgent(sp.UUID);
+ }
}
-}
\ No newline at end of file
+}
--
cgit v1.1
From 139e84c0b2033462bdfa91b186fb77432474afc5 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Fri, 14 Jan 2011 01:01:02 +0100
Subject: Fix slam bits being lost when editing perms in prim inventory
---
OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 1 -
1 file changed, 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 8761284..2ee8c07 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -881,7 +881,6 @@ namespace OpenSim.Region.Framework.Scenes
{
item.ParentID = m_part.UUID;
item.ParentPartID = m_part.UUID;
- item.Flags = m_items[item.ItemID].Flags;
// If group permissions have been set on, check that the groupID is up to date in case it has
// changed since permissions were last set.
--
cgit v1.1
From fe2d9be0cff649fad7fee78b257686954262e3cd Mon Sep 17 00:00:00 2001
From: Melanie
Date: Fri, 14 Jan 2011 03:35:45 +0100
Subject: Implement nonlocal god kicks and freezes
---
.../Region/CoreModules/Avatar/Gods/GodsModule.cs | 39 +++++++++++++++++++---
1 file changed, 35 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
index 9fd3318..a83b3df 100644
--- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
@@ -74,6 +74,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
m_scene.EventManager.OnRegisterCaps += OnRegisterCaps;
m_scene.EventManager.OnClientClosed += OnClientClosed;
+ scene.EventManager.OnIncomingInstantMessage +=
+ OnIncomingInstantMessage;
}
public void PostInitialise() {}
@@ -128,6 +130,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
uint kickFlags = userData["KickFlags"].AsUInteger();
string reason = userData["Reason"].AsString();
+ ScenePresence god = m_scene.GetScenePresence(godID);
+ if (god == null || god.ControllingClient.SessionId != godSessionID)
+ return String.Empty;
+
KickUser(godID, godSessionID, agentID, kickFlags, Util.StringToBytes1024(reason));
}
else
@@ -188,12 +194,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
if (!m_scene.Permissions.IsGod(godID))
return;
- ScenePresence god = m_scene.GetScenePresence(godID);
- if (god == null || god.ControllingClient.SessionId != sessionID)
- return;
-
ScenePresence sp = m_scene.GetScenePresence(agentID);
+ if (sp == null && agentID != ALL_AGENTS)
+ {
+ IMessageTransferModule transferModule =
+ m_scene.RequestModuleInterface();
+ if (transferModule != null)
+ {
+ m_log.DebugFormat("[GODS]: Sending nonlocal kill for agent {0}", agentID);
+ transferModule.SendInstantMessage(new GridInstantMessage(
+ m_scene, godID, "God", agentID, (byte)250, false,
+ Utils.BytesToString(reason), UUID.Zero, true,
+ new Vector3(), new byte[] {(byte)kickflags}),
+ delegate(bool success) {} );
+ }
+ return;
+ }
+
switch (kickflags)
{
case 0:
@@ -240,5 +258,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
sp.ControllingClient.Kick(reason);
sp.Scene.IncomingCloseAgent(sp.UUID);
}
+
+ private void OnIncomingInstantMessage(GridInstantMessage msg)
+ {
+ if (msg.dialog == (uint)250) // Nonlocal kick
+ {
+ UUID agentID = new UUID(msg.toAgentID);
+ string reason = msg.message;
+ UUID godID = new UUID(msg.fromAgentID);
+ uint kickMode = (uint)msg.binaryBucket[0];
+
+ KickUser(godID, UUID.Zero, agentID, kickMode, Util.StringToBytes1024(reason));
+ }
+ }
}
}
--
cgit v1.1
From a30bbcbb64e9b985b0db4c4b795ad369d7f4cda7 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Fri, 14 Jan 2011 04:09:02 +0100
Subject: Temporarily reinstate prim counting in the update loop to make the
production systems run
---
OpenSim/Region/Framework/Scenes/Scene.cs | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 066e504..a4f630a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -151,7 +151,7 @@ namespace OpenSim.Region.Framework.Scenes
private int m_update_events = 1;
private int m_update_backup = 200;
private int m_update_terrain = 50;
-// private int m_update_land = 1;
+ private int m_update_land = 10;
private int m_update_coarse_locations = 50;
private int frameMS;
@@ -1330,12 +1330,12 @@ namespace OpenSim.Region.Framework.Scenes
terrainMS = Util.EnvironmentTickCountSubtract(terMS);
}
- //if (m_frame % m_update_land == 0)
- //{
- // int ldMS = Util.EnvironmentTickCount();
- // UpdateLand();
- // landMS = Util.EnvironmentTickCountSubtract(ldMS);
- //}
+ if (m_frame % m_update_land == 0)
+ {
+ int ldMS = Util.EnvironmentTickCount();
+ UpdateLand();
+ landMS = Util.EnvironmentTickCountSubtract(ldMS);
+ }
frameMS = Util.EnvironmentTickCountSubtract(tmpFrameMS);
otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS;
--
cgit v1.1
From 30320077a292ba98f054794f9f817628bf2be0f9 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Fri, 14 Jan 2011 01:01:02 +0100
Subject: Fix slam bits being lost when editing perms in prim inventory
---
OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 1 -
1 file changed, 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 91bb3a5..004e20c 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -695,7 +695,6 @@ namespace OpenSim.Region.Framework.Scenes
{
item.ParentID = m_part.UUID;
item.ParentPartID = m_part.UUID;
- item.Flags = m_items[item.ItemID].Flags;
// If group permissions have been set on, check that the groupID is up to date in case it has
// changed since permissions were last set.
--
cgit v1.1
From 76f39d326e88f0793daf5d1f0d19654d596d572c Mon Sep 17 00:00:00 2001
From: Melanie
Date: Fri, 14 Jan 2011 18:26:41 +0100
Subject: Add a new ViewObjectInventory permission to decouple viewing from
+MOD status
---
OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
index e1fedf4..48beb9c 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
@@ -49,6 +49,7 @@ namespace OpenSim.Region.Framework.Scenes
public delegate bool DuplicateObjectHandler(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition);
public delegate bool EditObjectHandler(UUID objectID, UUID editorID, Scene scene);
public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene);
+ public delegate bool ViewObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene);
public delegate bool MoveObjectHandler(UUID objectID, UUID moverID, Scene scene);
public delegate bool ObjectEntryHandler(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene);
public delegate bool ReturnObjectsHandler(ILandObject land, UUID user, List objects, Scene scene);
@@ -116,6 +117,7 @@ namespace OpenSim.Region.Framework.Scenes
public event DuplicateObjectHandler OnDuplicateObject;
public event EditObjectHandler OnEditObject;
public event EditObjectInventoryHandler OnEditObjectInventory;
+ public event ViewObjectInventoryHandler OnViewObjectInventory;
public event MoveObjectHandler OnMoveObject;
public event ObjectEntryHandler OnObjectEntry;
public event ReturnObjectsHandler OnReturnObjects;
@@ -401,6 +403,21 @@ namespace OpenSim.Region.Framework.Scenes
return true;
}
+ public bool CanViewObjectInventory(UUID objectID, UUID editorID)
+ {
+ ViewObjectInventoryHandler handler = OnViewObjectInventory;
+ if (handler != null)
+ {
+ Delegate[] list = handler.GetInvocationList();
+ foreach (ViewObjectInventoryHandler h in list)
+ {
+ if (h(objectID, editorID, m_scene) == false)
+ return false;
+ }
+ }
+ return true;
+ }
+
#endregion
#region MOVE OBJECT
--
cgit v1.1
From 5e35651efc98fd140a454c2dd6c5e826573f9dd6 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Mon, 17 Jan 2011 11:45:13 -0800
Subject: Protect World Map module, RequestMapItemsAsync, from badly formed
URLs.
---
OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index f9d28b9..e0f36a2 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -641,7 +641,17 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
lock (m_openRequests)
m_openRequests.Add(requestID, mrs);
- WebRequest mapitemsrequest = WebRequest.Create(httpserver);
+ WebRequest mapitemsrequest = null;
+ try
+ {
+ mapitemsrequest = WebRequest.Create(httpserver);
+ }
+ catch (Exception e)
+ {
+ m_log.DebugFormat("[WORLD MAP]: Access to {0} failed with {1}", httpserver, e);
+ return new OSDMap();
+ }
+
mapitemsrequest.Method = "POST";
mapitemsrequest.ContentType = "application/xml+llsd";
OSDMap RAMap = new OSDMap();
--
cgit v1.1
From ddb4de139ccd6eff117ac322e94b323bd91212ee Mon Sep 17 00:00:00 2001
From: Melanie
Date: Mon, 17 Jan 2011 21:22:32 +0100
Subject: Change gesture activation to not quash any other flags
---
OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
index 7303fe7..914990c 100644
--- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
@@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
item = invService.GetItem(item);
if (item != null)
{
- item.Flags = 1;
+ item.Flags |= 1;
invService.UpdateItem(item);
}
else
@@ -85,7 +85,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
item = invService.GetItem(item);
if (item != null)
{
- item.Flags = 0;
+ item.Flags &= ~1;
invService.UpdateItem(item);
}
else
@@ -93,4 +93,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
"[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name);
}
}
-}
\ No newline at end of file
+}
--
cgit v1.1
From 59c2cd04ba056b85eb4873e472b95826a1cc13b5 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Mon, 17 Jan 2011 12:35:19 -0800
Subject: DEBUG DEBUG DEBUG
---
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 3a40196..8e4aaf1 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -839,6 +839,7 @@ namespace OpenSim.Region.Framework.Scenes
m_rootRegionHandle = m_scene.RegionInfo.RegionHandle;
m_scene.EventManager.TriggerSetRootAgentScene(m_uuid, m_scene);
+ m_log.DebugFormat("[XXX] MakeRoot 1");
// Moved this from SendInitialData to ensure that m_appearance is initialized
// before the inventory is processed in MakeRootAgent. This fixes a race condition
@@ -899,6 +900,7 @@ namespace OpenSim.Region.Framework.Scenes
}
AddToPhysicalScene(isFlying);
+ m_log.DebugFormat("[XXX] MakeRoot 2");
if (m_appearance != null)
{
@@ -941,7 +943,9 @@ namespace OpenSim.Region.Framework.Scenes
presence.Animator.SendAnimPackToClient(ControllingClient);
});
+ m_log.DebugFormat("[XXX] MakeRoot 3");
m_scene.EventManager.TriggerOnMakeRootAgent(this);
+ m_log.DebugFormat("[XXX] MakeRoot 4");
}
///
--
cgit v1.1
From 4bcee1dfb4337fca342fd29916d5da3b4c7db954 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Mon, 17 Jan 2011 13:07:02 -0800
Subject: Revert "DEBUG DEBUG DEBUG"
This reverts commit 59c2cd04ba056b85eb4873e472b95826a1cc13b5.
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 4 ----
1 file changed, 4 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 8e4aaf1..3a40196 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -839,7 +839,6 @@ namespace OpenSim.Region.Framework.Scenes
m_rootRegionHandle = m_scene.RegionInfo.RegionHandle;
m_scene.EventManager.TriggerSetRootAgentScene(m_uuid, m_scene);
- m_log.DebugFormat("[XXX] MakeRoot 1");
// Moved this from SendInitialData to ensure that m_appearance is initialized
// before the inventory is processed in MakeRootAgent. This fixes a race condition
@@ -900,7 +899,6 @@ namespace OpenSim.Region.Framework.Scenes
}
AddToPhysicalScene(isFlying);
- m_log.DebugFormat("[XXX] MakeRoot 2");
if (m_appearance != null)
{
@@ -943,9 +941,7 @@ namespace OpenSim.Region.Framework.Scenes
presence.Animator.SendAnimPackToClient(ControllingClient);
});
- m_log.DebugFormat("[XXX] MakeRoot 3");
m_scene.EventManager.TriggerOnMakeRootAgent(this);
- m_log.DebugFormat("[XXX] MakeRoot 4");
}
///
--
cgit v1.1
From aecaadd3bdb8013addde47731e12427e2acc8994 Mon Sep 17 00:00:00 2001
From: dahlia
Date: Mon, 17 Jan 2011 13:10:09 -0800
Subject: objectId in AvatarAnimation packet should be UUID.Zero for
non-overridden animations
---
OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 2 --
1 file changed, 2 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index ee4f04e..c765e68 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -3466,8 +3466,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
ani.AnimationSourceList[i] = new AvatarAnimationPacket.AnimationSourceListBlock();
ani.AnimationSourceList[i].ObjectID = objectIDs[i];
- if (objectIDs[i] == UUID.Zero)
- ani.AnimationSourceList[i].ObjectID = sourceAgentId;
}
ani.Header.Reliable = false;
OutPacket(ani, ThrottleOutPacketType.Task);
--
cgit v1.1
From 81552099d6eaf1142cde4bbe864dfa1e752af5e5 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 17 Jan 2011 23:45:25 +0000
Subject: Fix UnackedBytes client stack statistic as seen in "show queues"
Bytes were being wrongly added again on a resend
---
OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 2 --
OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs | 4 +++-
2 files changed, 3 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index e54cfc2..fe5156e 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -585,8 +585,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// Stats tracking
Interlocked.Increment(ref udpClient.PacketsSent);
- if (isReliable)
- Interlocked.Add(ref udpClient.UnackedBytes, outgoingPacket.Buffer.DataLength);
// Put the UDP payload on the wire
AsyncBeginSend(buffer);
diff --git a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs
index 4cb4aee..d762bef 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs
@@ -28,6 +28,7 @@
using System;
using System.Collections.Generic;
using System.Net;
+using System.Threading;
using OpenMetaverse;
namespace OpenSim.Region.ClientStack.LindenUDP
@@ -77,6 +78,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void Add(OutgoingPacket packet)
{
m_pendingAdds.Enqueue(packet);
+ Interlocked.Add(ref packet.Client.UnackedBytes, packet.Buffer.DataLength);
}
///
@@ -166,7 +168,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_packets.Remove(pendingRemove.SequenceNumber);
// Update stats
- System.Threading.Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength);
+ Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength);
if (!pendingRemove.FromResend)
{
--
cgit v1.1
From 6e58996b4d9db202cd7795a37bd687362effef48 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 17 Jan 2011 23:57:50 +0000
Subject: refactor: remove redundant null checks
---
.../LindenUDP/UnackedPacketCollection.cs | 45 ++++++++--------------
1 file changed, 15 insertions(+), 30 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs
index d762bef..9d40688 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs
@@ -141,46 +141,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private void ProcessQueues()
{
// Process all the pending adds
-
OutgoingPacket pendingAdd;
- if (m_pendingAdds != null)
- {
- while (m_pendingAdds.TryDequeue(out pendingAdd))
- {
- if (pendingAdd != null && m_packets != null)
- {
- m_packets[pendingAdd.SequenceNumber] = pendingAdd;
- }
- }
- }
+ while (m_pendingAdds.TryDequeue(out pendingAdd))
+ m_packets[pendingAdd.SequenceNumber] = pendingAdd;
// Process all the pending removes, including updating statistics and round-trip times
PendingAck pendingRemove;
OutgoingPacket ackedPacket;
- if (m_pendingRemoves != null)
+ while (m_pendingRemoves.TryDequeue(out pendingRemove))
{
- while (m_pendingRemoves.TryDequeue(out pendingRemove))
+ if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket))
{
- if (m_pendingRemoves != null && m_packets != null)
+ m_packets.Remove(pendingRemove.SequenceNumber);
+
+ // Update stats
+ Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength);
+
+ if (!pendingRemove.FromResend)
{
- if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket))
- {
- m_packets.Remove(pendingRemove.SequenceNumber);
-
- // Update stats
- Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength);
-
- if (!pendingRemove.FromResend)
- {
- // Calculate the round-trip time for this packet and its ACK
- int rtt = pendingRemove.RemoveTime - ackedPacket.TickCount;
- if (rtt > 0)
- ackedPacket.Client.UpdateRoundTrip(rtt);
- }
- }
+ // Calculate the round-trip time for this packet and its ACK
+ int rtt = pendingRemove.RemoveTime - ackedPacket.TickCount;
+ if (rtt > 0)
+ ackedPacket.Client.UpdateRoundTrip(rtt);
}
}
}
}
}
-}
+}
\ No newline at end of file
--
cgit v1.1
From c544f0d0c5fcea625107c0eff25be8aa0586564a Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 18 Jan 2011 00:25:24 +0000
Subject: Prune some of the excess logging for client logins.
Didn't touch the appearance related stuff.
---
OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 6 +++---
OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs | 2 +-
OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs | 4 ++--
OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs | 2 +-
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 6 +++---
5 files changed, 10 insertions(+), 10 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index fe5156e..571624b 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -857,9 +857,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// Acknowledge the UseCircuitCode packet
SendAckImmediate(remoteEndPoint, packet.Header.Sequence);
- m_log.DebugFormat(
- "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
- buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
+// m_log.DebugFormat(
+// "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
+// buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
}
private void SendAckImmediate(IPEndPoint remoteEndpoint, uint sequenceNumber)
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs
index 36aaab3..8347e35 100644
--- a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs
@@ -102,7 +102,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
{
UUID capID = UUID.Random();
- m_log.Info("[GETMESH]: /CAPS/" + capID);
+// m_log.Info("[GETMESH]: /CAPS/" + capID);
caps.RegisterHandler("GetMesh",
new RestHTTPHandler("GET", "/CAPS/" + capID,
delegate(Hashtable m_dhttpMethod)
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs
index 1f60e36..6fb8b46 100644
--- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs
@@ -105,7 +105,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
{
UUID capID = UUID.Random();
- m_log.InfoFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
+// m_log.InfoFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
}
@@ -171,7 +171,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
/// False for "caller try another codec"; true otherwise
private bool FetchTexture(OSHttpRequest httpRequest, OSHttpResponse httpResponse, UUID textureID, string format)
{
- m_log.DebugFormat("[GETTEXTURE]: {0} with requested format {1}", textureID, format);
+// m_log.DebugFormat("[GETTEXTURE]: {0} with requested format {1}", textureID, format);
AssetBase texture;
string fullID = textureID.ToString();
diff --git a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs
index c011776..008233b 100644
--- a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs
+++ b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs
@@ -63,7 +63,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
{
UUID capuuid = UUID.Random();
- m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/");
+// m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/");
caps.RegisterHandler("ObjectAdd",
new RestHTTPHandler("POST", "/CAPS/OA/" + capuuid + "/",
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 3a40196..7b94202 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1161,9 +1161,9 @@ namespace OpenSim.Region.Framework.Scenes
friendsModule.SendFriendsOnlineIfNeeded(ControllingClient);
}
- m_log.DebugFormat(
- "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms",
- client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds);
+// m_log.DebugFormat(
+// "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms",
+// client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds);
}
///
--
cgit v1.1
From 3083c517a01b4265434f9286aa1c95b2b513549b Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 18 Jan 2011 00:29:10 +0000
Subject: minor: resolve some mono compiler warnings
---
OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 2 +-
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 004e20c..cff2cf4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -849,7 +849,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public void RequestInventoryFile(IClientAPI client, IXfer xferManager)
{
- bool changed = CreateInventoryFile();
+ CreateInventoryFile();
if (m_inventorySerial == 0) // No inventory
{
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 7b94202..03cd90f 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1108,7 +1108,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public void CompleteMovement(IClientAPI client)
{
- DateTime startTime = DateTime.Now;
+// DateTime startTime = DateTime.Now;
m_log.DebugFormat(
"[SCENE PRESENCE]: Completing movement of {0} into region {1}",
--
cgit v1.1
From 624bf23abb3f7cf58447c73cff5187963945a15a Mon Sep 17 00:00:00 2001
From: dahlia
Date: Mon, 17 Jan 2011 16:39:53 -0800
Subject: force objectId to UUID.Zero for non-overridden animations in
AvatarAnimation packet
---
OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index c765e68..e43e3c9 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -3465,7 +3465,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
ani.AnimationList[i].AnimSequenceID = seqs[i];
ani.AnimationSourceList[i] = new AvatarAnimationPacket.AnimationSourceListBlock();
- ani.AnimationSourceList[i].ObjectID = objectIDs[i];
+ if (objectIDs[i].Equals(sourceAgentId))
+ ani.AnimationSourceList[i].ObjectID = UUID.Zero;
+ else
+ ani.AnimationSourceList[i].ObjectID = objectIDs[i];
}
ani.Header.Reliable = false;
OutPacket(ani, ThrottleOutPacketType.Task);
--
cgit v1.1
From 31144a62b34cf84cbc2c5508924294334fb76979 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Mon, 17 Jan 2011 21:22:32 +0100
Subject: Change gesture activation to not quash any other flags
---
OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
index 7303fe7..914990c 100644
--- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
@@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
item = invService.GetItem(item);
if (item != null)
{
- item.Flags = 1;
+ item.Flags |= 1;
invService.UpdateItem(item);
}
else
@@ -85,7 +85,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
item = invService.GetItem(item);
if (item != null)
{
- item.Flags = 0;
+ item.Flags &= ~1;
invService.UpdateItem(item);
}
else
@@ -93,4 +93,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
"[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name);
}
}
-}
\ No newline at end of file
+}
--
cgit v1.1
From c98d1cffe222085378ef8a9935f956882eae4ee9 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Mon, 17 Jan 2011 17:40:48 -0800
Subject: Removed the call to sceneViewer.Reset upon MakeRoot and
ChildAgentUpdate, because Reset hangs for a long time waiting for the lock.
That is a problem in itself -- that long holding of the lock by some thread
-- but let's just avoid it altogether.
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 8 --------
1 file changed, 8 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 3a40196..f811f3e 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -928,10 +928,6 @@ namespace OpenSim.Region.Framework.Scenes
//else
// m_log.ErrorFormat("[SCENE]: Could not find user info for {0} when making it a root agent", m_uuid);
- // On the next prim update, all objects will be sent
- //
- m_sceneViewer.Reset();
-
m_isChildAgent = false;
// send the animations of the other presences to me
@@ -2952,10 +2948,6 @@ namespace OpenSim.Region.Framework.Scenes
if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0)
ControllingClient.SetChildAgentThrottle(cAgentData.Throttles);
- // Sends out the objects in the user's draw distance if m_sendTasksToChild is true.
- if (m_scene.m_seeIntoRegionFromNeighbor)
- m_sceneViewer.Reset();
-
//cAgentData.AVHeight;
m_rootRegionHandle = cAgentData.RegionHandle;
//m_velocity = cAgentData.Velocity;
--
cgit v1.1
From 9f7b37b37cb746c603642df3c99e90f6ed0059ce Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 18 Jan 2011 01:48:28 +0000
Subject: Fix build break
---
OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
index 914990c..7df2beb 100644
--- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
@@ -85,7 +85,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
item = invService.GetItem(item);
if (item != null)
{
- item.Flags &= ~1;
+ item.Flags &= ~(uint)1;
invService.UpdateItem(item);
}
else
--
cgit v1.1