aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs8
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs1
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs52
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs14
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs21
5 files changed, 76 insertions, 20 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 6834606..3c2575d 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -218,7 +218,13 @@ namespace OpenSim
218 218
219 m_console.Commands.AddCommand("region", false, "debug packet", 219 m_console.Commands.AddCommand("region", false, "debug packet",
220 "debug packet <level>", 220 "debug packet <level>",
221 "Turn on packet debugging", Debug); 221 "Turn on packet debugging",
222 "If level > 255 then all incoming and outgoing packets are logged.\n"
223 + "If level <= 255 then incoming AgentUpdate and outgoing SimStats and SimulatorViewerTimeMessage packets are not logged.\n"
224 + "If level <= 200 then incoming RequestImage and outgoing ImagePacket, ImageData, LayerData and CoarseLocationUpdate packets are not logged.\n"
225 + "If level <= 100 then incoming ViewerEffect and AgentAnimation and outgoing ViewerEffect and AvatarAnimation packets are not logged.\n"
226 + "If level <= 0 then no packets are logged.",
227 Debug);
222 228
223 m_console.Commands.AddCommand("region", false, "debug scene", 229 m_console.Commands.AddCommand("region", false, "debug scene",
224 "debug scene <cripting> <collisions> <physics>", 230 "debug scene <cripting> <collisions> <physics>",
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 526d3b5..d2d2607 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -36,7 +36,6 @@ using Nini.Config;
36using OpenMetaverse; 36using OpenMetaverse;
37using OpenSim.Framework; 37using OpenSim.Framework;
38using OpenSim.Framework.Communications; 38using OpenSim.Framework.Communications;
39
40using OpenSim.Framework.Console; 39using OpenSim.Framework.Console;
41using OpenSim.Framework.Servers; 40using OpenSim.Framework.Servers;
42using OpenSim.Framework.Servers.HttpServer; 41using OpenSim.Framework.Servers.HttpServer;
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 0d142f4..fddb966 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -60,7 +60,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
60 public class LLClientView : IClientAPI, IClientCore, IClientIM, IClientChat, IClientIPEndpoint, IStatsCollector 60 public class LLClientView : IClientAPI, IClientCore, IClientIM, IClientChat, IClientIPEndpoint, IStatsCollector
61 { 61 {
62 /// <value> 62 /// <value>
63 /// Debug packet level. At the moment, only 255 does anything (prints out all in and out packets). 63 /// Debug packet level. See OpenSim.RegisterConsoleCommands() for more details.
64 /// </value> 64 /// </value>
65 protected int m_debugPacketLevel = 0; 65 protected int m_debugPacketLevel = 0;
66 66
@@ -11174,8 +11174,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11174 /// handles splitting manually</param> 11174 /// handles splitting manually</param>
11175 protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting) 11175 protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting)
11176 { 11176 {
11177 if (m_debugPacketLevel >= 255) 11177 if (m_debugPacketLevel > 0)
11178 m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type); 11178 {
11179 bool outputPacket = true;
11180
11181 if (m_debugPacketLevel <= 255
11182 && (packet.Type == PacketType.SimStats || packet.Type == PacketType.SimulatorViewerTimeMessage))
11183 outputPacket = false;
11184
11185 if (m_debugPacketLevel <= 200
11186 &&
11187 (packet.Type == PacketType.ImagePacket
11188 || packet.Type == PacketType.ImageData
11189 || packet.Type == PacketType.LayerData
11190 || packet.Type == PacketType.CoarseLocationUpdate))
11191 outputPacket = false;
11192
11193 if (m_debugPacketLevel <= 100 && (packet.Type == PacketType.AvatarAnimation || packet.Type == PacketType.ViewerEffect))
11194 outputPacket = false;
11195
11196 if (outputPacket)
11197 m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type);
11198 }
11179 11199
11180 m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting); 11200 m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting);
11181 } 11201 }
@@ -11246,15 +11266,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11246 /// Entryway from the client to the simulator. All UDP packets from the client will end up here 11266 /// Entryway from the client to the simulator. All UDP packets from the client will end up here
11247 /// </summary> 11267 /// </summary>
11248 /// <param name="Pack">OpenMetaverse.packet</param> 11268 /// <param name="Pack">OpenMetaverse.packet</param>
11249 public void ProcessInPacket(Packet Pack) 11269 public void ProcessInPacket(Packet packet)
11250 { 11270 {
11251 if (m_debugPacketLevel >= 255) 11271 if (m_debugPacketLevel > 0)
11252 m_log.DebugFormat("[CLIENT]: Packet IN {0}", Pack.Type); 11272 {
11273 bool outputPacket = true;
11274
11275 if (m_debugPacketLevel <= 255 && packet.Type == PacketType.AgentUpdate)
11276 outputPacket = false;
11277
11278 if (m_debugPacketLevel <= 200 && packet.Type == PacketType.RequestImage)
11279 outputPacket = false;
11280
11281 if (m_debugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation))
11282 outputPacket = false;
11283
11284 if (outputPacket)
11285 m_log.DebugFormat("[CLIENT]: Packet IN {0}", packet.Type);
11286 }
11253 11287
11254 if (!ProcessPacketMethod(Pack)) 11288 if (!ProcessPacketMethod(packet))
11255 m_log.Warn("[CLIENT]: unhandled packet " + Pack.Type); 11289 m_log.Warn("[CLIENT]: unhandled packet " + packet.Type);
11256 11290
11257 PacketPool.Instance.ReturnPacket(Pack); 11291 PacketPool.Instance.ReturnPacket(packet);
11258 } 11292 }
11259 11293
11260 private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket) 11294 private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket)
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index d56145a..de65460 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -173,16 +173,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
173 UUID itemID = UUID.Zero; 173 UUID itemID = UUID.Zero;
174 if (sp != null) 174 if (sp != null)
175 { 175 {
176 foreach(SceneObjectGroup grp in sp.Attachments) 176 foreach(SceneObjectGroup grp in sp.GetAttachments(AttachmentPt))
177 { 177 {
178 if (grp.GetAttachmentPoint() == (byte)AttachmentPt) 178 itemID = grp.GetFromItemID();
179 { 179 if (itemID != UUID.Zero)
180 itemID = grp.GetFromItemID(); 180 DetachSingleAttachmentToInv(itemID, remoteClient);
181 break; 181 }
182 }
183 }
184 if (itemID != UUID.Zero)
185 DetachSingleAttachmentToInv(itemID, remoteClient);
186 } 182 }
187 183
188 if (group.GetFromItemID() == UUID.Zero) 184 if (group.GetFromItemID() == UUID.Zero)
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index fbb3177..339d0c4 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3383,6 +3383,27 @@ namespace OpenSim.Region.Framework.Scenes
3383 m_attachments.Add(gobj); 3383 m_attachments.Add(gobj);
3384 } 3384 }
3385 } 3385 }
3386
3387 /// <summary>
3388 /// Get the scene object attached to the given point.
3389 /// </summary>
3390 /// <param name="attachmentPoint"></param>
3391 /// <returns>Returns an empty list if there were no attachments at the point.</returns>
3392 public List<SceneObjectGroup> GetAttachments(uint attachmentPoint)
3393 {
3394 List<SceneObjectGroup> attachments = new List<SceneObjectGroup>();
3395
3396 lock (m_attachments)
3397 {
3398 foreach (SceneObjectGroup so in m_attachments)
3399 {
3400 if (attachmentPoint == so.RootPart.AttachmentPoint)
3401 attachments.Add(so);
3402 }
3403 }
3404
3405 return attachments;
3406 }
3386 3407
3387 public bool HasAttachments() 3408 public bool HasAttachments()
3388 { 3409 {