Merge branch 'prephysics_kitty' into prephysics

dsg
Huaiyu (Kitty) Liu 2011-01-14 09:56:43 -08:00
commit 69476339df
6 changed files with 43 additions and 7 deletions

View File

@ -89,7 +89,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
//Register for local Scene events //Register for local Scene events
m_scene.EventManager.OnPostSceneCreation += OnPostSceneCreation; m_scene.EventManager.OnPostSceneCreation += OnPostSceneCreation;
m_scene.EventManager.OnObjectBeingRemovedFromScene += new EventManager.ObjectBeingRemovedFromScene(RegionSyncModule_OnObjectBeingRemovedFromScene); //m_scene.EventManager.OnObjectBeingRemovedFromScene += new EventManager.ObjectBeingRemovedFromScene(RegionSyncModule_OnObjectBeingRemovedFromScene);
} }
@ -1273,7 +1273,8 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
/// only be triggered by an object removal that is initiated locally. /// only be triggered by an object removal that is initiated locally.
/// </summary> /// </summary>
/// <param name="sog"></param> /// <param name="sog"></param>
private void RegionSyncModule_OnObjectBeingRemovedFromScene(SceneObjectGroup sog) //private void RegionSyncModule_OnObjectBeingRemovedFromScene(SceneObjectGroup sog)
public void SendDeleteObject(SceneObjectGroup sog)
{ {
//m_log.DebugFormat("RegionSyncModule_OnObjectBeingRemovedFromScene called at time {0}:{1}:{2}", DateTime.Now.Minute, DateTime.Now.Second, DateTime.Now.Millisecond); //m_log.DebugFormat("RegionSyncModule_OnObjectBeingRemovedFromScene called at time {0}:{1}:{2}", DateTime.Now.Minute, DateTime.Now.Second, DateTime.Now.Millisecond);

View File

@ -63,7 +63,7 @@ namespace OpenSim.Region.Framework.Interfaces
//void SendUpdatesToSynchronizeState(List<SceneObjectGroup> sog); //void SendUpdatesToSynchronizeState(List<SceneObjectGroup> sog);
void SendSceneUpdates(); void SendSceneUpdates();
void SendTerrainUpdates(string lastUpdateActorID); void SendTerrainUpdates(string lastUpdateActorID);
//void SendDeleteObject(SceneObjectGroup sog); void SendDeleteObject(SceneObjectGroup sog);
//For propogating scene events to other actors //For propogating scene events to other actors
void PublishSceneEvent(EventManager.EventNames ev, Object[] evArgs); void PublishSceneEvent(EventManager.EventNames ev, Object[] evArgs);

View File

@ -376,6 +376,17 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart part = GetSceneObjectPart(primID); SceneObjectPart part = GetSceneObjectPart(primID);
SceneObjectGroup group = part.ParentGroup; SceneObjectGroup group = part.ParentGroup;
if (null == group)
{
m_log.ErrorFormat(
"[PRIM INVENTORY]: " +
"Prim inventory update requested for item ID {0} in prim ID {1} but this prim does not exist",
itemID, primID);
return new ArrayList();
}
if (isScriptRunning) if (isScriptRunning)
{ {
m_log.Debug("To RemoveScriptInstance"); m_log.Debug("To RemoveScriptInstance");
@ -385,6 +396,16 @@ namespace OpenSim.Region.Framework.Scenes
// Retrieve item // Retrieve item
TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemID); TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemID);
if (null == item)
{
m_log.ErrorFormat(
"[PRIM INVENTORY]: Tried to retrieve item ID {0} from prim {1}, {2} for caps script update "
+ " but the item does not exist in this inventory",
itemID, part.Name, part.UUID);
return new ArrayList();
}
// Update item with new asset // Update item with new asset
item.AssetID = newAssetID; item.AssetID = newAssetID;
group.UpdateInventoryItem(item); group.UpdateInventoryItem(item);

View File

@ -662,8 +662,7 @@ namespace OpenSim.Region.Framework.Scenes
if (UnlinkSceneObject(group, false)) if (UnlinkSceneObject(group, false))
{ {
//For object removals caused by remote events (by other actors), do not trigger local event ObjectBeingRemovedFromScene EventManager.TriggerObjectBeingRemovedFromScene(group);
//EventManager.TriggerObjectBeingRemovedFromScene(group);
EventManager.TriggerParcelPrimCountTainted(); EventManager.TriggerParcelPrimCountTainted();
} }
@ -2430,8 +2429,16 @@ namespace OpenSim.Region.Framework.Scenes
{ {
part.SyncInfoUpdate(); part.SyncInfoUpdate();
} }
//end of SYMMETRIC SYNC *
* */ * */
//Propagate the RemovedObject message
if (RegionSyncModule != null)
{
RegionSyncModule.SendDeleteObject(group);
}
//end of SYMMETRIC SYNC
} }
/// <summary> /// <summary>
@ -3592,9 +3599,12 @@ namespace OpenSim.Region.Framework.Scenes
ForEachClient(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, localID); }); ForEachClient(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, localID); });
//SYMMETRIC SYNC: object remove should be handled through RegionSyncModule
// REGION SYNC // REGION SYNC
/*
if( IsSyncedServer() ) if( IsSyncedServer() )
RegionSyncServerModule.DeleteObject(m_regionHandle, localID, part); RegionSyncServerModule.DeleteObject(m_regionHandle, localID, part);
* */
} }
#endregion #endregion

View File

@ -1164,6 +1164,7 @@ namespace OpenSim.Region.Framework.Scenes
//return; //return;
} }
* */ * */
//end of SYMMETRIC SYNC
Scene.ForEachScenePresence(delegate(ScenePresence avatar) Scene.ForEachScenePresence(delegate(ScenePresence avatar)
{ {

View File

@ -539,6 +539,9 @@ namespace OpenSim.Region.Framework.Scenes
//m_inventorySerial += 2; //m_inventorySerial += 2;
HasInventoryChanged = true; HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true; m_part.ParentGroup.HasGroupChanged = true;
//SYMMETRIC SYNC: add ScheduleFullUpdate to enable synchronization across actors
m_part.ScheduleFullUpdate();
} }
/// <summary> /// <summary>