mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 10:15:33 +08:00
Merge branch 'master' into careminster-presence-refactor
This commit is contained in:
@@ -218,7 +218,13 @@ namespace OpenSim
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "debug packet",
|
||||
"debug packet <level>",
|
||||
"Turn on packet debugging", Debug);
|
||||
"Turn on packet debugging",
|
||||
"If level > 255 then all incoming and outgoing packets are logged.\n"
|
||||
+ "If level <= 255 then incoming AgentUpdate and outgoing SimStats and SimulatorViewerTimeMessage packets are not logged.\n"
|
||||
+ "If level <= 200 then incoming RequestImage and outgoing ImagePacket, ImageData, LayerData and CoarseLocationUpdate packets are not logged.\n"
|
||||
+ "If level <= 100 then incoming ViewerEffect and AgentAnimation and outgoing ViewerEffect and AvatarAnimation packets are not logged.\n"
|
||||
+ "If level <= 0 then no packets are logged.",
|
||||
Debug);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "debug scene",
|
||||
"debug scene <cripting> <collisions> <physics>",
|
||||
|
||||
@@ -36,7 +36,6 @@ using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Communications;
|
||||
|
||||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Framework.Servers;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
@@ -403,7 +402,9 @@ namespace OpenSim
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[STARTUP]: Registration of region with grid failed, aborting startup - {0}", e.StackTrace);
|
||||
m_log.ErrorFormat(
|
||||
"[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}",
|
||||
e.Message, e.StackTrace);
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
public class LLClientView : IClientAPI, IClientCore, IClientIM, IClientChat, IClientIPEndpoint, IStatsCollector
|
||||
{
|
||||
/// <value>
|
||||
/// Debug packet level. At the moment, only 255 does anything (prints out all in and out packets).
|
||||
/// Debug packet level. See OpenSim.RegisterConsoleCommands() for more details.
|
||||
/// </value>
|
||||
protected int m_debugPacketLevel = 0;
|
||||
|
||||
@@ -11229,8 +11229,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// handles splitting manually</param>
|
||||
protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting)
|
||||
{
|
||||
if (m_debugPacketLevel >= 255)
|
||||
m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type);
|
||||
if (m_debugPacketLevel > 0)
|
||||
{
|
||||
bool outputPacket = true;
|
||||
|
||||
if (m_debugPacketLevel <= 255
|
||||
&& (packet.Type == PacketType.SimStats || packet.Type == PacketType.SimulatorViewerTimeMessage))
|
||||
outputPacket = false;
|
||||
|
||||
if (m_debugPacketLevel <= 200
|
||||
&&
|
||||
(packet.Type == PacketType.ImagePacket
|
||||
|| packet.Type == PacketType.ImageData
|
||||
|| packet.Type == PacketType.LayerData
|
||||
|| packet.Type == PacketType.CoarseLocationUpdate))
|
||||
outputPacket = false;
|
||||
|
||||
if (m_debugPacketLevel <= 100 && (packet.Type == PacketType.AvatarAnimation || packet.Type == PacketType.ViewerEffect))
|
||||
outputPacket = false;
|
||||
|
||||
if (outputPacket)
|
||||
m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type);
|
||||
}
|
||||
|
||||
m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting);
|
||||
}
|
||||
@@ -11316,26 +11336,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// Entryway from the client to the simulator. All UDP packets from the client will end up here
|
||||
/// </summary>
|
||||
/// <param name="Pack">OpenMetaverse.packet</param>
|
||||
public void ProcessInPacket(Packet Pack)
|
||||
public void ProcessInPacket(Packet packet)
|
||||
{
|
||||
if (!m_IsPresenceReady)
|
||||
if (m_debugPacketLevel > 0)
|
||||
{
|
||||
if (m_pendingPackets == null)
|
||||
{
|
||||
m_pendingPackets = new List<Packet>();
|
||||
}
|
||||
m_pendingPackets.Add(Pack);
|
||||
bool outputPacket = true;
|
||||
|
||||
if (m_debugPacketLevel <= 255 && packet.Type == PacketType.AgentUpdate)
|
||||
outputPacket = false;
|
||||
|
||||
if (m_debugPacketLevel <= 200 && packet.Type == PacketType.RequestImage)
|
||||
outputPacket = false;
|
||||
|
||||
if (m_debugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation))
|
||||
outputPacket = false;
|
||||
|
||||
if (outputPacket)
|
||||
m_log.DebugFormat("[CLIENT]: Packet IN {0}", packet.Type);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_debugPacketLevel >= 255)
|
||||
m_log.DebugFormat("[CLIENT]: Packet IN {0}", Pack.Type);
|
||||
|
||||
if (!ProcessPacketMethod(Pack))
|
||||
m_log.Warn("[CLIENT]: unhandled packet " + Pack.Type);
|
||||
if (!ProcessPacketMethod(packet))
|
||||
m_log.Warn("[CLIENT]: unhandled packet " + packet.Type);
|
||||
|
||||
PacketPool.Instance.ReturnPacket(Pack);
|
||||
}
|
||||
PacketPool.Instance.ReturnPacket(packet);
|
||||
}
|
||||
|
||||
private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket)
|
||||
|
||||
@@ -174,16 +174,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
UUID itemID = UUID.Zero;
|
||||
if (sp != null)
|
||||
{
|
||||
foreach(SceneObjectGroup grp in sp.Attachments)
|
||||
foreach(SceneObjectGroup grp in sp.GetAttachments(AttachmentPt))
|
||||
{
|
||||
if (grp.GetAttachmentPoint() == (byte)AttachmentPt)
|
||||
{
|
||||
itemID = grp.GetFromItemID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (itemID != UUID.Zero)
|
||||
DetachSingleAttachmentToInv(itemID, remoteClient);
|
||||
itemID = grp.GetFromItemID();
|
||||
if (itemID != UUID.Zero)
|
||||
DetachSingleAttachmentToInv(itemID, remoteClient);
|
||||
}
|
||||
}
|
||||
|
||||
if (group.GetFromItemID() == UUID.Zero)
|
||||
@@ -197,12 +193,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
|
||||
SetAttachmentInventoryStatus(remoteClient, AttachmentPt, itemID, group);
|
||||
|
||||
group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent);
|
||||
|
||||
// In case it is later dropped again, don't let
|
||||
// it get cleaned up
|
||||
group.RootPart.RemFlag(PrimFlags.TemporaryOnRez);
|
||||
group.HasGroupChanged = false;
|
||||
AttachToAgent(sp, group, AttachmentPt, attachPos, silent);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -551,6 +542,78 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
remoteClient.SendInventoryItemCreateUpdate(item, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attach this scene object to the given avatar.
|
||||
/// </summary>
|
||||
///
|
||||
/// This isn't publicly available since attachments should always perform the corresponding inventory
|
||||
/// operation (to show the attach in user inventory and update the asset with positional information).
|
||||
///
|
||||
/// <param name="sp"></param>
|
||||
/// <param name="so"></param>
|
||||
/// <param name="attachmentpoint"></param>
|
||||
/// <param name="AttachOffset"></param>
|
||||
/// <param name="silent"></param>
|
||||
protected void AttachToAgent(ScenePresence avatar, SceneObjectGroup so, uint attachmentpoint, Vector3 AttachOffset, bool silent)
|
||||
{
|
||||
// don't attach attachments to child agents
|
||||
if (avatar.IsChildAgent) return;
|
||||
|
||||
// m_log.DebugFormat("[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1}", Name, avatar.Name);
|
||||
|
||||
so.DetachFromBackup();
|
||||
|
||||
// Remove from database and parcel prim count
|
||||
m_scene.DeleteFromStorage(so.UUID);
|
||||
m_scene.EventManager.TriggerParcelPrimCountTainted();
|
||||
|
||||
so.RootPart.AttachedAvatar = avatar.UUID;
|
||||
|
||||
//Anakin Lohner bug #3839
|
||||
lock (so.Children)
|
||||
{
|
||||
foreach (SceneObjectPart p in so.Children.Values)
|
||||
{
|
||||
p.AttachedAvatar = avatar.UUID;
|
||||
}
|
||||
}
|
||||
|
||||
if (so.RootPart.PhysActor != null)
|
||||
{
|
||||
m_scene.PhysicsScene.RemovePrim(so.RootPart.PhysActor);
|
||||
so.RootPart.PhysActor = null;
|
||||
}
|
||||
|
||||
so.AbsolutePosition = AttachOffset;
|
||||
so.RootPart.AttachedPos = AttachOffset;
|
||||
so.RootPart.IsAttachment = true;
|
||||
|
||||
so.RootPart.SetParentLocalId(avatar.LocalId);
|
||||
so.SetAttachmentPoint(Convert.ToByte(attachmentpoint));
|
||||
|
||||
avatar.AddAttachment(so);
|
||||
|
||||
if (!silent)
|
||||
{
|
||||
// Killing it here will cause the client to deselect it
|
||||
// It then reappears on the avatar, deselected
|
||||
// through the full update below
|
||||
//
|
||||
if (so.IsSelected)
|
||||
{
|
||||
m_scene.SendKillObject(so.RootPart.LocalId);
|
||||
}
|
||||
|
||||
so.IsSelected = false; // fudge....
|
||||
so.ScheduleGroupForFullUpdate();
|
||||
}
|
||||
|
||||
// In case it is later dropped again, don't let
|
||||
// it get cleaned up
|
||||
so.RootPart.RemFlag(PrimFlags.TemporaryOnRez);
|
||||
so.HasGroupChanged = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3911,6 +3911,27 @@ if (m_animator.m_jumping) force.Z = m_animator.m_jumpVelocity; // add for ju
|
||||
m_attachments.Add(gobj);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the scene object attached to the given point.
|
||||
/// </summary>
|
||||
/// <param name="attachmentPoint"></param>
|
||||
/// <returns>Returns an empty list if there were no attachments at the point.</returns>
|
||||
public List<SceneObjectGroup> GetAttachments(uint attachmentPoint)
|
||||
{
|
||||
List<SceneObjectGroup> attachments = new List<SceneObjectGroup>();
|
||||
|
||||
lock (m_attachments)
|
||||
{
|
||||
foreach (SceneObjectGroup so in m_attachments)
|
||||
{
|
||||
if (attachmentPoint == so.RootPart.AttachmentPoint)
|
||||
attachments.Add(so);
|
||||
}
|
||||
}
|
||||
|
||||
return attachments;
|
||||
}
|
||||
|
||||
public bool HasAttachments()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user