Merge branch 'master' of /home/opensim/var/repo/opensim

integration
BlueWall 2012-09-13 10:01:41 -04:00
commit dad2e2060c
15 changed files with 308 additions and 82 deletions

View File

@ -701,27 +701,27 @@ namespace OpenSim.Framework
config.Set("ExternalHostName", m_externalHostName); config.Set("ExternalHostName", m_externalHostName);
if (m_nonphysPrimMin != 0) if (m_nonphysPrimMin > 0)
config.Set("NonphysicalPrimMax", m_nonphysPrimMin); config.Set("NonphysicalPrimMax", m_nonphysPrimMin);
if (m_nonphysPrimMax != 0) if (m_nonphysPrimMax > 0)
config.Set("NonphysicalPrimMax", m_nonphysPrimMax); config.Set("NonphysicalPrimMax", m_nonphysPrimMax);
if (m_physPrimMin != 0) if (m_physPrimMin > 0)
config.Set("PhysicalPrimMax", m_physPrimMin); config.Set("PhysicalPrimMax", m_physPrimMin);
if (m_physPrimMax != 0) if (m_physPrimMax > 0)
config.Set("PhysicalPrimMax", m_physPrimMax); config.Set("PhysicalPrimMax", m_physPrimMax);
config.Set("ClampPrimSize", m_clampPrimSize.ToString()); config.Set("ClampPrimSize", m_clampPrimSize.ToString());
if (m_objectCapacity != 0) if (m_objectCapacity > 0)
config.Set("MaxPrims", m_objectCapacity); config.Set("MaxPrims", m_objectCapacity);
if (m_linksetCapacity != 0) if (m_linksetCapacity > 0)
config.Set("LinksetPrims", m_linksetCapacity); config.Set("LinksetPrims", m_linksetCapacity);
if (m_agentCapacity != 0) if (m_agentCapacity > 0)
config.Set("MaxAgents", m_agentCapacity); config.Set("MaxAgents", m_agentCapacity);
if (ScopeID != UUID.Zero) if (ScopeID != UUID.Zero)

View File

