Merge branch '0.7.6-extended' into 0.7.6-post-fixes
commit
87e725cd24
|
@ -482,21 +482,14 @@ namespace OpenSim.Framework
|
|||
set { m_LoadedCreationID = value; }
|
||||
}
|
||||
|
||||
// Connected Telehub object
|
||||
private UUID m_TelehubObject = UUID.Zero;
|
||||
public UUID TelehubObject
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_TelehubObject;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_TelehubObject = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Connected Telehub object
|
||||
/// </summary>
|
||||
public UUID TelehubObject { get; set; }
|
||||
|
||||
// Our Connected Telehub's SpawnPoints
|
||||
/// <summary>
|
||||
/// Our connected Telehub's SpawnPoints
|
||||
/// </summary>
|
||||
public List<SpawnPoint> l_SpawnPoints = new List<SpawnPoint>();
|
||||
|
||||
// Add a SpawnPoint
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
|||
|
||||
public void Initialise()
|
||||
{
|
||||
m_log.DebugFormat("[ESTATE MODULE]: Setting up estate commands for region {0}", m_module.Scene.RegionInfo.RegionName);
|
||||
// m_log.DebugFormat("[ESTATE MODULE]: Setting up estate commands for region {0}", m_module.Scene.RegionInfo.RegionName);
|
||||
|
||||
m_module.Scene.AddCommand("Regions", m_module, "set terrain texture",
|
||||
"set terrain texture <number> <uuid> [<x>] [<y>]",
|
||||
|
|
|
@ -702,7 +702,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
|||
}
|
||||
}
|
||||
|
||||
public void handleOnEstateManageTelehub(IClientAPI client, UUID invoice, UUID senderID, string cmd, uint param1)
|
||||
public void HandleOnEstateManageTelehub(IClientAPI client, UUID invoice, UUID senderID, string cmd, uint param1)
|
||||
{
|
||||
SceneObjectPart part;
|
||||
|
||||
|
@ -742,6 +742,8 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (client != null)
|
||||
SendTelehubInfo(client);
|
||||
}
|
||||
|
||||
|
@ -1207,7 +1209,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
|||
client.OnEstateRestartSimRequest += handleEstateRestartSimRequest;
|
||||
client.OnEstateChangeCovenantRequest += handleChangeEstateCovenantRequest;
|
||||
client.OnEstateChangeInfo += handleEstateChangeInfo;
|
||||
client.OnEstateManageTelehub += handleOnEstateManageTelehub;
|
||||
client.OnEstateManageTelehub += HandleOnEstateManageTelehub;
|
||||
client.OnUpdateEstateAccessDeltaRequest += handleEstateAccessDeltaRequest;
|
||||
client.OnSimulatorBlueBoxMessageRequest += SendSimulatorBlueBoxMessage;
|
||||
client.OnEstateBlueBoxMessageRequest += SendEstateBlueBoxMessage;
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
|||
public struct DrawStruct
|
||||
{
|
||||
public DrawRoutine dr;
|
||||
public Rectangle rect;
|
||||
// public Rectangle rect;
|
||||
public SolidBrush brush;
|
||||
public face[] trns;
|
||||
}
|
||||
|
@ -119,6 +119,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
|||
{
|
||||
mapbmp = FetchTexture(m_scene.RegionInfo.RegionSettings.TerrainImageID);
|
||||
}
|
||||
|
||||
return mapbmp;
|
||||
}
|
||||
|
||||
|
@ -127,8 +128,11 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
|||
try
|
||||
{
|
||||
using (Bitmap mapbmp = CreateMapTile())
|
||||
{
|
||||
if (mapbmp != null)
|
||||
return OpenJPEG.EncodeFromImage(mapbmp, true);
|
||||
}
|
||||
}
|
||||
catch (Exception e) // LEGIT: Catching problems caused by OpenJPEG p/invoke
|
||||
{
|
||||
m_log.Error("Failed generating terrain map: " + e);
|
||||
|
@ -277,10 +281,13 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
|||
tc = Environment.TickCount;
|
||||
m_log.Debug("[MAPTILE]: Generating Maptile Step 2: Object Volume Profile");
|
||||
EntityBase[] objs = whichScene.GetEntities();
|
||||
Dictionary<uint, DrawStruct> z_sort = new Dictionary<uint, DrawStruct>();
|
||||
//SortedList<float, RectangleDrawStruct> z_sort = new SortedList<float, RectangleDrawStruct>();
|
||||
List<float> z_sortheights = new List<float>();
|
||||
List<uint> z_localIDs = new List<uint>();
|
||||
Dictionary<uint, DrawStruct> z_sort = new Dictionary<uint, DrawStruct>();
|
||||
|
||||
try
|
||||
{
|
||||
//SortedList<float, RectangleDrawStruct> z_sort = new SortedList<float, RectangleDrawStruct>();
|
||||
|
||||
lock (objs)
|
||||
{
|
||||
|
@ -404,7 +411,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
|||
|| mapdrawendY > ((int)Constants.RegionSize - 1))
|
||||
continue;
|
||||
|
||||
#region obb face reconstruction part duex
|
||||
#region obb face reconstruction part duex
|
||||
Vector3[] vertexes = new Vector3[8];
|
||||
|
||||
// float[] distance = new float[6];
|
||||
|
@ -508,7 +515,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
|||
FaceD[2] = vertexes[7];
|
||||
FaceC[3] = vertexes[7];
|
||||
FaceD[5] = vertexes[7];
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
//int wy = 0;
|
||||
|
||||
|
@ -573,8 +580,8 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
|||
// Sort prim by Z position
|
||||
Array.Sort(sortedZHeights, sortedlocalIds);
|
||||
|
||||
Graphics g = Graphics.FromImage(mapbmp);
|
||||
|
||||
using (Graphics g = Graphics.FromImage(mapbmp))
|
||||
{
|
||||
for (int s = 0; s < sortedZHeights.Length; s++)
|
||||
{
|
||||
if (z_sort.ContainsKey(sortedlocalIds[s]))
|
||||
|
@ -587,11 +594,18 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
|||
//g.FillRectangle(rectDrawStruct.brush , rectDrawStruct.rect);
|
||||
}
|
||||
}
|
||||
|
||||
g.Dispose();
|
||||
}
|
||||
} // lock entities objs
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
foreach (DrawStruct ds in z_sort.Values)
|
||||
ds.brush.Dispose();
|
||||
}
|
||||
|
||||
m_log.Debug("[MAPTILE]: Generating Maptile Step 2: Done in " + (Environment.TickCount - tc) + " ms");
|
||||
|
||||
return mapbmp;
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
|||
public void TerrainToBitmap(Bitmap mapbmp)
|
||||
{
|
||||
int tc = Environment.TickCount;
|
||||
m_log.Debug("[MAPTILE]: Generating Maptile Step 1: Terrain");
|
||||
m_log.Debug("[SHADED MAP TILE RENDERER]: Generating Maptile Step 1: Terrain");
|
||||
|
||||
double[,] hm = m_scene.Heightmap.GetDoubles();
|
||||
bool ShadowDebugContinue = true;
|
||||
|
@ -199,7 +199,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
|||
{
|
||||
if (!terraincorruptedwarningsaid)
|
||||
{
|
||||
m_log.WarnFormat("[MAPIMAGE]: Your terrain is corrupted in region {0}, it might take a few minutes to generate the map image depending on the corruption level", m_scene.RegionInfo.RegionName);
|
||||
m_log.WarnFormat("[SHADED MAP TILE RENDERER]: Your terrain is corrupted in region {0}, it might take a few minutes to generate the map image depending on the corruption level", m_scene.RegionInfo.RegionName);
|
||||
terraincorruptedwarningsaid = true;
|
||||
}
|
||||
color = Color.Black;
|
||||
|
@ -229,7 +229,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
|||
{
|
||||
if (!terraincorruptedwarningsaid)
|
||||
{
|
||||
m_log.WarnFormat("[MAPIMAGE]: Your terrain is corrupted in region {0}, it might take a few minutes to generate the map image depending on the corruption level", m_scene.RegionInfo.RegionName);
|
||||
m_log.WarnFormat("[SHADED MAP TILE RENDERER]: Your terrain is corrupted in region {0}, it might take a few minutes to generate the map image depending on the corruption level", m_scene.RegionInfo.RegionName);
|
||||
terraincorruptedwarningsaid = true;
|
||||
}
|
||||
Color black = Color.Black;
|
||||
|
@ -238,7 +238,8 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
|||
}
|
||||
}
|
||||
}
|
||||
m_log.Debug("[MAPTILE]: Generating Maptile Step 1: Done in " + (Environment.TickCount - tc) + " ms");
|
||||
|
||||
m_log.Debug("[SHADED MAP TILE RENDERER]: Generating Maptile Step 1: Done in " + (Environment.TickCount - tc) + " ms");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -173,7 +173,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
|||
private Bitmap fetchTexture(UUID id)
|
||||
{
|
||||
AssetBase asset = m_scene.AssetService.Get(id.ToString());
|
||||
m_log.DebugFormat("[TexturedMapTileRenderer]: Fetched texture {0}, found: {1}", id, asset != null);
|
||||
m_log.DebugFormat("[TEXTURED MAP TILE RENDERER]: Fetched texture {0}, found: {1}", id, asset != null);
|
||||
if (asset == null) return null;
|
||||
|
||||
ManagedImage managedImage;
|
||||
|
@ -188,17 +188,17 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
|||
}
|
||||
catch (DllNotFoundException)
|
||||
{
|
||||
m_log.ErrorFormat("[TexturedMapTileRenderer]: OpenJpeg is not installed correctly on this system. Asset Data is empty for {0}", id);
|
||||
m_log.ErrorFormat("[TEXTURED MAP TILE RENDERER]: OpenJpeg is not installed correctly on this system. Asset Data is empty for {0}", id);
|
||||
|
||||
}
|
||||
catch (IndexOutOfRangeException)
|
||||
{
|
||||
m_log.ErrorFormat("[TexturedMapTileRenderer]: OpenJpeg was unable to encode this. Asset Data is empty for {0}", id);
|
||||
m_log.ErrorFormat("[TEXTURED MAP TILE RENDERER]: OpenJpeg was unable to encode this. Asset Data is empty for {0}", id);
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
m_log.ErrorFormat("[TexturedMapTileRenderer]: OpenJpeg was unable to encode this. Asset Data is empty for {0}", id);
|
||||
m_log.ErrorFormat("[TEXTURED MAP TILE RENDERER]: OpenJpeg was unable to encode this. Asset Data is empty for {0}", id);
|
||||
|
||||
}
|
||||
return null;
|
||||
|
@ -233,10 +233,14 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
|||
if (textureID == UUID.Zero) return defaultColor; // not set
|
||||
if (m_mapping.ContainsKey(textureID)) return m_mapping[textureID]; // one of the predefined textures
|
||||
|
||||
Bitmap bmp = fetchTexture(textureID);
|
||||
Color color = bmp == null ? defaultColor : computeAverageColor(bmp);
|
||||
Color color;
|
||||
|
||||
using (Bitmap bmp = fetchTexture(textureID))
|
||||
{
|
||||
color = bmp == null ? defaultColor : computeAverageColor(bmp);
|
||||
// store it for future reference
|
||||
m_mapping[textureID] = color;
|
||||
}
|
||||
|
||||
return color;
|
||||
}
|
||||
|
@ -278,7 +282,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
|||
public void TerrainToBitmap(Bitmap mapbmp)
|
||||
{
|
||||
int tc = Environment.TickCount;
|
||||
m_log.Debug("[MAPTILE]: Generating Maptile Step 1: Terrain");
|
||||
m_log.Debug("[TEXTURED MAP TILE RENDERER]: Generating Maptile Step 1: Terrain");
|
||||
|
||||
// These textures should be in the AssetCache anyway, as every client conneting to this
|
||||
// region needs them. Except on start, when the map is recreated (before anyone connected),
|
||||
|
@ -412,7 +416,8 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
|||
}
|
||||
}
|
||||
}
|
||||
m_log.Debug("[MAPTILE]: Generating Maptile Step 1: Done in " + (Environment.TickCount - tc) + " ms");
|
||||
|
||||
m_log.Debug("[TEXTURED MAP TILE RENDERER]: Generating Maptile Step 1: Done in " + (Environment.TickCount - tc) + " ms");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -114,6 +114,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
|||
"export-map [<path>]",
|
||||
"Save an image of the world map", HandleExportWorldMapConsoleCommand);
|
||||
|
||||
m_scene.AddCommand(
|
||||
"Regions", this, "generate map",
|
||||
"generate map",
|
||||
"Generates and stores a new maptile.", HandleGenerateMapConsoleCommand);
|
||||
|
||||
AddHandlers();
|
||||
}
|
||||
}
|
||||
|
@ -1255,6 +1260,16 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
|||
m_scene.RegionInfo.RegionName, exportPath);
|
||||
}
|
||||
|
||||
public void HandleGenerateMapConsoleCommand(string module, string[] cmdparams)
|
||||
{
|
||||
Scene consoleScene = m_scene.ConsoleScene();
|
||||
|
||||
if (consoleScene != null && consoleScene != m_scene)
|
||||
return;
|
||||
|
||||
GenerateMaptile();
|
||||
}
|
||||
|
||||
public OSD HandleRemoteMapItemRequest(string path, OSD request, string endpoint)
|
||||
{
|
||||
uint xstart = 0;
|
||||
|
@ -1486,8 +1501,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
|||
|
||||
private Byte[] GenerateOverlay()
|
||||
{
|
||||
Bitmap overlay = new Bitmap(256, 256);
|
||||
|
||||
using (Bitmap overlay = new Bitmap(256, 256))
|
||||
{
|
||||
bool[,] saleBitmap = new bool[64, 64];
|
||||
for (int x = 0 ; x < 64 ; x++)
|
||||
{
|
||||
|
@ -1500,11 +1515,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
|||
List<ILandObject> parcels = m_scene.LandChannel.AllParcels();
|
||||
|
||||
Color background = Color.FromArgb(0, 0, 0, 0);
|
||||
SolidBrush transparent = new SolidBrush(background);
|
||||
Graphics g = Graphics.FromImage(overlay);
|
||||
|
||||
using (Graphics g = Graphics.FromImage(overlay))
|
||||
{
|
||||
using (SolidBrush transparent = new SolidBrush(background))
|
||||
g.FillRectangle(transparent, 0, 0, 256, 256);
|
||||
|
||||
SolidBrush yellow = new SolidBrush(Color.FromArgb(255, 249, 223, 9));
|
||||
|
||||
foreach (ILandObject land in parcels)
|
||||
{
|
||||
|
@ -1525,6 +1541,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
|||
|
||||
m_log.DebugFormat("[WORLD MAP]: Region {0} has parcels for sale, generating overlay", m_scene.RegionInfo.RegionName);
|
||||
|
||||
using (SolidBrush yellow = new SolidBrush(Color.FromArgb(255, 249, 223, 9)))
|
||||
{
|
||||
for (int x = 0 ; x < 64 ; x++)
|
||||
{
|
||||
for (int y = 0 ; y < 64 ; y++)
|
||||
|
@ -1533,6 +1551,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
|||
g.FillRectangle(yellow, x * 4, 252 - (y * 4), 4, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -1542,6 +1562,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
|||
{
|
||||
m_log.DebugFormat("[WORLD MAP]: Error creating parcel overlay: " + e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3946,12 +3946,19 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
}
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE]: Found telehub object {0} for new user connection {1} to {2}",
|
||||
// RegionInfo.RegionSettings.TelehubObject, acd.Name, Name);
|
||||
|
||||
// Honor Estate teleport routing via Telehubs excluding ViaHome and GodLike TeleportFlags
|
||||
if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero &&
|
||||
RegionInfo.EstateSettings.AllowDirectTeleport == false &&
|
||||
!viahome && !godlike)
|
||||
{
|
||||
SceneObjectGroup telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject);
|
||||
|
||||
if (telehub != null)
|
||||
{
|
||||
// Can have multiple SpawnPoints
|
||||
List<SpawnPoint> spawnpoints = RegionInfo.RegionSettings.SpawnPoints();
|
||||
if (spawnpoints.Count > 1)
|
||||
|
@ -3968,11 +3975,24 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
telehub.GroupRotation
|
||||
);
|
||||
}
|
||||
else
|
||||
else if (spawnpoints.Count == 1)
|
||||
{
|
||||
// We have a single SpawnPoint and will route the agent to it
|
||||
acd.startpos = spawnpoints[0].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[SCENE]: No spawnpoints defined for telehub {0} for {1} in {2}. Continuing.",
|
||||
RegionInfo.RegionSettings.TelehubObject, acd.Name, Name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[SCENE]: No telehub {0} found to direct {1} in {2}. Continuing.",
|
||||
RegionInfo.RegionSettings.TelehubObject, acd.Name, Name);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -108,6 +108,16 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This exists to prevent race conditions between two CompleteMovement threads if the simulator is slow and
|
||||
/// the viewer fires these in quick succession.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// TODO: The child -> agent transition should be folded into LifecycleState and the CompleteMovement
|
||||
/// regulation done there.
|
||||
/// </remarks>
|
||||
private object m_completeMovementLock = new object();
|
||||
|
||||
// private static readonly byte[] DEFAULT_TEXTURE = AvatarAppearance.GetDefaultTexture().GetBytes();
|
||||
private static readonly Array DIR_CONTROL_FLAGS = Enum.GetValues(typeof(Dir_ControlFlags));
|
||||
private static readonly Vector3 HEAD_ADJUSTMENT = new Vector3(0f, 0f, 0.3f);
|
||||
|
@ -904,6 +914,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
/// <summary>
|
||||
/// Turns a child agent into a root agent.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Child agents are logged into neighbouring sims largely to observe changes. Root agents exist when the
|
||||
/// avatar is actual in the sim. They can perform all actions.
|
||||
/// This change is made whenever an avatar enters a region, whether by crossing over from a neighbouring sim,
|
||||
|
@ -911,8 +922,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
///
|
||||
/// This method is on the critical path for transferring an avatar from one region to another. Delay here
|
||||
/// delays that crossing.
|
||||
/// </summary>
|
||||
private void MakeRootAgent(Vector3 pos, bool isFlying)
|
||||
/// </remarks>
|
||||
private bool MakeRootAgent(Vector3 pos, bool isFlying)
|
||||
{
|
||||
// m_log.InfoFormat(
|
||||
// "[SCENE]: Upgrading child to root agent for {0} in {1}",
|
||||
|
@ -920,7 +931,13 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
//m_log.DebugFormat("[SCENE]: known regions in {0}: {1}", Scene.RegionInfo.RegionName, KnownChildRegionHandles.Count);
|
||||
|
||||
lock (m_completeMovementLock)
|
||||
{
|
||||
if (!IsChildAgent)
|
||||
return false;
|
||||
|
||||
IsChildAgent = false;
|
||||
}
|
||||
|
||||
// Must reset this here so that a teleport to a region next to an existing region does not keep the flag
|
||||
// set and prevent the close of the connection on a subsequent re-teleport.
|
||||
|
@ -1069,6 +1086,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
m_scene.EventManager.TriggerOnMakeRootAgent(this);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public int GetStateSource()
|
||||
|
@ -1442,7 +1460,14 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
|
||||
bool flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0);
|
||||
MakeRootAgent(AbsolutePosition, flying);
|
||||
if (!MakeRootAgent(AbsolutePosition, flying))
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[SCENE PRESENCE]: Aborting CompleteMovement call for {0} in {1} as they are already root",
|
||||
Name, Scene.Name);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Tell the client that we're totally ready
|
||||
ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look);
|
||||
|
|
|
@ -111,6 +111,45 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
|||
Assert.That(scene.GetScenePresences().Count, Is.EqualTo(1));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test that duplicate complete movement calls are ignored.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// If duplicate calls are not ignored then there is a risk of race conditions or other unexpected effects.
|
||||
/// </remarks>
|
||||
[Test]
|
||||
public void TestDupeCompleteMovementCalls()
|
||||
{
|
||||
TestHelpers.InMethod();
|
||||
// TestHelpers.EnableLogging();
|
||||
|
||||
UUID spUuid = TestHelpers.ParseTail(0x1);
|
||||
|
||||
TestScene scene = new SceneHelpers().SetupScene();
|
||||
|
||||
int makeRootAgentEvents = 0;
|
||||
scene.EventManager.OnMakeRootAgent += spi => makeRootAgentEvents++;
|
||||
|
||||
ScenePresence sp = SceneHelpers.AddScenePresence(scene, spUuid);
|
||||
|
||||
Assert.That(makeRootAgentEvents, Is.EqualTo(1));
|
||||
|
||||
// Normally these would be invoked by a CompleteMovement message coming in to the UDP stack. But for
|
||||
// convenience, here we will invoke it manually.
|
||||
sp.CompleteMovement(sp.ControllingClient, true);
|
||||
|
||||
Assert.That(makeRootAgentEvents, Is.EqualTo(1));
|
||||
|
||||
// Check rest of exepcted parameters.
|
||||
Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(spUuid), Is.Not.Null);
|
||||
Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));
|
||||
|
||||
Assert.That(sp.IsChildAgent, Is.False);
|
||||
Assert.That(sp.UUID, Is.EqualTo(spUuid));
|
||||
|
||||
Assert.That(scene.GetScenePresences().Count, Is.EqualTo(1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCreateDuplicateRootScenePresence()
|
||||
{
|
||||
|
@ -249,58 +288,5 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
|||
// Assert.That(childPresence, Is.Not.Null);
|
||||
// Assert.That(childPresence.IsChildAgent, Is.True);
|
||||
}
|
||||
|
||||
// /// <summary>
|
||||
// /// Test adding a root agent to a scene. Doesn't yet actually complete crossing the agent into the scene.
|
||||
// /// </summary>
|
||||
// [Test]
|
||||
// public void T010_TestAddRootAgent()
|
||||
// {
|
||||
// TestHelpers.InMethod();
|
||||
//
|
||||
// string firstName = "testfirstname";
|
||||
//
|
||||
// AgentCircuitData agent = new AgentCircuitData();
|
||||
// agent.AgentID = agent1;
|
||||
// agent.firstname = firstName;
|
||||
// agent.lastname = "testlastname";
|
||||
// agent.SessionID = UUID.Random();
|
||||
// agent.SecureSessionID = UUID.Random();
|
||||
// agent.circuitcode = 123;
|
||||
// agent.BaseFolder = UUID.Zero;
|
||||
// agent.InventoryFolder = UUID.Zero;
|
||||
// agent.startpos = Vector3.Zero;
|
||||
// agent.CapsPath = GetRandomCapsObjectPath();
|
||||
// agent.ChildrenCapSeeds = new Dictionary<ulong, string>();
|
||||
// agent.child = true;
|
||||
//
|
||||
// scene.PresenceService.LoginAgent(agent.AgentID.ToString(), agent.SessionID, agent.SecureSessionID);
|
||||
//
|
||||
// string reason;
|
||||
// scene.NewUserConnection(agent, (uint)TeleportFlags.ViaLogin, out reason);
|
||||
// testclient = new TestClient(agent, scene);
|
||||
// scene.AddNewAgent(testclient);
|
||||
//
|
||||
// ScenePresence presence = scene.GetScenePresence(agent1);
|
||||
//
|
||||
// Assert.That(presence, Is.Not.Null, "presence is null");
|
||||
// Assert.That(presence.Firstname, Is.EqualTo(firstName), "First name not same");
|
||||
// acd1 = agent;
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// Test removing an uncrossed root agent from a scene.
|
||||
// /// </summary>
|
||||
// [Test]
|
||||
// public void T011_TestRemoveRootAgent()
|
||||
// {
|
||||
// TestHelpers.InMethod();
|
||||
//
|
||||
// scene.RemoveClient(agent1);
|
||||
//
|
||||
// ScenePresence presence = scene.GetScenePresence(agent1);
|
||||
//
|
||||
// Assert.That(presence, Is.Null, "presence is not null");
|
||||
// }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,119 @@
|
|||
/*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using Nini.Config;
|
||||
using NUnit.Framework;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.CoreModules.World.Estate;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using OpenSim.Tests.Common;
|
||||
using OpenSim.Tests.Common.Mock;
|
||||
|
||||
namespace OpenSim.Region.Framework.Scenes.Tests
|
||||
{
|
||||
/// <summary>
|
||||
/// Scene telehub tests
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// TODO: Tests which run through normal functionality. Currently, the only test is one that checks behaviour
|
||||
/// in the case of an error condition
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class SceneTelehubTests : OpenSimTestCase
|
||||
{
|
||||
/// <summary>
|
||||
/// Test for desired behaviour when a telehub has no spawn points
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TestNoTelehubSpawnPoints()
|
||||
{
|
||||
TestHelpers.InMethod();
|
||||
// TestHelpers.EnableLogging();
|
||||
|
||||
EstateManagementModule emm = new EstateManagementModule();
|
||||
|
||||
SceneHelpers sh = new SceneHelpers();
|
||||
Scene scene = sh.SetupScene();
|
||||
SceneHelpers.SetupSceneModules(scene, emm);
|
||||
|
||||
UUID telehubSceneObjectOwner = TestHelpers.ParseTail(0x1);
|
||||
|
||||
SceneObjectGroup telehubSo = SceneHelpers.AddSceneObject(scene, "telehubObject", telehubSceneObjectOwner);
|
||||
|
||||
emm.HandleOnEstateManageTelehub(null, UUID.Zero, UUID.Zero, "connect", telehubSo.LocalId);
|
||||
scene.RegionInfo.EstateSettings.AllowDirectTeleport = false;
|
||||
|
||||
// Must still be possible to successfully log in
|
||||
UUID loggingInUserId = TestHelpers.ParseTail(0x2);
|
||||
|
||||
UserAccount ua
|
||||
= UserAccountHelpers.CreateUserWithInventory(scene, "Test", "User", loggingInUserId, "password");
|
||||
|
||||
SceneHelpers.AddScenePresence(scene, ua);
|
||||
|
||||
Assert.That(scene.GetScenePresence(loggingInUserId), Is.Not.Null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test for desired behaviour when the scene object nominated as a telehub object does not exist.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TestNoTelehubSceneObject()
|
||||
{
|
||||
TestHelpers.InMethod();
|
||||
// TestHelpers.EnableLogging();
|
||||
|
||||
EstateManagementModule emm = new EstateManagementModule();
|
||||
|
||||
SceneHelpers sh = new SceneHelpers();
|
||||
Scene scene = sh.SetupScene();
|
||||
SceneHelpers.SetupSceneModules(scene, emm);
|
||||
|
||||
UUID telehubSceneObjectOwner = TestHelpers.ParseTail(0x1);
|
||||
|
||||
SceneObjectGroup telehubSo = SceneHelpers.AddSceneObject(scene, "telehubObject", telehubSceneObjectOwner);
|
||||
SceneObjectGroup spawnPointSo = SceneHelpers.AddSceneObject(scene, "spawnpointObject", telehubSceneObjectOwner);
|
||||
|
||||
emm.HandleOnEstateManageTelehub(null, UUID.Zero, UUID.Zero, "connect", telehubSo.LocalId);
|
||||
emm.HandleOnEstateManageTelehub(null, UUID.Zero, UUID.Zero, "spawnpoint add", spawnPointSo.LocalId);
|
||||
scene.RegionInfo.EstateSettings.AllowDirectTeleport = false;
|
||||
|
||||
scene.DeleteSceneObject(telehubSo, false);
|
||||
|
||||
// Must still be possible to successfully log in
|
||||
UUID loggingInUserId = TestHelpers.ParseTail(0x2);
|
||||
|
||||
UserAccount ua
|
||||
= UserAccountHelpers.CreateUserWithInventory(scene, "Test", "User", loggingInUserId, "password");
|
||||
|
||||
SceneHelpers.AddScenePresence(scene, ua);
|
||||
|
||||
Assert.That(scene.GetScenePresence(loggingInUserId), Is.Not.Null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -788,11 +788,6 @@ namespace OpenSim.Tests.Common.Mock
|
|||
{
|
||||
OnRegionHandShakeReply(this);
|
||||
}
|
||||
|
||||
if (OnCompleteMovementToRegion != null)
|
||||
{
|
||||
OnCompleteMovementToRegion(this, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID)
|
||||
|
|
|
@ -117,8 +117,6 @@ namespace OpenSim.Tests.Common
|
|||
/// Parse a UUID stem into a full UUID.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Yes, this is completely inconsistent with ParseTail but this is probably a better way to do it,
|
||||
/// UUIDs are conceptually not hexadecmial numbers.
|
||||
/// The fragment will come at the start of the UUID. The rest will be 0s
|
||||
/// </remarks>
|
||||
/// <returns></returns>
|
||||
|
@ -143,5 +141,24 @@ namespace OpenSim.Tests.Common
|
|||
{
|
||||
return new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", tail));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parse a UUID tail section into a full UUID.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The fragment will come at the end of the UUID. The rest will be 0s
|
||||
/// </remarks>
|
||||
/// <returns></returns>
|
||||
/// <param name='frag'>
|
||||
/// A UUID fragment that will be parsed into a full UUID. Therefore, it can only contain
|
||||
/// cahracters which are valid in a UUID, except for "-" which is currently only allowed if a full UUID is
|
||||
/// given as the 'fragment'.
|
||||
/// </param>
|
||||
public static UUID ParseTail(string stem)
|
||||
{
|
||||
string rawUuid = stem.PadLeft(32, '0');
|
||||
|
||||
return UUID.Parse(rawUuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue