Merge branch 'dev_perPropertyTS' into dev

Conflicts:
	OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
dsg
Huaiyu (Kitty) Liu 2011-05-03 16:55:23 -07:00
commit cd70c3ff56
33 changed files with 4928 additions and 712 deletions

View File

@ -386,7 +386,7 @@ namespace OpenSim.Framework
public string RemotingAddress;
public UUID ScopeID = UUID.Zero;
//SYMMETRIC SYNC
//DSG SYNC
//IP:port for the symmetric sync listener this actor is configured to connect to
private string m_syncServerAddr = String.Empty;
private int m_syncServerPort;
@ -398,7 +398,7 @@ namespace OpenSim.Framework
private int m_physicsSyncServerPort;
private uint m_quarkLocX;
private uint m_quarkLocY;
//end of SYMMETRIC SYNC
//end of DSG SYNC
// Apparently, we're applying the same estatesettings regardless of whether it's local or remote.
@ -694,7 +694,7 @@ namespace OpenSim.Framework
get { return Util.UIntsToLong((RegionLocX * (uint) Constants.RegionSize), (RegionLocY * (uint) Constants.RegionSize)); }
}
//SYMMETRIC SYNC
//DSG SYNC
public string SyncServerAddress
{
get { return m_syncServerAddr; }
@ -731,7 +731,7 @@ namespace OpenSim.Framework
get { return m_quarkLocY; }
set { m_quarkLocY = value; }
}
//end of SYMMETRIC SYNC
//end of DSG SYNC
public void SetEndPoint(string ipaddr, int port)
{
@ -886,7 +886,7 @@ namespace OpenSim.Framework
//
ScopeID = new UUID(config.GetString("ScopeID", UUID.Zero.ToString()));
// SYMMETRIC SYNC
// DSG SYNC
m_syncServerAddr = config.GetString("SyncServerAddress", String.Empty);
m_syncServerPort = config.GetInt("SyncServerPort", -1);
//if either IP or port is not configured, we set IP to empty to raise warning later
@ -911,7 +911,7 @@ namespace OpenSim.Framework
m_quarkLocY = Convert.ToUInt32(quarkLocElements[1]);
// end of SYMMETRIC SYNC
// end of DSG SYNC
}

View File

@ -411,11 +411,11 @@ namespace OpenSim
scene.StartTimer();
//SYMMETRIC SYNC
//DSG SYNC
//For INonSharedRegionModule, there is no more PostInitialise(). So we trigger OnPostSceneCreation event here
//to let the Sync modules to do their work once all modules are loaded and scene has interfaces to all of them.
scene.EventManager.TriggerOnPostSceneCreation(scene);
//end of SYMMETRIC SYNC
//end of DSG SYNC
return clientServer;
}

View File

@ -612,7 +612,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
so.IsSelected = false; // fudge....
//so.ScheduleGroupForFullUpdate();
so.ScheduleGroupForFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.FullUpdate}); //just force it to sychronize all properties
so.ScheduleGroupForFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.FullUpdate}); //just force it to sychronize all properties
}
// In case it is later dropped again, don't let

View File

@ -355,7 +355,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
}
//rootGroup.ScheduleGroupForFullUpdate();
rootGroup.ScheduleGroupForFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.FullUpdate}); //seems like new object
rootGroup.ScheduleGroupForFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.FullUpdate}); //seems like new object
pos = m_scene.GetNewRezLocation(Vector3.Zero, rootpos, UUID.Zero, rot, (byte)1, 1, true, allparts[0].GroupScale(), false);
responsedata["int_response_code"] = 200; //501; //410; //404;

View File

@ -1603,7 +1603,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
{
grp.OffsetForNewRegion(oldGroupPosition);
//grp.ScheduleGroupForFullUpdate();
grp.ScheduleGroupForFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Position});
grp.ScheduleGroupForFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Position});
}
}

View File

@ -609,8 +609,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
{
// m_log.DebugFormat("[INVENTORY ACCESS MODULE]: RezObject for {0}, item {1}", remoteClient.Name, itemID);
// m_log.DebugFormat("[INVENTORY ACCESS MODULE]: RezObject for {0}, item {1}", remoteClient.Name, itemID);
byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0);
Vector3 scale = new Vector3(0.5f, 0.5f, 0.5f);
Vector3 pos = m_Scene.GetNewRezLocation(
@ -696,15 +696,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
itemId, n.OuterXml);
objlist.Add(g);
XmlElement el = (XmlElement)n;
string rawX = el.GetAttribute("offsetx");
string rawY = el.GetAttribute("offsety");
string rawZ = el.GetAttribute("offsetz");
//
// m_log.DebugFormat(
// "[INVENTORY ACCESS MODULE]: Converting coalesced object {0} offset <{1}, {2}, {3}>",
// g.Name, rawX, rawY, rawZ);
//
// m_log.DebugFormat(
// "[INVENTORY ACCESS MODULE]: Converting coalesced object {0} offset <{1}, {2}, {3}>",
// g.Name, rawX, rawY, rawZ);
float x = Convert.ToSingle(rawX);
float y = Convert.ToSingle(rawY);
float z = Convert.ToSingle(rawZ);
@ -730,7 +730,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
return null;
}
for (int i = 0 ; i < objlist.Count ; i++ )
for (int i = 0; i < objlist.Count; i++)
{
group = objlist[i];
@ -770,8 +770,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
// can reflect that, if not, we set it's position in world.
if (!attachment)
{
group.ScheduleGroupForFullUpdate(null);
group.ScheduleGroupForFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.FullUpdate});
group.AbsolutePosition = pos + veclist[i];
}
else
@ -828,7 +828,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
}
part.GroupMask = 0; // DO NOT propagate here
}
group.ApplyNextOwnerPermissions();
}
}
@ -853,12 +853,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{
if (group.RootPart.Shape.PCode == (byte)PCode.Prim)
group.ClearPartAttachmentData();
// Fire on_rez
group.CreateScriptInstances(0, true, m_Scene.DefaultScriptEngine, 1);
rootPart.ParentGroup.ResumeScripts();
rootPart.ScheduleFullUpdate(null);
rootPart.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>() { SceneObjectPartSyncProperties.FullUpdate });
}
}
@ -884,6 +883,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
return null;
}
protected void AddUserData(SceneObjectGroup sog)
{
UserManagementModule.AddUser(sog.RootPart.CreatorID, sog.RootPart.CreatorData);

View File

@ -318,7 +318,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
RegionSyncMessage.HandleSuccess(LogHeader(), msg, String.Format("Syncing to region \"{0}\"", m_regionName));
return;
}
//SYMMETRIC SYNC: do not handle terrian and object updates
//DSG SYNC: do not handle terrian and object updates
case RegionSyncMessage.MsgType.Terrain:
{
if(!m_symSync)
@ -378,7 +378,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
}
return;
}
//end of SYMMETRIC SYNC
//end of DSG SYNC
case RegionSyncMessage.MsgType.NewAvatar:
{
// Get the data from message and error check
@ -854,13 +854,13 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
Send(new RegionSyncMessage(RegionSyncMessage.MsgType.RegionName, m_scene.RegionInfo.RegionName));
m_log.WarnFormat("Sending region name: \"{0}\"", m_scene.RegionInfo.RegionName);
//SYMMETRIC SYNC: commenting out terrian and object updates
//DSG SYNC: commenting out terrian and object updates
if (!m_symSync)
{
Send(new RegionSyncMessage(RegionSyncMessage.MsgType.GetTerrain));
Send(new RegionSyncMessage(RegionSyncMessage.MsgType.GetObjects));
}
//end of SYMMETRIC SYNC
//end of DSG SYNC
Send(new RegionSyncMessage(RegionSyncMessage.MsgType.GetAvatars));
// Register for events which will be forwarded to authoritative scene
@ -910,11 +910,11 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
// Register for interesting client events which will be forwarded to auth sim
// These are the raw packet data blocks from the client, intercepted and sent up to the sim
client.OnAgentUpdateRaw += HandleAgentUpdateRaw;
//SYMMETRIC SYNC: do not subscribe to OnChatFromClientRaw: RegionSyncModule + Scene.EventManager will handle this.
//DSG SYNC: do not subscribe to OnChatFromClientRaw: RegionSyncModule + Scene.EventManager will handle this.
//client.OnChatFromClientRaw += HandleChatFromClientRaw;
client.OnAgentRequestSit += HandleAgentRequestSit;
client.OnAgentSit += HandleAgentSit;
//SYMMETRIC SYNC: do not subscribe to OnGrabObject, OnGrabUpdate, and OnDeGrabObject: RegionSyncModule + Scene.EventManager will handle this.
//DSG SYNC: do not subscribe to OnGrabObject, OnGrabUpdate, and OnDeGrabObject: RegionSyncModule + Scene.EventManager will handle this.
//client.OnGrabObject += HandleGrabObject;
//client.OnGrabUpdate += HandleGrabUpdate;
//client.OnDeGrabObject += HandleDeGrabObject;

View File

@ -202,10 +202,10 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
// *** This is the main receive loop thread for each connected client
private void ReceiveLoop()
{
//SYMMETRIC SYNC: commenting out the code for handling chats
//DSG SYNC: commenting out the code for handling chats
// m_scene.EventManager.OnChatFromClient += new EventManager.ChatFromClientEvent(EventManager_OnChatFromClient);
// m_scene.EventManager.OnChatFromWorld += new EventManager.ChatFromWorldEvent(EventManager_OnChatFromClient);
//end of SYMMETRIC SYNC
//end of DSG SYNC
// Reset stats and time
@ -327,7 +327,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
RegionSyncMessage.HandleSuccess(LogHeader, msg, String.Format("Syncing to region \"{0}\"", m_regionName));
return;
}
//SYMMETRIC SYNC: do not handle terrian and object updates
//DSG SYNC: do not handle terrian and object updates
case RegionSyncMessage.MsgType.GetTerrain:
{
/*
@ -358,7 +358,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
* */
return;
}
//end of SYMMETRIC SYNC
//end of DSG SYNC
case RegionSyncMessage.MsgType.GetAvatars:
{
m_scene.ForEachScenePresence(delegate(ScenePresence presence)

View File

@ -151,7 +151,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
//m_scene.EventManager.OnNewPresence += new EventManager.OnNewPresenceDelegate(EventManager_OnNewPresence);
m_scene.EventManager.OnRemovePresence += new EventManager.OnRemovePresenceDelegate(EventManager_OnRemovePresence);
//SYMMETRIC SYNC: do not handle object updates
//DSG SYNC: do not handle object updates
/*
if (!m_symsync)
{
@ -162,7 +162,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
m_scene.EventManager.OnOarFileLoaded += new EventManager.OarFileLoaded(EventManager_OnOarFileLoaded);
}
* */
//end of SYMMETRIC SYNC
//end of DSG SYNC
// Start the server and listen for RegionSyncClients
m_serveraddr = m_scene.RegionInfo.AvatarSyncServerAddress;
m_serverport = m_scene.RegionInfo.AvatarSyncServerPort;
@ -300,7 +300,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
// Sending the message when it's first queued would yield lower latency but much higher load on the simulator
// as parts may be updated many many times very quickly. Need to implement a higher resolution send in heartbeat
//SYMMETRIC SYNC: do not handle object updates
//DSG SYNC: do not handle object updates
/*
if (!m_symsync)
{
@ -317,7 +317,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
}
}
* */
//end of SYMMETRIC SYNC
//end of DSG SYNC
foreach (ScenePresence presence in presenceUpdates)
{
try

View File

@ -574,7 +574,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
primToUpdate.OffsetPosition = pos;
parent.HasGroupChanged = true;
//parent.ScheduleGroupForTerseUpdate();
parent.ScheduleGroupForTerseUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.OffsetPosition});
parent.ScheduleGroupForTerseUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.OffsetPosition});
}
}

View File

@ -47,6 +47,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
// SIM <-> CM
Terrain,
NewObject, // objects
UpdatedPrimProperties, //per property sync
UpdatedObject, // objects
UpdatedBucketProperties, //object properties in one bucket
RemovedObject, // objects

View File

@ -32,6 +32,12 @@ using OpenMetaverse;
namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
{
public enum SyncConnectorState
{
Idle, //not connected
Initialization, //initializing local copy of Scene
Syncing, //done initialization, in normal process of syncing terrain, objects, etc
}
// For implementations, a lot was copied from RegionSyncClientView, especially the SendLoop/ReceiveLoop.
public class SyncConnector : ISyncStatistics
{
@ -53,11 +59,15 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
private long bytesIn=0;
private long bytesOut=0;
private DateTime lastStatTime;
// A queue for outgoing traffic.
private BlockingUpdateQueue m_outQ = new BlockingUpdateQueue();
private RegionSyncModule m_regionSyncModule = null;
//members for keeping track of state of this connector
private SyncConnectorState m_syncState = SyncConnectorState.Idle;
// unique connector number across all regions
private static int m_connectorNum = 0;
public int ConnectorNum

View File

@ -127,11 +127,11 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
m_listenerManager = new ListenerManager(maxlisteners, maxhandles);
m_scene.EventManager.OnChatFromClient += DeliverClientMessage;
m_scene.EventManager.OnChatBroadcast += DeliverClientMessage;
//SYMMETRIC SYNC
//DSG SYNC
//m_scene.EventManager.OnChatFromWorld += DeliverClientMessage;
//Kitty: temp debug
//m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
//end SYMMETRIC SYNC
//end DSG SYNC
m_pendingQ = new Queue();
m_pending = Queue.Synchronized(m_pendingQ);
}

View File

@ -252,7 +252,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
SetPartMediaFlags(part, face, me != null);
//part.ScheduleFullUpdate();
part.ScheduleFullUpdate(new List<SceneObjectPartProperties>() { SceneObjectPartProperties.MediaUrl, SceneObjectPartProperties.Shape});
part.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>() { SceneObjectPartSyncProperties.MediaUrl, SceneObjectPartSyncProperties.Shape});
part.TriggerScriptChangedEvent(Changed.MEDIA);
}
@ -459,7 +459,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
// Arguably, we could avoid sending a full update to the avatar that just changed the texture.
//part.ScheduleFullUpdate();
part.ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Shape, SceneObjectPartProperties.MediaUrl});
part.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Shape, SceneObjectPartSyncProperties.MediaUrl});
part.TriggerScriptChangedEvent(Changed.MEDIA);
@ -538,7 +538,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
UpdateMediaUrl(part, agentId);
//part.ScheduleFullUpdate();
part.ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.MediaUrl});
part.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.MediaUrl});
part.TriggerScriptChangedEvent(Changed.MEDIA);

View File

@ -149,7 +149,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
part.TriggerScriptChangedEvent(Changed.OWNER);
group.ResumeScripts();
//part.ScheduleFullUpdate();
part.ScheduleFullUpdate(new List<SceneObjectPartProperties>() { SceneObjectPartProperties.FullUpdate }); //quite some properties changed, let's just force all to be synchronized
part.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>() { SceneObjectPartSyncProperties.FullUpdate }); //quite some properties changed, let's just force all to be synchronized
break;

