From a9ba9d4a9ee2515d2541fc536525ebed3d101606 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 15 Jul 2011 23:51:55 +0100
Subject: change async parameter name in AddLocalPacketHandler since it becomes
a reserved keyword in .net 5
Also adds some method doc.
---
.../Region/ClientStack/Linden/UDP/LLClientView.cs | 24 ++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/ClientStack/Linden/UDP')
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index c176c2b..8414f8b 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -574,22 +574,42 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return result;
}
+ ///
+ /// Add a handler for the given packet type.
+ ///
+ /// The packet is handled on its own thread. If packets must be handled in the order in which thye
+ /// are received then please us ethe synchronous version of this method.
+ ///
+ ///
+ /// true if the handler was added. This is currently always the case.
public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler)
{
return AddLocalPacketHandler(packetType, handler, true);
}
- public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler, bool async)
+ ///
+ /// Add a handler for the given packet type.
+ ///
+ ///
+ ///
+ ///
+ /// If true, when the packet is received it is handled on its own thread rather than on the main inward bound
+ /// packet handler thread. This vastly increases respnosiveness but some packets need to be handled
+ /// synchronously.
+ ///
+ /// true if the handler was added. This is currently always the case.
+ public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler, bool doAsync)
{
bool result = false;
lock (m_packetHandlers)
{
if (!m_packetHandlers.ContainsKey(packetType))
{
- m_packetHandlers.Add(packetType, new PacketProcessor() { method = handler, Async = async });
+ m_packetHandlers.Add(packetType, new PacketProcessor() { method = handler, Async = doAsync });
result = true;
}
}
+
return result;
}
--
cgit v1.1
From 6fc74b36d1d0f7dcd6f013893c3189a3f989431c Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 18 Jul 2011 04:54:21 +0100
Subject: Make various tweaks to undo code in an effort to get things working
better.
Undo rotation and position appear to be working.
Resizing a single prim appears to be working, though the undo has to be done twice.
Resizing a group of prims still does not work properly - possibly because in the UndoState we don't store a knowledge of when we're resizing a whole group rather than individual prims.
This needs to be addressed.
---
.../Region/ClientStack/Linden/UDP/LLClientView.cs | 27 +++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/ClientStack/Linden/UDP')
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 8414f8b..fa35bd8 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -11242,6 +11242,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
else
{
+ // Do this once since fetch parts creates a new array.
+ SceneObjectPart[] parts = part.ParentGroup.Parts;
+ for (int j = 0; j < parts.Length; j++)
+ {
+ part.StoreUndoState();
+ parts[j].IgnoreUndoUpdate = true;
+ }
+
// UUID partId = part.UUID;
UpdatePrimGroupRotation handlerUpdatePrimGroupRotation;
@@ -11257,6 +11265,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
handlerUpdatePrimSinglePosition(localId, pos1, this);
}
break;
+
case 2:
Quaternion rot1 = new Quaternion(block.Data, 0, true);
@@ -11267,6 +11276,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
handlerUpdatePrimSingleRotation(localId, rot1, this);
}
break;
+
case 3:
Vector3 rotPos = new Vector3(block.Data, 0);
Quaternion rot2 = new Quaternion(block.Data, 12, true);
@@ -11279,6 +11289,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
handlerUpdatePrimSingleRotationPosition(localId, rot2, rotPos, this);
}
break;
+
case 4:
case 20:
Vector3 scale4 = new Vector3(block.Data, 0);
@@ -11290,8 +11301,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
handlerUpdatePrimScale(localId, scale4, this);
}
break;
- case 5:
+ case 5:
Vector3 scale1 = new Vector3(block.Data, 12);
Vector3 pos11 = new Vector3(block.Data, 0);
@@ -11308,6 +11319,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
}
break;
+
case 9:
Vector3 pos2 = new Vector3(block.Data, 0);
@@ -11315,10 +11327,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (handlerUpdateVector != null)
{
-
handlerUpdateVector(localId, pos2, this);
}
break;
+
case 10:
Quaternion rot3 = new Quaternion(block.Data, 0, true);
@@ -11329,6 +11341,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
handlerUpdatePrimRotation(localId, rot3, this);
}
break;
+
case 11:
Vector3 pos3 = new Vector3(block.Data, 0);
Quaternion rot4 = new Quaternion(block.Data, 12, true);
@@ -11352,6 +11365,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
handlerUpdatePrimGroupScale(localId, scale7, this);
}
break;
+
case 13:
Vector3 scale2 = new Vector3(block.Data, 12);
Vector3 pos4 = new Vector3(block.Data, 0);
@@ -11371,6 +11385,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
}
break;
+
case 29:
Vector3 scale5 = new Vector3(block.Data, 12);
Vector3 pos5 = new Vector3(block.Data, 0);
@@ -11388,6 +11403,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
}
break;
+
case 21:
Vector3 scale6 = new Vector3(block.Data, 12);
Vector3 pos6 = new Vector3(block.Data, 0);
@@ -11404,13 +11420,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
}
break;
+
default:
- m_log.Debug("[CLIENT] MultipleObjUpdate recieved an unknown packet type: " + (block.Type));
+ m_log.Debug("[CLIENT]: MultipleObjUpdate recieved an unknown packet type: " + (block.Type));
break;
}
+
+ for (int j = 0; j < parts.Length; j++)
+ parts[j].IgnoreUndoUpdate = false;
}
}
}
+
return true;
}
--
cgit v1.1
From 430a4aeba8e98b8285ea3ebdf264baf429a55e22 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 19 Jul 2011 03:01:54 +0100
Subject: Fix undo for resizing linksets
This involves implementing a boolean in UndoState to signal whether the undo needs to be done for an entire group/linkset or just a single prim
Resizing individual components of linksets is still dodgy.
Resizing still has to be down twice, since for some reason the client is sending two multiobjectupdate packets on every resize except the very first. This applies to single prims and linksets. Need to look into this.
---
.../Region/ClientStack/Linden/UDP/LLClientView.cs | 37 +++++++++++++++-------
1 file changed, 25 insertions(+), 12 deletions(-)
(limited to 'OpenSim/Region/ClientStack/Linden/UDP')
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index fa35bd8..4c0b53c 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -11220,8 +11220,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
protected bool HandleMultipleObjUpdate(IClientAPI simClient, Packet packet)
{
MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet;
- if (multipleupdate.AgentData.SessionID != SessionId) return false;
- // m_log.Debug("new multi update packet " + multipleupdate.ToString());
+
+ if (multipleupdate.AgentData.SessionID != SessionId)
+ return false;
+
+// m_log.DebugFormat(
+// "[CLIENT]: Incoming MultipleObjectUpdatePacket contained {0} blocks", multipleupdate.ObjectData.Length);
+
Scene tScene = (Scene)m_scene;
for (int i = 0; i < multipleupdate.ObjectData.Length; i++)
@@ -11242,15 +11247,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
else
{
- // Do this once since fetch parts creates a new array.
- SceneObjectPart[] parts = part.ParentGroup.Parts;
- for (int j = 0; j < parts.Length; j++)
- {
- part.StoreUndoState();
- parts[j].IgnoreUndoUpdate = true;
- }
+// m_log.DebugFormat(
+// "[CLIENT]: Processing block {0} type {1} for {2} {3}",
+// i, block.Type, part.Name, part.LocalId);
+
+// // Do this once since fetch parts creates a new array.
+// SceneObjectPart[] parts = part.ParentGroup.Parts;
+// for (int j = 0; j < parts.Length; j++)
+// {
+// part.StoreUndoState();
+// parts[j].IgnoreUndoUpdate = true;
+// }
- // UUID partId = part.UUID;
UpdatePrimGroupRotation handlerUpdatePrimGroupRotation;
switch (block.Type)
@@ -11394,6 +11402,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (handlerUpdatePrimGroupScale != null)
{
// m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z);
+ part.StoreUndoState(true);
+ part.IgnoreUndoUpdate = true;
handlerUpdatePrimGroupScale(localId, scale5, this);
handlerUpdateVector = OnUpdatePrimGroupPosition;
@@ -11401,7 +11411,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
handlerUpdateVector(localId, pos5, this);
}
+
+ part.IgnoreUndoUpdate = false;
}
+
break;
case 21:
@@ -11426,8 +11439,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
break;
}
- for (int j = 0; j < parts.Length; j++)
- parts[j].IgnoreUndoUpdate = false;
+// for (int j = 0; j < parts.Length; j++)
+// parts[j].IgnoreUndoUpdate = false;
}
}
}
--
cgit v1.1
From c94dc95844c5a43483a30807353aaebf658b015e Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 19 Jul 2011 03:27:16 +0100
Subject: fix undo when resizing of non-root individual prims in a linkset
undo resize, rotation and position still needs fixing when only editing root prim of a linkset
---
OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 5 +++++
1 file changed, 5 insertions(+)
(limited to 'OpenSim/Region/ClientStack/Linden/UDP')
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 4c0b53c..a34ad62 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -11424,6 +11424,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
handlerUpdatePrimScale = OnUpdatePrimScale;
if (handlerUpdatePrimScale != null)
{
+ part.StoreUndoState(false);
+ part.IgnoreUndoUpdate = true;
+
// m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z);
handlerUpdatePrimScale(localId, scale6, this);
handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition;
@@ -11431,6 +11434,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
handlerUpdatePrimSinglePosition(localId, pos6, this);
}
+
+ part.IgnoreUndoUpdate = false;
}
break;
--
cgit v1.1
From 7c468cda360b9a9382986c3a029b799fd49bf898 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 19 Jul 2011 03:38:22 +0100
Subject: Stop undo of just the root prim position in the linkset from shifting
the whole linkset.
However, what happens now is that undo just doesn't do anything when the root prim is selected on its own. This requires more code than just fiddling with undo states.
---
OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region/ClientStack/Linden/UDP')
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index a34ad62..00115cc 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -11224,8 +11224,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (multipleupdate.AgentData.SessionID != SessionId)
return false;
-// m_log.DebugFormat(
-// "[CLIENT]: Incoming MultipleObjectUpdatePacket contained {0} blocks", multipleupdate.ObjectData.Length);
+ m_log.DebugFormat(
+ "[CLIENT]: Incoming MultipleObjectUpdatePacket contained {0} blocks", multipleupdate.ObjectData.Length);
Scene tScene = (Scene)m_scene;
@@ -11247,9 +11247,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
else
{
-// m_log.DebugFormat(
-// "[CLIENT]: Processing block {0} type {1} for {2} {3}",
-// i, block.Type, part.Name, part.LocalId);
+ m_log.DebugFormat(
+ "[CLIENT]: Processing block {0} type {1} for {2} {3}",
+ i, block.Type, part.Name, part.LocalId);
// // Do this once since fetch parts creates a new array.
// SceneObjectPart[] parts = part.ParentGroup.Parts;
--
cgit v1.1
From 62325829ecab7d956416ff0450faa3f90f267e6c Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 19 Jul 2011 05:14:58 +0100
Subject: comment out all kinds of debugging guff
---
OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region/ClientStack/Linden/UDP')
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 00115cc..a34ad62 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -11224,8 +11224,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (multipleupdate.AgentData.SessionID != SessionId)
return false;
- m_log.DebugFormat(
- "[CLIENT]: Incoming MultipleObjectUpdatePacket contained {0} blocks", multipleupdate.ObjectData.Length);
+// m_log.DebugFormat(
+// "[CLIENT]: Incoming MultipleObjectUpdatePacket contained {0} blocks", multipleupdate.ObjectData.Length);
Scene tScene = (Scene)m_scene;
@@ -11247,9 +11247,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
else
{
- m_log.DebugFormat(
- "[CLIENT]: Processing block {0} type {1} for {2} {3}",
- i, block.Type, part.Name, part.LocalId);
+// m_log.DebugFormat(
+// "[CLIENT]: Processing block {0} type {1} for {2} {3}",
+// i, block.Type, part.Name, part.LocalId);
// // Do this once since fetch parts creates a new array.
// SceneObjectPart[] parts = part.ParentGroup.Parts;
--
cgit v1.1