mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
Update svn properties, formatting cleanup.
This commit is contained in:
@@ -161,7 +161,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
|
||||
string message = e.Message;
|
||||
UUID fromID = e.SenderUUID;
|
||||
|
||||
if(message.Length >= 1000) // libomv limit
|
||||
if (message.Length >= 1000) // libomv limit
|
||||
message = message.Substring(0, 1000);
|
||||
|
||||
if (e.Sender != null)
|
||||
|
||||
@@ -820,33 +820,33 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
|
||||
string secret = (string) requestData["secret"];
|
||||
|
||||
Scene userScene = GetSceneByUUID(regionId);
|
||||
if(userScene != null)
|
||||
if (userScene != null)
|
||||
{
|
||||
if (userScene.RegionInfo.regionSecret.ToString() == secret)
|
||||
{
|
||||
|
||||
IClientAPI client = LocateClientObject(agentId);
|
||||
if (client != null)
|
||||
{
|
||||
|
||||
if (soundId != UUID.Zero)
|
||||
client.SendPlayAttachedSound(soundId, UUID.Zero, UUID.Zero, 1.0f, 0);
|
||||
|
||||
client.SendBlueBoxMessage(UUID.Zero, UUID.Zero, "", text);
|
||||
|
||||
retparam.Add("success", true);
|
||||
}
|
||||
if (client != null)
|
||||
{
|
||||
|
||||
if (soundId != UUID.Zero)
|
||||
client.SendPlayAttachedSound(soundId, UUID.Zero, UUID.Zero, 1.0f, 0);
|
||||
|
||||
client.SendBlueBoxMessage(UUID.Zero, UUID.Zero, "", text);
|
||||
|
||||
retparam.Add("success", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
retparam.Add("success", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
retparam.Add("success", false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ret.Value = retparam;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
public void SetAura(Vector3 color, float radius)
|
||||
{
|
||||
SceneObjectPart From = m_Entity.RootPart;
|
||||
|
||||
|
||||
//m_log.Debug("[META ENTITY] BEFORE: radius = " + radius);
|
||||
float burstRadius = 0.1f;
|
||||
Primitive.ParticleSystem.SourcePattern patternFlags = Primitive.ParticleSystem.SourcePattern.None;
|
||||
@@ -98,12 +98,12 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
float burstRate = 0.4f;
|
||||
if (radius >= 8.0f)
|
||||
{
|
||||
//float sizeOfObject = radius / 2.0f;
|
||||
burstRadius = (radius - 8.0f)/3f;
|
||||
burstRate = 1.5f;
|
||||
radius = 7.99f;
|
||||
patternFlags = Primitive.ParticleSystem.SourcePattern.Explode;
|
||||
age = 4.0f;
|
||||
//float sizeOfObject = radius / 2.0f;
|
||||
burstRadius = (radius - 8.0f)/3f;
|
||||
burstRate = 1.5f;
|
||||
radius = 7.99f;
|
||||
patternFlags = Primitive.ParticleSystem.SourcePattern.Explode;
|
||||
age = 4.0f;
|
||||
}
|
||||
SetAura(From, color, radius, burstRadius, age, burstRate, patternFlags);
|
||||
}
|
||||
@@ -111,48 +111,48 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
public void SetAura(SceneObjectPart From, Vector3 color, float radius, float burstRadius, float age, float burstRate, Primitive.ParticleSystem.SourcePattern patternFlags)
|
||||
{
|
||||
Primitive.ParticleSystem prules = new Primitive.ParticleSystem();
|
||||
//prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Emissive |
|
||||
// Primitive.ParticleSystem.ParticleDataFlags.FollowSrc; //PSYS_PART_FLAGS
|
||||
//prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Beam |
|
||||
// Primitive.ParticleSystem.ParticleDataFlags.TargetPos;
|
||||
prules.PartStartColor.R = color.X; //PSYS_PART_START_COLOR
|
||||
//prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Emissive |
|
||||
// Primitive.ParticleSystem.ParticleDataFlags.FollowSrc; //PSYS_PART_FLAGS
|
||||
//prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Beam |
|
||||
// Primitive.ParticleSystem.ParticleDataFlags.TargetPos;
|
||||
prules.PartStartColor.R = color.X; //PSYS_PART_START_COLOR
|
||||
prules.PartStartColor.G = color.Y;
|
||||
prules.PartStartColor.B = color.Z;
|
||||
prules.PartStartColor.A = 0.5f; //PSYS_PART_START_ALPHA, transparency
|
||||
prules.PartEndColor.R = color.X; //PSYS_PART_END_COLOR
|
||||
prules.PartStartColor.A = 0.5f; //PSYS_PART_START_ALPHA, transparency
|
||||
prules.PartEndColor.R = color.X; //PSYS_PART_END_COLOR
|
||||
prules.PartEndColor.G = color.Y;
|
||||
prules.PartEndColor.B = color.Z;
|
||||
prules.PartEndColor.A = 0.5f; //PSYS_PART_END_ALPHA, transparency
|
||||
/*prules.PartStartScaleX = 0.5f; //PSYS_PART_START_SCALE
|
||||
prules.PartEndColor.A = 0.5f; //PSYS_PART_END_ALPHA, transparency
|
||||
/*prules.PartStartScaleX = 0.5f; //PSYS_PART_START_SCALE
|
||||
prules.PartStartScaleY = 0.5f;
|
||||
prules.PartEndScaleX = 0.5f; //PSYS_PART_END_SCALE
|
||||
prules.PartEndScaleX = 0.5f; //PSYS_PART_END_SCALE
|
||||
prules.PartEndScaleY = 0.5f;
|
||||
*/
|
||||
prules.PartStartScaleX = radius; //PSYS_PART_START_SCALE
|
||||
prules.PartStartScaleX = radius; //PSYS_PART_START_SCALE
|
||||
prules.PartStartScaleY = radius;
|
||||
prules.PartEndScaleX = radius; //PSYS_PART_END_SCALE
|
||||
prules.PartEndScaleX = radius; //PSYS_PART_END_SCALE
|
||||
prules.PartEndScaleY = radius;
|
||||
prules.PartMaxAge = age; //PSYS_PART_MAX_AGE
|
||||
prules.PartAcceleration.X = 0.0f; //PSYS_SRC_ACCEL
|
||||
prules.PartMaxAge = age; //PSYS_PART_MAX_AGE
|
||||
prules.PartAcceleration.X = 0.0f; //PSYS_SRC_ACCEL
|
||||
prules.PartAcceleration.Y = 0.0f;
|
||||
prules.PartAcceleration.Z = 0.0f;
|
||||
prules.Pattern = patternFlags; //PSYS_SRC_PATTERN
|
||||
//prules.Texture = UUID.Zero;//= UUID //PSYS_SRC_TEXTURE, default used if blank
|
||||
prules.BurstRate = burstRate; //PSYS_SRC_BURST_RATE
|
||||
prules.BurstPartCount = 2; //PSYS_SRC_BURST_PART_COUNT
|
||||
//prules.BurstRadius = radius; //PSYS_SRC_BURST_RADIUS
|
||||
prules.BurstRadius = burstRadius; //PSYS_SRC_BURST_RADIUS
|
||||
prules.BurstSpeedMin = 0.001f; //PSYS_SRC_BURST_SPEED_MIN
|
||||
prules.BurstSpeedMax = 0.001f; //PSYS_SRC_BURST_SPEED_MAX
|
||||
prules.MaxAge = 0.0f; //PSYS_SRC_MAX_AGE
|
||||
//prules.Target = To; //PSYS_SRC_TARGET_KEY
|
||||
prules.AngularVelocity.X = 0.0f; //PSYS_SRC_OMEGA
|
||||
prules.Pattern = patternFlags; //PSYS_SRC_PATTERN
|
||||
//prules.Texture = UUID.Zero;//= UUID //PSYS_SRC_TEXTURE, default used if blank
|
||||
prules.BurstRate = burstRate; //PSYS_SRC_BURST_RATE
|
||||
prules.BurstPartCount = 2; //PSYS_SRC_BURST_PART_COUNT
|
||||
//prules.BurstRadius = radius; //PSYS_SRC_BURST_RADIUS
|
||||
prules.BurstRadius = burstRadius; //PSYS_SRC_BURST_RADIUS
|
||||
prules.BurstSpeedMin = 0.001f; //PSYS_SRC_BURST_SPEED_MIN
|
||||
prules.BurstSpeedMax = 0.001f; //PSYS_SRC_BURST_SPEED_MAX
|
||||
prules.MaxAge = 0.0f; //PSYS_SRC_MAX_AGE
|
||||
//prules.Target = To; //PSYS_SRC_TARGET_KEY
|
||||
prules.AngularVelocity.X = 0.0f; //PSYS_SRC_OMEGA
|
||||
prules.AngularVelocity.Y = 0.0f;
|
||||
prules.AngularVelocity.Z = 0.0f;
|
||||
prules.InnerAngle = 0.0f; //PSYS_SRC_ANGLE_BEGIN
|
||||
prules.OuterAngle = 0.0f; //PSYS_SRC_ANGLE_END
|
||||
prules.InnerAngle = 0.0f; //PSYS_SRC_ANGLE_BEGIN
|
||||
prules.OuterAngle = 0.0f; //PSYS_SRC_ANGLE_END
|
||||
|
||||
prules.CRC = 1; //activates the particle system??
|
||||
prules.CRC = 1; //activates the particle system??
|
||||
From.AddNewParticleSystem(prules);
|
||||
}
|
||||
|
||||
|
||||
@@ -79,15 +79,15 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
Vector3 FromPos = From.GetWorldPosition();
|
||||
Vector3 ToPos = From.GetWorldPosition();
|
||||
// UUID toUUID = To.UUID;
|
||||
float distance = (float) (Math.Sqrt(Math.Pow(FromPos.X-ToPos.X, 2) +
|
||||
Math.Pow(FromPos.X-ToPos.Y, 2) +
|
||||
float distance = (float) (Math.Sqrt(Math.Pow(FromPos.X-ToPos.X, 2) +
|
||||
Math.Pow(FromPos.X-ToPos.Y, 2) +
|
||||
Math.Pow(FromPos.X-ToPos.Z, 2)
|
||||
)
|
||||
);
|
||||
//float rate = (float) (distance/4f);
|
||||
float rate = 0.5f;
|
||||
float scale = (float) (distance/128f);
|
||||
float speed = (float) (2.0f - distance/128f);
|
||||
float speed = (float) (2.0f - distance/128f);
|
||||
|
||||
SetBeamToUUID(From, To, color, rate, scale, speed);
|
||||
}
|
||||
@@ -95,42 +95,42 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
public void SetBeamToUUID(SceneObjectPart From, SceneObjectPart To, Vector3 color, float rate, float scale, float speed)
|
||||
{
|
||||
Primitive.ParticleSystem prules = new Primitive.ParticleSystem();
|
||||
//prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Emissive |
|
||||
// Primitive.ParticleSystem.ParticleDataFlags.FollowSrc; //PSYS_PART_FLAGS
|
||||
prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Beam |
|
||||
Primitive.ParticleSystem.ParticleDataFlags.TargetPos;
|
||||
prules.PartStartColor.R = color.X; //PSYS_PART_START_COLOR
|
||||
//prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Emissive |
|
||||
// Primitive.ParticleSystem.ParticleDataFlags.FollowSrc; //PSYS_PART_FLAGS
|
||||
prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Beam |
|
||||
Primitive.ParticleSystem.ParticleDataFlags.TargetPos;
|
||||
prules.PartStartColor.R = color.X; //PSYS_PART_START_COLOR
|
||||
prules.PartStartColor.G = color.Y;
|
||||
prules.PartStartColor.B = color.Z;
|
||||
prules.PartStartColor.A = 1.0f; //PSYS_PART_START_ALPHA, transparency
|
||||
prules.PartEndColor.R = color.X; //PSYS_PART_END_COLOR
|
||||
prules.PartStartColor.A = 1.0f; //PSYS_PART_START_ALPHA, transparency
|
||||
prules.PartEndColor.R = color.X; //PSYS_PART_END_COLOR
|
||||
prules.PartEndColor.G = color.Y;
|
||||
prules.PartEndColor.B = color.Z;
|
||||
prules.PartEndColor.A = 1.0f; //PSYS_PART_END_ALPHA, transparency
|
||||
prules.PartStartScaleX = scale; //PSYS_PART_START_SCALE
|
||||
prules.PartEndColor.A = 1.0f; //PSYS_PART_END_ALPHA, transparency
|
||||
prules.PartStartScaleX = scale; //PSYS_PART_START_SCALE
|
||||
prules.PartStartScaleY = scale;
|
||||
prules.PartEndScaleX = scale; //PSYS_PART_END_SCALE
|
||||
prules.PartEndScaleX = scale; //PSYS_PART_END_SCALE
|
||||
prules.PartEndScaleY = scale;
|
||||
prules.PartMaxAge = 1.0f; //PSYS_PART_MAX_AGE
|
||||
prules.PartAcceleration.X = 0.0f; //PSYS_SRC_ACCEL
|
||||
prules.PartMaxAge = 1.0f; //PSYS_PART_MAX_AGE
|
||||
prules.PartAcceleration.X = 0.0f; //PSYS_SRC_ACCEL
|
||||
prules.PartAcceleration.Y = 0.0f;
|
||||
prules.PartAcceleration.Z = 0.0f;
|
||||
//prules.Pattern = Primitive.ParticleSystem.SourcePattern.Explode; //PSYS_SRC_PATTERN
|
||||
//prules.Texture = UUID.Zero;//= UUID //PSYS_SRC_TEXTURE, default used if blank
|
||||
prules.BurstRate = rate; //PSYS_SRC_BURST_RATE
|
||||
prules.BurstPartCount = 1; //PSYS_SRC_BURST_PART_COUNT
|
||||
prules.BurstRadius = 0.5f; //PSYS_SRC_BURST_RADIUS
|
||||
prules.BurstSpeedMin = speed; //PSYS_SRC_BURST_SPEED_MIN
|
||||
prules.BurstSpeedMax = speed; //PSYS_SRC_BURST_SPEED_MAX
|
||||
prules.MaxAge = 0.0f; //PSYS_SRC_MAX_AGE
|
||||
prules.Target = To.UUID; //PSYS_SRC_TARGET_KEY
|
||||
prules.AngularVelocity.X = 0.0f; //PSYS_SRC_OMEGA
|
||||
//prules.Pattern = Primitive.ParticleSystem.SourcePattern.Explode; //PSYS_SRC_PATTERN
|
||||
//prules.Texture = UUID.Zero;//= UUID //PSYS_SRC_TEXTURE, default used if blank
|
||||
prules.BurstRate = rate; //PSYS_SRC_BURST_RATE
|
||||
prules.BurstPartCount = 1; //PSYS_SRC_BURST_PART_COUNT
|
||||
prules.BurstRadius = 0.5f; //PSYS_SRC_BURST_RADIUS
|
||||
prules.BurstSpeedMin = speed; //PSYS_SRC_BURST_SPEED_MIN
|
||||
prules.BurstSpeedMax = speed; //PSYS_SRC_BURST_SPEED_MAX
|
||||
prules.MaxAge = 0.0f; //PSYS_SRC_MAX_AGE
|
||||
prules.Target = To.UUID; //PSYS_SRC_TARGET_KEY
|
||||
prules.AngularVelocity.X = 0.0f; //PSYS_SRC_OMEGA
|
||||
prules.AngularVelocity.Y = 0.0f;
|
||||
prules.AngularVelocity.Z = 0.0f;
|
||||
prules.InnerAngle = 0.0f; //PSYS_SRC_ANGLE_BEGIN
|
||||
prules.OuterAngle = 0.0f; //PSYS_SRC_ANGLE_END
|
||||
prules.InnerAngle = 0.0f; //PSYS_SRC_ANGLE_BEGIN
|
||||
prules.OuterAngle = 0.0f; //PSYS_SRC_ANGLE_END
|
||||
|
||||
prules.CRC = 1; //activates the particle system??
|
||||
prules.CRC = 1; //activates the particle system??
|
||||
From.AddNewParticleSystem(prules);
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
CMModel m_model = null;
|
||||
|
||||
/// <value>
|
||||
/// A list of all the scenes that should be revisioned. Controller is the only class that keeps track of all scenes in the region.
|
||||
/// A list of all the scenes that should be revisioned. Controller is the only class that keeps track of all scenes in the region.
|
||||
/// </value>
|
||||
Hashtable m_sceneList = Hashtable.Synchronized(new Hashtable());
|
||||
State m_state = State.NONE;
|
||||
@@ -129,31 +129,31 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
/// </summary>
|
||||
private SceneObjectGroup GetGroupByPrim(uint localID)
|
||||
{
|
||||
foreach(Object currScene in m_sceneList.Values)
|
||||
foreach (Object currScene in m_sceneList.Values)
|
||||
{
|
||||
foreach (EntityBase ent in ((Scene)currScene).GetEntities())
|
||||
{
|
||||
if (ent is SceneObjectGroup)
|
||||
{
|
||||
if (((SceneObjectGroup)ent).HasChildPrim(localID))
|
||||
return (SceneObjectGroup)ent;
|
||||
}
|
||||
}
|
||||
foreach (EntityBase ent in ((Scene)currScene).GetEntities())
|
||||
{
|
||||
if (ent is SceneObjectGroup)
|
||||
{
|
||||
if (((SceneObjectGroup)ent).HasChildPrim(localID))
|
||||
return (SceneObjectGroup)ent;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void Initialize(CMModel model, CMView view, Scene scene, int channel)
|
||||
{
|
||||
lock(this)
|
||||
lock (this)
|
||||
{
|
||||
m_estateModule = scene.RequestModuleInterface<IEstateModule>();
|
||||
m_thread = new Thread( MainLoop );
|
||||
m_thread.Name = "Content Management";
|
||||
m_thread.IsBackground = true;
|
||||
m_thread.Start();
|
||||
ThreadTracker.Add(m_thread);
|
||||
m_state = State.NONE;
|
||||
m_estateModule = scene.RequestModuleInterface<IEstateModule>();
|
||||
m_thread = new Thread(MainLoop);
|
||||
m_thread.Name = "Content Management";
|
||||
m_thread.IsBackground = true;
|
||||
m_thread.Start();
|
||||
ThreadTracker.Add(m_thread);
|
||||
m_state = State.NONE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,41 +164,41 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
{
|
||||
CMModel model = m_model; CMView view = m_view; int channel = m_channel;
|
||||
Work currentJob = new Work();
|
||||
while(true)
|
||||
while (true)
|
||||
{
|
||||
currentJob = m_WorkQueue.Dequeue();
|
||||
m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- DeQueued a request");
|
||||
m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- Work type: " + currentJob.Type);
|
||||
switch(currentJob.Type)
|
||||
{
|
||||
case WorkType.NONE:
|
||||
break;
|
||||
case WorkType.OBJECTATTRIBUTECHANGE:
|
||||
ObjectAttributeChanged(model, view, currentJob.LocalId);
|
||||
break;
|
||||
case WorkType.PRIMITIVEADDED:
|
||||
PrimitiveAdded(model, view, currentJob);
|
||||
break;
|
||||
case WorkType.OBJECTDUPLICATED:
|
||||
ObjectDuplicated(model, view, currentJob.LocalId);
|
||||
break;
|
||||
case WorkType.OBJECTKILLED:
|
||||
ObjectKilled(model, view, (SceneObjectGroup) currentJob.Data1);
|
||||
break;
|
||||
case WorkType.UNDODID:
|
||||
UndoDid(model, view, currentJob.UUID);
|
||||
break;
|
||||
case WorkType.NEWCLIENT:
|
||||
NewClient(view, (IClientAPI) currentJob.Data1);
|
||||
break;
|
||||
case WorkType.SIMCHAT:
|
||||
m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- Message received: " + ((OSChatMessage) currentJob.Data1).Message);
|
||||
SimChat(model, view, (OSChatMessage) currentJob.Data1, channel);
|
||||
break;
|
||||
default:
|
||||
m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- uuuuuuuuuh, what?");
|
||||
break;
|
||||
}
|
||||
currentJob = m_WorkQueue.Dequeue();
|
||||
m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- DeQueued a request");
|
||||
m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- Work type: " + currentJob.Type);
|
||||
switch (currentJob.Type)
|
||||
{
|
||||
case WorkType.NONE:
|
||||
break;
|
||||
case WorkType.OBJECTATTRIBUTECHANGE:
|
||||
ObjectAttributeChanged(model, view, currentJob.LocalId);
|
||||
break;
|
||||
case WorkType.PRIMITIVEADDED:
|
||||
PrimitiveAdded(model, view, currentJob);
|
||||
break;
|
||||
case WorkType.OBJECTDUPLICATED:
|
||||
ObjectDuplicated(model, view, currentJob.LocalId);
|
||||
break;
|
||||
case WorkType.OBJECTKILLED:
|
||||
ObjectKilled(model, view, (SceneObjectGroup) currentJob.Data1);
|
||||
break;
|
||||
case WorkType.UNDODID:
|
||||
UndoDid(model, view, currentJob.UUID);
|
||||
break;
|
||||
case WorkType.NEWCLIENT:
|
||||
NewClient(view, (IClientAPI) currentJob.Data1);
|
||||
break;
|
||||
case WorkType.SIMCHAT:
|
||||
m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- Message received: " + ((OSChatMessage) currentJob.Data1).Message);
|
||||
SimChat(model, view, (OSChatMessage) currentJob.Data1, channel);
|
||||
break;
|
||||
default:
|
||||
m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- uuuuuuuuuh, what?");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,24 +207,24 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
/// </summary>
|
||||
private void NewClient(CMView view, IClientAPI client)
|
||||
{
|
||||
if ((m_state & State.SHOWING_CHANGES) > 0)
|
||||
view.SendMetaEntitiesToNewClient(client);
|
||||
if ((m_state & State.SHOWING_CHANGES) > 0)
|
||||
view.SendMetaEntitiesToNewClient(client);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Only called by the MainLoop.
|
||||
/// Only called by the MainLoop.
|
||||
/// </summary>
|
||||
private void ObjectAttributeChanged(CMModel model, CMView view, uint LocalId)
|
||||
{
|
||||
SceneObjectGroup group = null;
|
||||
if ((m_state & State.SHOWING_CHANGES) > 0)
|
||||
if ((m_state & State.SHOWING_CHANGES) > 0)
|
||||
{
|
||||
group = GetGroupByPrim(LocalId);
|
||||
if (group != null)
|
||||
{
|
||||
view.DisplayAuras( model.UpdateNormalEntityEffects(group) ); //Might be a normal entity (green aura)
|
||||
m_view.DisplayMetaEntity(group.UUID); //Might be a meta entity (blue aura)
|
||||
}
|
||||
group = GetGroupByPrim(LocalId);
|
||||
if (group != null)
|
||||
{
|
||||
view.DisplayAuras(model.UpdateNormalEntityEffects(group)); //Might be a normal entity (green aura)
|
||||
m_view.DisplayMetaEntity(group.UUID); //Might be a meta entity (blue aura)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,43 +234,43 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
private void ObjectDuplicated(CMModel model, CMView view, uint localId)
|
||||
{
|
||||
if ((m_state & State.SHOWING_CHANGES) > 0)
|
||||
view.DisplayAuras(model.CheckForNewEntitiesMissingAuras( GetGroupByPrim(localId).Scene ));
|
||||
view.DisplayAuras(model.CheckForNewEntitiesMissingAuras(GetGroupByPrim(localId).Scene));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Only called by the MainLoop.
|
||||
/// </summary>
|
||||
/// Only called by the MainLoop.
|
||||
/// </summary>
|
||||
private void ObjectKilled(CMModel model, CMView view, SceneObjectGroup group)
|
||||
{
|
||||
if ((m_state & State.SHOWING_CHANGES) > 0)
|
||||
if ((m_state & State.SHOWING_CHANGES) > 0)
|
||||
{
|
||||
view.RemoveOrUpdateDeletedEntity(group);
|
||||
model.RemoveOrUpdateDeletedEntity(group);
|
||||
view.RemoveOrUpdateDeletedEntity(group);
|
||||
model.RemoveOrUpdateDeletedEntity(group);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Only called by the MainLoop.
|
||||
/// Only called by the MainLoop.
|
||||
/// </summary>
|
||||
private void PrimitiveAdded(CMModel model, CMView view, Work currentJob)
|
||||
{
|
||||
if ((m_state & State.SHOWING_CHANGES) > 0)
|
||||
if ((m_state & State.SHOWING_CHANGES) > 0)
|
||||
{
|
||||
foreach(Object scene in m_sceneList.Values)
|
||||
m_view.DisplayAuras(model.CheckForNewEntitiesMissingAuras((Scene) scene));
|
||||
foreach (Object scene in m_sceneList.Values)
|
||||
m_view.DisplayAuras(model.CheckForNewEntitiesMissingAuras((Scene) scene));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Only called by the MainLoop.
|
||||
/// Only called by the MainLoop.
|
||||
/// </summary>
|
||||
private void UndoDid(CMModel model, CMView view, UUID uuid)
|
||||
{
|
||||
if ((m_state & State.SHOWING_CHANGES) > 0)
|
||||
if ((m_state & State.SHOWING_CHANGES) > 0)
|
||||
{
|
||||
ContentManagementEntity ent = model.FindMetaEntityAffectedByUndo(uuid);
|
||||
if (ent != null)
|
||||
view.DisplayEntity(ent);
|
||||
ContentManagementEntity ent = model.FindMetaEntityAffectedByUndo(uuid);
|
||||
if (ent != null)
|
||||
view.DisplayEntity(ent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -328,38 +328,38 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
/// <summary>
|
||||
/// Takes a list of scenes and forms a new orderd list according to the proximity of scenes to the second argument.
|
||||
/// </summary>
|
||||
protected static System.Collections.Generic.List<Scene> ScenesInOrderOfProximity( Hashtable sceneList, Scene scene)
|
||||
protected static System.Collections.Generic.List<Scene> ScenesInOrderOfProximity(Hashtable sceneList, Scene scene)
|
||||
{
|
||||
int somethingAddedToList = 1;
|
||||
System.Collections.Generic.List<Scene> newList = new List<Scene>();
|
||||
newList.Add(scene);
|
||||
|
||||
if (! sceneList.ContainsValue(scene))
|
||||
if (!sceneList.ContainsValue(scene))
|
||||
{
|
||||
foreach(Object sceneObj in sceneList)
|
||||
newList.Add((Scene) sceneObj);
|
||||
return newList;
|
||||
foreach (Object sceneObj in sceneList)
|
||||
newList.Add((Scene) sceneObj);
|
||||
return newList;
|
||||
}
|
||||
|
||||
while(somethingAddedToList > 0)
|
||||
while (somethingAddedToList > 0)
|
||||
{
|
||||
somethingAddedToList = 0;
|
||||
for(int i = 0; i < newList.Count; i++)
|
||||
{
|
||||
foreach(Object sceneObj in sceneList.Values)
|
||||
{
|
||||
if (newList[i].CheckNeighborRegion(((Scene)sceneObj).RegionInfo) && (! newList.Contains((Scene)sceneObj)) )
|
||||
{
|
||||
newList.Add((Scene)sceneObj);
|
||||
somethingAddedToList++;
|
||||
}
|
||||
}
|
||||
}
|
||||
somethingAddedToList = 0;
|
||||
for (int i = 0; i < newList.Count; i++)
|
||||
{
|
||||
foreach (Object sceneObj in sceneList.Values)
|
||||
{
|
||||
if (newList[i].CheckNeighborRegion(((Scene)sceneObj).RegionInfo) && (!newList.Contains((Scene)sceneObj)))
|
||||
{
|
||||
newList.Add((Scene)sceneObj);
|
||||
somethingAddedToList++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach(Object sceneObj in sceneList.Values)
|
||||
if (! newList.Contains((Scene)sceneObj))
|
||||
newList.Add((Scene)sceneObj);
|
||||
foreach (Object sceneObj in sceneList.Values)
|
||||
if (!newList.Contains((Scene)sceneObj))
|
||||
newList.Add((Scene)sceneObj);
|
||||
|
||||
return newList;
|
||||
}
|
||||
@@ -381,7 +381,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
protected void StartManaging(IClientAPI client)
|
||||
{
|
||||
m_log.Debug("[CONTENT MANAGEMENT] Registering channel with chat services.");
|
||||
client.OnChatFromViewer += SimChatSent;
|
||||
client.OnChatFromViewer += SimChatSent;
|
||||
//init = true;
|
||||
|
||||
OnNewClient(client);
|
||||
@@ -401,19 +401,19 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
protected void StopManaging(UUID clientUUID)
|
||||
{
|
||||
foreach(Object sceneobj in m_sceneList.Values)
|
||||
foreach (Object sceneobj in m_sceneList.Values)
|
||||
{
|
||||
ScenePresence presence = ((Scene)sceneobj).GetScenePresence(clientUUID);
|
||||
ScenePresence presence = ((Scene)sceneobj).GetScenePresence(clientUUID);
|
||||
if (presence != null)
|
||||
{
|
||||
IClientAPI client = presence.ControllingClient;
|
||||
m_log.Debug("[CONTENT MANAGEMENT] Unregistering channel with chat services.");
|
||||
client.OnChatFromViewer -= SimChatSent;
|
||||
|
||||
client.OnChatFromViewer -= SimChatSent;
|
||||
|
||||
m_log.Debug("[CONTENT MANAGEMENT] Removing handlers to client");
|
||||
client.OnUpdatePrimScale -= UpdateSingleScale;
|
||||
client.OnUpdatePrimGroupScale -= UpdateMultipleScale;
|
||||
@@ -427,10 +427,10 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
client.OnUndo -= OnUnDid;
|
||||
//client.OnUpdatePrimGroupMouseRotation += m_innerScene.UpdatePrimRotation;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void UpdateMultiplePosition(uint localID, Vector3 pos, IClientAPI remoteClient)
|
||||
{
|
||||
Work moreWork = new Work();
|
||||
@@ -479,7 +479,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
protected void UpdateSingleRotation(uint localID, Quaternion rot, IClientAPI remoteClient)
|
||||
{
|
||||
@@ -504,47 +504,47 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
/// </summary>
|
||||
protected void commit(string message, Scene scene, CMModel model, CMView view)
|
||||
{
|
||||
System.Collections.Generic.List<Scene> proximitySceneList = ScenesInOrderOfProximity( m_sceneList, scene);
|
||||
System.Collections.Generic.List<Scene> proximitySceneList = ScenesInOrderOfProximity(m_sceneList, scene);
|
||||
|
||||
string[] args = message.Split(new char[] {' '});
|
||||
|
||||
char[] logMessage = {' '};
|
||||
if (args.Length > 1)
|
||||
if (args.Length > 1)
|
||||
{
|
||||
logMessage = new char[message.Length - (args[0].Length)];
|
||||
message.CopyTo(args[0].Length, logMessage, 0, message.Length - (args[0].Length));
|
||||
}
|
||||
logMessage = new char[message.Length - (args[0].Length)];
|
||||
message.CopyTo(args[0].Length, logMessage, 0, message.Length - (args[0].Length));
|
||||
}
|
||||
|
||||
m_log.Debug("[CONTENT MANAGEMENT] Saving terrain and objects of region.");
|
||||
foreach(Scene currScene in proximitySceneList)
|
||||
foreach (Scene currScene in proximitySceneList)
|
||||
{
|
||||
model.CommitRegion(currScene, new String(logMessage));
|
||||
view.SendSimChatMessage(scene, "Region Saved Successfully: " + currScene.RegionInfo.RegionName);
|
||||
model.CommitRegion(currScene, new String(logMessage));
|
||||
view.SendSimChatMessage(scene, "Region Saved Successfully: " + currScene.RegionInfo.RegionName);
|
||||
}
|
||||
|
||||
view.SendSimChatMessage(scene, "Successfully saved all regions.");
|
||||
m_state |= State.DIRTY;
|
||||
|
||||
if ((m_state & State.SHOWING_CHANGES) > 0) //DISPLAY NEW CHANGES INSTEAD OF OLD CHANGES
|
||||
{
|
||||
view.SendSimChatMessage(scene, "Updating differences between new revision and current environment.");
|
||||
//Hide objects from users and Forget about them
|
||||
view.HideAllMetaEntities();
|
||||
view.HideAllAuras();
|
||||
model.DeleteAllMetaObjects();
|
||||
|
||||
//Recreate them from backend files
|
||||
foreach(Scene currScene in proximitySceneList)
|
||||
{
|
||||
model.UpdateCMEntities(currScene);
|
||||
view.SendSimChatMessage(scene, "Finished updating differences between current scene and last revision: " + currScene.RegionInfo.RegionName);
|
||||
}
|
||||
|
||||
//Display new objects to users1
|
||||
view.DisplayRecentChanges();
|
||||
view.SendSimChatMessage(scene, "Finished updating for DIFF-MODE.");
|
||||
m_state &= ~(State.DIRTY);
|
||||
m_state |= State.SHOWING_CHANGES;
|
||||
{
|
||||
view.SendSimChatMessage(scene, "Updating differences between new revision and current environment.");
|
||||
//Hide objects from users and Forget about them
|
||||
view.HideAllMetaEntities();
|
||||
view.HideAllAuras();
|
||||
model.DeleteAllMetaObjects();
|
||||
|
||||
//Recreate them from backend files
|
||||
foreach (Scene currScene in proximitySceneList)
|
||||
{
|
||||
model.UpdateCMEntities(currScene);
|
||||
view.SendSimChatMessage(scene, "Finished updating differences between current scene and last revision: " + currScene.RegionInfo.RegionName);
|
||||
}
|
||||
|
||||
//Display new objects to users1
|
||||
view.DisplayRecentChanges();
|
||||
view.SendSimChatMessage(scene, "Finished updating for DIFF-MODE.");
|
||||
m_state &= ~(State.DIRTY);
|
||||
m_state |= State.SHOWING_CHANGES;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -553,74 +553,74 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
/// </summary>
|
||||
protected void diffmode(Scene scene, CMModel model, CMView view)
|
||||
{
|
||||
System.Collections.Generic.List<Scene> proximitySceneList = ScenesInOrderOfProximity( m_sceneList, scene);
|
||||
System.Collections.Generic.List<Scene> proximitySceneList = ScenesInOrderOfProximity(m_sceneList, scene);
|
||||
|
||||
if ((m_state & State.SHOWING_CHANGES) > 0) // TURN OFF
|
||||
{
|
||||
view.SendSimChatMessage(scene, "Hiding all meta objects.");
|
||||
view.HideAllMetaEntities();
|
||||
view.HideAllAuras();
|
||||
view.SendSimChatMessage(scene, "Diff-mode = OFF");
|
||||
|
||||
m_state &= ~State.SHOWING_CHANGES;
|
||||
return;
|
||||
view.SendSimChatMessage(scene, "Hiding all meta objects.");
|
||||
view.HideAllMetaEntities();
|
||||
view.HideAllAuras();
|
||||
view.SendSimChatMessage(scene, "Diff-mode = OFF");
|
||||
|
||||
m_state &= ~State.SHOWING_CHANGES;
|
||||
return;
|
||||
}
|
||||
else // TURN ON
|
||||
{
|
||||
if ((m_state & State.DIRTY) != 0 || m_state == State.NONE)
|
||||
{
|
||||
view.SendSimChatMessage(scene, "Hiding meta objects and replacing with latest revision");
|
||||
//Hide objects from users and Forget about them
|
||||
view.HideAllMetaEntities();
|
||||
view.HideAllAuras();
|
||||
model.DeleteAllMetaObjects();
|
||||
//Recreate them from backend files
|
||||
foreach(Object currScene in m_sceneList.Values)
|
||||
model.UpdateCMEntities((Scene) currScene);
|
||||
}
|
||||
else if ((m_state & State.DIRTY) != 0) {
|
||||
view.SendSimChatMessage(scene, "Forming list of meta entities with latest revision");
|
||||
foreach(Scene currScene in proximitySceneList)
|
||||
model.UpdateCMEntities(currScene);
|
||||
}
|
||||
if ((m_state & State.DIRTY) != 0 || m_state == State.NONE)
|
||||
{
|
||||
view.SendSimChatMessage(scene, "Hiding meta objects and replacing with latest revision");
|
||||
//Hide objects from users and Forget about them
|
||||
view.HideAllMetaEntities();
|
||||
view.HideAllAuras();
|
||||
model.DeleteAllMetaObjects();
|
||||
//Recreate them from backend files
|
||||
foreach (Object currScene in m_sceneList.Values)
|
||||
model.UpdateCMEntities((Scene) currScene);
|
||||
}
|
||||
else if ((m_state & State.DIRTY) != 0) {
|
||||
view.SendSimChatMessage(scene, "Forming list of meta entities with latest revision");
|
||||
foreach (Scene currScene in proximitySceneList)
|
||||
model.UpdateCMEntities(currScene);
|
||||
}
|
||||
|
||||
view.SendSimChatMessage(scene, "Displaying differences between last revision and current environment");
|
||||
foreach(Scene currScene in proximitySceneList)
|
||||
model.CheckForNewEntitiesMissingAuras(currScene);
|
||||
view.DisplayRecentChanges();
|
||||
|
||||
view.SendSimChatMessage(scene, "Diff-mode = ON");
|
||||
m_state |= State.SHOWING_CHANGES;
|
||||
m_state &= ~State.DIRTY;
|
||||
view.SendSimChatMessage(scene, "Displaying differences between last revision and current environment");
|
||||
foreach (Scene currScene in proximitySceneList)
|
||||
model.CheckForNewEntitiesMissingAuras(currScene);
|
||||
view.DisplayRecentChanges();
|
||||
|
||||
view.SendSimChatMessage(scene, "Diff-mode = ON");
|
||||
m_state |= State.SHOWING_CHANGES;
|
||||
m_state &= ~State.DIRTY;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Only called from within the SimChat method. Hides all auras and meta entities,
|
||||
/// retrieves the current scene object list with the most recent revision retrieved from the model for each scene,
|
||||
/// Only called from within the SimChat method. Hides all auras and meta entities,
|
||||
/// retrieves the current scene object list with the most recent revision retrieved from the model for each scene,
|
||||
/// then lets the view update the clients of the new objects.
|
||||
/// </summary>
|
||||
protected void rollback(Scene scene, CMModel model, CMView view)
|
||||
{
|
||||
if ((m_state & State.SHOWING_CHANGES) > 0)
|
||||
{
|
||||
view.HideAllAuras();
|
||||
view.HideAllMetaEntities();
|
||||
view.HideAllAuras();
|
||||
view.HideAllMetaEntities();
|
||||
}
|
||||
|
||||
System.Collections.Generic.List<Scene> proximitySceneList = ScenesInOrderOfProximity( m_sceneList, scene);
|
||||
foreach(Scene currScene in proximitySceneList)
|
||||
model.RollbackRegion(currScene);
|
||||
System.Collections.Generic.List<Scene> proximitySceneList = ScenesInOrderOfProximity(m_sceneList, scene);
|
||||
foreach (Scene currScene in proximitySceneList)
|
||||
model.RollbackRegion(currScene);
|
||||
|
||||
if ((m_state & State.DIRTY) != 0 )
|
||||
if ((m_state & State.DIRTY) != 0)
|
||||
{
|
||||
model.DeleteAllMetaObjects();
|
||||
foreach(Scene currScene in proximitySceneList)
|
||||
model.UpdateCMEntities(currScene);
|
||||
model.DeleteAllMetaObjects();
|
||||
foreach (Scene currScene in proximitySceneList)
|
||||
model.UpdateCMEntities(currScene);
|
||||
}
|
||||
|
||||
if ((m_state & State.SHOWING_CHANGES) > 0)
|
||||
view.DisplayRecentChanges();
|
||||
view.DisplayRecentChanges();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
@@ -642,7 +642,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
|
||||
scene.EventManager.OnNewClient += StartManaging;
|
||||
scene.EventManager.OnRemovePresence += StopManaging;
|
||||
// scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel;
|
||||
// scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel;
|
||||
scene.EventManager.OnObjectBeingRemovedFromScene += GroupBeingDeleted;
|
||||
}
|
||||
|
||||
@@ -652,9 +652,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
public void SimChat(CMModel model, CMView view, OSChatMessage e, int channel)
|
||||
{
|
||||
if (e.Channel != channel)
|
||||
return;
|
||||
return;
|
||||
if (e.Sender == null)
|
||||
return;
|
||||
return;
|
||||
|
||||
m_log.Debug("[CONTENT MANAGEMENT] Message received: " + e.Message);
|
||||
|
||||
@@ -667,31 +667,31 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
|
||||
if (!(m_estateModule.IsManager(avatar.UUID)))
|
||||
{
|
||||
m_log.Debug("[CONTENT MANAGEMENT] Message sent from non Estate Manager ... ignoring.");
|
||||
view.SendSimChatMessage(scene, "You must be an estate manager to perform that action.");
|
||||
return;
|
||||
m_log.Debug("[CONTENT MANAGEMENT] Message sent from non Estate Manager ... ignoring.");
|
||||
view.SendSimChatMessage(scene, "You must be an estate manager to perform that action.");
|
||||
return;
|
||||
}
|
||||
|
||||
switch(args[0])
|
||||
switch (args[0])
|
||||
{
|
||||
case "ci":
|
||||
case "commit":
|
||||
commit(message, scene, model, view);
|
||||
break;
|
||||
commit(message, scene, model, view);
|
||||
break;
|
||||
case "dm":
|
||||
case "diff-mode":
|
||||
diffmode(scene, model, view);
|
||||
break;
|
||||
diffmode(scene, model, view);
|
||||
break;
|
||||
case "rb":
|
||||
case "rollback":
|
||||
rollback(scene, model, view);
|
||||
break;
|
||||
rollback(scene, model, view);
|
||||
break;
|
||||
case "help":
|
||||
m_view.DisplayHelpMenu(scene);
|
||||
break;
|
||||
m_view.DisplayHelpMenu(scene);
|
||||
break;
|
||||
default:
|
||||
view.SendSimChatMessage(scene, "Command not found: " + args[0]);
|
||||
break;
|
||||
view.SendSimChatMessage(scene, "Command not found: " + args[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -705,7 +705,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
[Flags]
|
||||
private enum State
|
||||
{
|
||||
NONE = 0,
|
||||
NONE = 0,
|
||||
DIRTY = 1, // The meta entities may not correctly represent the last revision.
|
||||
SHOWING_CHANGES = 1<<1 // The meta entities are being shown to user.
|
||||
}
|
||||
|
||||
@@ -58,8 +58,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
{
|
||||
#region Fields
|
||||
|
||||
// private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
// Any ContentManagementEntities that represent old versions of current SceneObjectGroups or
|
||||
// private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
// Any ContentManagementEntities that represent old versions of current SceneObjectGroups or
|
||||
// old versions of deleted SceneObjectGroups will be stored in this hash table.
|
||||
// The UUID keys are from the SceneObjectGroup RootPart UUIDs
|
||||
protected Hashtable m_CMEntityHash = Hashtable.Synchronized(new Hashtable()); //UUID to ContentManagementEntity
|
||||
@@ -97,7 +97,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
public bool AddAura(ContentManagementEntity aura)
|
||||
{
|
||||
if (m_NewlyCreatedEntityAura.ContainsKey(aura.UUID))
|
||||
return false;
|
||||
return false;
|
||||
m_NewlyCreatedEntityAura.Add(aura.UUID, aura);
|
||||
return true;
|
||||
}
|
||||
@@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
public bool AddEntity(ContentManagementEntity ent)
|
||||
{
|
||||
if (m_CMEntityHash.ContainsKey(ent.UUID))
|
||||
return false;
|
||||
return false;
|
||||
m_CMEntityHash.Add(ent.UUID, ent);
|
||||
return true;
|
||||
}
|
||||
@@ -115,23 +115,23 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
{
|
||||
System.Collections.ArrayList missingList = new System.Collections.ArrayList();
|
||||
SceneObjectGroup temp = null;
|
||||
foreach( EntityBase currObj in currList )
|
||||
foreach (EntityBase currObj in currList)
|
||||
{
|
||||
if (! (currObj is SceneObjectGroup))
|
||||
continue;
|
||||
temp = (SceneObjectGroup) currObj;
|
||||
|
||||
if (m_CMEntityHash.ContainsKey(temp.UUID))
|
||||
{
|
||||
foreach(SceneObjectPart part in temp.Children.Values)
|
||||
if (!((ContentManagementEntity)m_CMEntityHash[temp.UUID]).HasChildPrim(part.UUID))
|
||||
missingList.Add(part);
|
||||
}
|
||||
else //Entire group is missing from revision. (and is a new part in region)
|
||||
{
|
||||
foreach(SceneObjectPart part in temp.Children.Values)
|
||||
missingList.Add(part);
|
||||
}
|
||||
if (!(currObj is SceneObjectGroup))
|
||||
continue;
|
||||
temp = (SceneObjectGroup) currObj;
|
||||
|
||||
if (m_CMEntityHash.ContainsKey(temp.UUID))
|
||||
{
|
||||
foreach (SceneObjectPart part in temp.Children.Values)
|
||||
if (!((ContentManagementEntity)m_CMEntityHash[temp.UUID]).HasChildPrim(part.UUID))
|
||||
missingList.Add(part);
|
||||
}
|
||||
else //Entire group is missing from revision. (and is a new part in region)
|
||||
{
|
||||
foreach (SceneObjectPart part in temp.Children.Values)
|
||||
missingList.Add(part);
|
||||
}
|
||||
}
|
||||
return missingList;
|
||||
}
|
||||
@@ -146,9 +146,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
public AuraMetaEntity CreateAuraForNewlyCreatedEntity(SceneObjectPart part)
|
||||
{
|
||||
AuraMetaEntity ent = new AuraMetaEntity(part.ParentGroup.Scene,
|
||||
part.ParentGroup.Scene.PrimIDAllocate(),
|
||||
part.GetWorldPosition(),
|
||||
MetaEntity.TRANSLUCENT,
|
||||
part.ParentGroup.Scene.PrimIDAllocate(),
|
||||
part.GetWorldPosition(),
|
||||
MetaEntity.TRANSLUCENT,
|
||||
new Vector3(0,254,0),
|
||||
part.Scale
|
||||
);
|
||||
@@ -168,7 +168,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
{
|
||||
ContentManagementEntity ent = new ContentManagementEntity(xml, scene, false);
|
||||
if (ent == null)
|
||||
return null;
|
||||
return null;
|
||||
m_CMEntityHash.Add(ent.UnchangedEntity.UUID, ent);
|
||||
return ent;
|
||||
}
|
||||
@@ -176,7 +176,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
public bool RemoveEntity(UUID uuid)
|
||||
{
|
||||
if (!m_CMEntityHash.ContainsKey(uuid))
|
||||
return false;
|
||||
return false;
|
||||
m_CMEntityHash.Remove(uuid);
|
||||
return true;
|
||||
}
|
||||
@@ -184,7 +184,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
public bool RemoveNewlyCreatedEntityAura(UUID uuid)
|
||||
{
|
||||
if (!m_NewlyCreatedEntityAura.ContainsKey(uuid))
|
||||
return false;
|
||||
return false;
|
||||
m_NewlyCreatedEntityAura.Remove(uuid);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
|
||||
#region Header
|
||||
|
||||
// CMModel.cs
|
||||
// User: bongiojp
|
||||
// CMModel.cs
|
||||
// User: bongiojp
|
||||
//
|
||||
//
|
||||
|
||||
@@ -100,13 +100,13 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
ArrayList missingList = null;
|
||||
ArrayList newList = new ArrayList();
|
||||
|
||||
m_log.Debug("[CONTENT MANAGEMENT] Checking for new scene object parts in scene: " + scene.RegionInfo.RegionName);
|
||||
m_log.Debug("[CONTENT MANAGEMENT] Checking for new scene object parts in scene: " + scene.RegionInfo.RegionName);
|
||||
|
||||
//Check if the current scene has groups not included in the current list of MetaEntities
|
||||
//If so, then the current scene's parts that are new should be marked green.
|
||||
//If so, then the current scene's parts that are new should be marked green.
|
||||
missingList = m_MetaEntityCollection.CheckForMissingEntities(scene.GetEntities());
|
||||
|
||||
foreach(Object missingPart in missingList)
|
||||
foreach (Object missingPart in missingList)
|
||||
{
|
||||
if (m_MetaEntityCollection.Auras.ContainsKey(((SceneObjectPart)missingPart).UUID))
|
||||
continue;
|
||||
@@ -175,16 +175,16 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
public void RemoveOrUpdateDeletedEntity(SceneObjectGroup group)
|
||||
{
|
||||
// Deal with new parts not revisioned that have been deleted.
|
||||
foreach(SceneObjectPart part in group.Children.Values)
|
||||
foreach (SceneObjectPart part in group.Children.Values)
|
||||
if (m_MetaEntityCollection.Auras.ContainsKey(part.UUID))
|
||||
m_MetaEntityCollection.RemoveNewlyCreatedEntityAura(part.UUID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the latest revision of a region in xml form,
|
||||
/// converts it to scene object groups and scene presences,
|
||||
/// Retrieves the latest revision of a region in xml form,
|
||||
/// converts it to scene object groups and scene presences,
|
||||
/// swaps the current scene's entity list with the revision's list.
|
||||
/// Note: Since deleted objects while
|
||||
/// Note: Since deleted objects while
|
||||
/// </summary>
|
||||
public void RollbackRegion(Scene scene)
|
||||
{
|
||||
@@ -214,26 +214,26 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
try{
|
||||
temp = new SceneObjectGroup(xml);
|
||||
temp.SetScene(scene);
|
||||
foreach(SceneObjectPart part in temp.Children.Values)
|
||||
foreach (SceneObjectPart part in temp.Children.Values)
|
||||
part.RegionHandle = scene.RegionInfo.RegionHandle;
|
||||
ReplacementList.Add(temp.UUID, (EntityBase)temp);
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
m_log.Info("[CMMODEL]: Error while creating replacement list for rollback: " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//If in scene but not in revision and not a client, remove them
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
try
|
||||
{
|
||||
foreach(EntityBase entity in scene.GetEntities())
|
||||
foreach (EntityBase entity in scene.GetEntities())
|
||||
{
|
||||
if (entity == null)
|
||||
continue;
|
||||
|
||||
|
||||
if (entity is ScenePresence)
|
||||
{
|
||||
ReplacementList.Add(entity.UUID, entity);
|
||||
@@ -253,9 +253,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
break;
|
||||
}
|
||||
|
||||
foreach(UUID uuid in deleteListUUIDs.Keys)
|
||||
foreach (UUID uuid in deleteListUUIDs.Keys)
|
||||
{
|
||||
try
|
||||
try
|
||||
{
|
||||
// I thought that the DeleteGroup() function would handle all of this, but it doesn't. I'm not sure WHAT it handles.
|
||||
((SceneObjectGroup)scene.Entities[uuid]).DetachFromBackup((SceneObjectGroup)scene.Entities[uuid]);
|
||||
@@ -275,13 +275,13 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
scene.Entities = ReplacementList;
|
||||
}
|
||||
|
||||
foreach(EntityBase ent in ReplacementList.Values)
|
||||
foreach (EntityBase ent in ReplacementList.Values)
|
||||
{
|
||||
try
|
||||
{
|
||||
{
|
||||
if (!(ent is SceneObjectGroup))
|
||||
continue;
|
||||
|
||||
|
||||
if ((((SceneObjectGroup)ent).RootPart.GetEffectiveObjectFlags() & (uint) PrimFlags.Phantom) == 0)
|
||||
((SceneObjectGroup)ent).ApplyPhysics(true);
|
||||
((SceneObjectGroup)ent).AttachToBackup();
|
||||
@@ -319,15 +319,15 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
m_MetaEntityCollection.CreateNewEntity(xml, scene);
|
||||
y.Stop();
|
||||
TimeToConvertXml += y.ElapsedMilliseconds;
|
||||
m_log.Info("[FileSystemDatabase] Time spent converting xml to metaentities for " + scene.RegionInfo.RegionName + ": " + y.ElapsedMilliseconds);
|
||||
m_log.Info("[FileSystemDatabase] Time spent converting xml to metaentities so far: " + TimeToConvertXml);
|
||||
m_log.Info("[FileSystemDatabase] Time spent converting xml to metaentities for " + scene.RegionInfo.RegionName + ": " + y.ElapsedMilliseconds);
|
||||
m_log.Info("[FileSystemDatabase] Time spent converting xml to metaentities so far: " + TimeToConvertXml);
|
||||
|
||||
m_log.Info("[FSDB]: checking for new scene object parts missing green auras and create the auras");
|
||||
CheckForNewEntitiesMissingAuras(scene);
|
||||
|
||||
x.Stop();
|
||||
TimeToUpdate += x.ElapsedMilliseconds;
|
||||
m_log.Info("[FileSystemDatabase] Time spent Updating entity list for " + scene.RegionInfo.RegionName + ": " + x.ElapsedMilliseconds);
|
||||
m_log.Info("[FileSystemDatabase] Time spent Updating entity list for " + scene.RegionInfo.RegionName + ": " + x.ElapsedMilliseconds);
|
||||
m_log.Info("[FileSystemDatabase] Time spent Updating so far: " + TimeToUpdate);
|
||||
}
|
||||
|
||||
@@ -340,7 +340,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
System.Collections.ArrayList auraList = new System.Collections.ArrayList();
|
||||
if (group == null)
|
||||
return null;
|
||||
foreach(SceneObjectPart part in group.Children.Values)
|
||||
foreach (SceneObjectPart part in group.Children.Values)
|
||||
{
|
||||
if (m_MetaEntityCollection.Auras.ContainsKey(part.UUID))
|
||||
{
|
||||
|
||||
@@ -78,46 +78,46 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
// Auras To
|
||||
public void DisplayAuras(CMEntityCollection auraCollection)
|
||||
{
|
||||
foreach( Object ent in auraCollection.Auras.Values)
|
||||
((AuraMetaEntity)ent).SendFullUpdateToAll();
|
||||
foreach (Object ent in auraCollection.Auras.Values)
|
||||
((AuraMetaEntity)ent).SendFullUpdateToAll();
|
||||
}
|
||||
|
||||
// Auras To Client
|
||||
public void DisplayAuras(CMEntityCollection auraCollection, IClientAPI client)
|
||||
{
|
||||
foreach( Object ent in auraCollection.Auras.Values)
|
||||
((AuraMetaEntity)ent).SendFullUpdate(client);
|
||||
foreach (Object ent in auraCollection.Auras.Values)
|
||||
((AuraMetaEntity)ent).SendFullUpdate(client);
|
||||
}
|
||||
|
||||
// Auras from List To ALL
|
||||
public void DisplayAuras(ArrayList list)
|
||||
{
|
||||
foreach( Object ent in list)
|
||||
foreach (Object ent in list)
|
||||
{
|
||||
m_log.Debug("[CONTENT MANAGEMENT] displaying new aura riiiiiiiiiiiight NOW");
|
||||
((AuraMetaEntity)ent).SendFullUpdateToAll();
|
||||
m_log.Debug("[CONTENT MANAGEMENT] displaying new aura riiiiiiiiiiiight NOW");
|
||||
((AuraMetaEntity)ent).SendFullUpdateToAll();
|
||||
}
|
||||
}
|
||||
|
||||
// Entities to ALL
|
||||
public void DisplayEntities(CMEntityCollection entityCollection)
|
||||
{
|
||||
foreach( Object ent in entityCollection.Entities.Values)
|
||||
((ContentManagementEntity)ent).SendFullDiffUpdateToAll();
|
||||
foreach (Object ent in entityCollection.Entities.Values)
|
||||
((ContentManagementEntity)ent).SendFullDiffUpdateToAll();
|
||||
}
|
||||
|
||||
// Entities to Client
|
||||
public void DisplayEntities(CMEntityCollection entityCollection, IClientAPI client)
|
||||
{
|
||||
foreach( Object ent in entityCollection.Entities.Values)
|
||||
((ContentManagementEntity)ent).SendFullDiffUpdate(client);
|
||||
foreach (Object ent in entityCollection.Entities.Values)
|
||||
((ContentManagementEntity)ent).SendFullDiffUpdate(client);
|
||||
}
|
||||
|
||||
// Entities from List to ALL
|
||||
public void DisplayEntities(ArrayList list)
|
||||
{
|
||||
foreach( Object ent in list)
|
||||
((ContentManagementEntity)ent).SendFullDiffUpdateToAll();
|
||||
foreach (Object ent in list)
|
||||
((ContentManagementEntity)ent).SendFullDiffUpdateToAll();
|
||||
}
|
||||
|
||||
// Entity to ALL
|
||||
@@ -138,7 +138,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
{
|
||||
ContentManagementEntity group = m_model.GetMetaGroupByPrim(uuid);
|
||||
if (group != null)
|
||||
group.SendFullDiffUpdateToAll();
|
||||
group.SendFullDiffUpdateToAll();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -158,14 +158,14 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
|
||||
public void HideAllAuras()
|
||||
{
|
||||
foreach(Object obj in m_model.MetaEntityCollection.Auras.Values)
|
||||
((MetaEntity)obj).HideFromAll();
|
||||
foreach (Object obj in m_model.MetaEntityCollection.Auras.Values)
|
||||
((MetaEntity)obj).HideFromAll();
|
||||
}
|
||||
|
||||
public void HideAllMetaEntities()
|
||||
{
|
||||
foreach(Object obj in m_model.MetaEntityCollection.Entities.Values)
|
||||
((ContentManagementEntity)obj).HideFromAll();
|
||||
foreach (Object obj in m_model.MetaEntityCollection.Entities.Values)
|
||||
((ContentManagementEntity)obj).HideFromAll();
|
||||
}
|
||||
|
||||
public void Initialise(CMModel model)
|
||||
@@ -183,12 +183,12 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
{
|
||||
// Deal with revisioned parts that have been deleted.
|
||||
if (m_model.MetaEntityCollection.Entities.ContainsKey(group.UUID))
|
||||
((ContentManagementEntity)m_model.MetaEntityCollection.Entities[group.UUID]).SendFullDiffUpdateToAll();
|
||||
((ContentManagementEntity)m_model.MetaEntityCollection.Entities[group.UUID]).SendFullDiffUpdateToAll();
|
||||
|
||||
// Deal with new parts not revisioned that have been deleted.
|
||||
foreach(SceneObjectPart part in group.Children.Values)
|
||||
if (m_model.MetaEntityCollection.Auras.ContainsKey(part.UUID))
|
||||
((AuraMetaEntity)m_model.MetaEntityCollection.Auras[part.UUID]).HideFromAll();
|
||||
foreach (SceneObjectPart part in group.Children.Values)
|
||||
if (m_model.MetaEntityCollection.Auras.ContainsKey(part.UUID))
|
||||
((AuraMetaEntity)m_model.MetaEntityCollection.Auras[part.UUID]).HideFromAll();
|
||||
}
|
||||
|
||||
public void SendMetaEntitiesToNewClient(IClientAPI client)
|
||||
|
||||
@@ -104,13 +104,13 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Check if an entitybase list (like that returned by scene.GetEntities() ) contains a group with the rootpart uuid that matches the current uuid.
|
||||
/// Check if an entitybase list (like that returned by scene.GetEntities()) contains a group with the rootpart uuid that matches the current uuid.
|
||||
/// </summary>
|
||||
private bool ContainsKey(List<EntityBase> list, UUID uuid)
|
||||
{
|
||||
foreach( EntityBase part in list)
|
||||
if (part.UUID == uuid)
|
||||
return true;
|
||||
foreach (EntityBase part in list)
|
||||
if (part.UUID == uuid)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -118,9 +118,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
{
|
||||
foreach (EntityBase ent in list)
|
||||
{
|
||||
if (ent is SceneObjectGroup)
|
||||
if (ent.UUID == uuid)
|
||||
return (SceneObjectGroup)ent;
|
||||
if (ent is SceneObjectGroup)
|
||||
if (ent.UUID == uuid)
|
||||
return (SceneObjectGroup)ent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -138,49 +138,49 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
System.Collections.Generic.List<EntityBase> sceneEntityList = m_Entity.Scene.GetEntities();
|
||||
DiffersFromSceneGroup = false;
|
||||
// if group is not contained in scene's list
|
||||
if(!ContainsKey(sceneEntityList, m_UnchangedEntity.UUID))
|
||||
if (!ContainsKey(sceneEntityList, m_UnchangedEntity.UUID))
|
||||
{
|
||||
foreach(SceneObjectPart part in m_UnchangedEntity.Children.Values)
|
||||
{
|
||||
// if scene list no longer contains this part, display translucent part and mark with red aura
|
||||
if(! ContainsKey(sceneEntityList, part.UUID))
|
||||
{
|
||||
// if already displaying a red aura over part, make sure its red
|
||||
if (m_AuraEntities.ContainsKey(part.UUID))
|
||||
{
|
||||
m_AuraEntities[part.UUID].SetAura(new Vector3(254,0,0), part.Scale);
|
||||
}
|
||||
else
|
||||
{
|
||||
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
|
||||
m_Entity.Scene.PrimIDAllocate(),
|
||||
part.GetWorldPosition(),
|
||||
MetaEntity.TRANSLUCENT,
|
||||
new Vector3(254,0,0),
|
||||
part.Scale
|
||||
);
|
||||
m_AuraEntities.Add(part.UUID, auraGroup);
|
||||
}
|
||||
SceneObjectPart metaPart = m_Entity.GetLinkNumPart(part.LinkNum);
|
||||
SetPartTransparency(metaPart, MetaEntity.TRANSLUCENT);
|
||||
}
|
||||
// otherwise, scene will not contain the part. note: a group can not remove a part without changing group id
|
||||
}
|
||||
|
||||
// a deleted part has no where to point a beam particle system,
|
||||
// if a metapart had a particle system (maybe it represented a moved part) remove it
|
||||
if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
|
||||
{
|
||||
m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
|
||||
m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
|
||||
}
|
||||
|
||||
DiffersFromSceneGroup = true;
|
||||
foreach (SceneObjectPart part in m_UnchangedEntity.Children.Values)
|
||||
{
|
||||
// if scene list no longer contains this part, display translucent part and mark with red aura
|
||||
if (!ContainsKey(sceneEntityList, part.UUID))
|
||||
{
|
||||
// if already displaying a red aura over part, make sure its red
|
||||
if (m_AuraEntities.ContainsKey(part.UUID))
|
||||
{
|
||||
m_AuraEntities[part.UUID].SetAura(new Vector3(254,0,0), part.Scale);
|
||||
}
|
||||
else
|
||||
{
|
||||
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
|
||||
m_Entity.Scene.PrimIDAllocate(),
|
||||
part.GetWorldPosition(),
|
||||
MetaEntity.TRANSLUCENT,
|
||||
new Vector3(254,0,0),
|
||||
part.Scale
|
||||
);
|
||||
m_AuraEntities.Add(part.UUID, auraGroup);
|
||||
}
|
||||
SceneObjectPart metaPart = m_Entity.GetLinkNumPart(part.LinkNum);
|
||||
SetPartTransparency(metaPart, MetaEntity.TRANSLUCENT);
|
||||
}
|
||||
// otherwise, scene will not contain the part. note: a group can not remove a part without changing group id
|
||||
}
|
||||
|
||||
// a deleted part has no where to point a beam particle system,
|
||||
// if a metapart had a particle system (maybe it represented a moved part) remove it
|
||||
if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
|
||||
{
|
||||
m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
|
||||
m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
|
||||
}
|
||||
|
||||
DiffersFromSceneGroup = true;
|
||||
}
|
||||
// if scene list does contain group, compare each part in group for differences and display beams and auras appropriately
|
||||
else
|
||||
else
|
||||
{
|
||||
MarkWithDifferences((SceneObjectGroup)GetGroupByUUID(sceneEntityList, m_UnchangedEntity.UUID));
|
||||
MarkWithDifferences((SceneObjectGroup)GetGroupByUUID(sceneEntityList, m_UnchangedEntity.UUID));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
public bool HasChildPrim(UUID uuid)
|
||||
{
|
||||
if (m_UnchangedEntity.Children.ContainsKey(uuid))
|
||||
return true;
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -199,28 +199,28 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
/// </summary>
|
||||
public bool HasChildPrim(uint localID)
|
||||
{
|
||||
foreach( SceneObjectPart part in m_UnchangedEntity.Children.Values)
|
||||
if ( part.LocalId == localID )
|
||||
return true;
|
||||
foreach (SceneObjectPart part in m_UnchangedEntity.Children.Values)
|
||||
if (part.LocalId == localID)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Hide(IClientAPI client)
|
||||
{
|
||||
base.Hide(client);
|
||||
foreach(MetaEntity group in m_AuraEntities.Values)
|
||||
group.Hide(client);
|
||||
foreach(MetaEntity group in m_BeamEntities.Values)
|
||||
group.Hide(client);
|
||||
foreach (MetaEntity group in m_AuraEntities.Values)
|
||||
group.Hide(client);
|
||||
foreach (MetaEntity group in m_BeamEntities.Values)
|
||||
group.Hide(client);
|
||||
}
|
||||
|
||||
public override void HideFromAll()
|
||||
{
|
||||
base.HideFromAll();
|
||||
foreach(MetaEntity group in m_AuraEntities.Values)
|
||||
group.HideFromAll();
|
||||
foreach(MetaEntity group in m_BeamEntities.Values)
|
||||
group.HideFromAll();
|
||||
foreach (MetaEntity group in m_AuraEntities.Values)
|
||||
group.HideFromAll();
|
||||
foreach (MetaEntity group in m_BeamEntities.Values)
|
||||
group.HideFromAll();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -234,92 +234,92 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
Diff differences;
|
||||
bool changed = false;
|
||||
|
||||
// Use "UnchangedEntity" to do comparisons because its text, transparency, and other attributes will be just as the user
|
||||
// Use "UnchangedEntity" to do comparisons because its text, transparency, and other attributes will be just as the user
|
||||
// had originally saved.
|
||||
// m_Entity will NOT necessarily be the same entity as the user had saved.
|
||||
foreach(SceneObjectPart UnchangedPart in m_UnchangedEntity.Children.Values)
|
||||
foreach (SceneObjectPart UnchangedPart in m_UnchangedEntity.Children.Values)
|
||||
{
|
||||
//This is the part that we use to show changes.
|
||||
metaEntityPart = m_Entity.GetLinkNumPart(UnchangedPart.LinkNum);
|
||||
if (sceneEntityGroup.Children.ContainsKey(UnchangedPart.UUID))
|
||||
{
|
||||
sceneEntityPart = sceneEntityGroup.Children[UnchangedPart.UUID];
|
||||
differences = Difference.FindDifferences(UnchangedPart, sceneEntityPart);
|
||||
if (differences != Diff.NONE)
|
||||
metaEntityPart.Text = "CHANGE: " + differences.ToString();
|
||||
if (differences != 0)
|
||||
{
|
||||
// Root Part that has been modified
|
||||
if ((differences&Diff.POSITION) > 0)
|
||||
{
|
||||
// If the position of any part has changed, make sure the RootPart of the
|
||||
// meta entity is pointing with a beam particle system
|
||||
if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
|
||||
{
|
||||
m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
|
||||
m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
|
||||
}
|
||||
BeamMetaEntity beamGroup = new BeamMetaEntity(m_Entity.Scene,
|
||||
m_Entity.Scene.PrimIDAllocate(),
|
||||
m_UnchangedEntity.RootPart.GetWorldPosition(),
|
||||
MetaEntity.TRANSLUCENT,
|
||||
sceneEntityPart,
|
||||
new Vector3(0,0,254)
|
||||
);
|
||||
m_BeamEntities.Add(m_UnchangedEntity.RootPart.UUID, beamGroup);
|
||||
}
|
||||
|
||||
if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
|
||||
{
|
||||
m_AuraEntities[UnchangedPart.UUID].HideFromAll();
|
||||
m_AuraEntities.Remove(UnchangedPart.UUID);
|
||||
}
|
||||
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
|
||||
m_Entity.Scene.PrimIDAllocate(),
|
||||
UnchangedPart.GetWorldPosition(),
|
||||
MetaEntity.TRANSLUCENT,
|
||||
new Vector3(0,0,254),
|
||||
UnchangedPart.Scale
|
||||
);
|
||||
m_AuraEntities.Add(UnchangedPart.UUID, auraGroup);
|
||||
SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT);
|
||||
|
||||
DiffersFromSceneGroup = true;
|
||||
}
|
||||
else // no differences between scene part and meta part
|
||||
{
|
||||
if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
|
||||
{
|
||||
m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
|
||||
m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
|
||||
}
|
||||
if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
|
||||
{
|
||||
m_AuraEntities[UnchangedPart.UUID].HideFromAll();
|
||||
m_AuraEntities.Remove(UnchangedPart.UUID);
|
||||
}
|
||||
SetPartTransparency(metaEntityPart, MetaEntity.NONE);
|
||||
}
|
||||
}
|
||||
else //The entity currently in the scene is missing parts from the metaentity saved, so mark parts red as deleted.
|
||||
{
|
||||
if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
|
||||
{
|
||||
m_AuraEntities[UnchangedPart.UUID].HideFromAll();
|
||||
m_AuraEntities.Remove(UnchangedPart.UUID);
|
||||
}
|
||||
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
|
||||
m_Entity.Scene.PrimIDAllocate(),
|
||||
UnchangedPart.GetWorldPosition(),
|
||||
MetaEntity.TRANSLUCENT,
|
||||
new Vector3(254,0,0),
|
||||
UnchangedPart.Scale
|
||||
);
|
||||
m_AuraEntities.Add(UnchangedPart.UUID, auraGroup);
|
||||
SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT);
|
||||
|
||||
DiffersFromSceneGroup = true;
|
||||
}
|
||||
//This is the part that we use to show changes.
|
||||
metaEntityPart = m_Entity.GetLinkNumPart(UnchangedPart.LinkNum);
|
||||
if (sceneEntityGroup.Children.ContainsKey(UnchangedPart.UUID))
|
||||
{
|
||||
sceneEntityPart = sceneEntityGroup.Children[UnchangedPart.UUID];
|
||||
differences = Difference.FindDifferences(UnchangedPart, sceneEntityPart);
|
||||
if (differences != Diff.NONE)
|
||||
metaEntityPart.Text = "CHANGE: " + differences.ToString();
|
||||
if (differences != 0)
|
||||
{
|
||||
// Root Part that has been modified
|
||||
if ((differences&Diff.POSITION) > 0)
|
||||
{
|
||||
// If the position of any part has changed, make sure the RootPart of the
|
||||
// meta entity is pointing with a beam particle system
|
||||
if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
|
||||
{
|
||||
m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
|
||||
m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
|
||||
}
|
||||
BeamMetaEntity beamGroup = new BeamMetaEntity(m_Entity.Scene,
|
||||
m_Entity.Scene.PrimIDAllocate(),
|
||||
m_UnchangedEntity.RootPart.GetWorldPosition(),
|
||||
MetaEntity.TRANSLUCENT,
|
||||
sceneEntityPart,
|
||||
new Vector3(0,0,254)
|
||||
);
|
||||
m_BeamEntities.Add(m_UnchangedEntity.RootPart.UUID, beamGroup);
|
||||
}
|
||||
|
||||
if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
|
||||
{
|
||||
m_AuraEntities[UnchangedPart.UUID].HideFromAll();
|
||||
m_AuraEntities.Remove(UnchangedPart.UUID);
|
||||
}
|
||||
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
|
||||
m_Entity.Scene.PrimIDAllocate(),
|
||||
UnchangedPart.GetWorldPosition(),
|
||||
MetaEntity.TRANSLUCENT,
|
||||
new Vector3(0,0,254),
|
||||
UnchangedPart.Scale
|
||||
);
|
||||
m_AuraEntities.Add(UnchangedPart.UUID, auraGroup);
|
||||
SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT);
|
||||
|
||||
DiffersFromSceneGroup = true;
|
||||
}
|
||||
else // no differences between scene part and meta part
|
||||
{
|
||||
if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
|
||||
{
|
||||
m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
|
||||
m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
|
||||
}
|
||||
if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
|
||||
{
|
||||
m_AuraEntities[UnchangedPart.UUID].HideFromAll();
|
||||
m_AuraEntities.Remove(UnchangedPart.UUID);
|
||||
}
|
||||
SetPartTransparency(metaEntityPart, MetaEntity.NONE);
|
||||
}
|
||||
}
|
||||
else //The entity currently in the scene is missing parts from the metaentity saved, so mark parts red as deleted.
|
||||
{
|
||||
if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
|
||||
{
|
||||
m_AuraEntities[UnchangedPart.UUID].HideFromAll();
|
||||
m_AuraEntities.Remove(UnchangedPart.UUID);
|
||||
}
|
||||
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
|
||||
m_Entity.Scene.PrimIDAllocate(),
|
||||
UnchangedPart.GetWorldPosition(),
|
||||
MetaEntity.TRANSLUCENT,
|
||||
new Vector3(254,0,0),
|
||||
UnchangedPart.Scale
|
||||
);
|
||||
m_AuraEntities.Add(UnchangedPart.UUID, auraGroup);
|
||||
SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT);
|
||||
|
||||
DiffersFromSceneGroup = true;
|
||||
}
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
@@ -328,8 +328,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
{
|
||||
if (DiffersFromSceneGroup)
|
||||
{
|
||||
foreach(AuraMetaEntity group in m_AuraEntities.Values)
|
||||
group.SendFullUpdate(client);
|
||||
foreach (AuraMetaEntity group in m_AuraEntities.Values)
|
||||
group.SendFullUpdate(client);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -337,8 +337,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
{
|
||||
if (DiffersFromSceneGroup)
|
||||
{
|
||||
foreach(AuraMetaEntity group in m_AuraEntities.Values)
|
||||
group.SendFullUpdateToAll();
|
||||
foreach (AuraMetaEntity group in m_AuraEntities.Values)
|
||||
group.SendFullUpdateToAll();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -346,8 +346,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
{
|
||||
if (DiffersFromSceneGroup)
|
||||
{
|
||||
foreach(BeamMetaEntity group in m_BeamEntities.Values)
|
||||
group.SendFullUpdate(client);
|
||||
foreach (BeamMetaEntity group in m_BeamEntities.Values)
|
||||
group.SendFullUpdate(client);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -355,8 +355,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
{
|
||||
if (DiffersFromSceneGroup)
|
||||
{
|
||||
foreach(BeamMetaEntity group in m_BeamEntities.Values)
|
||||
group.SendFullUpdateToAll();
|
||||
foreach (BeamMetaEntity group in m_BeamEntities.Values)
|
||||
group.SendFullUpdateToAll();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,9 +365,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
FindDifferences();
|
||||
if (DiffersFromSceneGroup)
|
||||
{
|
||||
SendFullUpdate(client);
|
||||
SendFullAuraUpdate(client);
|
||||
SendFullBeamUpdate(client);
|
||||
SendFullUpdate(client);
|
||||
SendFullAuraUpdate(client);
|
||||
SendFullBeamUpdate(client);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -376,9 +376,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
FindDifferences();
|
||||
if (DiffersFromSceneGroup)
|
||||
{
|
||||
SendFullUpdateToAll();
|
||||
SendFullAuraUpdateToAll();
|
||||
SendFullBeamUpdateToAll();
|
||||
SendFullUpdateToAll();
|
||||
SendFullAuraUpdateToAll();
|
||||
SendFullBeamUpdateToAll();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#region Header
|
||||
|
||||
// ContentManagementModule.cs
|
||||
// ContentManagementModule.cs
|
||||
// User: bongiojp
|
||||
|
||||
#endregion Header
|
||||
@@ -98,7 +98,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
{
|
||||
if (source.Configs["CMS"] == null)
|
||||
return;
|
||||
|
||||
|
||||
m_enabled = source.Configs["CMS"].GetBoolean("enabled", false);
|
||||
databaseDir = source.Configs["CMS"].GetString("directory", databaseDir);
|
||||
database = source.Configs["CMS"].GetString("database", database);
|
||||
@@ -122,7 +122,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
return;
|
||||
}
|
||||
|
||||
lock(this)
|
||||
lock (this)
|
||||
{
|
||||
if (!initialised) //only init once
|
||||
{
|
||||
@@ -131,7 +131,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
m_control = new CMController(m_model, m_view, scene, channel);
|
||||
m_model.Initialise(database);
|
||||
m_view.Initialise(m_model);
|
||||
|
||||
|
||||
initialised = true;
|
||||
m_model.InitialiseDatabase(scene, databaseDir);
|
||||
}
|
||||
@@ -148,7 +148,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
if (! m_enabled)
|
||||
return;
|
||||
|
||||
lock(this)
|
||||
lock (this)
|
||||
{
|
||||
if (!m_posted) //only post once
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#region Header
|
||||
|
||||
// FileSystemDatabase.cs
|
||||
// User: bongiojp
|
||||
// User: bongiojp
|
||||
|
||||
#endregion Header
|
||||
|
||||
@@ -88,13 +88,13 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
{
|
||||
string scenedir;
|
||||
if (!Directory.Exists(m_repodir))
|
||||
Directory.CreateDirectory(m_repodir);
|
||||
Directory.CreateDirectory(m_repodir);
|
||||
|
||||
foreach (UUID region in m_scenes.Keys)
|
||||
{
|
||||
scenedir = m_repodir + Slash.DirectorySeparatorChar + region + Slash.DirectorySeparatorChar;
|
||||
if (!Directory.Exists(scenedir))
|
||||
Directory.CreateDirectory(scenedir);
|
||||
scenedir = m_repodir + Slash.DirectorySeparatorChar + region + Slash.DirectorySeparatorChar;
|
||||
if (!Directory.Exists(scenedir))
|
||||
Directory.CreateDirectory(scenedir);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,10 +102,14 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
private void SetupSerialiser()
|
||||
{
|
||||
if (m_serialiser.Count == 0)
|
||||
foreach(UUID region in m_scenes.Keys)
|
||||
m_serialiser.Add(region,
|
||||
m_scenes[region].RequestModuleInterface<IRegionSerialiser>()
|
||||
);
|
||||
{
|
||||
foreach (UUID region in m_scenes.Keys)
|
||||
{
|
||||
m_serialiser.Add(region,
|
||||
m_scenes[region].RequestModuleInterface<IRegionSerialiser>()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
@@ -120,7 +124,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
public string GetRegionObjectHeightMap(UUID regionid)
|
||||
{
|
||||
String filename = m_repodir + Slash.DirectorySeparatorChar + regionid +
|
||||
Slash.DirectorySeparatorChar + "heightmap.r32";
|
||||
Slash.DirectorySeparatorChar + "heightmap.r32";
|
||||
FileStream fs = new FileStream( filename, FileMode.Open);
|
||||
StreamReader sr = new StreamReader(fs);
|
||||
String result = sr.ReadToEnd();
|
||||
@@ -132,7 +136,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
public string GetRegionObjectHeightMap(UUID regionid, int revision)
|
||||
{
|
||||
String filename = m_repodir + Slash.DirectorySeparatorChar + regionid +
|
||||
Slash.DirectorySeparatorChar + "heightmap.r32";
|
||||
Slash.DirectorySeparatorChar + "heightmap.r32";
|
||||
FileStream fs = new FileStream( filename, FileMode.Open);
|
||||
StreamReader sr = new StreamReader(fs);
|
||||
String result = sr.ReadToEnd();
|
||||
@@ -144,14 +148,14 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
public System.Collections.ArrayList GetRegionObjectXMLList(UUID regionid, int revision)
|
||||
{
|
||||
System.Collections.ArrayList objectList = new System.Collections.ArrayList();
|
||||
string filename = m_repodir + Slash.DirectorySeparatorChar + regionid + Slash.DirectorySeparatorChar +
|
||||
+ revision + Slash.DirectorySeparatorChar + "objects.xml";
|
||||
string filename = m_repodir + Slash.DirectorySeparatorChar + regionid + Slash.DirectorySeparatorChar +
|
||||
+ revision + Slash.DirectorySeparatorChar + "objects.xml";
|
||||
XmlDocument doc = new XmlDocument();
|
||||
XmlNode rootNode;
|
||||
//int primCount = 0;
|
||||
//SceneObjectGroup obj = null;
|
||||
|
||||
if(File.Exists(filename))
|
||||
if (File.Exists(filename))
|
||||
{
|
||||
XmlTextReader reader = new XmlTextReader(filename);
|
||||
reader.WhitespaceHandling = WhitespaceHandling.None;
|
||||
@@ -160,9 +164,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
rootNode = doc.FirstChild;
|
||||
foreach (XmlNode aPrimNode in rootNode.ChildNodes)
|
||||
{
|
||||
objectList.Add(aPrimNode.OuterXml);
|
||||
}
|
||||
return objectList;
|
||||
objectList.Add(aPrimNode.OuterXml);
|
||||
}
|
||||
return objectList;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -172,45 +176,46 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
int revision = NumOfRegionRev(regionid);
|
||||
m_log.Info("[FSDB]: found revisions:" + revision);
|
||||
System.Collections.ArrayList xmlList = new System.Collections.ArrayList();
|
||||
string filename = m_repodir + Slash.DirectorySeparatorChar + regionid + Slash.DirectorySeparatorChar +
|
||||
+ revision + Slash.DirectorySeparatorChar + "objects.xml";
|
||||
string filename = m_repodir + Slash.DirectorySeparatorChar + regionid + Slash.DirectorySeparatorChar +
|
||||
+ revision + Slash.DirectorySeparatorChar + "objects.xml";
|
||||
XmlDocument doc = new XmlDocument();
|
||||
XmlNode rootNode;
|
||||
|
||||
|
||||
m_log.Info("[FSDB]: Checking if " + filename + " exists.");
|
||||
if(File.Exists(filename))
|
||||
{
|
||||
Stopwatch x = new Stopwatch();
|
||||
x.Start();
|
||||
|
||||
if (File.Exists(filename))
|
||||
{
|
||||
Stopwatch x = new Stopwatch();
|
||||
x.Start();
|
||||
|
||||
XmlTextReader reader = new XmlTextReader(filename);
|
||||
reader.WhitespaceHandling = WhitespaceHandling.None;
|
||||
doc.Load(reader);
|
||||
reader.Close();
|
||||
rootNode = doc.FirstChild;
|
||||
|
||||
|
||||
foreach (XmlNode aPrimNode in rootNode.ChildNodes)
|
||||
xmlList.Add(aPrimNode.OuterXml);
|
||||
|
||||
x.Stop();
|
||||
TimeToDownload += x.ElapsedMilliseconds;
|
||||
m_log.Info("[FileSystemDatabase] Time spent retrieving xml files so far: " + TimeToDownload);
|
||||
|
||||
return xmlList;
|
||||
{
|
||||
xmlList.Add(aPrimNode.OuterXml);
|
||||
}
|
||||
|
||||
x.Stop();
|
||||
TimeToDownload += x.ElapsedMilliseconds;
|
||||
m_log.Info("[FileSystemDatabase] Time spent retrieving xml files so far: " + TimeToDownload);
|
||||
|
||||
return xmlList;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void Initialise(Scene scene, string dir)
|
||||
{
|
||||
lock(this)
|
||||
lock (this)
|
||||
{
|
||||
if (m_repodir == null)
|
||||
m_repodir = dir;
|
||||
if (m_repodir == null)
|
||||
m_repodir = dir;
|
||||
}
|
||||
lock(m_scenes)
|
||||
m_scenes.Add(scene.RegionInfo.RegionID, scene);
|
||||
lock (m_scenes)
|
||||
m_scenes.Add(scene.RegionInfo.RegionID, scene);
|
||||
}
|
||||
|
||||
public System.Collections.Generic.SortedDictionary<string, string> ListOfRegionRevisions(UUID regionid)
|
||||
@@ -224,19 +229,21 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
StreamReader sr = null;
|
||||
String logMessage = "";
|
||||
String logLocation = "";
|
||||
foreach(string revisionDir in directories)
|
||||
foreach (string revisionDir in directories)
|
||||
{
|
||||
try {
|
||||
logLocation = revisionDir + Slash.DirectorySeparatorChar + "log";
|
||||
fs = new FileStream( logLocation, FileMode.Open);
|
||||
sr = new StreamReader(fs);
|
||||
logMessage = sr.ReadToEnd();
|
||||
sr.Close();
|
||||
fs.Close();
|
||||
revisionDict.Add(revisionDir, logMessage);
|
||||
}
|
||||
catch (Exception)
|
||||
{}
|
||||
try
|
||||
{
|
||||
logLocation = revisionDir + Slash.DirectorySeparatorChar + "log";
|
||||
fs = new FileStream( logLocation, FileMode.Open);
|
||||
sr = new StreamReader(fs);
|
||||
logMessage = sr.ReadToEnd();
|
||||
sr.Close();
|
||||
fs.Close();
|
||||
revisionDict.Add(revisionDir, logMessage);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
return revisionDict;
|
||||
@@ -254,9 +261,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
public void PostInitialise()
|
||||
{
|
||||
SetupSerialiser();
|
||||
|
||||
m_log.Info("[FSDB]: Creating repository in " + m_repodir + ".");
|
||||
CreateDirectory();
|
||||
|
||||
m_log.Info("[FSDB]: Creating repository in " + m_repodir + ".");
|
||||
CreateDirectory();
|
||||
}
|
||||
|
||||
public void SaveRegion(UUID regionid, string regionName, string logMessage)
|
||||
@@ -266,44 +273,44 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
|
||||
m_log.Info("[FSDB]: checking if scene directory exists: " + scenedir);
|
||||
if (!Directory.Exists(scenedir))
|
||||
Directory.CreateDirectory(scenedir);
|
||||
Directory.CreateDirectory(scenedir);
|
||||
|
||||
int newRevisionNum = GetMostRecentRevision(regionid)+1;
|
||||
string revisiondir = scenedir + newRevisionNum + Slash.DirectorySeparatorChar;
|
||||
|
||||
m_log.Info("[FSDB]: checking if revision directory exists: " + revisiondir);
|
||||
if (!Directory.Exists(revisiondir))
|
||||
Directory.CreateDirectory(revisiondir);
|
||||
Directory.CreateDirectory(revisiondir);
|
||||
|
||||
try {
|
||||
Stopwatch x = new Stopwatch();
|
||||
x.Start();
|
||||
if (m_scenes.ContainsKey(regionid))
|
||||
{
|
||||
m_serialiser[regionid].SerialiseRegion(m_scenes[regionid], revisiondir);
|
||||
}
|
||||
x.Stop();
|
||||
TimeToSave += x.ElapsedMilliseconds;
|
||||
m_log.Info("[FileSystemDatabase] Time spent serialising regions to files on disk for " + regionName + ": " + x.ElapsedMilliseconds);
|
||||
m_log.Info("[FileSystemDatabase] Time spent serialising regions to files on disk so far: " + TimeToSave);
|
||||
try {
|
||||
Stopwatch x = new Stopwatch();
|
||||
x.Start();
|
||||
if (m_scenes.ContainsKey(regionid))
|
||||
{
|
||||
m_serialiser[regionid].SerialiseRegion(m_scenes[regionid], revisiondir);
|
||||
}
|
||||
x.Stop();
|
||||
TimeToSave += x.ElapsedMilliseconds;
|
||||
m_log.Info("[FileSystemDatabase] Time spent serialising regions to files on disk for " + regionName + ": " + x.ElapsedMilliseconds);
|
||||
m_log.Info("[FileSystemDatabase] Time spent serialising regions to files on disk so far: " + TimeToSave);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[FSDB]: Serialisation of region failed: " + e);
|
||||
return;
|
||||
m_log.ErrorFormat("[FSDB]: Serialisation of region failed: " + e);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
// Finish by writing log message.
|
||||
FileStream file = new FileStream(revisiondir + "log", FileMode.Create, FileAccess.ReadWrite);
|
||||
StreamWriter sw = new StreamWriter(file);
|
||||
sw.Write(logMessage);
|
||||
sw.Close();
|
||||
// Finish by writing log message.
|
||||
FileStream file = new FileStream(revisiondir + "log", FileMode.Create, FileAccess.ReadWrite);
|
||||
StreamWriter sw = new StreamWriter(file);
|
||||
sw.Write(logMessage);
|
||||
sw.Close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[FSDB]: Failed trying to save log file " + e);
|
||||
return;
|
||||
m_log.ErrorFormat("[FSDB]: Failed trying to save log file " + e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Makes a new meta entity by copying the given scene object group.
|
||||
/// Makes a new meta entity by copying the given scene object group.
|
||||
/// The physics boolean is just a stub right now.
|
||||
/// </summary>
|
||||
public MetaEntity(SceneObjectGroup orig, bool physics)
|
||||
@@ -160,19 +160,19 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
{
|
||||
//make new uuids
|
||||
Dictionary<UUID, SceneObjectPart> parts = new Dictionary<UUID, SceneObjectPart>();
|
||||
foreach(SceneObjectPart part in m_Entity.Children.Values)
|
||||
foreach (SceneObjectPart part in m_Entity.Children.Values)
|
||||
{
|
||||
part.ResetIDs(part.LinkNum);
|
||||
parts.Add(part.UUID, part);
|
||||
part.ResetIDs(part.LinkNum);
|
||||
parts.Add(part.UUID, part);
|
||||
}
|
||||
|
||||
// make new localids
|
||||
foreach (SceneObjectPart part in m_Entity.Children.Values)
|
||||
part.LocalId = m_Entity.Scene.PrimIDAllocate();
|
||||
part.LocalId = m_Entity.Scene.PrimIDAllocate();
|
||||
|
||||
//finalize
|
||||
m_Entity.UpdateParentIDs();
|
||||
m_Entity.RootPart.PhysActor = null;
|
||||
m_Entity.RootPart.PhysActor = null;
|
||||
m_Entity.Children = parts;
|
||||
}
|
||||
|
||||
@@ -188,8 +188,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
//This deletes the group without removing from any databases.
|
||||
//This is important because we are not IN any database.
|
||||
//m_Entity.FakeDeleteGroup();
|
||||
foreach( SceneObjectPart part in m_Entity.Children.Values)
|
||||
client.SendKiPrimitive(m_Entity.RegionHandle, part.LocalId);
|
||||
foreach (SceneObjectPart part in m_Entity.Children.Values)
|
||||
client.SendKiPrimitive(m_Entity.RegionHandle, part.LocalId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -197,10 +197,10 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
/// </summary>
|
||||
public virtual void HideFromAll()
|
||||
{
|
||||
foreach( SceneObjectPart part in m_Entity.Children.Values)
|
||||
m_Entity.Scene.ClientManager.ForEachClient(delegate(IClientAPI controller)
|
||||
{ controller.SendKiPrimitive(m_Entity.RegionHandle, part.LocalId); }
|
||||
);
|
||||
foreach (SceneObjectPart part in m_Entity.Children.Values)
|
||||
m_Entity.Scene.ClientManager.ForEachClient(delegate(IClientAPI controller)
|
||||
{ controller.SendKiPrimitive(m_Entity.RegionHandle, part.LocalId); }
|
||||
);
|
||||
}
|
||||
|
||||
public void SendFullUpdate(IClientAPI client)
|
||||
@@ -239,40 +239,40 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
Color4 texcolor;
|
||||
try
|
||||
{
|
||||
tex = part.Shape.Textures;
|
||||
texcolor = new Color4();
|
||||
tex = part.Shape.Textures;
|
||||
texcolor = new Color4();
|
||||
}
|
||||
catch(Exception)
|
||||
{
|
||||
//m_log.ErrorFormat("[Content Management]: Exception thrown while accessing textures of scene object: " + e);
|
||||
return;
|
||||
//m_log.ErrorFormat("[Content Management]: Exception thrown while accessing textures of scene object: " + e);
|
||||
return;
|
||||
}
|
||||
|
||||
for (uint i = 0; i < tex.FaceTextures.Length; i++)
|
||||
{
|
||||
try {
|
||||
if (tex.FaceTextures[i] != null)
|
||||
{
|
||||
texcolor = tex.FaceTextures[i].RGBA;
|
||||
texcolor.A = transparencyAmount;
|
||||
tex.FaceTextures[i].RGBA = texcolor;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//m_log.ErrorFormat("[Content Management]: Exception thrown while accessing different face textures of object: " + e);
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
if (tex.FaceTextures[i] != null)
|
||||
{
|
||||
texcolor = tex.FaceTextures[i].RGBA;
|
||||
texcolor.A = transparencyAmount;
|
||||
tex.FaceTextures[i].RGBA = texcolor;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//m_log.ErrorFormat("[Content Management]: Exception thrown while accessing different face textures of object: " + e);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
try {
|
||||
texcolor = tex.DefaultTexture.RGBA;
|
||||
texcolor.A = transparencyAmount;
|
||||
tex.DefaultTexture.RGBA = texcolor;
|
||||
part.Shape.TextureEntry = tex.ToBytes();
|
||||
texcolor = tex.DefaultTexture.RGBA;
|
||||
texcolor.A = transparencyAmount;
|
||||
tex.DefaultTexture.RGBA = texcolor;
|
||||
part.Shape.TextureEntry = tex.ToBytes();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//m_log.Info("[Content Management]: Exception thrown while accessing default face texture of object: " + e);
|
||||
//m_log.Info("[Content Management]: Exception thrown while accessing default face texture of object: " + e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
y.UUID = uuid;
|
||||
|
||||
y.LocalId = LocalId;
|
||||
|
||||
|
||||
y.Shape = PrimitiveBaseShape.CreateBox();
|
||||
y.Scale = new Vector3(0.01f,0.01f,0.01f);
|
||||
y.LastOwnerID = UUID.Zero;
|
||||
|
||||
@@ -106,13 +106,13 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
|
||||
private static bool AreVectorsEquivalent(Vector3 first, Vector3 second)
|
||||
{
|
||||
if(TruncateSignificant(first.X, 2) == TruncateSignificant(second.X, 2)
|
||||
if (TruncateSignificant(first.X, 2) == TruncateSignificant(second.X, 2)
|
||||
&& TruncateSignificant(first.Y, 2) == TruncateSignificant(second.Y, 2)
|
||||
&& TruncateSignificant(first.Z, 2) == TruncateSignificant(second.Z, 2)
|
||||
)
|
||||
return true;
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Taken from Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
|
||||
@@ -126,7 +126,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
private static int TruncateSignificant(float num, int digits)
|
||||
{
|
||||
return (int) Math.Ceiling((Math.Truncate(num * 10 * digits)/10*digits));
|
||||
// return (int) ((num * (10*digits))/10*digits);
|
||||
// return (int) ((num * (10*digits))/10*digits);
|
||||
}
|
||||
|
||||
// Taken from Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
|
||||
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Compares the attributes (Vectors, Quaternions, Strings, etc.) between two scene object parts
|
||||
/// Compares the attributes (Vectors, Quaternions, Strings, etc.) between two scene object parts
|
||||
/// and returns a Diff bitmask which details what the differences are.
|
||||
/// </summary>
|
||||
public static Diff FindDifferences(SceneObjectPart first, SceneObjectPart second)
|
||||
@@ -164,47 +164,47 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
Diff result = 0;
|
||||
|
||||
// VECTOR COMPARISONS
|
||||
if(! AreVectorsEquivalent(first.Acceleration, second.Acceleration))
|
||||
result |= Diff.ACCELERATION;
|
||||
if(! AreVectorsEquivalent(first.AbsolutePosition, second.AbsolutePosition))
|
||||
result |= Diff.POSITION;
|
||||
if(! AreVectorsEquivalent(first.AngularVelocity, second.AngularVelocity))
|
||||
result |= Diff.ANGULARVELOCITY;
|
||||
if(! AreVectorsEquivalent(first.OffsetPosition, second.OffsetPosition))
|
||||
result |= Diff.OFFSETPOSITION;
|
||||
if(! AreVectorsEquivalent(first.RotationalVelocity, second.RotationalVelocity))
|
||||
result |= Diff.ROTATIONALVELOCITY;
|
||||
if(! AreVectorsEquivalent(first.Scale, second.Scale))
|
||||
result |= Diff.SCALE;
|
||||
if(! AreVectorsEquivalent(first.Velocity, second.Velocity))
|
||||
result |= Diff.VELOCITY;
|
||||
if (!AreVectorsEquivalent(first.Acceleration, second.Acceleration))
|
||||
result |= Diff.ACCELERATION;
|
||||
if (!AreVectorsEquivalent(first.AbsolutePosition, second.AbsolutePosition))
|
||||
result |= Diff.POSITION;
|
||||
if (!AreVectorsEquivalent(first.AngularVelocity, second.AngularVelocity))
|
||||
result |= Diff.ANGULARVELOCITY;
|
||||
if (!AreVectorsEquivalent(first.OffsetPosition, second.OffsetPosition))
|
||||
result |= Diff.OFFSETPOSITION;
|
||||
if (!AreVectorsEquivalent(first.RotationalVelocity, second.RotationalVelocity))
|
||||
result |= Diff.ROTATIONALVELOCITY;
|
||||
if (!AreVectorsEquivalent(first.Scale, second.Scale))
|
||||
result |= Diff.SCALE;
|
||||
if (!AreVectorsEquivalent(first.Velocity, second.Velocity))
|
||||
result |= Diff.VELOCITY;
|
||||
|
||||
|
||||
// QUATERNION COMPARISONS
|
||||
if(! AreQuaternionsEquivalent(first.RotationOffset, second.RotationOffset))
|
||||
result |= Diff.ROTATIONOFFSET;
|
||||
if (!AreQuaternionsEquivalent(first.RotationOffset, second.RotationOffset))
|
||||
result |= Diff.ROTATIONOFFSET;
|
||||
|
||||
|
||||
// MISC COMPARISONS (UUID, Byte)
|
||||
if(first.ClickAction != second.ClickAction)
|
||||
result |= Diff.CLICKACTION;
|
||||
if(first.ObjectOwner != second.ObjectOwner)
|
||||
result |= Diff.OBJECTOWNER;
|
||||
if (first.ClickAction != second.ClickAction)
|
||||
result |= Diff.CLICKACTION;
|
||||
if (first.ObjectOwner != second.ObjectOwner)
|
||||
result |= Diff.OBJECTOWNER;
|
||||
|
||||
|
||||
// STRING COMPARISONS
|
||||
if(first.Description != second.Description)
|
||||
result |= Diff.DESCRIPTION;
|
||||
if(first.Material != second.Material)
|
||||
result |= Diff.MATERIAL;
|
||||
if(first.Name != second.Name)
|
||||
result |= Diff.NAME;
|
||||
if(first.SitName != second.SitName)
|
||||
result |= Diff.SITNAME;
|
||||
if(first.Text != second.Text)
|
||||
result |= Diff.TEXT;
|
||||
if(first.TouchName != second.TouchName)
|
||||
result |= Diff.TOUCHNAME;
|
||||
if (first.Description != second.Description)
|
||||
result |= Diff.DESCRIPTION;
|
||||
if (first.Material != second.Material)
|
||||
result |= Diff.MATERIAL;
|
||||
if (first.Name != second.Name)
|
||||
result |= Diff.NAME;
|
||||
if (first.SitName != second.SitName)
|
||||
result |= Diff.SITNAME;
|
||||
if (first.Text != second.Text)
|
||||
result |= Diff.TEXT;
|
||||
if (first.TouchName != second.TouchName)
|
||||
result |= Diff.TOUCHNAME;
|
||||
|
||||
x.Stop();
|
||||
TimeToDiff += x.ElapsedMilliseconds;
|
||||
|
||||
@@ -176,8 +176,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
|
||||
/// within this object).
|
||||
/// </summary>
|
||||
/// <param name="sceneObject"></param>
|
||||
/// <param name="assetUuids"></param>
|
||||
protected void GetSceneObjectAssetUuids(UUID sceneObjectUuid, IDictionary<UUID, int> assetUuids)
|
||||
/// <param name="assetUuids"></param>
|
||||
protected void GetSceneObjectAssetUuids(UUID sceneObjectUuid, IDictionary<UUID, int> assetUuids)
|
||||
{
|
||||
AssetBase objectAsset = GetAsset(sceneObjectUuid);
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
|
||||
|
||||
public void setEstateTerrainBaseTexture(IClientAPI remoteClient, int corner, UUID texture)
|
||||
{
|
||||
if(texture == UUID.Zero)
|
||||
if (texture == UUID.Zero)
|
||||
return;
|
||||
|
||||
switch (corner)
|
||||
|
||||
@@ -388,10 +388,10 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
|
||||
get { return 0; }
|
||||
}
|
||||
|
||||
public ulong GetGroupPowers(UUID groupID)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
public ulong GetGroupPowers(UUID groupID)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public virtual int NextAnimationSequenceNumber
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user