View File

@ -584,14 +584,14 @@ namespace OpenSim.Region.CoreModules.World.Terrain
m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialised());
m_scene.SaveTerrain();
//SYMMETRIC SYNC
//DSG SYNC
//Terrain has been modified, send out sync message if needed
//if (m_scene.RegionSyncModule != null)
//{
//m_log.DebugFormat("EventManager_OnTerrainTick: To call SendTerrainUpdates with TS {0} and actorID {1}", m_lastUpdateTimeStamp, m_lastUpdateActorID);
//m_scene.RegionSyncModule.SendTerrainUpdates(m_lastUpdateTimeStamp, m_lastUpdateActorID);
//}
//end of SYMMETRIC SYNC
//end of DSG SYNC
// Clients who look at the map will never see changes after they looked at the map, so i've commented this out.
//m_scene.CreateTerrainTexture(true);
@ -633,7 +633,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
client.OnUnackedTerrain += client_OnUnackedTerrain;
}
//SYMMETRIC SYNC
//DSG SYNC
private long m_lastUpdateTimeStamp = DateTime.Now.Ticks;
public long LastUpdateTimeStamp
{
@ -708,7 +708,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
m_lastUpdateActorID = lastUpdateActorID;
}
//end of SYMMETRIC SYNC
//end of DSG SYNC
/// <summary>
/// Checks to see if the terrain has been modified since last check
@ -717,7 +717,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
/// </summary>
private void CheckForTerrainUpdates()
{
//SYMMETRIC SYNC
//DSG SYNC
m_log.DebugFormat("CheckForTerrainUpdates() called");
//Assumption: Thus function is only called when the terrain is updated by the local actor.
// Updating terrain during receiving sync messages from another actor will call CheckForTerrainUpdates.
@ -729,7 +729,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
//Check if the terrain has been modified and send out sync message if modified.
CheckForTerrainUpdates(false, currentTimeTick, localActorID);
//end of SYMMETRIC SYNC
//end of DSG SYNC
//CheckForTerrainUpdates(false);
}
@ -743,9 +743,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain
/// <param name="respectEstateSettings">should height map deltas be limited to the estate settings limits</param>
/// </summary>
//private void CheckForTerrainUpdates(bool respectEstateSettings)
//SYMMETRIC SYNC: Change the interface, to input the right sync information for the most recent update
//DSG SYNC: Change the interface, to input the right sync information for the most recent update
private void CheckForTerrainUpdates(bool respectEstateSettings, long lastUpdateTimeStamp, string lastUpdateActorID)
//end of SYMMETRIC SYNC
//end of DSG SYNC
{
bool shouldTaint = false;
float[] serialised = m_channel.GetFloatsSerialised();
@ -774,14 +774,14 @@ namespace OpenSim.Region.CoreModules.World.Terrain
if (shouldTaint)
{
m_tainted = true;
//SYMMETRIC SYNC
//DSG SYNC
//Terrain has been modified, updated the sync info
if (m_scene.RegionSyncModule != null)
{
SyncInfoUpdate(lastUpdateTimeStamp, lastUpdateActorID);
m_scene.RegionSyncModule.SendTerrainUpdates(lastUpdateTimeStamp, lastUpdateActorID);
}
//end of SYMMETRIC SYNC
//end of DSG SYNC
}
}
@ -895,9 +895,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain
m_channel, allowMask, west, south, height, size, seconds);
//CheckForTerrainUpdates(!god); //revert changes outside estate limits
//SYMMETRIC SYNC
//DSG SYNC
CheckForTerrainUpdates(!god, DateTime.Now.Ticks, m_scene.GetSyncActorID());
//end of SYMMETRIC SYNC
//end of DSG SYNC
}
}
else
@ -939,9 +939,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain
m_channel, fillArea, size);
//CheckForTerrainUpdates(!god); //revert changes outside estate limits
//SYMMETRIC SYNC
//DSG SYNC
CheckForTerrainUpdates(!god, DateTime.Now.Ticks, m_scene.GetSyncActorID());
//end of SYMMETRIC SYNC
//end of DSG SYNC
}
}
else

View File

@ -52,31 +52,43 @@ namespace OpenSim.Region.Framework.Interfaces
public interface IRegionSyncModule
{
bool Active { get; } //if true, this RegionSyncModule is connected into the synchronization overlay
string ActorID { get; }
DSGActorTypes DSGActorType { get; set; }
string ActorID { get; } //might be phased out soon
string SyncID { get; }
//DSGActorTypes DSGActorType { get; set; }
bool IsSyncRelay { get; }
/// <summary>
/// The mapping of a property (identified by its name) to the index of a bucket.
/// </summary>
Dictionary<SceneObjectPartProperties, string> PrimPropertyBucketMap { get; }
Dictionary<SceneObjectPartSyncProperties, string> PrimPropertyBucketMap { get; }
/// <summary>
/// The text description of the properties in each bucket, e.g. "General", "Physics"
/// </summary>
List<string> PropertyBucketDescription { get; }
//Enqueue updates for scene-objects and scene-presences
void QueueSceneObjectPartForUpdate(SceneObjectPart part);
//Legacy interface, used in Bucket-sync
//void QueueSceneObjectPartForUpdate(SceneObjectPart part);
void QueueScenePresenceForTerseUpdate(ScenePresence presence);
//void QueueSceneObjectGroupForUpdate(SceneObjectGroup sog);
//void ProcessAndEnqueuePrimUpdatesBySync(SceneObjectPart part, List<SceneObjectPartSyncProperties> updatedProperties);
void ProcessAndEnqueuePrimUpdatesByLocal(SceneObjectPart part, List<SceneObjectPartSyncProperties> updatedProperties);
void SyncOutPrimUpdates();
//Legacy calls in Bucket sync'ing
//The folloiwng calls deal with object updates, and will insert each update into an outgoing queue of each SyncConnector
void SendSceneUpdates();
//void SendSceneUpdates();
void SendNewObject(SceneObjectGroup sog);
void SendDeleteObject(SceneObjectGroup sog, bool softDelete);
void SendLinkObject(SceneObjectGroup linkedGroup, SceneObjectPart root, List<SceneObjectPart> children);
void SendDeLinkObject(List<SceneObjectPart> prims, List<SceneObjectGroup> beforeDelinkGroups, List<SceneObjectGroup> afterDelinkGroups);
//New functions for per property sync'ing
void SyncNewObject(SceneObjectGroup sog);
void SyncDeleteObject(SceneObjectGroup sog, bool softDelete);
void SyncLinkObject(SceneObjectGroup linkedGroup, SceneObjectPart root, List<SceneObjectPart> children);
void SyncDeLinkObject(List<SceneObjectPart> prims, List<SceneObjectGroup> beforeDelinkGroups, List<SceneObjectGroup> afterDelinkGroups);
//In RegionSyncModule's implementation,
//The following calls send out a message immediately, w/o putting it in the SyncConnector's outgoing queue.
//May need some optimization there on the priorities.
@ -89,6 +101,8 @@ namespace OpenSim.Region.Framework.Interfaces
//void QueuePresenceForTerseUpdate(ScenePresence presence)
//void SendAvatarUpdates();
//Debug purpose, mainly for LSL scripts
void Debug(String debugMsg);
}
/// <summary>

View File

@ -65,7 +65,7 @@ namespace OpenSim.Region.Framework.Interfaces
void UndoTerrain(ITerrainChannel channel);
//SYMMETRIC SYNC
//DSG SYNC
/// <summary>
/// Invoked by receiving a terrain sync message. First, check if the
/// timestamp is more advance than the local copy. If so, update the
@ -96,6 +96,6 @@ namespace OpenSim.Region.Framework.Interfaces
/// <param name="lastUpdateTimeStamp"></param>
/// <param name="lastUpdateActorID"></param>
void SetSyncInfo(long lastUpdateTimeStamp, string lastUpdateActorID);
//end of SYMMETRIC SYNC
//end of DSG SYNC
}
}

View File

