Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

connector_plugin
Justin Clark-Casey (justincc) 2012-09-12 00:07:56 +01:00
commit 757d9163fa
10 changed files with 127 additions and 7 deletions

View File

@ -126,6 +126,7 @@ namespace OpenSim.Framework
private int m_physPrimMax = 0;
private bool m_clampPrimSize = false;
private int m_objectCapacity = 0;
private int m_linksetCapacity = 0;
private int m_agentCapacity = 0;
private string m_regionType = String.Empty;
private RegionLightShareData m_windlight = new RegionLightShareData();
@ -317,6 +318,11 @@ namespace OpenSim.Framework
get { return m_objectCapacity; }
}
public int LinksetCapacity
{
get { return m_linksetCapacity; }
}
public int AgentCapacity
{
get { return m_agentCapacity; }
@ -654,6 +660,9 @@ namespace OpenSim.Framework
m_objectCapacity = config.GetInt("MaxPrims", 15000);
allKeys.Remove("MaxPrims");
m_linksetCapacity = config.GetInt("LinksetPrims", 0);
allKeys.Remove("LinksetPrims");
#endregion
@ -709,6 +718,9 @@ namespace OpenSim.Framework
if (m_objectCapacity != 0)
config.Set("MaxPrims", m_objectCapacity);
if (m_linksetCapacity != 0)
config.Set("LinksetPrims", m_linksetCapacity);
if (m_agentCapacity != 0)
config.Set("MaxAgents", m_agentCapacity);
@ -804,6 +816,9 @@ namespace OpenSim.Framework
configMember.addConfigurationOption("object_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
"Max objects this sim will hold", m_objectCapacity.ToString(), true);
configMember.addConfigurationOption("linkset_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
"Max prims an object will hold", m_linksetCapacity.ToString(), true);
configMember.addConfigurationOption("agent_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
"Max avatars this sim will hold", m_agentCapacity.ToString(), true);
@ -922,6 +937,9 @@ namespace OpenSim.Framework
case "object_capacity":
m_objectCapacity = (int)configuration_result;
break;
case "linkset_capacity":
m_linksetCapacity = (int)configuration_result;
break;
case "agent_capacity":
m_agentCapacity = (int)configuration_result;
break;
@ -1052,4 +1070,4 @@ namespace OpenSim.Framework
return kvp;
}
}
}
}

View File