@ -449,9 +449,7 @@ namespace OpenSim.Framework.Servers.HttpServer
if (TryGetStreamHandler(handlerKey, out requestHandler)) if (TryGetStreamHandler(handlerKey, out requestHandler))
{ {
if (DebugLevel >= 3) if (DebugLevel >= 3)
m_log.DebugFormat( LogIncomingToStreamHandler(request, requestHandler);
"[BASE HTTP SERVER]: Found stream handler for {0} {1} {2} {3}",
request.HttpMethod, request.Url.PathAndQuery, requestHandler.Name, requestHandler.Description);
response.ContentType = requestHandler.ContentType; // Lets do this defaulting before in case handler has varying content type. response.ContentType = requestHandler.ContentType; // Lets do this defaulting before in case handler has varying content type.
@ -563,9 +561,7 @@ namespace OpenSim.Framework.Servers.HttpServer
if (DoWeHaveALLSDHandler(request.RawUrl)) if (DoWeHaveALLSDHandler(request.RawUrl))
{ {
if (DebugLevel >= 3) if (DebugLevel >= 3)
m_log.DebugFormat( LogIncomingToContentTypeHandler(request);
"[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}",
request.ContentType, request.HttpMethod, request.Url.PathAndQuery);
buffer = HandleLLSDRequests(request, response); buffer = HandleLLSDRequests(request, response);
} }
@ -573,18 +569,14 @@ namespace OpenSim.Framework.Servers.HttpServer
else if (DoWeHaveAHTTPHandler(request.RawUrl)) else if (DoWeHaveAHTTPHandler(request.RawUrl))
{ {
if (DebugLevel >= 3) if (DebugLevel >= 3)
m_log.DebugFormat( LogIncomingToContentTypeHandler(request);
"[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}",
request.ContentType, request.HttpMethod, request.Url.PathAndQuery);
buffer = HandleHTTPRequest(request, response); buffer = HandleHTTPRequest(request, response);
} }
else else
{ {
if (DebugLevel >= 3) if (DebugLevel >= 3)
m_log.DebugFormat( LogIncomingToXmlRpcHandler(request);
"[BASE HTTP SERVER]: Assuming a generic XMLRPC request for {0} {1}",
request.HttpMethod, request.Url.PathAndQuery);
// generic login request. // generic login request.
buffer = HandleXmlRpcRequests(request, response); buffer = HandleXmlRpcRequests(request, response);
@ -654,6 +646,58 @@ namespace OpenSim.Framework.Servers.HttpServer
} }
} }
private void LogIncomingToStreamHandler(OSHttpRequest request, IRequestHandler requestHandler)
{
m_log.DebugFormat(
"[BASE HTTP SERVER]: Found stream handler for {0} {1} {2} {3}",
request.HttpMethod, request.Url.PathAndQuery, requestHandler.Name, requestHandler.Description);
if (DebugLevel >= 4)
LogIncomingInDetail(request);
}
private void LogIncomingToContentTypeHandler(OSHttpRequest request)
{
m_log.DebugFormat(
"[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}",
request.ContentType, request.HttpMethod, request.Url.PathAndQuery);
if (DebugLevel >= 4)
LogIncomingInDetail(request);
}
private void LogIncomingToXmlRpcHandler(OSHttpRequest request)
{
m_log.DebugFormat(
"[BASE HTTP SERVER]: Assuming a generic XMLRPC request for {0} {1}",
request.HttpMethod, request.Url.PathAndQuery);
if (DebugLevel >= 4)
LogIncomingInDetail(request);
}
private void LogIncomingInDetail(OSHttpRequest request)
{
using (StreamReader reader = new StreamReader(Util.Copy(request.InputStream), Encoding.UTF8))
{
string output;
if (DebugLevel == 4)
{
const int sampleLength = 80;
char[] sampleChars = new char[sampleLength];
reader.Read(sampleChars, 0, sampleLength);
output = string.Format("[BASE HTTP SERVER]: {0}...", new string(sampleChars).Replace("\n", @"\n"));
}
else
{
output = string.Format("[BASE HTTP SERVER]: {0}", reader.ReadToEnd());
}
m_log.Debug(output);
}
}
private bool TryGetStreamHandler(string handlerKey, out IRequestHandler streamHandler) private bool TryGetStreamHandler(string handlerKey, out IRequestHandler streamHandler)
{ {
string bestMatch = null; string bestMatch = null;

View File

@ -29,6 +29,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using System.Net; using System.Net;
using System.Text;
using log4net; using log4net;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Console; using OpenSim.Framework.Console;
@ -104,6 +105,11 @@ namespace OpenSim.Framework.Servers
public static void RegisterHttpConsoleCommands(ICommandConsole console) public static void RegisterHttpConsoleCommands(ICommandConsole console)
{ {
console.Commands.AddCommand(
"Comms", false, "show http-handlers",
"show http-handlers",
"Show all registered http handlers", HandleShowHttpHandlersCommand);
console.Commands.AddCommand( console.Commands.AddCommand(
"Debug", false, "debug http", "debug http [<level>]", "Debug", false, "debug http", "debug http [<level>]",
"Turn on inbound non-poll http request debugging.", "Turn on inbound non-poll http request debugging.",
@ -111,6 +117,8 @@ namespace OpenSim.Framework.Servers
+ "If level >= 1, then short warnings are logged when receiving bad input data.\n" + "If level >= 1, then short warnings are logged when receiving bad input data.\n"
+ "If level >= 2, then long warnings are logged when receiving bad input data.\n" + "If level >= 2, then long warnings are logged when receiving bad input data.\n"
+ "If level >= 3, then short notices about all incoming non-poll HTTP requests are logged.\n" + "If level >= 3, then short notices about all incoming non-poll HTTP requests are logged.\n"
+ "If level >= 4, then a sample from the beginning of the incoming data is logged.\n"
+ "If level >= 5, then the entire incoming data is logged.\n"
+ "If no level is specified then the current level is returned.", + "If no level is specified then the current level is returned.",
HandleDebugHttpCommand); HandleDebugHttpCommand);
} }
@ -136,10 +144,55 @@ namespace OpenSim.Framework.Servers
} }
else else
{ {
MainConsole.Instance.Output("Usage: debug http 0..3"); MainConsole.Instance.Output("Usage: debug http 0..5");
} }
} }
private static void HandleShowHttpHandlersCommand(string module, string[] args)
{
if (args.Length != 2)
{
MainConsole.Instance.Output("Usage: show http-handlers");
return;
}
StringBuilder handlers = new StringBuilder();
lock (m_Servers)
{
foreach (BaseHttpServer httpServer in m_Servers.Values)
{
handlers.AppendFormat(
"Registered HTTP Handlers for server at {0}:{1}\n", httpServer.ListenIPAddress, httpServer.Port);
handlers.AppendFormat("* XMLRPC:\n");
foreach (String s in httpServer.GetXmlRpcHandlerKeys())
handlers.AppendFormat("\t{0}\n", s);
handlers.AppendFormat("* HTTP:\n");
List<String> poll = httpServer.GetPollServiceHandlerKeys();
foreach (String s in httpServer.GetHTTPHandlerKeys())
handlers.AppendFormat("\t{0} {1}\n", s, (poll.Contains(s) ? "(poll service)" : string.Empty));
handlers.AppendFormat("* Agent:\n");
foreach (String s in httpServer.GetAgentHandlerKeys())
handlers.AppendFormat("\t{0}\n", s);
handlers.AppendFormat("* LLSD:\n");
foreach (String s in httpServer.GetLLSDHandlerKeys())
handlers.AppendFormat("\t{0}\n", s);
handlers.AppendFormat("* StreamHandlers ({0}):\n", httpServer.GetStreamHandlerKeys().Count);
foreach (String s in httpServer.GetStreamHandlerKeys())
handlers.AppendFormat("\t{0}\n", s);
handlers.Append("\n");
}
}
MainConsole.Instance.Output(handlers.ToString());
}
/// <summary> /// <summary>
/// Register an already started HTTP server to the collection of known servers. /// Register an already started HTTP server to the collection of known servers.
/// </summary> /// </summary>

