diff options
author | Melanie | 2010-09-03 03:37:18 +0100 |
---|---|---|
committer | Melanie | 2010-09-03 03:37:18 +0100 |
commit | 4e0d6e8e41cf25a8e8d8524d9d5e94ab0752fb00 (patch) | |
tree | 6ecae46c7c5d46d4eb5a5ed65c1a7a8b8b15cc04 /OpenSim/Region | |
parent | Fix an issue with rezzing scripted objects. (diff) | |
parent | Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff) | |
download | opensim-SC_OLD-4e0d6e8e41cf25a8e8d8524d9d5e94ab0752fb00.zip opensim-SC_OLD-4e0d6e8e41cf25a8e8d8524d9d5e94ab0752fb00.tar.gz opensim-SC_OLD-4e0d6e8e41cf25a8e8d8524d9d5e94ab0752fb00.tar.bz2 opensim-SC_OLD-4e0d6e8e41cf25a8e8d8524d9d5e94ab0752fb00.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 59 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 95 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 21 |
5 files changed, 151 insertions, 37 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 072e4d3..945da7d 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 4ef0b1b..ec3193c 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -36,7 +36,6 @@ using Nini.Config; | |||
36 | using OpenMetaverse; | 36 | using OpenMetaverse; |
37 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
38 | using OpenSim.Framework.Communications; | 38 | using OpenSim.Framework.Communications; |
39 | |||
40 | using OpenSim.Framework.Console; | 39 | using OpenSim.Framework.Console; |
41 | using OpenSim.Framework.Servers; | 40 | using OpenSim.Framework.Servers; |
42 | using OpenSim.Framework.Servers.HttpServer; | 41 | using OpenSim.Framework.Servers.HttpServer; |
@@ -403,7 +402,9 @@ namespace OpenSim | |||
403 | } | 402 | } |
404 | catch (Exception e) | 403 | catch (Exception e) |
405 | { | 404 | { |
406 | m_log.ErrorFormat("[STARTUP]: Registration of region with grid failed, aborting startup - {0}", e.StackTrace); | 405 | m_log.ErrorFormat( |
406 | "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", | ||
407 | e.Message, e.StackTrace); | ||
407 | 408 | ||
408 | if (scene.SnmpService != null) | 409 | if (scene.SnmpService != null) |
409 | { | 410 | { |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index aa7de05..a1cd30a 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 | ||
@@ -11229,8 +11229,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11229 | /// handles splitting manually</param> | 11229 | /// handles splitting manually</param> |
11230 | protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting) | 11230 | protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting) |
11231 | { | 11231 | { |
11232 | if (m_debugPacketLevel >= 255) | 11232 | if (m_debugPacketLevel > 0) |
11233 | m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type); | 11233 | { |
11234 | bool outputPacket = true; | ||
11235 | |||
11236 | if (m_debugPacketLevel <= 255 | ||
11237 | && (packet.Type == PacketType.SimStats || packet.Type == PacketType.SimulatorViewerTimeMessage)) | ||
11238 | outputPacket = false; | ||
11239 | |||
11240 | if (m_debugPacketLevel <= 200 | ||
11241 | && | ||
11242 | (packet.Type == PacketType.ImagePacket | ||
11243 | || packet.Type == PacketType.ImageData | ||
11244 | || packet.Type == PacketType.LayerData | ||
11245 | || packet.Type == PacketType.CoarseLocationUpdate)) | ||
11246 | outputPacket = false; | ||
11247 | |||
11248 | if (m_debugPacketLevel <= 100 && (packet.Type == PacketType.AvatarAnimation || packet.Type == PacketType.ViewerEffect)) | ||
11249 | outputPacket = false; | ||
11250 | |||
11251 | if (outputPacket) | ||
11252 | m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type); | ||
11253 | } | ||
11234 | 11254 | ||
11235 | m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting); | 11255 | m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting); |
11236 | } | 11256 | } |
@@ -11316,26 +11336,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11316 | /// Entryway from the client to the simulator. All UDP packets from the client will end up here | 11336 | /// Entryway from the client to the simulator. All UDP packets from the client will end up here |
11317 | /// </summary> | 11337 | /// </summary> |
11318 | /// <param name="Pack">OpenMetaverse.packet</param> | 11338 | /// <param name="Pack">OpenMetaverse.packet</param> |
11319 | public void ProcessInPacket(Packet Pack) | 11339 | public void ProcessInPacket(Packet packet) |
11320 | { | 11340 | { |
11321 | if (!m_IsPresenceReady) | 11341 | if (m_debugPacketLevel > 0) |
11322 | { | 11342 | { |
11323 | if (m_pendingPackets == null) | 11343 | bool outputPacket = true; |
11324 | { | 11344 | |
11325 | m_pendingPackets = new List<Packet>(); | 11345 | if (m_debugPacketLevel <= 255 && packet.Type == PacketType.AgentUpdate) |
11326 | } | 11346 | outputPacket = false; |
11327 | m_pendingPackets.Add(Pack); | 11347 | |
11348 | if (m_debugPacketLevel <= 200 && packet.Type == PacketType.RequestImage) | ||
11349 | outputPacket = false; | ||
11350 | |||
11351 | if (m_debugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation)) | ||
11352 | outputPacket = false; | ||
11353 | |||
11354 | if (outputPacket) | ||
11355 | m_log.DebugFormat("[CLIENT]: Packet IN {0}", packet.Type); | ||
11328 | } | 11356 | } |
11329 | else | ||
11330 | { | ||
11331 | if (m_debugPacketLevel >= 255) | ||
11332 | m_log.DebugFormat("[CLIENT]: Packet IN {0}", Pack.Type); | ||
11333 | 11357 | ||
11334 | if (!ProcessPacketMethod(Pack)) | 11358 | if (!ProcessPacketMethod(packet)) |
11335 | m_log.Warn("[CLIENT]: unhandled packet " + Pack.Type); | 11359 | m_log.Warn("[CLIENT]: unhandled packet " + packet.Type); |
11336 | 11360 | ||
11337 | PacketPool.Instance.ReturnPacket(Pack); | 11361 | PacketPool.Instance.ReturnPacket(packet); |
11338 | } | ||
11339 | } | 11362 | } |
11340 | 11363 | ||
11341 | private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket) | 11364 | 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 38152cc..bd9e621 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -174,16 +174,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
174 | UUID itemID = UUID.Zero; | 174 | UUID itemID = UUID.Zero; |
175 | if (sp != null) | 175 | if (sp != null) |
176 | { | 176 | { |
177 | foreach(SceneObjectGroup grp in sp.Attachments) | 177 | foreach(SceneObjectGroup grp in sp.GetAttachments(AttachmentPt)) |
178 | { | 178 | { |
179 | if (grp.GetAttachmentPoint() == (byte)AttachmentPt) | 179 | itemID = grp.GetFromItemID(); |
180 | { | 180 | if (itemID != UUID.Zero) |
181 | itemID = grp.GetFromItemID(); | 181 | DetachSingleAttachmentToInv(itemID, remoteClient); |
182 | break; | 182 | } |
183 | } | ||
184 | } | ||
185 | if (itemID != UUID.Zero) | ||
186 | DetachSingleAttachmentToInv(itemID, remoteClient); | ||
187 | } | 183 | } |
188 | 184 | ||
189 | if (group.GetFromItemID() == UUID.Zero) | 185 | if (group.GetFromItemID() == UUID.Zero) |
@@ -197,12 +193,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
197 | 193 | ||
198 | SetAttachmentInventoryStatus(remoteClient, AttachmentPt, itemID, group); | 194 | SetAttachmentInventoryStatus(remoteClient, AttachmentPt, itemID, group); |
199 | 195 | ||
200 | group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); | 196 | AttachToAgent(sp, group, AttachmentPt, attachPos, silent); |
201 | |||
202 | // In case it is later dropped again, don't let | ||
203 | // it get cleaned up | ||
204 | group.RootPart.RemFlag(PrimFlags.TemporaryOnRez); | ||
205 | group.HasGroupChanged = false; | ||
206 | } | 197 | } |
207 | else | 198 | else |
208 | { | 199 | { |
@@ -551,6 +542,78 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
551 | remoteClient.SendInventoryItemCreateUpdate(item, 0); | 542 | remoteClient.SendInventoryItemCreateUpdate(item, 0); |
552 | } | 543 | } |
553 | } | 544 | } |
554 | } | 545 | } |
546 | |||
547 | /// <summary> | ||
548 | /// Attach this scene object to the given avatar. | ||
549 | /// </summary> | ||
550 | /// | ||
551 | /// This isn't publicly available since attachments should always perform the corresponding inventory | ||
552 | /// operation (to show the attach in user inventory and update the asset with positional information). | ||
553 | /// | ||
554 | /// <param name="sp"></param> | ||
555 | /// <param name="so"></param> | ||
556 | /// <param name="attachmentpoint"></param> | ||
557 | /// <param name="AttachOffset"></param> | ||
558 | /// <param name="silent"></param> | ||
559 | protected void AttachToAgent(ScenePresence avatar, SceneObjectGroup so, uint attachmentpoint, Vector3 AttachOffset, bool silent) | ||
560 | { | ||
561 | // don't attach attachments to child agents | ||
562 | if (avatar.IsChildAgent) return; | ||
563 | |||
564 | // m_log.DebugFormat("[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1}", Name, avatar.Name); | ||
565 | |||
566 | so.DetachFromBackup(); | ||
567 | |||
568 | // Remove from database and parcel prim count | ||
569 | m_scene.DeleteFromStorage(so.UUID); | ||
570 | m_scene.EventManager.TriggerParcelPrimCountTainted(); | ||
571 | |||
572 | so.RootPart.AttachedAvatar = avatar.UUID; | ||
573 | |||
574 | //Anakin Lohner bug #3839 | ||
575 | lock (so.Children) | ||
576 | { | ||
577 | foreach (SceneObjectPart p in so.Children.Values) | ||
578 | { | ||
579 | p.AttachedAvatar = avatar.UUID; | ||
580 | } | ||
581 | } | ||
582 | |||
583 | if (so.RootPart.PhysActor != null) | ||
584 | { | ||
585 | m_scene.PhysicsScene.RemovePrim(so.RootPart.PhysActor); | ||
586 | so.RootPart.PhysActor = null; | ||
587 | } | ||
588 | |||
589 | so.AbsolutePosition = AttachOffset; | ||
590 | so.RootPart.AttachedPos = AttachOffset; | ||
591 | so.RootPart.IsAttachment = true; | ||
592 | |||
593 | so.RootPart.SetParentLocalId(avatar.LocalId); | ||
594 | so.SetAttachmentPoint(Convert.ToByte(attachmentpoint)); | ||
595 | |||
596 | avatar.AddAttachment(so); | ||
597 | |||
598 | if (!silent) | ||
599 | { | ||
600 | // Killing it here will cause the client to deselect it | ||
601 | // It then reappears on the avatar, deselected | ||
602 | // through the full update below | ||
603 | // | ||
604 | if (so.IsSelected) | ||
605 | { | ||
606 | m_scene.SendKillObject(so.RootPart.LocalId); | ||
607 | } | ||
608 | |||
609 | so.IsSelected = false; // fudge.... | ||
610 | so.ScheduleGroupForFullUpdate(); | ||
611 | } | ||
612 | |||
613 | // In case it is later dropped again, don't let | ||
614 | // it get cleaned up | ||
615 | so.RootPart.RemFlag(PrimFlags.TemporaryOnRez); | ||
616 | so.HasGroupChanged = false; | ||
617 | } | ||
555 | } | 618 | } |
556 | } \ No newline at end of file | 619 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 2ed00a0..6e3afa9 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -3911,6 +3911,27 @@ if (m_animator.m_jumping) force.Z = m_animator.m_jumpVelocity; // add for ju | |||
3911 | m_attachments.Add(gobj); | 3911 | m_attachments.Add(gobj); |
3912 | } | 3912 | } |
3913 | } | 3913 | } |
3914 | |||
3915 | /// <summary> | ||
3916 | /// Get the scene object attached to the given point. | ||
3917 | /// </summary> | ||
3918 | /// <param name="attachmentPoint"></param> | ||
3919 | /// <returns>Returns an empty list if there were no attachments at the point.</returns> | ||
3920 | public List<SceneObjectGroup> GetAttachments(uint attachmentPoint) | ||
3921 | { | ||
3922 | List<SceneObjectGroup> attachments = new List<SceneObjectGroup>(); | ||
3923 | |||
3924 | lock (m_attachments) | ||
3925 | { | ||
3926 | foreach (SceneObjectGroup so in m_attachments) | ||
3927 | { | ||
3928 | if (attachmentPoint == so.RootPart.AttachmentPoint) | ||
3929 | attachments.Add(so); | ||
3930 | } | ||
3931 | } | ||
3932 | |||
3933 | return attachments; | ||
3934 | } | ||
3914 | 3935 | ||
3915 | public bool HasAttachments() | 3936 | public bool HasAttachments() |
3916 | { | 3937 | { |