@ -49,8 +49,12 @@ using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces;
[assembly: Addin("FlotsamAssetCache", "1.1")]
[assembly: AddinDependency("OpenSim", "0.5")]
namespace OpenSim.Region.CoreModules.Asset
{
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class FlotsamAssetCache : ISharedRegionModule, IImprovedAssetCache, IAssetService
{
private static readonly ILog m_log =

View File

@ -35,7 +35,6 @@ using Nini.Config;
using NUnit.Framework;
using OpenMetaverse;
using OpenMetaverse.Assets;
using OpenSim.Region.CoreModules.Asset;
using OpenSim.Framework;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Scenes.Serialization;

View File

@ -34,7 +34,6 @@
<RegionModule id="LureModule" type="OpenSim.Region.CoreModules.Avatar.Lure.LureModule" />
<RegionModule id="InventoryTransferModule" type="OpenSim.Region.CoreModules.Avatar.Inventory.Transfer.InventoryTransferModule" />
<RegionModule id="CoreAssetCache" type="OpenSim.Region.CoreModules.Asset.CoreAssetCache" />
<RegionModule id="FlotsamAssetCache" type="OpenSim.Region.CoreModules.Asset.FlotsamAssetCache" />
<RegionModule id="GlynnTuckerAssetCache" type="OpenSim.Region.CoreModules.Asset.GlynnTuckerAssetCache" />
<RegionModule id="CenomeMemoryAssetCache" type="OpenSim.Region.CoreModules.Asset.CenomeMemoryAssetCache"/>
<RegionModule id="LibraryModule" type="OpenSim.Region.CoreModules.Framework.Library.LibraryModule"/>

View File

@ -47,26 +47,71 @@ namespace OpenSim.Region.Framework.Scenes
public delegate void OnFrameDelegate();
/// <summary>
/// Triggered on each sim frame.
/// </summary>
/// <remarks>
/// This gets triggered in <see cref="OpenSim.Region.Framework.Scenes.Scene.Update"/>
/// Core uses it for things like Sun, Wind & Clouds
/// The MRM module also uses it.
/// </remarks>
public event OnFrameDelegate OnFrame;
public delegate void ClientMovement(ScenePresence client);
/// <summary>
/// Trigerred when an agent moves.
/// </summary>
/// <remarks>
/// This gets triggered in <see cref="OpenSim.Region.Framework.Scenes.ScenePresence.HandleAgentUpdate"/>
/// prior to <see cref="OpenSim.Region.Framework.Scenes.ScenePresence.TriggerScenePresenceUpdated"/>
/// </remarks>
public event ClientMovement OnClientMovement;
public delegate void OnTerrainTaintedDelegate();
/// <summary>
/// Triggered if the terrain has been edited
/// </summary>
/// <remarks>
/// This gets triggered in <see cref="OpenSim.Region.CoreModules.World.Terrain.CheckForTerrainUpdates"/>
/// after it determines that an update has been made.
/// </remarks>
public event OnTerrainTaintedDelegate OnTerrainTainted;
public delegate void OnTerrainTickDelegate();
/// <summary>
/// Triggered if the terrain has been edited
/// </summary>
/// <remarks>
/// This gets triggered in <see cref="OpenSim.Region.Framework.Scenes.Scene.UpdateTerrain"/>
/// but is used by core solely to update the physics engine.
/// </remarks>
public event OnTerrainTickDelegate OnTerrainTick;
public delegate void OnBackupDelegate(ISimulationDataService datastore, bool forceBackup);
/// <summary>
/// Triggered when a region is backed up/persisted to storage
/// </summary>
/// <remarks>
/// This gets triggered in <see cref="OpenSim.Region.Framework.Scenes.Scene.Backup"/>
/// and is fired before the persistence occurs.
/// </remarks>
public event OnBackupDelegate OnBackup;
public delegate void OnClientConnectCoreDelegate(IClientCore client);
/// <summary>
/// Triggered when a new client connects to the scene.
/// </summary>
/// <remarks>
/// This gets triggered in <see cref="TriggerOnNewClient"/>,
/// which checks if an instance of <see cref="OpenSim.Framework.IClientAPI"/>
/// also implements <see cref="OpenSim.Framework.Client.IClientCore"/> and as such,
/// is not triggered by <see cref="OpenSim.Region.OptionalModules.World.NPC">NPCs</see>.
/// </remarks>
public event OnClientConnectCoreDelegate OnClientConnect;
public delegate void OnNewClientDelegate(IClientAPI client);
@ -87,10 +132,24 @@ namespace OpenSim.Region.Framework.Scenes
public delegate void OnNewPresenceDelegate(ScenePresence presence);
/// <summary>
/// Triggered when a new presence is added to the scene
/// </summary>
/// <remarks>
/// Triggered in <see cref="OpenSim.Region.Framework.Scenes.Scene.AddNewClient"/> which is used by both
/// <see cref="OpenSim.Framework.PresenceType.User">users</see> and <see cref="OpenSim.Framework.PresenceType.Npc">NPCs</see>
/// </remarks>
public event OnNewPresenceDelegate OnNewPresence;
public delegate void OnRemovePresenceDelegate(UUID agentId);
/// <summary>
/// Triggered when a presence is removed from the scene
/// </summary>
/// <remarks>
/// Triggered in <see cref="OpenSim.Region.Framework.Scenes.Scene.AddNewClient"/> which is used by both
/// <see cref="OpenSim.Framework.PresenceType.User">users</see> and <see cref="OpenSim.Framework.PresenceType.Npc">NPCs</see>
/// </remarks>
public event OnRemovePresenceDelegate OnRemovePresence;
public delegate void OnParcelPrimCountUpdateDelegate();
@ -481,6 +540,9 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="copy"></param>
/// <param name="original"></param>
/// <param name="userExposed">True if the duplicate will immediately be in the scene, false otherwise</param>
/// <remarks>
/// Triggered in <see cref="OpenSim.Region.Framework.Scenes.SceneObjectPart.Copy"/>
/// </remarks>
public event SceneObjectPartCopyDelegate OnSceneObjectPartCopy;
public delegate void SceneObjectPartCopyDelegate(SceneObjectPart copy, SceneObjectPart original, bool userExposed);

View File

@ -123,6 +123,11 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary>
public float m_maxPhys = 10;
/// <summary>
/// Max prims an object will hold
/// </summary>
public int m_linksetCapacity = 0;
public bool m_clampPrimSize;
public bool m_trustBinaries;
public bool m_allowScriptCrossings;
@ -772,6 +777,12 @@ namespace OpenSim.Region.Framework.Scenes
m_clampPrimSize = true;
}
m_linksetCapacity = startupConfig.GetInt("LinksetPrims", m_linksetCapacity);
if (RegionInfo.LinksetCapacity > 0)
{
m_linksetCapacity = RegionInfo.LinksetCapacity;
}
m_useTrashOnDelete = startupConfig.GetBoolean("UseTrashOnDelete", m_useTrashOnDelete);
m_trustBinaries = startupConfig.GetBoolean("TrustBinaries", m_trustBinaries);
m_allowScriptCrossings = startupConfig.GetBoolean("AllowScriptCrossing", m_allowScriptCrossings);

View File

@ -2014,6 +2014,24 @@ namespace OpenSim.Region.Framework.Scenes
if (objectGroup == this)
return;
// If the configured linkset capacity is greater than zero,
// and the new linkset would have a prim count higher than this
// value, do not link it.
if (m_scene.m_linksetCapacity > 0 &&
(PrimCount + objectGroup.PrimCount) >
m_scene.m_linksetCapacity)
{
m_log.DebugFormat(
"[SCENE OBJECT GROUP]: Cannot link group with root" +
" part {0}, {1} ({2} prims) to group with root part" +
" {3}, {4} ({5} prims) because the new linkset" +
" would exceed the configured maximum of {6}",
objectGroup.RootPart.Name, objectGroup.RootPart.UUID,
objectGroup.PrimCount, RootPart.Name, RootPart.UUID,
PrimCount, m_scene.m_linksetCapacity);
return;
}
// 'linkPart' == the root of the group being linked into this group
SceneObjectPart linkPart = objectGroup.m_rootPart;

View File

@ -254,7 +254,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
object[] convertedParms = new object[parms.Length];
for (int i = 0; i < parms.Length; i++)
convertedParms[i] = ConvertFromLSL(parms[i],signature[i]);
convertedParms[i] = ConvertFromLSL(parms[i],signature[i], fname);
// now call the function, the contract with the function is that it will always return
// non-null but don't trust it completely
@ -294,7 +294,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/// <summary>
/// </summary>
protected object ConvertFromLSL(object lslparm, Type type)
protected object ConvertFromLSL(object lslparm, Type type, string fname)
{
// ---------- String ----------
if (lslparm is LSL_String)
@ -374,14 +374,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
(LSL_Vector)plist[i]);
}
else
MODError("unknown LSL list element type");
MODError(String.Format("{0}: unknown LSL list element type", fname));
}
return result;
}
}
MODError(String.Format("parameter type mismatch; expecting {0}",type.Name));
MODError(String.Format("{1}: parameter type mismatch; expecting {0}",type.Name, fname));
return null;
}

View File

@ -107,6 +107,11 @@
;; If a viewer attempts to rez a prim larger than the non-physical or physical prim max, clamp the dimensions to the appropriate maximum
;; This can be overriden in the region config file.
; ClampPrimSize = false
;# {LinksetPrims} {} {Max prims an object will hold?} {} 0
;; Maximum number of prims allowable in a linkset. Affects creating new linksets. Ignored if less than or equal to zero.
;; This can be overriden in the region config file.
; LinksetPrims = 0
;# {AllowScriptCrossing} {} {Allow scripts to cross into this region} {true false} true
;; Allow scripts to keep running when they cross region boundaries, rather than being restarted. State is reloaded on the destination region.

View File

@ -94,6 +94,10 @@
; If a viewer attempts to rez a prim larger than the non-physical or physical prim max, clamp the dimensions to the appropriate maximum
; This can be overriden in the region config file.
ClampPrimSize = false
; Maximum number of prims allowable in a linkset. Affects creating new linksets. Ignored if less than or equal to zero.
; This can be overriden in the region config file.
LinksetPrims = 0
; Allow scripts to keep running when they cross region boundaries, rather than being restarted. State is reloaded on the destination region.
; This only applies when crossing to a region running in a different simulator.