@ -38,7 +38,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion;
namespace OpenSim.Region.Framework.Scenes
{
//SYMMETRIC SYNC: Rename the original EventManager as EventManagerBase, and implement a new EventManager that inherits from EventManagerBase
//DSG SYNC: Rename the original EventManager as EventManagerBase, and implement a new EventManager that inherits from EventManagerBase
/// <summary>
/// A wrapper class to implement handle event differently depending on if they are initiated locally or remotelly (i.e. by another actor)
@ -1113,7 +1113,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
//SYMMETRIC SYNC: overridden at new EventManager class
//DSG SYNC: overridden at new EventManager class
//public void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
public virtual void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
@ -1136,7 +1136,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
//SYMMETRIC SYNC: overridden at new EventManager class
//DSG SYNC: overridden at new EventManager class
//public void TriggerObjectGrabbing(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
public virtual void TriggerObjectGrabbing(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
@ -1159,7 +1159,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
//SYMMETRIC SYNC: overridden at new EventManager class
//DSG SYNC: overridden at new EventManager class
//public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
public virtual void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
@ -1851,7 +1851,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
//SYMMETRIC SYNC: the function is overridden in new EventManager
//DSG SYNC: the function is overridden in new EventManager
//public void TriggerOnChatFromWorld(Object sender, OSChatMessage chat)
public virtual void TriggerOnChatFromWorld(Object sender, OSChatMessage chat)
{
@ -1874,7 +1874,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
//SYMMETRIC SYNC: overiding this in the inherited class
//DSG SYNC: overiding this in the inherited class
//public void TriggerOnChatFromClient(Object sender, OSChatMessage chat)
public virtual void TriggerOnChatFromClient(Object sender, OSChatMessage chat)
{
@ -2550,7 +2550,7 @@ namespace OpenSim.Region.Framework.Scenes
}
#endregion
//SYMMETRIC SYNC
//DSG SYNC
public event PostSceneCreation OnPostSceneCreation;
public delegate void PostSceneCreation(Scene createdScene);
public void TriggerOnPostSceneCreation(Scene createdScene)
@ -2619,6 +2619,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
//end of SYMMETRIC SYNC
//end of DSG SYNC
}
}

View File

@ -251,7 +251,7 @@ namespace OpenSim.Region.Framework.Scenes
AssetService.Store(asset);
//REGION SYNC: if RegionSyncEnabled, move script related operations to be after update inventory item
//SYMMETRIC SYNC: commenting out old REGION SYNC code, the RemoveScriptInstance would be handled by ScriptEngineSyncModule
//DSG SYNC: commenting out old REGION SYNC code, the RemoveScriptInstance would be handled by ScriptEngineSyncModule
/*
if (!RegionSyncEnabled)
{
@ -270,7 +270,7 @@ namespace OpenSim.Region.Framework.Scenes
part.GetProperties(remoteClient);
////REGION SYNC
//SYMMETRIC SYNC: commenting out old REGION SYNC code, the RemoveScriptInstance would be handled by ScriptEngineSyncModule
//DSG SYNC: commenting out old REGION SYNC code, the RemoveScriptInstance would be handled by ScriptEngineSyncModule
/*
if (!RegionSyncEnabled)
{
@ -309,7 +309,7 @@ namespace OpenSim.Region.Framework.Scenes
}
* */
//SYMMETRIC SYNC: Distributed Scene Graph implementation
//DSG SYNC: Distributed Scene Graph implementation
m_log.Debug("Scene.Inventory: to call EventManager.TriggerUpdateScript, agentID: " + remoteClient.AgentId);
//Trigger OnUpdateScript event.
EventManager.TriggerUpdateScript(remoteClient.AgentId, itemId, primId, isScriptRunning, item.AssetID);
@ -370,7 +370,7 @@ namespace OpenSim.Region.Framework.Scenes
}
#endregion
#region SYMMETRIC SYNC
#region DSG SYNC
public void SymSync_OnNewScript(UUID avatarID, UUID itemID, SceneObjectPart part)
{
TaskInventoryItem item = part.Inventory.GetInventoryItem(itemID);
@ -433,7 +433,7 @@ namespace OpenSim.Region.Framework.Scenes
return errors;
}
#endregion //SYMMETRIC SYNC
#endregion //DSG SYNC
/// <summary>
@ -1714,7 +1714,7 @@ namespace OpenSim.Region.Framework.Scenes
part.ParentGroup.AddInventoryItem(remoteClient, localID, item, copyID);
part.GetProperties(remoteClient);
//SYMMETRIC SYNC
//DSG SYNC
/* Original OpenSim code, commented out
// TODO: switch to posting on_rez here when scripts
// have state in inventory
@ -1741,7 +1741,7 @@ namespace OpenSim.Region.Framework.Scenes
//part.GetProperties(remoteClient);
part.ParentGroup.ResumeScripts();
}
//end of SYMMETRIC SYNC
//end of DSG SYNC
}
else
@ -1801,7 +1801,7 @@ namespace OpenSim.Region.Framework.Scenes
part.Inventory.AddInventoryItem(taskItem, false);
part.GetProperties(remoteClient);
//SYMMETRIC SYNC
//DSG SYNC
//part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0);
//part.ParentGroup.ResumeScripts();
if (RegionSyncModule != null)
@ -1819,7 +1819,7 @@ namespace OpenSim.Region.Framework.Scenes
//part.GetProperties(remoteClient);
part.ParentGroup.ResumeScripts();
}
//end of SYMMETRIC SYNC
//end of DSG SYNC
}
}
@ -2256,7 +2256,7 @@ namespace OpenSim.Region.Framework.Scenes
group.CreateScriptInstances(param, true, DefaultScriptEngine, 3);
//group.ScheduleGroupForFullUpdate();
group.ScheduleGroupForFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.FullUpdate}); //new object, all properties have new value
group.ScheduleGroupForFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.FullUpdate}); //new object, all properties have new value
return group;
}
@ -2322,7 +2322,7 @@ namespace OpenSim.Region.Framework.Scenes
sog.SetOwnerId(ownerID);
sog.SetGroup(groupID, remoteClient);
//sog.ScheduleGroupForFullUpdate();
sog.ScheduleGroupForFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.OwnerID, SceneObjectPartProperties.GroupID});
sog.ScheduleGroupForFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.OwnerID, SceneObjectPartSyncProperties.GroupID});
SceneObjectPart[] partList = sog.Parts;
@ -2386,6 +2386,9 @@ namespace OpenSim.Region.Framework.Scenes
List<SceneObjectPart> children = new List<SceneObjectPart>();
SceneObjectPart root = GetSceneObjectPart(parentPrimId);
//DSG DEBUG
m_log.Debug("Scene.LinkObjects -- ROOT: " + root.DebugObjectPartProperties());
if (root == null)
{
m_log.DebugFormat("[LINK]: Can't find linkset root prim {0}", parentPrimId);
@ -2405,6 +2408,9 @@ namespace OpenSim.Region.Framework.Scenes
if (part == null)
continue;
//DSG DEBUG
m_log.Debug("Scene.LinkObjects -- child to link: " + part.DebugObjectPartProperties());
if (!owners.Contains(part.OwnerID))
owners.Add(part.OwnerID);

View File

@ -213,7 +213,7 @@ namespace OpenSim.Region.Framework.Scenes
isAttachment = true;
else
//part.ParentGroup.ScheduleGroupForFullUpdate();
part.ParentGroup.ScheduleGroupForFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.IsSelected});
part.ParentGroup.ScheduleGroupForFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.FullUpdate});
// If it's not an attachment, and we are allowed to move it,
// then we might have done so. If we moved across a parcel

View File

@ -634,9 +634,9 @@ namespace OpenSim.Region.Framework.Scenes
#endregion
#region SYMMETRIC SYNC
#region DSG SYNC
///////////////////////////////////////////////////////////////////////////////////////////////
//KittyL: 12/23/2010. SYMMETRIC SYNC: Implementation for the symmetric synchronization model.
//KittyL: 12/23/2010. DSG SYNC: Implementation for the symmetric synchronization model.
///////////////////////////////////////////////////////////////////////////////////////////////
private IRegionSyncModule m_regionSyncModule = null;
@ -709,9 +709,6 @@ namespace OpenSim.Region.Framework.Scenes
//Similar to DeleteSceneObject, except that this does not change LastUpdateActorID and LastUpdateTimeStamp
public void DeleteSceneObjectBySynchronization(SceneObjectGroup group)
{
// m_log.DebugFormat("[SCENE]: Deleting scene object {0} {1}", group.Name, group.UUID);
//SceneObjectPart rootPart = group.GetChildPart(group.UUID);
// Serialise calls to RemoveScriptInstances to avoid
// deadlocking on m_parts inside SceneObjectGroup
@ -794,7 +791,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="childrenIDs"></param>
public void LinkObjectBySync(SceneObjectGroup linkedGroup, UUID rootID, List<UUID> childrenIDs)
{
//m_log.Debug("Start to LinkObjectBySync");
m_log.Debug("Start to LinkObjectBySync");
//DebugSceneObjectGroups();
List<SceneObjectPart> children = new List<SceneObjectPart>();
@ -816,13 +813,17 @@ namespace OpenSim.Region.Framework.Scenes
continue;
}
//m_log.Debug("to link part " + part.DebugObjectPartProperties());
//TEMP DEBUG
/*
m_log.Debug("to link part " + part.DebugObjectPartProperties());
string partNames = "";
foreach (SceneObjectPart child in part.ParentGroup.Parts)
{
partNames += "(" + child.Name + "," + child.UUID + ")";
}
//m_log.Debug("LinkObjectBySync: " + part.Name + "," + part.UUID + " with root "+root.Name+","+root.UUID+"; its SOG has " + part.ParentGroup.Parts.Length + " parts : "+partNames);
* */
children.Add(part);
}
@ -830,17 +831,15 @@ namespace OpenSim.Region.Framework.Scenes
//m_log.Debug("to link " + children.Count + " parts with " + root.Name);
//Leverage the LinkObject implementation to get the book keeping of Group and Parts relations right
m_sceneGraph.LinkObjectsBySync(root, children);
m_sceneGraph.LinkObjectsBySync(root, children);
//The properties of the newly linked object should be updated later with another UpdatedObject message.
//KittyL 04/19/2011: no longer update properties here, caller will do it
//Set the property values as in the incoming copy of the object group
//SceneObjectGroup localGroup = root.ParentGroup;
//localGroup.UpdateObjectGroupBySync(linkedGroup);
SceneObjectGroup localGroup = root.ParentGroup;
localGroup.UpdateObjectGroupBySync(linkedGroup);
//debug
//DSG DEBUG
/*
m_log.Debug("after SceneGraph.LinkObjectsBySync, the newly linked group is \n" + root.ParentGroup.DebugObjectUpdateResult());
m_log.Debug("parts before linking now have properties: ");
@ -848,9 +847,18 @@ namespace OpenSim.Region.Framework.Scenes
{
m_log.Debug(part.DebugObjectPartProperties());
}
* */
* */
}
/// <summary>
/// Delink objects after receiving DelinkObject sync message.
/// Assumption: the actor whichever initiates the DelinkObject
/// operation has already done premission checking.
/// </summary>
/// <param name="delinkPrimIDs"></param>
/// <param name="beforeDelinkGroupIDs"></param>
/// <param name="incomingAfterDelinkGroups"></param>
public void DelinkObjectsBySync(List<UUID> delinkPrimIDs, List<UUID> beforeDelinkGroupIDs, List<SceneObjectGroup> incomingAfterDelinkGroups)
{
m_sceneGraph.DelinkObjectsBySync(delinkPrimIDs, beforeDelinkGroupIDs, incomingAfterDelinkGroups);
@ -863,7 +871,18 @@ namespace OpenSim.Region.Framework.Scenes
return m_sceneGraph.UpdateObjectPartBucketProperties(bucketName, partUUID, updatePart, bucketSyncInfo);
}
#endregion //SYMMETRIC SYNC
public bool AddNewSceneObjectByDelink(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates)
{
if (m_sceneGraph.AddNewSceneObjectByDelink(sceneObject, attachToBackup, sendClientUpdates))
{
EventManager.TriggerObjectAddedToScene(sceneObject);
return true;
}
return false;
}
#endregion //DSG SYNC
public ICapabilitiesModule CapsModule
{
@ -1006,10 +1025,10 @@ namespace OpenSim.Region.Framework.Scenes
m_physicalPrim = physicalPrim;
m_seeIntoRegionFromNeighbor = SeeIntoRegionFromNeighbor;
//SYMMETRIC SYNC: pass Scene reference to EventManager
//DSG SYNC: pass Scene reference to EventManager
//m_eventManager = new EventManager();
m_eventManager = new EventManager(this);
//end of SYMMETRIC SYNC
//end of DSG SYNC
m_permissions = new ScenePermissions(this);
m_asyncSceneObjectDeleter = new AsyncSceneObjectGroupDeleter(this);
@ -1215,10 +1234,10 @@ namespace OpenSim.Region.Framework.Scenes
m_regInfo = regInfo;
//SYMMETRIC SYNC: pass Scene reference to EventManager
//DSG SYNC: pass Scene reference to EventManager
//m_eventManager = new EventManager();
m_eventManager = new EventManager(this);
//end of SYMMETRIC SYNC
//end of DSG SYNC
m_lastUpdate = Util.EnvironmentTickCount();
}
@ -1553,13 +1572,13 @@ namespace OpenSim.Region.Framework.Scenes
PhysEngineToSceneConnectorModule = RequestModuleInterface<IPhysEngineToSceneConnectorModule>();
SceneToPhysEngineSyncServer = RequestModuleInterface<ISceneToPhysEngineServer>();
//////////////////////////////////////////////////////////////////////
//SYMMETRIC SYNC (KittyL: started 12/23/2010)
//DSG SYNC (KittyL: started 12/23/2010)
//////////////////////////////////////////////////////////////////////
m_regionSyncModule = RequestModuleInterface<IRegionSyncModule>();
m_DSGActorSyncModule = RequestModuleInterface<IDSGActorSyncModule>();
//////////////////////////////////////////////////////////////////////
//end of SYMMETRIC SYNC
//end of DSG SYNC
//////////////////////////////////////////////////////////////////////
// Shoving this in here for now, because we have the needed
@ -1739,14 +1758,15 @@ namespace OpenSim.Region.Framework.Scenes
m_regionSyncServerModule.SendUpdates();
}
//SYMMETRIC SYNC
//DSG SYNC
//NOTE: If it is configured as symmetric sync in opensim.ini, the above IsSyncedServer() or IsSyncedClient() should all return false
if (RegionSyncModule != null)
{
RegionSyncModule.SendSceneUpdates();
//RegionSyncModule.SendSceneUpdates();
RegionSyncModule.SyncOutPrimUpdates();
}
//end of SYMMETRIC SYNC
//end of DSG SYNC
int tmpPhysicsMS2 = Util.EnvironmentTickCount();
if ((Frame % m_update_physics == 0) && m_physics_enabled && (IsSyncedServer() || IsPhysEngineActor()))
@ -2403,7 +2423,7 @@ namespace OpenSim.Region.Framework.Scenes
}
//sceneObject.ScheduleGroupForFullUpdate();
sceneObject.ScheduleGroupForFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.FullUpdate}); //new object, all properties have new value
sceneObject.ScheduleGroupForFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.FullUpdate}); //new object, all properties have new value
return sceneObject;
}
@ -2580,16 +2600,18 @@ namespace OpenSim.Region.Framework.Scenes
EventManager.TriggerParcelPrimCountTainted();
}
group.DeleteGroupFromScene(silent);
// m_log.DebugFormat("[SCENE]: Exit DeleteSceneObject() for {0} {1}", group.Name, group.UUID);
//DSG SYNC
//Propagate the RemovedObject message
if (RegionSyncModule != null)
{
RegionSyncModule.SendDeleteObject(group, false);
//RegionSyncModule.SendDeleteObject(group, false);
RegionSyncModule.SyncDeleteObject(group, false);
}
//end of SYMMETRIC SYNC
//end of DSG SYNC
group.DeleteGroupFromScene(silent);
// m_log.DebugFormat("[SCENE]: Exit DeleteSceneObject() for {0} {1}", group.Name, group.UUID);
}
@ -3210,7 +3232,7 @@ namespace OpenSim.Region.Framework.Scenes
client.OnUpdatePrimFlags += m_sceneGraph.UpdatePrimFlags;
client.OnRequestObjectPropertiesFamily += m_sceneGraph.RequestObjectPropertiesFamily;
client.OnObjectPermissions += HandleObjectPermissionsUpdate;
//SYMMETRIC SYNC: return the code back to its original OpenSim version
//DSG SYNC: return the code back to its original OpenSim version
//if (IsSyncedServer())
//{
client.OnGrabObject += ProcessObjectGrab;
@ -3710,7 +3732,7 @@ namespace OpenSim.Region.Framework.Scenes
ForEachClient(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, localID); });
//SYMMETRIC SYNC: object remove should be handled through RegionSyncModule
//DSG SYNC: object remove should be handled through RegionSyncModule
// REGION SYNC
/*
if( IsSyncedServer() )
@ -4532,7 +4554,7 @@ namespace OpenSim.Region.Framework.Scenes
if (ent is SceneObjectGroup)
{
//((SceneObjectGroup)ent).ScheduleGroupForFullUpdate();
((SceneObjectGroup)ent).ScheduleGroupForFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.None}); //This is not due to property being updated, hence passing "None" property.
((SceneObjectGroup)ent).ScheduleGroupForFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.None}); //This is not due to property being updated, hence passing "None" property.
}
}
}

View File

@ -47,9 +47,9 @@ namespace OpenSim.Region.Framework.Scenes
public delegate void ObjectDeleteDelegate(EntityBase obj);
//SYMMETRIC SYNC
//DSG SYNC
public delegate void ObjectCreateBySyncDelegate(EntityBase obj);
//end of SYMMETRIC SYNC
//end of DSG SYNC
/// <summary>
@ -69,9 +69,9 @@ namespace OpenSim.Region.Framework.Scenes
public event ObjectCreateDelegate OnObjectCreate;
public event ObjectDeleteDelegate OnObjectRemove;
//SYMMETRIC SYNC
//DSG SYNC
public event ObjectCreateBySyncDelegate OnObjectCreateBySync;
//end of SYMMETRIC SYNC
//end of DSG SYNC
#endregion
@ -288,7 +288,7 @@ namespace OpenSim.Region.Framework.Scenes
sceneObject.HasGroupChanged = true;
}
return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates);
return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates, false);
}
/// <summary>
@ -310,7 +310,7 @@ namespace OpenSim.Region.Framework.Scenes
if (attachToBackup)
sceneObject.HasGroupChanged = true;
return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates);
return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates, false);
}
/// <summary>
@ -344,7 +344,7 @@ namespace OpenSim.Region.Framework.Scenes
sceneObject.Velocity = vel;
}
//SYMMETRIC SYNC
//DSG SYNC
//Moving AddNewSceneObject to the end of this function, so that
//all object properties are set when AddNewSceneObject is called.
AddNewSceneObject(sceneObject, true, false);
@ -368,17 +368,17 @@ namespace OpenSim.Region.Framework.Scenes
/// <returns>
/// true if the object was added, false if an object with the same uuid was already in the scene
/// </returns>
protected bool AddSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates)
protected bool AddSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates, bool addedByDelink)
{
if (sceneObject == null || sceneObject.RootPart == null || sceneObject.RootPart.UUID == UUID.Zero)
return false;
if (Entities.ContainsKey(sceneObject.UUID))
return false;
// m_log.DebugFormat(
// "[SCENEGRAPH]: Adding scene object {0} {1}, with {2} parts on {3}",
// sceneObject.Name, sceneObject.UUID, sceneObject.Parts.Length, m_parentScene.RegionInfo.RegionName);
// m_log.DebugFormat(
// "[SCENEGRAPH]: Adding scene object {0} {1}, with {2} parts on {3}",
// sceneObject.Name, sceneObject.UUID, sceneObject.Parts.Length, m_parentScene.RegionInfo.RegionName);
SceneObjectPart[] children = sceneObject.Parts;
@ -403,18 +403,18 @@ namespace OpenSim.Region.Framework.Scenes
m_numPrim += children.Length;
sceneObject.AttachToScene(m_parentScene);
Entities.Add(sceneObject);
if (attachToBackup)
sceneObject.AttachToBackup();
if (OnObjectCreate != null)
OnObjectCreate(sceneObject);
lock (SceneObjectGroupsByFullID)
SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject;
lock (SceneObjectGroupsByFullPartID)
{
SceneObjectGroupsByFullPartID[sceneObject.UUID] = sceneObject;
@ -429,15 +429,15 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectGroupsByLocalPartID[part.LocalId] = sceneObject;
}
//SYMMETRIC SYNC: sending NewObject event, and sending it before calling ScheduleGroupForFullUpdate
if (m_parentScene.RegionSyncModule != null)
{
m_parentScene.RegionSyncModule.SendNewObject(sceneObject);
}
if (sendClientUpdates)
//sceneObject.ScheduleGroupForFullUpdate();
sceneObject.ScheduleGroupForFullUpdate(new List<SceneObjectPartProperties>() { SceneObjectPartProperties.None });
sceneObject.ScheduleGroupForFullUpdate(null);
//DSG SYNC: sending NewObject event, and sending it before calling ScheduleGroupForFullUpdate
if (m_parentScene.RegionSyncModule != null && !addedByDelink)
{
m_parentScene.RegionSyncModule.SyncNewObject(sceneObject);
}
return true;
}
@ -1637,21 +1637,21 @@ namespace OpenSim.Region.Framework.Scenes
parentGroup.TriggerScriptChangedEvent(Changed.LINK);
parentGroup.HasGroupChanged = true;
//SYMMETRIC SYNC
//Schedule a LinkObject message for synchronization purpose. This will lead to enqueue a LinkObject message in SyncConnector's outgoingQueue,
//so should return quickly.
//DSG SYNC
//Send out LinkObject sync messages.
if (m_parentScene.RegionSyncModule != null)
{
//Tell other actors to link the SceneObjectParts together as a new group.
m_parentScene.RegionSyncModule.SendLinkObject(parentGroup, root, children);
//m_parentScene.RegionSyncModule.SendLinkObject(parentGroup, root, children);
m_parentScene.RegionSyncModule.SyncLinkObject(parentGroup, root, children);
}
//Schedule updates as in legacy OpenSim code, to send updates to viewers connected to this actor (at least needed for client managers).
//But timestamp won't be changed, so that when other actors get the update, they's simple ignore the updates since they already get them
//via the LinkObject message sent above.
parentGroup.ScheduleGroupForFullUpdate_SyncInfoUnchanged();
parentGroup.ScheduleGroupForFullUpdate(null);
//end of SYMMETRIC SYNC
//end of DSG SYNC
}
finally
@ -1673,7 +1673,7 @@ namespace OpenSim.Region.Framework.Scenes
List<SceneObjectPart> rootParts = new List<SceneObjectPart>();
List<SceneObjectGroup> affectedGroups = new List<SceneObjectGroup>();
//SYMMETRIC SYNC, record the new object groups after the delink operation
//DSG SYNC, record the new object groups after the delink operation
List<SceneObjectGroup> beforeDelinkGroups = new List<SceneObjectGroup>();
List<SceneObjectGroup> afterDelinkGroups = new List<SceneObjectGroup>();
@ -1694,7 +1694,7 @@ namespace OpenSim.Region.Framework.Scenes
if (!affectedGroups.Contains(group))
{
affectedGroups.Add(group);
//SYMMETRIC SYNC
//DSG SYNC
beforeDelinkGroups.Add(group);
}
}
@ -1711,7 +1711,7 @@ namespace OpenSim.Region.Framework.Scenes
// handled further. Do the honors here.
child.ParentGroup.HasGroupChanged = true;
//SYMMETRIC SYNC, delay ScheduleGroupForFullUpdate till the end of the delink operations.
//DSG SYNC, delay ScheduleGroupForFullUpdate till the end of the delink operations.
//child.ParentGroup.ScheduleGroupForFullUpdate();
afterDelinkGroups.Add(child.ParentGroup);
}
@ -1783,24 +1783,24 @@ namespace OpenSim.Region.Framework.Scenes
g.TriggerScriptChangedEvent(Changed.LINK);
g.HasGroupChanged = true; // Persist
//SYMMETRIC SYNC, delay ScheduleGroupForFullUpdate till the end of the delink operations.
//DSG SYNC, delay ScheduleGroupForFullUpdate till the end of the delink operations.
//g.ScheduleGroupForFullUpdate();
afterDelinkGroups.Add(g);
}
//SYMMETRIC SYNC
//DSG SYNC
//Send out DelinkObject message to other actors to sychronize their object list
if (m_parentScene.RegionSyncModule != null)
{
m_parentScene.RegionSyncModule.SendDeLinkObject(prims, beforeDelinkGroups, afterDelinkGroups);
m_parentScene.RegionSyncModule.SyncDeLinkObject(prims, beforeDelinkGroups, afterDelinkGroups);
}
//Schedule updates as in legacy OpenSim code, to send updates to viewers connected to this actor (at least needed for client managers).
//But timestamp won't be changed, so that when other actors get the update, they's simple ignore the updates since they already get them
//Schedule updates as in legacy OpenSim code, to send updates
//to viewers connected to this actor (at least needed for client managers).
foreach (SceneObjectGroup sog in afterDelinkGroups)
{
sog.ScheduleGroupForFullUpdate_SyncInfoUnchanged();
sog.ScheduleGroupForFullUpdate(null);
}
//end of SYMMETRIC SYNC
//end of DSG SYNC
}
finally
{
@ -1961,7 +1961,7 @@ namespace OpenSim.Region.Framework.Scenes
copy.CreateScriptInstances(0, false, m_parentScene.DefaultScriptEngine, 1);
copy.HasGroupChanged = true;
//copy.ScheduleGroupForFullUpdate();
copy.ScheduleGroupForFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.FullUpdate}); //new object, all property values are new
copy.ScheduleGroupForFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.FullUpdate}); //new object, all property values are new
copy.ResumeScripts();
// required for physics to update it's position
@ -2059,7 +2059,7 @@ namespace OpenSim.Region.Framework.Scenes
#endregion // REGION SYNC
#region SYMMETRIC SYNC
#region DSG SYNC
public Scene.ObjectUpdateResult UpdateObjectBySynchronization(SceneObjectGroup updatedSog)
{
@ -2175,9 +2175,13 @@ namespace OpenSim.Region.Framework.Scenes
sceneObject.RootPart.SetParentLocalId(avatar.LocalId);
}
//SYMMETRIC SYNC,
sceneObject.ScheduleGroupForFullUpdate_SyncInfoUnchanged();
//end of SYMMETRIC SYNC,
//DSG SYNC,
sceneObject.HasGroupChanged = true;
//NewObject is sent via a specific sync message, not through updates;
//hence not passing any property list here in calling
//ScheduleGroupForFullUpdate().
sceneObject.ScheduleGroupForFullUpdate(null);
//end of DSG SYNC,
Entities.Add(sceneObject);
@ -2248,7 +2252,7 @@ namespace OpenSim.Region.Framework.Scenes
// Make sure no child prim is set for sale
// So that, on delink, no prims are unwittingly
// left for sale and sold off
//SYMMETRIC SYNC: need to copy value w/o trigger UpdateBucketSyncInfo
//DSG SYNC: need to copy value w/o trigger UpdateBucketSyncInfo
//child.RootPart.ObjectSaleType = 0;
//child.RootPart.SalePrice = 10;
//child.RootPart.SetObjectSaleType(0);
@ -2285,7 +2289,7 @@ namespace OpenSim.Region.Framework.Scenes
parentGroup.TriggerScriptChangedEvent(Changed.LINK);
parentGroup.HasGroupChanged = true;
//Do not change the timestamp and actorID values
parentGroup.ScheduleGroupForFullUpdate_SyncInfoUnchanged();
parentGroup.ScheduleGroupForFullUpdate(null);
}
finally
@ -2304,6 +2308,7 @@ namespace OpenSim.Region.Framework.Scenes
public void DelinkObjectsBySync(List<UUID> delinkPrimIDs, List<UUID> beforeDelinkGroupIDs, List<SceneObjectGroup> incomingAfterDelinkGroups)
{
Dictionary<UUID, SceneObjectGroup> localBeforeDelinkGroups = new Dictionary<UUID, SceneObjectGroup>();
List<SceneObjectGroup> localAfterDelinkGroups = new List<SceneObjectGroup>();
Dictionary<UUID, SceneObjectPart> delinkPrims = new Dictionary<UUID, SceneObjectPart>();
bool beforeStateConsistent = true;
bool afterStateConsistent = true;
@ -2385,9 +2390,8 @@ namespace OpenSim.Region.Framework.Scenes
m_log.Warn("DelinkObjectsBySync: before-delink state not consistent in local copy and the incoming copy. Return without further operations.");
}else{
//Next, apply the delink operation locally.
List<SceneObjectGroup> localAfterDelinkGroups = DelinkObjectsBySync(new List<SceneObjectPart>(delinkPrims.Values));
localAfterDelinkGroups = DelinkObjectsBySync(new List<SceneObjectPart>(delinkPrims.Values));
//Check if local after-state agrees with that in the remote copy, and update the groups' properties
if (localAfterDelinkGroups.Count != incomingAfterDelinkGroups.Count)
{
@ -2409,11 +2413,17 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
localAfterGroup.UpdateObjectGroupBySync(incomingAfterDelinkGroupsDictionary[localAfterGroup.UUID]);
//No longer calling update prim's properties here, caller will do that
//localAfterGroup.UpdateObjectGroupBySync(incomingAfterDelinkGroupsDictionary[localAfterGroup.UUID]);
}
}
}
}
foreach (SceneObjectGroup sog in localAfterDelinkGroups)
{
sog.ScheduleGroupForFullUpdate(null);
}
}
finally
{
@ -2425,7 +2435,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
//Similar to DelinkObjects(), w/o triggering any ScheduleFullUpdate(),
//Similar to DelinkObjects(), but calling DelinkFromGroupBySync instead
private List<SceneObjectGroup> DelinkObjectsBySync(List<SceneObjectPart> prims)
{
//!!!Caller of this function should already lock on m_updateLock, so no locking here !!!
@ -2553,6 +2563,17 @@ namespace OpenSim.Region.Framework.Scenes
return localPart.UpdateBucketProperties(bucketName, updatedPart, bucketSyncInfo);
}
#endregion //SYMMETRIC SYNC
protected internal bool AddNewSceneObjectByDelink(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates)
{
// Ensure that we persist this new scene object if it's not an
// attachment
if (attachToBackup)
sceneObject.HasGroupChanged = true;
bool addedByDelink = true;
return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates, addedByDelink);
}
#endregion //DSG SYNC
}
}

View File

@ -509,7 +509,7 @@ namespace OpenSim.Region.Framework.Scenes
#region Constructors
//SYMMETRIC SYNC
//DSG SYNC
public SceneObjectGroup(SceneObjectPart part, bool newGroupBySync)
{
if (!newGroupBySync)
@ -638,7 +638,7 @@ namespace OpenSim.Region.Framework.Scenes
// for the same object with very different properties. The caller must schedule the update.
//ScheduleGroupForFullUpdate();
//SYMMETRIC SYNC
//DSG SYNC
if (m_scene.RegionSyncModule != null)
{
foreach (SceneObjectPart part in Parts)
@ -1028,7 +1028,7 @@ namespace OpenSim.Region.Framework.Scenes
AttachToBackup();
m_scene.EventManager.TriggerParcelPrimCountTainted();
//m_rootPart.ScheduleFullUpdate();
m_rootPart.ScheduleFullUpdate(new List<SceneObjectPartProperties>() { SceneObjectPartProperties.GroupPosition, SceneObjectPartProperties.AttachmentPoint}); //Physics properties, such as Position, OffsetPosition, etc, should be tainted in ApplyPhysics()
m_rootPart.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>() { SceneObjectPartSyncProperties.GroupPosition, SceneObjectPartSyncProperties.AttachmentPoint}); //Physics properties, such as Position, OffsetPosition, etc, should be tainted in ApplyPhysics()
m_rootPart.ClearUndoState();
}
@ -1223,7 +1223,7 @@ namespace OpenSim.Region.Framework.Scenes
{
SceneObjectPart part = parts[i];
//SYMMETRIC SYNC: object remove should be handled through RegionSyncModule
//DSG SYNC: object remove should be handled through RegionSyncModule
/*
// REGION SYNC
if (Scene.IsSyncedServer())
@ -1232,7 +1232,7 @@ namespace OpenSim.Region.Framework.Scenes
//return;
}
* */
//end of SYMMETRIC SYNC
//end of DSG SYNC
Scene.ForEachScenePresence(delegate(ScenePresence avatar)
{
@ -1302,7 +1302,7 @@ namespace OpenSim.Region.Framework.Scenes
}
//ScheduleGroupForFullUpdate();
ScheduleGroupForFullUpdate(new List<SceneObjectPartProperties>(){ SceneObjectPartProperties.Flags}); //do we also need to synchronize SOG properties such as m_scriptListens_atRotTarget? (does any acotr other than script engine care about it?)
ScheduleGroupForFullUpdate(new List<SceneObjectPartSyncProperties>(){ SceneObjectPartSyncProperties.Flags, SceneObjectPartSyncProperties.AggregateScriptEvents}); //do we also need to synchronize SOG properties such as m_scriptListens_atRotTarget? (does any acotr other than script engine care about it?)
}
public void SetText(string text, Vector3 color, double alpha)
@ -1315,7 +1315,7 @@ namespace OpenSim.Region.Framework.Scenes
HasGroupChanged = true;
//m_rootPart.ScheduleFullUpdate();
m_rootPart.ScheduleFullUpdate(new List<SceneObjectPartProperties>() {SceneObjectPartProperties.Text, SceneObjectPartProperties.Color});
m_rootPart.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>() {SceneObjectPartSyncProperties.Text, SceneObjectPartSyncProperties.Color});
}
/// <summary>
@ -1377,13 +1377,13 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
//SYMMETRIC SYNC
//DSG SYNC
//if we are doing sync across different sync nodes, and are not told to persist the state, don't do anything (only persistence actor will do it)
if (m_scene.RegionSyncModule != null && !ToPersistObjectState)
{
return;
}
//end of SYMMETRIC SYNC
//end of DSG SYNC
// Since this is the top of the section of call stack for backing up a particular scene object, don't let
// any exception propogate upwards.
@ -1560,7 +1560,7 @@ namespace OpenSim.Region.Framework.Scenes
dupe.AttachToBackup();
//ScheduleGroupForFullUpdate();
ScheduleGroupForFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.FullUpdate});
ScheduleGroupForFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.FullUpdate});
}
return dupe;
@ -1814,7 +1814,7 @@ namespace OpenSim.Region.Framework.Scenes
}
//part.ScheduleFullUpdate();
part.ScheduleFullUpdate(new List<SceneObjectPartProperties>() {SceneObjectPartProperties.OwnerID, SceneObjectPartProperties.GroupID, SceneObjectPartProperties.LastOwnerID});
part.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>() {SceneObjectPartSyncProperties.OwnerID, SceneObjectPartSyncProperties.GroupID, SceneObjectPartSyncProperties.LastOwnerID});
}
/// <summary>
@ -1942,7 +1942,7 @@ namespace OpenSim.Region.Framework.Scenes
/// Schedule a full update for this scene object
/// </summary>
//public void ScheduleGroupForFullUpdate()
public void ScheduleGroupForFullUpdate(List<SceneObjectPartProperties> updatedProperties)
public void ScheduleGroupForFullUpdate(List<SceneObjectPartSyncProperties> updatedProperties)
{
// if (IsAttachment)
// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId);
@ -1951,13 +1951,29 @@ namespace OpenSim.Region.Framework.Scenes
//RootPart.ScheduleFullUpdate();
RootPart.ScheduleFullUpdate(updatedProperties);
//For group properties, we only need to send it once per SOG,
//hence remove them from the updatedProperties for other parts
List<SceneObjectPartSyncProperties> otherPartsUpdatedProperties = updatedProperties;
if (updatedProperties!=null)
{
HashSet<SceneObjectPartSyncProperties> hashedList = new HashSet<SceneObjectPartSyncProperties>(updatedProperties);
foreach (SceneObjectPartSyncProperties groupProperty in SceneObjectPart.GetGroupProperties())
{
if (updatedProperties.Contains(groupProperty))
{
hashedList.Remove(groupProperty);
}
}
otherPartsUpdatedProperties = new List<SceneObjectPartSyncProperties>(hashedList);
}
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart part = parts[i];
if (part != RootPart)
//part.ScheduleFullUpdate();
part.ScheduleFullUpdate(updatedProperties);
part.ScheduleFullUpdate(otherPartsUpdatedProperties);
}
}
@ -1965,7 +1981,7 @@ namespace OpenSim.Region.Framework.Scenes
/// Schedule a terse update for this scene object
/// </summary>
//public void ScheduleGroupForTerseUpdate()
public void ScheduleGroupForTerseUpdate(List<SceneObjectPartProperties> updatedProperties)
public void ScheduleGroupForTerseUpdate(List<SceneObjectPartSyncProperties> updatedProperties)
{
// m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1}", Name, UUID);
@ -2215,11 +2231,11 @@ namespace OpenSim.Region.Framework.Scenes
//HasGroupChanged = true;
//ScheduleGroupForFullUpdate();
//SYMMETRIC SYNC
//DSG SYNC
//The DeleteObject message will be enqueued to be sent out by another thread, and the call will return quickly.
//if (m_scene.RegionSyncModule != null)
// m_scene.RegionSyncModule.SendDeleteObject(objectGroup, true);
//end of SYMMETRIC SYNC
//end of DSG SYNC
}
@ -2322,7 +2338,11 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectGroup objectGroup = new SceneObjectGroup(linkPart);
m_scene.AddNewSceneObject(objectGroup, true);
//m_scene.AddNewSceneObject(objectGroup, true);
//DSG SYNC: calling AddNewSceneObjectByDelink, so that later on we know
//the "new" object is added by delink operation, no need to send sync
//message of NewObject
m_scene.AddNewSceneObjectByDelink(objectGroup, true, true);
if (sendEvents)
linkPart.TriggerScriptChangedEvent(Changed.LINK);
@ -2731,7 +2751,7 @@ namespace OpenSim.Region.Framework.Scenes
HasGroupChanged = true;
part.TriggerScriptChangedEvent(Changed.SCALE);
//ScheduleGroupForFullUpdate();
ScheduleGroupForFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.None}); //above actions only update Scale for the given part, and part.Resize() will taint Scale as updated
ScheduleGroupForFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.None}); //above actions only update Scale for the given part, and part.Resize() will taint Scale as updated
//if (part.UUID == m_rootPart.UUID)
//{
@ -2884,7 +2904,7 @@ namespace OpenSim.Region.Framework.Scenes
HasGroupChanged = true;
m_rootPart.TriggerScriptChangedEvent(Changed.SCALE);
//ScheduleGroupForTerseUpdate();
ScheduleGroupForTerseUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Scale});
ScheduleGroupForTerseUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Scale});
}
}
@ -2926,10 +2946,10 @@ namespace OpenSim.Region.Framework.Scenes
//we need to do a terse update even if the move wasn't allowed
// so that the position is reset in the client (the object snaps back)
//ScheduleGroupForTerseUpdate();
List<SceneObjectPartProperties> updatedProperties = new List<SceneObjectPartProperties>() { SceneObjectPartProperties.GroupPosition };
List<SceneObjectPartSyncProperties> updatedProperties = new List<SceneObjectPartSyncProperties>() { SceneObjectPartSyncProperties.GroupPosition };
if (IsAttachment)
{
updatedProperties.Add(SceneObjectPartProperties.AttachedPos);
updatedProperties.Add(SceneObjectPartSyncProperties.AttachedPos);
}
ScheduleGroupForTerseUpdate(updatedProperties);
}
@ -2995,7 +3015,7 @@ namespace OpenSim.Region.Framework.Scenes
HasGroupChanged = true;
//ScheduleGroupForTerseUpdate();
ScheduleGroupForTerseUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Position, SceneObjectPartProperties.OffsetPosition});
ScheduleGroupForTerseUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Position, SceneObjectPartSyncProperties.OffsetPosition});
}
public void OffsetForNewRegion(Vector3 offset)
@ -3028,7 +3048,7 @@ namespace OpenSim.Region.Framework.Scenes
HasGroupChanged = true;
//ScheduleGroupForTerseUpdate();
ScheduleGroupForTerseUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Orientation}); //Above actions only update m_rootPart's RotationOffset, and m_rootPart.UpdateRotation will taint RotationOffset as updated
ScheduleGroupForTerseUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Orientation}); //Above actions only update m_rootPart's RotationOffset, and m_rootPart.UpdateRotation will taint RotationOffset as updated
}
/// <summary>
@ -3055,7 +3075,7 @@ namespace OpenSim.Region.Framework.Scenes
HasGroupChanged = true;
//ScheduleGroupForTerseUpdate();
ScheduleGroupForTerseUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Position, SceneObjectPartProperties.Orientation}); //RotationOffset is only updated for m_rootPart, and m_rootPart.UpdateRotation should already taint RotationOffset as updated
ScheduleGroupForTerseUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Position, SceneObjectPartSyncProperties.Orientation}); //RotationOffset is only updated for m_rootPart, and m_rootPart.UpdateRotation should already taint RotationOffset as updated
}
/// <summary>
@ -3143,7 +3163,7 @@ namespace OpenSim.Region.Framework.Scenes
newRot *= Quaternion.Inverse(axRot);
prim.RotationOffset = newRot;
//prim.ScheduleTerseUpdate();
prim.ScheduleTerseUpdate(new List<SceneObjectPartProperties>(){ SceneObjectPartProperties.RotationOffset, SceneObjectPartProperties.OffsetPosition});
prim.ScheduleTerseUpdate(new List<SceneObjectPartSyncProperties>(){ SceneObjectPartSyncProperties.RotationOffset, SceneObjectPartSyncProperties.OffsetPosition});
}
}
@ -3158,7 +3178,7 @@ namespace OpenSim.Region.Framework.Scenes
}
//m_rootPart.ScheduleTerseUpdate();
m_rootPart.ScheduleTerseUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.RotationOffset});
m_rootPart.ScheduleTerseUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.RotationOffset});
}
#endregion
@ -3571,7 +3591,7 @@ namespace OpenSim.Region.Framework.Scenes
}
#endregion
#region SYMMETRIC SYNC
#region DSG SYNC
private bool m_toPersistObjectState = false;
public bool ToPersistObjectState
@ -3794,14 +3814,11 @@ namespace OpenSim.Region.Framework.Scenes
}
//Similar actions with DelinkFromGroup, except that m_scene.AddNewSceneObjectBySync is called
//!!!!!!!!!!!!!!!!!!NOTE!!!!!!!!!!!!!!!
//All SOP properties below is set through calling SetXXX(value) instead of by "XXX=value", as such a value is being changed due to sync (
//i.e. triggered by remote operation instead of by local operation
public SceneObjectGroup DelinkFromGroupBySync(SceneObjectPart delinkPart, bool sendEvents)
{
// m_log.DebugFormat(
// "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}",
// linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID);
m_log.DebugFormat(
"[SCENE OBJECT GROUP]: Delinking part {0}, {1}, {4} from group with root part {2}, {3}",
delinkPart.Name, delinkPart.UUID, RootPart.Name, RootPart.UUID, delinkPart.LocalId);
SceneObjectPartBase linkPart = (SceneObjectPartBase)delinkPart;
linkPart.ClearUndoState();
@ -3818,9 +3835,7 @@ namespace OpenSim.Region.Framework.Scenes
if (parts.Length == 1 && RootPart != null)
{
// Single prim left
//RootPart.LinkNum = 0;
//RootPart.SetProperty("LinkNum", 0);
((SceneObjectPartBase)RootPart).LinkNum = 0;
RootPart.LinkNum = 0;
}
else
{
@ -3830,16 +3845,13 @@ namespace OpenSim.Region.Framework.Scenes
if (part.LinkNum > linkPart.LinkNum)
{
part.LinkNum--;
//int linkNum = part.LinkNum - 1;
//part.SetProperty("LinkNum", linkNum);
}
}
}
}
linkPart.ParentID = 0; //ParentID is a value set only locally and ignored in synchronization, so no need to call SetProperty to set its value
linkPart.ParentID = 0; //ParentID is a value set only locally and ignored in synchronization, so no need to set its value
linkPart.LinkNum = 0;
//linkPart.SetParentID(0);
if (linkPart.PhysActor != null)
{
@ -3858,15 +3870,6 @@ namespace OpenSim.Region.Framework.Scenes
linkPart.OffsetPosition = new Vector3(0, 0, 0);
linkPart.RotationOffset = worldRot;
//linkPart.SetOffsetPosition(new Vector3(axPos.X, axPos.Y, axPos.Z));
//linkPart.SetGroupPosition(AbsolutePosition + linkPart.OffsetPosition);
//linkPart.SetOffsetPosition(new Vector3(0, 0, 0));
//linkPart.SetRotationOffset(worldRot);
//linkPart.SetProperty("OffsetPosition", new Vector3(axPos.X, axPos.Y, axPos.Z));
//linkPart.SetProperty("GroupPosition", AbsolutePosition + linkPart.OffsetPosition);
//linkPart.SetProperty("OffsetPosition", new Vector3(0, 0, 0));
//linkPart.SetProperty("RotationOffset", worldRot);
//SceneObjectGroup objectGroup = new SceneObjectGroup(linkPart);
bool newGroupBySync = true;
SceneObjectGroup objectGroup = new SceneObjectGroup(delinkPart, newGroupBySync);
@ -4152,6 +4155,91 @@ namespace OpenSim.Region.Framework.Scenes
}
///////////////////////////////////////////////////////////////////////
// Per SOP property based sync
///////////////////////////////////////////////////////////////////////
/// <summary>
/// Update the existing copy of the object with updated properties in 'updatedSog'.
/// </summary>
/// <param name="updatedSog"></param>
/// <returns></returns>
public Scene.ObjectUpdateResult UpdateSOGBySync(SceneObjectGroup updatedSog)
{
//This GroupID check should be done by the actor who initiates the object update
//if (!this.GroupID.Equals(updatedSog.GroupID))
// return Scene.ObjectUpdateResult.Error;
////////////////////////////////////////////////////////////////////////////////////////////////////
//NOTE!!!
//We do not want to simply call SceneObjectGroup.Copy here to clone the object:
//the prims (SceneObjectParts) in updatedSog are different instances than those in the local copy,
//and we want to preserve the references to the prims in this local copy, especially for scripts
//of each prim, where the scripts have references to the local copy. If the local copy is replaced,
//the prims (parts) will be replaces and we need to update all the references that were pointing to
//the previous prims.
////////////////////////////////////////////////////////////////////////////////////////////////////
Scene.ObjectUpdateResult groupUpdateResult = Scene.ObjectUpdateResult.Unchanged;
Dictionary<UUID, SceneObjectPart> updatedParts = new Dictionary<UUID, SceneObjectPart>();
lock (m_parts.SyncRoot)
{
//This function is called by LinkObjectBySync and DelinkObjectBySinc(),
//which should have updated the parts in this SOG, hence should be no need to
//add or remove parts to sync
if (this.PrimCount != updatedSog.PrimCount)
{
m_log.WarnFormat("UpdateSOGBySync: For SOP {0}, local copy has {1} parts, while incoming updated copy has {2} parts. Inconsistent.", this.UUID,
this.PrimCount, updatedSog.PrimCount);
}
//now update properties of the parts
foreach (SceneObjectPart part in this.Parts)
{
Scene.ObjectUpdateResult partUpdateResult = Scene.ObjectUpdateResult.Unchanged;
SceneObjectPart updatedPart = updatedSog.GetChildPart(part.UUID);
if (updatedPart == null)
{
m_log.WarnFormat("UpdateSOGBySync: part {0},{1} exists in local copy, not in incoming updated copy", part.Name, part.UUID);
}
else
{
partUpdateResult = part.UpdateAllProperties(updatedPart);
if (partUpdateResult != Scene.ObjectUpdateResult.Unchanged)
{
groupUpdateResult = partUpdateResult;
}
}
}
//Just to make sure the parts each has the right localID of the rootpart
UpdateParentIDs();
}
//Schedule updates to be sent out, if the local copy has just been updated
//(1) if we are debugging the actor with a viewer attaching to it,
//we need to schedule updates to be sent to the viewer.
//(2) or if we are a relaying node to relay updates, we need to forward the updates.
//NOTE: LastUpdateTimeStamp and LastUpdateActorID should be kept the same as in the received copy of the object.
if (groupUpdateResult == Scene.ObjectUpdateResult.Updated)
{
ScheduleGroupForFullUpdate_SyncInfoUnchanged();
}
//debug the update result
if (groupUpdateResult == Scene.ObjectUpdateResult.Updated)
{
DebugObjectUpdateResult();
}
return groupUpdateResult;
}
#endregion
}
}

