Merge commit 'de19dc3024e5359f594d0a32c593d905163c24ea' into bigmerge

Conflicts:
	OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
	OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
	OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
avinationmerge
Melanie 2011-10-11 21:21:44 +01:00
commit cc1fe354d0
8 changed files with 54 additions and 44 deletions

View File

@ -4173,8 +4173,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
while (updatesThisCall < m_maxUpdates) while (updatesThisCall < m_maxUpdates)
{ {
lock (m_entityProps.SyncRoot) lock (m_entityProps.SyncRoot)
if (!m_entityProps.TryDequeue(out iupdate, out timeinqueue)) if (!m_entityProps.TryDequeue(out iupdate, out timeinqueue))
break; break;
ObjectPropertyUpdate update = (ObjectPropertyUpdate)iupdate; ObjectPropertyUpdate update = (ObjectPropertyUpdate)iupdate;
if (update.SendFamilyProps) if (update.SendFamilyProps)

View File

@ -101,7 +101,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
part.ParentGroup.HasGroupChanged = true; part.ParentGroup.HasGroupChanged = true;
part.GetProperties(client); part.SendPropertiesToClient(client);
} }
public bool BuyObject(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType, int salePrice) public bool BuyObject(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType, int salePrice)
@ -142,7 +142,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
part.SalePrice = 10; part.SalePrice = 10;
group.HasGroupChanged = true; group.HasGroupChanged = true;
part.GetProperties(remoteClient); part.SendPropertiesToClient(remoteClient);
part.TriggerScriptChangedEvent(Changed.OWNER); part.TriggerScriptChangedEvent(Changed.OWNER);
group.ResumeScripts(); group.ResumeScripts();
part.ScheduleFullUpdate(); part.ScheduleFullUpdate();

View File

@ -261,7 +261,7 @@ namespace OpenSim.Region.Framework.Scenes
item.AssetID = asset.FullID; item.AssetID = asset.FullID;
group.UpdateInventoryItem(item); group.UpdateInventoryItem(item);
part.GetProperties(remoteClient); part.SendPropertiesToClient(remoteClient);
// Trigger rerunning of script (use TriggerRezScript event, see RezScript) // Trigger rerunning of script (use TriggerRezScript event, see RezScript)
ArrayList errors = new ArrayList(); ArrayList errors = new ArrayList();
@ -1005,7 +1005,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
group.RemoveInventoryItem(localID, itemID); group.RemoveInventoryItem(localID, itemID);
part.GetProperties(remoteClient); part.SendPropertiesToClient(remoteClient);
} }
} }
@ -1283,7 +1283,7 @@ namespace OpenSim.Region.Framework.Scenes
if (TryGetScenePresence(srcTaskItem.OwnerID, out avatar)) if (TryGetScenePresence(srcTaskItem.OwnerID, out avatar))
{ {
destPart.GetProperties(avatar.ControllingClient); destPart.SendPropertiesToClient(avatar.ControllingClient);
} }
} }
@ -1446,7 +1446,7 @@ namespace OpenSim.Region.Framework.Scenes
m_log.InfoFormat( m_log.InfoFormat(
"[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}", "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}",
item.Name, primLocalID, remoteClient.Name); item.Name, primLocalID, remoteClient.Name);
part.GetProperties(remoteClient); part.SendPropertiesToClient(remoteClient);
if (!Permissions.BypassPermissions()) if (!Permissions.BypassPermissions())
{ {
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
@ -1534,7 +1534,7 @@ namespace OpenSim.Region.Framework.Scenes
if (part.Inventory.UpdateInventoryItem(itemInfo)) if (part.Inventory.UpdateInventoryItem(itemInfo))
{ {
part.GetProperties(remoteClient); part.SendPropertiesToClient(remoteClient);
} }
} }
} }
@ -1586,7 +1586,7 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.InfoFormat("[PRIMINVENTORY]: " + // m_log.InfoFormat("[PRIMINVENTORY]: " +
// "Rezzed script {0} into prim local ID {1} for user {2}", // "Rezzed script {0} into prim local ID {1} for user {2}",
// item.inventoryName, localID, remoteClient.Name); // item.inventoryName, localID, remoteClient.Name);
part.GetProperties(remoteClient); part.SendPropertiesToClient(remoteClient);
part.ParentGroup.ResumeScripts(); part.ParentGroup.ResumeScripts();
} }
else else
@ -1644,7 +1644,7 @@ namespace OpenSim.Region.Framework.Scenes
taskItem.AssetID = asset.FullID; taskItem.AssetID = asset.FullID;
part.Inventory.AddInventoryItem(taskItem, false); part.Inventory.AddInventoryItem(taskItem, false);
part.GetProperties(remoteClient); part.SendPropertiesToClient(remoteClient);
part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0); part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0);
part.ParentGroup.ResumeScripts(); part.ParentGroup.ResumeScripts();
@ -1758,7 +1758,7 @@ namespace OpenSim.Region.Framework.Scenes
if (TryGetScenePresence(srcTaskItem.OwnerID, out avatar)) if (TryGetScenePresence(srcTaskItem.OwnerID, out avatar))
{ {
destPart.GetProperties(avatar.ControllingClient); destPart.SendPropertiesToClient(avatar.ControllingClient);
} }
} }
@ -2217,7 +2217,7 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart part = GetSceneObjectPart(localID); SceneObjectPart part = GetSceneObjectPart(localID);
if (part == null) if (part == null)
continue; continue;
part.GetProperties(remoteClient); part.SendPropertiesToClient(remoteClient);
} }
} }

View File