View File

@ -1007,6 +1007,38 @@ namespace OpenSim.Framework
} }
} }
/// <summary>
/// Copy data from one stream to another, leaving the read position of both streams at the beginning.
/// </summary>
/// <param name='inputStream'>
/// Input stream. Must be seekable.
/// </param>
/// <exception cref='ArgumentException'>
/// Thrown if the input stream is not seekable.
/// </exception>
public static Stream Copy(Stream inputStream)
{
if (!inputStream.CanSeek)
throw new ArgumentException("Util.Copy(Stream inputStream) must receive an inputStream that can seek");
const int readSize = 256;
byte[] buffer = new byte[readSize];
MemoryStream ms = new MemoryStream();
int count = inputStream.Read(buffer, 0, readSize);
while (count > 0)
{
ms.Write(buffer, 0, count);
count = inputStream.Read(buffer, 0, readSize);
}
ms.Position = 0;
inputStream.Position = 0;
return ms;
}
public static XmlRpcResponse XmlRpcCommand(string url, string methodName, params object[] args) public static XmlRpcResponse XmlRpcCommand(string url, string methodName, params object[] args)
{ {
return SendXmlRpcCommand(url, methodName, args); return SendXmlRpcCommand(url, methodName, args);

View File

@ -332,10 +332,6 @@ namespace OpenSim
"show circuits", "show circuits",
"Show agent circuit data", HandleShow); "Show agent circuit data", HandleShow);
m_console.Commands.AddCommand("Comms", false, "show http-handlers",
"show http-handlers",
"Show all registered http handlers", HandleShow);
m_console.Commands.AddCommand("Comms", false, "show pending-objects", m_console.Commands.AddCommand("Comms", false, "show pending-objects",
"show pending-objects", "show pending-objects",
"Show # of objects on the pending queues of all scene viewers", HandleShow); "Show # of objects on the pending queues of all scene viewers", HandleShow);
@ -1013,33 +1009,6 @@ namespace OpenSim
HandleShowCircuits(); HandleShowCircuits();
break; break;
case "http-handlers":
System.Text.StringBuilder handlers = new System.Text.StringBuilder("Registered HTTP Handlers:\n");
handlers.AppendFormat("* XMLRPC:\n");
foreach (String s in HttpServer.GetXmlRpcHandlerKeys())
handlers.AppendFormat("\t{0}\n", s);
handlers.AppendFormat("* HTTP:\n");
List<String> poll = HttpServer.GetPollServiceHandlerKeys();
foreach (String s in HttpServer.GetHTTPHandlerKeys())
handlers.AppendFormat("\t{0} {1}\n", s, (poll.Contains(s) ? "(poll service)" : string.Empty));
handlers.AppendFormat("* Agent:\n");
foreach (String s in HttpServer.GetAgentHandlerKeys())
handlers.AppendFormat("\t{0}\n", s);
handlers.AppendFormat("* LLSD:\n");
foreach (String s in HttpServer.GetLLSDHandlerKeys())
handlers.AppendFormat("\t{0}\n", s);
handlers.AppendFormat("* StreamHandlers ({0}):\n", HttpServer.GetStreamHandlerKeys().Count);
foreach (String s in HttpServer.GetStreamHandlerKeys())
handlers.AppendFormat("\t{0}\n", s);
MainConsole.Instance.Output(handlers.ToString());
break;
case "modules": case "modules":
MainConsole.Instance.Output("The currently loaded shared modules are:"); MainConsole.Instance.Output("The currently loaded shared modules are:");
foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules) foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules)

