From 47377f17c626515747f507014301c6c101791014 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 12 Jan 2012 23:46:43 +0000 Subject: [PATCH 1/4] Add missing assert to confirm owner delete succeeded to the end of TestOsNpcRemoveOwned() --- OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs index f0b28b22de..9d9fc514a3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs @@ -127,6 +127,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests npc = m_scene.GetScenePresence(npcId); + // Now the owner deleted it and it's gone + Assert.That(npc, Is.Null); } /// From 6e7154d55c4b5ab8dacd2bcbce3b5408470b7f48 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 13 Jan 2012 00:00:18 +0000 Subject: [PATCH 2/4] Removing osNpcCreateOwned(). Please use osNpcCreate(string user, string name, vector position, string notecard, int options) instead with option OS_NPC_CREATOR_OWNED Please note that correct option name is OS_NPC_CREATOR_OWNED not OS_NPC_CREATE_OWNED as mistakenly put in a previous commit. --- .../ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 6 ------ .../Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 1 - OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 5 ----- 3 files changed, 12 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 25e4789c3a..2c35f58b1e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -2077,12 +2077,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return retVal; } - public LSL_Key osNpcCreateOwned(string firstname, string lastname, LSL_Vector position, string notecard) - { - CheckThreatLevel(ThreatLevel.High, "osNpcCreateOwned"); - return NpcCreate(firstname, lastname, position, notecard, true); - } - public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard) { CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index ddfc20d8e2..af6be5f78b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -173,7 +173,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces key osNpcCreate(string user, string name, vector position, string notecard); key osNpcCreate(string user, string name, vector position, string notecard, int options); - key osNpcCreateOwned(string user, string name, vector position, string notecard); LSL_Key osNpcSaveAppearance(key npc, string notecard); void osNpcLoadAppearance(key npc, string notecard); vector osNpcGetPos(key npc); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index ceccceb82c..0c05ea491c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -493,11 +493,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osNpcCreate(user, name, position, cloneFrom, options); } - public key osNpcCreateOwned(string user, string name, vector position, key cloneFrom) - { - return m_OSSL_Functions.osNpcCreateOwned(user, name, position, cloneFrom); - } - public key osNpcSaveAppearance(key npc, string notecard) { return m_OSSL_Functions.osNpcSaveAppearance(npc, notecard); From 3b59af222580e6d6e1a938ab622961285bd6903c Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 13 Jan 2012 00:03:39 +0000 Subject: [PATCH 3/4] Change the default osNpcCreate() to create an 'owned' npc rather than an 'unowned' one. An owned NPC is one that only the original creator can manipulate and delete. An unowned NPC is one that anybody with access to the osNpc* methods and knowledge of the avatar id can manipulate. This is to correct an oversight I made in the original reimplementation where I mistakenly assumed that avatar IDs could be treated as private. I am not anticipating that many people were deliberately making use of unowned npcs due to their insecure nature. If you do need an unowned NPC please call the new overloaded osCreateNpc() function with the option OS_NPC_NOT_OWNED. --- .../Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 2c35f58b1e..40d9d6f47d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -2080,7 +2080,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard) { CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); - return NpcCreate(firstname, lastname, position, notecard, false); + return NpcCreate(firstname, lastname, position, notecard, true); } public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, int options) From d40ec1c346d4b5f5999218bf1cbffe9cee1ea992 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Thu, 12 Jan 2012 20:49:50 -0500 Subject: [PATCH 4/4] Move some interfaces to a more apropriate place --- .../{Framework => Region/Framework/Interfaces}/IProfileModule.cs | 0 .../{Framework => Region/Framework/Interfaces}/ISearchModule.cs | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename OpenSim/{Framework => Region/Framework/Interfaces}/IProfileModule.cs (100%) rename OpenSim/{Framework => Region/Framework/Interfaces}/ISearchModule.cs (100%) diff --git a/OpenSim/Framework/IProfileModule.cs b/OpenSim/Region/Framework/Interfaces/IProfileModule.cs similarity index 100% rename from OpenSim/Framework/IProfileModule.cs rename to OpenSim/Region/Framework/Interfaces/IProfileModule.cs diff --git a/OpenSim/Framework/ISearchModule.cs b/OpenSim/Region/Framework/Interfaces/ISearchModule.cs similarity index 100% rename from OpenSim/Framework/ISearchModule.cs rename to OpenSim/Region/Framework/Interfaces/ISearchModule.cs