View File

@ -42,6 +42,7 @@ using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes.Scripting;
using OpenSim.Region.Framework.Scenes.Serialization;
using OpenSim.Region.Physics.Manager;
using System.IO;
namespace OpenSim.Region.Framework.Scenes
{
@ -129,7 +130,7 @@ namespace OpenSim.Region.Framework.Scenes
#region Fields
//SYMMETRIC SYNC
//DSG SYNC
//public bool AllowedDrop;
private bool m_allowedDrop;
public bool AllowedDrop
@ -2799,7 +2800,7 @@ namespace OpenSim.Region.Framework.Scenes
//m_parentGroup.RootPart.m_groupPosition = newpos;
}
//ScheduleTerseUpdate();
ScheduleTerseUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Position});
ScheduleTerseUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Position});
//SendTerseUpdateToAllClients();
}
@ -2890,7 +2891,7 @@ namespace OpenSim.Region.Framework.Scenes
ParentGroup.HasGroupChanged = true;
//ScheduleFullUpdate();
ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Scale});
ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Scale});
}
public void RotLookAt(Quaternion target, float strength, float damping)
@ -2932,8 +2933,8 @@ namespace OpenSim.Region.Framework.Scenes
/// <summary>
/// Schedules this prim for a full update
/// </summary>
//public void ScheduleFullUpdate() :: SYMMETRIC SYNC: changed the interface so that we can identify which property triggers calling this function
public virtual void ScheduleFullUpdate(List<SceneObjectPartProperties> updatedProperties)
//public void ScheduleFullUpdate() :: DSG SYNC: changed the interface so that we can identify which property triggers calling this function
public virtual void ScheduleFullUpdate(List<SceneObjectPartSyncProperties> updatedProperties)
{
// m_log.DebugFormat("[SCENE OBJECT PART]: Scheduling full update for {0} {1}", Name, LocalId);
@ -2968,7 +2969,7 @@ namespace OpenSim.Region.Framework.Scenes
/// rotation, velocity, rotational velocity and shape information.
/// </summary>
//public void ScheduleTerseUpdate()
public virtual void ScheduleTerseUpdate(List<SceneObjectPartProperties> updatedProperties)
public virtual void ScheduleTerseUpdate(List<SceneObjectPartSyncProperties> updatedProperties)
{
if (m_updateFlag < 1)
{
@ -3201,12 +3202,16 @@ namespace OpenSim.Region.Framework.Scenes
}
ClearUpdateSchedule();
//SYMMETRIC SYNC
//DSG SYNC
//KittyL: 04/06/2011, No longer calling QueueSceneObjectPartForUpdate
//from here. Local updates are now recorded by calling IRegionSyncModule.ProcessAndEnqueuePrimUpdatesByLocal().
/*
if (m_parentGroup.Scene.RegionSyncModule != null)
{
m_parentGroup.Scene.RegionSyncModule.QueueSceneObjectPartForUpdate((SceneObjectPart)this);
}
//end of SYMMETRIC SYNC
* */
//end of DSG SYNC
}
/// <summary>
@ -3670,7 +3675,7 @@ namespace OpenSim.Region.Framework.Scenes
ParentGroup.HasGroupChanged = true;
//ScheduleFullUpdate();
ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Text});
ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Text});
}
public void StopLookAt()
@ -3678,7 +3683,7 @@ namespace OpenSim.Region.Framework.Scenes
m_parentGroup.stopLookAt();
//m_parentGroup.ScheduleGroupForTerseUpdate();
m_parentGroup.ScheduleGroupForTerseUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.None});//in stopLookAt(), PhysicsActor shall already take care of tainting which properties have been updated
m_parentGroup.ScheduleGroupForTerseUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.None});//in stopLookAt(), PhysicsActor shall already take care of tainting which properties have been updated
}
/// <summary>
@ -3701,7 +3706,7 @@ namespace OpenSim.Region.Framework.Scenes
m_parentGroup.stopMoveToTarget();
//m_parentGroup.ScheduleGroupForTerseUpdate();
m_parentGroup.ScheduleGroupForTerseUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.None}); //in stopMoveToTarget(), PhysicsActor shall already take care of tainting which properties have been updated
m_parentGroup.ScheduleGroupForTerseUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.None}); //in stopMoveToTarget(), PhysicsActor shall already take care of tainting which properties have been updated
//m_parentGroup.ScheduleGroupForFullUpdate();
}
@ -4250,7 +4255,7 @@ namespace OpenSim.Region.Framework.Scenes
ParentGroup.HasGroupChanged = true;
//ScheduleFullUpdate();
ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Shape});
ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Shape});
}
public void UpdateGroupPosition(Vector3 pos)
@ -4262,7 +4267,7 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z);
GroupPosition = newPos;
//ScheduleTerseUpdate();
ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.GroupPosition});
ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.GroupPosition});
}
}
@ -4295,7 +4300,7 @@ namespace OpenSim.Region.Framework.Scenes
OffsetPosition = newPos;
//ScheduleTerseUpdate();
ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.OffsetPosition});
ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.OffsetPosition});
}
}
@ -4585,7 +4590,7 @@ namespace OpenSim.Region.Framework.Scenes
ParentGroup.HasGroupChanged = true;
//ScheduleFullUpdate();
ScheduleFullUpdate(new List<SceneObjectPartProperties>() { SceneObjectPartProperties.Flags});
ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>() { SceneObjectPartSyncProperties.Flags});
}
public void UpdateRotation(Quaternion rot)
@ -4598,7 +4603,7 @@ namespace OpenSim.Region.Framework.Scenes
RotationOffset = rot;
ParentGroup.HasGroupChanged = true;
//ScheduleTerseUpdate();
ScheduleFullUpdate(new List<SceneObjectPartProperties>() {SceneObjectPartProperties.RotationOffset});
ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>() {SceneObjectPartSyncProperties.RotationOffset});
}
}
@ -4644,7 +4649,11 @@ namespace OpenSim.Region.Framework.Scenes
ParentGroup.HasGroupChanged = true;
TriggerScriptChangedEvent(Changed.SHAPE);
//ScheduleFullUpdate();
ScheduleFullUpdate(new List<SceneObjectPartProperties>() {SceneObjectPartProperties.Shape});
//DSG DEBUG
//m_log.DebugFormat("{0}, {1}: shaped updated to {2}, calling ScheduleFullUpdate.", Name, UUID, Shape.ProfileShape);
ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>() {SceneObjectPartSyncProperties.Shape});
}
/// <summary>
@ -4692,7 +4701,7 @@ namespace OpenSim.Region.Framework.Scenes
//ParentGroup.ScheduleGroupForFullUpdate();
//This is sparta
//ScheduleFullUpdate();
ScheduleFullUpdate(new List<SceneObjectPartProperties>() {SceneObjectPartProperties.Shape});
ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>() {SceneObjectPartSyncProperties.Shape});
}
public void aggregateScriptEvents()
@ -4761,7 +4770,7 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.DebugFormat(
// "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents() since m_parentGroup == null", Name, LocalId);
//ScheduleFullUpdate();
ScheduleFullUpdate(new List<SceneObjectPartProperties>() { SceneObjectPartProperties.Flags, SceneObjectPartProperties.AggregateScriptEvents});
ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>() { SceneObjectPartSyncProperties.Flags, SceneObjectPartSyncProperties.AggregateScriptEvents});
return;
}
@ -4785,7 +4794,8 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.DebugFormat(
// "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents()", Name, LocalId);
//ScheduleFullUpdate();
ScheduleFullUpdate(new List<SceneObjectPartProperties>() { SceneObjectPartProperties.Flags, SceneObjectPartProperties.AggregateScriptEvents});
ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>() { SceneObjectPartSyncProperties.Flags, SceneObjectPartSyncProperties.LocalFlags,
SceneObjectPartSyncProperties.AggregateScriptEvents});
}
}
@ -4978,7 +4988,7 @@ namespace OpenSim.Region.Framework.Scenes
#endregion
#region SYMMETRIC SYNC
#region DSG SYNC
//Time stamp for the most recent update on this prim. We only have one time-stamp per prim for now.
//The goal is to evetually have time-stamp per property bucket for each prim.
@ -4993,7 +5003,7 @@ namespace OpenSim.Region.Framework.Scenes
}
//SYMMETRIC SYNC
//DSG SYNC
//Information for concurrency control of one bucket of prim proproperties.
public class BucketSyncInfo
@ -5150,7 +5160,7 @@ namespace OpenSim.Region.Framework.Scenes
}
*/
public enum SceneObjectPartProperties
public enum SceneObjectPartSyncProperties
{
None,
//Following properties copied from SceneObjectSerializer(),
@ -5160,12 +5170,12 @@ namespace OpenSim.Region.Framework.Scenes
FolderID ,
InventorySerial,
TaskInventory,
//UUID",
//UUID", //UUID not supposed to be changed after SOP is created, not included in SyncProperties
//LocalId",
Name,
Material,
PassTouches,
RegionHandle,
//RegionHandle,
ScriptAccessPin,
GroupPosition,
OffsetPosition,
@ -5188,7 +5198,7 @@ namespace OpenSim.Region.Framework.Scenes
SitTargetPosition,
SitTargetPositionLL,
SitTargetOrientationLL,
ParentID,
//ParentID,
CreationDate,
Category,
SalePrice,
@ -5208,7 +5218,8 @@ namespace OpenSim.Region.Framework.Scenes
MediaUrl,
TextureAnimation,
ParticleSystem,
//Property names below copied from PhysicsActor, they are necessary in synchronization, but not covered the above properties
//Property names below copied from PhysicsActor, they are necessary in
//synchronization, but not covered by xml serialization
//Physics properties "Velocity" is covered above
Position,
Size,
@ -5221,19 +5232,22 @@ namespace OpenSim.Region.Framework.Scenes
Flying,
Buoyancy,
Kinematic,
IsCollidingGround,
CollidingGround,
IsColliding,
//TODO!!!! To be handled in serialization/deserizaltion for synchronization
//Properties need to be synced, but not in xml serializations
AggregateScriptEvents,
IsAttachment,
AttachedAvatar,
AttachedPos,
AttachmentPoint,
IsAttachment,
LocalFlags,
//TODO!!!! To be handled in serialization/deserizaltion for synchronization
IsSelected,
Sound, //This indicates any Sound related property has changed: Sound, SoundGain, SoundFlags,SoundRadius,
//Addition properties to be added here
//Group properties
IsSelected,
//Client Manager may want to add some property here that viewers care about and should be synchronized across actors
FullUpdate,
@ -5266,7 +5280,7 @@ namespace OpenSim.Region.Framework.Scenes
//TODO: serialization and deserialization processors to be added in SceneObjectSerializer
//The following variables are initialized when RegionSyncModule reads the config file for mapping of properties and buckets
private static Dictionary<SceneObjectPartProperties, string> m_primPropertyBucketMap = null;
private static Dictionary<SceneObjectPartSyncProperties, string> m_primPropertyBucketMap = null;
private static List<string> m_propertyBucketNames = null;
private static string m_localActorID = "";
@ -5359,8 +5373,111 @@ namespace OpenSim.Region.Framework.Scenes
};
* */
/// <summary>
/// Return the list of all prim (SOP) properties, in enum type.
/// Excluding None, FullUpdate.
/// </summary>
/// <returns></returns>
public static HashSet<SceneObjectPartSyncProperties> GetAllPrimProperties()
{
HashSet<SceneObjectPartSyncProperties> allProperties = new HashSet<SceneObjectPartSyncProperties>();
foreach (SceneObjectPartSyncProperties property in Enum.GetValues(typeof(SceneObjectPartSyncProperties)))
{
switch (property)
{
case SceneObjectPartSyncProperties.None:
case SceneObjectPartSyncProperties.FullUpdate:
break;
default:
allProperties.Add(property);
break;
}
}
return allProperties;
}
public static void InitializePropertyBucketInfo(Dictionary<SceneObjectPartProperties, string> propertyBucketMap, List<string> bucketNames, string actorID)
public static HashSet<SceneObjectPartSyncProperties> GetAllPrimNonPhysActorProperties()
{
HashSet<SceneObjectPartSyncProperties> allProperties = new HashSet<SceneObjectPartSyncProperties>();
foreach (SceneObjectPartSyncProperties property in Enum.GetValues(typeof(SceneObjectPartSyncProperties)))
{
switch (property)
{
//Enum value that is not real properties
case SceneObjectPartSyncProperties.None:
case SceneObjectPartSyncProperties.FullUpdate:
//PhysActor properties
case SceneObjectPartSyncProperties.Buoyancy:
case SceneObjectPartSyncProperties.Flying:
case SceneObjectPartSyncProperties.Force:
case SceneObjectPartSyncProperties.IsColliding:
case SceneObjectPartSyncProperties.CollidingGround:
case SceneObjectPartSyncProperties.IsPhysical:
case SceneObjectPartSyncProperties.Kinematic:
case SceneObjectPartSyncProperties.Orientation:
case SceneObjectPartSyncProperties.PA_Acceleration:
case SceneObjectPartSyncProperties.Position:
case SceneObjectPartSyncProperties.RotationalVelocity:
case SceneObjectPartSyncProperties.Size:
case SceneObjectPartSyncProperties.Torque:
break;
default:
allProperties.Add(property);
break;
}
}
return allProperties;
}
public static HashSet<SceneObjectPartSyncProperties> GetAllPhysActorProperties()
{
HashSet<SceneObjectPartSyncProperties> allProperties = new HashSet<SceneObjectPartSyncProperties>();
foreach (SceneObjectPartSyncProperties property in Enum.GetValues(typeof(SceneObjectPartSyncProperties)))
{
switch (property)
{
//PhysActor properties
case SceneObjectPartSyncProperties.Buoyancy:
case SceneObjectPartSyncProperties.Flying:
case SceneObjectPartSyncProperties.Force:
case SceneObjectPartSyncProperties.IsColliding:
case SceneObjectPartSyncProperties.CollidingGround:
case SceneObjectPartSyncProperties.IsPhysical:
case SceneObjectPartSyncProperties.Kinematic:
case SceneObjectPartSyncProperties.Orientation:
case SceneObjectPartSyncProperties.PA_Acceleration:
case SceneObjectPartSyncProperties.Position:
case SceneObjectPartSyncProperties.RotationalVelocity:
case SceneObjectPartSyncProperties.Size:
case SceneObjectPartSyncProperties.Torque:
allProperties.Add(property);
break;
default:
break;
}
}
return allProperties;
}
public static HashSet<SceneObjectPartSyncProperties> GetAllNonPhysActorProperties()
{
HashSet<SceneObjectPartSyncProperties> allProperties = GetAllPrimProperties();
HashSet<SceneObjectPartSyncProperties> physActorProperties = GetAllPhysActorProperties();
foreach (SceneObjectPartSyncProperties pProperty in physActorProperties)
{
allProperties.Remove(pProperty);
}
return allProperties;
}
public static HashSet<SceneObjectPartSyncProperties> GetGroupProperties()
{
HashSet<SceneObjectPartSyncProperties> allProperties = new HashSet<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.IsSelected};
return allProperties;
}
public static void InitializePropertyBucketInfo(Dictionary<SceneObjectPartSyncProperties, string> propertyBucketMap, List<string> bucketNames, string actorID)
{
m_primPropertyBucketMap = propertyBucketMap;
m_propertyBucketNames = bucketNames;
@ -5373,11 +5490,14 @@ namespace OpenSim.Region.Framework.Scenes
public string DebugObjectPartProperties()
{
string debugMsg = "UUID " + UUID + ", Name " + Name + ", localID " + LocalId;
debugMsg += ", parentID " + ParentID + ", parentUUID " + ParentUUID;
foreach (KeyValuePair<string, BucketSyncInfo> pair in m_bucketSyncInfoList)
{
debugMsg += ", Bucket " + pair.Key + ": TimeStamp - " + pair.Value.LastUpdateTimeStamp + ", ActorID - " + pair.Value.LastUpdateActorID;
}
//debugMsg += ", parentID " + ParentID + ", parentUUID " + ParentUUID;
//foreach (KeyValuePair<string, BucketSyncInfo> pair in m_bucketSyncInfoList)
//{
// debugMsg += ", Bucket " + pair.Key + ": TimeStamp - " + pair.Value.LastUpdateTimeStamp + ", ActorID - " + pair.Value.LastUpdateActorID;
//}
debugMsg += ", AggregateScriptEvents = " + AggregateScriptEvents.ToString()+", OffsetPosition: "+OffsetPosition;
String hashedShape = Util.Md5Hash(SerializeShape());
debugMsg += ", hashed Shape = " + hashedShape;
return debugMsg;
}
@ -5705,14 +5825,14 @@ namespace OpenSim.Region.Framework.Scenes
}
//For tainitng and clearing taints, do i need to lock on m_bucketSyncTaint?
public void TaintBucketSyncInfo(SceneObjectPartProperties property)
public void TaintBucketSyncInfo(SceneObjectPartSyncProperties property)
{
if (m_syncEnabled)
{
if (property == SceneObjectPartProperties.None)
if (property == SceneObjectPartSyncProperties.None)
return;
if (property == SceneObjectPartProperties.FullUpdate)
if (property == SceneObjectPartSyncProperties.FullUpdate)
{
foreach (BucketSyncInfo bucketSynInfo in m_bucketSyncInfoList.Values)
{
@ -5800,7 +5920,7 @@ namespace OpenSim.Region.Framework.Scenes
/// Update the timestamp and actorID information of the bucket the given property belongs to.
/// </summary>
/// <param name="propertyName">Name of the property. Make sure the spelling is consistent with what are defined in PropertyList</param>
public void UpdateBucketSyncInfo(SceneObjectPartProperties property)
public void UpdateBucketSyncInfo(SceneObjectPartSyncProperties property)
{
if (m_syncEnabled && m_bucketSyncInfoList != null && m_bucketSyncInfoList.Count > 0)
{
@ -5936,6 +6056,9 @@ namespace OpenSim.Region.Framework.Scenes
return partUpdateResult;
}
//Implementation of ScheduleFullUpdate and ScheduleTerseUpdate for Bucket
//based synchronization
/*
public override void ScheduleFullUpdate(List<SceneObjectPartProperties> updatedProperties)
{
if (updatedProperties != null && updatedProperties.Count > 0)
@ -5963,6 +6086,49 @@ namespace OpenSim.Region.Framework.Scenes
base.ScheduleTerseUpdate(updatedProperties);
//TaintBucketSyncInfo(property);
}
* */
//Implementation of ScheduleFullUpdate and ScheduleTerseUpdate for Bucket
//based synchronization
public override void ScheduleFullUpdate(List<SceneObjectPartSyncProperties> updatedProperties)
{
if (updatedProperties != null && updatedProperties.Count > 0)
{
if (m_parentGroup != null && m_parentGroup.Scene != null && m_parentGroup.Scene.RegionSyncModule != null)
{
/*
if (updatedProperties.Contains(SceneObjectPartSyncProperties.Shape))
{
m_log.DebugFormat("{0}, {1} -- calling ProcessAndEnqueuePrimUpdatesByLocal to update to Shape {2}", Name, UUID, Shape.ProfileShape);
}
* */
m_parentGroup.Scene.RegionSyncModule.ProcessAndEnqueuePrimUpdatesByLocal(this, updatedProperties);
}
else
{
if (updatedProperties.Contains(SceneObjectPartSyncProperties.Shape))
{
m_log.DebugFormat("{0}, {1} Shape changed to {2}, but this SOP not attached to Scene yet", Name, UUID, Shape.ProfileShape);
}
}
}
base.ScheduleFullUpdate(updatedProperties);
}
public override void ScheduleTerseUpdate(List<SceneObjectPartSyncProperties> updatedProperties)
{
if (updatedProperties != null && updatedProperties.Count > 0)
{
if (m_parentGroup != null && m_parentGroup.Scene != null && m_parentGroup.Scene.RegionSyncModule != null)
{
m_parentGroup.Scene.RegionSyncModule.ProcessAndEnqueuePrimUpdatesByLocal(this, updatedProperties);
}
}
base.ScheduleTerseUpdate(updatedProperties);
}
/// <summary>
/// Schedules this prim for a full update, without changing the timestamp or actorID (info on when and who modified any property).
@ -5970,36 +6136,10 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary>
public void ScheduleFullUpdate_SyncInfoUnchanged()
{
//m_log.DebugFormat("[SCENE OBJECT PART]: ScheduleFullUpdate_SyncInfoUnchanged for {0} {1}", Name, LocalId);
if (m_parentGroup != null)
{
m_parentGroup.QueueForUpdateCheck();
}
int timeNow = Util.UnixTimeSinceEpoch();
// If multiple updates are scheduled on the same second, we still need to perform all of them
// So we'll force the issue by bumping up the timestamp so that later processing sees these need
// to be performed.
if (timeNow <= TimeStampFull)
{
TimeStampFull += 1;
}
else
{
TimeStampFull = (uint)timeNow;
}
m_updateFlag = 2;
// m_log.DebugFormat(
// "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}",
// UUID, Name, TimeStampFull);
base.ScheduleFullUpdate(null);
}
private bool UpdateCollisionSound(UUID updatedCollisionSound)
public bool UpdateCollisionSound(UUID updatedCollisionSound)
{
if (this.CollisionSound != updatedCollisionSound)
{
@ -6032,7 +6172,27 @@ namespace OpenSim.Region.Framework.Scenes
{
base.PhysicsCollision(e);
}
///////////////////////////////////////////////////////////////////////
//Per property sync functions
///////////////////////////////////////////////////////////////////////
//For debugging, same implemenation with PropertySerializer.SerializeShape
private string SerializeShape()
{
string serializedShape;
using (StringWriter sw = new StringWriter())
{
using (XmlTextWriter writer = new XmlTextWriter(sw))
{
SceneObjectSerializer.WriteShape(writer, Shape, new Dictionary<string, object>());
}
serializedShape = sw.ToString();
}
return serializedShape;
}
}
//end of SYMMETRIC SYNC
//end of DSG SYNC
}

View File

@ -294,7 +294,7 @@ namespace OpenSim.Region.Framework.Scenes
m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
m_part.LocalId, item.ItemID, String.Empty, startParam, postOnRez, engine, stateSource);
m_part.ParentGroup.AddActiveScriptCount(1);
m_part.ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Flags, SceneObjectPartProperties.TaskInventory});
m_part.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Flags, SceneObjectPartSyncProperties.TaskInventory});
return;
}
@ -322,7 +322,7 @@ namespace OpenSim.Region.Framework.Scenes
m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource);
m_part.ParentGroup.AddActiveScriptCount(1);
m_part.ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Flags, SceneObjectPartProperties.TaskInventory});
m_part.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Flags, SceneObjectPartSyncProperties.TaskInventory});
}
}
}
@ -545,8 +545,8 @@ namespace OpenSim.Region.Framework.Scenes
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
//SYMMETRIC SYNC: add ScheduleFullUpdate to enable synchronization across actors
m_part.ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.TaskInventory, SceneObjectPartProperties.InventorySerial});
//DSG SYNC: add ScheduleFullUpdate to enable synchronization across actors
m_part.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.TaskInventory, SceneObjectPartSyncProperties.InventorySerial});
}
/// <summary>
@ -769,7 +769,7 @@ namespace OpenSim.Region.Framework.Scenes
if (!ContainsScripts())
m_part.RemFlag(PrimFlags.Scripted);
m_part.ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.TaskInventory});
m_part.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.TaskInventory});
return type;
@ -1183,7 +1183,7 @@ namespace OpenSim.Region.Framework.Scenes
#endregion REGION SYNC
}
#region SYMMETRIC SYNC
#region DSG SYNC
public class SceneObjectPartInventory : SceneObjectPartInventoryBase
{
private SceneObjectPart m_part;

View File

@ -232,7 +232,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
sceneObject.AddPart(part);
//SYMMETRIC SYNC
//DSG SYNC
//KittyL: 12/27/2010, added ActorID for symmetric synch model
//part.SetLastUpdateActorID();
@ -346,7 +346,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
m_SOPXmlProcessors.Add("TextureAnimation", ProcessTextureAnimation);
m_SOPXmlProcessors.Add("ParticleSystem", ProcessParticleSystem);
//SYMMETRIC SYNC
//DSG SYNC
m_SOPXmlProcessors.Add("LocalFlags", ProcessLocalFlags);
//m_SOPXmlProcessors.Add("LastUpdateTimeStamp", ProcessUpdateTimeStamp);
//m_SOPXmlProcessors.Add("LastUpdateActorID", ProcessLastUpdateActorID);
@ -357,7 +357,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
m_SOPXmlProcessors.Add("AggregateScriptEvents", ProcessAggregateScriptEvents);
m_SOPXmlProcessors.Add("BucketSyncInfoList", ProcessBucketSyncInfo);
//end of SYMMETRIC SYNC
//end of DSG SYNC
#endregion
@ -442,7 +442,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
}
#region SOPXmlProcessors
//SYMMETRIC SYNC NOTE: -- assignments in de-serialization should directly set the values w/o triggering SceneObjectPart.UpdateBucketSyncInfo;
//DSG SYNC NOTE: -- assignments in de-serialization should directly set the values w/o triggering SceneObjectPart.UpdateBucketSyncInfo;
private static void ProcessAllowedDrop(SceneObjectPart obj, XmlTextReader reader)
{
obj.AllowedDrop = Util.ReadBoolean(reader);
@ -595,7 +595,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader)
{
obj.Scale = Util.ReadVector(reader, "Scale");
//obj.SetScale(Util.ReadVector(reader, "Scale"));
}
private static void ProcessUpdateFlag(SceneObjectPart obj, XmlTextReader reader)
@ -724,7 +723,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
obj.ParticleSystem = Convert.FromBase64String(reader.ReadElementContentAsString("ParticleSystem", String.Empty));
}
//SYMMETRIC SYNC
//DSG SYNC
/*
private static void ProcessUpdateTimeStamp(SceneObjectPart obj, XmlTextReader reader)
{
@ -817,7 +816,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
reader.ReadEndElement(); // BucketSyncInfoList
}
//end of SYMMETRIC SYNC
//end of DSG SYNC
#endregion
@ -1289,10 +1288,10 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
writer.WriteElementString("GroupMask", sop.GroupMask.ToString());
writer.WriteElementString("EveryoneMask", sop.EveryoneMask.ToString());
writer.WriteElementString("NextOwnerMask", sop.NextOwnerMask.ToString());
//SYMMETRIC SYNC: also serialize SceneObjectPart:LocalFlags, so that it can be propogated across actors
//DSG SYNC: also serialize SceneObjectPart:LocalFlags, so that it can be propogated across actors
WriteFlags(writer, "Flags", sop.Flags.ToString(), options);
WriteFlags(writer, "LocalFlags", sop.LocalFlags.ToString(), options);
//end SYMMETRIC SYNC
//end DSG SYNC
WriteUUID(writer, "CollisionSound", sop.CollisionSound, options);
writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString());
if (sop.MediaUrl != null)
@ -1300,7 +1299,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
WriteBytes(writer, "TextureAnimation", sop.TextureAnimation);
WriteBytes(writer, "ParticleSystem", sop.ParticleSystem);
//SYMMETRIC SYNC
//DSG SYNC
//These properties are only meaningful for synchronization purpose. For saving oar files, they are not necessary.
//We may remove these if later we use a different method to encode object properties for synchronization.
WriteUUID(writer, "AttachedAvatar", sop.AttachedAvatar, options);
@ -1309,12 +1308,12 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
//writer.WriteElementString("IsAttachment", sop.IsAttachment.ToString().ToLower()); //IsAttachment is written last, so that on deserialization, it will be deserialized later than other Attachment properties
WriteFlags(writer, "AggregateScriptEvents", sop.AggregateScriptEvents.ToString(), options);
WriteBucketSyncInfo(writer, sop.BucketSyncInfoList);
//end of SYMMETRIC SYNC
//end of DSG SYNC
writer.WriteEndElement();
}
//SYMMETRIC SYNC
//DSG SYNC
public static void WriteBucketSyncInfo(XmlTextWriter writer, Dictionary<string, BucketSyncInfo> bucketSyncInfoList)
{
if (bucketSyncInfoList!=null || bucketSyncInfoList.Count > 0) // otherwise skip this
@ -1336,7 +1335,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
}
}
//end of SYMMETRIC SYNC
//end of DSG SYNC
static void WriteUUID(XmlTextWriter writer, string name, UUID id, Dictionary<string, object> options)
{
@ -1386,7 +1385,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
writer.WriteElementString(name, flagsStr.Replace(",", ""));
}
static void WriteTaskInventory(XmlTextWriter writer, TaskInventoryDictionary tinv, Dictionary<string, object> options, Scene scene)
//DSG SYNC: make it a public function, so that we can call serialization of TaskInventory from other places
//static void WriteTaskInventory(XmlTextWriter writer, TaskInventoryDictionary tinv, Dictionary<string, object> options, Scene scene)
public static void WriteTaskInventory(XmlTextWriter writer, TaskInventoryDictionary tinv, Dictionary<string, object> options, Scene scene)
{
if (tinv.Count > 0) // otherwise skip this
{
@ -1440,7 +1441,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
}
}
static void WriteShape(XmlTextWriter writer, PrimitiveBaseShape shp, Dictionary<string, object> options)
//DSG SYNC: make it a public function, so that we can call serialization of Shape from other places
//static void WriteShape(XmlTextWriter writer, PrimitiveBaseShape shp, Dictionary<string, object> options)
public static void WriteShape(XmlTextWriter writer, PrimitiveBaseShape shp, Dictionary<string, object> options)
{
if (shp != null)
{
@ -1484,6 +1487,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
writer.WriteElementString("ProfileBegin", shp.ProfileBegin.ToString());
writer.WriteElementString("ProfileEnd", shp.ProfileEnd.ToString());
writer.WriteElementString("ProfileHollow", shp.ProfileHollow.ToString());
//DSG SYNC: added serialization of Shape
WriteVector(writer, "Scale", shp.Scale);
//end of DSG SYNC
writer.WriteElementString("State", shp.State.ToString());
WriteFlags(writer, "ProfileShape", shp.ProfileShape.ToString(), options);
@ -1613,7 +1619,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
return obj;
}
static TaskInventoryDictionary ReadTaskInventory(XmlTextReader reader, string name)
//DSG SYNC: make it public to be called outside
//static TaskInventoryDictionary ReadTaskInventory(XmlTextReader reader, string name)
public static TaskInventoryDictionary ReadTaskInventory(XmlTextReader reader, string name)
{
TaskInventoryDictionary tinv = new TaskInventoryDictionary();
@ -1652,7 +1660,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
return tinv;
}
static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name)
//DSG SYNC: make it public to be called outside
//static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name)
public static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name)
{
PrimitiveBaseShape shape = new PrimitiveBaseShape();

View File

@ -94,13 +94,13 @@ namespace OpenSim.Region.Framework.Scenes
if (Scale != Vector3.Zero)
part.Resize(Scale);
//part.ParentGroup.ScheduleGroupForTerseUpdate();
//SYMMETRIC SYNC
List<SceneObjectPartProperties> updatedProperties = new List<SceneObjectPartProperties>();
updatedProperties.Add(SceneObjectPartProperties.RotationOffset);
//DSG SYNC
List<SceneObjectPartSyncProperties> updatedProperties = new List<SceneObjectPartSyncProperties>();
updatedProperties.Add(SceneObjectPartSyncProperties.RotationOffset);
if (Position != Vector3.Zero)
updatedProperties.Add(SceneObjectPartProperties.Position);
updatedProperties.Add(SceneObjectPartSyncProperties.Position);
if (Scale != Vector3.Zero)
updatedProperties.Add(SceneObjectPartProperties.Scale);
updatedProperties.Add(SceneObjectPartSyncProperties.Scale);
part.ParentGroup.ScheduleGroupForTerseUpdate(updatedProperties);
}
else
@ -110,13 +110,13 @@ namespace OpenSim.Region.Framework.Scenes
part.UpdateRotation(Rotation);
if (Scale != Vector3.Zero)
part.Resize(Scale); //part.ScheduleTerseUpdate();
//SYMMETRIC SYNC
List<SceneObjectPartProperties> updatedProperties = new List<SceneObjectPartProperties>();
updatedProperties.Add(SceneObjectPartProperties.RotationOffset);
//DSG SYNC
List<SceneObjectPartSyncProperties> updatedProperties = new List<SceneObjectPartSyncProperties>();
updatedProperties.Add(SceneObjectPartSyncProperties.RotationOffset);
if (Position != Vector3.Zero)
updatedProperties.Add(SceneObjectPartProperties.OffsetPosition);
updatedProperties.Add(SceneObjectPartSyncProperties.OffsetPosition);
if (Scale != Vector3.Zero)
updatedProperties.Add(SceneObjectPartProperties.Scale);
updatedProperties.Add(SceneObjectPartSyncProperties.Scale);
part.ScheduleTerseUpdate(updatedProperties);
}
part.Undoing = false;
@ -138,14 +138,14 @@ namespace OpenSim.Region.Framework.Scenes
if (Scale != Vector3.Zero)
part.Resize(Scale);
//part.ParentGroup.ScheduleGroupForTerseUpdate();
//SYMMETRIC SYNC
List<SceneObjectPartProperties> updatedProperties = new List<SceneObjectPartProperties>();
//DSG SYNC
List<SceneObjectPartSyncProperties> updatedProperties = new List<SceneObjectPartSyncProperties>();
if (Rotation != Quaternion.Identity)
updatedProperties.Add(SceneObjectPartProperties.RotationOffset);
updatedProperties.Add(SceneObjectPartSyncProperties.RotationOffset);
if (Position != Vector3.Zero)
updatedProperties.Add(SceneObjectPartProperties.Position);
updatedProperties.Add(SceneObjectPartSyncProperties.Position);
if (Scale != Vector3.Zero)
updatedProperties.Add(SceneObjectPartProperties.Scale);
updatedProperties.Add(SceneObjectPartSyncProperties.Scale);
part.ParentGroup.ScheduleGroupForTerseUpdate(updatedProperties);
}
else
@ -157,14 +157,14 @@ namespace OpenSim.Region.Framework.Scenes
if (Scale != Vector3.Zero)
part.Resize(Scale);
//part.ScheduleTerseUpdate();
//SYMMETRIC SYNC
List<SceneObjectPartProperties> updatedProperties = new List<SceneObjectPartProperties>();
//DSG SYNC
List<SceneObjectPartSyncProperties> updatedProperties = new List<SceneObjectPartSyncProperties>();
if (Rotation != Quaternion.Identity)
updatedProperties.Add(SceneObjectPartProperties.RotationOffset);
updatedProperties.Add(SceneObjectPartSyncProperties.RotationOffset);
if (Position != Vector3.Zero)
updatedProperties.Add(SceneObjectPartProperties.Position);
updatedProperties.Add(SceneObjectPartSyncProperties.Position);
if (Scale != Vector3.Zero)
updatedProperties.Add(SceneObjectPartProperties.Scale);
updatedProperties.Add(SceneObjectPartSyncProperties.Scale);
part.ScheduleTerseUpdate(updatedProperties);
}

View File

@ -291,7 +291,7 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
((SceneObjectGroup)ent).AttachToBackup();
((SceneObjectGroup)ent).HasGroupChanged = true; // If not true, then attaching to backup does nothing because no change is detected.
//((SceneObjectGroup)ent).ScheduleGroupForFullUpdate();
((SceneObjectGroup)ent).ScheduleGroupForFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.FullUpdate}); //don't know what properties to taint, so just taint all
((SceneObjectGroup)ent).ScheduleGroupForFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.FullUpdate}); //don't know what properties to taint, so just taint all
}
catch(Exception e)
{

View File

@ -641,7 +641,7 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
s_tree.Scale += copse.m_rate;
s_tree.ParentGroup.HasGroupChanged = true;
//s_tree.ScheduleFullUpdate();
s_tree.ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Scale});
s_tree.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Scale});
}
}
else

View File

@ -1388,6 +1388,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
tmp.Z = (float)scale.z;
part.Scale = tmp;
part.SendFullUpdateToAllClients();
//DSG SYNC
part.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>() { SceneObjectPartSyncProperties.Scale });
}
public LSL_Vector llGetScale()
@ -1402,7 +1405,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.ClickAction = (byte)action;
if (m_host.ParentGroup != null) m_host.ParentGroup.HasGroupChanged = true;
//m_host.ScheduleFullUpdate();
m_host.ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.ClickAction});
m_host.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.ClickAction});
return;
}
@ -1655,7 +1658,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
part.ParentGroup.HasGroupChanged = true;
//part.ScheduleFullUpdate();
part.ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Shape});
part.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Shape});
}
/// <summary>
@ -1691,7 +1694,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
part.ParentGroup.HasGroupChanged = true;
//part.ScheduleFullUpdate();
part.ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Shape});
part.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Shape});
}
public LSL_Vector llGetColor(int face)
@ -1967,7 +1970,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
SceneObjectGroup parent = part.ParentGroup;
parent.HasGroupChanged = true;
//parent.ScheduleGroupForTerseUpdate();
parent.ScheduleGroupForTerseUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.OffsetPosition});
parent.ScheduleGroupForTerseUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.OffsetPosition});
}
}
@ -2314,7 +2317,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.SoundRadius = 20; // Magic number, 20 seems reasonable. Make configurable?
//m_host.ScheduleFullUpdate();
m_host.ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Sound});
m_host.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Sound});
m_host.SendFullUpdateToAllClients();
}
@ -2335,7 +2338,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
prim.SoundRadius = 20; // Magic number, 20 seems reasonable. Make configurable?
//prim.ScheduleFullUpdate();
m_host.ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Sound});
m_host.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Sound});
prim.SendFullUpdateToAllClients();
}
}
@ -2348,7 +2351,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.SoundRadius = 20; // Magic number, 20 seems reasonable. Make configurable?
//m_host.ScheduleFullUpdate();
m_host.ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Sound});
m_host.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Sound});
m_host.SendFullUpdateToAllClients();
}
@ -2391,7 +2394,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
part.SoundFlags = 0;
part.SoundRadius = 0;
//part.ScheduleFullUpdate();
m_host.ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Sound});
m_host.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Sound});
part.SendFullUpdateToAllClients();
}
m_host.ParentGroup.LoopSoundMasterPrim = null;
@ -2404,7 +2407,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.SoundFlags = 0;
m_host.SoundRadius = 0;
//m_host.ScheduleFullUpdate();
m_host.ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Sound});
m_host.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Sound});
m_host.SendFullUpdateToAllClients();
}
}
@ -2415,7 +2418,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.SoundFlags = 0;
m_host.SoundRadius = 0;
//m_host.ScheduleFullUpdate();
m_host.ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Sound});
m_host.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Sound});
m_host.SendFullUpdateToAllClients();
}
}
@ -3326,7 +3329,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1);
m_host.AngularVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate));
//m_host.ScheduleTerseUpdate();
m_host.ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.AngularVelocity});
m_host.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.AngularVelocity});
m_host.SendTerseUpdateToAllClients();
m_host.ParentGroup.HasGroupChanged = true;
}
@ -3612,17 +3615,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
parentPrim.RootPart.CreateSelected = true;
parentPrim.HasGroupChanged = true;
//parentPrim.ScheduleGroupForFullUpdate();
//SYMMETRIC SYNC
//DSG SYNC
//Schedule a LinkObject message for synchronization purpose. This will lead to enqueue a LinkObject message in SyncConnector's outgoingQueue,
//so should return quickly.
if (World.RegionSyncModule != null)
{
//Tell other actors to link the SceneObjectParts together as a new group.
//parentGroup.SyncInfoUpdate();
World.RegionSyncModule.SendLinkObject(parentPrim, parentPrim.RootPart, children);
//World.RegionSyncModule.SendLinkObject(parentPrim, parentPrim.RootPart, children);
World.RegionSyncModule.SyncLinkObject(parentPrim, parentPrim.RootPart, children);
}
m_host.ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.None}); //SendLinkObject above will synchronize the link operation, no need to taint updates here
//end of SYMMETRIC SYNC
m_host.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>() { SceneObjectPartSyncProperties.None }); //SyncLinkObject above will synchronize the link operation, no need to taint updates here
//end of DSG SYNC
if (client != null)
parentPrim.GetProperties(client);
@ -3680,11 +3684,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (linknum == ScriptBaseClass.LINK_ROOT)
{
//SYMMETRIC SYNC
//DSG SYNC
List<SceneObjectGroup> beforeDelinkGroups = new List<SceneObjectGroup>();
beforeDelinkGroups.Add(parentPrim);
List<SceneObjectGroup> afterDelinkGroups = new List<SceneObjectGroup>();
//end of SYMMETRIC SYNC
//end of DSG SYNC
// Restructuring Multiple Prims.
List<SceneObjectPart> parts = new List<SceneObjectPart>(parentPrim.Parts);
@ -3692,19 +3696,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
foreach (SceneObjectPart part in parts)
{
parentPrim.DelinkFromGroup(part.LocalId, true);
//SYMMETRIC SYNC
//DSG SYNC
afterDelinkGroups.Add(part.ParentGroup);
}
parentPrim.HasGroupChanged = true;
//parentPrim.ScheduleGroupForFullUpdate();
//SYMMETRIC SYNC
//DSG SYNC
//Send out DelinkObject message to other actors to sychronize their object list
if (World.RegionSyncModule != null)
{
World.RegionSyncModule.SendDeLinkObject(parts, beforeDelinkGroups, afterDelinkGroups);
}
parentPrim.ScheduleGroupForFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.None});
//end of SYMMETRIC SYNC
parentPrim.ScheduleGroupForFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.None});
//end of DSG SYNC
parentPrim.TriggerScriptChangedEvent(Changed.LINK);
if (parts.Count > 0)
@ -3718,13 +3722,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
newRoot.ParentGroup.HasGroupChanged = true;
//newRoot.ParentGroup.ScheduleGroupForFullUpdate();
//SYMMETRIC SYNC
//DSG SYNC
if (World.RegionSyncModule != null)
{
World.RegionSyncModule.SendLinkObject(newRoot.ParentGroup, newRoot, new List<SceneObjectPart>(newRoot.ParentGroup.Parts));
//World.RegionSyncModule.SendLinkObject(newRoot.ParentGroup, newRoot, new List<SceneObjectPart>(newRoot.ParentGroup.Parts));
World.RegionSyncModule.SyncLinkObject(newRoot.ParentGroup, newRoot, new List<SceneObjectPart>(newRoot.ParentGroup.Parts));
}
newRoot.ParentGroup.ScheduleGroupForFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.None});
//end of SYMMETRIC SYNC
newRoot.ParentGroup.ScheduleGroupForFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.None});
//end of DSG SYNC
}
}
@ -3736,7 +3741,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
parentPrim.DelinkFromGroup(childPrim.LocalId, true);
parentPrim.HasGroupChanged = true;
//parentPrim.ScheduleGroupForFullUpdate();
//SYMMETRIC SYNC
//DSG SYNC
//Send out DelinkObject message to other actors to sychronize their object list
if (World.RegionSyncModule != null)
{
@ -3746,7 +3751,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
afterDelinkGroups.Add(childPrim.ParentGroup);
World.RegionSyncModule.SendDeLinkObject(new List<SceneObjectPart>(parentPrim.Parts), beforeDelinkGroups, afterDelinkGroups);
}
//end of SYMMETRIC SYNC
//end of DSG SYNC
parentPrim.TriggerScriptChangedEvent(Changed.LINK);
}
@ -3759,12 +3764,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (parentPrim.RootPart.AttachmentPoint != 0)
return; // Fail silently if attached
//SYMMETRIC SYNC
//DSG SYNC
List<SceneObjectGroup> beforeDelinkGroups = new List<SceneObjectGroup>();
beforeDelinkGroups.Add(parentPrim);
List<SceneObjectGroup> afterDelinkGroups = new List<SceneObjectGroup>();
SceneObjectPart rootPart = parentPrim.RootPart;
//end of SYMMETRIC SYNC
//end of DSG SYNC
List<SceneObjectPart> parts = new List<SceneObjectPart>(parentPrim.Parts);
parts.Remove(parentPrim.RootPart);
@ -3773,7 +3778,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
parentPrim.DelinkFromGroup(part.LocalId, true);
parentPrim.TriggerScriptChangedEvent(Changed.LINK);
//SYMMETRIC SYNC
//DSG SYNC
afterDelinkGroups.Add(part.ParentGroup);
}
parentPrim.HasGroupChanged = true;
@ -3785,8 +3790,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
afterDelinkGroups.Add(rootPart.ParentGroup);
World.RegionSyncModule.SendDeLinkObject(parts, beforeDelinkGroups, afterDelinkGroups);
}
parentPrim.ScheduleGroupForFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.None});
//end of SYMMETRIC SYNC
parentPrim.ScheduleGroupForFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.None});
//end of DSG SYNC
}
public LSL_String llGetLinkKey(int linknum)
@ -4025,7 +4030,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.SetText(text, av3, Util.Clip((float)alpha, 0.0f, 1.0f));
m_host.ParentGroup.HasGroupChanged = true;
//m_host.ParentGroup.ScheduleGroupForFullUpdate();
m_host.ParentGroup.ScheduleGroupForFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Text});
m_host.ParentGroup.ScheduleGroupForFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Text});
}
public LSL_Float llWater(LSL_Vector offset)
@ -5677,6 +5682,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
part.AddTextureAnimation(pTexAnim);
part.SendFullUpdateToAllClients();
part.ParentGroup.HasGroupChanged = true;
//DSG SYNC
part.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>() { SceneObjectPartSyncProperties.TextureAnimation });
}
public void llTriggerSoundLimited(string sound, double volume, LSL_Vector top_north_east,
@ -6189,6 +6197,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
part.ParentGroup.HasGroupChanged = true;
}
part.SendFullUpdateToAllClients();
//DSG SYNC
part.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>() { SceneObjectPartSyncProperties.ParticleSystem });
}
public void llGroundRepel(double height, int water, double tau)

View File

@ -2346,7 +2346,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
obj.ParentGroup.HasGroupChanged = true;
//obj.ScheduleFullUpdate();
obj.ScheduleFullUpdate(new List<SceneObjectPartProperties>(){SceneObjectPartProperties.Shape});
obj.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.Shape});
}