From bec100a662f2734b5da0cc8d4fb731da019b4304 Mon Sep 17 00:00:00 2001
From: Mic Bowman
Date: Wed, 25 Apr 2012 09:51:30 -0700
Subject: Add try/catch around Json script method registration to avoild some
issues with .NET 3.5 vs 4.0 differences.
See http://opensimulator.org/mantis/view.php?id=5971
---
.../Scripting/JsonStore/JsonStoreScriptModule.cs | 39 +++++++++++++---------
1 file changed, 24 insertions(+), 15 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs
index eda2aef..4949097 100644
--- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs
@@ -163,28 +163,37 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
return;
}
- m_comms.RegisterScriptInvocation(this,"JsonCreateStore");
- m_comms.RegisterScriptInvocation(this,"JsonDestroyStore");
+ try
+ {
+ m_comms.RegisterScriptInvocation(this,"JsonCreateStore");
+ m_comms.RegisterScriptInvocation(this,"JsonDestroyStore");
- m_comms.RegisterScriptInvocation(this,"JsonReadNotecard");
- m_comms.RegisterScriptInvocation(this,"JsonWriteNotecard");
+ m_comms.RegisterScriptInvocation(this,"JsonReadNotecard");
+ m_comms.RegisterScriptInvocation(this,"JsonWriteNotecard");
- m_comms.RegisterScriptInvocation(this,"JsonTestPath");
- m_comms.RegisterScriptInvocation(this,"JsonTestPathJson");
+ m_comms.RegisterScriptInvocation(this,"JsonTestPath");
+ m_comms.RegisterScriptInvocation(this,"JsonTestPathJson");
- m_comms.RegisterScriptInvocation(this,"JsonGetValue");
- m_comms.RegisterScriptInvocation(this,"JsonGetValueJson");
+ m_comms.RegisterScriptInvocation(this,"JsonGetValue");
+ m_comms.RegisterScriptInvocation(this,"JsonGetValueJson");
- m_comms.RegisterScriptInvocation(this,"JsonTakeValue");
- m_comms.RegisterScriptInvocation(this,"JsonTakeValueJson");
+ m_comms.RegisterScriptInvocation(this,"JsonTakeValue");
+ m_comms.RegisterScriptInvocation(this,"JsonTakeValueJson");
- m_comms.RegisterScriptInvocation(this,"JsonReadValue");
- m_comms.RegisterScriptInvocation(this,"JsonReadValueJson");
+ m_comms.RegisterScriptInvocation(this,"JsonReadValue");
+ m_comms.RegisterScriptInvocation(this,"JsonReadValueJson");
- m_comms.RegisterScriptInvocation(this,"JsonSetValue");
- m_comms.RegisterScriptInvocation(this,"JsonSetValueJson");
+ m_comms.RegisterScriptInvocation(this,"JsonSetValue");
+ m_comms.RegisterScriptInvocation(this,"JsonSetValueJson");
- m_comms.RegisterScriptInvocation(this,"JsonRemoveValue");
+ m_comms.RegisterScriptInvocation(this,"JsonRemoveValue");
+ }
+ catch (Exception e)
+ {
+ // See http://opensimulator.org/mantis/view.php?id=5971 for more information
+ m_log.WarnFormat("[JsonStroreScripts] script method registration failed; {0}",e.Message);
+ m_enabled = false;
+ }
}
}
--
cgit v1.1
From 88553bb884c5c8849ec61362e65fe0950c1e3080 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Wed, 25 Apr 2012 19:09:22 +0100
Subject: Port Avination link order to make OpenSim behave like SL. Make
Primstar scripts work. Fixes Mantis #5990
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 42 ++++++++++++++++++++--
.../Shared/Api/Implementation/LSL_Api.cs | 12 ++++---
2 files changed, 47 insertions(+), 7 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 49a3485..2686004 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1969,6 +1969,11 @@ namespace OpenSim.Region.Framework.Scenes
/// The group of prims which should be linked to this group
public void LinkToGroup(SceneObjectGroup objectGroup)
{
+ LinkToGroup(objectGroup, false);
+ }
+
+ public void LinkToGroup(SceneObjectGroup objectGroup, bool insert)
+ {
// m_log.DebugFormat(
// "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}",
// objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
@@ -1979,6 +1984,10 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart linkPart = objectGroup.m_rootPart;
+ // physics flags from group to be applied to linked parts
+ bool grpusephys = UsesPhysics;
+ bool grptemporary = IsTemporary;
+
Vector3 oldGroupPosition = linkPart.GroupPosition;
Quaternion oldRootRotation = linkPart.RotationOffset;
@@ -2002,15 +2011,35 @@ namespace OpenSim.Region.Framework.Scenes
lock (m_parts.SyncRoot)
{
- int linkNum = PrimCount + 1;
+ int linkNum;
+ if (insert)
+ {
+ linkNum = 2;
+ foreach (SceneObjectPart part in Parts)
+ {
+ if (part.LinkNum > 1)
+ part.LinkNum++;
+ }
+ }
+ else
+ {
+ linkNum = PrimCount + 1;
+ }
m_parts.Add(linkPart.UUID, linkPart);
linkPart.SetParent(this);
linkPart.CreateSelected = true;
+ // let physics know preserve part volume dtc messy since UpdatePrimFlags doesn't look to parent changes for now
+ linkPart.UpdatePrimFlags(grpusephys, grptemporary, (IsPhantom || (linkPart.Flags & PrimFlags.Phantom) != 0), linkPart.VolumeDetectActive);
+ if (linkPart.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical)
+ {
+ linkPart.PhysActor.link(m_rootPart.PhysActor);
+ this.Scene.PhysicsScene.AddPhysicsActorTaint(linkPart.PhysActor);
+ }
+
linkPart.LinkNum = linkNum++;
- linkPart.UpdatePrimFlags(UsesPhysics, IsTemporary, IsPhantom, IsVolumeDetect);
SceneObjectPart[] ogParts = objectGroup.Parts;
Array.Sort(ogParts, delegate(SceneObjectPart a, SceneObjectPart b)
@@ -2022,7 +2051,16 @@ namespace OpenSim.Region.Framework.Scenes
{
SceneObjectPart part = ogParts[i];
if (part.UUID != objectGroup.m_rootPart.UUID)
+ {
LinkNonRootPart(part, oldGroupPosition, oldRootRotation, linkNum++);
+ // let physics know
+ part.UpdatePrimFlags(grpusephys, grptemporary, (IsPhantom || (part.Flags & PrimFlags.Phantom) != 0), part.VolumeDetectActive);
+ if (part.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical)
+ {
+ part.PhysActor.link(m_rootPart.PhysActor);
+ this.Scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor);
+ }
+ }
part.ClearUndoState();
}
}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index d4c872c..d641958 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -832,8 +832,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llRegionSayTo(string target, int channel, string msg)
{
- string error = String.Empty;
-
if (msg.Length > 1023)
msg = msg.Substring(0, 1023);
@@ -3548,7 +3546,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llCreateLink(string target, int parent)
{
m_host.AddScriptLPS(1);
-
UUID targetID;
if (!UUID.TryParse(target, out targetID))
@@ -3572,11 +3569,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (targetPart.ParentGroup.AttachmentPoint != 0)
return; // Fail silently if attached
+
+ if (targetPart.ParentGroup.RootPart.OwnerID != m_host.ParentGroup.RootPart.OwnerID)
+ return;
+
SceneObjectGroup parentPrim = null, childPrim = null;
if (targetPart != null)
{
- if (parent != 0) {
+ if (parent != 0)
+ {
parentPrim = m_host.ParentGroup;
childPrim = targetPart.ParentGroup;
}
@@ -3588,7 +3590,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// Required for linking
childPrim.RootPart.ClearUpdateSchedule();
- parentPrim.LinkToGroup(childPrim);
+ parentPrim.LinkToGroup(childPrim, true);
}
parentPrim.TriggerScriptChangedEvent(Changed.LINK);
--
cgit v1.1
From a2d544c9383391f483bdfb82026e2ebc9c88388f Mon Sep 17 00:00:00 2001
From: Mic Bowman
Date: Wed, 25 Apr 2012 11:54:57 -0700
Subject: Add a configuration switch to turn on/off the use of the trash folder
when deleting objects from a scene. The use of the trash folder causes assets
to be created and stored everytime you delete an object from the scene (slows
down the delete and adds mostly useless assets to your database).
Default is on (use the trash folder) which is the standard behavior.
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 2 +-
OpenSim/Region/Framework/Scenes/Scene.cs | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 10b25ed..816d3b6 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1988,7 +1988,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- if (permissionToTake)
+ if (permissionToTake && (action != DeRezAction.Delete || this.m_useTrashOnDelete))
{
m_asyncSceneObjectDeleter.DeleteToInventory(
action, destinationID, deleteGroups, remoteClient,
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index a87dfb7..7a2b2ed 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -103,6 +103,7 @@ namespace OpenSim.Region.Framework.Scenes
public bool m_trustBinaries;
public bool m_allowScriptCrossings;
public bool m_useFlySlow;
+ public bool m_useTrashOnDelete = true;
///
/// Temporarily setting to trigger appearance resends at 60 second intervals.
@@ -709,6 +710,7 @@ namespace OpenSim.Region.Framework.Scenes
m_clampPrimSize = true;
}
+ m_useTrashOnDelete = startupConfig.GetBoolean("UseTrashOnDelete",m_useTrashOnDelete);
m_trustBinaries = startupConfig.GetBoolean("TrustBinaries", m_trustBinaries);
m_allowScriptCrossings = startupConfig.GetBoolean("AllowScriptCrossing", m_allowScriptCrossings);
m_dontPersistBefore =
--
cgit v1.1
From 74dbfe6bb5cebf0ea2af5cb80ff03a15a12e125e Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 25 Apr 2012 23:46:42 +0100
Subject: Comment out avatar move to target message for now.
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index e8178ce..7a94215 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1690,9 +1690,9 @@ namespace OpenSim.Region.Framework.Scenes
if (pos.Z - terrainHeight < 0.2)
pos.Z = terrainHeight;
- m_log.DebugFormat(
- "[SCENE PRESENCE]: Avatar {0} set move to target {1} (terrain height {2}) in {3}",
- Name, pos, terrainHeight, m_scene.RegionInfo.RegionName);
+// m_log.DebugFormat(
+// "[SCENE PRESENCE]: Avatar {0} set move to target {1} (terrain height {2}) in {3}",
+// Name, pos, terrainHeight, m_scene.RegionInfo.RegionName);
if (noFly)
Flying = false;
--
cgit v1.1
From e52fe03fffc908c4a3387ba77a204ec19f9ed9d4 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 26 Apr 2012 00:42:37 +0100
Subject: minor: Add avatar name to removing agent log message
---
OpenSim/Region/Framework/Scenes/Scene.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 7a2b2ed..a46c827 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3217,8 +3217,8 @@ namespace OpenSim.Region.Framework.Scenes
try
{
m_log.DebugFormat(
- "[SCENE]: Removing {0} agent {1} from region {2}",
- (isChildAgent ? "child" : "root"), agentID, RegionInfo.RegionName);
+ "[SCENE]: Removing {0} agent {1} {2} from region {2}",
+ (isChildAgent ? "child" : "root"), avatar.Name, agentID, RegionInfo.RegionName);
m_sceneGraph.removeUserCount(!isChildAgent);
--
cgit v1.1
From b0cbf16c19495814920e138deba4d1bb47615582 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 26 Apr 2012 16:04:49 +0100
Subject: minor: Add region name to dropped inbound packet message
---
OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index fb6b11e..d05f72f 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -1350,7 +1350,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
else
{
- m_log.DebugFormat("[LLUDPSERVER]: Dropping incoming {0} packet for dead client {1}", packet.Type, udpClient.AgentID);
+ m_log.DebugFormat(
+ "[LLUDPSERVER]: Dropped incoming {0} for dead client {1} in {2}",
+ packet.Type, udpClient.AgentID, m_scene.RegionInfo.RegionName);
}
}
--
cgit v1.1
From f49912f92abfae79ba00da74fc7665548266f7cd Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 26 Apr 2012 16:10:24 +0100
Subject: minor: Add more detail to unauthorized caps client message
---
OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index 8ec2f20..e20c24f 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -235,7 +235,10 @@ namespace OpenSim.Region.ClientStack.Linden
if (!m_Scene.CheckClient(m_HostCapsObj.AgentID, httpRequest.RemoteIPEndPoint))
{
- m_log.DebugFormat("[CAPS]: Unauthorized CAPS client");
+ m_log.DebugFormat(
+ "[CAPS]: Unauthorized CAPS client {0} from {1}",
+ m_HostCapsObj.AgentID, httpRequest.RemoteIPEndPoint);
+
return string.Empty;
}
--
cgit v1.1
From ca228c4770660096bde98fb603e7e295808a2133 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 26 Apr 2012 16:20:53 +0100
Subject: Comment out old Scene.HandleLogOffUserFromGrid() to reduce client
closing analysis complexity
---
OpenSim/Region/Framework/Scenes/Scene.cs | 70 ++++++++++++++++----------------
1 file changed, 35 insertions(+), 35 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index a46c827..dacd9b6 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3796,41 +3796,41 @@ namespace OpenSim.Region.Framework.Scenes
return m_authenticateHandler.TryChangeCiruitCode(oldcc, newcc);
}
- ///
- /// The Grid has requested that we log-off a user. Log them off.
- ///
- /// Unique ID of the avatar to log-off
- /// SecureSessionID of the user, or the RegionSecret text when logging on to the grid
- /// message to display to the user. Reason for being logged off
- public void HandleLogOffUserFromGrid(UUID AvatarID, UUID RegionSecret, string message)
- {
- ScenePresence loggingOffUser = GetScenePresence(AvatarID);
- if (loggingOffUser != null)
- {
- UUID localRegionSecret = UUID.Zero;
- bool parsedsecret = UUID.TryParse(m_regInfo.regionSecret, out localRegionSecret);
-
- // Region Secret is used here in case a new sessionid overwrites an old one on the user server.
- // Will update the user server in a few revisions to use it.
-
- if (RegionSecret == loggingOffUser.ControllingClient.SecureSessionId || (parsedsecret && RegionSecret == localRegionSecret))
- {
- m_sceneGridService.SendCloseChildAgentConnections(loggingOffUser.UUID, loggingOffUser.KnownRegionHandles);
- loggingOffUser.ControllingClient.Kick(message);
- // Give them a second to receive the message!
- Thread.Sleep(1000);
- loggingOffUser.ControllingClient.Close();
- }
- else
- {
- m_log.Info("[USERLOGOFF]: System sending the LogOff user message failed to sucessfully authenticate");
- }
- }
- else
- {
- m_log.InfoFormat("[USERLOGOFF]: Got a logoff request for {0} but the user isn't here. The user might already have been logged out", AvatarID.ToString());
- }
- }
+// ///
+// /// The Grid has requested that we log-off a user. Log them off.
+// ///
+// /// Unique ID of the avatar to log-off
+// /// SecureSessionID of the user, or the RegionSecret text when logging on to the grid
+// /// message to display to the user. Reason for being logged off
+// public void HandleLogOffUserFromGrid(UUID AvatarID, UUID RegionSecret, string message)
+// {
+// ScenePresence loggingOffUser = GetScenePresence(AvatarID);
+// if (loggingOffUser != null)
+// {
+// UUID localRegionSecret = UUID.Zero;
+// bool parsedsecret = UUID.TryParse(m_regInfo.regionSecret, out localRegionSecret);
+//
+// // Region Secret is used here in case a new sessionid overwrites an old one on the user server.
+// // Will update the user server in a few revisions to use it.
+//
+// if (RegionSecret == loggingOffUser.ControllingClient.SecureSessionId || (parsedsecret && RegionSecret == localRegionSecret))
+// {
+// m_sceneGridService.SendCloseChildAgentConnections(loggingOffUser.UUID, loggingOffUser.KnownRegionHandles);
+// loggingOffUser.ControllingClient.Kick(message);
+// // Give them a second to receive the message!
+// Thread.Sleep(1000);
+// loggingOffUser.ControllingClient.Close();
+// }
+// else
+// {
+// m_log.Info("[USERLOGOFF]: System sending the LogOff user message failed to sucessfully authenticate");
+// }
+// }
+// else
+// {
+// m_log.InfoFormat("[USERLOGOFF]: Got a logoff request for {0} but the user isn't here. The user might already have been logged out", AvatarID.ToString());
+// }
+// }
///
/// Triggered when an agent crosses into this sim. Also happens on initial login.
--
cgit v1.1
From b8114d2b67c8ae8d7551a2ece2177f8b7e958112 Mon Sep 17 00:00:00 2001
From: Talun
Date: Tue, 24 Apr 2012 21:54:13 +0100
Subject: Add a version of osNpcSay that takes a channel number Mantis 5747
osNpcSay(UUID npc, string message) left untouched
New functions:-
osNpcSay(UUID npc, int channel, string message)
osNpcShout(UUID npc, int channel, string message)
osNpcWhisper(UUID npc, int channel, string message)
Signed-off-by: BlueWall
---
OpenSim/Region/Framework/Interfaces/INPCModule.cs | 30 +++++++++++++++
.../Region/OptionalModules/World/NPC/NPCAvatar.cs | 21 +++++++----
.../Region/OptionalModules/World/NPC/NPCModule.cs | 43 +++++++++++++++++++++-
.../Shared/Api/Implementation/OSSL_Api.cs | 41 ++++++++++++++++++++-
.../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 3 ++
.../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 16 ++++++++
6 files changed, 144 insertions(+), 10 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs
index dc3ff89..b4dc3c3 100644
--- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs
@@ -135,6 +135,36 @@ namespace OpenSim.Region.Framework.Interfaces
bool Say(UUID agentID, Scene scene, string text);
///
+ /// Get the NPC to say something.
+ ///
+ /// The UUID of the NPC
+ ///
+ ///
+ ///
+ /// True if the operation succeeded, false if there was no such agent or the agent was not an NPC
+ bool Say(UUID agentID, Scene scene, string text, int channel);
+
+ ///
+ /// Get the NPC to shout something.
+ ///
+ /// The UUID of the NPC
+ ///
+ ///
+ ///
+ /// True if the operation succeeded, false if there was no such agent or the agent was not an NPC
+ bool Shout(UUID agentID, Scene scene, string text, int channel);
+
+ ///
+ /// Get the NPC to whisper something.
+ ///
+ /// The UUID of the NPC
+ ///
+ ///
+ ///
+ /// True if the operation succeeded, false if there was no such agent or the agent was not an NPC
+ bool Whisper(UUID agentID, Scene scene, string text, int channel);
+
+ ///
/// Sit the NPC.
///
///
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 5ea5af7..e57e5e6 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -76,22 +76,27 @@ namespace OpenSim.Region.OptionalModules.World.NPC
public void Say(string message)
{
- SendOnChatFromClient(message, ChatTypeEnum.Say);
+ SendOnChatFromClient(0, message, ChatTypeEnum.Say);
}
- public void Shout(string message)
+ public void Say(int channel, string message)
{
- SendOnChatFromClient(message, ChatTypeEnum.Shout);
+ SendOnChatFromClient(channel, message, ChatTypeEnum.Say);
}
- public void Whisper(string message)
+ public void Shout(int channel, string message)
{
- SendOnChatFromClient(message, ChatTypeEnum.Whisper);
+ SendOnChatFromClient(channel, message, ChatTypeEnum.Shout);
+ }
+
+ public void Whisper(int channel, string message)
+ {
+ SendOnChatFromClient(channel, message, ChatTypeEnum.Whisper);
}
public void Broadcast(string message)
{
- SendOnChatFromClient(message, ChatTypeEnum.Broadcast);
+ SendOnChatFromClient(0, message, ChatTypeEnum.Broadcast);
}
public void GiveMoney(UUID target, int amount)
@@ -146,10 +151,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC
#region Internal Functions
- private void SendOnChatFromClient(string message, ChatTypeEnum chatType)
+ private void SendOnChatFromClient(int channel, string message, ChatTypeEnum chatType)
{
OSChatMessage chatFromClient = new OSChatMessage();
- chatFromClient.Channel = 0;
+ chatFromClient.Channel = channel;
chatFromClient.From = Name;
chatFromClient.Message = message;
chatFromClient.Position = StartPos;
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index 2b8379d..adc6f9c 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -212,6 +212,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC
public bool Say(UUID agentID, Scene scene, string text)
{
+ return Say(agentID, scene, text, 0);
+ }
+
+ public bool Say(UUID agentID, Scene scene, string text, int channel)
+ {
lock (m_avatars)
{
if (m_avatars.ContainsKey(agentID))
@@ -219,7 +224,25 @@ namespace OpenSim.Region.OptionalModules.World.NPC
ScenePresence sp;
scene.TryGetScenePresence(agentID, out sp);
- m_avatars[agentID].Say(text);
+ m_avatars[agentID].Say(channel, text);
+
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public bool Shout(UUID agentID, Scene scene, string text, int channel)
+ {
+ lock (m_avatars)
+ {
+ if (m_avatars.ContainsKey(agentID))
+ {
+ ScenePresence sp;
+ scene.TryGetScenePresence(agentID, out sp);
+
+ m_avatars[agentID].Shout(channel, text);
return true;
}
@@ -246,6 +269,24 @@ namespace OpenSim.Region.OptionalModules.World.NPC
return false;
}
+ public bool Whisper(UUID agentID, Scene scene, string text, int channel)
+ {
+ lock (m_avatars)
+ {
+ if (m_avatars.ContainsKey(agentID))
+ {
+ ScenePresence sp;
+ scene.TryGetScenePresence(agentID, out sp);
+
+ m_avatars[agentID].Whisper(channel, text);
+
+ return true;
+ }
+ }
+
+ return false;
+ }
+
public bool Stand(UUID agentID, Scene scene)
{
lock (m_avatars)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index fe94b79..890115d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -2531,6 +2531,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void osNpcSay(LSL_Key npc, string message)
{
+ osNpcSay(npc, 0, message);
+ }
+
+ public void osNpcSay(LSL_Key npc, int channel, string message)
+ {
CheckThreatLevel(ThreatLevel.High, "osNpcSay");
m_host.AddScriptLPS(1);
@@ -2542,7 +2547,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (!module.CheckPermissions(npcId, m_host.OwnerID))
return;
- module.Say(npcId, World, message);
+ module.Say(npcId, World, message, channel);
+ }
+ }
+
+ public void osNpcShout(LSL_Key npc, int channel, string message)
+ {
+ CheckThreatLevel(ThreatLevel.High, "osNpcShout");
+ m_host.AddScriptLPS(1);
+
+ INPCModule module = World.RequestModuleInterface();
+ if (module != null)
+ {
+ UUID npcId = new UUID(npc.m_string);
+
+ if (!module.CheckPermissions(npcId, m_host.OwnerID))
+ return;
+
+ module.Shout(npcId, World, message, channel);
}
}
@@ -2627,6 +2649,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
+ public void osNpcWhisper(LSL_Key npc, int channel, string message)
+ {
+ CheckThreatLevel(ThreatLevel.High, "osNpcWhisper");
+ m_host.AddScriptLPS(1);
+
+ INPCModule module = World.RequestModuleInterface();
+ if (module != null)
+ {
+ UUID npcId = new UUID(npc.m_string);
+
+ if (!module.CheckPermissions(npcId, m_host.OwnerID))
+ return;
+
+ module.Whisper(npcId, World, message, channel);
+ }
+ }
+
///
/// Save the current appearance of the script owner permanently to the named notecard.
///
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 545bbee..2d3e8e8 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -203,11 +203,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void osNpcSetRot(LSL_Key npc, rotation rot);
void osNpcStopMoveToTarget(LSL_Key npc);
void osNpcSay(key npc, string message);
+ void osNpcSay(key npc, int channel, string message);
+ void osNpcShout(key npc, int channel, string message);
void osNpcSit(key npc, key target, int options);
void osNpcStand(LSL_Key npc);
void osNpcRemove(key npc);
void osNpcPlayAnimation(LSL_Key npc, string animation);
void osNpcStopAnimation(LSL_Key npc, string animation);
+ void osNpcWhisper(key npc, int channel, string message);
LSL_Key osOwnerSaveAppearance(string notecard);
LSL_Key osAgentSaveAppearance(key agentId, string notecard);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index b94b9bf..e836959 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -569,6 +569,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osNpcSay(npc, message);
}
+ public void osNpcSay(key npc, int channel, string message)
+ {
+ m_OSSL_Functions.osNpcSay(npc, channel, message);
+ }
+
+
+ public void osNpcShout(key npc, int channel, string message)
+ {
+ m_OSSL_Functions.osNpcShout(npc, channel, message);
+ }
+
public void osNpcSit(LSL_Key npc, LSL_Key target, int options)
{
m_OSSL_Functions.osNpcSit(npc, target, options);
@@ -594,6 +605,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osNpcStopAnimation(npc, animation);
}
+ public void osNpcWhisper(key npc, int channel, string message)
+ {
+ m_OSSL_Functions.osNpcWhisper(npc, channel, message);
+ }
+
public LSL_Key osOwnerSaveAppearance(string notecard)
{
return m_OSSL_Functions.osOwnerSaveAppearance(notecard);
--
cgit v1.1
From cb6791fb30ce0fbe416f42d95b9737f9f30e02a7 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 26 Apr 2012 22:35:25 +0100
Subject: Tweak log messages on local region to region teleport path to help
with problem resolution.
---
.../Region/ClientStack/Linden/UDP/LLUDPServer.cs | 4 +-
.../EntityTransfer/EntityTransferModule.cs | 51 ++++++++++++++--------
.../EntityTransfer/HGEntityTransferModule.cs | 3 +-
.../Simulation/LocalSimulationConnector.cs | 10 ++---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 5 ++-
5 files changed, 48 insertions(+), 25 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index d05f72f..edf91cb 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -916,7 +916,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
UDPPacketBuffer buffer = (UDPPacketBuffer)array[0];
UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1];
- m_log.DebugFormat("[LLUDPSERVER]: Handling UseCircuitCode request from {0}", buffer.RemoteEndPoint);
+ m_log.DebugFormat(
+ "[LLUDPSERVER]: Handling UseCircuitCode request for circuit {0} from {1}",
+ uccp.CircuitCode.Code, buffer.RemoteEndPoint);
remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint;
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index a36d0fe..0f3ed27 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -178,7 +178,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
destinationRegionName = sp.Scene.RegionInfo.RegionName;
m_log.DebugFormat(
- "[ENTITY TRANSFER MODULE]: RequestTeleportToLocation for {0} to {1} within existing region {2}",
+ "[ENTITY TRANSFER MODULE]: Teleport for {0} to {1} within {2}",
sp.Name, position, destinationRegionName);
// Teleport within the same region
@@ -231,7 +231,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
GridRegion finalDestination = GetFinalDestination(reg);
if (finalDestination == null)
{
- m_log.WarnFormat("[ENTITY TRANSFER MODULE]: Final destination is having problems. Unable to teleport agent.");
+ m_log.WarnFormat(
+ "[ENTITY TRANSFER MODULE]: Final destination is having problems. Unable to teleport {0} {1}",
+ sp.Name, sp.UUID);
+
sp.ControllingClient.SendTeleportFailed("Problem at destination");
return;
}
@@ -320,10 +323,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
}
if (IsInTransit(sp.UUID)) // Avie is already on the way. Caller shouldn't do this.
+ {
+ m_log.DebugFormat(
+ "[ENTITY TRANSFER MODULE]: Ignoring teleport request of {0} {1} to {2} ({3}) {4}/{5} - agent is already in transit.",
+ sp.Name, sp.UUID, reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position);
+
return;
+ }
m_log.DebugFormat(
- "[ENTITY TRANSFER MODULE]: Request Teleport to {0} ({1}) {2}/{3}",
+ "[ENTITY TRANSFER MODULE]: Teleporting {0} {1} from {2} to {3} ({4}) {5}/{6}",
+ sp.Name, sp.UUID, sp.Scene.RegionInfo.RegionName,
reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position);
uint newRegionX = (uint)(reg.RegionHandle >> 40);
@@ -444,7 +454,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
}
-
SetInTransit(sp.UUID);
// Let's send a full update of the agent. This is a synchronous call.
@@ -656,7 +665,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
public virtual void TeleportHome(UUID id, IClientAPI client)
{
- m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName);
+ m_log.DebugFormat(
+ "[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.Name, client.AgentId);
//OpenSim.Services.Interfaces.PresenceInfo pinfo = m_aScene.PresenceService.GetAgent(client.SessionId);
GridUserInfo uinfo = m_aScene.GridUserService.GetGridUserInfo(client.AgentId.ToString());
@@ -671,14 +681,20 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
return;
}
- m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})",
- regionInfo.RegionName, regionInfo.RegionID, regionInfo.RegionLocX / Constants.RegionSize, regionInfo.RegionLocY / Constants.RegionSize);
+ m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Home region of {0} is {1} ({2}-{3})",
+ client.Name, regionInfo.RegionName, regionInfo.RegionCoordX, regionInfo.RegionCoordY);
// a little eekie that this goes back to Scene and with a forced cast, will fix that at some point...
((Scene)(client.Scene)).RequestTeleportLocation(
client, regionInfo.RegionHandle, uinfo.HomePosition, uinfo.HomeLookAt,
(uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome));
}
+ else
+ {
+ m_log.ErrorFormat(
+ "[ENTITY TRANSFER MODULE]: No grid user information found for {0} {1}. Cannot send home.",
+ client.Name, client.AgentId);
+ }
}
#endregion
@@ -1362,19 +1378,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// after a cross here
Thread.Sleep(500);
- Scene m_scene = sp.Scene;
+ Scene scene = sp.Scene;
- uint x, y;
- Utils.LongToUInts(reg.RegionHandle, out x, out y);
- x = x / Constants.RegionSize;
- y = y / Constants.RegionSize;
- m_log.Debug("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint + ")");
+ m_log.DebugFormat(
+ "[ENTITY TRANSFER MODULE]: Informing {0} {1} about neighbour {2} {3} at ({4},{5})",
+ sp.Name, sp.UUID, reg.RegionName, endPoint, reg.RegionCoordX, reg.RegionCoordY);
string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath);
string reason = String.Empty;
- bool regionAccepted = m_scene.SimulationService.CreateAgent(reg, a, (uint)TeleportFlags.Default, out reason);
+ bool regionAccepted = scene.SimulationService.CreateAgent(reg, a, (uint)TeleportFlags.Default, out reason);
if (regionAccepted && newAgent)
{
@@ -1391,7 +1405,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: {0} is sending {1} EnableSimulator for neighbour region {2} @ {3} " +
"and EstablishAgentCommunication with seed cap {4}",
- m_scene.RegionInfo.RegionName, sp.Name, reg.RegionName, reg.RegionHandle, capsPath);
+ scene.RegionInfo.RegionName, sp.Name, reg.RegionName, reg.RegionHandle, capsPath);
eq.EnableSimulator(reg.RegionHandle, endPoint, sp.UUID);
eq.EstablishAgentCommunication(sp.UUID, endPoint, capsPath);
@@ -1402,10 +1416,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// TODO: make Event Queue disablable!
}
- m_log.Debug("[ENTITY TRANSFER MODULE]: Completed inform client about neighbour " + endPoint.ToString());
+ m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Completed inform {0} {1} about neighbour {2}", sp.Name, sp.UUID, endPoint);
}
+
if (!regionAccepted)
- m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Region {0} did not accept agent: {1}", reg.RegionName, reason);
+ m_log.WarnFormat(
+ "[ENTITY TRANSFER MODULE]: Region {0} did not accept {1} {2}: {3}",
+ reg.RegionName, sp.Name, sp.UUID, reason);
}
///
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 634fb43..6696997 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -201,7 +201,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
public override void TeleportHome(UUID id, IClientAPI client)
{
- m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName);
+ m_log.DebugFormat(
+ "[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.Name, client.AgentId);
// Let's find out if this is a foreign user or a local user
IUserManagement uMan = m_aScene.RequestModuleInterface();
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
index 85e7e94..90f27c4 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
@@ -191,7 +191,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
{
if (s.RegionInfo.RegionHandle == destination.RegionHandle)
{
- m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Found region {0} to send SendCreateChildAgent", destination.RegionName);
+// m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Found region {0} to send SendCreateChildAgent", destination.RegionName);
return s.NewUserConnection(aCircuit, teleportFlags, out reason);
}
}
@@ -209,9 +209,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
{
if (s.RegionInfo.RegionHandle == destination.RegionHandle)
{
- m_log.DebugFormat(
- "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate",
- s.RegionInfo.RegionName, destination.RegionHandle);
+// m_log.DebugFormat(
+// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate",
+// s.RegionInfo.RegionName, destination.RegionHandle);
s.IncomingChildAgentDataUpdate(cAgentData);
return true;
@@ -281,7 +281,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
{
if (s.RegionInfo.RegionID == origin)
{
- m_log.Debug("[LOCAL COMMS]: Found region to SendReleaseAgent");
+// m_log.Debug("[LOCAL COMMS]: Found region to SendReleaseAgent");
AgentTransferModule.AgentArrivedAtDestination(id);
return true;
// return s.IncomingReleaseAgent(id);
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 7a94215..6b38027 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1142,7 +1142,10 @@ namespace OpenSim.Region.Framework.Scenes
if ((m_callbackURI != null) && !m_callbackURI.Equals(""))
{
- m_log.DebugFormat("[SCENE PRESENCE]: Releasing agent in URI {0}", m_callbackURI);
+ m_log.DebugFormat(
+ "[SCENE PRESENCE]: Releasing {0} {1} with callback to {2}",
+ client.Name, client.AgentId, m_callbackURI);
+
Scene.SimulationService.ReleaseAgent(m_originRegionID, UUID, m_callbackURI);
m_callbackURI = null;
}
--
cgit v1.1
From ee13d817f128c294dc05bddaa0bc9a643c48fe8d Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Mon, 23 Apr 2012 18:33:50 +0300
Subject: When creating an OAR, objects where the user is the Creator are
always included, regardless of their permissions.
The purpose of the permission checks is to prevent the unauthorized copying of assets, but users can always copy assets that they created.
---
.../CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
index 4d459bf..ab3cc41 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
@@ -297,10 +297,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver
if (checkPermissions.Contains("T") && !canTransfer)
partPermitted = false;
+ // If the user is the Creator of the object then it can always be included in the OAR
+ bool creator = (obj.CreatorID.Guid == user.Guid);
+ if (creator)
+ partPermitted = true;
+
//string name = (objGroup.PrimCount == 1) ? objGroup.Name : string.Format("{0} ({1}/{2})", obj.Name, primNumber, objGroup.PrimCount);
- //m_log.DebugFormat("[ARCHIVER]: Object permissions: {0}: Base={1:X4}, Owner={2:X4}, Everyone={3:X4}, permissionClass={4}, checkPermissions={5}, canCopy={6}, canTransfer={7}, permitted={8}",
+ //m_log.DebugFormat("[ARCHIVER]: Object permissions: {0}: Base={1:X4}, Owner={2:X4}, Everyone={3:X4}, permissionClass={4}, checkPermissions={5}, canCopy={6}, canTransfer={7}, creator={8}, permitted={9}",
// name, obj.BaseMask, obj.OwnerMask, obj.EveryoneMask,
- // permissionClass, checkPermissions, canCopy, canTransfer, permitted);
+ // permissionClass, checkPermissions, canCopy, canTransfer, creator, partPermitted);
if (!partPermitted)
{
--
cgit v1.1
From 8a65f5a70dea70073790c15ba2ae7739771f74b5 Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Mon, 23 Apr 2012 19:18:28 +0300
Subject: OSSL: Removed check for CanRunConsoleCommand() in osKickAvatar.
OSSL permissions are now controlled in OpenSim.ini.
---
.../Shared/Api/Implementation/OSSL_Api.cs | 25 +++++++++++-----------
1 file changed, 12 insertions(+), 13 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 893fda1..0d4ea19 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -351,7 +351,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
UUID ownerID = ti.OwnerID;
- //OSSL only may be used if objet is in the same group as the parcel
+ //OSSL only may be used if object is in the same group as the parcel
if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("PARCEL_GROUP_MEMBER"))
{
ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
@@ -729,11 +729,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1);
+ // For safety, we add another permission check here, and don't rely only on the standard OSSL permissions
if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
{
MainConsole.Instance.RunCommand(command);
return true;
}
+
return false;
}
@@ -2825,21 +2827,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
m_host.AddScriptLPS(1);
- if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
+ World.ForEachRootScenePresence(delegate(ScenePresence sp)
{
- World.ForEachRootScenePresence(delegate(ScenePresence sp)
+ if (sp.Firstname == FirstName && sp.Lastname == SurName)
{
- if (sp.Firstname == FirstName && sp.Lastname == SurName)
- {
- // kick client...
- if (alert != null)
- sp.ControllingClient.Kick(alert);
+ // kick client...
+ if (alert != null)
+ sp.ControllingClient.Kick(alert);
- // ...and close on our side
- sp.Scene.IncomingCloseAgent(sp.UUID);
- }
- });
- }
+ // ...and close on our side
+ sp.Scene.IncomingCloseAgent(sp.UUID);
+ }
+ });
}
public void osCauseDamage(string avatar, double damage)
--
cgit v1.1
From 07e62df5582e28675275b3f5143ec37e5697d283 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 27 Apr 2012 00:58:54 +0100
Subject: Add regression test for teleporting an agent between separated
regions on the same simulator.
This involves a large amount of change in test scene setup code to allow test scenes to share shared modules
SetupScene is now an instance method that requires an instantiation of SceneHelpers, though other SceneHelpers methods are still static
May split these out into separate classes in the future.
---
.../Caps/EventQueue/Tests/EventQueueTests.cs | 2 +-
.../Linden/UDP/Tests/BasicCircuitTests.cs | 2 +-
.../Linden/UDP/Tests/LLImageManagerTests.cs | 2 +-
.../Asset/Tests/FlotsamAssetCacheTests.cs | 2 +-
.../Attachments/Tests/AttachmentsModuleTests.cs | 2 +-
.../Tests/AvatarFactoryModuleTests.cs | 4 +-
.../Avatar/Friends/Tests/FriendModuleTests.cs | 2 +-
.../Archiver/Tests/InventoryArchiveTestCase.cs | 2 +-
.../Archiver/Tests/InventoryArchiverTests.cs | 2 +-
.../Avatar/Inventory/Archiver/Tests/PathTests.cs | 14 +-
.../EntityTransfer/EntityTransferModule.cs | 3 +-
.../Tests/InventoryAccessModuleTests.cs | 2 +-
.../World/Archiver/Tests/ArchiverTests.cs | 6 +-
.../World/Land/Tests/PrimCountModuleTests.cs | 2 +-
.../World/Media/Moap/Tests/MoapTests.cs | 2 +-
.../World/Serialiser/Tests/SerialiserTests.cs | 2 +-
OpenSim/Region/Framework/Scenes/Scene.cs | 8 +-
.../Framework/Scenes/Tests/EntityManagerTests.cs | 2 +-
.../Framework/Scenes/Tests/SceneGraphTests.cs | 2 +-
.../Scenes/Tests/SceneObjectBasicTests.cs | 10 +-
.../Scenes/Tests/SceneObjectDeRezTests.cs | 4 +-
.../Scenes/Tests/SceneObjectLinkingTests.cs | 10 +-
.../Scenes/Tests/SceneObjectResizeTests.cs | 4 +-
.../Scenes/Tests/SceneObjectScriptTests.cs | 2 +-
.../Scenes/Tests/SceneObjectSpatialTests.cs | 2 +-
.../Scenes/Tests/SceneObjectStatusTests.cs | 2 +-
.../Scenes/Tests/SceneObjectUserGroupTests.cs | 2 +-
.../Scenes/Tests/ScenePresenceAgentTests.cs | 18 ++-
.../Scenes/Tests/ScenePresenceAnimationTests.cs | 2 +-
.../Scenes/Tests/ScenePresenceAutopilotTests.cs | 2 +-
.../Scenes/Tests/ScenePresenceSitTests.cs | 2 +-
.../Scenes/Tests/ScenePresenceTeleportTests.cs | 177 ++++++---------------
.../Region/Framework/Scenes/Tests/SceneTests.cs | 2 +-
.../Framework/Scenes/Tests/TaskInventoryTests.cs | 8 +-
.../Framework/Scenes/Tests/UserInventoryTests.cs | 4 +-
.../Framework/Scenes/Tests/UuidGathererTests.cs | 2 +-
.../Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs | 2 +-
.../World/NPC/Tests/NPCModuleTests.cs | 2 +-
.../Shared/Tests/LSL_ApiInventoryTests.cs | 2 +-
.../ScriptEngine/Shared/Tests/LSL_ApiTest.cs | 4 +-
.../Shared/Tests/OSSL_ApiAppearanceTest.cs | 2 +-
.../ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs | 2 +-
.../ScriptEngine/XEngine/Tests/XEngineTest.cs | 2 +-
43 files changed, 126 insertions(+), 206 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs
index a5209b7..c25b58c 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs
@@ -60,7 +60,7 @@ namespace OpenSim.Region.ClientStack.Linden.Tests
CapabilitiesModule capsModule = new CapabilitiesModule();
EventQueueGetModule eqgModule = new EventQueueGetModule();
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(m_scene, config, capsModule, eqgModule);
}
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs
index a575e36..1321470 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/BasicCircuitTests.cs
@@ -158,7 +158,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
TestHelpers.InMethod();
// XmlConfigurator.Configure();
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
uint myCircuitCode = 123456;
UUID myAgentUuid = TestHelpers.ParseTail(0x1);
UUID mySessionUuid = TestHelpers.ParseTail(0x2);
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs
index 1b68d68..221f02b 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs
@@ -79,7 +79,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
J2KDecoderModule j2kdm = new J2KDecoderModule();
- scene = SceneHelpers.SetupScene();
+ scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(scene, j2kdm);
tc = new TestClient(SceneHelpers.GenerateAgentData(userId), scene);
diff --git a/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs b/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs
index 5adb845..c91b25f 100644
--- a/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs
+++ b/OpenSim/Region/CoreModules/Asset/Tests/FlotsamAssetCacheTests.cs
@@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.Asset.Tests
config.Configs["AssetCache"].Set("MemoryCacheEnabled", "true");
m_cache = new FlotsamAssetCache();
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(m_scene, config, m_cache);
}
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
index bfe5e4a..42d07fd 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
config.AddConfig("Modules");
config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");
- scene = SceneHelpers.SetupScene();
+ scene = new SceneHelpers().SetupScene();
m_attMod = new AttachmentsModule();
SceneHelpers.SetupSceneModules(scene, config, m_attMod, new BasicInventoryAccessModule());
}
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs
index 11a0a86..848b3bf 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs
@@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
UUID userId = TestHelpers.ParseTail(0x1);
AvatarFactoryModule afm = new AvatarFactoryModule();
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(scene, afm);
ScenePresence sp = SceneHelpers.AddScenePresence(scene, userId);
@@ -81,7 +81,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
CoreAssetCache assetCache = new CoreAssetCache();
AvatarFactoryModule afm = new AvatarFactoryModule();
- TestScene scene = SceneHelpers.SetupScene(assetCache);
+ TestScene scene = new SceneHelpers(assetCache).SetupScene();
SceneHelpers.SetupSceneModules(scene, afm);
ScenePresence sp = SceneHelpers.AddScenePresence(scene, userId);
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs
index 45b4264..7a197f7 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/Tests/FriendModuleTests.cs
@@ -78,7 +78,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends.Tests
config.AddConfig("FriendsService");
config.Configs["FriendsService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
m_fm = new FriendsModule();
SceneHelpers.SetupSceneModules(m_scene, config, m_fm);
}
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
index 19ef571..90ae69d 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
@@ -100,7 +100,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
// log4net.Config.XmlConfigurator.Configure();
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(scene, archiverModule);
UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire");
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index e409c8e..b112b6d 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -61,7 +61,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
SerialiserModule serialiserModule = new SerialiserModule();
m_archiverModule = new InventoryArchiverModule();
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule);
}
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
index 417c20c..6eb3605 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
@@ -62,7 +62,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(scene, archiverModule);
// Create user
@@ -179,7 +179,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
// Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
@@ -222,7 +222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
SerialiserModule serialiserModule = new SerialiserModule();
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "password");
@@ -247,7 +247,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(scene, archiverModule);
// Create user
@@ -326,7 +326,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
Dictionary foldersCreated = new Dictionary();
@@ -393,7 +393,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
TestHelpers.InMethod();
//log4net.Config.XmlConfigurator.Configure();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
string folder1ExistingName = "a";
@@ -444,7 +444,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
string folder1ExistingName = "a";
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 0f3ed27..a318a3c 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -597,7 +597,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
protected virtual void AgentHasMovedAway(ScenePresence sp, bool logout)
{
- sp.Scene.AttachmentsModule.DeleteAttachmentsFromScene(sp, true);
+ if (sp.Scene.AttachmentsModule != null)
+ sp.Scene.AttachmentsModule.DeleteAttachmentsFromScene(sp, true);
}
protected void KillEntity(Scene scene, uint localID)
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
index e74310c..d6afaa9 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
@@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests
config.AddConfig("Modules");
config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(m_scene, config, m_iam);
// Create user
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
index e05e8f6..053c6f5 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
@@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
SerialiserModule serialiserModule = new SerialiserModule();
TerrainModule terrainModule = new TerrainModule();
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule);
}
@@ -463,7 +463,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
SerialiserModule serialiserModule = new SerialiserModule();
TerrainModule terrainModule = new TerrainModule();
- TestScene scene2 = SceneHelpers.SetupScene();
+ TestScene scene2 = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(scene2, archiverModule, serialiserModule, terrainModule);
// Make sure there's a valid owner for the owner we saved (this should have been wiped if the code is
@@ -607,7 +607,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
SerialiserModule serialiserModule = new SerialiserModule();
TerrainModule terrainModule = new TerrainModule();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule);
m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false);
diff --git a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
index e553ffa..b5ee4d2 100644
--- a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
+++ b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
@@ -64,7 +64,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
{
m_pcm = new PrimCountModule();
LandManagementModule lmm = new LandManagementModule();
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(m_scene, lmm, m_pcm);
int xParcelDivider = (int)Constants.RegionSize - 1;
diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs b/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs
index 4326606..0545250 100644
--- a/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs
+++ b/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs
@@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap.Tests
public void SetUp()
{
m_module = new MoapModule();
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(m_scene, m_module);
}
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
index d1d2020..7825e3e 100644
--- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
+++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
@@ -343,7 +343,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
public void Init()
{
m_serialiserModule = new SerialiserModule();
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(m_scene, m_serialiserModule);
}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index dacd9b6..4d0aa6f 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -437,6 +437,7 @@ namespace OpenSim.Region.Framework.Scenes
{
if (m_simulationService == null)
m_simulationService = RequestModuleInterface();
+
return m_simulationService;
}
}
@@ -3217,7 +3218,7 @@ namespace OpenSim.Region.Framework.Scenes
try
{
m_log.DebugFormat(
- "[SCENE]: Removing {0} agent {1} {2} from region {2}",
+ "[SCENE]: Removing {0} agent {1} {2} from region {3}",
(isChildAgent ? "child" : "root"), avatar.Name, agentID, RegionInfo.RegionName);
m_sceneGraph.removeUserCount(!isChildAgent);
@@ -3879,7 +3880,10 @@ namespace OpenSim.Region.Framework.Scenes
ILandObject nearestParcel = GetNearestAllowedParcel(cAgentData.AgentID, Constants.RegionSize / 2, Constants.RegionSize / 2);
if (nearestParcel == null)
{
- m_log.DebugFormat("[SCENE]: Denying root agent entry to {0}: no allowed parcel", cAgentData.AgentID);
+ m_log.DebugFormat(
+ "[SCENE]: Denying root agent entry to {0} in {1}: no allowed parcel",
+ cAgentData.AgentID, RegionInfo.RegionName);
+
return false;
}
diff --git a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs
index a5d2b23..ea9fc93 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs
@@ -45,7 +45,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
{
static public Random random;
SceneObjectGroup found;
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
[Test]
public void T010_AddObjects()
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs
index 9a60e50..1c33a5f 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
public void TestDuplicateObject()
{
TestHelpers.InMethod();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
UUID ownerId = new UUID("00000000-0000-0000-0000-000000000010");
string part1Name = "part1";
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
index 7737d8e..453e077 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
@@ -88,7 +88,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
{
TestHelpers.InMethod();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
int partsToTestCount = 3;
SceneObjectGroup so
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
{
TestHelpers.InMethod();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
string obj1Name = "Alfred";
string obj2Name = "Betty";
@@ -152,7 +152,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
{
TestHelpers.InMethod();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
int partsToTestCount = 3;
SceneObjectGroup so
@@ -185,7 +185,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
{
TestHelpers.InMethod();
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
scene.DeleteSceneObject(part.ParentGroup, false);
@@ -204,7 +204,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001");
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
// Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
index 654b1a2..0076f41 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
@@ -61,7 +61,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
IConfigSource configSource = new IniConfigSource();
IConfig config = configSource.AddConfig("Startup");
config.Set("serverside_object_permissions", true);
@@ -100,7 +100,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
UUID objectOwnerId = UUID.Parse("20000000-0000-0000-0000-000000000001");
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
IConfigSource configSource = new IniConfigSource();
IConfig config = configSource.AddConfig("Startup");
config.Set("serverside_object_permissions", true);
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
index be5b4a8..1add3dd 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
@@ -55,7 +55,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
UUID ownerId = TestHelpers.ParseTail(0x1);
int nParts = 3;
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(nParts, ownerId, "TestLinkToSelf_", 0x10);
scene.AddSceneObject(sog1);
scene.LinkObjects(ownerId, sog1.LocalId, new List() { sog1.Parts[1].LocalId });
@@ -71,7 +71,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
bool debugtest = false;
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
SceneObjectPart part1 = SceneHelpers.AddSceneObject(scene);
SceneObjectGroup grp1 = part1.ParentGroup;
SceneObjectPart part2 = SceneHelpers.AddSceneObject(scene);
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
bool debugtest = false;
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
SceneObjectPart part1 = SceneHelpers.AddSceneObject(scene);
SceneObjectGroup grp1 = part1.ParentGroup;
SceneObjectPart part2 = SceneHelpers.AddSceneObject(scene);
@@ -286,7 +286,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
TestHelpers.InMethod();
//log4net.Config.XmlConfigurator.Configure();
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
string rootPartName = "rootpart";
UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001");
@@ -325,7 +325,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
TestHelpers.InMethod();
//log4net.Config.XmlConfigurator.Configure();
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
string rootPartName = "rootpart";
UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001");
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs
index b49c6e7..0a94c19 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
SceneObjectGroup g1 = SceneHelpers.AddSceneObject(scene).ParentGroup;
g1.GroupResize(new Vector3(2, 3, 4));
@@ -75,7 +75,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
TestHelpers.InMethod();
//log4net.Config.XmlConfigurator.Configure();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
SceneObjectGroup g1 = SceneHelpers.CreateSceneObject(2, UUID.Zero);
g1.RootPart.Scale = new Vector3(2, 3, 4);
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs
index c582cf6..d2361f8 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
// UUID itemId = TestHelpers.ParseTail(0x2);
string itemName = "Test Script Item";
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, userId);
scene.AddNewSceneObject(so, true);
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs
index 9fea3c6..6d255aa 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
[SetUp]
public void SetUp()
{
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
}
[Test]
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs
index 360566d..742c769 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
[SetUp]
public void Init()
{
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
m_so1 = SceneHelpers.CreateSceneObject(1, m_ownerId, "so1", 0x10);
m_so2 = SceneHelpers.CreateSceneObject(1, m_ownerId, "so2", 0x20);
}
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
index c13d82e..c7eaff9 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
IConfigSource configSource = new IniConfigSource();
IConfig startupConfig = configSource.AddConfig("Startup");
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
index ed9b179..2e46377 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
@@ -67,10 +67,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests
public void Init()
{
TestHelpers.InMethod();
-
- scene = SceneHelpers.SetupScene("Neighbour x", UUID.Random(), 1000, 1000);
- scene2 = SceneHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000);
- scene3 = SceneHelpers.SetupScene("Neighbour x-1", UUID.Random(), 999, 1000);
+
+ SceneHelpers sh = new SceneHelpers();
+
+ scene = sh.SetupScene("Neighbour x", UUID.Random(), 1000, 1000);
+ scene2 = sh.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000);
+ scene3 = sh.SetupScene("Neighbour x-1", UUID.Random(), 999, 1000);
ISharedRegionModule interregionComms = new LocalSimulationConnectorModule();
interregionComms.Initialise(new IniConfigSource());
@@ -101,7 +103,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));
Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Not.Null);
@@ -126,7 +128,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
IConfig config = configSource.AddConfig("Modules");
config.Set("SimulationServices", "LocalSimulationConnectorModule");
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(scene, configSource, lsc);
UUID agentId = TestHelpers.ParseTail(0x01);
@@ -176,8 +178,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests
// UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001");
- TestScene myScene1 = SceneHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000);
- TestScene myScene2 = SceneHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000);
+ TestScene myScene1 = new SceneHelpers().SetupScene("Neighbour y", UUID.Random(), 1000, 1000);
+ TestScene myScene2 = new SceneHelpers().SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000);
IConfigSource configSource = new IniConfigSource();
IConfig config = configSource.AddConfig("Startup");
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs
index 89f8007..646e5fa 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs
@@ -59,7 +59,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));
sp.Flying = true;
sp.PhysicsCollisionUpdate(new CollisionEventUpdate());
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs
index cfea10d..1d1ff88 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs
@@ -64,7 +64,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
[SetUp]
public void Init()
{
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
}
[Test]
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs
index b7b8db4..313e350 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
[SetUp]
public void Init()
{
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
m_sp = SceneHelpers.AddScenePresence(m_scene, TestHelpers.ParseTail(0x1));
}
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
index eb7bfbd..19542ff 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
@@ -61,7 +61,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
// Not strictly necessary since FriendsModule assumes it is the default (!)
config.Configs["Modules"].Set("EntityTransferModule", etm.Name);
- TestScene scene = SceneHelpers.SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
+ TestScene scene = new SceneHelpers().SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
SceneHelpers.SetupSceneModules(scene, config, etm);
Vector3 teleportPosition = new Vector3(10, 11, 12);
@@ -83,145 +83,58 @@ namespace OpenSim.Region.Framework.Scenes.Tests
// Assert.That(sp.Lookat, Is.EqualTo(teleportLookAt));
}
- ///
- /// Test a teleport between two regions that are not neighbours and do not share any neighbours in common.
- ///
- /// Does not yet do what is says on the tin.
- /// Commenting for now
- //[Test, LongRunning]
- public void TestSimpleNotNeighboursTeleport()
+ [Test]
+ public void TestSameSimulatorSeparatedRegionsTeleport()
{
TestHelpers.InMethod();
- ThreadRunResults results = new ThreadRunResults();
- results.Result = false;
- results.Message = "Test did not run";
- TestRunning testClass = new TestRunning(results);
+// log4net.Config.XmlConfigurator.Configure();
- Thread testThread = new Thread(testClass.run);
+ UUID userId = TestHelpers.ParseTail(0x1);
- // Seems kind of redundant to start a thread and then join it, however.. We need to protect against
- // A thread abort exception in the simulator code.
- testThread.Start();
- testThread.Join();
+ EntityTransferModule etm = new EntityTransferModule();
+ LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule();
- Assert.That(testClass.results.Result, Is.EqualTo(true), testClass.results.Message);
- // Console.WriteLine("Beginning test {0}", MethodBase.GetCurrentMethod());
- }
+ IConfigSource config = new IniConfigSource();
+ config.AddConfig("Modules");
+ // Not strictly necessary since FriendsModule assumes it is the default (!)
+ config.Configs["Modules"].Set("EntityTransferModule", etm.Name);
+ config.Configs["Modules"].Set("SimulationServices", lscm.Name);
- [TearDown]
- public void TearDown()
- {
- try
- {
- if (MainServer.Instance != null) MainServer.Instance.Stop();
- }
- catch (NullReferenceException)
- { }
- }
+ SceneHelpers sh = new SceneHelpers();
+ TestScene sceneA = sh.SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
+ TestScene sceneB = sh.SetupScene("sceneB", TestHelpers.ParseTail(0x200), 1002, 1000);
- }
+ SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, etm, lscm);
- public class ThreadRunResults
- {
- public bool Result = false;
- public string Message = string.Empty;
- }
+ Vector3 teleportPosition = new Vector3(10, 11, 12);
+ Vector3 teleportLookAt = new Vector3(20, 21, 22);
- public class TestRunning
- {
- public ThreadRunResults results;
- public TestRunning(ThreadRunResults t)
- {
- results = t;
- }
- public void run(object o)
- {
-
- //results.Result = true;
- log4net.Config.XmlConfigurator.Configure();
-
- UUID sceneAId = UUID.Parse("00000000-0000-0000-0000-000000000100");
- UUID sceneBId = UUID.Parse("00000000-0000-0000-0000-000000000200");
-
- // shared module
- ISharedRegionModule interregionComms = new LocalSimulationConnectorModule();
-
-
- Scene sceneB = SceneHelpers.SetupScene("sceneB", sceneBId, 1010, 1010);
- SceneHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms);
- sceneB.RegisterRegionWithGrid();
-
- Scene sceneA = SceneHelpers.SetupScene("sceneA", sceneAId, 1000, 1000);
- SceneHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms);
- sceneA.RegisterRegionWithGrid();
-
- UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041");
- TestClient client = (TestClient)SceneHelpers.AddScenePresence(sceneA, agentId).ControllingClient;
-
- ICapabilitiesModule sceneACapsModule = sceneA.RequestModuleInterface();
-
- results.Result = (sceneACapsModule.GetCapsPath(agentId) == client.CapsSeedUrl);
-
- if (!results.Result)
- {
- results.Message = "Incorrect caps object path set up in sceneA";
- return;
- }
-
- /*
- Assert.That(
- sceneACapsModule.GetCapsPath(agentId),
- Is.EqualTo(client.CapsSeedUrl),
- "Incorrect caps object path set up in sceneA");
- */
- // FIXME: This is a hack to get the test working - really the normal OpenSim mechanisms should be used.
-
-
- client.TeleportTargetScene = sceneB;
- client.Teleport(sceneB.RegionInfo.RegionHandle, new Vector3(100, 100, 100), new Vector3(40, 40, 40));
-
- results.Result = (sceneB.GetScenePresence(agentId) != null);
- if (!results.Result)
- {
- results.Message = "Client does not have an agent in sceneB";
- return;
- }
-
- //Assert.That(sceneB.GetScenePresence(agentId), Is.Not.Null, "Client does not have an agent in sceneB");
-
- //Assert.That(sceneA.GetScenePresence(agentId), Is.Null, "Client still had an agent in sceneA");
-
- results.Result = (sceneA.GetScenePresence(agentId) == null);
- if (!results.Result)
- {
- results.Message = "Client still had an agent in sceneA";
- return;
- }
-
- ICapabilitiesModule sceneBCapsModule = sceneB.RequestModuleInterface();
-
-
- results.Result = ("http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort +
- "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/" == client.CapsSeedUrl);
- if (!results.Result)
- {
- results.Message = "Incorrect caps object path set up in sceneB";
- return;
- }
-
- // Temporary assertion - caps url construction should at least be doable through a method.
- /*
- Assert.That(
- "http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort + "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/",
- Is.EqualTo(client.CapsSeedUrl),
- "Incorrect caps object path set up in sceneB");
- */
- // This assertion will currently fail since we don't remove the caps paths when no longer needed
- //Assert.That(sceneACapsModule.GetCapsPath(agentId), Is.Null, "sceneA still had a caps object path");
-
- // TODO: Check that more of everything is as it should be
-
- // TODO: test what happens if we try to teleport to a region that doesn't exist
+ ScenePresence sp = SceneHelpers.AddScenePresence(sceneA, userId);
+ sp.AbsolutePosition = new Vector3(30, 31, 32);
+
+ // XXX: A very nasty hack to tell the client about the destination scene without having to crank the whole
+ // UDP stack (?)
+ ((TestClient)sp.ControllingClient).TeleportTargetScene = sceneB;
+
+ sceneA.RequestTeleportLocation(
+ sp.ControllingClient,
+ sceneB.RegionInfo.RegionHandle,
+ teleportPosition,
+ teleportLookAt,
+ (uint)TeleportFlags.ViaLocation);
+
+ Assert.That(sceneA.GetScenePresence(userId), Is.Null);
+
+ ScenePresence sceneBSp = sceneB.GetScenePresence(userId);
+ Assert.That(sceneBSp, Is.Not.Null);
+ Assert.That(sceneBSp.Scene.RegionInfo.RegionName, Is.EqualTo(sceneB.RegionInfo.RegionName));
+ Assert.That(sceneBSp.AbsolutePosition, Is.EqualTo(teleportPosition));
+
+ // TODO: Add assertions to check correct circuit details in both scenes.
+
+ // Lookat is sent to the client only - sp.Lookat does not yield the same thing (calculation from camera
+ // position instead).
+// Assert.That(sp.Lookat, Is.EqualTo(teleportLookAt));
}
}
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
index 5c9a77d..d722a09 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
@@ -60,7 +60,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
{
TestHelpers.InMethod();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
scene.Update(1);
Assert.That(scene.Frame, Is.EqualTo(1));
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index 55c80f5..d15141b 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.Framework.Tests
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart;
@@ -81,7 +81,7 @@ namespace OpenSim.Region.Framework.Tests
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart;
@@ -124,7 +124,7 @@ namespace OpenSim.Region.Framework.Tests
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart;
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Framework.Tests
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart;
diff --git a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs
index 55fc1e7..44d2d45 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.Framework.Tests
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001));
UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1002));
InventoryItemBase item1 = UserInventoryHelpers.CreateInventoryItem(scene, "item1", user1.PrincipalID);
@@ -85,7 +85,7 @@ namespace OpenSim.Region.Framework.Tests
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001));
UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1002));
InventoryFolderBase folder1
diff --git a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
index d9fe87c..198e487 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
public void Init()
{
// FIXME: We don't need a full scene here - it would be enough to set up the asset service.
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
m_assetService = scene.AssetService;
m_uuidGatherer = new UuidGatherer(m_assetService);
}
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
index d2f6327..ac638f1 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
- TestScene scene = SceneHelpers.SetupScene();
+ TestScene scene = new SceneHelpers().SetupScene();
IConfigSource configSource = new IniConfigSource();
IConfig config = configSource.AddConfig("Groups");
config.Set("Enabled", true);
diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
index eea0b2e..a39257e 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
@@ -85,7 +85,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
m_attMod = new AttachmentsModule();
m_npcMod = new NPCModule();
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(m_scene, config, m_afMod, m_umMod, m_attMod, m_npcMod, new BasicInventoryAccessModule());
}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs
index e2d0db2..49266e9 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs
@@ -63,7 +63,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
IConfig config = initConfigSource.AddConfig("XEngine");
config.Set("Enabled", "true");
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(m_scene, initConfigSource);
m_engine = new XEngine.XEngine();
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
index 9cf9258..92a63bf 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
IConfig config = initConfigSource.AddConfig("XEngine");
config.Set("Enabled", "true");
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
XEngine.XEngine engine = new XEngine.XEngine();
@@ -261,7 +261,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
TestHelpers.InMethod();
// Create Prim1.
- Scene scene = SceneHelpers.SetupScene();
+ Scene scene = new SceneHelpers().SetupScene();
string obj1Name = "Prim1";
UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001");
SceneObjectPart part1 =
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs
index 7573dff..c51227b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs
@@ -67,7 +67,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
config = initConfigSource.AddConfig("NPC");
config.Set("Enabled", "true");
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(m_scene, initConfigSource, new AvatarFactoryModule(), new NPCModule());
m_engine = new XEngine.XEngine();
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs
index 9d9fc51..9c36108 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs
@@ -68,7 +68,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
config = initConfigSource.AddConfig("NPC");
config.Set("Enabled", "true");
- m_scene = SceneHelpers.SetupScene();
+ m_scene = new SceneHelpers().SetupScene();
SceneHelpers.SetupSceneModules(m_scene, initConfigSource, new AvatarFactoryModule(), new NPCModule());
m_engine = new XEngine.XEngine();
diff --git a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs
index 7d7bd82..a3f848c 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs
@@ -73,7 +73,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Tests
// to AssemblyResolver.OnAssemblyResolve fails.
xEngineConfig.Set("AppDomainLoading", "false");
- m_scene = SceneHelpers.SetupScene("My Test", UUID.Random(), 1000, 1000, null, configSource);
+ m_scene = new SceneHelpers().SetupScene("My Test", UUID.Random(), 1000, 1000, configSource);
SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine, wcModule);
m_scene.StartScripts();
}
--
cgit v1.1