@ -144,7 +144,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (((SceneObjectGroup) ent).LocalId == primLocalID) if (((SceneObjectGroup) ent).LocalId == primLocalID)
{ {
((SceneObjectGroup) ent).GetProperties(remoteClient); ((SceneObjectGroup) ent).SendPropertiesToClient(remoteClient);
((SceneObjectGroup) ent).IsSelected = true; ((SceneObjectGroup) ent).IsSelected = true;
// A prim is only tainted if it's allowed to be edited by the person clicking it. // A prim is only tainted if it's allowed to be edited by the person clicking it.
if (Permissions.CanEditObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId) if (Permissions.CanEditObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId)
@ -167,7 +167,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (part.LocalId == primLocalID) if (part.LocalId == primLocalID)
{ {
part.GetProperties(remoteClient); part.SendPropertiesToClient(remoteClient);
foundPrim = true; foundPrim = true;
break; break;
} }

View File

@ -2104,8 +2104,6 @@ namespace OpenSim.Region.Framework.Scenes
#endregion #endregion
#region Scheduling
public override void Update() public override void Update()
{ {
// Check that the group was not deleted before the scheduled update // Check that the group was not deleted before the scheduled update
@ -2256,7 +2254,14 @@ namespace OpenSim.Region.Framework.Scenes
parts[i].SendTerseUpdateToAllClients(); parts[i].SendTerseUpdateToAllClients();
} }
#endregion /// <summary>
/// Send metadata about the root prim (name, description, sale price, etc.) to a client.
/// </summary>
/// <param name="client"></param>
public void SendPropertiesToClient(IClientAPI client)
{
m_rootPart.SendPropertiesToClient(client);
}
#region SceneGroupPart Methods #region SceneGroupPart Methods
@ -2750,15 +2755,6 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
/// <summary>
/// Return metadata about a prim (name, description, sale price, etc.)
/// </summary>
/// <param name="client"></param>
public void GetProperties(IClientAPI client)
{
m_rootPart.GetProperties(client);
}
/// <summary> /// <summary>
/// Set the name of a prim /// Set the name of a prim
/// </summary> /// </summary>

View File

@ -1357,8 +1357,6 @@ namespace OpenSim.Region.Framework.Scenes
#endregion Public Properties with only Get #endregion Public Properties with only Get
#region Private Methods
private uint ApplyMask(uint val, bool set, uint mask) private uint ApplyMask(uint val, bool set, uint mask)
{ {
if (set) if (set)
@ -1371,14 +1369,35 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
private void SendObjectPropertiesToClient(UUID AgentID) /// <summary>
/// Clear all pending updates of parts to clients
/// </summary>
private void ClearUpdateSchedule()
{
m_updateFlag = 0;
}
/// <summary>
/// Send this part's properties (name, description, inventory serial, base mask, etc.) to a client
/// </summary>
/// <param name="client"></param>
public void SendPropertiesToClient(IClientAPI client)
{
client.SendObjectPropertiesReply(this);
}
/// <summary>
/// For the scene object group to which this part belongs, send that scene object's root part properties to a client.
/// </summary>
/// <param name="AgentID"></param>
private void SendRootPartPropertiesToClient(UUID AgentID)
{ {
m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
{ {
// Ugly reference :( // Ugly reference :(
if (avatar.UUID == AgentID) if (avatar.UUID == AgentID)
{ {
m_parentGroup.GetProperties(avatar.ControllingClient); m_parentGroup.SendPropertiesToClient(avatar.ControllingClient);
} }
}); });
} }
@ -1407,8 +1426,6 @@ namespace OpenSim.Region.Framework.Scenes
// } // }
// } // }
#endregion Private Methods
#region Public Methods #region Public Methods
public void ResetExpire() public void ResetExpire()
@ -2077,11 +2094,6 @@ namespace OpenSim.Region.Framework.Scenes
return Vector3.Zero; return Vector3.Zero;
} }
public void GetProperties(IClientAPI client)
{
client.SendObjectPropertiesReply(this);
}
/// <summary> /// <summary>
/// Method for a prim to get it's world position from the group. /// Method for a prim to get it's world position from the group.
/// </summary> /// </summary>
@ -3500,7 +3512,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
_groupID = groupID; _groupID = groupID;
if (client != null) if (client != null)
GetProperties(client); SendPropertiesToClient(client);
m_updateFlag = 2; m_updateFlag = 2;
} }
@ -4320,10 +4332,10 @@ namespace OpenSim.Region.Framework.Scenes
break; break;
} }
SendFullUpdateToAllClients(); SendFullUpdateToAllClients();
SendObjectPropertiesToClient(AgentID); SendRootPartPropertiesToClient(AgentID);
} }
} }

View File

@ -1107,10 +1107,12 @@ namespace OpenSim.Region.Framework.Scenes
if (m_inventoryFileData.Length > 2) if (m_inventoryFileData.Length > 2)
{ {
xferManager.AddNewFile(m_inventoryFileName, m_inventoryFileData); xferManager.AddNewFile(m_inventoryFileName, m_inventoryFileData);
client.SendTaskInventory(m_part.UUID, (short)m_inventorySerial,
Util.StringToBytes256(m_inventoryFileName));
return;
} }
client.SendTaskInventory(m_part.UUID, (short)m_inventorySerial, client.SendTaskInventory(m_part.UUID, 0, new byte[0]);
Util.StringToBytes256(m_inventoryFileName));
} }
/// <summary> /// <summary>

View File

@ -3953,7 +3953,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
parentPrim.ScheduleGroupForFullUpdate(); parentPrim.ScheduleGroupForFullUpdate();
if (client != null) if (client != null)
parentPrim.GetProperties(client); parentPrim.SendPropertiesToClient(client);
ScriptSleep(1000); ScriptSleep(1000);
} }