Merge branch 'master' into careminster

Conflicts:
	OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
	OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
	OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
avinationmerge
Melanie 2012-04-14 01:51:20 +01:00
commit 919972a440
8 changed files with 257 additions and 102 deletions

View File

@ -144,6 +144,7 @@ what it is today.
* SignpostMarv * SignpostMarv
* SpotOn3D * SpotOn3D
* Strawberry Fride * Strawberry Fride
* Talun
* tglion * tglion
* tlaukkan/Tommil (Tommi S. E. Laukkanen, Bubble Cloud) * tlaukkan/Tommil (Tommi S. E. Laukkanen, Bubble Cloud)
* tyre * tyre

View File

@ -146,6 +146,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
protected void SaveInvItem(InventoryItemBase inventoryItem, string path, Dictionary<string, object> options, IUserAccountService userAccountService) protected void SaveInvItem(InventoryItemBase inventoryItem, string path, Dictionary<string, object> options, IUserAccountService userAccountService)
{ {
if (options.ContainsKey("exclude"))
{
if (((List<String>)options["exclude"]).Contains(inventoryItem.Name) ||
((List<String>)options["exclude"]).Contains(inventoryItem.ID.ToString()))
{
if (options.ContainsKey("verbose"))
{
m_log.InfoFormat(
"[INVENTORY ARCHIVER]: Skipping inventory item {0} {1} at {2}",
inventoryItem.Name, inventoryItem.ID, path);
}
return;
}
}
if (options.ContainsKey("verbose")) if (options.ContainsKey("verbose"))
m_log.InfoFormat( m_log.InfoFormat(
"[INVENTORY ARCHIVER]: Saving item {0} {1} with asset {2}", "[INVENTORY ARCHIVER]: Saving item {0} {1} with asset {2}",
@ -178,6 +193,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
InventoryFolderBase inventoryFolder, string path, bool saveThisFolderItself, InventoryFolderBase inventoryFolder, string path, bool saveThisFolderItself,
Dictionary<string, object> options, IUserAccountService userAccountService) Dictionary<string, object> options, IUserAccountService userAccountService)
{ {
if (options.ContainsKey("excludefolders"))
{
if (((List<String>)options["excludefolders"]).Contains(inventoryFolder.Name) ||
((List<String>)options["excludefolders"]).Contains(inventoryFolder.ID.ToString()))
{
if (options.ContainsKey("verbose"))
{
m_log.InfoFormat(
"[INVENTORY ARCHIVER]: Skipping folder {0} at {1}",
inventoryFolder.Name, path);
}
return;
}
}
if (options.ContainsKey("verbose"))
m_log.InfoFormat("[INVENTORY ARCHIVER]: Saving folder {0}", inventoryFolder.Name);
if (saveThisFolderItself) if (saveThisFolderItself)
{ {
path += CreateArchiveFolderName(inventoryFolder); path += CreateArchiveFolderName(inventoryFolder);

View File

@ -122,7 +122,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
scene.AddCommand( scene.AddCommand(
"Archiving", this, "save iar", "Archiving", this, "save iar",
"save iar [-h|--home=<url>] [--noassets] <first> <last> <inventory path> <password> [<IAR path>] [-c|--creators] [-v|--verbose]", "save iar [-h|--home=<url>] [--noassets] <first> <last> <inventory path> <password> [<IAR path>] [-c|--creators] [-e|--exclude=<name/uuid>] [-f|--excludefolder=<foldername/uuid>] [-v|--verbose]",
"Save user inventory archive (IAR).", "Save user inventory archive (IAR).",
"<first> is the user's first name.\n" "<first> is the user's first name.\n"
+ "<last> is the user's last name.\n" + "<last> is the user's last name.\n"
@ -131,6 +131,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
+ string.Format(" If this is not given then the filename {0} in the current directory is used.\n", DEFAULT_INV_BACKUP_FILENAME) + string.Format(" If this is not given then the filename {0} in the current directory is used.\n", DEFAULT_INV_BACKUP_FILENAME)
+ "-h|--home=<url> adds the url of the profile service to the saved user information.\n" + "-h|--home=<url> adds the url of the profile service to the saved user information.\n"
+ "-c|--creators preserves information about foreign creators.\n" + "-c|--creators preserves information about foreign creators.\n"
+ "-e|--exclude=<name/uuid> don't save the inventory item in archive" + Environment.NewLine
+ "-f|--excludefolder=<folder/uuid> don't save contents of the folder in archive" + Environment.NewLine
+ "-v|--verbose extra debug messages.\n" + "-v|--verbose extra debug messages.\n"
+ "--noassets stops assets being saved to the IAR.", + "--noassets stops assets being saved to the IAR.",
HandleSaveInvConsoleCommand); HandleSaveInvConsoleCommand);
@ -398,6 +400,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
ops.Add("v|verbose", delegate(string v) { options["verbose"] = v; }); ops.Add("v|verbose", delegate(string v) { options["verbose"] = v; });
ops.Add("c|creators", delegate(string v) { options["creators"] = v; }); ops.Add("c|creators", delegate(string v) { options["creators"] = v; });
ops.Add("noassets", delegate(string v) { options["noassets"] = v != null; }); ops.Add("noassets", delegate(string v) { options["noassets"] = v != null; });
ops.Add("e|exclude=", delegate(string v)
{
if (!options.ContainsKey("exclude"))
options["exclude"] = new List<String>();
((List<String>)options["exclude"]).Add(v);
});
ops.Add("f|excludefolder=", delegate(string v)
{
if (!options.ContainsKey("excludefolders"))
options["excludefolders"] = new List<String>();
((List<String>)options["excludefolders"]).Add(v);
});
List<string> mainParams = ops.Parse(cmdparams); List<string> mainParams = ops.Parse(cmdparams);
@ -406,7 +420,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
if (mainParams.Count < 6) if (mainParams.Count < 6)
{ {
m_log.Error( m_log.Error(
"[INVENTORY ARCHIVER]: usage is save iar [-h|--home=<url>] [--noassets] <first name> <last name> <inventory path> <user password> [<save file path>] [-c|--creators] [-v|--verbose]"); "[INVENTORY ARCHIVER]: save iar [-h|--home=<url>] [--noassets] <first> <last> <inventory path> <password> [<IAR path>] [-c|--creators] [-e|--exclude=<name/uuid>] [-f|--excludefolder=<foldername/uuid>] [-v|--verbose]");
return; return;
} }

View File

@ -0,0 +1,65 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Reflection;
using System.Threading;
using NUnit.Framework;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
namespace OpenSim.Region.Framework.Scenes.Tests
{
/// <summary>
/// Spatial scene object tests (will eventually cover root and child part position, rotation properties, etc.)
/// </summary>
[TestFixture]
public class SceneObjectSpatialTests
{
[Test]
public void TestGetRootPartPosition()
{
TestHelpers.InMethod();
Scene scene = SceneHelpers.SetupScene();
UUID ownerId = TestHelpers.ParseTail(0x1);
Vector3 partPosition = new Vector3(10, 20, 30);
SceneObjectGroup so
= SceneHelpers.CreateSceneObject(1, ownerId, "obj1", 0x10);
so.AbsolutePosition = partPosition;
scene.AddNewSceneObject(so, false);
Assert.That(so.AbsolutePosition, Is.EqualTo(partPosition));
Assert.That(so.RootPart.AbsolutePosition, Is.EqualTo(partPosition));
}
}
}

View File

@ -12019,6 +12019,40 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return 1; return 1;
} }
public LSL_Integer llGetMemoryLimit()
{
m_host.AddScriptLPS(1);
// The value returned for LSO scripts in SL
return 16384;
}
public LSL_Integer llSetMemoryLimit(LSL_Integer limit)
{
m_host.AddScriptLPS(1);
// Treat as an LSO script
return ScriptBaseClass.FALSE;
}
public LSL_Integer llGetSPMaxMemory()
{
m_host.AddScriptLPS(1);
// The value returned for LSO scripts in SL
return 16384;
}
public virtual LSL_Integer llGetUsedMemory()
{
m_host.AddScriptLPS(1);
// The value returned for LSO scripts in SL
return 16384;
}
public void llScriptProfiler(LSL_Integer flags)
{
m_host.AddScriptLPS(1);
// This does nothing for LSO scripts in SL
}
#region Not Implemented #region Not Implemented
// //
// Listing the unimplemented lsl functions here, please move // Listing the unimplemented lsl functions here, please move
@ -12031,25 +12065,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
NotImplemented("llGetEnv"); NotImplemented("llGetEnv");
} }
public void llGetSPMaxMemory()
{
m_host.AddScriptLPS(1);
NotImplemented("llGetSPMaxMemory");
}
public virtual LSL_Integer llGetUsedMemory()
{
m_host.AddScriptLPS(1);
NotImplemented("llGetUsedMemory");
return 0;
}
public void llScriptProfiler(LSL_Integer flags)
{
m_host.AddScriptLPS(1);
//NotImplemented("llScriptProfiler");
}
public void llSetSoundQueueing(int queue) public void llSetSoundQueueing(int queue)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);

View File

@ -149,6 +149,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_Rotation llGetLocalRot(); LSL_Rotation llGetLocalRot();
LSL_Float llGetMass(); LSL_Float llGetMass();
LSL_Float llGetMassMKS(); LSL_Float llGetMassMKS();
LSL_Integer llGetMemoryLimit();
void llGetNextEmail(string address, string subject); void llGetNextEmail(string address, string subject);
LSL_String llGetNotecardLine(string name, int line); LSL_String llGetNotecardLine(string name, int line);
LSL_Key llGetNumberOfNotecardLines(string name); LSL_Key llGetNumberOfNotecardLines(string name);
@ -187,6 +188,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_String llGetScriptName(); LSL_String llGetScriptName();
LSL_Integer llGetScriptState(string name); LSL_Integer llGetScriptState(string name);
LSL_String llGetSimulatorHostname(); LSL_String llGetSimulatorHostname();
LSL_Integer llGetSPMaxMemory();
LSL_Integer llGetStartParameter(); LSL_Integer llGetStartParameter();
LSL_Integer llGetStatus(int status); LSL_Integer llGetStatus(int status);
LSL_String llGetSubString(string src, int start, int end); LSL_String llGetSubString(string src, int start, int end);
@ -322,6 +324,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void llSay(int channelID, string text); void llSay(int channelID, string text);
void llScaleTexture(double u, double v, int face); void llScaleTexture(double u, double v, int face);
LSL_Integer llScriptDanger(LSL_Vector pos); LSL_Integer llScriptDanger(LSL_Vector pos);
void llScriptProfiler(LSL_Integer flag);
LSL_Key llSendRemoteData(string channel, string dest, int idata, string sdata); LSL_Key llSendRemoteData(string channel, string dest, int idata, string sdata);
void llSensor(string name, string id, int type, double range, double arc); void llSensor(string name, string id, int type, double range, double arc);
void llSensorRemove(); void llSensorRemove();
@ -345,6 +348,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void llSetLinkTexture(int linknumber, string texture, int face); void llSetLinkTexture(int linknumber, string texture, int face);
void llSetLinkTextureAnim(int linknum, int mode, int face, int sizex, int sizey, double start, double length, double rate); void llSetLinkTextureAnim(int linknum, int mode, int face, int sizex, int sizey, double start, double length, double rate);
void llSetLocalRot(LSL_Rotation rot); void llSetLocalRot(LSL_Rotation rot);
LSL_Integer llSetMemoryLimit(LSL_Integer limit);
void llSetObjectDesc(string desc); void llSetObjectDesc(string desc);
void llSetObjectName(string name); void llSetObjectName(string name);
void llSetObjectPermMask(int mask, int value); void llSetObjectPermMask(int mask, int value);

View File

@ -383,6 +383,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const int PRIM_SCULPT_FLAG_INVERT = 64; public const int PRIM_SCULPT_FLAG_INVERT = 64;
public const int PRIM_SCULPT_FLAG_MIRROR = 128; public const int PRIM_SCULPT_FLAG_MIRROR = 128;
public const int PROFILE_NONE = 0;
public const int PROFILE_SCRIPT_MEMORY = 1;
public const int MASK_BASE = 0; public const int MASK_BASE = 0;
public const int MASK_OWNER = 1; public const int MASK_OWNER = 1;
public const int MASK_GROUP = 2; public const int MASK_GROUP = 2;

View File

@ -586,6 +586,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_LSL_Functions.llGetMassMKS(); return m_LSL_Functions.llGetMassMKS();
} }
public LSL_Integer llGetMemoryLimit()
{
return m_LSL_Functions.llGetMemoryLimit();
}
public void llGetNextEmail(string address, string subject) public void llGetNextEmail(string address, string subject)
{ {
m_LSL_Functions.llGetNextEmail(address, subject); m_LSL_Functions.llGetNextEmail(address, subject);
@ -776,6 +781,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_LSL_Functions.llGetSimulatorHostname(); return m_LSL_Functions.llGetSimulatorHostname();
} }
public LSL_Integer llGetSPMaxMemory()
{
return m_LSL_Functions.llGetSPMaxMemory();
}
public LSL_Integer llGetStartParameter() public LSL_Integer llGetStartParameter()
{ {
return m_LSL_Functions.llGetStartParameter(); return m_LSL_Functions.llGetStartParameter();
@ -1445,6 +1455,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_LSL_Functions.llScriptDanger(pos); return m_LSL_Functions.llScriptDanger(pos);
} }
public void llScriptProfiler(LSL_Integer flags)
{
m_LSL_Functions.llScriptProfiler(flags);
}
public LSL_Key llSendRemoteData(string channel, string dest, int idata, string sdata) public LSL_Key llSendRemoteData(string channel, string dest, int idata, string sdata)
{ {
return m_LSL_Functions.llSendRemoteData(channel, dest, idata, sdata); return m_LSL_Functions.llSendRemoteData(channel, dest, idata, sdata);
@ -1555,6 +1570,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_LSL_Functions.llSetLocalRot(rot); m_LSL_Functions.llSetLocalRot(rot);
} }
public LSL_Integer llSetMemoryLimit(LSL_Integer limit)
{
return m_LSL_Functions.llSetMemoryLimit(limit);
}
public void llSetObjectDesc(string desc) public void llSetObjectDesc(string desc)
{ {
m_LSL_Functions.llSetObjectDesc(desc); m_LSL_Functions.llSetObjectDesc(desc);