Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
commit
1f1d72eba5
|
@ -327,7 +327,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
/// thread servicing the m_primFullUpdates queue after a kill. If this happens the object persists as an
|
/// thread servicing the m_primFullUpdates queue after a kill. If this happens the object persists as an
|
||||||
/// ownerless phantom.
|
/// ownerless phantom.
|
||||||
///
|
///
|
||||||
/// All manipulation of this set has to occur under a m_primFullUpdate.SyncRoot lock
|
/// All manipulation of this set has to occur under an m_entityUpdates.SyncRoot lock
|
||||||
///
|
///
|
||||||
/// </value>
|
/// </value>
|
||||||
protected HashSet<uint> m_killRecord;
|
protected HashSet<uint> m_killRecord;
|
||||||
|
@ -382,18 +382,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
public string ActiveGroupName { get { return m_activeGroupName; } }
|
public string ActiveGroupName { get { return m_activeGroupName; } }
|
||||||
public ulong ActiveGroupPowers { get { return m_activeGroupPowers; } }
|
public ulong ActiveGroupPowers { get { return m_activeGroupPowers; } }
|
||||||
public bool IsGroupMember(UUID groupID) { return m_groupPowers.ContainsKey(groupID); }
|
public bool IsGroupMember(UUID groupID) { return m_groupPowers.ContainsKey(groupID); }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// First name of the agent/avatar represented by the client
|
/// First name of the agent/avatar represented by the client
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string FirstName { get { return m_firstName; } }
|
public string FirstName { get { return m_firstName; } }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Last name of the agent/avatar represented by the client
|
/// Last name of the agent/avatar represented by the client
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string LastName { get { return m_lastName; } }
|
public string LastName { get { return m_lastName; } }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Full name of the client (first name and last name)
|
/// Full name of the client (first name and last name)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name { get { return FirstName + " " + LastName; } }
|
public string Name { get { return FirstName + " " + LastName; } }
|
||||||
|
|
||||||
public uint CircuitCode { get { return m_circuitCode; } }
|
public uint CircuitCode { get { return m_circuitCode; } }
|
||||||
public int MoneyBalance { get { return m_moneyBalance; } }
|
public int MoneyBalance { get { return m_moneyBalance; } }
|
||||||
public int NextAnimationSequenceNumber { get { return m_animationSequenceNumber++; } }
|
public int NextAnimationSequenceNumber { get { return m_animationSequenceNumber++; } }
|
||||||
|
@ -3531,6 +3535,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
EntityUpdate update;
|
EntityUpdate update;
|
||||||
while (updatesThisCall < maxUpdates && m_entityUpdates.TryDequeue(out update))
|
while (updatesThisCall < maxUpdates && m_entityUpdates.TryDequeue(out update))
|
||||||
{
|
{
|
||||||
|
// Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client
|
||||||
|
// will never receive an update after a prim kill. Even then, keeping the kill record may be a good
|
||||||
|
// safety measure.
|
||||||
|
//
|
||||||
|
// Receiving updates after kills results in undeleteable prims that persist until relog and
|
||||||
|
// currently occurs because prims can be deleted before all queued updates are sent.
|
||||||
|
if (m_killRecord.Contains(update.Entity.LocalId))
|
||||||
|
{
|
||||||
|
// m_log.WarnFormat(
|
||||||
|
// "[CLIENT]: Preventing full update for prim with local id {0} after client for user {1} told it was deleted",
|
||||||
|
// update.Entity.LocalId, Name);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (update.Entity is SceneObjectPart)
|
if (update.Entity is SceneObjectPart)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = (SceneObjectPart)update.Entity;
|
SceneObjectPart part = (SceneObjectPart)update.Entity;
|
||||||
|
|
|
@ -37,6 +37,7 @@ using OpenSim.Framework;
|
||||||
using OpenSim.Region.Framework;
|
using OpenSim.Region.Framework;
|
||||||
using OpenSim.Region.Framework.Interfaces;
|
using OpenSim.Region.Framework.Interfaces;
|
||||||
using OpenSim.Region.Framework.Scenes;
|
using OpenSim.Region.Framework.Scenes;
|
||||||
|
using OpenSim.Region.Framework.Scenes.Serialization;
|
||||||
|
|
||||||
namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
{
|
{
|
||||||
|
@ -448,12 +449,86 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
m_scene.EventManager.TriggerOnAttach(group.LocalId, itemID, UUID.Zero);
|
m_scene.EventManager.TriggerOnAttach(group.LocalId, itemID, UUID.Zero);
|
||||||
group.DetachToInventoryPrep();
|
group.DetachToInventoryPrep();
|
||||||
m_log.Debug("[ATTACHMENTS MODULE]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString());
|
m_log.Debug("[ATTACHMENTS MODULE]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString());
|
||||||
m_scene.UpdateKnownItem(remoteClient, group,group.GetFromItemID(), group.OwnerID);
|
UpdateKnownItem(remoteClient, group, group.GetFromItemID(), group.OwnerID);
|
||||||
m_scene.DeleteSceneObject(group, false);
|
m_scene.DeleteSceneObject(group, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void UpdateAttachmentPosition(IClientAPI client, SceneObjectGroup sog, Vector3 pos)
|
||||||
|
{
|
||||||
|
// If this is an attachment, then we need to save the modified
|
||||||
|
// object back into the avatar's inventory. First we save the
|
||||||
|
// attachment point information, then we update the relative
|
||||||
|
// positioning (which caused this method to get driven in the
|
||||||
|
// first place. Then we have to mark the object as NOT an
|
||||||
|
// attachment. This is necessary in order to correctly save
|
||||||
|
// and retrieve GroupPosition information for the attachment.
|
||||||
|
// Then we save the asset back into the appropriate inventory
|
||||||
|
// entry. Finally, we restore the object's attachment status.
|
||||||
|
byte attachmentPoint = sog.GetAttachmentPoint();
|
||||||
|
sog.UpdateGroupPosition(pos);
|
||||||
|
sog.RootPart.IsAttachment = false;
|
||||||
|
sog.AbsolutePosition = sog.RootPart.AttachedPos;
|
||||||
|
UpdateKnownItem(client, sog, sog.GetFromItemID(), sog.OwnerID);
|
||||||
|
sog.SetAttachmentPoint(attachmentPoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update the attachment asset for the new sog details if they have changed.
|
||||||
|
/// </summary>
|
||||||
|
///
|
||||||
|
/// This is essential for preserving attachment attributes such as permission. Unlike normal scene objects,
|
||||||
|
/// these details are not stored on the region.
|
||||||
|
///
|
||||||
|
/// <param name="remoteClient"></param>
|
||||||
|
/// <param name="grp"></param>
|
||||||
|
/// <param name="itemID"></param>
|
||||||
|
/// <param name="agentID"></param>
|
||||||
|
protected void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID)
|
||||||
|
{
|
||||||
|
if (grp != null)
|
||||||
|
{
|
||||||
|
if (!grp.HasGroupChanged)
|
||||||
|
{
|
||||||
|
m_log.WarnFormat("[ATTACHMENTS MODULE]: Save request for {0} which is unchanged", grp.UUID);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_log.DebugFormat(
|
||||||
|
"[ATTACHMENTS MODULE]: Updating asset for attachment {0}, attachpoint {1}",
|
||||||
|
grp.UUID, grp.GetAttachmentPoint());
|
||||||
|
|
||||||
|
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp);
|
||||||
|
|
||||||
|
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
|
||||||
|
item = m_scene.InventoryService.GetItem(item);
|
||||||
|
|
||||||
|
if (item != null)
|
||||||
|
{
|
||||||
|
AssetBase asset = m_scene.CreateAsset(
|
||||||
|
grp.GetPartName(grp.LocalId),
|
||||||
|
grp.GetPartDescription(grp.LocalId),
|
||||||
|
(sbyte)AssetType.Object,
|
||||||
|
Utils.StringToBytes(sceneObjectXml),
|
||||||
|
remoteClient.AgentId);
|
||||||
|
m_scene.AssetService.Store(asset);
|
||||||
|
|
||||||
|
item.AssetID = asset.FullID;
|
||||||
|
item.Description = asset.Description;
|
||||||
|
item.Name = asset.Name;
|
||||||
|
item.AssetType = asset.Type;
|
||||||
|
item.InvType = (int)InventoryType.Object;
|
||||||
|
|
||||||
|
m_scene.InventoryService.UpdateItem(item);
|
||||||
|
|
||||||
|
// this gets called when the agent logs off!
|
||||||
|
if (remoteClient != null)
|
||||||
|
remoteClient.SendInventoryItemCreateUpdate(item, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -159,7 +159,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||||
|
|
||||||
private void OnInstantMessage(IClientAPI client, GridInstantMessage im)
|
private void OnInstantMessage(IClientAPI client, GridInstantMessage im)
|
||||||
{
|
{
|
||||||
m_log.InfoFormat(
|
m_log.DebugFormat(
|
||||||
"[INVENTORY TRANSFER]: {0} IM type received from {1}",
|
"[INVENTORY TRANSFER]: {0} IM type received from {1}",
|
||||||
(InstantMessageDialog)im.dialog, client.Name);
|
(InstantMessageDialog)im.dialog, client.Name);
|
||||||
|
|
||||||
|
|
|
@ -142,9 +142,18 @@ namespace OpenSim.Region.DataSnapshot.Providers
|
||||||
node.InnerText = m_scene.RegionInfo.RegionSettings.RegionUUID.ToString();
|
node.InnerText = m_scene.RegionInfo.RegionSettings.RegionUUID.ToString();
|
||||||
xmlobject.AppendChild(node);
|
xmlobject.AppendChild(node);
|
||||||
|
|
||||||
node = nodeFactory.CreateNode(XmlNodeType.Element, "parceluuid", "");
|
if (land != null && land.LandData != null)
|
||||||
node.InnerText = land.LandData.GlobalID.ToString();
|
{
|
||||||
xmlobject.AppendChild(node);
|
node = nodeFactory.CreateNode(XmlNodeType.Element, "parceluuid", "");
|
||||||
|
node.InnerText = land.LandData.GlobalID.ToString();
|
||||||
|
xmlobject.AppendChild(node);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Something is wrong with this object. Let's not list it.
|
||||||
|
m_log.WarnFormat("[DATASNAPSHOT]: Bad data for object {0} ({1}) in region {2}", obj.Name, obj.UUID, m_scene.RegionInfo.RegionName);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
node = nodeFactory.CreateNode(XmlNodeType.Element, "location", "");
|
node = nodeFactory.CreateNode(XmlNodeType.Element, "location", "");
|
||||||
Vector3 loc = obj.AbsolutePosition;
|
Vector3 loc = obj.AbsolutePosition;
|
||||||
|
|
|
@ -30,6 +30,7 @@ using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using log4net;
|
using log4net;
|
||||||
using OpenSim.Region.DataSnapshot.Interfaces;
|
using OpenSim.Region.DataSnapshot.Interfaces;
|
||||||
|
@ -98,13 +99,21 @@ namespace OpenSim.Region.DataSnapshot
|
||||||
{
|
{
|
||||||
String path = DataFileNameFragment(provider.GetParentScene, provider.Name);
|
String path = DataFileNameFragment(provider.GetParentScene, provider.Name);
|
||||||
|
|
||||||
using (XmlTextWriter snapXWriter = new XmlTextWriter(path, Encoding.Default))
|
try
|
||||||
{
|
{
|
||||||
snapXWriter.Formatting = Formatting.Indented;
|
using (XmlTextWriter snapXWriter = new XmlTextWriter(path, Encoding.Default))
|
||||||
snapXWriter.WriteStartDocument();
|
{
|
||||||
data.WriteTo(snapXWriter);
|
snapXWriter.Formatting = Formatting.Indented;
|
||||||
snapXWriter.WriteEndDocument();
|
snapXWriter.WriteStartDocument();
|
||||||
|
data.WriteTo(snapXWriter);
|
||||||
|
snapXWriter.WriteEndDocument();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.WarnFormat("[DATASNAPSHOT]: Exception on writing to file {0}: {1}", path, e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//mark provider as not stale, parent scene as stale
|
//mark provider as not stale, parent scene as stale
|
||||||
|
@ -185,12 +194,19 @@ namespace OpenSim.Region.DataSnapshot
|
||||||
//save snapshot
|
//save snapshot
|
||||||
String path = DataFileNameScene(scene);
|
String path = DataFileNameScene(scene);
|
||||||
|
|
||||||
using (XmlTextWriter snapXWriter = new XmlTextWriter(path, Encoding.Default))
|
try
|
||||||
{
|
{
|
||||||
snapXWriter.Formatting = Formatting.Indented;
|
using (XmlTextWriter snapXWriter = new XmlTextWriter(path, Encoding.Default))
|
||||||
snapXWriter.WriteStartDocument();
|
{
|
||||||
regionElement.WriteTo(snapXWriter);
|
snapXWriter.Formatting = Formatting.Indented;
|
||||||
snapXWriter.WriteEndDocument();
|
snapXWriter.WriteStartDocument();
|
||||||
|
regionElement.WriteTo(snapXWriter);
|
||||||
|
snapXWriter.WriteEndDocument();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.WarnFormat("[DATASNAPSHOT]: Exception on writing to file {0}: {1}", path, e.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_scenes[scene] = false;
|
m_scenes[scene] = false;
|
||||||
|
@ -206,15 +222,23 @@ namespace OpenSim.Region.DataSnapshot
|
||||||
#region Helpers
|
#region Helpers
|
||||||
private string DataFileNameFragment(Scene scene, String fragmentName)
|
private string DataFileNameFragment(Scene scene, String fragmentName)
|
||||||
{
|
{
|
||||||
return Path.Combine(m_directory, Path.ChangeExtension(scene.RegionInfo.RegionName + "_" + fragmentName, "xml"));
|
return Path.Combine(m_directory, Path.ChangeExtension(Sanitize(scene.RegionInfo.RegionName + "_" + fragmentName), "xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private string DataFileNameScene(Scene scene)
|
private string DataFileNameScene(Scene scene)
|
||||||
{
|
{
|
||||||
return Path.Combine(m_directory, Path.ChangeExtension(scene.RegionInfo.RegionName, "xml"));
|
return Path.Combine(m_directory, Path.ChangeExtension(Sanitize(scene.RegionInfo.RegionName), "xml"));
|
||||||
//return (m_snapsDir + Path.DirectorySeparatorChar + scene.RegionInfo.RegionName + ".xml");
|
//return (m_snapsDir + Path.DirectorySeparatorChar + scene.RegionInfo.RegionName + ".xml");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string Sanitize(string name)
|
||||||
|
{
|
||||||
|
string invalidChars = Regex.Escape(new string(Path.GetInvalidFileNameChars()));
|
||||||
|
string invalidReStr = string.Format(@"[{0}]", invalidChars);
|
||||||
|
string newname = Regex.Replace(name, invalidReStr, "_");
|
||||||
|
return newname.Replace('.', '_');
|
||||||
|
}
|
||||||
|
|
||||||
private XmlNode MakeRegionNode(Scene scene, XmlDocument basedoc)
|
private XmlNode MakeRegionNode(Scene scene, XmlDocument basedoc)
|
||||||
{
|
{
|
||||||
XmlNode docElement = basedoc.CreateNode(XmlNodeType.Element, "region", "");
|
XmlNode docElement = basedoc.CreateNode(XmlNodeType.Element, "region", "");
|
||||||
|
|
|
@ -131,5 +131,13 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
/// A <see cref="IClientAPI"/>
|
/// A <see cref="IClientAPI"/>
|
||||||
/// </param>
|
/// </param>
|
||||||
void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient);
|
void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update the position of an attachment
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="sog"></param>
|
||||||
|
/// <param name="pos"></param>
|
||||||
|
void UpdateAttachmentPosition(IClientAPI client, SceneObjectGroup sog, Vector3 pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -31,7 +31,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public class Prioritizer
|
public class Prioritizer
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
// private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is added to the priority of all child prims, to make sure that the root prim update is sent to the
|
/// This is added to the priority of all child prims, to make sure that the root prim update is sent to the
|
||||||
|
@ -75,7 +75,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new InvalidOperationException("UpdatePrioritizationScheme not defined.");
|
throw new InvalidOperationException("UpdatePrioritizationScheme not defined.");
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adjust priority so that root prims are sent to the viewer first. This is especially important for
|
// Adjust priority so that root prims are sent to the viewer first. This is especially important for
|
||||||
|
@ -122,9 +121,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// Use group position for child prims
|
// Use group position for child prims
|
||||||
Vector3 entityPos;
|
Vector3 entityPos;
|
||||||
if (entity is SceneObjectPart)
|
if (entity is SceneObjectPart)
|
||||||
entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition;
|
{
|
||||||
|
// Can't use Scene.GetGroupByPrim() here, since the entity may have been delete from the scene
|
||||||
|
// before its scheduled update was triggered
|
||||||
|
//entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition;
|
||||||
|
entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
entityPos = entity.AbsolutePosition;
|
entityPos = entity.AbsolutePosition;
|
||||||
|
}
|
||||||
|
|
||||||
return Vector3.DistanceSquared(presencePos, entityPos);
|
return Vector3.DistanceSquared(presencePos, entityPos);
|
||||||
}
|
}
|
||||||
|
@ -144,9 +150,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// Use group position for child prims
|
// Use group position for child prims
|
||||||
Vector3 entityPos = entity.AbsolutePosition;
|
Vector3 entityPos = entity.AbsolutePosition;
|
||||||
if (entity is SceneObjectPart)
|
if (entity is SceneObjectPart)
|
||||||
entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition;
|
{
|
||||||
|
// Can't use Scene.GetGroupByPrim() here, since the entity may have been delete from the scene
|
||||||
|
// before its scheduled update was triggered
|
||||||
|
//entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition;
|
||||||
|
entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
entityPos = entity.AbsolutePosition;
|
entityPos = entity.AbsolutePosition;
|
||||||
|
}
|
||||||
|
|
||||||
if (!presence.IsChildAgent)
|
if (!presence.IsChildAgent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1799,53 +1799,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID)
|
|
||||||
{
|
|
||||||
SceneObjectGroup objectGroup = grp;
|
|
||||||
if (objectGroup != null)
|
|
||||||
{
|
|
||||||
if (!grp.HasGroupChanged)
|
|
||||||
{
|
|
||||||
m_log.InfoFormat("[ATTACHMENT]: Save request for {0} which is unchanged", grp.UUID);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_log.InfoFormat(
|
|
||||||
"[ATTACHMENT]: Updating asset for attachment {0}, attachpoint {1}",
|
|
||||||
grp.UUID, grp.GetAttachmentPoint());
|
|
||||||
|
|
||||||
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup);
|
|
||||||
|
|
||||||
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
|
|
||||||
item = InventoryService.GetItem(item);
|
|
||||||
|
|
||||||
if (item != null)
|
|
||||||
{
|
|
||||||
AssetBase asset = CreateAsset(
|
|
||||||
objectGroup.GetPartName(objectGroup.LocalId),
|
|
||||||
objectGroup.GetPartDescription(objectGroup.LocalId),
|
|
||||||
(sbyte)AssetType.Object,
|
|
||||||
Utils.StringToBytes(sceneObjectXml),
|
|
||||||
remoteClient.AgentId);
|
|
||||||
AssetService.Store(asset);
|
|
||||||
|
|
||||||
item.AssetID = asset.FullID;
|
|
||||||
item.Description = asset.Description;
|
|
||||||
item.Name = asset.Name;
|
|
||||||
item.AssetType = asset.Type;
|
|
||||||
item.InvType = (int)InventoryType.Object;
|
|
||||||
|
|
||||||
InventoryService.UpdateItem(item);
|
|
||||||
|
|
||||||
// this gets called when the agent loggs off!
|
|
||||||
if (remoteClient != null)
|
|
||||||
{
|
|
||||||
remoteClient.SendInventoryItemCreateUpdate(item, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public UUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, UUID AgentId, out UUID itemID)
|
public UUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, UUID AgentId, out UUID itemID)
|
||||||
{
|
{
|
||||||
itemID = UUID.Zero;
|
itemID = UUID.Zero;
|
||||||
|
|
|
@ -3608,18 +3608,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ILandObject GetParcelAtPoint(float x, float y)
|
|
||||||
{
|
|
||||||
foreach (var parcel in AllParcels())
|
|
||||||
{
|
|
||||||
if (parcel.ContainsPoint((int)x,(int)y))
|
|
||||||
{
|
|
||||||
return parcel;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update an AgentCircuitData object with new information
|
/// Update an AgentCircuitData object with new information
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -70,7 +70,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A user will arrive shortly, set up appropriate credentials so it can connect
|
/// A user will arrive shortly, set up appropriate credentials so it can connect
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event ExpectUserDelegate OnExpectUser;
|
// public event ExpectUserDelegate OnExpectUser;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Prim will arrive shortly
|
/// A Prim will arrive shortly
|
||||||
|
@ -80,7 +80,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A new prim has arrived
|
/// A new prim has arrived
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event PrimCrossing OnPrimCrossingIntoRegion;
|
// public event PrimCrossing OnPrimCrossingIntoRegion;
|
||||||
|
|
||||||
///// <summary>
|
///// <summary>
|
||||||
///// A New Region is up and available
|
///// A New Region is up and available
|
||||||
|
@ -90,7 +90,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// We have a child agent for this avatar and we're getting a status update about it
|
/// We have a child agent for this avatar and we're getting a status update about it
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event ChildAgentUpdate OnChildAgentUpdate;
|
// public event ChildAgentUpdate OnChildAgentUpdate;
|
||||||
//public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar;
|
//public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -1289,37 +1289,21 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="localID"></param>
|
/// <param name="localID"></param>
|
||||||
/// <param name="pos"></param>
|
/// <param name="pos"></param>
|
||||||
/// <param name="remoteClient"></param>
|
/// <param name="remoteClient"></param>
|
||||||
protected internal void UpdatePrimPosition(uint localID, Vector3 pos, IClientAPI remoteClient)
|
public void UpdatePrimPosition(uint localID, Vector3 pos, IClientAPI remoteClient)
|
||||||
{
|
{
|
||||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||||
|
|
||||||
if (group != null)
|
if (group != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Vector3 oldPos = group.AbsolutePosition;
|
|
||||||
if (group.IsAttachment || (group.RootPart.Shape.PCode == 9 && group.RootPart.Shape.State != 0))
|
if (group.IsAttachment || (group.RootPart.Shape.PCode == 9 && group.RootPart.Shape.State != 0))
|
||||||
{
|
{
|
||||||
|
if (m_parentScene.AttachmentsModule != null)
|
||||||
// If this is an attachment, then we need to save the modified
|
m_parentScene.AttachmentsModule.UpdateAttachmentPosition(remoteClient, group, pos);
|
||||||
// object back into the avatar's inventory. First we save the
|
|
||||||
// attachment point information, then we update the relative
|
|
||||||
// positioning (which caused this method to get driven in the
|
|
||||||
// first place. Then we have to mark the object as NOT an
|
|
||||||
// attachment. This is necessary in order to correctly save
|
|
||||||
// and retrieve GroupPosition information for the attachment.
|
|
||||||
// Then we save the asset back into the appropriate inventory
|
|
||||||
// entry. Finally, we restore the object's attachment status.
|
|
||||||
|
|
||||||
byte attachmentPoint = group.GetAttachmentPoint();
|
|
||||||
group.UpdateGroupPosition(pos);
|
|
||||||
group.RootPart.IsAttachment = false;
|
|
||||||
group.AbsolutePosition = group.RootPart.AttachedPos;
|
|
||||||
m_parentScene.UpdateKnownItem(remoteClient, group, group.GetFromItemID(), group.OwnerID);
|
|
||||||
group.SetAttachmentPoint(attachmentPoint);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId) && m_parentScene.Permissions.CanObjectEntry(group.UUID, false, pos))
|
if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId)
|
||||||
|
&& m_parentScene.Permissions.CanObjectEntry(group.UUID, false, pos))
|
||||||
{
|
{
|
||||||
group.UpdateGroupPosition(pos);
|
group.UpdateGroupPosition(pos);
|
||||||
}
|
}
|
||||||
|
@ -1328,14 +1312,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
/// Update the texture entry of the given prim.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
///
|
||||||
|
/// A texture entry is an object that contains details of all the textures of the prim's face. In this case,
|
||||||
|
/// the texture is given in its byte serialized form.
|
||||||
|
///
|
||||||
/// <param name="localID"></param>
|
/// <param name="localID"></param>
|
||||||
/// <param name="texture"></param>
|
/// <param name="texture"></param>
|
||||||
/// <param name="remoteClient"></param>
|
/// <param name="remoteClient"></param>
|
||||||
protected internal void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient)
|
protected internal void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient)
|
||||||
{
|
{
|
||||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
SceneObjectGroup group = GetGroupByPrim(localID);
|
||||||
|
|
||||||
if (group != null)
|
if (group != null)
|
||||||
{
|
{
|
||||||
if (m_parentScene.Permissions.CanEditObject(group.UUID,remoteClient.AgentId))
|
if (m_parentScene.Permissions.CanEditObject(group.UUID,remoteClient.AgentId))
|
||||||
|
@ -1700,8 +1689,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
SceneObjectPart newRoot = newSet[0];
|
SceneObjectPart newRoot = newSet[0];
|
||||||
newSet.RemoveAt(0);
|
newSet.RemoveAt(0);
|
||||||
|
|
||||||
List<uint> linkIDs = new List<uint>();
|
|
||||||
|
|
||||||
foreach (SceneObjectPart newChild in newSet)
|
foreach (SceneObjectPart newChild in newSet)
|
||||||
newChild.UpdateFlag = 0;
|
newChild.UpdateFlag = 0;
|
||||||
|
|
||||||
|
|
|
@ -4727,20 +4727,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (ParentGroup == null || ParentGroup.IsDeleted)
|
if (ParentGroup == null || ParentGroup.IsDeleted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Vector3 lPos = OffsetPosition;
|
if (IsAttachment && ParentGroup.RootPart != this)
|
||||||
|
return;
|
||||||
if (IsAttachment)
|
|
||||||
{
|
|
||||||
if (ParentGroup.RootPart != this)
|
|
||||||
return;
|
|
||||||
|
|
||||||
lPos = ParentGroup.RootPart.AttachedPos;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (ParentGroup.RootPart == this)
|
|
||||||
lPos = AbsolutePosition;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Causes this thread to dig into the Client Thread Data.
|
// Causes this thread to dig into the Client Thread Data.
|
||||||
// Remember your locking here!
|
// Remember your locking here!
|
||||||
|
|
|
@ -577,7 +577,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public SceneObjectGroup GetRezReadySceneObject(TaskInventoryItem item)
|
public SceneObjectGroup GetRezReadySceneObject(TaskInventoryItem item)
|
||||||
{
|
{
|
||||||
UUID ownerID = item.OwnerID;
|
|
||||||
AssetBase rezAsset = m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString());
|
AssetBase rezAsset = m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString());
|
||||||
|
|
||||||
if (null == rezAsset)
|
if (null == rezAsset)
|
||||||
|
|
|
@ -2326,15 +2326,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
m_perfMonMS = Util.EnvironmentTickCount();
|
m_perfMonMS = Util.EnvironmentTickCount();
|
||||||
|
|
||||||
PhysicsActor actor = m_physicsActor;
|
|
||||||
Vector3 velocity = (actor != null) ? actor.Velocity : Vector3.Zero;
|
|
||||||
|
|
||||||
Vector3 pos = m_pos;
|
Vector3 pos = m_pos;
|
||||||
pos.Z += m_appearance.HipOffset;
|
pos.Z += m_appearance.HipOffset;
|
||||||
|
|
||||||
//m_log.DebugFormat("[SCENEPRESENCE]: TerseUpdate: Pos={0} Rot={1} Vel={2}", m_pos, m_bodyRot, m_velocity);
|
//m_log.DebugFormat("[SCENEPRESENCE]: TerseUpdate: Pos={0} Rot={1} Vel={2}", m_pos, m_bodyRot, m_velocity);
|
||||||
|
|
||||||
remoteClient.SendPrimUpdate(this, PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity);
|
remoteClient.SendPrimUpdate(
|
||||||
|
this,
|
||||||
|
PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity
|
||||||
|
| PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity);
|
||||||
|
|
||||||
m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
|
m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
|
||||||
m_scene.StatsReporter.AddAgentUpdates(1);
|
m_scene.StatsReporter.AddAgentUpdates(1);
|
||||||
|
|
Loading…
Reference in New Issue