View File

@ -482,9 +482,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
Util.FireAndForget( Util.FireAndForget(
delegate delegate
{ {
m_log.DebugFormat( // m_log.DebugFormat(
"[FRIENDS MODULE]: Notifying {0} friends of {1} of online status {2}", // "[FRIENDS MODULE]: Notifying {0} friends of {1} of online status {2}",
friendList.Count, agentID, online); // friendList.Count, agentID, online);
// Notify about this user status // Notify about this user status
StatusNotify(friendList, agentID, online); StatusNotify(friendList, agentID, online);

View File

@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.World.Land
/// without recounting the whole sim. /// without recounting the whole sim.
/// ///
/// We start out tainted so that the first get call resets the various prim counts. /// We start out tainted so that the first get call resets the various prim counts.
/// <value> /// </value>
private bool m_Tainted = true; private bool m_Tainted = true;
private Object m_TaintLock = new Object(); private Object m_TaintLock = new Object();

View File

@ -35,7 +35,7 @@ namespace OpenSim.Region.Framework.Interfaces
public interface IJsonStoreModule public interface IJsonStoreModule
{ {
bool CreateStore(string value, out UUID result); bool CreateStore(string value, ref UUID result);
bool DestroyStore(UUID storeID); bool DestroyStore(UUID storeID);
bool TestPath(UUID storeID, string path, bool useJson); bool TestPath(UUID storeID, string path, bool useJson);
bool SetValue(UUID storeID, string path, string value, bool useJson); bool SetValue(UUID storeID, string path, string value, bool useJson);

View File

@ -47,26 +47,71 @@ namespace OpenSim.Region.Framework.Scenes
public delegate void OnFrameDelegate(); 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 event OnFrameDelegate OnFrame;
public delegate void ClientMovement(ScenePresence client); 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 event ClientMovement OnClientMovement;
public delegate void OnTerrainTaintedDelegate(); 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 event OnTerrainTaintedDelegate OnTerrainTainted;
public delegate void OnTerrainTickDelegate(); 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 event OnTerrainTickDelegate OnTerrainTick;
public delegate void OnBackupDelegate(ISimulationDataService datastore, bool forceBackup); 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 event OnBackupDelegate OnBackup;
public delegate void OnClientConnectCoreDelegate(IClientCore client); 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 event OnClientConnectCoreDelegate OnClientConnect;
public delegate void OnNewClientDelegate(IClientAPI client); public delegate void OnNewClientDelegate(IClientAPI client);
@ -87,18 +132,54 @@ namespace OpenSim.Region.Framework.Scenes
public delegate void OnNewPresenceDelegate(ScenePresence presence); 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 event OnNewPresenceDelegate OnNewPresence;
public delegate void OnRemovePresenceDelegate(UUID agentId); 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 event OnRemovePresenceDelegate OnRemovePresence;
public delegate void OnParcelPrimCountUpdateDelegate(); public delegate void OnParcelPrimCountUpdateDelegate();
/// <summary>
/// Triggered whenever the prim count may have been altered, or prior
/// to an action that requires the current prim count to be accurate.
/// </summary>
/// <remarks>
/// Triggered by <see cref="TriggerParcelPrimCountUpdate"/> in
/// <see cref="OpenSim.OpenSimBase.CreateRegion"/>,
/// <see cref="OpenSim.Region.CoreModules.World.Land.LandManagementModule.EventManagerOnRequestParcelPrimCountUpdate"/>,
/// <see cref="OpenSim.Region.CoreModules.World.Land.LandManagementModule.ClientOnParcelObjectOwnerRequest"/>,
/// <see cref="OpenSim.Region.CoreModules.World.Land.LandObject.GetPrimsFree"/>,
/// <see cref="OpenSim.Region.CoreModules.World.Land.LandObject.UpdateLandSold"/>,
/// <see cref="OpenSim.Region.CoreModules.World.Land.LandObject.DeedToGroup"/>,
/// <see cref="OpenSim.Region.CoreModules.World.Land.LandObject.SendLandUpdateToClient"/>
/// </remarks>
public event OnParcelPrimCountUpdateDelegate OnParcelPrimCountUpdate; public event OnParcelPrimCountUpdateDelegate OnParcelPrimCountUpdate;
public delegate void OnParcelPrimCountAddDelegate(SceneObjectGroup obj); public delegate void OnParcelPrimCountAddDelegate(SceneObjectGroup obj);
/// <summary>
/// Triggered in response to <see cref="OnParcelPrimCountUpdate"/> for
/// objects that actually contribute to parcel prim count.
/// </summary>
/// <remarks>
/// Triggered by <see cref="TriggerParcelPrimCountAdd"/> in
/// <see cref="OpenSim.Region.CoreModules.World.Land.LandManagementModule.EventManagerOnParcelPrimCountUpdate"/>
/// </remarks>
public event OnParcelPrimCountAddDelegate OnParcelPrimCountAdd; public event OnParcelPrimCountAddDelegate OnParcelPrimCountAdd;
public delegate void OnPluginConsoleDelegate(string[] args); public delegate void OnPluginConsoleDelegate(string[] args);
@ -119,6 +200,14 @@ namespace OpenSim.Region.Framework.Scenes
public event OnSetRootAgentSceneDelegate OnSetRootAgentScene; public event OnSetRootAgentSceneDelegate OnSetRootAgentScene;
/// <summary>
/// Triggered after parcel properties have been updated.
/// </summary>
/// <remarks>
/// Triggered by <see cref="TriggerOnParcelPropertiesUpdateRequest"/> in
/// <see cref="OpenSim.Region.CoreModules.World.Land.LandManagementModule.ClientOnParcelPropertiesUpdateRequest"/>,
/// <see cref="OpenSim.Region.CoreModules.World.Land.LandManagementModule.ProcessPropertiesUpdate"/>
/// </remarks>
public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
/// <summary> /// <summary>
@ -369,6 +458,20 @@ namespace OpenSim.Region.Framework.Scenes
public event RequestParcelPrimCountUpdate OnRequestParcelPrimCountUpdate; public event RequestParcelPrimCountUpdate OnRequestParcelPrimCountUpdate;
public delegate void ParcelPrimCountTainted(); public delegate void ParcelPrimCountTainted();
/// <summary>
/// Triggered when the parcel prim count has been altered.
/// </summary>
/// <remarks>
/// Triggered by <see cref="TriggerParcelPrimCountTainted"/> in
/// <see cref="OpenSim.Region.CoreModules.Avatar.Attachments.AttachmentsModule.DetachSingleAttachmentToGround"/>,
/// <see cref="OpenSim.Region.CoreModules.Avatar.Attachments.AttachmentsModule.AttachToAgent"/>,
/// <see cref="Scene.DeleteSceneObject"/>,
/// <see cref="Scene.SelectPrim"/>,
/// <see cref="Scene.DeselectPrim"/>,
/// <see cref="SceneObjectGroup.UpdatePrimFlags"/>,
/// <see cref="SceneObjectGroup.AbsolutePosition"/>
/// </remarks>
public event ParcelPrimCountTainted OnParcelPrimCountTainted; public event ParcelPrimCountTainted OnParcelPrimCountTainted;
public event GetScriptRunning OnGetScriptRunning; public event GetScriptRunning OnGetScriptRunning;
@ -481,6 +584,9 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="copy"></param> /// <param name="copy"></param>
/// <param name="original"></param> /// <param name="original"></param>
/// <param name="userExposed">True if the duplicate will immediately be in the scene, false otherwise</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 event SceneObjectPartCopyDelegate OnSceneObjectPartCopy;
public delegate void SceneObjectPartCopyDelegate(SceneObjectPart copy, SceneObjectPart original, bool userExposed); public delegate void SceneObjectPartCopyDelegate(SceneObjectPart copy, SceneObjectPart original, bool userExposed);
@ -589,8 +695,29 @@ namespace OpenSim.Region.Framework.Scenes
public delegate void LandBuy(Object sender, LandBuyArgs e); public delegate void LandBuy(Object sender, LandBuyArgs e);
/// <summary>
/// Triggered when an attempt to transfer grid currency occurs
/// </summary>
/// <remarks>
/// Triggered in <see cref="OpenSim.Region.Framework.Scenes.Scene.ProcessMoneyTransferRequest"/>
/// via <see cref="OpenSim.Region.Framework.Scenes.Scene.SubscribeToClientGridEvents"/>
/// via <see cref="OpenSim.Region.Framework.Scenes.Scene.SubscribeToClientEvents"/>
/// via <see cref="OpenSim.Region.Framework.Scenes.Scene.AddNewClient"/>
/// </remarks>
public event MoneyTransferEvent OnMoneyTransfer; public event MoneyTransferEvent OnMoneyTransfer;
/// <summary>
/// Triggered after after <see cref="OnValidateLandBuy"/>
/// </summary>
public event LandBuy OnLandBuy; public event LandBuy OnLandBuy;
/// <summary>
/// Triggered to allow or prevent a real estate transaction
/// </summary>
/// <remarks>
/// Triggered in <see cref="OpenSim.Region.Framework.Scenes.Scene.ProcessParcelBuy"/>
/// <seealso cref="OpenSim.Region.OptionalModules.World.MoneyModule.SampleMoneyModule.ValidateLandBuy"/>
/// </remarks>
public event LandBuy OnValidateLandBuy; public event LandBuy OnValidateLandBuy;
public void TriggerOnAttach(uint localID, UUID itemID, UUID avatarID) public void TriggerOnAttach(uint localID, UUID itemID, UUID avatarID)

View File

@ -2029,6 +2029,7 @@ namespace OpenSim.Region.Framework.Scenes
objectGroup.RootPart.Name, objectGroup.RootPart.UUID, objectGroup.RootPart.Name, objectGroup.RootPart.UUID,
objectGroup.PrimCount, RootPart.Name, RootPart.UUID, objectGroup.PrimCount, RootPart.Name, RootPart.UUID,
PrimCount, m_scene.m_linksetCapacity); PrimCount, m_scene.m_linksetCapacity);
return; return;
} }

View File

@ -175,14 +175,15 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
/// ///
/// </summary> /// </summary>
// ----------------------------------------------------------------- // -----------------------------------------------------------------
public bool CreateStore(string value, out UUID result) public bool CreateStore(string value, ref UUID result)
{ {
result = UUID.Zero; if (result == UUID.Zero)
result = UUID.Random();
JsonStore map = null;
if (! m_enabled) return false; if (! m_enabled) return false;
UUID uuid = UUID.Random();
JsonStore map = null;
try try
{ {
@ -195,9 +196,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
} }
lock (m_JsonValueStore) lock (m_JsonValueStore)
m_JsonValueStore.Add(uuid,map); m_JsonValueStore.Add(result,map);
result = uuid;
return true; return true;
} }
@ -231,7 +231,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
if (! m_JsonValueStore.TryGetValue(storeID,out map)) if (! m_JsonValueStore.TryGetValue(storeID,out map))
{ {
m_log.InfoFormat("[JsonStore] Missing store {0}",storeID); m_log.InfoFormat("[JsonStore] Missing store {0}",storeID);
return true; return false;
} }
} }

View File

@ -227,7 +227,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
protected UUID JsonCreateStore(UUID hostID, UUID scriptID, string value) protected UUID JsonCreateStore(UUID hostID, UUID scriptID, string value)
{ {
UUID uuid = UUID.Zero; UUID uuid = UUID.Zero;
if (! m_store.CreateStore(value, out uuid)) if (! m_store.CreateStore(value, ref uuid))
GenerateRuntimeError("Failed to create Json store"); GenerateRuntimeError("Failed to create Json store");
return uuid; return uuid;

View File

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