Merge branch 'master' into careminster

avinationmerge
Melanie 2012-02-03 08:47:26 +00:00
commit 0dbfa70443
5 changed files with 121 additions and 59 deletions

View File

@ -450,13 +450,17 @@ namespace OpenSim.Framework
public string GetOtherSetting(string key) public string GetOtherSetting(string key)
{ {
string val; string val;
m_otherSettings.TryGetValue(key, out val); string keylower = key.ToLower();
return val; if (m_otherSettings.TryGetValue(keylower, out val))
return val;
m_log.DebugFormat("[RegionInfo] Could not locate value for parameter {0}", key);
return null;
} }
public void SetOtherSetting(string key, string value) public void SetOtherSetting(string key, string value)
{ {
m_otherSettings[key] = value; string keylower = key.ToLower();
m_otherSettings[keylower] = value;
} }
private void ReadNiniConfig(IConfigSource source, string name) private void ReadNiniConfig(IConfigSource source, string name)
@ -498,12 +502,12 @@ namespace OpenSim.Framework
HashSet<String> allKeys = new HashSet<String>(); HashSet<String> allKeys = new HashSet<String>();
foreach (string s in config.GetKeys()) foreach (string s in config.GetKeys())
{ {
allKeys.Add(s.ToLower()); allKeys.Add(s);
} }
// RegionUUID // RegionUUID
// //
allKeys.Remove(("RegionUUID").ToLower()); allKeys.Remove("RegionUUID");
string regionUUID = config.GetString("RegionUUID", string.Empty); string regionUUID = config.GetString("RegionUUID", string.Empty);
if (regionUUID == String.Empty) if (regionUUID == String.Empty)
{ {
@ -518,7 +522,7 @@ namespace OpenSim.Framework
// Location // Location
// //
allKeys.Remove(("Location").ToLower()); allKeys.Remove("Location");
string location = config.GetString("Location", String.Empty); string location = config.GetString("Location", String.Empty);
if (location == String.Empty) if (location == String.Empty)
{ {
@ -534,7 +538,7 @@ namespace OpenSim.Framework
// InternalAddress // InternalAddress
// //
IPAddress address; IPAddress address;
allKeys.Remove(("InternalAddress").ToLower()); allKeys.Remove("InternalAddress");
if (config.Contains("InternalAddress")) if (config.Contains("InternalAddress"))
{ {
address = IPAddress.Parse(config.GetString("InternalAddress", String.Empty)); address = IPAddress.Parse(config.GetString("InternalAddress", String.Empty));
@ -548,7 +552,7 @@ namespace OpenSim.Framework
// InternalPort // InternalPort
// //
int port; int port;
allKeys.Remove(("InternalPort").ToLower()); allKeys.Remove("InternalPort");
if (config.Contains("InternalPort")) if (config.Contains("InternalPort"))
{ {
port = config.GetInt("InternalPort", 9000); port = config.GetInt("InternalPort", 9000);
@ -562,7 +566,7 @@ namespace OpenSim.Framework
// AllowAlternatePorts // AllowAlternatePorts
// //
allKeys.Remove(("AllowAlternatePorts").ToLower()); allKeys.Remove("AllowAlternatePorts");
if (config.Contains("AllowAlternatePorts")) if (config.Contains("AllowAlternatePorts"))
{ {
m_allow_alternate_ports = config.GetBoolean("AllowAlternatePorts", true); m_allow_alternate_ports = config.GetBoolean("AllowAlternatePorts", true);
@ -576,7 +580,7 @@ namespace OpenSim.Framework
// ExternalHostName // ExternalHostName
// //
allKeys.Remove(("ExternalHostName").ToLower()); allKeys.Remove("ExternalHostName");
string externalName; string externalName;
if (config.Contains("ExternalHostName")) if (config.Contains("ExternalHostName"))
{ {
@ -601,29 +605,30 @@ namespace OpenSim.Framework
// RegionType // RegionType
m_regionType = config.GetString("RegionType", String.Empty); m_regionType = config.GetString("RegionType", String.Empty);
allKeys.Remove(("RegionType").ToLower()); allKeys.Remove("RegionType");
// Prim stuff // Prim stuff
// //
m_nonphysPrimMax = config.GetInt("NonphysicalPrimMax", 256); m_nonphysPrimMax = config.GetInt("NonphysicalPrimMax", 256);
allKeys.Remove(("NonphysicalPrimMax").ToLower()); allKeys.Remove("NonphysicalPrimMax");
m_physPrimMax = config.GetInt("PhysicalPrimMax", 10); m_physPrimMax = config.GetInt("PhysicalPrimMax", 10);
allKeys.Remove(("PhysicalPrimMax").ToLower()); allKeys.Remove("PhysicalPrimMax");
m_clampPrimSize = config.GetBoolean("ClampPrimSize", false); m_clampPrimSize = config.GetBoolean("ClampPrimSize", false);
allKeys.Remove(("ClampPrimSize").ToLower()); allKeys.Remove("ClampPrimSize");
m_objectCapacity = config.GetInt("MaxPrims", 15000); m_objectCapacity = config.GetInt("MaxPrims", 15000);
allKeys.Remove(("MaxPrims").ToLower()); allKeys.Remove("MaxPrims");
m_agentCapacity = config.GetInt("MaxAgents", 100); m_agentCapacity = config.GetInt("MaxAgents", 100);
allKeys.Remove(("MaxAgents").ToLower()); allKeys.Remove("MaxAgents");
// Multi-tenancy // Multi-tenancy
// //
ScopeID = new UUID(config.GetString("ScopeID", UUID.Zero.ToString())); ScopeID = new UUID(config.GetString("ScopeID", UUID.Zero.ToString()));
allKeys.Remove(("ScopeID").ToLower()); allKeys.Remove("ScopeID");
foreach (String s in allKeys) foreach (String s in allKeys)
{ {
m_otherSettings.Add(s, config.GetString(s)); string val = config.GetString(s);
SetOtherSetting(s, config.GetString(s));
} }
} }

View File

@ -402,12 +402,18 @@ namespace OpenSim.Region.Framework.Scenes
public event SceneObjectPartCopyDelegate OnSceneObjectPartCopy; public event SceneObjectPartCopyDelegate OnSceneObjectPartCopy;
public delegate void SceneObjectPartCopyDelegate(SceneObjectPart copy, SceneObjectPart original, bool userExposed); public delegate void SceneObjectPartCopyDelegate(SceneObjectPart copy, SceneObjectPart original, bool userExposed);
public delegate void SceneObjectPartUpdated(SceneObjectPart sop);
public event SceneObjectPartUpdated OnSceneObjectPartUpdated;
public delegate void RegionUp(GridRegion region); public delegate void RegionUp(GridRegion region);
public event RegionUp OnRegionUp; public event RegionUp OnRegionUp;
public delegate void RegionStarted(Scene scene); public delegate void RegionStarted(Scene scene);
public event RegionStarted OnRegionStarted; public event RegionStarted OnRegionStarted;
public delegate void RegionHeartbeatEnd(Scene scene);
public event RegionHeartbeatEnd OnRegionHeartbeatEnd;
public delegate void LoginsEnabled(string regionName); public delegate void LoginsEnabled(string regionName);
public event LoginsEnabled OnLoginsEnabled; public event LoginsEnabled OnLoginsEnabled;
@ -2227,6 +2233,27 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public void TriggerSceneObjectPartUpdated(SceneObjectPart sop)
{
SceneObjectPartUpdated handler = OnSceneObjectPartUpdated;
if (handler != null)
{
foreach (SceneObjectPartUpdated d in handler.GetInvocationList())
{
try
{
d(sop);
}
catch (Exception e)
{
m_log.ErrorFormat(
"[EVENT MANAGER]: Delegate for TriggerSceneObjectPartUpdated failed - continuing. {0} {1}",
e.Message, e.StackTrace);
}
}
}
}
public void TriggerOnParcelPropertiesUpdateRequest(LandUpdateArgs args, public void TriggerOnParcelPropertiesUpdateRequest(LandUpdateArgs args,
int local_id, IClientAPI remote_client) int local_id, IClientAPI remote_client)
{ {
@ -2291,6 +2318,27 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public void TriggerRegionHeartbeatEnd(Scene scene)
{
RegionHeartbeatEnd handler = OnRegionHeartbeatEnd;
if (handler != null)
{
foreach (RegionHeartbeatEnd d in handler.GetInvocationList())
{
try
{
d(scene);
}
catch (Exception e)
{
m_log.ErrorFormat("[EVENT MANAGER]: Delegate for OnRegionHeartbeatEnd failed - continuing {0} - {1}",
e.Message, e.StackTrace);
}
}
}
}
public void TriggerLoginsEnabled (string regionName) public void TriggerLoginsEnabled (string regionName)
{ {
LoginsEnabled handler = OnLoginsEnabled; LoginsEnabled handler = OnLoginsEnabled;

View File

@ -1431,6 +1431,8 @@ namespace OpenSim.Region.Framework.Scenes
RegionInfo.RegionName, e.Message, e.StackTrace); RegionInfo.RegionName, e.Message, e.StackTrace);
} }
EventManager.TriggerRegionHeartbeatEnd(this);
maintc = Util.EnvironmentTickCountSubtract(maintc); maintc = Util.EnvironmentTickCountSubtract(maintc);
maintc = (int)(MinFrameTime * 1000) - maintc; maintc = (int)(MinFrameTime * 1000) - maintc;
@ -2837,7 +2839,7 @@ namespace OpenSim.Region.Framework.Scenes
client.OnObjectMaterial += m_sceneGraph.PrimMaterial; client.OnObjectMaterial += m_sceneGraph.PrimMaterial;
client.OnLinkObjects += LinkObjects; client.OnLinkObjects += LinkObjects;
client.OnDelinkObjects += DelinkObjects; client.OnDelinkObjects += DelinkObjects;
client.OnObjectDuplicate += m_sceneGraph.DuplicateObject; client.OnObjectDuplicate += DuplicateObject;
client.OnObjectDuplicateOnRay += doObjectDuplicateOnRay; client.OnObjectDuplicateOnRay += doObjectDuplicateOnRay;
client.OnUpdatePrimFlags += m_sceneGraph.UpdatePrimFlags; client.OnUpdatePrimFlags += m_sceneGraph.UpdatePrimFlags;
client.OnRequestObjectPropertiesFamily += m_sceneGraph.RequestObjectPropertiesFamily; client.OnRequestObjectPropertiesFamily += m_sceneGraph.RequestObjectPropertiesFamily;
@ -2965,7 +2967,7 @@ namespace OpenSim.Region.Framework.Scenes
client.OnObjectMaterial -= m_sceneGraph.PrimMaterial; client.OnObjectMaterial -= m_sceneGraph.PrimMaterial;
client.OnLinkObjects -= LinkObjects; client.OnLinkObjects -= LinkObjects;
client.OnDelinkObjects -= DelinkObjects; client.OnDelinkObjects -= DelinkObjects;
client.OnObjectDuplicate -= m_sceneGraph.DuplicateObject; client.OnObjectDuplicate -= DuplicateObject;
client.OnObjectDuplicateOnRay -= doObjectDuplicateOnRay; client.OnObjectDuplicateOnRay -= doObjectDuplicateOnRay;
client.OnUpdatePrimFlags -= m_sceneGraph.UpdatePrimFlags; client.OnUpdatePrimFlags -= m_sceneGraph.UpdatePrimFlags;
client.OnRequestObjectPropertiesFamily -= m_sceneGraph.RequestObjectPropertiesFamily; client.OnRequestObjectPropertiesFamily -= m_sceneGraph.RequestObjectPropertiesFamily;
@ -3058,6 +3060,21 @@ namespace OpenSim.Region.Framework.Scenes
return false; return false;
} }
/// <summary>
/// Duplicates object specified by localID. This is the event handler for IClientAPI.
/// </summary>
/// <param name="originalPrim">ID of object to duplicate</param>
/// <param name="offset"></param>
/// <param name="flags"></param>
/// <param name="AgentID">Agent doing the duplication</param>
/// <param name="GroupID">Group of new object</param>
public void DuplicateObject(uint originalPrim, Vector3 offset, uint flags, UUID AgentID, UUID GroupID)
{
SceneObjectGroup copy = SceneGraph.DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Identity);
if (copy != null)
EventManager.TriggerObjectAddedToScene(copy);
}
/// <summary> /// <summary>
/// Duplicates object specified by localID at position raycasted against RayTargetObject using /// Duplicates object specified by localID at position raycasted against RayTargetObject using
/// RayEnd and RayStart to determine what the angle of the ray is /// RayEnd and RayStart to determine what the angle of the ray is
@ -3120,19 +3137,22 @@ namespace OpenSim.Region.Framework.Scenes
// stick in offset format from the original prim // stick in offset format from the original prim
pos = pos - target.ParentGroup.AbsolutePosition; pos = pos - target.ParentGroup.AbsolutePosition;
SceneObjectGroup copy;
if (CopyRotates) if (CopyRotates)
{ {
Quaternion worldRot = target2.GetWorldRotation(); Quaternion worldRot = target2.GetWorldRotation();
// SceneObjectGroup obj = m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot); // SceneObjectGroup obj = m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot);
m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot); copy = m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot);
//obj.Rotation = worldRot; //obj.Rotation = worldRot;
//obj.UpdateGroupRotationR(worldRot); //obj.UpdateGroupRotationR(worldRot);
} }
else else
{ {
m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID); copy = m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, Quaternion.Identity);
} }
if (copy != null)
EventManager.TriggerObjectAddedToScene(copy);
} }
} }
} }
@ -4467,6 +4487,16 @@ namespace OpenSim.Region.Framework.Scenes
return m_sceneGraph.GetGroupByPrim(localID); return m_sceneGraph.GetGroupByPrim(localID);
} }
/// <summary>
/// Get a scene object group that contains the prim with the given uuid
/// </summary>
/// <param name="fullID"></param>
/// <returns>null if no scene object group containing that prim is found</returns>
public SceneObjectGroup GetGroupByPrim(UUID fullID)
{
return m_sceneGraph.GetGroupByPrim(fullID);
}
public override bool TryGetScenePresence(UUID agentID, out ScenePresence sp) public override bool TryGetScenePresence(UUID agentID, out ScenePresence sp)
{ {
return m_sceneGraph.TryGetScenePresence(agentID, out sp); return m_sceneGraph.TryGetScenePresence(agentID, out sp);

View File

@ -343,6 +343,7 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
/// ///
/// This method does not send updates to the client - callers need to handle this themselves. /// This method does not send updates to the client - callers need to handle this themselves.
/// Caller should also trigger EventManager.TriggerObjectAddedToScene
/// <param name="sceneObject"></param> /// <param name="sceneObject"></param>
/// <param name="attachToBackup"></param> /// <param name="attachToBackup"></param>
/// <param name="pos">Position of the object. If null then the position stored in the object is used.</param> /// <param name="pos">Position of the object. If null then the position stored in the object is used.</param>
@ -1002,7 +1003,7 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
/// <param name="fullID"></param> /// <param name="fullID"></param>
/// <returns>null if no scene object group containing that prim is found</returns> /// <returns>null if no scene object group containing that prim is found</returns>
private SceneObjectGroup GetGroupByPrim(UUID fullID) public SceneObjectGroup GetGroupByPrim(UUID fullID)
{ {
SceneObjectGroup sog; SceneObjectGroup sog;
lock (SceneObjectGroupsByFullPartID) lock (SceneObjectGroupsByFullPartID)
@ -1992,22 +1993,6 @@ namespace OpenSim.Region.Framework.Scenes
#pragma warning restore 0612 #pragma warning restore 0612
} }
/// <summary>
/// Duplicate the given object, Fire and Forget, No rotation, no return wrapper
/// </summary>
/// <param name="originalPrim"></param>
/// <param name="offset"></param>
/// <param name="flags"></param>
/// <param name="AgentID"></param>
/// <param name="GroupID"></param>
protected internal void DuplicateObject(uint originalPrim, Vector3 offset, uint flags, UUID AgentID, UUID GroupID)
{
//m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID);
// SceneObjectGroup dupe = DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Zero);
DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Identity);
}
/// <summary> /// <summary>
/// Duplicate the given object. /// Duplicate the given object.
/// </summary> /// </summary>

View File

@ -244,7 +244,7 @@ namespace OpenSim.Region.Framework.Scenes
public bool IgnoreUndoUpdate = false; public bool IgnoreUndoUpdate = false;
private PrimFlags LocalFlags; public PrimFlags LocalFlags;
private float m_damage = -1.0f; private float m_damage = -1.0f;
private byte[] m_TextureAnimation; private byte[] m_TextureAnimation;
@ -933,32 +933,18 @@ namespace OpenSim.Region.Framework.Scenes
public Color Color public Color Color
{ {
get { return m_color; } get { return m_color; }
set set { m_color = value; }
{
m_color = value;
/* ScheduleFullUpdate() need not be called b/c after
* setting the color, the text will be set, so then
* ScheduleFullUpdate() will be called. */
//ScheduleFullUpdate();
}
} }
public string Text public string Text
{ {
get get
{ {
string returnstr = m_text; if (m_text.Length > 255)
if (returnstr.Length > 255) return m_text.Substring(0, 254);
{ return m_text;
returnstr = returnstr.Substring(0, 254);
}
return returnstr;
}
set
{
m_text = value;
} }
set { m_text = value; }
} }
@ -2795,6 +2781,10 @@ namespace OpenSim.Region.Framework.Scenes
if (ParentGroup == null) if (ParentGroup == null)
return; return;
// When running OpenSim tests, Scene (and EventManager can be null).
// Need to fix tests before we can trigger this here
// ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this);
ParentGroup.QueueForUpdateCheck(); ParentGroup.QueueForUpdateCheck();
int timeNow = Util.UnixTimeSinceEpoch(); int timeNow = Util.UnixTimeSinceEpoch();
@ -2827,6 +2817,10 @@ namespace OpenSim.Region.Framework.Scenes
if (ParentGroup == null) if (ParentGroup == null)
return; return;
// When running OpenSim tests, Scene (and EventManager can be null).
// Need to fix tests before we can trigger this here
// ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this);
// This was pulled from SceneViewer. Attachments always receive full updates. // This was pulled from SceneViewer. Attachments always receive full updates.
// I could not verify if this is a requirement but this maintains existing behavior // I could not verify if this is a requirement but this maintains existing behavior
if (ParentGroup.IsAttachment) if (ParentGroup.IsAttachment)