Merge branch 'master' into bulletsim
Conflicts: OpenSim/Region/Framework/Scenes/SceneManager.csbulletsim
commit
384cb79a1a
|
@ -14,6 +14,7 @@ people that make the day to day of OpenSim happen.
|
||||||
* Marck
|
* Marck
|
||||||
* Mic Bowman (Intel)
|
* Mic Bowman (Intel)
|
||||||
* BlueWall (James Hughes)
|
* BlueWall (James Hughes)
|
||||||
|
* Snoopy Pfeffer
|
||||||
|
|
||||||
= Core Developers Following the White Rabbit =
|
= Core Developers Following the White Rabbit =
|
||||||
Core developers who have temporarily (we hope) gone chasing the white rabbit.
|
Core developers who have temporarily (we hope) gone chasing the white rabbit.
|
||||||
|
@ -128,7 +129,6 @@ what it is today.
|
||||||
* Salahzar Stenvaag
|
* Salahzar Stenvaag
|
||||||
* sempuki
|
* sempuki
|
||||||
* SignpostMarv
|
* SignpostMarv
|
||||||
* Snoopy
|
|
||||||
* Strawberry Fride
|
* Strawberry Fride
|
||||||
* tglion
|
* tglion
|
||||||
* tlaukkan/Tommil (Tommi S. E. Laukkanen, Bubble Cloud)
|
* tlaukkan/Tommil (Tommi S. E. Laukkanen, Bubble Cloud)
|
||||||
|
|
|
@ -169,7 +169,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests
|
||||||
float y = Convert.ToSingle(rdata.Parameters[PARM_MOVE_Y]);
|
float y = Convert.ToSingle(rdata.Parameters[PARM_MOVE_Y]);
|
||||||
float z = Convert.ToSingle(rdata.Parameters[PARM_MOVE_Z]);
|
float z = Convert.ToSingle(rdata.Parameters[PARM_MOVE_Z]);
|
||||||
Vector3 vector = new Vector3(x, y, z);
|
Vector3 vector = new Vector3(x, y, z);
|
||||||
presence.MoveToTarget(vector);
|
presence.MoveToTarget(vector, false);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,7 +57,6 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
|
|
||||||
public Hashtable ProcessGetMesh(Hashtable request, UUID AgentId, Caps cap)
|
public Hashtable ProcessGetMesh(Hashtable request, UUID AgentId, Caps cap)
|
||||||
{
|
{
|
||||||
|
|
||||||
Hashtable responsedata = new Hashtable();
|
Hashtable responsedata = new Hashtable();
|
||||||
responsedata["int_response_code"] = 400; //501; //410; //404;
|
responsedata["int_response_code"] = 400; //501; //410; //404;
|
||||||
responsedata["content_type"] = "text/plain";
|
responsedata["content_type"] = "text/plain";
|
||||||
|
@ -69,7 +68,6 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
if (request.ContainsKey("mesh_id"))
|
if (request.ContainsKey("mesh_id"))
|
||||||
meshStr = request["mesh_id"].ToString();
|
meshStr = request["mesh_id"].ToString();
|
||||||
|
|
||||||
|
|
||||||
UUID meshID = UUID.Zero;
|
UUID meshID = UUID.Zero;
|
||||||
if (!String.IsNullOrEmpty(meshStr) && UUID.TryParse(meshStr, out meshID))
|
if (!String.IsNullOrEmpty(meshStr) && UUID.TryParse(meshStr, out meshID))
|
||||||
{
|
{
|
||||||
|
@ -82,12 +80,11 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
return responsedata;
|
return responsedata;
|
||||||
}
|
}
|
||||||
|
|
||||||
AssetBase mesh;
|
AssetBase mesh = m_assetService.Get(meshID.ToString());
|
||||||
// Only try to fetch locally cached textures. Misses are redirected
|
|
||||||
mesh = m_assetService.GetCached(meshID.ToString());
|
|
||||||
if (mesh != null)
|
if (mesh != null)
|
||||||
{
|
{
|
||||||
if (mesh.Type == (SByte)AssetType.Mesh)
|
if (mesh.Type == (SByte)AssetType.Mesh)
|
||||||
{
|
{
|
||||||
responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data);
|
responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data);
|
||||||
responsedata["content_type"] = "application/vnd.ll.mesh";
|
responsedata["content_type"] = "application/vnd.ll.mesh";
|
||||||
|
@ -105,39 +102,15 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mesh = m_assetService.Get(meshID.ToString());
|
responsedata["int_response_code"] = 404; //501; //410; //404;
|
||||||
if (mesh != null)
|
responsedata["content_type"] = "text/plain";
|
||||||
{
|
responsedata["keepalive"] = false;
|
||||||
if (mesh.Type == (SByte)AssetType.Mesh)
|
responsedata["str_response_string"] = "Your Mesh wasn't found. Sorry!";
|
||||||
{
|
return responsedata;
|
||||||
responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data);
|
|
||||||
responsedata["content_type"] = "application/vnd.ll.mesh";
|
|
||||||
responsedata["int_response_code"] = 200;
|
|
||||||
}
|
|
||||||
// Optionally add additional mesh types here
|
|
||||||
else
|
|
||||||
{
|
|
||||||
responsedata["int_response_code"] = 404; //501; //410; //404;
|
|
||||||
responsedata["content_type"] = "text/plain";
|
|
||||||
responsedata["keepalive"] = false;
|
|
||||||
responsedata["str_response_string"] = "Unfortunately, this asset isn't a mesh.";
|
|
||||||
return responsedata;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
responsedata["int_response_code"] = 404; //501; //410; //404;
|
|
||||||
responsedata["content_type"] = "text/plain";
|
|
||||||
responsedata["keepalive"] = false;
|
|
||||||
responsedata["str_response_string"] = "Your Mesh wasn't found. Sorry!";
|
|
||||||
return responsedata;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return responsedata;
|
return responsedata;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -88,7 +88,7 @@ namespace OpenSim.Data.MSSQL
|
||||||
cmd.ExecuteNonQuery();
|
cmd.ExecuteNonQuery();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
throw new Exception(sql);
|
throw new Exception(sql);
|
||||||
|
|
||||||
|
|
|
@ -191,7 +191,7 @@ namespace OpenSim.Data.MSSQL
|
||||||
{
|
{
|
||||||
cmd.ExecuteNonQuery();
|
cmd.ExecuteNonQuery();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,12 +251,14 @@ namespace OpenSim.Data.MySQL
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// check if the asset UUID exist in database
|
/// Check if the asset exists in the database
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="uuid">The asset UUID</param>
|
/// <param name="uuid">The asset UUID</param>
|
||||||
/// <returns>true if exist.</returns>
|
/// <returns>true if it exists, false otherwise.</returns>
|
||||||
override public bool ExistsAsset(UUID uuid)
|
override public bool ExistsAsset(UUID uuid)
|
||||||
{
|
{
|
||||||
|
// m_log.DebugFormat("[ASSETS DB]: Checking for asset {0}", uuid);
|
||||||
|
|
||||||
bool assetExists = false;
|
bool assetExists = false;
|
||||||
|
|
||||||
lock (m_dbLock)
|
lock (m_dbLock)
|
||||||
|
@ -273,7 +275,10 @@ namespace OpenSim.Data.MySQL
|
||||||
using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
||||||
{
|
{
|
||||||
if (dbReader.Read())
|
if (dbReader.Read())
|
||||||
|
{
|
||||||
|
// m_log.DebugFormat("[ASSETS DB]: Found asset {0}", uuid);
|
||||||
assetExists = true;
|
assetExists = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
|
@ -97,7 +97,7 @@ namespace OpenSim.Data.Null
|
||||||
|
|
||||||
foreach (RegionData r in m_regionData.Values)
|
foreach (RegionData r in m_regionData.Values)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[NULL REGION DATA]: comparing {0} to {1}", cleanName, r.RegionName.ToLower());
|
// m_log.DebugFormat("[NULL REGION DATA]: comparing {0} to {1}", cleanName, r.RegionName.ToLower());
|
||||||
if (queryMatch(r.RegionName.ToLower()))
|
if (queryMatch(r.RegionName.ToLower()))
|
||||||
ret.Add(r);
|
ret.Add(r);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,11 +41,9 @@ COMMIT;
|
||||||
|
|
||||||
:VERSION 2
|
:VERSION 2
|
||||||
|
|
||||||
ATTACH 'inventoryStore.db' AS old;
|
|
||||||
|
|
||||||
BEGIN TRANSACTION;
|
BEGIN TRANSACTION;
|
||||||
|
|
||||||
INSERT INTO inventoryfolders (folderName, type, version, folderID, agentID, parentFolderID) SELECT `name` AS folderName, `type` AS type, `version` AS version, `UUID` AS folderID, `agentID` AS agentID, `parentID` AS parentFolderID from old.inventoryfolders;
|
INSERT INTO inventoryfolders (folderName, type, version, folderID, agentID, parentFolderID) SELECT `name` AS folderName, `type` AS type, `version` AS version, `UUID` AS folderID, `agentID` AS agentID, `parentID` AS parentFolderID from old.inventoryfolders;
|
||||||
INSERT INTO inventoryitems (assetID, assetType, inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType, creatorID, inventoryBasePermissions, inventoryEveryOnePermissions, salePrice, saleType, creationDate, groupID, groupOwned, flags, inventoryID, parentFolderID, avatarID, inventoryGroupPermissions) SELECT `assetID`, `assetType` AS assetType, `inventoryName` AS inventoryName, `inventoryDescription` AS inventoryDescription, `inventoryNextPermissions` AS inventoryNextPermissions, `inventoryCurrentPermissions` AS inventoryCurrentPermissions, `invType` AS invType, `creatorsID` AS creatorID, `inventoryBasePermissions` AS inventoryBasePermissions, `inventoryEveryOnePermissions` AS inventoryEveryOnePermissions, `salePrice` AS salePrice, `saleType` AS saleType, `creationDate` AS creationDate, `groupID` AS groupID, `groupOwned` AS groupOwned, `flags` AS flags, `UUID` AS inventoryID, `parentFolderID` AS parentFolderID, `avatarID` AS avatarID, `inventoryGroupPermissions` AS inventoryGroupPermissions FROM old.inventoryitems;
|
INSERT INTO inventoryitems (assetID, assetType, inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType, creatorID, inventoryBasePermissions, inventoryEveryOnePermissions, salePrice, saleType, creationDate, groupID, groupOwned, flags, inventoryID, parentFolderID, avatarID, inventoryGroupPermissions) SELECT `assetID`, `assetType` AS assetType, `inventoryName` AS inventoryName, `inventoryDescription` AS inventoryDescription, `inventoryNextPermissions` AS inventoryNextPermissions, `inventoryCurrentPermissions` AS inventoryCurrentPermissions, `invType` AS invType, `creatorsID` AS creatorID, `inventoryBasePermissions` AS inventoryBasePermissions, `inventoryEveryOnePermissions` AS inventoryEveryOnePermissions, `salePrice` AS salePrice, `saleType` AS saleType, `creationDate` AS creationDate, `groupID` AS groupID, `groupOwned` AS groupOwned, `flags` AS flags, `UUID` AS inventoryID, `parentFolderID` AS parentFolderID, `avatarID` AS avatarID, `inventoryGroupPermissions` AS inventoryGroupPermissions FROM old.inventoryitems;
|
||||||
|
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
|
@ -106,7 +106,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T001_LoadEmpty()
|
public void T001_LoadEmpty()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
Assert.That(m_db.ExistsAsset(uuid1), Is.False);
|
Assert.That(m_db.ExistsAsset(uuid1), Is.False);
|
||||||
Assert.That(m_db.ExistsAsset(uuid2), Is.False);
|
Assert.That(m_db.ExistsAsset(uuid2), Is.False);
|
||||||
|
@ -116,7 +116,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T010_StoreReadVerifyAssets()
|
public void T010_StoreReadVerifyAssets()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
AssetBase a1 = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture, critter1.ToString());
|
AssetBase a1 = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture, critter1.ToString());
|
||||||
AssetBase a2 = new AssetBase(uuid2, "asset two", (sbyte)AssetType.Texture, critter2.ToString());
|
AssetBase a2 = new AssetBase(uuid2, "asset two", (sbyte)AssetType.Texture, critter2.ToString());
|
||||||
|
@ -183,7 +183,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T020_CheckForWeirdCreatorID()
|
public void T020_CheckForWeirdCreatorID()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
// It is expected that eventually the CreatorID might be an arbitrary string (an URI)
|
// It is expected that eventually the CreatorID might be an arbitrary string (an URI)
|
||||||
// rather than a valid UUID (?). This test is to make sure that the database layer does not
|
// rather than a valid UUID (?). This test is to make sure that the database layer does not
|
||||||
|
|
|
@ -107,7 +107,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T010_EstateSettingsSimpleStorage_MinimumParameterSet()
|
public void T010_EstateSettingsSimpleStorage_MinimumParameterSet()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
EstateSettingsSimpleStorage(
|
EstateSettingsSimpleStorage(
|
||||||
REGION_ID,
|
REGION_ID,
|
||||||
|
@ -140,7 +140,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T011_EstateSettingsSimpleStorage_MaximumParameterSet()
|
public void T011_EstateSettingsSimpleStorage_MaximumParameterSet()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
EstateSettingsSimpleStorage(
|
EstateSettingsSimpleStorage(
|
||||||
REGION_ID,
|
REGION_ID,
|
||||||
|
@ -173,7 +173,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T012_EstateSettingsSimpleStorage_AccurateParameterSet()
|
public void T012_EstateSettingsSimpleStorage_AccurateParameterSet()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
EstateSettingsSimpleStorage(
|
EstateSettingsSimpleStorage(
|
||||||
REGION_ID,
|
REGION_ID,
|
||||||
|
@ -206,7 +206,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T012_EstateSettingsRandomStorage()
|
public void T012_EstateSettingsRandomStorage()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
// Letting estate store generate rows to database for us
|
// Letting estate store generate rows to database for us
|
||||||
EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
|
EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
|
||||||
|
@ -227,7 +227,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T020_EstateSettingsManagerList()
|
public void T020_EstateSettingsManagerList()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
// Letting estate store generate rows to database for us
|
// Letting estate store generate rows to database for us
|
||||||
EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
|
EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
|
||||||
|
@ -248,7 +248,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T021_EstateSettingsUserList()
|
public void T021_EstateSettingsUserList()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
// Letting estate store generate rows to database for us
|
// Letting estate store generate rows to database for us
|
||||||
EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
|
EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
|
||||||
|
@ -269,7 +269,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T022_EstateSettingsGroupList()
|
public void T022_EstateSettingsGroupList()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
// Letting estate store generate rows to database for us
|
// Letting estate store generate rows to database for us
|
||||||
EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
|
EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
|
||||||
|
@ -290,7 +290,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T022_EstateSettingsBanList()
|
public void T022_EstateSettingsBanList()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
// Letting estate store generate rows to database for us
|
// Letting estate store generate rows to database for us
|
||||||
EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
|
EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
|
||||||
|
|
|
@ -114,7 +114,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T001_LoadEmpty()
|
public void T001_LoadEmpty()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
Assert.That(db.getInventoryFolder(zero), Is.Null);
|
Assert.That(db.getInventoryFolder(zero), Is.Null);
|
||||||
Assert.That(db.getInventoryFolder(folder1), Is.Null);
|
Assert.That(db.getInventoryFolder(folder1), Is.Null);
|
||||||
|
@ -134,7 +134,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T010_FolderNonParent()
|
public void T010_FolderNonParent()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
InventoryFolderBase f1 = NewFolder(folder2, folder1, owner1, name2);
|
InventoryFolderBase f1 = NewFolder(folder2, folder1, owner1, name2);
|
||||||
// the folder will go in
|
// the folder will go in
|
||||||
|
@ -146,7 +146,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T011_FolderCreate()
|
public void T011_FolderCreate()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
InventoryFolderBase f1 = NewFolder(folder1, zero, owner1, name1);
|
InventoryFolderBase f1 = NewFolder(folder1, zero, owner1, name1);
|
||||||
// TODO: this is probably wrong behavior, but is what we have
|
// TODO: this is probably wrong behavior, but is what we have
|
||||||
|
@ -171,7 +171,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T012_FolderList()
|
public void T012_FolderList()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
InventoryFolderBase f2 = NewFolder(folder3, folder1, owner1, name3);
|
InventoryFolderBase f2 = NewFolder(folder3, folder1, owner1, name3);
|
||||||
db.addInventoryFolder(f2);
|
db.addInventoryFolder(f2);
|
||||||
|
@ -187,7 +187,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T013_FolderHierarchy()
|
public void T013_FolderHierarchy()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
int n = db.getFolderHierarchy(zero).Count; // (for dbg - easier to see what's returned)
|
int n = db.getFolderHierarchy(zero).Count; // (for dbg - easier to see what's returned)
|
||||||
Assert.That(n, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))");
|
Assert.That(n, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))");
|
||||||
|
@ -202,7 +202,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T014_MoveFolder()
|
public void T014_MoveFolder()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
InventoryFolderBase f2 = db.getInventoryFolder(folder2);
|
InventoryFolderBase f2 = db.getInventoryFolder(folder2);
|
||||||
f2.ParentID = folder3;
|
f2.ParentID = folder3;
|
||||||
|
@ -218,7 +218,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T015_FolderHierarchy()
|
public void T015_FolderHierarchy()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))");
|
Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))");
|
||||||
Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2), "Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2))");
|
Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2), "Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2))");
|
||||||
|
@ -231,7 +231,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T100_NoItems()
|
public void T100_NoItems()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0))");
|
Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0))");
|
||||||
Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0))");
|
Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0))");
|
||||||
|
@ -245,7 +245,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T101_CreatItems()
|
public void T101_CreatItems()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
db.addInventoryItem(NewItem(item1, folder3, owner1, iname1, asset1));
|
db.addInventoryItem(NewItem(item1, folder3, owner1, iname1, asset1));
|
||||||
db.addInventoryItem(NewItem(item2, folder3, owner1, iname2, asset2));
|
db.addInventoryItem(NewItem(item2, folder3, owner1, iname2, asset2));
|
||||||
|
@ -256,7 +256,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T102_CompareItems()
|
public void T102_CompareItems()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
InventoryItemBase i1 = db.getInventoryItem(item1);
|
InventoryItemBase i1 = db.getInventoryItem(item1);
|
||||||
InventoryItemBase i2 = db.getInventoryItem(item2);
|
InventoryItemBase i2 = db.getInventoryItem(item2);
|
||||||
|
@ -275,7 +275,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T103_UpdateItem()
|
public void T103_UpdateItem()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
// TODO: probably shouldn't have the ability to have an
|
// TODO: probably shouldn't have the ability to have an
|
||||||
// owner of an item in a folder not owned by the user
|
// owner of an item in a folder not owned by the user
|
||||||
|
@ -295,7 +295,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T104_RandomUpdateItem()
|
public void T104_RandomUpdateItem()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
PropertyScrambler<InventoryFolderBase> folderScrambler =
|
PropertyScrambler<InventoryFolderBase> folderScrambler =
|
||||||
new PropertyScrambler<InventoryFolderBase>()
|
new PropertyScrambler<InventoryFolderBase>()
|
||||||
|
@ -354,7 +354,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T999_StillNull()
|
public void T999_StillNull()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
// After all tests are run, these should still return no results
|
// After all tests are run, these should still return no results
|
||||||
Assert.That(db.getInventoryFolder(zero), Is.Null);
|
Assert.That(db.getInventoryFolder(zero), Is.Null);
|
||||||
|
|
|
@ -151,7 +151,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T001_LoadEmpty()
|
public void T001_LoadEmpty()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
List<SceneObjectGroup> objs = db.LoadObjects(region1);
|
List<SceneObjectGroup> objs = db.LoadObjects(region1);
|
||||||
List<SceneObjectGroup> objs3 = db.LoadObjects(region3);
|
List<SceneObjectGroup> objs3 = db.LoadObjects(region3);
|
||||||
|
@ -169,7 +169,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T010_StoreSimpleObject()
|
public void T010_StoreSimpleObject()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
SceneObjectGroup sog = NewSOG("object1", prim1, region1);
|
SceneObjectGroup sog = NewSOG("object1", prim1, region1);
|
||||||
SceneObjectGroup sog2 = NewSOG("object2", prim2, region1);
|
SceneObjectGroup sog2 = NewSOG("object2", prim2, region1);
|
||||||
|
@ -204,7 +204,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T011_ObjectNames()
|
public void T011_ObjectNames()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
List<SceneObjectGroup> objs = db.LoadObjects(region1);
|
List<SceneObjectGroup> objs = db.LoadObjects(region1);
|
||||||
foreach (SceneObjectGroup sog in objs)
|
foreach (SceneObjectGroup sog in objs)
|
||||||
|
@ -218,7 +218,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T012_SceneParts()
|
public void T012_SceneParts()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
UUID tmp0 = UUID.Random();
|
UUID tmp0 = UUID.Random();
|
||||||
UUID tmp1 = UUID.Random();
|
UUID tmp1 = UUID.Random();
|
||||||
|
@ -253,7 +253,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T013_DatabasePersistency()
|
public void T013_DatabasePersistency()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
// Sets all ScenePart parameters, stores and retrieves them, then check for consistency with initial data
|
// Sets all ScenePart parameters, stores and retrieves them, then check for consistency with initial data
|
||||||
// The commented Asserts are the ones that are unchangeable (when storing on the database, their "Set" values are ignored
|
// The commented Asserts are the ones that are unchangeable (when storing on the database, their "Set" values are ignored
|
||||||
|
@ -430,7 +430,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T014_UpdateObject()
|
public void T014_UpdateObject()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string text1 = "object1 text";
|
string text1 = "object1 text";
|
||||||
SceneObjectGroup sog = FindSOG("object1", region1);
|
SceneObjectGroup sog = FindSOG("object1", region1);
|
||||||
|
@ -540,7 +540,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T015_LargeSceneObjects()
|
public void T015_LargeSceneObjects()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
UUID id = UUID.Random();
|
UUID id = UUID.Random();
|
||||||
Dictionary<UUID, SceneObjectPart> mydic = new Dictionary<UUID, SceneObjectPart>();
|
Dictionary<UUID, SceneObjectPart> mydic = new Dictionary<UUID, SceneObjectPart>();
|
||||||
|
@ -587,7 +587,7 @@ namespace OpenSim.Data.Tests
|
||||||
//[Test]
|
//[Test]
|
||||||
public void T016_RandomSogWithSceneParts()
|
public void T016_RandomSogWithSceneParts()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
PropertyScrambler<SceneObjectPart> scrambler =
|
PropertyScrambler<SceneObjectPart> scrambler =
|
||||||
new PropertyScrambler<SceneObjectPart>()
|
new PropertyScrambler<SceneObjectPart>()
|
||||||
|
@ -663,7 +663,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T020_PrimInventoryEmpty()
|
public void T020_PrimInventoryEmpty()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
SceneObjectGroup sog = GetMySOG("object1");
|
SceneObjectGroup sog = GetMySOG("object1");
|
||||||
TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, item1);
|
TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, item1);
|
||||||
|
@ -687,7 +687,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T021_PrimInventoryBasic()
|
public void T021_PrimInventoryBasic()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
SceneObjectGroup sog = GetMySOG("object1");
|
SceneObjectGroup sog = GetMySOG("object1");
|
||||||
InventoryItemBase i = NewItem(item1, zero, zero, itemname1, zero);
|
InventoryItemBase i = NewItem(item1, zero, zero, itemname1, zero);
|
||||||
|
@ -727,7 +727,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T025_PrimInventoryPersistency()
|
public void T025_PrimInventoryPersistency()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
InventoryItemBase i = new InventoryItemBase();
|
InventoryItemBase i = new InventoryItemBase();
|
||||||
UUID id = UUID.Random();
|
UUID id = UUID.Random();
|
||||||
|
@ -800,7 +800,7 @@ namespace OpenSim.Data.Tests
|
||||||
[ExpectedException(typeof(ArgumentException))]
|
[ExpectedException(typeof(ArgumentException))]
|
||||||
public void T026_PrimInventoryMany()
|
public void T026_PrimInventoryMany()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
UUID i1,i2,i3,i4;
|
UUID i1,i2,i3,i4;
|
||||||
i1 = UUID.Random();
|
i1 = UUID.Random();
|
||||||
|
@ -832,7 +832,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T052_RemoveObject()
|
public void T052_RemoveObject()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
db.RemoveObject(prim1, region1);
|
db.RemoveObject(prim1, region1);
|
||||||
SceneObjectGroup sog = FindSOG("object1", region1);
|
SceneObjectGroup sog = FindSOG("object1", region1);
|
||||||
|
@ -842,7 +842,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T100_DefaultRegionInfo()
|
public void T100_DefaultRegionInfo()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
RegionSettings r1 = db.LoadRegionSettings(region1);
|
RegionSettings r1 = db.LoadRegionSettings(region1);
|
||||||
Assert.That(r1.RegionUUID, Is.EqualTo(region1), "Assert.That(r1.RegionUUID, Is.EqualTo(region1))");
|
Assert.That(r1.RegionUUID, Is.EqualTo(region1), "Assert.That(r1.RegionUUID, Is.EqualTo(region1))");
|
||||||
|
@ -854,7 +854,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T101_UpdateRegionInfo()
|
public void T101_UpdateRegionInfo()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
int agentlimit = random.Next();
|
int agentlimit = random.Next();
|
||||||
double objectbonus = random.Next();
|
double objectbonus = random.Next();
|
||||||
|
@ -960,7 +960,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T300_NoTerrain()
|
public void T300_NoTerrain()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
Assert.That(db.LoadTerrain(zero), Is.Null);
|
Assert.That(db.LoadTerrain(zero), Is.Null);
|
||||||
Assert.That(db.LoadTerrain(region1), Is.Null);
|
Assert.That(db.LoadTerrain(region1), Is.Null);
|
||||||
|
@ -971,7 +971,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T301_CreateTerrain()
|
public void T301_CreateTerrain()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
double[,] t1 = GenTerrain(height1);
|
double[,] t1 = GenTerrain(height1);
|
||||||
db.StoreTerrain(t1, region1);
|
db.StoreTerrain(t1, region1);
|
||||||
|
@ -985,7 +985,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T302_FetchTerrain()
|
public void T302_FetchTerrain()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
double[,] baseterrain1 = GenTerrain(height1);
|
double[,] baseterrain1 = GenTerrain(height1);
|
||||||
double[,] baseterrain2 = GenTerrain(height2);
|
double[,] baseterrain2 = GenTerrain(height2);
|
||||||
|
@ -997,7 +997,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T303_UpdateTerrain()
|
public void T303_UpdateTerrain()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
double[,] baseterrain1 = GenTerrain(height1);
|
double[,] baseterrain1 = GenTerrain(height1);
|
||||||
double[,] baseterrain2 = GenTerrain(height2);
|
double[,] baseterrain2 = GenTerrain(height2);
|
||||||
|
@ -1011,7 +1011,7 @@ namespace OpenSim.Data.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T400_EmptyLand()
|
public void T400_EmptyLand()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0))");
|
Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0))");
|
||||||
Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0))");
|
Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0))");
|
||||||
|
|
|
@ -412,12 +412,20 @@ namespace OpenSim.Framework
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add an attachment, if the attachpoint has the
|
/// Add an attachment
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// If the attachpoint has the
|
||||||
/// 0x80 bit set then we assume this is an append
|
/// 0x80 bit set then we assume this is an append
|
||||||
/// operation otherwise we replace whatever is
|
/// operation otherwise we replace whatever is
|
||||||
/// currently attached at the attachpoint
|
/// currently attached at the attachpoint
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="attachpoint"></param>
|
||||||
|
/// <param name="item">If UUID.Zero, then an any attachment at the attachpoint is removed.</param>
|
||||||
|
/// <param name="asset"></param>
|
||||||
|
/// <returns>
|
||||||
/// return true if something actually changed
|
/// return true if something actually changed
|
||||||
/// </summary>
|
/// </returns>
|
||||||
public bool SetAttachment(int attachpoint, UUID item, UUID asset)
|
public bool SetAttachment(int attachpoint, UUID item, UUID asset)
|
||||||
{
|
{
|
||||||
if (attachpoint == 0)
|
if (attachpoint == 0)
|
||||||
|
@ -539,7 +547,7 @@ namespace OpenSim.Framework
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Unpack(OSDMap data)
|
public void Unpack(OSDMap data)
|
||||||
{
|
{
|
||||||
if ((data != null) && (data["serial"] != null))
|
if ((data != null) && (data["serial"] != null))
|
||||||
m_serial = data["serial"].AsInteger();
|
m_serial = data["serial"].AsInteger();
|
||||||
if ((data != null) && (data["height"] != null))
|
if ((data != null) && (data["height"] != null))
|
||||||
m_avatarHeight = (float)data["height"].AsReal();
|
m_avatarHeight = (float)data["height"].AsReal();
|
||||||
|
|
|
@ -786,7 +786,7 @@ namespace OpenSim.Framework
|
||||||
event DeRezObject OnDeRezObject;
|
event DeRezObject OnDeRezObject;
|
||||||
event Action<IClientAPI> OnRegionHandShakeReply;
|
event Action<IClientAPI> OnRegionHandShakeReply;
|
||||||
event GenericCall1 OnRequestWearables;
|
event GenericCall1 OnRequestWearables;
|
||||||
event GenericCall1 OnCompleteMovementToRegion;
|
event Action<IClientAPI, bool> OnCompleteMovementToRegion;
|
||||||
event UpdateAgent OnPreAgentUpdate;
|
event UpdateAgent OnPreAgentUpdate;
|
||||||
event UpdateAgent OnAgentUpdate;
|
event UpdateAgent OnAgentUpdate;
|
||||||
event AgentRequestSit OnAgentRequestSit;
|
event AgentRequestSit OnAgentRequestSit;
|
||||||
|
@ -935,7 +935,7 @@ namespace OpenSim.Framework
|
||||||
event ScriptReset OnScriptReset;
|
event ScriptReset OnScriptReset;
|
||||||
event GetScriptRunning OnGetScriptRunning;
|
event GetScriptRunning OnGetScriptRunning;
|
||||||
event SetScriptRunning OnSetScriptRunning;
|
event SetScriptRunning OnSetScriptRunning;
|
||||||
event Action<Vector3> OnAutoPilotGo;
|
event Action<Vector3, bool> OnAutoPilotGo;
|
||||||
|
|
||||||
event TerrainUnacked OnUnackedTerrain;
|
event TerrainUnacked OnUnackedTerrain;
|
||||||
event ActivateGesture OnActivateGesture;
|
event ActivateGesture OnActivateGesture;
|
||||||
|
|
|
@ -70,8 +70,20 @@ namespace OpenSim.Framework
|
||||||
|
|
||||||
event restart OnRestart;
|
event restart OnRestart;
|
||||||
|
|
||||||
void AddNewClient(IClientAPI client);
|
/// <summary>
|
||||||
void RemoveClient(UUID agentID);
|
/// Register the new client with the scene. The client starts off as a child agent - the later agent crossing
|
||||||
|
/// will promote it to a root agent.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="type">The type of agent to add.</param>
|
||||||
|
void AddNewClient(IClientAPI client, PresenceType type);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remove the given client from the scene.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="agentID"></param>
|
||||||
|
/// <param name="closeChildAgents">Close the neighbour child agents associated with this client.</param>
|
||||||
|
void RemoveClient(UUID agentID, bool closeChildAgents);
|
||||||
|
|
||||||
void Restart();
|
void Restart();
|
||||||
//RegionInfo OtherRegionUp(RegionInfo thisRegion);
|
//RegionInfo OtherRegionUp(RegionInfo thisRegion);
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) Contributors, http://opensimulator.org/
|
||||||
|
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of the OpenSimulator Project nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace OpenSim.Framework
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Indicate the type of ScenePresence.
|
||||||
|
/// </summary>
|
||||||
|
public enum PresenceType
|
||||||
|
{
|
||||||
|
User,
|
||||||
|
Npc
|
||||||
|
}
|
||||||
|
}
|
|
@ -61,7 +61,7 @@ namespace OpenSim.Framework.Tests
|
||||||
"Magnitude of vector was incorrect.");
|
"Magnitude of vector was incorrect.");
|
||||||
|
|
||||||
TestDelegate d = delegate() { Util.GetNormalizedVector(v1); };
|
TestDelegate d = delegate() { Util.GetNormalizedVector(v1); };
|
||||||
bool causesArgumentException = TestHelper.AssertThisDelegateCausesArgumentException(d);
|
bool causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d);
|
||||||
Assert.That(causesArgumentException, Is.True,
|
Assert.That(causesArgumentException, Is.True,
|
||||||
"Getting magnitude of null vector did not cause argument exception.");
|
"Getting magnitude of null vector did not cause argument exception.");
|
||||||
|
|
||||||
|
@ -94,12 +94,12 @@ namespace OpenSim.Framework.Tests
|
||||||
"Magnitude of vector was incorrect.");
|
"Magnitude of vector was incorrect.");
|
||||||
|
|
||||||
TestDelegate d = delegate() { Util.GetNormalizedVector(v1); };
|
TestDelegate d = delegate() { Util.GetNormalizedVector(v1); };
|
||||||
bool causesArgumentException = TestHelper.AssertThisDelegateCausesArgumentException(d);
|
bool causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d);
|
||||||
Assert.That(causesArgumentException, Is.True,
|
Assert.That(causesArgumentException, Is.True,
|
||||||
"Getting magnitude of null vector did not cause argument exception.");
|
"Getting magnitude of null vector did not cause argument exception.");
|
||||||
|
|
||||||
d = delegate() { Util.GetNormalizedVector(v2); };
|
d = delegate() { Util.GetNormalizedVector(v2); };
|
||||||
causesArgumentException = TestHelper.AssertThisDelegateCausesArgumentException(d);
|
causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d);
|
||||||
Assert.That(causesArgumentException, Is.True,
|
Assert.That(causesArgumentException, Is.True,
|
||||||
"Getting magnitude of null vector did not cause argument exception.");
|
"Getting magnitude of null vector did not cause argument exception.");
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ namespace OpenSim.Framework.Tests
|
||||||
"Magnitude of vector was incorrect.");
|
"Magnitude of vector was incorrect.");
|
||||||
|
|
||||||
TestDelegate d = delegate() { Util.GetNormalizedVector(v1); };
|
TestDelegate d = delegate() { Util.GetNormalizedVector(v1); };
|
||||||
bool causesArgumentException = TestHelper.AssertThisDelegateCausesArgumentException(d);
|
bool causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d);
|
||||||
Assert.That(causesArgumentException, Is.True,
|
Assert.That(causesArgumentException, Is.True,
|
||||||
"Getting magnitude of null vector did not cause argument exception.");
|
"Getting magnitude of null vector did not cause argument exception.");
|
||||||
|
|
||||||
|
|
|
@ -56,8 +56,13 @@ namespace OpenSim.Framework
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The method used by Util.FireAndForget for asynchronously firing events
|
/// The method used by Util.FireAndForget for asynchronously firing events
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// None is used to execute the method in the same thread that made the call. It should only be used by regression
|
||||||
|
/// test code that relies on predictable event ordering.
|
||||||
|
/// </remarks>
|
||||||
public enum FireAndForgetMethod
|
public enum FireAndForgetMethod
|
||||||
{
|
{
|
||||||
|
None,
|
||||||
UnsafeQueueUserWorkItem,
|
UnsafeQueueUserWorkItem,
|
||||||
QueueUserWorkItem,
|
QueueUserWorkItem,
|
||||||
BeginInvoke,
|
BeginInvoke,
|
||||||
|
@ -89,7 +94,8 @@ namespace OpenSim.Framework
|
||||||
public static readonly Regex UUIDPattern
|
public static readonly Regex UUIDPattern
|
||||||
= new Regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$");
|
= new Regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$");
|
||||||
|
|
||||||
public static FireAndForgetMethod FireAndForgetMethod = FireAndForgetMethod.SmartThreadPool;
|
public static FireAndForgetMethod DefaultFireAndForgetMethod = FireAndForgetMethod.SmartThreadPool;
|
||||||
|
public static FireAndForgetMethod FireAndForgetMethod = DefaultFireAndForgetMethod;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the name of the directory where the current running executable
|
/// Gets the name of the directory where the current running executable
|
||||||
|
@ -1506,6 +1512,9 @@ namespace OpenSim.Framework
|
||||||
|
|
||||||
switch (FireAndForgetMethod)
|
switch (FireAndForgetMethod)
|
||||||
{
|
{
|
||||||
|
case FireAndForgetMethod.None:
|
||||||
|
realCallback.Invoke(obj);
|
||||||
|
break;
|
||||||
case FireAndForgetMethod.UnsafeQueueUserWorkItem:
|
case FireAndForgetMethod.UnsafeQueueUserWorkItem:
|
||||||
ThreadPool.UnsafeQueueUserWorkItem(realCallback, obj);
|
ThreadPool.UnsafeQueueUserWorkItem(realCallback, obj);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -549,6 +549,7 @@ namespace OpenSim
|
||||||
{
|
{
|
||||||
string regionName = string.Empty;
|
string regionName = string.Empty;
|
||||||
string regionFile = string.Empty;
|
string regionFile = string.Empty;
|
||||||
|
|
||||||
if (cmd.Length == 3)
|
if (cmd.Length == 3)
|
||||||
{
|
{
|
||||||
regionFile = cmd[2];
|
regionFile = cmd[2];
|
||||||
|
@ -558,14 +559,17 @@ namespace OpenSim
|
||||||
regionName = cmd[2];
|
regionName = cmd[2];
|
||||||
regionFile = cmd[3];
|
regionFile = cmd[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
string extension = Path.GetExtension(regionFile).ToLower();
|
string extension = Path.GetExtension(regionFile).ToLower();
|
||||||
bool isXml = extension.Equals(".xml");
|
bool isXml = extension.Equals(".xml");
|
||||||
bool isIni = extension.Equals(".ini");
|
bool isIni = extension.Equals(".ini");
|
||||||
|
|
||||||
if (!isXml && !isIni)
|
if (!isXml && !isIni)
|
||||||
{
|
{
|
||||||
MainConsole.Instance.Output("Usage: create region [\"region name\"] <region_file.ini>");
|
MainConsole.Instance.Output("Usage: create region [\"region name\"] <region_file.ini>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Path.IsPathRooted(regionFile))
|
if (!Path.IsPathRooted(regionFile))
|
||||||
{
|
{
|
||||||
string regionsDir = ConfigSource.Source.Configs["Startup"].GetString("regionload_regionsdir", "Regions").Trim();
|
string regionsDir = ConfigSource.Source.Configs["Startup"].GetString("regionload_regionsdir", "Regions").Trim();
|
||||||
|
@ -582,8 +586,18 @@ namespace OpenSim
|
||||||
regInfo = new RegionInfo(regionName, regionFile, false, ConfigSource.Source, regionName);
|
regInfo = new RegionInfo(regionName, regionFile, false, ConfigSource.Source, regionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
IScene scene;
|
Scene existingScene;
|
||||||
|
if (SceneManager.TryGetScene(regInfo.RegionID, out existingScene))
|
||||||
|
{
|
||||||
|
MainConsole.Instance.OutputFormat(
|
||||||
|
"ERROR: Cannot create region {0} with ID {1}, this ID is already assigned to region {2}",
|
||||||
|
regInfo.RegionName, regInfo.RegionID, existingScene.RegionInfo.RegionName);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
PopulateRegionEstateInfo(regInfo);
|
PopulateRegionEstateInfo(regInfo);
|
||||||
|
IScene scene;
|
||||||
CreateRegion(regInfo, true, out scene);
|
CreateRegion(regInfo, true, out scene);
|
||||||
regInfo.EstateSettings.Save();
|
regInfo.EstateSettings.Save();
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,7 +232,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
public string SeedCapRequest(string request, string path, string param,
|
public string SeedCapRequest(string request, string path, string param,
|
||||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||||
{
|
{
|
||||||
m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName);
|
// m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName);
|
||||||
|
|
||||||
if (!m_Scene.CheckClient(m_HostCapsObj.AgentID, httpRequest.RemoteIPEndPoint))
|
if (!m_Scene.CheckClient(m_HostCapsObj.AgentID, httpRequest.RemoteIPEndPoint))
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,8 +50,8 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||||
public class GetMeshModule : INonSharedRegionModule
|
public class GetMeshModule : INonSharedRegionModule
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log =
|
// private static readonly ILog m_log =
|
||||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private Scene m_scene;
|
private Scene m_scene;
|
||||||
private IAssetService m_AssetService;
|
private IAssetService m_AssetService;
|
||||||
|
@ -113,12 +113,12 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
|
|
||||||
public void RegisterCaps(UUID agentID, Caps caps)
|
public void RegisterCaps(UUID agentID, Caps caps)
|
||||||
{
|
{
|
||||||
UUID capID = UUID.Random();
|
// UUID capID = UUID.Random();
|
||||||
|
|
||||||
//caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
|
//caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
|
||||||
if (m_URL == "localhost")
|
if (m_URL == "localhost")
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[GETMESH]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
|
// m_log.DebugFormat("[GETMESH]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
|
||||||
GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService);
|
GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService);
|
||||||
IRequestHandler reqHandler = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(),
|
IRequestHandler reqHandler = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(),
|
||||||
delegate(Hashtable m_dhttpMethod)
|
delegate(Hashtable m_dhttpMethod)
|
||||||
|
@ -130,7 +130,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[GETMESH]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
|
// m_log.DebugFormat("[GETMESH]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
|
||||||
caps.RegisterHandler("GetMesh", m_URL);
|
caps.RegisterHandler("GetMesh", m_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,8 +54,9 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||||
public class GetTextureModule : INonSharedRegionModule
|
public class GetTextureModule : INonSharedRegionModule
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log =
|
// private static readonly ILog m_log =
|
||||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private Scene m_scene;
|
private Scene m_scene;
|
||||||
private IAssetService m_assetService;
|
private IAssetService m_assetService;
|
||||||
|
|
||||||
|
@ -128,12 +129,12 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
//caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
|
//caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
|
||||||
if (m_URL == "localhost")
|
if (m_URL == "localhost")
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
|
// m_log.DebugFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
|
||||||
caps.RegisterHandler("GetTexture", new GetTextureHandler("/CAPS/" + capID + "/", m_assetService));
|
caps.RegisterHandler("GetTexture", new GetTextureHandler("/CAPS/" + capID + "/", m_assetService));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[GETTEXTURE]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
|
// m_log.DebugFormat("[GETTEXTURE]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
|
||||||
caps.RegisterHandler("GetTexture", m_URL);
|
caps.RegisterHandler("GetTexture", m_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
public event ObjectAttach OnObjectAttach;
|
public event ObjectAttach OnObjectAttach;
|
||||||
public event ObjectDeselect OnObjectDetach;
|
public event ObjectDeselect OnObjectDetach;
|
||||||
public event ObjectDrop OnObjectDrop;
|
public event ObjectDrop OnObjectDrop;
|
||||||
public event GenericCall1 OnCompleteMovementToRegion;
|
public event Action<IClientAPI, bool> OnCompleteMovementToRegion;
|
||||||
public event UpdateAgent OnPreAgentUpdate;
|
public event UpdateAgent OnPreAgentUpdate;
|
||||||
public event UpdateAgent OnAgentUpdate;
|
public event UpdateAgent OnAgentUpdate;
|
||||||
public event AgentRequestSit OnAgentRequestSit;
|
public event AgentRequestSit OnAgentRequestSit;
|
||||||
|
@ -231,7 +231,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
public event ScriptReset OnScriptReset;
|
public event ScriptReset OnScriptReset;
|
||||||
public event GetScriptRunning OnGetScriptRunning;
|
public event GetScriptRunning OnGetScriptRunning;
|
||||||
public event SetScriptRunning OnSetScriptRunning;
|
public event SetScriptRunning OnSetScriptRunning;
|
||||||
public event Action<Vector3> OnAutoPilotGo;
|
public event Action<Vector3, bool> OnAutoPilotGo;
|
||||||
public event TerrainUnacked OnUnackedTerrain;
|
public event TerrainUnacked OnUnackedTerrain;
|
||||||
public event ActivateGesture OnActivateGesture;
|
public event ActivateGesture OnActivateGesture;
|
||||||
public event DeactivateGesture OnDeactivateGesture;
|
public event DeactivateGesture OnDeactivateGesture;
|
||||||
|
@ -512,7 +512,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
m_udpServer.Flush(m_udpClient);
|
m_udpServer.Flush(m_udpClient);
|
||||||
|
|
||||||
// Remove ourselves from the scene
|
// Remove ourselves from the scene
|
||||||
m_scene.RemoveClient(AgentId);
|
m_scene.RemoveClient(AgentId, true);
|
||||||
|
|
||||||
// We can't reach into other scenes and close the connection
|
// We can't reach into other scenes and close the connection
|
||||||
// We need to do this over grid communications
|
// We need to do this over grid communications
|
||||||
|
@ -692,7 +692,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
public virtual void Start()
|
public virtual void Start()
|
||||||
{
|
{
|
||||||
m_scene.AddNewClient(this);
|
m_scene.AddNewClient(this, PresenceType.User);
|
||||||
|
|
||||||
RefreshGroupMembership();
|
RefreshGroupMembership();
|
||||||
}
|
}
|
||||||
|
@ -6195,10 +6195,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
private bool HandleCompleteAgentMovement(IClientAPI sender, Packet Pack)
|
private bool HandleCompleteAgentMovement(IClientAPI sender, Packet Pack)
|
||||||
{
|
{
|
||||||
GenericCall1 handlerCompleteMovementToRegion = OnCompleteMovementToRegion;
|
Action<IClientAPI, bool> handlerCompleteMovementToRegion = OnCompleteMovementToRegion;
|
||||||
if (handlerCompleteMovementToRegion != null)
|
if (handlerCompleteMovementToRegion != null)
|
||||||
{
|
{
|
||||||
handlerCompleteMovementToRegion(sender);
|
handlerCompleteMovementToRegion(sender, true);
|
||||||
}
|
}
|
||||||
handlerCompleteMovementToRegion = null;
|
handlerCompleteMovementToRegion = null;
|
||||||
|
|
||||||
|
@ -11628,9 +11628,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
locy = Convert.ToSingle(args[1]) - (float)regionY;
|
locy = Convert.ToSingle(args[1]) - (float)regionY;
|
||||||
locz = Convert.ToSingle(args[2]);
|
locz = Convert.ToSingle(args[2]);
|
||||||
|
|
||||||
Action<Vector3> handlerAutoPilotGo = OnAutoPilotGo;
|
Action<Vector3, bool> handlerAutoPilotGo = OnAutoPilotGo;
|
||||||
if (handlerAutoPilotGo != null)
|
if (handlerAutoPilotGo != null)
|
||||||
handlerAutoPilotGo(new Vector3(locx, locy, locz));
|
handlerAutoPilotGo(new Vector3(locx, locy, locz), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -357,8 +357,6 @@ namespace Flotsam.RegionModules.AssetCache
|
||||||
|
|
||||||
asset = (AssetBase)bformatter.Deserialize(stream);
|
asset = (AssetBase)bformatter.Deserialize(stream);
|
||||||
|
|
||||||
UpdateMemoryCache(id, asset);
|
|
||||||
|
|
||||||
m_DiskHits++;
|
m_DiskHits++;
|
||||||
}
|
}
|
||||||
catch (System.Runtime.Serialization.SerializationException e)
|
catch (System.Runtime.Serialization.SerializationException e)
|
||||||
|
@ -419,9 +417,15 @@ namespace Flotsam.RegionModules.AssetCache
|
||||||
|
|
||||||
if (m_MemoryCacheEnabled)
|
if (m_MemoryCacheEnabled)
|
||||||
asset = GetFromMemoryCache(id);
|
asset = GetFromMemoryCache(id);
|
||||||
|
|
||||||
if (asset == null && m_FileCacheEnabled)
|
if (asset == null && m_FileCacheEnabled)
|
||||||
|
{
|
||||||
asset = GetFromFileCache(id);
|
asset = GetFromFileCache(id);
|
||||||
|
|
||||||
|
if (m_MemoryCacheEnabled && asset != null)
|
||||||
|
UpdateMemoryCache(id, asset);
|
||||||
|
}
|
||||||
|
|
||||||
if (((m_LogLevel >= 1)) && (m_HitRateDisplay != 0) && (m_Requests % m_HitRateDisplay == 0))
|
if (((m_LogLevel >= 1)) && (m_HitRateDisplay != 0) && (m_Requests % m_HitRateDisplay == 0))
|
||||||
{
|
{
|
||||||
m_HitRateFile = (double)m_DiskHits / m_Requests * 100.0;
|
m_HitRateFile = (double)m_DiskHits / m_Requests * 100.0;
|
||||||
|
@ -589,33 +593,59 @@ namespace Flotsam.RegionModules.AssetCache
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!Directory.Exists(directory))
|
try
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(directory);
|
if (!Directory.Exists(directory))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(directory);
|
||||||
|
}
|
||||||
|
|
||||||
|
stream = File.Open(tempname, FileMode.Create);
|
||||||
|
BinaryFormatter bformatter = new BinaryFormatter();
|
||||||
|
bformatter.Serialize(stream, asset);
|
||||||
|
}
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
m_log.ErrorFormat(
|
||||||
|
"[FLOTSAM ASSET CACHE]: Failed to write asset {0} to temporary location {1} (final {2}) on cache in {3}. Exception {4} {5}.",
|
||||||
|
asset.ID, tempname, filename, directory, e.Message, e.StackTrace);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (stream != null)
|
||||||
|
stream.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
stream = File.Open(tempname, FileMode.Create);
|
try
|
||||||
BinaryFormatter bformatter = new BinaryFormatter();
|
{
|
||||||
bformatter.Serialize(stream, asset);
|
// Now that it's written, rename it so that it can be found.
|
||||||
stream.Close();
|
//
|
||||||
|
// File.Copy(tempname, filename, true);
|
||||||
// Now that it's written, rename it so that it can be found.
|
// File.Delete(tempname);
|
||||||
File.Move(tempname, filename);
|
//
|
||||||
|
// For a brief period, this was done as a separate copy and then temporary file delete operation to
|
||||||
if (m_LogLevel >= 2)
|
// avoid an IOException caused by move if some competing thread had already written the file.
|
||||||
m_log.DebugFormat("[FLOTSAM ASSET CACHE]: Cache Stored :: {0}", asset.ID);
|
// However, this causes exceptions on Windows when other threads attempt to read a file
|
||||||
}
|
// which is still being copied. So instead, go back to moving the file and swallow any IOException.
|
||||||
catch (Exception e)
|
//
|
||||||
{
|
// This situation occurs fairly rarely anyway. We assume in this that moves are atomic on the
|
||||||
m_log.ErrorFormat(
|
// filesystem.
|
||||||
"[FLOTSAM ASSET CACHE]: Failed to write asset {0} to cache. Directory {1}, tempname {2}, filename {3}. Exception {4} {5}.",
|
File.Move(tempname, filename);
|
||||||
asset.ID, directory, tempname, filename, e.Message, e.StackTrace);
|
|
||||||
|
if (m_LogLevel >= 2)
|
||||||
|
m_log.DebugFormat("[FLOTSAM ASSET CACHE]: Cache Stored :: {0}", asset.ID);
|
||||||
|
}
|
||||||
|
catch (IOException)
|
||||||
|
{
|
||||||
|
// If we see an IOException here it's likely that some other competing thread has written the
|
||||||
|
// cache file first, so ignore. Other IOException errors (e.g. filesystem full) should be
|
||||||
|
// signally by the earlier temporary file writing code.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
if (stream != null)
|
|
||||||
stream.Close();
|
|
||||||
|
|
||||||
// Even if the write fails with an exception, we need to make sure
|
// Even if the write fails with an exception, we need to make sure
|
||||||
// that we release the lock on that file, otherwise it'll never get
|
// that we release the lock on that file, otherwise it'll never get
|
||||||
// cached
|
// cached
|
||||||
|
@ -629,13 +659,9 @@ namespace Flotsam.RegionModules.AssetCache
|
||||||
waitEvent.Set();
|
waitEvent.Set();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (m_CurrentlyWriting.Contains(filename))
|
m_CurrentlyWriting.Remove(filename);
|
||||||
{
|
|
||||||
m_CurrentlyWriting.Remove(filename);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,18 +65,18 @@ namespace OpenSim.Region.CoreModules.Asset.Tests
|
||||||
config.Configs["AssetCache"].Set("MemoryCacheEnabled", "true");
|
config.Configs["AssetCache"].Set("MemoryCacheEnabled", "true");
|
||||||
|
|
||||||
m_cache = new FlotsamAssetCache();
|
m_cache = new FlotsamAssetCache();
|
||||||
m_scene = SceneSetupHelpers.SetupScene();
|
m_scene = SceneHelpers.SetupScene();
|
||||||
SceneSetupHelpers.SetupSceneModules(m_scene, config, m_cache);
|
SceneHelpers.SetupSceneModules(m_scene, config, m_cache);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestCacheAsset()
|
public void TestCacheAsset()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
AssetBase asset = AssetHelpers.CreateAsset();
|
AssetBase asset = AssetHelpers.CreateAsset();
|
||||||
asset.ID = TestHelper.ParseTail(0x1).ToString();
|
asset.ID = TestHelpers.ParseTail(0x1).ToString();
|
||||||
|
|
||||||
// Check we don't get anything before the asset is put in the cache
|
// Check we don't get anything before the asset is put in the cache
|
||||||
AssetBase retrievedAsset = m_cache.Get(asset.ID.ToString());
|
AssetBase retrievedAsset = m_cache.Get(asset.ID.ToString());
|
||||||
|
@ -93,11 +93,11 @@ namespace OpenSim.Region.CoreModules.Asset.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestExpireAsset()
|
public void TestExpireAsset()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
AssetBase asset = AssetHelpers.CreateAsset();
|
AssetBase asset = AssetHelpers.CreateAsset();
|
||||||
asset.ID = TestHelper.ParseTail(0x2).ToString();
|
asset.ID = TestHelpers.ParseTail(0x2).ToString();
|
||||||
|
|
||||||
m_cache.Store(asset);
|
m_cache.Store(asset);
|
||||||
|
|
||||||
|
@ -110,11 +110,11 @@ namespace OpenSim.Region.CoreModules.Asset.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestClearCache()
|
public void TestClearCache()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
AssetBase asset = AssetHelpers.CreateAsset();
|
AssetBase asset = AssetHelpers.CreateAsset();
|
||||||
asset.ID = TestHelper.ParseTail(0x2).ToString();
|
asset.ID = TestHelpers.ParseTail(0x2).ToString();
|
||||||
|
|
||||||
m_cache.Store(asset);
|
m_cache.Store(asset);
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
/// <param name="silent"></param>
|
/// <param name="silent"></param>
|
||||||
public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent)
|
public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent)
|
||||||
{
|
{
|
||||||
m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject");
|
// m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -226,9 +226,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
public UUID RezSingleAttachmentFromInventory(
|
public UUID RezSingleAttachmentFromInventory(
|
||||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus)
|
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
"[ATTACHMENTS MODULE]: Rezzing attachment to point {0} from item {1} for {2}",
|
// "[ATTACHMENTS MODULE]: Rezzing attachment to point {0} from item {1} for {2}",
|
||||||
(AttachmentPoint)AttachmentPt, itemID, remoteClient.Name);
|
// (AttachmentPoint)AttachmentPt, itemID, remoteClient.Name);
|
||||||
|
|
||||||
// TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should
|
// TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should
|
||||||
// be removed when that functionality is implemented in opensim
|
// be removed when that functionality is implemented in opensim
|
||||||
|
@ -261,7 +261,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
false, false, remoteClient.AgentId, true);
|
false, false, remoteClient.AgentId, true);
|
||||||
|
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[ATTACHMENTS MODULE]: Retrieved single object {0} for attachment to {1} on point {2}",
|
// "[ATTACHMENTS MODULE]: Retrieved single object {0} for attachment to {1} on point {2}",
|
||||||
// objatt.Name, remoteClient.Name, AttachmentPt);
|
// objatt.Name, remoteClient.Name, AttachmentPt);
|
||||||
|
|
||||||
if (objatt != null)
|
if (objatt != null)
|
||||||
|
@ -466,7 +466,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
{
|
{
|
||||||
m_scene.EventManager.TriggerOnAttach(group.LocalId, itemID, UUID.Zero);
|
m_scene.EventManager.TriggerOnAttach(group.LocalId, itemID, UUID.Zero);
|
||||||
group.DetachToInventoryPrep();
|
group.DetachToInventoryPrep();
|
||||||
m_log.Debug("[ATTACHMENTS MODULE]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString());
|
// m_log.Debug("[ATTACHMENTS MODULE]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString());
|
||||||
|
|
||||||
// If an item contains scripts, it's always changed.
|
// If an item contains scripts, it's always changed.
|
||||||
// This ensures script state is saved on detach
|
// This ensures script state is saved on detach
|
||||||
|
@ -501,10 +501,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update the attachment asset for the new sog details if they have changed.
|
/// Update the attachment asset for the new sog details if they have changed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
///
|
/// <remarks>
|
||||||
/// This is essential for preserving attachment attributes such as permission. Unlike normal scene objects,
|
/// This is essential for preserving attachment attributes such as permission. Unlike normal scene objects,
|
||||||
/// these details are not stored on the region.
|
/// these details are not stored on the region.
|
||||||
///
|
/// </remarks>
|
||||||
/// <param name="remoteClient"></param>
|
/// <param name="remoteClient"></param>
|
||||||
/// <param name="grp"></param>
|
/// <param name="grp"></param>
|
||||||
/// <param name="itemID"></param>
|
/// <param name="itemID"></param>
|
||||||
|
@ -566,8 +566,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
/// <param name="silent"></param>
|
/// <param name="silent"></param>
|
||||||
protected void AttachToAgent(ScenePresence avatar, SceneObjectGroup so, uint attachmentpoint, Vector3 attachOffset, bool silent)
|
protected void AttachToAgent(ScenePresence avatar, SceneObjectGroup so, uint attachmentpoint, Vector3 attachOffset, bool silent)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1} in pt {2} pos {3} {4}", Name, avatar.Name,
|
// m_log.DebugFormat("[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1} in pt {2} pos {3} {4}",
|
||||||
attachmentpoint, attachOffset, so.RootPart.AttachedPos);
|
// so.Name, avatar.Name, attachmentpoint, attachOffset, so.RootPart.AttachedPos);
|
||||||
|
|
||||||
so.DetachFromBackup();
|
so.DetachFromBackup();
|
||||||
|
|
||||||
|
|
|
@ -37,104 +37,132 @@ using NUnit.Framework;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using OpenSim.Framework.Communications;
|
using OpenSim.Framework.Communications;
|
||||||
using OpenSim.Region.Framework.Scenes;
|
using OpenSim.Region.CoreModules.Avatar.Attachments;
|
||||||
using OpenSim.Region.Framework.Interfaces;
|
using OpenSim.Region.CoreModules.Framework.InventoryAccess;
|
||||||
using OpenSim.Region.CoreModules.World.Serialiser;
|
using OpenSim.Region.CoreModules.World.Serialiser;
|
||||||
using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
|
using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
|
||||||
|
using OpenSim.Region.Framework.Scenes;
|
||||||
|
using OpenSim.Region.Framework.Interfaces;
|
||||||
using OpenSim.Tests.Common;
|
using OpenSim.Tests.Common;
|
||||||
using OpenSim.Tests.Common.Mock;
|
using OpenSim.Tests.Common.Mock;
|
||||||
|
|
||||||
namespace OpenSim.Region.Framework.Scenes.Tests
|
namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Attachment tests
|
/// Attachment tests
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class AttachmentTests
|
public class AttachmentsModuleTests
|
||||||
{
|
{
|
||||||
public Scene scene, scene2;
|
public Scene scene;
|
||||||
public UUID agent1;
|
public UUID agent1;
|
||||||
public static Random random;
|
public static Random random;
|
||||||
public ulong region1, region2;
|
|
||||||
public AgentCircuitData acd1;
|
public AgentCircuitData acd1;
|
||||||
public SceneObjectGroup sog1, sog2, sog3;
|
public SceneObjectGroup sog1, sog2;
|
||||||
|
|
||||||
[TestFixtureSetUp]
|
[SetUp]
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
// Don't allow tests to be bamboozled by asynchronous events. Execute everything on the same thread.
|
||||||
|
Util.FireAndForgetMethod = FireAndForgetMethod.None;
|
||||||
scene = SceneSetupHelpers.SetupScene("Neighbour x", UUID.Random(), 1000, 1000);
|
|
||||||
scene2 = SceneSetupHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000);
|
|
||||||
|
|
||||||
ISharedRegionModule interregionComms = new LocalSimulationConnectorModule();
|
IConfigSource config = new IniConfigSource();
|
||||||
interregionComms.Initialise(new IniConfigSource());
|
config.AddConfig("Modules");
|
||||||
interregionComms.PostInitialise();
|
config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");
|
||||||
SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), interregionComms);
|
|
||||||
SceneSetupHelpers.SetupSceneModules(scene2, new IniConfigSource(), interregionComms);
|
scene = SceneHelpers.SetupScene();
|
||||||
|
SceneHelpers.SetupSceneModules(scene, config, new AttachmentsModule(), new BasicInventoryAccessModule());
|
||||||
|
|
||||||
agent1 = UUID.Random();
|
agent1 = UUID.Random();
|
||||||
random = new Random();
|
random = new Random();
|
||||||
sog1 = NewSOG(UUID.Random(), scene, agent1);
|
sog1 = NewSOG(UUID.Random(), scene, agent1);
|
||||||
sog2 = NewSOG(UUID.Random(), scene, agent1);
|
sog2 = NewSOG(UUID.Random(), scene, agent1);
|
||||||
sog3 = NewSOG(UUID.Random(), scene, agent1);
|
}
|
||||||
|
|
||||||
//ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize));
|
[TearDown]
|
||||||
region1 = scene.RegionInfo.RegionHandle;
|
public void TearDown()
|
||||||
region2 = scene2.RegionInfo.RegionHandle;
|
{
|
||||||
|
// We must set this back afterwards, otherwise later tests will fail since they're expecting multiple
|
||||||
SceneSetupHelpers.AddClient(scene, agent1);
|
// threads. Possibly, later tests should be rewritten not to worry about such things.
|
||||||
}
|
Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod;
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void T030_TestAddAttachments()
|
public void TestAddAttachments()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
ScenePresence presence = scene.GetScenePresence(agent1);
|
|
||||||
|
|
||||||
|
ScenePresence presence = SceneHelpers.AddScenePresence(scene, agent1);
|
||||||
presence.AddAttachment(sog1);
|
presence.AddAttachment(sog1);
|
||||||
presence.AddAttachment(sog2);
|
presence.AddAttachment(sog2);
|
||||||
presence.AddAttachment(sog3);
|
|
||||||
|
|
||||||
Assert.That(presence.HasAttachments(), Is.True);
|
Assert.That(presence.HasAttachments(), Is.True);
|
||||||
Assert.That(presence.ValidateAttachments(), Is.True);
|
Assert.That(presence.ValidateAttachments(), Is.True);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void T031_RemoveAttachments()
|
public void TestRemoveAttachments()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
ScenePresence presence = scene.GetScenePresence(agent1);
|
ScenePresence presence = SceneHelpers.AddScenePresence(scene, agent1);
|
||||||
|
presence.AddAttachment(sog1);
|
||||||
|
presence.AddAttachment(sog2);
|
||||||
presence.RemoveAttachment(sog1);
|
presence.RemoveAttachment(sog1);
|
||||||
presence.RemoveAttachment(sog2);
|
presence.RemoveAttachment(sog2);
|
||||||
presence.RemoveAttachment(sog3);
|
|
||||||
Assert.That(presence.HasAttachments(), Is.False);
|
Assert.That(presence.HasAttachments(), Is.False);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestRezAttachmentsOnAvatarEntrance()
|
||||||
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
|
UUID userId = TestHelpers.ParseTail(0x1);
|
||||||
|
UUID attItemId = TestHelpers.ParseTail(0x2);
|
||||||
|
UUID attAssetId = TestHelpers.ParseTail(0x3);
|
||||||
|
string attName = "att";
|
||||||
|
|
||||||
|
UserAccountHelpers.CreateUserWithInventory(scene, userId);
|
||||||
|
InventoryItemBase attItem
|
||||||
|
= UserInventoryHelpers.CreateInventoryItem(
|
||||||
|
scene, attName, attItemId, attAssetId, userId, InventoryType.Object);
|
||||||
|
|
||||||
|
AgentCircuitData acd = SceneHelpers.GenerateAgentData(userId);
|
||||||
|
acd.Appearance = new AvatarAppearance();
|
||||||
|
acd.Appearance.SetAttachment((int)AttachmentPoint.Chest, attItem.ID, attItem.AssetID);
|
||||||
|
ScenePresence presence = SceneHelpers.AddScenePresence(scene, acd);
|
||||||
|
|
||||||
|
Assert.That(presence.HasAttachments(), Is.True);
|
||||||
|
List<SceneObjectGroup> attachments = presence.Attachments;
|
||||||
|
|
||||||
|
Assert.That(attachments.Count, Is.EqualTo(1));
|
||||||
|
Assert.That(attachments[0].Name, Is.EqualTo(attName));
|
||||||
|
}
|
||||||
|
|
||||||
// I'm commenting this test because scene setup NEEDS InventoryService to
|
// I'm commenting this test because scene setup NEEDS InventoryService to
|
||||||
// be non-null
|
// be non-null
|
||||||
//[Test]
|
//[Test]
|
||||||
public void T032_CrossAttachments()
|
// public void T032_CrossAttachments()
|
||||||
{
|
// {
|
||||||
TestHelper.InMethod();
|
// TestHelpers.InMethod();
|
||||||
|
//
|
||||||
ScenePresence presence = scene.GetScenePresence(agent1);
|
// ScenePresence presence = scene.GetScenePresence(agent1);
|
||||||
ScenePresence presence2 = scene2.GetScenePresence(agent1);
|
// ScenePresence presence2 = scene2.GetScenePresence(agent1);
|
||||||
presence2.AddAttachment(sog1);
|
// presence2.AddAttachment(sog1);
|
||||||
presence2.AddAttachment(sog2);
|
// presence2.AddAttachment(sog2);
|
||||||
|
//
|
||||||
ISharedRegionModule serialiser = new SerialiserModule();
|
// ISharedRegionModule serialiser = new SerialiserModule();
|
||||||
SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), serialiser);
|
// SceneHelpers.SetupSceneModules(scene, new IniConfigSource(), serialiser);
|
||||||
SceneSetupHelpers.SetupSceneModules(scene2, new IniConfigSource(), serialiser);
|
// SceneHelpers.SetupSceneModules(scene2, new IniConfigSource(), serialiser);
|
||||||
|
//
|
||||||
Assert.That(presence.HasAttachments(), Is.False, "Presence has attachments before cross");
|
// Assert.That(presence.HasAttachments(), Is.False, "Presence has attachments before cross");
|
||||||
|
//
|
||||||
//Assert.That(presence2.CrossAttachmentsIntoNewRegion(region1, true), Is.True, "Cross was not successful");
|
// //Assert.That(presence2.CrossAttachmentsIntoNewRegion(region1, true), Is.True, "Cross was not successful");
|
||||||
Assert.That(presence2.HasAttachments(), Is.False, "Presence2 objects were not deleted");
|
// Assert.That(presence2.HasAttachments(), Is.False, "Presence2 objects were not deleted");
|
||||||
Assert.That(presence.HasAttachments(), Is.True, "Presence has not received new objects");
|
// Assert.That(presence.HasAttachments(), Is.True, "Presence has not received new objects");
|
||||||
}
|
// }
|
||||||
|
|
||||||
private SceneObjectGroup NewSOG(UUID uuid, Scene scene, UUID agent)
|
private SceneObjectGroup NewSOG(UUID uuid, Scene scene, UUID agent)
|
||||||
{
|
{
|
|
@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
public void NewClient(IClientAPI client)
|
public void NewClient(IClientAPI client)
|
||||||
{
|
{
|
||||||
client.OnRequestWearables += SendWearables;
|
client.OnRequestWearables += SendWearables;
|
||||||
client.OnSetAppearance += SetAppearance;
|
client.OnSetAppearance += SetAppearanceFromClient;
|
||||||
client.OnAvatarNowWearing += AvatarIsWearing;
|
client.OnAvatarNowWearing += AvatarIsWearing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
/// <param name="client"></param>
|
/// <param name="client"></param>
|
||||||
/// <param name="texture"></param>
|
/// <param name="texture"></param>
|
||||||
/// <param name="visualParam"></param>
|
/// <param name="visualParam"></param>
|
||||||
public void SetAppearance(IClientAPI client, Primitive.TextureEntry textureEntry, byte[] visualParams)
|
public void SetAppearanceFromClient(IClientAPI client, Primitive.TextureEntry textureEntry, byte[] visualParams)
|
||||||
{
|
{
|
||||||
ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
|
ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
|
||||||
if (sp == null)
|
if (sp == null)
|
||||||
|
@ -257,6 +257,85 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool SaveBakedTextures(UUID agentId)
|
||||||
|
{
|
||||||
|
ScenePresence sp = m_scene.GetScenePresence(agentId);
|
||||||
|
|
||||||
|
if (sp == null || sp.IsChildAgent)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
AvatarAppearance appearance = sp.Appearance;
|
||||||
|
Primitive.TextureEntryFace[] faceTextures = appearance.Texture.FaceTextures;
|
||||||
|
|
||||||
|
m_log.DebugFormat(
|
||||||
|
"[AV FACTORY]: Permanently saving baked textures for {0} in {1}",
|
||||||
|
sp.Name, m_scene.RegionInfo.RegionName);
|
||||||
|
|
||||||
|
foreach (int i in Enum.GetValues(typeof(BakeType)))
|
||||||
|
{
|
||||||
|
BakeType bakeType = (BakeType)i;
|
||||||
|
|
||||||
|
if (bakeType == BakeType.Unknown)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// m_log.DebugFormat(
|
||||||
|
// "[AVFACTORY]: NPC avatar {0} has texture id {1} : {2}",
|
||||||
|
// acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]);
|
||||||
|
|
||||||
|
int ftIndex = (int)AppearanceManager.BakeTypeToAgentTextureIndex(bakeType);
|
||||||
|
Primitive.TextureEntryFace bakedTextureFace = faceTextures[ftIndex];
|
||||||
|
|
||||||
|
if (bakedTextureFace == null)
|
||||||
|
{
|
||||||
|
m_log.WarnFormat(
|
||||||
|
"[AV FACTORY]: No texture ID set for {0} for {1} in {2} not found when trying to save permanently",
|
||||||
|
bakeType, sp.Name, m_scene.RegionInfo.RegionName);
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
AssetBase asset = m_scene.AssetService.Get(bakedTextureFace.TextureID.ToString());
|
||||||
|
|
||||||
|
if (asset != null)
|
||||||
|
{
|
||||||
|
asset.Temporary = false;
|
||||||
|
m_scene.AssetService.Store(asset);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_log.WarnFormat(
|
||||||
|
"[AV FACTORY]: Baked texture id {0} not found for bake {1} for avatar {2} in {3} when trying to save permanently",
|
||||||
|
bakedTextureFace.TextureID, bakeType, sp.Name, m_scene.RegionInfo.RegionName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// for (int i = 0; i < faceTextures.Length; i++)
|
||||||
|
// {
|
||||||
|
//// m_log.DebugFormat(
|
||||||
|
//// "[AVFACTORY]: NPC avatar {0} has texture id {1} : {2}",
|
||||||
|
//// acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]);
|
||||||
|
//
|
||||||
|
// if (faceTextures[i] == null)
|
||||||
|
// continue;
|
||||||
|
//
|
||||||
|
// AssetBase asset = m_scene.AssetService.Get(faceTextures[i].TextureID.ToString());
|
||||||
|
//
|
||||||
|
// if (asset != null)
|
||||||
|
// {
|
||||||
|
// asset.Temporary = false;
|
||||||
|
// m_scene.AssetService.Store(asset);
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// m_log.WarnFormat(
|
||||||
|
// "[AV FACTORY]: Baked texture {0} for {1} in {2} not found when trying to save permanently",
|
||||||
|
// faceTextures[i].TextureID, sp.Name, m_scene.RegionInfo.RegionName);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
#region UpdateAppearanceTimer
|
#region UpdateAppearanceTimer
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -289,25 +368,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleAppearanceSend(UUID agentid)
|
private void SaveAppearance(UUID agentid)
|
||||||
{
|
|
||||||
ScenePresence sp = m_scene.GetScenePresence(agentid);
|
|
||||||
if (sp == null)
|
|
||||||
{
|
|
||||||
m_log.WarnFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentid);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// m_log.WarnFormat("[AVFACTORY]: Handle appearance send for {0}", agentid);
|
|
||||||
|
|
||||||
// Send the appearance to everyone in the scene
|
|
||||||
sp.SendAppearanceToAllOtherAgents();
|
|
||||||
|
|
||||||
// Send animations back to the avatar as well
|
|
||||||
sp.Animator.SendAnimPack();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void HandleAppearanceSave(UUID agentid)
|
|
||||||
{
|
{
|
||||||
// We must set appearance parameters in the en_US culture in order to avoid issues where values are saved
|
// We must set appearance parameters in the en_US culture in order to avoid issues where values are saved
|
||||||
// in a culture where decimal points are commas and then reloaded in a culture which just treats them as
|
// in a culture where decimal points are commas and then reloaded in a culture which just treats them as
|
||||||
|
@ -337,7 +398,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
{
|
{
|
||||||
if (kvp.Value < now)
|
if (kvp.Value < now)
|
||||||
{
|
{
|
||||||
Util.FireAndForget(delegate(object o) { HandleAppearanceSend(kvp.Key); });
|
Util.FireAndForget(delegate(object o) { SendAppearance(kvp.Key); });
|
||||||
m_sendqueue.Remove(kvp.Key);
|
m_sendqueue.Remove(kvp.Key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -350,7 +411,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
{
|
{
|
||||||
if (kvp.Value < now)
|
if (kvp.Value < now)
|
||||||
{
|
{
|
||||||
Util.FireAndForget(delegate(object o) { HandleAppearanceSave(kvp.Key); });
|
Util.FireAndForget(delegate(object o) { SaveAppearance(kvp.Key); });
|
||||||
m_savequeue.Remove(kvp.Key);
|
m_savequeue.Remove(kvp.Key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -427,6 +488,24 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool SendAppearance(UUID agentId)
|
||||||
|
{
|
||||||
|
ScenePresence sp = m_scene.GetScenePresence(agentId);
|
||||||
|
if (sp == null)
|
||||||
|
{
|
||||||
|
m_log.WarnFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentId);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send the appearance to everyone in the scene
|
||||||
|
sp.SendAppearanceToAllOtherAgents();
|
||||||
|
|
||||||
|
// Send animations back to the avatar as well
|
||||||
|
sp.Animator.SendAnimPack();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance)
|
private void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance)
|
||||||
{
|
{
|
||||||
IInventoryService invService = m_scene.InventoryService;
|
IInventoryService invService = m_scene.InventoryService;
|
||||||
|
|
|
@ -44,21 +44,21 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
[Test]
|
[Test]
|
||||||
public void TestSetAppearance()
|
public void TestSetAppearance()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
UUID userId = TestHelper.ParseTail(0x1);
|
UUID userId = TestHelpers.ParseTail(0x1);
|
||||||
|
|
||||||
AvatarFactoryModule afm = new AvatarFactoryModule();
|
AvatarFactoryModule afm = new AvatarFactoryModule();
|
||||||
TestScene scene = SceneSetupHelpers.SetupScene();
|
TestScene scene = SceneHelpers.SetupScene();
|
||||||
SceneSetupHelpers.SetupSceneModules(scene, afm);
|
SceneHelpers.SetupSceneModules(scene, afm);
|
||||||
TestClient tc = SceneSetupHelpers.AddClient(scene, userId);
|
IClientAPI tc = SceneHelpers.AddScenePresence(scene, userId).ControllingClient;
|
||||||
|
|
||||||
byte[] visualParams = new byte[AvatarAppearance.VISUALPARAM_COUNT];
|
byte[] visualParams = new byte[AvatarAppearance.VISUALPARAM_COUNT];
|
||||||
for (byte i = 0; i < visualParams.Length; i++)
|
for (byte i = 0; i < visualParams.Length; i++)
|
||||||
visualParams[i] = i;
|
visualParams[i] = i;
|
||||||
|
|
||||||
afm.SetAppearance(tc, new Primitive.TextureEntry(TestHelper.ParseTail(0x10)), visualParams);
|
afm.SetAppearanceFromClient(tc, new Primitive.TextureEntry(TestHelpers.ParseTail(0x10)), visualParams);
|
||||||
|
|
||||||
ScenePresence sp = scene.GetScenePresence(userId);
|
ScenePresence sp = scene.GetScenePresence(userId);
|
||||||
|
|
||||||
|
|
|
@ -100,8 +100,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
|
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
|
SceneHelpers.SetupSceneModules(scene, archiverModule);
|
||||||
|
|
||||||
UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire");
|
UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire");
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
|
|
||||||
// Create scene object asset
|
// Create scene object asset
|
||||||
UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
|
UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
|
||||||
SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, ownerId, "Ray Gun Object", 0x50);
|
SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, ownerId, "Ray Gun Object", 0x50);
|
||||||
|
|
||||||
UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
|
UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
|
||||||
AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
|
AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
|
||||||
|
@ -127,10 +127,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
scene.AddInventoryItem(item1);
|
scene.AddInventoryItem(item1);
|
||||||
|
|
||||||
// Create coalesced objects asset
|
// Create coalesced objects asset
|
||||||
SceneObjectGroup cobj1 = SceneSetupHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object1", 0x120);
|
SceneObjectGroup cobj1 = SceneHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object1", 0x120);
|
||||||
cobj1.AbsolutePosition = new Vector3(15, 30, 45);
|
cobj1.AbsolutePosition = new Vector3(15, 30, 45);
|
||||||
|
|
||||||
SceneObjectGroup cobj2 = SceneSetupHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object2", 0x140);
|
SceneObjectGroup cobj2 = SceneHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object2", 0x140);
|
||||||
cobj2.AbsolutePosition = new Vector3(25, 50, 75);
|
cobj2.AbsolutePosition = new Vector3(25, 50, 75);
|
||||||
|
|
||||||
CoalescedSceneObjects coa = new CoalescedSceneObjects(m_uaLL1.PrincipalID, cobj1, cobj2);
|
CoalescedSceneObjects coa = new CoalescedSceneObjects(m_uaLL1.PrincipalID, cobj1, cobj2);
|
||||||
|
|
|
@ -61,14 +61,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
SerialiserModule serialiserModule = new SerialiserModule();
|
SerialiserModule serialiserModule = new SerialiserModule();
|
||||||
m_archiverModule = new InventoryArchiverModule();
|
m_archiverModule = new InventoryArchiverModule();
|
||||||
|
|
||||||
m_scene = SceneSetupHelpers.SetupScene();
|
m_scene = SceneHelpers.SetupScene();
|
||||||
SceneSetupHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule);
|
SceneHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestLoadCoalesecedItem()
|
public void TestLoadCoalesecedItem()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "password");
|
UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "password");
|
||||||
|
@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestOrder()
|
public void TestOrder()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
MemoryStream archiveReadStream = new MemoryStream(m_iarStreamBytes);
|
MemoryStream archiveReadStream = new MemoryStream(m_iarStreamBytes);
|
||||||
|
@ -129,7 +129,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestSaveItemToIar()
|
public void TestSaveItemToIar()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
// Create user
|
// Create user
|
||||||
|
@ -141,7 +141,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
|
|
||||||
// Create asset
|
// Create asset
|
||||||
UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
|
UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
|
||||||
SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, ownerId, "My Little Dog Object", 0x50);
|
SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, ownerId, "My Little Dog Object", 0x50);
|
||||||
|
|
||||||
UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
|
UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
|
||||||
AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
|
AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
|
||||||
|
@ -224,7 +224,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestSaveItemToIarNoAssets()
|
public void TestSaveItemToIarNoAssets()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
// Create user
|
// Create user
|
||||||
|
@ -236,7 +236,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
|
|
||||||
// Create asset
|
// Create asset
|
||||||
UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
|
UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
|
||||||
SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, ownerId, "My Little Dog Object", 0x50);
|
SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, ownerId, "My Little Dog Object", 0x50);
|
||||||
|
|
||||||
UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
|
UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
|
||||||
AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
|
AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
|
||||||
|
@ -325,7 +325,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestLoadIarCreatorAccountPresent()
|
public void TestLoadIarCreatorAccountPresent()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "meowfood");
|
UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "meowfood");
|
||||||
|
@ -357,7 +357,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestLoadIarV0_1SameNameCreator()
|
public void TestLoadIarV0_1SameNameCreator()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "meowfood");
|
UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "meowfood");
|
||||||
|
@ -390,7 +390,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestLoadIarV0_1AbsentCreator()
|
public void TestLoadIarV0_1AbsentCreator()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "password");
|
UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "password");
|
||||||
|
|
|
@ -57,13 +57,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestSavePathToIarV0_1()
|
public void TestSavePathToIarV0_1()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
|
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
|
||||||
|
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
|
SceneHelpers.SetupSceneModules(scene, archiverModule);
|
||||||
|
|
||||||
// Create user
|
// Create user
|
||||||
string userFirstName = "Jock";
|
string userFirstName = "Jock";
|
||||||
|
@ -172,16 +172,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestLoadIarToInventoryPaths()
|
public void TestLoadIarToInventoryPaths()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
SerialiserModule serialiserModule = new SerialiserModule();
|
SerialiserModule serialiserModule = new SerialiserModule();
|
||||||
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
|
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
|
||||||
|
|
||||||
// Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
|
// Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
|
|
||||||
SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
|
SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
|
||||||
|
|
||||||
UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "meowfood");
|
UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "meowfood");
|
||||||
UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire");
|
UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire");
|
||||||
|
@ -217,13 +217,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestLoadIarPathStartsWithSlash()
|
public void TestLoadIarPathStartsWithSlash()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
SerialiserModule serialiserModule = new SerialiserModule();
|
SerialiserModule serialiserModule = new SerialiserModule();
|
||||||
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
|
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
|
SceneHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
|
||||||
|
|
||||||
UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "password");
|
UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "password");
|
||||||
archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/Objects", "password", m_iarStream);
|
archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/Objects", "password", m_iarStream);
|
||||||
|
@ -238,7 +238,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestLoadIarPathWithEscapedChars()
|
public void TestLoadIarPathWithEscapedChars()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
string itemName = "You & you are a mean/man/";
|
string itemName = "You & you are a mean/man/";
|
||||||
|
@ -247,8 +247,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
|
|
||||||
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
|
InventoryArchiverModule archiverModule = new InventoryArchiverModule();
|
||||||
|
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
|
SceneHelpers.SetupSceneModules(scene, archiverModule);
|
||||||
|
|
||||||
// Create user
|
// Create user
|
||||||
string userFirstName = "Jock";
|
string userFirstName = "Jock";
|
||||||
|
@ -323,10 +323,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestNewIarPath()
|
public void TestNewIarPath()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
|
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
|
||||||
|
|
||||||
Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>();
|
Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>();
|
||||||
|
@ -390,10 +390,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestPartExistingIarPath()
|
public void TestPartExistingIarPath()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
//log4net.Config.XmlConfigurator.Configure();
|
//log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
|
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
|
||||||
|
|
||||||
string folder1ExistingName = "a";
|
string folder1ExistingName = "a";
|
||||||
|
@ -441,10 +441,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestMergeIarPath()
|
public void TestMergeIarPath()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
|
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
|
||||||
|
|
||||||
string folder1ExistingName = "a";
|
string folder1ExistingName = "a";
|
||||||
|
|
|
@ -1065,10 +1065,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Enable Child Agent
|
#region Enable Child Agent
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This informs a single neighbouring region about agent "avatar".
|
/// This informs a single neighbouring region about agent "avatar".
|
||||||
/// Calls an asynchronous method to do so.. so it doesn't lag the sim.
|
/// Calls an asynchronous method to do so.. so it doesn't lag the sim.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="sp"></param>
|
||||||
|
/// <param name="region"></param>
|
||||||
public void EnableChildAgent(ScenePresence sp, GridRegion region)
|
public void EnableChildAgent(ScenePresence sp, GridRegion region)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[ENTITY TRANSFER]: Enabling child agent in new neighbour {0}", region.RegionName);
|
m_log.DebugFormat("[ENTITY TRANSFER]: Enabling child agent in new neighbour {0}", region.RegionName);
|
||||||
|
@ -1126,6 +1129,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
/// This informs all neighbouring regions about agent "avatar".
|
/// This informs all neighbouring regions about agent "avatar".
|
||||||
/// Calls an asynchronous method to do so.. so it doesn't lag the sim.
|
/// Calls an asynchronous method to do so.. so it doesn't lag the sim.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="sp"></param>
|
||||||
public void EnableChildAgents(ScenePresence sp)
|
public void EnableChildAgents(ScenePresence sp)
|
||||||
{
|
{
|
||||||
List<GridRegion> neighbours = new List<GridRegion>();
|
List<GridRegion> neighbours = new List<GridRegion>();
|
||||||
|
@ -1312,7 +1316,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
Utils.LongToUInts(reg.RegionHandle, out x, out y);
|
Utils.LongToUInts(reg.RegionHandle, out x, out y);
|
||||||
x = x / Constants.RegionSize;
|
x = x / Constants.RegionSize;
|
||||||
y = y / Constants.RegionSize;
|
y = y / Constants.RegionSize;
|
||||||
m_log.Debug("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")");
|
m_log.Debug("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint + ")");
|
||||||
|
|
||||||
string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath);
|
string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath);
|
||||||
|
|
||||||
|
|
|
@ -964,8 +964,20 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_log.WarnFormat(
|
||||||
|
"[InventoryAccessModule]: Could not find asset {0} for item {1} {2} for {3} in RezObject()", item.AssetID, item.Name, item.ID, remoteClient.Name);
|
||||||
|
}
|
||||||
|
|
||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_log.WarnFormat(
|
||||||
|
"[InventoryAccessModule]: Could not find item {0} for {1} in RezObject()",
|
||||||
|
itemID, remoteClient.Name);
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,8 +65,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests
|
||||||
config.AddConfig("Modules");
|
config.AddConfig("Modules");
|
||||||
config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");
|
config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");
|
||||||
|
|
||||||
m_scene = SceneSetupHelpers.SetupScene();
|
m_scene = SceneHelpers.SetupScene();
|
||||||
SceneSetupHelpers.SetupSceneModules(m_scene, config, m_iam);
|
SceneHelpers.SetupSceneModules(m_scene, config, m_iam);
|
||||||
|
|
||||||
// Create user
|
// Create user
|
||||||
string userFirstName = "Jock";
|
string userFirstName = "Jock";
|
||||||
|
@ -82,14 +82,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestRezCoalescedObject()
|
public void TestRezCoalescedObject()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
// Create asset
|
// Create asset
|
||||||
SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, m_userId, "Object1", 0x20);
|
SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, m_userId, "Object1", 0x20);
|
||||||
object1.AbsolutePosition = new Vector3(15, 30, 45);
|
object1.AbsolutePosition = new Vector3(15, 30, 45);
|
||||||
|
|
||||||
SceneObjectGroup object2 = SceneSetupHelpers.CreateSceneObject(1, m_userId, "Object2", 0x40);
|
SceneObjectGroup object2 = SceneHelpers.CreateSceneObject(1, m_userId, "Object2", 0x40);
|
||||||
object2.AbsolutePosition = new Vector3(25, 50, 75);
|
object2.AbsolutePosition = new Vector3(25, 50, 75);
|
||||||
|
|
||||||
CoalescedSceneObjects coa = new CoalescedSceneObjects(m_userId, object1, object2);
|
CoalescedSceneObjects coa = new CoalescedSceneObjects(m_userId, object1, object2);
|
||||||
|
@ -138,11 +138,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestRezObject()
|
public void TestRezObject()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
// Create asset
|
// Create asset
|
||||||
SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, m_userId, "My Little Dog Object", 0x40);
|
SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, m_userId, "My Little Dog Object", 0x40);
|
||||||
|
|
||||||
UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
|
UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
|
||||||
AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
|
AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
|
||||||
|
|
|
@ -186,7 +186,6 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private string[] GetUserNames(UUID uuid)
|
private string[] GetUserNames(UUID uuid)
|
||||||
{
|
{
|
||||||
string[] returnstring = new string[2];
|
string[] returnstring = new string[2];
|
||||||
|
@ -292,6 +291,25 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||||
return userID.ToString();
|
return userID.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AddUser(UUID uuid, string first, string last)
|
||||||
|
{
|
||||||
|
if (m_UserCache.ContainsKey(uuid))
|
||||||
|
return;
|
||||||
|
|
||||||
|
UserData user = new UserData();
|
||||||
|
user.Id = uuid;
|
||||||
|
user.FirstName = first;
|
||||||
|
user.LastName = last;
|
||||||
|
// user.ProfileURL = we should initialize this to the default
|
||||||
|
|
||||||
|
AddUserInternal(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddUser(UUID uuid, string first, string last, string profileURL)
|
||||||
|
{
|
||||||
|
AddUser(uuid, profileURL + ";" + first + " " + last);
|
||||||
|
}
|
||||||
|
|
||||||
public void AddUser(UUID id, string creatorData)
|
public void AddUser(UUID id, string creatorData)
|
||||||
{
|
{
|
||||||
if (m_UserCache.ContainsKey(id))
|
if (m_UserCache.ContainsKey(id))
|
||||||
|
@ -299,18 +317,17 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||||
|
|
||||||
// m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, craetorData {1}", id, creatorData);
|
// m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, craetorData {1}", id, creatorData);
|
||||||
|
|
||||||
UserData user = new UserData();
|
|
||||||
user.Id = id;
|
|
||||||
UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, id);
|
UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, id);
|
||||||
|
|
||||||
if (account != null)
|
if (account != null)
|
||||||
{
|
{
|
||||||
user.FirstName = account.FirstName;
|
AddUser(id, account.FirstName, account.LastName);
|
||||||
user.LastName = account.LastName;
|
|
||||||
// user.ProfileURL = we should initialize this to the default
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
UserData user = new UserData();
|
||||||
|
user.Id = id;
|
||||||
|
|
||||||
if (creatorData != null && creatorData != string.Empty)
|
if (creatorData != null && creatorData != string.Empty)
|
||||||
{
|
{
|
||||||
//creatorData = <endpoint>;<name>
|
//creatorData = <endpoint>;<name>
|
||||||
|
@ -338,17 +355,19 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||||
user.FirstName = "Unknown";
|
user.FirstName = "Unknown";
|
||||||
user.LastName = "User";
|
user.LastName = "User";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AddUserInternal(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
lock (m_UserCache)
|
|
||||||
m_UserCache[id] = user;
|
|
||||||
|
|
||||||
m_log.DebugFormat("[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", user.Id, user.FirstName, user.LastName, user.HomeURL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddUser(UUID uuid, string first, string last, string profileURL)
|
void AddUserInternal(UserData user)
|
||||||
{
|
{
|
||||||
AddUser(uuid, profileURL + ";" + first + " " + last);
|
lock (m_UserCache)
|
||||||
|
m_UserCache[user.Id] = user;
|
||||||
|
|
||||||
|
m_log.DebugFormat(
|
||||||
|
"[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}",
|
||||||
|
user.Id, user.FirstName, user.LastName, user.HomeURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
//public void AddUser(UUID uuid, string userData)
|
//public void AddUser(UUID uuid, string userData)
|
||||||
|
|
|
@ -93,7 +93,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser
|
||||||
lookat = ((ScenePresence)sp).Lookat;
|
lookat = ((ScenePresence)sp).Lookat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName);
|
|
||||||
|
// m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName);
|
||||||
m_GridUserService.LoggedOut(client.AgentId.ToString(), client.SessionId, client.Scene.RegionInfo.RegionID, position, lookat);
|
m_GridUserService.LoggedOut(client.AgentId.ToString(), client.SessionId, client.Scene.RegionInfo.RegionID, position, lookat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -211,11 +211,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
m_log.DebugFormat("[HG INVENTORY CONNECTOR]: User {0} does not have InventoryServerURI. OH NOES!", userID);
|
// m_log.DebugFormat("[HG INVENTORY CONNECTOR]: User {0} does not have InventoryServerURI. OH NOES!", userID);
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sp == null)
|
if (sp == null)
|
||||||
|
|
|
@ -94,7 +94,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.DebugFormat("[PRESENCE DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName);
|
// m_log.DebugFormat("[PRESENCE DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName);
|
||||||
m_PresenceService.LogoutAgent(client.SessionId);
|
m_PresenceService.LogoutAgent(client.SessionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -129,14 +129,12 @@ namespace OpenSim.Region.CoreModules.World
|
||||||
switch (cmd[1])
|
switch (cmd[1])
|
||||||
{
|
{
|
||||||
case "enable":
|
case "enable":
|
||||||
if (scene.LoginsDisabled)
|
|
||||||
MainConsole.Instance.Output(String.Format("Enabling logins for region {0}", scene.RegionInfo.RegionName));
|
|
||||||
scene.LoginsDisabled = false;
|
scene.LoginsDisabled = false;
|
||||||
|
MainConsole.Instance.Output(String.Format("Logins are enabled for region {0}", scene.RegionInfo.RegionName));
|
||||||
break;
|
break;
|
||||||
case "disable":
|
case "disable":
|
||||||
if (!scene.LoginsDisabled)
|
|
||||||
MainConsole.Instance.Output(String.Format("Disabling logins for region {0}", scene.RegionInfo.RegionName));
|
|
||||||
scene.LoginsDisabled = true;
|
scene.LoginsDisabled = true;
|
||||||
|
MainConsole.Instance.Output(String.Format("Logins are disabled for region {0}", scene.RegionInfo.RegionName));
|
||||||
break;
|
break;
|
||||||
case "status":
|
case "status":
|
||||||
if (scene.LoginsDisabled)
|
if (scene.LoginsDisabled)
|
||||||
|
|
|
@ -68,8 +68,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
||||||
SerialiserModule serialiserModule = new SerialiserModule();
|
SerialiserModule serialiserModule = new SerialiserModule();
|
||||||
TerrainModule terrainModule = new TerrainModule();
|
TerrainModule terrainModule = new TerrainModule();
|
||||||
|
|
||||||
m_scene = SceneSetupHelpers.SetupScene();
|
m_scene = SceneHelpers.SetupScene();
|
||||||
SceneSetupHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule);
|
SceneHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LoadCompleted(Guid requestId, string errorMessage)
|
private void LoadCompleted(Guid requestId, string errorMessage)
|
||||||
|
@ -125,7 +125,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestSaveOar()
|
public void TestSaveOar()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
SceneObjectPart part1 = CreateSceneObjectPart1();
|
SceneObjectPart part1 = CreateSceneObjectPart1();
|
||||||
|
@ -217,7 +217,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestSaveOarNoAssets()
|
public void TestSaveOarNoAssets()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
SceneObjectPart part1 = CreateSceneObjectPart1();
|
SceneObjectPart part1 = CreateSceneObjectPart1();
|
||||||
|
@ -300,7 +300,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestLoadOar()
|
public void TestLoadOar()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
MemoryStream archiveWriteStream = new MemoryStream();
|
MemoryStream archiveWriteStream = new MemoryStream();
|
||||||
|
@ -409,7 +409,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestLoadOarRegionSettings()
|
public void TestLoadOarRegionSettings()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
//log4net.Config.XmlConfigurator.Configure();
|
//log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
MemoryStream archiveWriteStream = new MemoryStream();
|
MemoryStream archiveWriteStream = new MemoryStream();
|
||||||
|
@ -505,7 +505,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
||||||
//[Test]
|
//[Test]
|
||||||
public void TestMergeOar()
|
public void TestMergeOar()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
//XmlConfigurator.Configure();
|
//XmlConfigurator.Configure();
|
||||||
|
|
||||||
MemoryStream archiveWriteStream = new MemoryStream();
|
MemoryStream archiveWriteStream = new MemoryStream();
|
||||||
|
@ -524,8 +524,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
||||||
SerialiserModule serialiserModule = new SerialiserModule();
|
SerialiserModule serialiserModule = new SerialiserModule();
|
||||||
TerrainModule terrainModule = new TerrainModule();
|
TerrainModule terrainModule = new TerrainModule();
|
||||||
|
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule);
|
SceneHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule);
|
||||||
|
|
||||||
m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false);
|
m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false);
|
||||||
|
|
||||||
|
|
|
@ -64,8 +64,8 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
|
||||||
{
|
{
|
||||||
m_pcm = new PrimCountModule();
|
m_pcm = new PrimCountModule();
|
||||||
LandManagementModule lmm = new LandManagementModule();
|
LandManagementModule lmm = new LandManagementModule();
|
||||||
m_scene = SceneSetupHelpers.SetupScene();
|
m_scene = SceneHelpers.SetupScene();
|
||||||
SceneSetupHelpers.SetupSceneModules(m_scene, lmm, m_pcm);
|
SceneHelpers.SetupSceneModules(m_scene, lmm, m_pcm);
|
||||||
|
|
||||||
int xParcelDivider = (int)Constants.RegionSize - 1;
|
int xParcelDivider = (int)Constants.RegionSize - 1;
|
||||||
|
|
||||||
|
@ -106,12 +106,12 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestAddOwnerObject()
|
public void TestAddOwnerObject()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
IPrimCounts pc = m_lo.PrimCounts;
|
IPrimCounts pc = m_lo.PrimCounts;
|
||||||
|
|
||||||
SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_userId, "a", 0x01);
|
SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01);
|
||||||
m_scene.AddNewSceneObject(sog, false);
|
m_scene.AddNewSceneObject(sog, false);
|
||||||
|
|
||||||
Assert.That(pc.Owner, Is.EqualTo(3));
|
Assert.That(pc.Owner, Is.EqualTo(3));
|
||||||
|
@ -124,7 +124,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
|
||||||
Assert.That(pc.Simulator, Is.EqualTo(3));
|
Assert.That(pc.Simulator, Is.EqualTo(3));
|
||||||
|
|
||||||
// Add a second object and retest
|
// Add a second object and retest
|
||||||
SceneObjectGroup sog2 = SceneSetupHelpers.CreateSceneObject(2, m_userId, "b", 0x10);
|
SceneObjectGroup sog2 = SceneHelpers.CreateSceneObject(2, m_userId, "b", 0x10);
|
||||||
m_scene.AddNewSceneObject(sog2, false);
|
m_scene.AddNewSceneObject(sog2, false);
|
||||||
|
|
||||||
Assert.That(pc.Owner, Is.EqualTo(5));
|
Assert.That(pc.Owner, Is.EqualTo(5));
|
||||||
|
@ -143,12 +143,12 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestCopyOwnerObject()
|
public void TestCopyOwnerObject()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
IPrimCounts pc = m_lo.PrimCounts;
|
IPrimCounts pc = m_lo.PrimCounts;
|
||||||
|
|
||||||
SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_userId, "a", 0x01);
|
SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01);
|
||||||
m_scene.AddNewSceneObject(sog, false);
|
m_scene.AddNewSceneObject(sog, false);
|
||||||
m_scene.SceneGraph.DuplicateObject(sog.LocalId, Vector3.Zero, 0, m_userId, UUID.Zero, Quaternion.Identity);
|
m_scene.SceneGraph.DuplicateObject(sog.LocalId, Vector3.Zero, 0, m_userId, UUID.Zero, Quaternion.Identity);
|
||||||
|
|
||||||
|
@ -169,12 +169,12 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestMoveOwnerObject()
|
public void TestMoveOwnerObject()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_userId, "a", 0x01);
|
SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01);
|
||||||
m_scene.AddNewSceneObject(sog, false);
|
m_scene.AddNewSceneObject(sog, false);
|
||||||
SceneObjectGroup sog2 = SceneSetupHelpers.CreateSceneObject(2, m_userId, "b", 0x10);
|
SceneObjectGroup sog2 = SceneHelpers.CreateSceneObject(2, m_userId, "b", 0x10);
|
||||||
m_scene.AddNewSceneObject(sog2, false);
|
m_scene.AddNewSceneObject(sog2, false);
|
||||||
|
|
||||||
// Move the first scene object to the eastern strip parcel
|
// Move the first scene object to the eastern strip parcel
|
||||||
|
@ -230,13 +230,13 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestRemoveOwnerObject()
|
public void TestRemoveOwnerObject()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
IPrimCounts pc = m_lo.PrimCounts;
|
IPrimCounts pc = m_lo.PrimCounts;
|
||||||
|
|
||||||
m_scene.AddNewSceneObject(SceneSetupHelpers.CreateSceneObject(1, m_userId, "a", 0x1), false);
|
m_scene.AddNewSceneObject(SceneHelpers.CreateSceneObject(1, m_userId, "a", 0x1), false);
|
||||||
SceneObjectGroup sogToDelete = SceneSetupHelpers.CreateSceneObject(3, m_userId, "b", 0x10);
|
SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_userId, "b", 0x10);
|
||||||
m_scene.AddNewSceneObject(sogToDelete, false);
|
m_scene.AddNewSceneObject(sogToDelete, false);
|
||||||
m_scene.DeleteSceneObject(sogToDelete, false);
|
m_scene.DeleteSceneObject(sogToDelete, false);
|
||||||
|
|
||||||
|
@ -253,14 +253,14 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestAddGroupObject()
|
public void TestAddGroupObject()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
m_lo.DeedToGroup(m_groupId);
|
m_lo.DeedToGroup(m_groupId);
|
||||||
|
|
||||||
IPrimCounts pc = m_lo.PrimCounts;
|
IPrimCounts pc = m_lo.PrimCounts;
|
||||||
|
|
||||||
SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01);
|
SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01);
|
||||||
sog.GroupID = m_groupId;
|
sog.GroupID = m_groupId;
|
||||||
m_scene.AddNewSceneObject(sog, false);
|
m_scene.AddNewSceneObject(sog, false);
|
||||||
|
|
||||||
|
@ -284,18 +284,18 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestRemoveGroupObject()
|
public void TestRemoveGroupObject()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
m_lo.DeedToGroup(m_groupId);
|
m_lo.DeedToGroup(m_groupId);
|
||||||
|
|
||||||
IPrimCounts pc = m_lo.PrimCounts;
|
IPrimCounts pc = m_lo.PrimCounts;
|
||||||
|
|
||||||
SceneObjectGroup sogToKeep = SceneSetupHelpers.CreateSceneObject(1, m_userId, "a", 0x1);
|
SceneObjectGroup sogToKeep = SceneHelpers.CreateSceneObject(1, m_userId, "a", 0x1);
|
||||||
sogToKeep.GroupID = m_groupId;
|
sogToKeep.GroupID = m_groupId;
|
||||||
m_scene.AddNewSceneObject(sogToKeep, false);
|
m_scene.AddNewSceneObject(sogToKeep, false);
|
||||||
|
|
||||||
SceneObjectGroup sogToDelete = SceneSetupHelpers.CreateSceneObject(3, m_userId, "b", 0x10);
|
SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_userId, "b", 0x10);
|
||||||
m_scene.AddNewSceneObject(sogToDelete, false);
|
m_scene.AddNewSceneObject(sogToDelete, false);
|
||||||
m_scene.DeleteSceneObject(sogToDelete, false);
|
m_scene.DeleteSceneObject(sogToDelete, false);
|
||||||
|
|
||||||
|
@ -313,12 +313,12 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestAddOthersObject()
|
public void TestAddOthersObject()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
IPrimCounts pc = m_lo.PrimCounts;
|
IPrimCounts pc = m_lo.PrimCounts;
|
||||||
|
|
||||||
SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01);
|
SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01);
|
||||||
m_scene.AddNewSceneObject(sog, false);
|
m_scene.AddNewSceneObject(sog, false);
|
||||||
|
|
||||||
Assert.That(pc.Owner, Is.EqualTo(0));
|
Assert.That(pc.Owner, Is.EqualTo(0));
|
||||||
|
@ -334,13 +334,13 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestRemoveOthersObject()
|
public void TestRemoveOthersObject()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
IPrimCounts pc = m_lo.PrimCounts;
|
IPrimCounts pc = m_lo.PrimCounts;
|
||||||
|
|
||||||
m_scene.AddNewSceneObject(SceneSetupHelpers.CreateSceneObject(1, m_otherUserId, "a", 0x1), false);
|
m_scene.AddNewSceneObject(SceneHelpers.CreateSceneObject(1, m_otherUserId, "a", 0x1), false);
|
||||||
SceneObjectGroup sogToDelete = SceneSetupHelpers.CreateSceneObject(3, m_otherUserId, "b", 0x10);
|
SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_otherUserId, "b", 0x10);
|
||||||
m_scene.AddNewSceneObject(sogToDelete, false);
|
m_scene.AddNewSceneObject(sogToDelete, false);
|
||||||
m_scene.DeleteSceneObject(sogToDelete, false);
|
m_scene.DeleteSceneObject(sogToDelete, false);
|
||||||
|
|
||||||
|
@ -360,10 +360,10 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestTaint()
|
public void TestTaint()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
IPrimCounts pc = m_lo.PrimCounts;
|
IPrimCounts pc = m_lo.PrimCounts;
|
||||||
|
|
||||||
SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_userId, "a", 0x01);
|
SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01);
|
||||||
m_scene.AddNewSceneObject(sog, false);
|
m_scene.AddNewSceneObject(sog, false);
|
||||||
|
|
||||||
m_pcm.TaintPrimCount();
|
m_pcm.TaintPrimCount();
|
||||||
|
|
|
@ -173,7 +173,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
||||||
private Bitmap fetchTexture(UUID id)
|
private Bitmap fetchTexture(UUID id)
|
||||||
{
|
{
|
||||||
AssetBase asset = m_scene.AssetService.Get(id.ToString());
|
AssetBase asset = m_scene.AssetService.Get(id.ToString());
|
||||||
m_log.DebugFormat("Fetched texture {0}, found: {1}", id, asset != null);
|
m_log.DebugFormat("[TexturedMapTileRenderer]: Fetched texture {0}, found: {1}", id, asset != null);
|
||||||
if (asset == null) return null;
|
if (asset == null) return null;
|
||||||
|
|
||||||
ManagedImage managedImage;
|
ManagedImage managedImage;
|
||||||
|
|
|
@ -53,17 +53,17 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap.Tests
|
||||||
public void SetUp()
|
public void SetUp()
|
||||||
{
|
{
|
||||||
m_module = new MoapModule();
|
m_module = new MoapModule();
|
||||||
m_scene = SceneSetupHelpers.SetupScene();
|
m_scene = SceneHelpers.SetupScene();
|
||||||
SceneSetupHelpers.SetupSceneModules(m_scene, m_module);
|
SceneHelpers.SetupSceneModules(m_scene, m_module);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestClearMediaUrl()
|
public void TestClearMediaUrl()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
SceneObjectPart part = SceneSetupHelpers.AddSceneObject(m_scene);
|
SceneObjectPart part = SceneHelpers.AddSceneObject(m_scene);
|
||||||
MediaEntry me = new MediaEntry();
|
MediaEntry me = new MediaEntry();
|
||||||
|
|
||||||
m_module.SetMediaEntry(part, 1, me);
|
m_module.SetMediaEntry(part, 1, me);
|
||||||
|
@ -84,11 +84,11 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestSetMediaUrl()
|
public void TestSetMediaUrl()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string homeUrl = "opensimulator.org";
|
string homeUrl = "opensimulator.org";
|
||||||
|
|
||||||
SceneObjectPart part = SceneSetupHelpers.AddSceneObject(m_scene);
|
SceneObjectPart part = SceneHelpers.AddSceneObject(m_scene);
|
||||||
MediaEntry me = new MediaEntry() { HomeURL = homeUrl };
|
MediaEntry me = new MediaEntry() { HomeURL = homeUrl };
|
||||||
|
|
||||||
m_module.SetMediaEntry(part, 1, me);
|
m_module.SetMediaEntry(part, 1, me);
|
||||||
|
|
|
@ -236,14 +236,14 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
m_serialiserModule = new SerialiserModule();
|
m_serialiserModule = new SerialiserModule();
|
||||||
m_scene = SceneSetupHelpers.SetupScene();
|
m_scene = SceneHelpers.SetupScene();
|
||||||
SceneSetupHelpers.SetupSceneModules(m_scene, m_serialiserModule);
|
SceneHelpers.SetupSceneModules(m_scene, m_serialiserModule);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDeserializeXml()
|
public void TestDeserializeXml()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
//log4net.Config.XmlConfigurator.Configure();
|
//log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(xml);
|
SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(xml);
|
||||||
|
@ -259,7 +259,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestSerializeXml()
|
public void TestSerializeXml()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
//log4net.Config.XmlConfigurator.Configure();
|
//log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
string rpName = "My Little Donkey";
|
string rpName = "My Little Donkey";
|
||||||
|
@ -334,7 +334,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDeserializeXml2()
|
public void TestDeserializeXml2()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
//log4net.Config.XmlConfigurator.Configure();
|
//log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
SceneObjectGroup so = m_serialiserModule.DeserializeGroupFromXml2(xml2);
|
SceneObjectGroup so = m_serialiserModule.DeserializeGroupFromXml2(xml2);
|
||||||
|
@ -350,7 +350,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestSerializeXml2()
|
public void TestSerializeXml2()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
//log4net.Config.XmlConfigurator.Configure();
|
//log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
string rpName = "My Little Pony";
|
string rpName = "My Little Pony";
|
||||||
|
|
|
@ -100,15 +100,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Vegetation
|
||||||
{
|
{
|
||||||
case Tree.Cypress1:
|
case Tree.Cypress1:
|
||||||
case Tree.Cypress2:
|
case Tree.Cypress2:
|
||||||
tree.Scale = new Vector3(4, 4, 10);
|
tree.Scale *= new Vector3(8, 8, 20);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// case... other tree types
|
// case... other tree types
|
||||||
// tree.Scale = new Vector3(?, ?, ?);
|
// tree.Scale *= new Vector3(?, ?, ?);
|
||||||
// break;
|
// break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
tree.Scale = new Vector3(4, 4, 4);
|
tree.Scale *= new Vector3(8, 8, 8);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,7 @@ using OpenSim.Framework.Servers;
|
||||||
using OpenSim.Framework.Servers.HttpServer;
|
using OpenSim.Framework.Servers.HttpServer;
|
||||||
using OpenSim.Region.Framework.Interfaces;
|
using OpenSim.Region.Framework.Interfaces;
|
||||||
using OpenSim.Region.Framework.Scenes;
|
using OpenSim.Region.Framework.Scenes;
|
||||||
|
using OpenSim.Region.CoreModules.World.Land;
|
||||||
using Caps=OpenSim.Framework.Capabilities.Caps;
|
using Caps=OpenSim.Framework.Capabilities.Caps;
|
||||||
using OSDArray=OpenMetaverse.StructuredData.OSDArray;
|
using OSDArray=OpenMetaverse.StructuredData.OSDArray;
|
||||||
using OSDMap=OpenMetaverse.StructuredData.OSDMap;
|
using OSDMap=OpenMetaverse.StructuredData.OSDMap;
|
||||||
|
@ -68,6 +69,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
protected Scene m_scene;
|
protected Scene m_scene;
|
||||||
private List<MapBlockData> cachedMapBlocks = new List<MapBlockData>();
|
private List<MapBlockData> cachedMapBlocks = new List<MapBlockData>();
|
||||||
private int cachedTime = 0;
|
private int cachedTime = 0;
|
||||||
|
private int blacklistTimeout = 10*60*1000; // 10 minutes
|
||||||
private byte[] myMapImageJPEG;
|
private byte[] myMapImageJPEG;
|
||||||
protected volatile bool m_Enabled = false;
|
protected volatile bool m_Enabled = false;
|
||||||
private Dictionary<UUID, MapRequestState> m_openRequests = new Dictionary<UUID, MapRequestState>();
|
private Dictionary<UUID, MapRequestState> m_openRequests = new Dictionary<UUID, MapRequestState>();
|
||||||
|
@ -85,6 +87,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
IConfig startupConfig = config.Configs["Startup"];
|
IConfig startupConfig = config.Configs["Startup"];
|
||||||
if (startupConfig.GetString("WorldMapModule", "WorldMap") == "WorldMap")
|
if (startupConfig.GetString("WorldMapModule", "WorldMap") == "WorldMap")
|
||||||
m_Enabled = true;
|
m_Enabled = true;
|
||||||
|
|
||||||
|
blacklistTimeout = startupConfig.GetInt("BlacklistTimeout", 10*60) * 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void AddRegion (Scene scene)
|
public virtual void AddRegion (Scene scene)
|
||||||
|
@ -159,11 +163,17 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
m_scene.EventManager.OnClientClosed += ClientLoggedOut;
|
m_scene.EventManager.OnClientClosed += ClientLoggedOut;
|
||||||
m_scene.EventManager.OnMakeChildAgent += MakeChildAgent;
|
m_scene.EventManager.OnMakeChildAgent += MakeChildAgent;
|
||||||
m_scene.EventManager.OnMakeRootAgent += MakeRootAgent;
|
m_scene.EventManager.OnMakeRootAgent += MakeRootAgent;
|
||||||
|
m_scene.EventManager.OnRegionUp += OnRegionUp;
|
||||||
|
|
||||||
|
StartThread(new object());
|
||||||
}
|
}
|
||||||
|
|
||||||
// this has to be called with a lock on m_scene
|
// this has to be called with a lock on m_scene
|
||||||
protected virtual void RemoveHandlers()
|
protected virtual void RemoveHandlers()
|
||||||
{
|
{
|
||||||
|
StopThread();
|
||||||
|
|
||||||
|
m_scene.EventManager.OnRegionUp -= OnRegionUp;
|
||||||
m_scene.EventManager.OnMakeRootAgent -= MakeRootAgent;
|
m_scene.EventManager.OnMakeRootAgent -= MakeRootAgent;
|
||||||
m_scene.EventManager.OnMakeChildAgent -= MakeChildAgent;
|
m_scene.EventManager.OnMakeChildAgent -= MakeChildAgent;
|
||||||
m_scene.EventManager.OnClientClosed -= ClientLoggedOut;
|
m_scene.EventManager.OnClientClosed -= ClientLoggedOut;
|
||||||
|
@ -279,7 +289,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public LLSDMapLayerResponse GetMapLayer(LLSDMapRequest mapReq)
|
public LLSDMapLayerResponse GetMapLayer(LLSDMapRequest mapReq)
|
||||||
{
|
{
|
||||||
m_log.Debug("[WORLD MAP]: MapLayer Request in region: " + m_scene.RegionInfo.RegionName);
|
m_log.DebugFormat("[WORLD MAP]: MapLayer Request in region: {0}", m_scene.RegionInfo.RegionName);
|
||||||
LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse();
|
LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse();
|
||||||
mapResponse.LayerData.Array.Add(GetOSDMapLayerResponse());
|
mapResponse.LayerData.Array.Add(GetOSDMapLayerResponse());
|
||||||
return mapResponse;
|
return mapResponse;
|
||||||
|
@ -321,8 +331,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
lock (m_rootAgents)
|
lock (m_rootAgents)
|
||||||
{
|
{
|
||||||
m_rootAgents.Remove(AgentId);
|
m_rootAgents.Remove(AgentId);
|
||||||
if (m_rootAgents.Count == 0)
|
|
||||||
StopThread();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -362,6 +370,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
public virtual void HandleMapItemRequest(IClientAPI remoteClient, uint flags,
|
public virtual void HandleMapItemRequest(IClientAPI remoteClient, uint flags,
|
||||||
uint EstateID, bool godlike, uint itemtype, ulong regionhandle)
|
uint EstateID, bool godlike, uint itemtype, ulong regionhandle)
|
||||||
{
|
{
|
||||||
|
// m_log.DebugFormat("[WORLD MAP]: Handle MapItem request {0} {1}", regionhandle, itemtype);
|
||||||
|
|
||||||
lock (m_rootAgents)
|
lock (m_rootAgents)
|
||||||
{
|
{
|
||||||
if (!m_rootAgents.Contains(remoteClient.AgentId))
|
if (!m_rootAgents.Contains(remoteClient.AgentId))
|
||||||
|
@ -370,7 +380,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
uint xstart = 0;
|
uint xstart = 0;
|
||||||
uint ystart = 0;
|
uint ystart = 0;
|
||||||
Utils.LongToUInts(m_scene.RegionInfo.RegionHandle, out xstart, out ystart);
|
Utils.LongToUInts(m_scene.RegionInfo.RegionHandle, out xstart, out ystart);
|
||||||
if (itemtype == 6) // we only sevice 6 right now (avatar green dots)
|
if (itemtype == 6) // Service 6 right now (MAP_ITEM_AGENTS_LOCATION; green dots)
|
||||||
{
|
{
|
||||||
if (regionhandle == 0 || regionhandle == m_scene.RegionInfo.RegionHandle)
|
if (regionhandle == 0 || regionhandle == m_scene.RegionInfo.RegionHandle)
|
||||||
{
|
{
|
||||||
|
@ -414,14 +424,58 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
// Remote Map Item Request
|
// Remote Map Item Request
|
||||||
|
|
||||||
// ensures that the blockingqueue doesn't get borked if the GetAgents() timing changes.
|
// ensures that the blockingqueue doesn't get borked if the GetAgents() timing changes.
|
||||||
// Note that we only start up a remote mapItem Request thread if there's users who could
|
RequestMapItems("",remoteClient.AgentId,flags,EstateID,godlike,itemtype,regionhandle);
|
||||||
// be making requests
|
}
|
||||||
if (!threadrunning)
|
} else if (itemtype == 7) // Service 7 (MAP_ITEM_LAND_FOR_SALE)
|
||||||
{
|
{
|
||||||
m_log.Warn("[WORLD MAP]: Starting new remote request thread manually. This means that AvatarEnteringParcel never fired! This needs to be fixed! Don't Mantis this, as the developers can see it in this message");
|
if (regionhandle == 0 || regionhandle == m_scene.RegionInfo.RegionHandle)
|
||||||
StartThread(new object());
|
{
|
||||||
}
|
// Parcels
|
||||||
|
ILandChannel landChannel = m_scene.LandChannel;
|
||||||
|
List<ILandObject> parcels = landChannel.AllParcels();
|
||||||
|
|
||||||
|
// Local Map Item Request
|
||||||
|
int tc = Environment.TickCount;
|
||||||
|
List<mapItemReply> mapitems = new List<mapItemReply>();
|
||||||
|
mapItemReply mapitem = new mapItemReply();
|
||||||
|
if ((parcels != null) && (parcels.Count >= 1))
|
||||||
|
{
|
||||||
|
foreach (ILandObject parcel_interface in parcels)
|
||||||
|
{
|
||||||
|
// Play it safe
|
||||||
|
if (!(parcel_interface is LandObject))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
LandObject land = (LandObject)parcel_interface;
|
||||||
|
LandData parcel = land.LandData;
|
||||||
|
|
||||||
|
// Show land for sale
|
||||||
|
if ((parcel.Flags & (uint)ParcelFlags.ForSale) == (uint)ParcelFlags.ForSale)
|
||||||
|
{
|
||||||
|
Vector3 min = parcel.AABBMin;
|
||||||
|
Vector3 max = parcel.AABBMax;
|
||||||
|
float x = (min.X+max.X)/2;
|
||||||
|
float y = (min.Y+max.Y)/2;
|
||||||
|
|
||||||
|
mapitem = new mapItemReply();
|
||||||
|
mapitem.x = (uint)(xstart + x);
|
||||||
|
mapitem.y = (uint)(ystart + y);
|
||||||
|
// mapitem.z = (uint)m_scene.GetGroundHeight(x,y);
|
||||||
|
mapitem.id = UUID.Zero;
|
||||||
|
mapitem.name = parcel.Name;
|
||||||
|
mapitem.Extra = parcel.Area;
|
||||||
|
mapitem.Extra2 = parcel.SalePrice;
|
||||||
|
mapitems.Add(mapitem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
remoteClient.SendMapItemReply(mapitems.ToArray(), itemtype, flags);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Remote Map Item Request
|
||||||
|
|
||||||
|
// ensures that the blockingqueue doesn't get borked if the GetAgents() timing changes.
|
||||||
RequestMapItems("",remoteClient.AgentId,flags,EstateID,godlike,itemtype,regionhandle);
|
RequestMapItems("",remoteClient.AgentId,flags,EstateID,godlike,itemtype,regionhandle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -542,6 +596,28 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
}
|
}
|
||||||
av.ControllingClient.SendMapItemReply(returnitems.ToArray(), mrs.itemtype, mrs.flags);
|
av.ControllingClient.SendMapItemReply(returnitems.ToArray(), mrs.itemtype, mrs.flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Service 7 (MAP_ITEM_LAND_FOR_SALE)
|
||||||
|
uint itemtype = 7;
|
||||||
|
|
||||||
|
if (response.ContainsKey(itemtype.ToString()))
|
||||||
|
{
|
||||||
|
List<mapItemReply> returnitems = new List<mapItemReply>();
|
||||||
|
OSDArray itemarray = (OSDArray)response[itemtype.ToString()];
|
||||||
|
for (int i = 0; i < itemarray.Count; i++)
|
||||||
|
{
|
||||||
|
OSDMap mapitem = (OSDMap)itemarray[i];
|
||||||
|
mapItemReply mi = new mapItemReply();
|
||||||
|
mi.x = (uint)mapitem["X"].AsInteger();
|
||||||
|
mi.y = (uint)mapitem["Y"].AsInteger();
|
||||||
|
mi.id = mapitem["ID"].AsUUID();
|
||||||
|
mi.Extra = mapitem["Extra"].AsInteger();
|
||||||
|
mi.Extra2 = mapitem["Extra2"].AsInteger();
|
||||||
|
mi.name = mapitem["Name"].AsString();
|
||||||
|
returnitems.Add(mi);
|
||||||
|
}
|
||||||
|
av.ControllingClient.SendMapItemReply(returnitems.ToArray(), itemtype, mrs.flags);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -589,12 +665,23 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
private OSDMap RequestMapItemsAsync(UUID id, uint flags,
|
private OSDMap RequestMapItemsAsync(UUID id, uint flags,
|
||||||
uint EstateID, bool godlike, uint itemtype, ulong regionhandle)
|
uint EstateID, bool godlike, uint itemtype, ulong regionhandle)
|
||||||
{
|
{
|
||||||
|
// m_log.DebugFormat("[WORLDMAP]: RequestMapItemsAsync; region handle: {0} {1}", regionhandle, itemtype);
|
||||||
|
|
||||||
string httpserver = "";
|
string httpserver = "";
|
||||||
bool blacklisted = false;
|
bool blacklisted = false;
|
||||||
lock (m_blacklistedregions)
|
lock (m_blacklistedregions)
|
||||||
{
|
{
|
||||||
if (m_blacklistedregions.ContainsKey(regionhandle))
|
if (m_blacklistedregions.ContainsKey(regionhandle))
|
||||||
blacklisted = true;
|
{
|
||||||
|
if (Environment.TickCount > (m_blacklistedregions[regionhandle] + blacklistTimeout))
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[WORLDMAP]: Unblock blacklisted region {0}", regionhandle);
|
||||||
|
|
||||||
|
m_blacklistedregions.Remove(regionhandle);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
blacklisted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blacklisted)
|
if (blacklisted)
|
||||||
|
@ -636,7 +723,16 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
lock (m_blacklistedurls)
|
lock (m_blacklistedurls)
|
||||||
{
|
{
|
||||||
if (m_blacklistedurls.ContainsKey(httpserver))
|
if (m_blacklistedurls.ContainsKey(httpserver))
|
||||||
blacklisted = true;
|
{
|
||||||
|
if (Environment.TickCount > (m_blacklistedurls[httpserver] + blacklistTimeout))
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[WORLDMAP]: Unblock blacklisted URL {0}", httpserver);
|
||||||
|
|
||||||
|
m_blacklistedurls.Remove(httpserver);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
blacklisted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Can't find the http server
|
// Can't find the http server
|
||||||
|
@ -682,7 +778,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
mapitemsrequest.ContentLength = buffer.Length; //Count bytes to send
|
mapitemsrequest.ContentLength = buffer.Length; //Count bytes to send
|
||||||
os = mapitemsrequest.GetRequestStream();
|
os = mapitemsrequest.GetRequestStream();
|
||||||
os.Write(buffer, 0, buffer.Length); //Send it
|
os.Write(buffer, 0, buffer.Length); //Send it
|
||||||
os.Close();
|
|
||||||
//m_log.DebugFormat("[WORLD MAP]: Getting MapItems from {0}", httpserver);
|
//m_log.DebugFormat("[WORLD MAP]: Getting MapItems from {0}", httpserver);
|
||||||
}
|
}
|
||||||
catch (WebException ex)
|
catch (WebException ex)
|
||||||
|
@ -705,6 +800,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
responseMap["connect"] = OSD.FromBoolean(false);
|
responseMap["connect"] = OSD.FromBoolean(false);
|
||||||
return responseMap;
|
return responseMap;
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (os != null)
|
||||||
|
os.Close();
|
||||||
|
}
|
||||||
|
|
||||||
string response_mapItems_reply = null;
|
string response_mapItems_reply = null;
|
||||||
{ // get the response
|
{ // get the response
|
||||||
|
@ -1060,6 +1160,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
|
|
||||||
Utils.LongToUInts(m_scene.RegionInfo.RegionHandle,out xstart,out ystart);
|
Utils.LongToUInts(m_scene.RegionInfo.RegionHandle,out xstart,out ystart);
|
||||||
|
|
||||||
|
// Service 6 (MAP_ITEM_AGENTS_LOCATION; green dots)
|
||||||
|
|
||||||
OSDMap responsemap = new OSDMap();
|
OSDMap responsemap = new OSDMap();
|
||||||
int tc = Environment.TickCount;
|
int tc = Environment.TickCount;
|
||||||
if (m_scene.GetRootAgentCount() == 0)
|
if (m_scene.GetRootAgentCount() == 0)
|
||||||
|
@ -1092,6 +1194,60 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
});
|
});
|
||||||
responsemap["6"] = responsearr;
|
responsemap["6"] = responsearr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Service 7 (MAP_ITEM_LAND_FOR_SALE)
|
||||||
|
|
||||||
|
ILandChannel landChannel = m_scene.LandChannel;
|
||||||
|
List<ILandObject> parcels = landChannel.AllParcels();
|
||||||
|
|
||||||
|
if ((parcels == null) || (parcels.Count == 0))
|
||||||
|
{
|
||||||
|
OSDMap responsemapdata = new OSDMap();
|
||||||
|
responsemapdata["X"] = OSD.FromInteger((int)(xstart + 1));
|
||||||
|
responsemapdata["Y"] = OSD.FromInteger((int)(ystart + 1));
|
||||||
|
responsemapdata["ID"] = OSD.FromUUID(UUID.Zero);
|
||||||
|
responsemapdata["Name"] = OSD.FromString("");
|
||||||
|
responsemapdata["Extra"] = OSD.FromInteger(0);
|
||||||
|
responsemapdata["Extra2"] = OSD.FromInteger(0);
|
||||||
|
OSDArray responsearr = new OSDArray();
|
||||||
|
responsearr.Add(responsemapdata);
|
||||||
|
|
||||||
|
responsemap["7"] = responsearr;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OSDArray responsearr = new OSDArray(m_scene.GetRootAgentCount());
|
||||||
|
foreach (ILandObject parcel_interface in parcels)
|
||||||
|
{
|
||||||
|
// Play it safe
|
||||||
|
if (!(parcel_interface is LandObject))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
LandObject land = (LandObject)parcel_interface;
|
||||||
|
LandData parcel = land.LandData;
|
||||||
|
|
||||||
|
// Show land for sale
|
||||||
|
if ((parcel.Flags & (uint)ParcelFlags.ForSale) == (uint)ParcelFlags.ForSale)
|
||||||
|
{
|
||||||
|
Vector3 min = parcel.AABBMin;
|
||||||
|
Vector3 max = parcel.AABBMax;
|
||||||
|
float x = (min.X+max.X)/2;
|
||||||
|
float y = (min.Y+max.Y)/2;
|
||||||
|
|
||||||
|
OSDMap responsemapdata = new OSDMap();
|
||||||
|
responsemapdata["X"] = OSD.FromInteger((int)(xstart + x));
|
||||||
|
responsemapdata["Y"] = OSD.FromInteger((int)(ystart + y));
|
||||||
|
// responsemapdata["Z"] = OSD.FromInteger((int)m_scene.GetGroundHeight(x,y));
|
||||||
|
responsemapdata["ID"] = OSD.FromUUID(UUID.Zero);
|
||||||
|
responsemapdata["Name"] = OSD.FromString(parcel.Name);
|
||||||
|
responsemapdata["Extra"] = OSD.FromInteger(parcel.Area);
|
||||||
|
responsemapdata["Extra2"] = OSD.FromInteger(parcel.SalePrice);
|
||||||
|
responsearr.Add(responsemapdata);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
responsemap["7"] = responsearr;
|
||||||
|
}
|
||||||
|
|
||||||
return responsemap;
|
return responsemap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1140,12 +1296,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
|
|
||||||
private void MakeRootAgent(ScenePresence avatar)
|
private void MakeRootAgent(ScenePresence avatar)
|
||||||
{
|
{
|
||||||
// You may ask, why this is in a threadpool to start with..
|
|
||||||
// The reason is so we don't cause the thread to freeze waiting
|
|
||||||
// for the 1 second it costs to start a thread manually.
|
|
||||||
if (!threadrunning)
|
|
||||||
Util.FireAndForget(this.StartThread);
|
|
||||||
|
|
||||||
lock (m_rootAgents)
|
lock (m_rootAgents)
|
||||||
{
|
{
|
||||||
if (!m_rootAgents.Contains(avatar.UUID))
|
if (!m_rootAgents.Contains(avatar.UUID))
|
||||||
|
@ -1160,8 +1310,30 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
lock (m_rootAgents)
|
lock (m_rootAgents)
|
||||||
{
|
{
|
||||||
m_rootAgents.Remove(avatar.UUID);
|
m_rootAgents.Remove(avatar.UUID);
|
||||||
if (m_rootAgents.Count == 0)
|
}
|
||||||
StopThread();
|
}
|
||||||
|
|
||||||
|
public void OnRegionUp(GridRegion otherRegion)
|
||||||
|
{
|
||||||
|
ulong regionhandle = otherRegion.RegionHandle;
|
||||||
|
string httpserver = otherRegion.ServerURI + "MAP/MapItems/" + regionhandle.ToString();
|
||||||
|
|
||||||
|
lock (m_blacklistedregions)
|
||||||
|
{
|
||||||
|
if (!m_blacklistedregions.ContainsKey(regionhandle))
|
||||||
|
m_blacklistedregions.Remove(regionhandle);
|
||||||
|
}
|
||||||
|
|
||||||
|
lock (m_blacklistedurls)
|
||||||
|
{
|
||||||
|
if (m_blacklistedurls.ContainsKey(httpserver))
|
||||||
|
m_blacklistedurls.Remove(httpserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
lock (m_cachedRegionMapItemsAddress)
|
||||||
|
{
|
||||||
|
if (!m_cachedRegionMapItemsAddress.ContainsKey(regionhandle))
|
||||||
|
m_cachedRegionMapItemsAddress.Remove(regionhandle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||||
public event DeRezObject OnDeRezObject;
|
public event DeRezObject OnDeRezObject;
|
||||||
public event Action<IClientAPI> OnRegionHandShakeReply;
|
public event Action<IClientAPI> OnRegionHandShakeReply;
|
||||||
public event GenericCall1 OnRequestWearables;
|
public event GenericCall1 OnRequestWearables;
|
||||||
public event GenericCall1 OnCompleteMovementToRegion;
|
public event Action<IClientAPI, bool> OnCompleteMovementToRegion;
|
||||||
public event UpdateAgent OnPreAgentUpdate;
|
public event UpdateAgent OnPreAgentUpdate;
|
||||||
public event UpdateAgent OnAgentUpdate;
|
public event UpdateAgent OnAgentUpdate;
|
||||||
public event AgentRequestSit OnAgentRequestSit;
|
public event AgentRequestSit OnAgentRequestSit;
|
||||||
|
@ -222,7 +222,7 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||||
public event ScriptReset OnScriptReset;
|
public event ScriptReset OnScriptReset;
|
||||||
public event GetScriptRunning OnGetScriptRunning;
|
public event GetScriptRunning OnGetScriptRunning;
|
||||||
public event SetScriptRunning OnSetScriptRunning;
|
public event SetScriptRunning OnSetScriptRunning;
|
||||||
public event Action<Vector3> OnAutoPilotGo;
|
public event Action<Vector3, bool> OnAutoPilotGo;
|
||||||
|
|
||||||
public event TerrainUnacked OnUnackedTerrain;
|
public event TerrainUnacked OnUnackedTerrain;
|
||||||
|
|
||||||
|
@ -663,7 +663,7 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||||
|
|
||||||
if (OnCompleteMovementToRegion != null)
|
if (OnCompleteMovementToRegion != null)
|
||||||
{
|
{
|
||||||
OnCompleteMovementToRegion(this);
|
OnCompleteMovementToRegion(this, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID)
|
public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID)
|
||||||
|
|
|
@ -95,7 +95,7 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||||
for (int i = 0; i < 1; i++)
|
for (int i = 0; i < 1; i++)
|
||||||
{
|
{
|
||||||
MyNpcCharacter m_character = new MyNpcCharacter(m_scene);
|
MyNpcCharacter m_character = new MyNpcCharacter(m_scene);
|
||||||
m_scene.AddNewClient(m_character);
|
m_scene.AddNewClient(m_character, PresenceType.Npc);
|
||||||
m_scene.AgentCrossing(m_character.AgentId, Vector3.Zero, false);
|
m_scene.AgentCrossing(m_character.AgentId, Vector3.Zero, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -96,9 +96,10 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Detach an object from the avatar.
|
/// Detach an object from the avatar.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
///
|
/// <remarks>
|
||||||
/// This method is called in response to a client's detach request, so we only update the information in
|
/// This method is called in response to a client's detach request, so we only update the information in
|
||||||
/// inventory
|
/// inventory
|
||||||
|
/// </remarks>
|
||||||
/// <param name="objectLocalID"></param>
|
/// <param name="objectLocalID"></param>
|
||||||
/// <param name="remoteClient"></param>
|
/// <param name="remoteClient"></param>
|
||||||
void DetachObject(uint objectLocalID, IClientAPI remoteClient);
|
void DetachObject(uint objectLocalID, IClientAPI remoteClient);
|
||||||
|
|
|
@ -32,6 +32,14 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
{
|
{
|
||||||
public interface IAvatarFactory
|
public interface IAvatarFactory
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Send the appearance of an avatar to others in the scene.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="agentId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
bool SendAppearance(UUID agentId);
|
||||||
|
|
||||||
|
bool SaveBakedTextures(UUID agentId);
|
||||||
bool ValidateBakedTextureCache(IClientAPI client);
|
bool ValidateBakedTextureCache(IClientAPI client);
|
||||||
void QueueAppearanceSend(UUID agentid);
|
void QueueAppearanceSend(UUID agentid);
|
||||||
void QueueAppearanceSave(UUID agentid);
|
void QueueAppearanceSave(UUID agentid);
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
|
using OpenSim.Framework;
|
||||||
using OpenSim.Region.Framework.Scenes;
|
using OpenSim.Region.Framework.Scenes;
|
||||||
|
|
||||||
namespace OpenSim.Region.Framework.Interfaces
|
namespace OpenSim.Region.Framework.Interfaces
|
||||||
|
@ -39,9 +40,26 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
/// <param name="lastname"></param>
|
/// <param name="lastname"></param>
|
||||||
/// <param name="position"></param>
|
/// <param name="position"></param>
|
||||||
/// <param name="scene"></param>
|
/// <param name="scene"></param>
|
||||||
/// <param name="cloneAppearanceFrom">The UUID of the avatar from which to clone the NPC's appearance from.</param>
|
/// <param name="appearance">The avatar appearance to use for the new NPC.</param>
|
||||||
/// <returns>The UUID of the ScenePresence created.</returns>
|
/// <returns>The UUID of the ScenePresence created.</returns>
|
||||||
UUID CreateNPC(string firstname, string lastname, Vector3 position, Scene scene, UUID cloneAppearanceFrom);
|
UUID CreateNPC(string firstname, string lastname, Vector3 position, Scene scene, AvatarAppearance appearance);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check if the agent is an NPC.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="agentID"></param>
|
||||||
|
/// <param name="scene"></param>
|
||||||
|
/// <returns>True if the agent is an NPC in the given scene. False otherwise.</returns>
|
||||||
|
bool IsNPC(UUID agentID, Scene scene);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set the appearance for an NPC.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="agentID"></param>
|
||||||
|
/// <param name="appearance"></param>
|
||||||
|
/// <param name="scene"></param>
|
||||||
|
/// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns>
|
||||||
|
bool SetNPCAppearance(UUID agentID, AvatarAppearance appearance, Scene scene);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Move an NPC to a target over time.
|
/// Move an NPC to a target over time.
|
||||||
|
@ -49,7 +67,23 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
/// <param name="agentID">The UUID of the NPC</param>
|
/// <param name="agentID">The UUID of the NPC</param>
|
||||||
/// <param name="scene"></param>
|
/// <param name="scene"></param>
|
||||||
/// <param name="pos"></param>
|
/// <param name="pos"></param>
|
||||||
void MoveToTarget(UUID agentID, Scene scene, Vector3 pos);
|
/// <param name="noFly">
|
||||||
|
/// If true, then the avatar will attempt to walk to the location even if it's up in the air.
|
||||||
|
/// This is to allow walking on prims.
|
||||||
|
/// </param>
|
||||||
|
/// <param name="landAtTarget">
|
||||||
|
/// If true and the avatar is flying when it reaches the target, land.
|
||||||
|
/// </param>
|
||||||
|
/// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns>
|
||||||
|
bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stop the NPC's current movement.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="agentID">The UUID of the NPC</param>
|
||||||
|
/// <param name="scene"></param>
|
||||||
|
/// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns>
|
||||||
|
bool StopMoveToTarget(UUID agentID, Scene scene);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the NPC to say something.
|
/// Get the NPC to say something.
|
||||||
|
@ -57,14 +91,15 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
/// <param name="agentID">The UUID of the NPC</param>
|
/// <param name="agentID">The UUID of the NPC</param>
|
||||||
/// <param name="scene"></param>
|
/// <param name="scene"></param>
|
||||||
/// <param name="text"></param>
|
/// <param name="text"></param>
|
||||||
void Say(UUID agentID, Scene scene, string text);
|
/// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns>
|
||||||
|
bool Say(UUID agentID, Scene scene, string text);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Delete an NPC.
|
/// Delete an NPC.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="agentID">The UUID of the NPC</param>
|
/// <param name="agentID">The UUID of the NPC</param>
|
||||||
/// <param name="scene"></param>
|
/// <param name="scene"></param>
|
||||||
void DeleteNPC(UUID agentID, Scene scene);
|
/// <returns>True if the operation succeeded, false if there was no such agent or the agent was not an NPC</returns>
|
||||||
|
bool DeleteNPC(UUID agentID, Scene scene);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -5,13 +5,48 @@ using OpenMetaverse;
|
||||||
|
|
||||||
namespace OpenSim.Region.Framework.Interfaces
|
namespace OpenSim.Region.Framework.Interfaces
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// This maintains the relationship between a UUID and a user name.
|
||||||
|
/// </summary>
|
||||||
public interface IUserManagement
|
public interface IUserManagement
|
||||||
{
|
{
|
||||||
string GetUserName(UUID uuid);
|
string GetUserName(UUID uuid);
|
||||||
string GetUserHomeURL(UUID uuid);
|
string GetUserHomeURL(UUID uuid);
|
||||||
string GetUserUUI(UUID uuid);
|
string GetUserUUI(UUID uuid);
|
||||||
string GetUserServerURL(UUID uuid, string serverType);
|
string GetUserServerURL(UUID uuid, string serverType);
|
||||||
void AddUser(UUID uuid, string userData);
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add a user.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// If an account is found for the UUID, then the names in this will be used rather than any information
|
||||||
|
/// extracted from creatorData.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <param name="creatorData">The creator data for this user.</param>
|
||||||
|
void AddUser(UUID uuid, string creatorData);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add a user.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// The UUID is related to the name without any other checks being performed, such as user account presence.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <param name="firstName"></param>
|
||||||
|
/// <param name="lastName"></param>
|
||||||
|
void AddUser(UUID uuid, string firstName, string lastName);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add a user.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// The arguments apart from uuid are formed into a creatorData string and processing proceeds as for the
|
||||||
|
/// AddUser(UUID uuid, string creatorData) method.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <param name="firstName"></param>
|
||||||
|
/// <param name="profileURL"></param>
|
||||||
void AddUser(UUID uuid, string firstName, string lastName, string profileURL);
|
void AddUser(UUID uuid, string firstName, string lastName, string profileURL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,6 +77,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||||
if (m_scenePresence.IsChildAgent)
|
if (m_scenePresence.IsChildAgent)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Adding animation {0} for {1}", animID, m_scenePresence.Name);
|
||||||
|
|
||||||
if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID))
|
if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID))
|
||||||
SendAnimPack();
|
SendAnimPack();
|
||||||
}
|
}
|
||||||
|
@ -91,6 +93,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||||
if (animID == UUID.Zero)
|
if (animID == UUID.Zero)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Adding animation {0} {1} for {2}", animID, name, m_scenePresence.Name);
|
||||||
|
|
||||||
AddAnimation(animID, objectID);
|
AddAnimation(animID, objectID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,13 +131,15 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void TrySetMovementAnimation(string anim)
|
public void TrySetMovementAnimation(string anim)
|
||||||
{
|
{
|
||||||
//m_log.DebugFormat("Updating movement animation to {0}", anim);
|
|
||||||
|
|
||||||
if (!m_scenePresence.IsChildAgent)
|
if (!m_scenePresence.IsChildAgent)
|
||||||
{
|
{
|
||||||
if (m_animations.TrySetDefaultAnimation(
|
if (m_animations.TrySetDefaultAnimation(
|
||||||
anim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID))
|
anim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID))
|
||||||
{
|
{
|
||||||
|
// m_log.DebugFormat(
|
||||||
|
// "[SCENE PRESENCE ANIMATOR]: Updating movement animation to {0} for {1}",
|
||||||
|
// anim, m_scenePresence.Name);
|
||||||
|
|
||||||
// 16384 is CHANGED_ANIMATION
|
// 16384 is CHANGED_ANIMATION
|
||||||
m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { (int)Changed.ANIMATION});
|
m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { (int)Changed.ANIMATION});
|
||||||
SendAnimPack();
|
SendAnimPack();
|
||||||
|
|
|
@ -611,6 +611,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
"delete object name <name>",
|
"delete object name <name>",
|
||||||
"Delete object by name", HandleDeleteObject);
|
"Delete object by name", HandleDeleteObject);
|
||||||
|
|
||||||
|
MainConsole.Instance.Commands.AddCommand("region", false, "delete object outside",
|
||||||
|
"delete object outside",
|
||||||
|
"Delete all objects outside boundaries", HandleDeleteObject);
|
||||||
|
|
||||||
//Bind Storage Manager functions to some land manager functions for this scene
|
//Bind Storage Manager functions to some land manager functions for this scene
|
||||||
EventManager.OnLandObjectAdded +=
|
EventManager.OnLandObjectAdded +=
|
||||||
new EventManager.LandObjectAdded(simDataService.StoreLandObject);
|
new EventManager.LandObjectAdded(simDataService.StoreLandObject);
|
||||||
|
@ -2539,10 +2543,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
#region Add/Remove Avatar Methods
|
#region Add/Remove Avatar Methods
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adding a New Client and Create a Presence for it.
|
/// Add a new client and create a child agent for it.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="client"></param>
|
/// <param name="client"></param>
|
||||||
public override void AddNewClient(IClientAPI client)
|
/// <param name="type">The type of agent to add.</param>
|
||||||
|
public override void AddNewClient(IClientAPI client, PresenceType type)
|
||||||
{
|
{
|
||||||
AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode);
|
AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode);
|
||||||
bool vialogin = false;
|
bool vialogin = false;
|
||||||
|
@ -2562,7 +2567,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_clientManager.Add(client);
|
m_clientManager.Add(client);
|
||||||
SubscribeToClientEvents(client);
|
SubscribeToClientEvents(client);
|
||||||
|
|
||||||
ScenePresence sp = m_sceneGraph.CreateAndAddChildScenePresence(client, aCircuit.Appearance);
|
ScenePresence sp = m_sceneGraph.CreateAndAddChildScenePresence(client, aCircuit.Appearance, type);
|
||||||
m_eventManager.TriggerOnNewPresence(sp);
|
m_eventManager.TriggerOnNewPresence(sp);
|
||||||
|
|
||||||
sp.TeleportFlags = (TeleportFlags)aCircuit.teleportFlags;
|
sp.TeleportFlags = (TeleportFlags)aCircuit.teleportFlags;
|
||||||
|
@ -2577,12 +2582,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetScenePresence(client.AgentId) != null)
|
ScenePresence createdSp = GetScenePresence(client.AgentId);
|
||||||
|
if (createdSp != null)
|
||||||
{
|
{
|
||||||
m_LastLogin = Util.EnvironmentTickCount();
|
m_LastLogin = Util.EnvironmentTickCount();
|
||||||
|
|
||||||
// Cache the user's name
|
// Cache the user's name
|
||||||
CacheUserName(aCircuit);
|
CacheUserName(createdSp, aCircuit);
|
||||||
|
|
||||||
EventManager.TriggerOnNewClient(client);
|
EventManager.TriggerOnNewClient(client);
|
||||||
if (vialogin)
|
if (vialogin)
|
||||||
|
@ -2590,28 +2596,41 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CacheUserName(AgentCircuitData aCircuit)
|
/// <summary>
|
||||||
|
/// Cache the user name for later use.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sp"></param>
|
||||||
|
/// <param name="aCircuit"></param>
|
||||||
|
private void CacheUserName(ScenePresence sp, AgentCircuitData aCircuit)
|
||||||
{
|
{
|
||||||
IUserManagement uMan = RequestModuleInterface<IUserManagement>();
|
IUserManagement uMan = RequestModuleInterface<IUserManagement>();
|
||||||
if (uMan != null)
|
if (uMan != null)
|
||||||
{
|
{
|
||||||
string homeURL = string.Empty;
|
|
||||||
string first = aCircuit.firstname, last = aCircuit.lastname;
|
string first = aCircuit.firstname, last = aCircuit.lastname;
|
||||||
|
|
||||||
if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
|
if (sp.PresenceType == PresenceType.Npc)
|
||||||
homeURL = aCircuit.ServiceURLs["HomeURI"].ToString();
|
|
||||||
|
|
||||||
if (aCircuit.lastname.StartsWith("@"))
|
|
||||||
{
|
{
|
||||||
string[] parts = aCircuit.firstname.Split('.');
|
uMan.AddUser(aCircuit.AgentID, first, last);
|
||||||
if (parts.Length >= 2)
|
|
||||||
{
|
|
||||||
first = parts[0];
|
|
||||||
last = parts[1];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string homeURL = string.Empty;
|
||||||
|
|
||||||
uMan.AddUser(aCircuit.AgentID, first, last, homeURL);
|
if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
|
||||||
|
homeURL = aCircuit.ServiceURLs["HomeURI"].ToString();
|
||||||
|
|
||||||
|
if (aCircuit.lastname.StartsWith("@"))
|
||||||
|
{
|
||||||
|
string[] parts = aCircuit.firstname.Split('.');
|
||||||
|
if (parts.Length >= 2)
|
||||||
|
{
|
||||||
|
first = parts[0];
|
||||||
|
last = parts[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uMan.AddUser(aCircuit.AgentID, first, last, homeURL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3091,11 +3110,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
public override void RemoveClient(UUID agentID, bool closeChildAgents)
|
||||||
/// Remove the given client from the scene.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="agentID"></param>
|
|
||||||
public override void RemoveClient(UUID agentID)
|
|
||||||
{
|
{
|
||||||
CheckHeartbeat();
|
CheckHeartbeat();
|
||||||
bool childagentYN = false;
|
bool childagentYN = false;
|
||||||
|
@ -3116,15 +3131,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
(childagentYN ? "child" : "root"), agentID, RegionInfo.RegionName);
|
(childagentYN ? "child" : "root"), agentID, RegionInfo.RegionName);
|
||||||
|
|
||||||
m_sceneGraph.removeUserCount(!childagentYN);
|
m_sceneGraph.removeUserCount(!childagentYN);
|
||||||
|
|
||||||
if (CapsModule != null)
|
// TODO: We shouldn't use closeChildAgents here - it's being used by the NPC module to stop
|
||||||
|
// unnecessary operations. This should go away once NPCs have no accompanying IClientAPI
|
||||||
|
if (closeChildAgents && CapsModule != null)
|
||||||
CapsModule.RemoveCaps(agentID);
|
CapsModule.RemoveCaps(agentID);
|
||||||
|
|
||||||
// REFACTORING PROBLEM -- well not really a problem, but just to point out that whatever
|
// REFACTORING PROBLEM -- well not really a problem, but just to point out that whatever
|
||||||
// this method is doing is HORRIBLE!!!
|
// this method is doing is HORRIBLE!!!
|
||||||
avatar.Scene.NeedSceneCacheClear(avatar.UUID);
|
avatar.Scene.NeedSceneCacheClear(avatar.UUID);
|
||||||
|
|
||||||
if (!avatar.IsChildAgent)
|
if (closeChildAgents && !avatar.IsChildAgent)
|
||||||
{
|
{
|
||||||
//List<ulong> childknownRegions = new List<ulong>();
|
//List<ulong> childknownRegions = new List<ulong>();
|
||||||
//List<ulong> ckn = avatar.KnownChildRegionHandles;
|
//List<ulong> ckn = avatar.KnownChildRegionHandles;
|
||||||
|
@ -3136,6 +3153,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
regions.Remove(RegionInfo.RegionHandle);
|
regions.Remove(RegionInfo.RegionHandle);
|
||||||
m_sceneGridService.SendCloseChildAgentConnections(agentID, regions);
|
m_sceneGridService.SendCloseChildAgentConnections(agentID, regions);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_eventManager.TriggerClientClosed(agentID, this);
|
m_eventManager.TriggerClientClosed(agentID, this);
|
||||||
}
|
}
|
||||||
catch (NullReferenceException)
|
catch (NullReferenceException)
|
||||||
|
@ -3146,7 +3164,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
m_eventManager.TriggerOnRemovePresence(agentID);
|
m_eventManager.TriggerOnRemovePresence(agentID);
|
||||||
|
|
||||||
if (avatar != null && (!avatar.IsChildAgent))
|
if (avatar != null && (!avatar.IsChildAgent) && avatar.PresenceType != PresenceType.Npc)
|
||||||
avatar.SaveChangedAttachments();
|
avatar.SaveChangedAttachments();
|
||||||
|
|
||||||
ForEachClient(
|
ForEachClient(
|
||||||
|
@ -4942,11 +4960,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
private void HandleDeleteObject(string module, string[] cmd)
|
private void HandleDeleteObject(string module, string[] cmd)
|
||||||
{
|
{
|
||||||
if (cmd.Length < 4)
|
if (cmd.Length < 3)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
string mode = cmd[2];
|
string mode = cmd[2];
|
||||||
string o = cmd[3];
|
string o = "";
|
||||||
|
|
||||||
|
if (mode != "outside")
|
||||||
|
{
|
||||||
|
if (cmd.Length < 4)
|
||||||
|
return;
|
||||||
|
|
||||||
|
o = cmd[3];
|
||||||
|
}
|
||||||
|
|
||||||
List<SceneObjectGroup> deletes = new List<SceneObjectGroup>();
|
List<SceneObjectGroup> deletes = new List<SceneObjectGroup>();
|
||||||
|
|
||||||
|
@ -4988,10 +5014,33 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
deletes.Add(g);
|
deletes.Add(g);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case "outside":
|
||||||
|
ForEachSOG(delegate (SceneObjectGroup g)
|
||||||
|
{
|
||||||
|
SceneObjectPart rootPart = g.RootPart;
|
||||||
|
bool delete = false;
|
||||||
|
|
||||||
|
if (rootPart.GroupPosition.Z < 0.0 || rootPart.GroupPosition.Z > 10000.0)
|
||||||
|
{
|
||||||
|
delete = true;
|
||||||
|
} else {
|
||||||
|
ILandObject parcel = LandChannel.GetLandObject(rootPart.GroupPosition.X, rootPart.GroupPosition.Y);
|
||||||
|
|
||||||
|
if (parcel == null || parcel.LandData.Name == "NO LAND")
|
||||||
|
delete = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (delete && !rootPart.IsAttachment && !deletes.Contains(g))
|
||||||
|
deletes.Add(g);
|
||||||
|
});
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (SceneObjectGroup g in deletes)
|
foreach (SceneObjectGroup g in deletes)
|
||||||
|
{
|
||||||
|
m_log.InfoFormat("[SCENE]: Deleting object {0}", g.UUID);
|
||||||
DeleteSceneObject(g, false);
|
DeleteSceneObject(g, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleReloadEstate(string module, string[] cmd)
|
private void HandleReloadEstate(string module, string[] cmd)
|
||||||
|
|
|
@ -175,18 +175,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
#region Add/Remove Agent/Avatar
|
#region Add/Remove Agent/Avatar
|
||||||
|
|
||||||
/// <summary>
|
public abstract void AddNewClient(IClientAPI client, PresenceType type);
|
||||||
/// Register the new client with the scene. The client starts off as a child agent - the later agent crossing
|
public abstract void RemoveClient(UUID agentID, bool closeChildAgents);
|
||||||
/// will promote it to a root agent during login.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="client"></param
|
|
||||||
public abstract void AddNewClient(IClientAPI client);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Remove a client from the scene
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="agentID"></param>
|
|
||||||
public abstract void RemoveClient(UUID agentID);
|
|
||||||
|
|
||||||
public bool TryGetScenePresence(UUID agentID, out object scenePresence)
|
public bool TryGetScenePresence(UUID agentID, out object scenePresence)
|
||||||
{
|
{
|
||||||
|
|
|
@ -590,12 +590,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected internal ScenePresence CreateAndAddChildScenePresence(IClientAPI client, AvatarAppearance appearance)
|
protected internal ScenePresence CreateAndAddChildScenePresence(
|
||||||
|
IClientAPI client, AvatarAppearance appearance, PresenceType type)
|
||||||
{
|
{
|
||||||
ScenePresence newAvatar = null;
|
ScenePresence newAvatar = null;
|
||||||
|
|
||||||
// ScenePresence always defaults to child agent
|
// ScenePresence always defaults to child agent
|
||||||
newAvatar = new ScenePresence(client, m_parentScene, m_regInfo, appearance);
|
newAvatar = new ScenePresence(client, m_parentScene, m_regInfo, appearance, type);
|
||||||
|
|
||||||
AddScenePresence(newAvatar);
|
AddScenePresence(newAvatar);
|
||||||
|
|
||||||
|
|
|
@ -53,12 +53,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
get { return m_instance; }
|
get { return m_instance; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly List<Scene> m_localScenes;
|
private readonly List<Scene> m_localScenes = new List<Scene>();
|
||||||
private Scene m_currentScene = null;
|
private Scene m_currentScene = null;
|
||||||
|
|
||||||
public List<Scene> Scenes
|
public List<Scene> Scenes
|
||||||
{
|
{
|
||||||
get { return m_localScenes; }
|
get { return new List<Scene>(m_localScenes); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public Scene CurrentScene
|
public Scene CurrentScene
|
||||||
|
@ -72,13 +72,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
if (m_currentScene == null)
|
if (m_currentScene == null)
|
||||||
{
|
{
|
||||||
if (m_localScenes.Count > 0)
|
lock (m_localScenes)
|
||||||
{
|
{
|
||||||
return m_localScenes[0];
|
if (m_localScenes.Count > 0)
|
||||||
}
|
return m_localScenes[0];
|
||||||
else
|
else
|
||||||
{
|
return null;
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -98,17 +97,21 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
// collect known shared modules in sharedModules
|
// collect known shared modules in sharedModules
|
||||||
Dictionary<string, IRegionModule> sharedModules = new Dictionary<string, IRegionModule>();
|
Dictionary<string, IRegionModule> sharedModules = new Dictionary<string, IRegionModule>();
|
||||||
for (int i = 0; i < m_localScenes.Count; i++)
|
|
||||||
|
lock (m_localScenes)
|
||||||
{
|
{
|
||||||
// extract known shared modules from scene
|
for (int i = 0; i < m_localScenes.Count; i++)
|
||||||
foreach (string k in m_localScenes[i].Modules.Keys)
|
|
||||||
{
|
{
|
||||||
if (m_localScenes[i].Modules[k].IsSharedModule &&
|
// extract known shared modules from scene
|
||||||
!sharedModules.ContainsKey(k))
|
foreach (string k in m_localScenes[i].Modules.Keys)
|
||||||
sharedModules[k] = m_localScenes[i].Modules[k];
|
{
|
||||||
|
if (m_localScenes[i].Modules[k].IsSharedModule &&
|
||||||
|
!sharedModules.ContainsKey(k))
|
||||||
|
sharedModules[k] = m_localScenes[i].Modules[k];
|
||||||
|
}
|
||||||
|
// close scene/region
|
||||||
|
m_localScenes[i].Close();
|
||||||
}
|
}
|
||||||
// close scene/region
|
|
||||||
m_localScenes[i].Close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// all regions/scenes are now closed, we can now safely
|
// all regions/scenes are now closed, we can now safely
|
||||||
|
@ -121,13 +124,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public void Close(Scene cscene)
|
public void Close(Scene cscene)
|
||||||
{
|
{
|
||||||
if (m_localScenes.Contains(cscene))
|
lock (m_localScenes)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < m_localScenes.Count; i++)
|
if (m_localScenes.Contains(cscene))
|
||||||
{
|
{
|
||||||
if (m_localScenes[i].Equals(cscene))
|
for (int i = 0; i < m_localScenes.Count; i++)
|
||||||
{
|
{
|
||||||
m_localScenes[i].Close();
|
if (m_localScenes[i].Equals(cscene))
|
||||||
|
{
|
||||||
|
m_localScenes[i].Close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -136,27 +142,33 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
public void Add(Scene scene)
|
public void Add(Scene scene)
|
||||||
{
|
{
|
||||||
scene.OnRestart += HandleRestart;
|
scene.OnRestart += HandleRestart;
|
||||||
m_localScenes.Add(scene);
|
|
||||||
|
lock (m_localScenes)
|
||||||
|
m_localScenes.Add(scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void HandleRestart(RegionInfo rdata)
|
public void HandleRestart(RegionInfo rdata)
|
||||||
{
|
{
|
||||||
m_log.Error("[SCENEMANAGER]: Got Restart message for region:" + rdata.RegionName + " Sending up to main");
|
m_log.Error("[SCENEMANAGER]: Got Restart message for region:" + rdata.RegionName + " Sending up to main");
|
||||||
int RegionSceneElement = -1;
|
int RegionSceneElement = -1;
|
||||||
for (int i = 0; i < m_localScenes.Count; i++)
|
|
||||||
|
lock (m_localScenes)
|
||||||
{
|
{
|
||||||
if (rdata.RegionName == m_localScenes[i].RegionInfo.RegionName)
|
for (int i = 0; i < m_localScenes.Count; i++)
|
||||||
{
|
{
|
||||||
RegionSceneElement = i;
|
if (rdata.RegionName == m_localScenes[i].RegionInfo.RegionName)
|
||||||
|
{
|
||||||
|
RegionSceneElement = i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Now we make sure the region is no longer known about by the SceneManager
|
// Now we make sure the region is no longer known about by the SceneManager
|
||||||
// Prevents duplicates.
|
// Prevents duplicates.
|
||||||
|
|
||||||
if (RegionSceneElement >= 0)
|
if (RegionSceneElement >= 0)
|
||||||
{
|
{
|
||||||
m_localScenes.RemoveAt(RegionSceneElement);
|
m_localScenes.RemoveAt(RegionSceneElement);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send signal to main that we're restarting this sim.
|
// Send signal to main that we're restarting this sim.
|
||||||
|
@ -167,28 +179,32 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
RegionInfo Result = null;
|
RegionInfo Result = null;
|
||||||
|
|
||||||
for (int i = 0; i < m_localScenes.Count; i++)
|
lock (m_localScenes)
|
||||||
{
|
|
||||||
if (m_localScenes[i].RegionInfo.RegionHandle == regionHandle)
|
|
||||||
{
|
|
||||||
// Inform other regions to tell their avatar about me
|
|
||||||
Result = m_localScenes[i].RegionInfo;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (Result != null)
|
|
||||||
{
|
{
|
||||||
for (int i = 0; i < m_localScenes.Count; i++)
|
for (int i = 0; i < m_localScenes.Count; i++)
|
||||||
{
|
{
|
||||||
if (m_localScenes[i].RegionInfo.RegionHandle != regionHandle)
|
if (m_localScenes[i].RegionInfo.RegionHandle == regionHandle)
|
||||||
{
|
{
|
||||||
// Inform other regions to tell their avatar about me
|
// Inform other regions to tell their avatar about me
|
||||||
//m_localScenes[i].OtherRegionUp(Result);
|
Result = m_localScenes[i].RegionInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
if (Result != null)
|
||||||
{
|
{
|
||||||
m_log.Error("[REGION]: Unable to notify Other regions of this Region coming up");
|
for (int i = 0; i < m_localScenes.Count; i++)
|
||||||
|
{
|
||||||
|
if (m_localScenes[i].RegionInfo.RegionHandle != regionHandle)
|
||||||
|
{
|
||||||
|
// Inform other regions to tell their avatar about me
|
||||||
|
//m_localScenes[i].OtherRegionUp(Result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_log.Error("[REGION]: Unable to notify Other regions of this Region coming up");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,7 +308,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
if (m_currentScene == null)
|
if (m_currentScene == null)
|
||||||
{
|
{
|
||||||
m_localScenes.ForEach(func);
|
lock (m_localScenes)
|
||||||
|
m_localScenes.ForEach(func);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -321,12 +338,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach (Scene scene in m_localScenes)
|
lock (m_localScenes)
|
||||||
{
|
{
|
||||||
if (String.Compare(scene.RegionInfo.RegionName, regionName, true) == 0)
|
foreach (Scene scene in m_localScenes)
|
||||||
{
|
{
|
||||||
m_currentScene = scene;
|
if (String.Compare(scene.RegionInfo.RegionName, regionName, true) == 0)
|
||||||
return true;
|
{
|
||||||
|
m_currentScene = scene;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -338,12 +358,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
m_log.Debug("Searching for Region: '" + regionID + "'");
|
m_log.Debug("Searching for Region: '" + regionID + "'");
|
||||||
|
|
||||||
foreach (Scene scene in m_localScenes)
|
lock (m_localScenes)
|
||||||
{
|
{
|
||||||
if (scene.RegionInfo.RegionID == regionID)
|
foreach (Scene scene in m_localScenes)
|
||||||
{
|
{
|
||||||
m_currentScene = scene;
|
if (scene.RegionInfo.RegionID == regionID)
|
||||||
return true;
|
{
|
||||||
|
m_currentScene = scene;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -352,26 +375,33 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public bool TryGetScene(string regionName, out Scene scene)
|
public bool TryGetScene(string regionName, out Scene scene)
|
||||||
{
|
{
|
||||||
foreach (Scene mscene in m_localScenes)
|
lock (m_localScenes)
|
||||||
{
|
{
|
||||||
if (String.Compare(mscene.RegionInfo.RegionName, regionName, true) == 0)
|
foreach (Scene mscene in m_localScenes)
|
||||||
{
|
{
|
||||||
scene = mscene;
|
if (String.Compare(mscene.RegionInfo.RegionName, regionName, true) == 0)
|
||||||
return true;
|
{
|
||||||
|
scene = mscene;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scene = null;
|
scene = null;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TryGetScene(UUID regionID, out Scene scene)
|
public bool TryGetScene(UUID regionID, out Scene scene)
|
||||||
{
|
{
|
||||||
foreach (Scene mscene in m_localScenes)
|
lock (m_localScenes)
|
||||||
{
|
{
|
||||||
if (mscene.RegionInfo.RegionID == regionID)
|
foreach (Scene mscene in m_localScenes)
|
||||||
{
|
{
|
||||||
scene = mscene;
|
if (mscene.RegionInfo.RegionID == regionID)
|
||||||
return true;
|
{
|
||||||
|
scene = mscene;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -381,13 +411,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public bool TryGetScene(uint locX, uint locY, out Scene scene)
|
public bool TryGetScene(uint locX, uint locY, out Scene scene)
|
||||||
{
|
{
|
||||||
foreach (Scene mscene in m_localScenes)
|
lock (m_localScenes)
|
||||||
{
|
{
|
||||||
if (mscene.RegionInfo.RegionLocX == locX &&
|
foreach (Scene mscene in m_localScenes)
|
||||||
mscene.RegionInfo.RegionLocY == locY)
|
|
||||||
{
|
{
|
||||||
scene = mscene;
|
if (mscene.RegionInfo.RegionLocX == locX &&
|
||||||
return true;
|
mscene.RegionInfo.RegionLocY == locY)
|
||||||
|
{
|
||||||
|
scene = mscene;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -397,13 +430,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public bool TryGetScene(IPEndPoint ipEndPoint, out Scene scene)
|
public bool TryGetScene(IPEndPoint ipEndPoint, out Scene scene)
|
||||||
{
|
{
|
||||||
foreach (Scene mscene in m_localScenes)
|
lock (m_localScenes)
|
||||||
{
|
{
|
||||||
if ((mscene.RegionInfo.InternalEndPoint.Equals(ipEndPoint.Address)) &&
|
foreach (Scene mscene in m_localScenes)
|
||||||
(mscene.RegionInfo.InternalEndPoint.Port == ipEndPoint.Port))
|
|
||||||
{
|
{
|
||||||
scene = mscene;
|
if ((mscene.RegionInfo.InternalEndPoint.Equals(ipEndPoint.Address)) &&
|
||||||
return true;
|
(mscene.RegionInfo.InternalEndPoint.Port == ipEndPoint.Port))
|
||||||
|
{
|
||||||
|
scene = mscene;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -472,11 +508,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public RegionInfo GetRegionInfo(UUID regionID)
|
public RegionInfo GetRegionInfo(UUID regionID)
|
||||||
{
|
{
|
||||||
foreach (Scene scene in m_localScenes)
|
lock (m_localScenes)
|
||||||
{
|
{
|
||||||
if (scene.RegionInfo.RegionID == regionID)
|
foreach (Scene scene in m_localScenes)
|
||||||
{
|
{
|
||||||
return scene.RegionInfo;
|
if (scene.RegionInfo.RegionID == regionID)
|
||||||
|
{
|
||||||
|
return scene.RegionInfo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -495,11 +534,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar)
|
public bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar)
|
||||||
{
|
{
|
||||||
foreach (Scene scene in m_localScenes)
|
lock (m_localScenes)
|
||||||
{
|
{
|
||||||
if (scene.TryGetScenePresence(avatarId, out avatar))
|
foreach (Scene scene in m_localScenes)
|
||||||
{
|
{
|
||||||
return true;
|
if (scene.TryGetScenePresence(avatarId, out avatar))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -510,12 +552,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
public bool TryGetAvatarsScene(UUID avatarId, out Scene scene)
|
public bool TryGetAvatarsScene(UUID avatarId, out Scene scene)
|
||||||
{
|
{
|
||||||
ScenePresence avatar = null;
|
ScenePresence avatar = null;
|
||||||
foreach (Scene mScene in m_localScenes)
|
|
||||||
|
lock (m_localScenes)
|
||||||
{
|
{
|
||||||
if (mScene.TryGetScenePresence(avatarId, out avatar))
|
foreach (Scene mScene in m_localScenes)
|
||||||
{
|
{
|
||||||
scene = mScene;
|
if (mScene.TryGetScenePresence(avatarId, out avatar))
|
||||||
return true;
|
{
|
||||||
|
scene = mScene;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -525,17 +571,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public void CloseScene(Scene scene)
|
public void CloseScene(Scene scene)
|
||||||
{
|
{
|
||||||
m_localScenes.Remove(scene);
|
lock (m_localScenes)
|
||||||
|
m_localScenes.Remove(scene);
|
||||||
|
|
||||||
scene.Close();
|
scene.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TryGetAvatarByName(string avatarName, out ScenePresence avatar)
|
public bool TryGetAvatarByName(string avatarName, out ScenePresence avatar)
|
||||||
{
|
{
|
||||||
foreach (Scene scene in m_localScenes)
|
lock (m_localScenes)
|
||||||
{
|
{
|
||||||
if (scene.TryGetAvatarByName(avatarName, out avatar))
|
foreach (Scene scene in m_localScenes)
|
||||||
{
|
{
|
||||||
return true;
|
if (scene.TryGetAvatarByName(avatarName, out avatar))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -545,7 +596,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public void ForEachScene(Action<Scene> action)
|
public void ForEachScene(Action<Scene> action)
|
||||||
{
|
{
|
||||||
m_localScenes.ForEach(action);
|
lock (m_localScenes)
|
||||||
|
m_localScenes.ForEach(action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1650,7 +1650,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
|
ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
|
||||||
if (avatar != null)
|
if (avatar != null)
|
||||||
{
|
{
|
||||||
avatar.MoveToTarget(target);
|
avatar.MoveToTarget(target, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2253,7 +2253,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="objectGroup"></param>
|
/// <param name="objectGroup"></param>
|
||||||
public virtual void DetachFromBackup()
|
public virtual void DetachFromBackup()
|
||||||
{
|
{
|
||||||
if (m_isBackedUp)
|
if (m_isBackedUp && Scene != null)
|
||||||
m_scene.EventManager.OnBackup -= ProcessBackup;
|
m_scene.EventManager.OnBackup -= ProcessBackup;
|
||||||
|
|
||||||
m_isBackedUp = false;
|
m_isBackedUp = false;
|
||||||
|
@ -2520,7 +2520,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
SceneObjectPart selectionPart = GetChildPart(localID);
|
SceneObjectPart selectionPart = GetChildPart(localID);
|
||||||
|
|
||||||
if (SetTemporary)
|
if (SetTemporary && Scene != null)
|
||||||
{
|
{
|
||||||
DetachFromBackup();
|
DetachFromBackup();
|
||||||
// Remove from database and parcel prim count
|
// Remove from database and parcel prim count
|
||||||
|
@ -2532,15 +2532,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (selectionPart != null)
|
if (selectionPart != null)
|
||||||
{
|
{
|
||||||
SceneObjectPart[] parts = m_parts.GetArray();
|
SceneObjectPart[] parts = m_parts.GetArray();
|
||||||
for (int i = 0; i < parts.Length; i++)
|
|
||||||
|
if (Scene != null)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = parts[i];
|
for (int i = 0; i < parts.Length; i++)
|
||||||
if (part.Scale.X > m_scene.RegionInfo.PhysPrimMax ||
|
|
||||||
part.Scale.Y > m_scene.RegionInfo.PhysPrimMax ||
|
|
||||||
part.Scale.Z > m_scene.RegionInfo.PhysPrimMax)
|
|
||||||
{
|
{
|
||||||
UsePhysics = false; // Reset physics
|
SceneObjectPart part = parts[i];
|
||||||
break;
|
if (part.Scale.X > m_scene.RegionInfo.PhysPrimMax ||
|
||||||
|
part.Scale.Y > m_scene.RegionInfo.PhysPrimMax ||
|
||||||
|
part.Scale.Z > m_scene.RegionInfo.PhysPrimMax)
|
||||||
|
{
|
||||||
|
UsePhysics = false; // Reset physics
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -261,12 +261,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
protected SceneObjectPartInventory m_inventory;
|
protected SceneObjectPartInventory m_inventory;
|
||||||
|
|
||||||
|
|
||||||
public bool Undoing;
|
public bool Undoing;
|
||||||
|
|
||||||
|
|
||||||
public bool IgnoreUndoUpdate = false;
|
public bool IgnoreUndoUpdate = false;
|
||||||
|
|
||||||
|
|
||||||
private PrimFlags LocalFlags;
|
private PrimFlags LocalFlags;
|
||||||
|
|
||||||
|
@ -1606,7 +1603,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
RotationOffset,
|
RotationOffset,
|
||||||
RigidBody,
|
RigidBody,
|
||||||
m_localId);
|
m_localId);
|
||||||
PhysActor.SetMaterial(Material);
|
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
@ -1618,6 +1614,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
PhysActor.SOPName = this.Name; // save object name and desc into the PhysActor so ODE internals know the joint/body info
|
PhysActor.SOPName = this.Name; // save object name and desc into the PhysActor so ODE internals know the joint/body info
|
||||||
PhysActor.SOPDescription = this.Description;
|
PhysActor.SOPDescription = this.Description;
|
||||||
|
PhysActor.SetMaterial(Material);
|
||||||
DoPhysicsPropertyUpdate(RigidBody, true);
|
DoPhysicsPropertyUpdate(RigidBody, true);
|
||||||
PhysActor.SetVolumeDetect(VolumeDetectActive ? 1 : 0);
|
PhysActor.SetVolumeDetect(VolumeDetectActive ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
@ -2970,22 +2967,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ScriptSetPhantomStatus(bool Phantom)
|
|
||||||
{
|
|
||||||
if (m_parentGroup != null)
|
|
||||||
{
|
|
||||||
m_parentGroup.ScriptSetPhantomStatus(Phantom);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ScriptSetTemporaryStatus(bool Temporary)
|
|
||||||
{
|
|
||||||
if (m_parentGroup != null)
|
|
||||||
{
|
|
||||||
m_parentGroup.ScriptSetTemporaryStatus(Temporary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ScriptSetPhysicsStatus(bool UsePhysics)
|
public void ScriptSetPhysicsStatus(bool UsePhysics)
|
||||||
{
|
{
|
||||||
if (m_parentGroup == null)
|
if (m_parentGroup == null)
|
||||||
|
@ -2994,15 +2975,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_parentGroup.ScriptSetPhysicsStatus(UsePhysics);
|
m_parentGroup.ScriptSetPhysicsStatus(UsePhysics);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ScriptSetVolumeDetect(bool SetVD)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (m_parentGroup != null)
|
|
||||||
{
|
|
||||||
m_parentGroup.ScriptSetVolumeDetect(SetVD);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set sculpt and mesh data, and tell the physics engine to process the change.
|
/// Set sculpt and mesh data, and tell the physics engine to process the change.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -4542,6 +4514,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
RemFlag(PrimFlags.Phantom);
|
RemFlag(PrimFlags.Phantom);
|
||||||
|
|
||||||
|
if (ParentGroup.Scene == null)
|
||||||
|
return;
|
||||||
|
|
||||||
PhysicsActor pa = PhysActor;
|
PhysicsActor pa = PhysActor;
|
||||||
|
|
||||||
if (pa == null)
|
if (pa == null)
|
||||||
|
@ -4555,11 +4530,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
RotationOffset,
|
RotationOffset,
|
||||||
UsePhysics,
|
UsePhysics,
|
||||||
m_localId);
|
m_localId);
|
||||||
PhysActor.SetMaterial(Material);
|
|
||||||
|
|
||||||
pa = PhysActor;
|
pa = PhysActor;
|
||||||
if (pa != null)
|
if (pa != null)
|
||||||
{
|
{
|
||||||
|
PhysActor.SetMaterial(Material);
|
||||||
DoPhysicsPropertyUpdate(UsePhysics, true);
|
DoPhysicsPropertyUpdate(UsePhysics, true);
|
||||||
|
|
||||||
if (m_parentGroup != null)
|
if (m_parentGroup != null)
|
||||||
|
@ -4645,6 +4620,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
ParentGroup.HasGroupChanged = true;
|
ParentGroup.HasGroupChanged = true;
|
||||||
ScheduleFullUpdate();
|
ScheduleFullUpdate();
|
||||||
|
|
||||||
|
// m_log.DebugFormat("[SCENE OBJECT PART]: Updated PrimFlags on {0} {1} to {2}", Name, LocalId, Flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateRotation(Quaternion rot)
|
public void UpdateRotation(Quaternion rot)
|
||||||
|
@ -4864,7 +4841,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// m_parentGroup.Scene.EventManager.OnScriptTimerEvent -= handleTimerAccounting;
|
// m_parentGroup.Scene.EventManager.OnScriptTimerEvent -= handleTimerAccounting;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
LocalFlags=(PrimFlags)objectflagupdate;
|
LocalFlags = (PrimFlags)objectflagupdate;
|
||||||
|
|
||||||
if (m_parentGroup != null && m_parentGroup.RootPart == this)
|
if (m_parentGroup != null && m_parentGroup.RootPart == this)
|
||||||
{
|
{
|
||||||
|
|
|
@ -75,6 +75,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// What type of presence is this? User, NPC, etc.
|
||||||
|
/// </summary>
|
||||||
|
public PresenceType PresenceType { get; private set; }
|
||||||
|
|
||||||
// private static readonly byte[] DEFAULT_TEXTURE = AvatarAppearance.GetDefaultTexture().GetBytes();
|
// private static readonly byte[] DEFAULT_TEXTURE = AvatarAppearance.GetDefaultTexture().GetBytes();
|
||||||
private static readonly Array DIR_CONTROL_FLAGS = Enum.GetValues(typeof(Dir_ControlFlags));
|
private static readonly Array DIR_CONTROL_FLAGS = Enum.GetValues(typeof(Dir_ControlFlags));
|
||||||
private static readonly Vector3 HEAD_ADJUSTMENT = new Vector3(0f, 0f, 0.3f);
|
private static readonly Vector3 HEAD_ADJUSTMENT = new Vector3(0f, 0f, 0.3f);
|
||||||
|
@ -173,7 +178,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
private float m_speedModifier = 1.0f;
|
private float m_speedModifier = 1.0f;
|
||||||
|
|
||||||
private Quaternion m_bodyRot= Quaternion.Identity;
|
private Quaternion m_bodyRot = Quaternion.Identity;
|
||||||
|
|
||||||
private Quaternion m_bodyRotPrevious = Quaternion.Identity;
|
private Quaternion m_bodyRotPrevious = Quaternion.Identity;
|
||||||
|
|
||||||
|
@ -708,15 +713,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
#region Constructor(s)
|
#region Constructor(s)
|
||||||
|
|
||||||
public ScenePresence()
|
public ScenePresence(
|
||||||
|
IClientAPI client, Scene world, RegionInfo reginfo, AvatarAppearance appearance, PresenceType type)
|
||||||
{
|
{
|
||||||
m_sendCourseLocationsMethod = SendCoarseLocationsDefault;
|
m_sendCourseLocationsMethod = SendCoarseLocationsDefault;
|
||||||
CreateSceneViewer();
|
m_sceneViewer = new SceneViewer(this);
|
||||||
m_animator = new ScenePresenceAnimator(this);
|
m_animator = new ScenePresenceAnimator(this);
|
||||||
}
|
PresenceType = type;
|
||||||
|
|
||||||
private ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo) : this()
|
|
||||||
{
|
|
||||||
m_DrawDistance = world.DefaultDrawDistance;
|
m_DrawDistance = world.DefaultDrawDistance;
|
||||||
m_rootRegionHandle = reginfo.RegionHandle;
|
m_rootRegionHandle = reginfo.RegionHandle;
|
||||||
m_controllingClient = client;
|
m_controllingClient = client;
|
||||||
|
@ -762,19 +765,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
RegisterToEvents();
|
RegisterToEvents();
|
||||||
SetDirectionVectors();
|
SetDirectionVectors();
|
||||||
}
|
|
||||||
|
|
||||||
public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, AvatarAppearance appearance)
|
|
||||||
: this(client, world, reginfo)
|
|
||||||
{
|
|
||||||
m_appearance = appearance;
|
m_appearance = appearance;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreateSceneViewer()
|
|
||||||
{
|
|
||||||
m_sceneViewer = new SceneViewer(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void RegisterToEvents()
|
public void RegisterToEvents()
|
||||||
{
|
{
|
||||||
m_controllingClient.OnCompleteMovementToRegion += CompleteMovement;
|
m_controllingClient.OnCompleteMovementToRegion += CompleteMovement;
|
||||||
|
@ -1144,10 +1138,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Complete Avatar's movement into the region.
|
/// Complete Avatar's movement into the region.
|
||||||
/// This is called upon a very important packet sent from the client,
|
|
||||||
/// so it's client-controlled. Never call this method directly.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void CompleteMovement(IClientAPI client)
|
/// <param name="client"></param>
|
||||||
|
/// <param name="openChildAgents">
|
||||||
|
/// If true, send notification to neighbour regions to expect
|
||||||
|
/// a child agent from the client. These neighbours can be some distance away, depending right now on the
|
||||||
|
/// configuration of DefaultDrawDistance in the [Startup] section of config
|
||||||
|
/// </param>
|
||||||
|
public void CompleteMovement(IClientAPI client, bool openChildAgents)
|
||||||
{
|
{
|
||||||
// DateTime startTime = DateTime.Now;
|
// DateTime startTime = DateTime.Now;
|
||||||
|
|
||||||
|
@ -1188,15 +1186,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
SendInitialData();
|
SendInitialData();
|
||||||
|
|
||||||
// Create child agents in neighbouring regions
|
// Create child agents in neighbouring regions
|
||||||
if (!m_isChildAgent)
|
if (openChildAgents && !m_isChildAgent)
|
||||||
{
|
{
|
||||||
IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
|
IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
|
||||||
if (m_agentTransfer != null)
|
if (m_agentTransfer != null)
|
||||||
m_agentTransfer.EnableChildAgents(this);
|
m_agentTransfer.EnableChildAgents(this);
|
||||||
else
|
|
||||||
m_log.DebugFormat(
|
|
||||||
"[SCENE PRESENCE]: Unable to create child agents in neighbours, because AgentTransferModule is not active for region {0}",
|
|
||||||
m_scene.RegionInfo.RegionName);
|
|
||||||
|
|
||||||
IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>();
|
IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>();
|
||||||
if (friendsModule != null)
|
if (friendsModule != null)
|
||||||
|
@ -1294,7 +1288,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
#region Inputs
|
#region Inputs
|
||||||
|
|
||||||
AgentManager.ControlFlags flags = (AgentManager.ControlFlags)agentData.ControlFlags;
|
AgentManager.ControlFlags flags = (AgentManager.ControlFlags)agentData.ControlFlags;
|
||||||
Quaternion bodyRotation = agentData.BodyRotation;
|
|
||||||
|
|
||||||
// Camera location in world. We'll need to raytrace
|
// Camera location in world. We'll need to raytrace
|
||||||
// from this location from time to time.
|
// from this location from time to time.
|
||||||
|
@ -1380,6 +1373,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
if (m_allowMovement && !SitGround)
|
if (m_allowMovement && !SitGround)
|
||||||
{
|
{
|
||||||
|
Quaternion bodyRotation = agentData.BodyRotation;
|
||||||
|
bool update_rotation = false;
|
||||||
|
|
||||||
|
if (bodyRotation != m_bodyRot)
|
||||||
|
{
|
||||||
|
Rotation = bodyRotation;
|
||||||
|
update_rotation = true;
|
||||||
|
}
|
||||||
|
|
||||||
bool update_movementflag = false;
|
bool update_movementflag = false;
|
||||||
|
|
||||||
if (agentData.UseClientAgentPosition)
|
if (agentData.UseClientAgentPosition)
|
||||||
|
@ -1389,11 +1391,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
bool update_rotation = false;
|
|
||||||
bool DCFlagKeyPressed = false;
|
bool DCFlagKeyPressed = false;
|
||||||
Vector3 agent_control_v3 = Vector3.Zero;
|
Vector3 agent_control_v3 = Vector3.Zero;
|
||||||
Quaternion q = bodyRotation;
|
|
||||||
|
|
||||||
bool oldflying = PhysicsActor.Flying;
|
bool oldflying = PhysicsActor.Flying;
|
||||||
|
|
||||||
|
@ -1407,12 +1406,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (actor.Flying != oldflying)
|
if (actor.Flying != oldflying)
|
||||||
update_movementflag = true;
|
update_movementflag = true;
|
||||||
|
|
||||||
if (q != m_bodyRot)
|
|
||||||
{
|
|
||||||
m_bodyRot = q;
|
|
||||||
update_rotation = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_parentID == 0)
|
if (m_parentID == 0)
|
||||||
{
|
{
|
||||||
bool bAllowUpdateMoveToPosition = false;
|
bool bAllowUpdateMoveToPosition = false;
|
||||||
|
@ -1464,8 +1457,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
) // This or is for Nudge forward
|
) // This or is for Nudge forward
|
||||||
{
|
{
|
||||||
m_movementflag -= ((byte)(uint)DCF);
|
m_movementflag -= ((byte)(uint)DCF);
|
||||||
|
|
||||||
update_movementflag = true;
|
update_movementflag = true;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if ((DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE)
|
if ((DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE)
|
||||||
&& ((m_movementflag & (byte)nudgehack) == nudgehack))
|
&& ((m_movementflag & (byte)nudgehack) == nudgehack))
|
||||||
|
@ -1493,7 +1486,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
else if (bAllowUpdateMoveToPosition)
|
else if (bAllowUpdateMoveToPosition)
|
||||||
{
|
{
|
||||||
if (HandleMoveToTargetUpdate(ref agent_control_v3, bodyRotation))
|
if (HandleMoveToTargetUpdate(ref agent_control_v3))
|
||||||
update_movementflag = true;
|
update_movementflag = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1531,13 +1524,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "In {0} adding velocity to {1} of {2}", m_scene.RegionInfo.RegionName, Name, agent_control_v3);
|
// "In {0} adding velocity to {1} of {2}", m_scene.RegionInfo.RegionName, Name, agent_control_v3);
|
||||||
|
|
||||||
AddNewMovement(agent_control_v3, q);
|
AddNewMovement(agent_control_v3);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update_movementflag
|
if (update_movementflag && m_parentID == 0)
|
||||||
&& ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) == 0)
|
|
||||||
&& (m_parentID == 0)
|
|
||||||
&& !SitGround)
|
|
||||||
Animator.UpdateMovementAnimations();
|
Animator.UpdateMovementAnimations();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1553,9 +1543,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// This doesn't actually perform the movement. Instead, it adds its vector to agent_control_v3.
|
/// This doesn't actually perform the movement. Instead, it adds its vector to agent_control_v3.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <param value="agent_control_v3">Cumulative agent movement that this method will update.</param>
|
/// <param value="agent_control_v3">Cumulative agent movement that this method will update.</param>
|
||||||
/// <param value="bodyRotation">New body rotation of the avatar.</param>
|
|
||||||
/// <returns>True if movement has been updated in some way. False otherwise.</returns>
|
/// <returns>True if movement has been updated in some way. False otherwise.</returns>
|
||||||
public bool HandleMoveToTargetUpdate(ref Vector3 agent_control_v3, Quaternion bodyRotation)
|
public bool HandleMoveToTargetUpdate(ref Vector3 agent_control_v3)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("[SCENE PRESENCE]: Called HandleMoveToTargetUpdate() for {0}", Name);
|
// m_log.DebugFormat("[SCENE PRESENCE]: Called HandleMoveToTargetUpdate() for {0}", Name);
|
||||||
|
|
||||||
|
@ -1591,7 +1580,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// to such forces, but the following simple approach seems to works fine.
|
// to such forces, but the following simple approach seems to works fine.
|
||||||
Vector3 LocalVectorToTarget3D =
|
Vector3 LocalVectorToTarget3D =
|
||||||
(MoveToPositionTarget - AbsolutePosition) // vector from cur. pos to target in global coords
|
(MoveToPositionTarget - AbsolutePosition) // vector from cur. pos to target in global coords
|
||||||
* Matrix4.CreateFromQuaternion(Quaternion.Inverse(bodyRotation)); // change to avatar coords
|
* Matrix4.CreateFromQuaternion(Quaternion.Inverse(Rotation)); // change to avatar coords
|
||||||
// Ignore z component of vector
|
// Ignore z component of vector
|
||||||
// Vector3 LocalVectorToTarget2D = new Vector3((float)(LocalVectorToTarget3D.X), (float)(LocalVectorToTarget3D.Y), 0f);
|
// Vector3 LocalVectorToTarget2D = new Vector3((float)(LocalVectorToTarget3D.X), (float)(LocalVectorToTarget3D.Y), 0f);
|
||||||
LocalVectorToTarget3D.Normalize();
|
LocalVectorToTarget3D.Normalize();
|
||||||
|
@ -1680,7 +1669,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// Move to the given target over time.
|
/// Move to the given target over time.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="pos"></param>
|
/// <param name="pos"></param>
|
||||||
public void MoveToTarget(Vector3 pos)
|
/// <param name="noFly">
|
||||||
|
/// If true, then don't allow the avatar to fly to the target, even if it's up in the air.
|
||||||
|
/// This is to allow movement to targets that are known to be on an elevated platform with a continuous path
|
||||||
|
/// from start to finish.
|
||||||
|
/// </param>
|
||||||
|
public void MoveToTarget(Vector3 pos, bool noFly)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[SCENE PRESENCE]: Avatar {0} received request to move to position {1} in {2}",
|
// "[SCENE PRESENCE]: Avatar {0} received request to move to position {1} in {2}",
|
||||||
|
@ -1714,15 +1708,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
"[SCENE PRESENCE]: Avatar {0} set move to target {1} (terrain height {2}) in {3}",
|
"[SCENE PRESENCE]: Avatar {0} set move to target {1} (terrain height {2}) in {3}",
|
||||||
Name, pos, terrainHeight, m_scene.RegionInfo.RegionName);
|
Name, pos, terrainHeight, m_scene.RegionInfo.RegionName);
|
||||||
|
|
||||||
if (pos.Z > terrainHeight)
|
if (noFly)
|
||||||
|
PhysicsActor.Flying = false;
|
||||||
|
else if (pos.Z > terrainHeight)
|
||||||
PhysicsActor.Flying = true;
|
PhysicsActor.Flying = true;
|
||||||
|
|
||||||
MovingToTarget = true;
|
MovingToTarget = true;
|
||||||
MoveToPositionTarget = pos;
|
MoveToPositionTarget = pos;
|
||||||
|
|
||||||
Vector3 agent_control_v3 = new Vector3();
|
Vector3 agent_control_v3 = new Vector3();
|
||||||
HandleMoveToTargetUpdate(ref agent_control_v3, Rotation);
|
HandleMoveToTargetUpdate(ref agent_control_v3);
|
||||||
AddNewMovement(agent_control_v3, Rotation);
|
AddNewMovement(agent_control_v3);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1734,6 +1730,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
MovingToTarget = false;
|
MovingToTarget = false;
|
||||||
MoveToPositionTarget = Vector3.Zero;
|
MoveToPositionTarget = Vector3.Zero;
|
||||||
|
|
||||||
|
// We need to reset the control flag as the ScenePresenceAnimator uses this to determine the correct
|
||||||
|
// resting animation (e.g. hover or stand). NPCs don't have a client that will quickly reset this flag.
|
||||||
|
// However, the line is here rather than in the NPC module since it also appears necessary to stop a
|
||||||
|
// viewer that uses "go here" from juddering on all subsequent avatar movements.
|
||||||
|
AgentControlFlags = (uint)AgentManager.ControlFlags.NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckAtSitTarget()
|
private void CheckAtSitTarget()
|
||||||
|
@ -2295,20 +2297,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// Rotate the avatar to the given rotation and apply a movement in the given relative vector
|
/// Rotate the avatar to the given rotation and apply a movement in the given relative vector
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="vec">The vector in which to move. This is relative to the rotation argument</param>
|
/// <param name="vec">The vector in which to move. This is relative to the rotation argument</param>
|
||||||
/// <param name="rotation">The direction in which this avatar should now face.
|
public void AddNewMovement(Vector3 vec)
|
||||||
public void AddNewMovement(Vector3 vec, Quaternion rotation)
|
|
||||||
{
|
{
|
||||||
if (m_isChildAgent)
|
|
||||||
{
|
|
||||||
// WHAT???
|
|
||||||
m_log.Debug("[SCENEPRESENCE]: AddNewMovement() called on child agent, making root agent!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_perfMonMS = Util.EnvironmentTickCount();
|
m_perfMonMS = Util.EnvironmentTickCount();
|
||||||
|
|
||||||
Rotation = rotation;
|
Vector3 direc = vec * Rotation;
|
||||||
Vector3 direc = vec * rotation;
|
|
||||||
direc.Normalize();
|
direc.Normalize();
|
||||||
|
|
||||||
direc *= 0.03f * 128f * m_speedModifier;
|
direc *= 0.03f * 128f * m_speedModifier;
|
||||||
|
@ -2513,13 +2506,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// We have an appearance but we may not have the baked textures. Check the asset cache
|
// We have an appearance but we may not have the baked textures. Check the asset cache
|
||||||
// to see if all the baked textures are already here.
|
// to see if all the baked textures are already here.
|
||||||
if (m_scene.AvatarFactory != null)
|
if (m_scene.AvatarFactory != null)
|
||||||
{
|
|
||||||
cachedappearance = m_scene.AvatarFactory.ValidateBakedTextureCache(m_controllingClient);
|
cachedappearance = m_scene.AvatarFactory.ValidateBakedTextureCache(m_controllingClient);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_log.WarnFormat("[SCENEPRESENCE]: AvatarFactory not set for {0}", Name);
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we aren't using a cached appearance, then clear out the baked textures
|
// If we aren't using a cached appearance, then clear out the baked textures
|
||||||
if (!cachedappearance)
|
if (!cachedappearance)
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestCross()
|
public void TestCross()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
List<Border> testborders = new List<Border>();
|
List<Border> testborders = new List<Border>();
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestCrossSquare512()
|
public void TestCrossSquare512()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
List<Border> testborders = new List<Border>();
|
List<Border> testborders = new List<Border>();
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestCrossRectangle512x256()
|
public void TestCrossRectangle512x256()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
List<Border> testborders = new List<Border>();
|
List<Border> testborders = new List<Border>();
|
||||||
|
|
||||||
|
@ -259,7 +259,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestCrossOdd512x512w256hole()
|
public void TestCrossOdd512x512w256hole()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
List<Border> testborders = new List<Border>();
|
List<Border> testborders = new List<Border>();
|
||||||
// 512____
|
// 512____
|
||||||
|
|
|
@ -45,12 +45,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
{
|
{
|
||||||
static public Random random;
|
static public Random random;
|
||||||
SceneObjectGroup found;
|
SceneObjectGroup found;
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void T010_AddObjects()
|
public void T010_AddObjects()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
random = new Random();
|
random = new Random();
|
||||||
SceneObjectGroup found;
|
SceneObjectGroup found;
|
||||||
|
@ -85,7 +85,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T011_ThreadAddRemoveTest()
|
public void T011_ThreadAddRemoveTest()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
// This test adds and removes with mutiple threads, attempting to break the
|
// This test adds and removes with mutiple threads, attempting to break the
|
||||||
// uuid and localid dictionary coherence.
|
// uuid and localid dictionary coherence.
|
||||||
|
|
|
@ -43,8 +43,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDuplicateObject()
|
public void TestDuplicateObject()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
|
|
||||||
UUID ownerId = new UUID("00000000-0000-0000-0000-000000000010");
|
UUID ownerId = new UUID("00000000-0000-0000-0000-000000000010");
|
||||||
string part1Name = "part1";
|
string part1Name = "part1";
|
||||||
|
|
|
@ -49,9 +49,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestAddSceneObject()
|
public void TestAddSceneObject()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
|
|
||||||
string objName = "obj1";
|
string objName = "obj1";
|
||||||
UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001");
|
UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001");
|
||||||
|
@ -76,9 +76,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void TestAddExistingSceneObjectUuid()
|
public void TestAddExistingSceneObjectUuid()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
|
|
||||||
string obj1Name = "Alfred";
|
string obj1Name = "Alfred";
|
||||||
string obj2Name = "Betty";
|
string obj2Name = "Betty";
|
||||||
|
@ -110,10 +110,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDeleteSceneObject()
|
public void TestDeleteSceneObject()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
TestScene scene = SceneSetupHelpers.SetupScene();
|
TestScene scene = SceneHelpers.SetupScene();
|
||||||
SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene);
|
SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
|
||||||
scene.DeleteSceneObject(part.ParentGroup, false);
|
scene.DeleteSceneObject(part.ParentGroup, false);
|
||||||
|
|
||||||
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
|
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
|
||||||
|
@ -126,20 +126,20 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDeleteSceneObjectAsync()
|
public void TestDeleteSceneObjectAsync()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
//log4net.Config.XmlConfigurator.Configure();
|
//log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001");
|
UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001");
|
||||||
|
|
||||||
TestScene scene = SceneSetupHelpers.SetupScene();
|
TestScene scene = SceneHelpers.SetupScene();
|
||||||
|
|
||||||
// Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
|
// Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
|
||||||
AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
|
AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
|
||||||
sogd.Enabled = false;
|
sogd.Enabled = false;
|
||||||
|
|
||||||
SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene);
|
SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
|
||||||
|
|
||||||
IClientAPI client = SceneSetupHelpers.AddClient(scene, agentId);
|
IClientAPI client = SceneHelpers.AddScenePresence(scene, agentId).ControllingClient;
|
||||||
scene.DeRezObjects(client, new System.Collections.Generic.List<uint>() { part.LocalId }, UUID.Zero, DeRezAction.Delete, UUID.Zero);
|
scene.DeRezObjects(client, new System.Collections.Generic.List<uint>() { part.LocalId }, UUID.Zero, DeRezAction.Delete, UUID.Zero);
|
||||||
|
|
||||||
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
|
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
|
||||||
|
|
|
@ -56,17 +56,17 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDeRezSceneObject()
|
public void TestDeRezSceneObject()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
|
UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
|
||||||
|
|
||||||
TestScene scene = SceneSetupHelpers.SetupScene();
|
TestScene scene = SceneHelpers.SetupScene();
|
||||||
IConfigSource configSource = new IniConfigSource();
|
IConfigSource configSource = new IniConfigSource();
|
||||||
IConfig config = configSource.AddConfig("Startup");
|
IConfig config = configSource.AddConfig("Startup");
|
||||||
config.Set("serverside_object_permissions", true);
|
config.Set("serverside_object_permissions", true);
|
||||||
SceneSetupHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() });
|
SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() });
|
||||||
TestClient client = SceneSetupHelpers.AddClient(scene, userId);
|
IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient;
|
||||||
|
|
||||||
// Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
|
// Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
|
||||||
AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
|
AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
|
||||||
|
@ -94,18 +94,18 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDeRezSceneObjectNotOwner()
|
public void TestDeRezSceneObjectNotOwner()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
|
UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
|
||||||
UUID objectOwnerId = UUID.Parse("20000000-0000-0000-0000-000000000001");
|
UUID objectOwnerId = UUID.Parse("20000000-0000-0000-0000-000000000001");
|
||||||
|
|
||||||
TestScene scene = SceneSetupHelpers.SetupScene();
|
TestScene scene = SceneHelpers.SetupScene();
|
||||||
IConfigSource configSource = new IniConfigSource();
|
IConfigSource configSource = new IniConfigSource();
|
||||||
IConfig config = configSource.AddConfig("Startup");
|
IConfig config = configSource.AddConfig("Startup");
|
||||||
config.Set("serverside_object_permissions", true);
|
config.Set("serverside_object_permissions", true);
|
||||||
SceneSetupHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() });
|
SceneHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() });
|
||||||
TestClient client = SceneSetupHelpers.AddClient(scene, userId);
|
IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient;
|
||||||
|
|
||||||
// Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
|
// Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
|
||||||
AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
|
AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
|
||||||
|
|
|
@ -50,14 +50,14 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestLinkDelink2SceneObjects()
|
public void TestLinkDelink2SceneObjects()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
bool debugtest = false;
|
bool debugtest = false;
|
||||||
|
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
SceneObjectPart part1 = SceneSetupHelpers.AddSceneObject(scene);
|
SceneObjectPart part1 = SceneHelpers.AddSceneObject(scene);
|
||||||
SceneObjectGroup grp1 = part1.ParentGroup;
|
SceneObjectGroup grp1 = part1.ParentGroup;
|
||||||
SceneObjectPart part2 = SceneSetupHelpers.AddSceneObject(scene);
|
SceneObjectPart part2 = SceneHelpers.AddSceneObject(scene);
|
||||||
SceneObjectGroup grp2 = part2.ParentGroup;
|
SceneObjectGroup grp2 = part2.ParentGroup;
|
||||||
|
|
||||||
grp1.AbsolutePosition = new Vector3(10, 10, 10);
|
grp1.AbsolutePosition = new Vector3(10, 10, 10);
|
||||||
|
@ -132,18 +132,18 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestLinkDelink2groups4SceneObjects()
|
public void TestLinkDelink2groups4SceneObjects()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
bool debugtest = false;
|
bool debugtest = false;
|
||||||
|
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
SceneObjectPart part1 = SceneSetupHelpers.AddSceneObject(scene);
|
SceneObjectPart part1 = SceneHelpers.AddSceneObject(scene);
|
||||||
SceneObjectGroup grp1 = part1.ParentGroup;
|
SceneObjectGroup grp1 = part1.ParentGroup;
|
||||||
SceneObjectPart part2 = SceneSetupHelpers.AddSceneObject(scene);
|
SceneObjectPart part2 = SceneHelpers.AddSceneObject(scene);
|
||||||
SceneObjectGroup grp2 = part2.ParentGroup;
|
SceneObjectGroup grp2 = part2.ParentGroup;
|
||||||
SceneObjectPart part3 = SceneSetupHelpers.AddSceneObject(scene);
|
SceneObjectPart part3 = SceneHelpers.AddSceneObject(scene);
|
||||||
SceneObjectGroup grp3 = part3.ParentGroup;
|
SceneObjectGroup grp3 = part3.ParentGroup;
|
||||||
SceneObjectPart part4 = SceneSetupHelpers.AddSceneObject(scene);
|
SceneObjectPart part4 = SceneHelpers.AddSceneObject(scene);
|
||||||
SceneObjectGroup grp4 = part4.ParentGroup;
|
SceneObjectGroup grp4 = part4.ParentGroup;
|
||||||
|
|
||||||
grp1.AbsolutePosition = new Vector3(10, 10, 10);
|
grp1.AbsolutePosition = new Vector3(10, 10, 10);
|
||||||
|
@ -266,10 +266,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestNewSceneObjectLinkPersistence()
|
public void TestNewSceneObjectLinkPersistence()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
//log4net.Config.XmlConfigurator.Configure();
|
//log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
TestScene scene = SceneSetupHelpers.SetupScene();
|
TestScene scene = SceneHelpers.SetupScene();
|
||||||
|
|
||||||
string rootPartName = "rootpart";
|
string rootPartName = "rootpart";
|
||||||
UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001");
|
UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001");
|
||||||
|
@ -305,10 +305,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDelinkPersistence()
|
public void TestDelinkPersistence()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
//log4net.Config.XmlConfigurator.Configure();
|
//log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
TestScene scene = SceneSetupHelpers.SetupScene();
|
TestScene scene = SceneHelpers.SetupScene();
|
||||||
|
|
||||||
string rootPartName = "rootpart";
|
string rootPartName = "rootpart";
|
||||||
UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001");
|
UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001");
|
||||||
|
|
|
@ -49,11 +49,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestResizeSceneObject()
|
public void TestResizeSceneObject()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
SceneObjectGroup g1 = SceneSetupHelpers.AddSceneObject(scene).ParentGroup;
|
SceneObjectGroup g1 = SceneHelpers.AddSceneObject(scene).ParentGroup;
|
||||||
|
|
||||||
g1.GroupResize(new Vector3(2, 3, 4));
|
g1.GroupResize(new Vector3(2, 3, 4));
|
||||||
|
|
||||||
|
@ -72,12 +72,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestResizeSceneObjectPart()
|
public void TestResizeSceneObjectPart()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
//log4net.Config.XmlConfigurator.Configure();
|
//log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
|
|
||||||
SceneObjectGroup g1 = SceneSetupHelpers.CreateSceneObject(2, UUID.Zero);
|
SceneObjectGroup g1 = SceneHelpers.CreateSceneObject(2, UUID.Zero);
|
||||||
g1.RootPart.Scale = new Vector3(2, 3, 4);
|
g1.RootPart.Scale = new Vector3(2, 3, 4);
|
||||||
g1.Parts[1].Scale = new Vector3(5, 6, 7);
|
g1.Parts[1].Scale = new Vector3(5, 6, 7);
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,66 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) Contributors, http://opensimulator.org/
|
||||||
|
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of the OpenSimulator Project nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Reflection;
|
||||||
|
using NUnit.Framework;
|
||||||
|
using OpenMetaverse;
|
||||||
|
using OpenSim.Framework;
|
||||||
|
using OpenSim.Framework.Communications;
|
||||||
|
using OpenSim.Region.Framework.Scenes;
|
||||||
|
using OpenSim.Tests.Common;
|
||||||
|
using OpenSim.Tests.Common.Mock;
|
||||||
|
|
||||||
|
namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Basic scene object status tests
|
||||||
|
/// </summary>
|
||||||
|
[TestFixture]
|
||||||
|
public class SceneObjectStatusTests
|
||||||
|
{
|
||||||
|
[Test]
|
||||||
|
public void TestSetPhantom()
|
||||||
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
|
// Scene scene = SceneSetupHelpers.SetupScene();
|
||||||
|
SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, UUID.Zero);
|
||||||
|
SceneObjectPart rootPart = so.RootPart;
|
||||||
|
Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None));
|
||||||
|
|
||||||
|
so.ScriptSetPhantomStatus(true);
|
||||||
|
|
||||||
|
// Console.WriteLine("so.RootPart.Flags [{0}]", so.RootPart.Flags);
|
||||||
|
Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Phantom));
|
||||||
|
|
||||||
|
so.ScriptSetPhantomStatus(false);
|
||||||
|
|
||||||
|
Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -53,12 +53,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestShareWithGroup()
|
public void TestShareWithGroup()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
|
UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
|
||||||
|
|
||||||
TestScene scene = SceneSetupHelpers.SetupScene();
|
TestScene scene = SceneHelpers.SetupScene();
|
||||||
IConfigSource configSource = new IniConfigSource();
|
IConfigSource configSource = new IniConfigSource();
|
||||||
|
|
||||||
IConfig startupConfig = configSource.AddConfig("Startup");
|
IConfig startupConfig = configSource.AddConfig("Startup");
|
||||||
|
@ -69,13 +69,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
groupsConfig.Set("Module", "GroupsModule");
|
groupsConfig.Set("Module", "GroupsModule");
|
||||||
groupsConfig.Set("DebugEnabled", true);
|
groupsConfig.Set("DebugEnabled", true);
|
||||||
|
|
||||||
SceneSetupHelpers.SetupSceneModules(
|
SceneHelpers.SetupSceneModules(
|
||||||
scene, configSource, new object[]
|
scene, configSource, new object[]
|
||||||
{ new PermissionsModule(),
|
{ new PermissionsModule(),
|
||||||
new GroupsModule(),
|
new GroupsModule(),
|
||||||
new MockGroupsServicesConnector() });
|
new MockGroupsServicesConnector() });
|
||||||
|
|
||||||
TestClient client = SceneSetupHelpers.AddClient(scene, userId);
|
IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient;
|
||||||
|
|
||||||
IGroupsModule groupsModule = scene.RequestModuleInterface<IGroupsModule>();
|
IGroupsModule groupsModule = scene.RequestModuleInterface<IGroupsModule>();
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
/// Scene presence tests
|
/// Scene presence tests
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class ScenePresenceTests
|
public class ScenePresenceAgentTests
|
||||||
{
|
{
|
||||||
public Scene scene, scene2, scene3;
|
public Scene scene, scene2, scene3;
|
||||||
public UUID agent1, agent2, agent3;
|
public UUID agent1, agent2, agent3;
|
||||||
|
@ -64,90 +64,140 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[TestFixtureSetUp]
|
[TestFixtureSetUp]
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
scene = SceneSetupHelpers.SetupScene("Neighbour x", UUID.Random(), 1000, 1000);
|
scene = SceneHelpers.SetupScene("Neighbour x", UUID.Random(), 1000, 1000);
|
||||||
scene2 = SceneSetupHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000);
|
scene2 = SceneHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000);
|
||||||
scene3 = SceneSetupHelpers.SetupScene("Neighbour x-1", UUID.Random(), 999, 1000);
|
scene3 = SceneHelpers.SetupScene("Neighbour x-1", UUID.Random(), 999, 1000);
|
||||||
|
|
||||||
ISharedRegionModule interregionComms = new LocalSimulationConnectorModule();
|
ISharedRegionModule interregionComms = new LocalSimulationConnectorModule();
|
||||||
interregionComms.Initialise(new IniConfigSource());
|
interregionComms.Initialise(new IniConfigSource());
|
||||||
interregionComms.PostInitialise();
|
interregionComms.PostInitialise();
|
||||||
SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), interregionComms);
|
SceneHelpers.SetupSceneModules(scene, new IniConfigSource(), interregionComms);
|
||||||
SceneSetupHelpers.SetupSceneModules(scene2, new IniConfigSource(), interregionComms);
|
SceneHelpers.SetupSceneModules(scene2, new IniConfigSource(), interregionComms);
|
||||||
SceneSetupHelpers.SetupSceneModules(scene3, new IniConfigSource(), interregionComms);
|
SceneHelpers.SetupSceneModules(scene3, new IniConfigSource(), interregionComms);
|
||||||
|
|
||||||
agent1 = UUID.Random();
|
agent1 = UUID.Random();
|
||||||
agent2 = UUID.Random();
|
agent2 = UUID.Random();
|
||||||
agent3 = UUID.Random();
|
agent3 = UUID.Random();
|
||||||
random = new Random();
|
random = new Random();
|
||||||
sog1 = NewSOG(UUID.Random(), scene, agent1);
|
sog1 = SceneHelpers.CreateSceneObject(1, agent1);
|
||||||
sog2 = NewSOG(UUID.Random(), scene, agent1);
|
scene.AddSceneObject(sog1);
|
||||||
sog3 = NewSOG(UUID.Random(), scene, agent1);
|
sog2 = SceneHelpers.CreateSceneObject(1, agent1);
|
||||||
|
scene.AddSceneObject(sog2);
|
||||||
|
sog3 = SceneHelpers.CreateSceneObject(1, agent1);
|
||||||
|
scene.AddSceneObject(sog3);
|
||||||
|
|
||||||
//ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize));
|
|
||||||
region1 = scene.RegionInfo.RegionHandle;
|
region1 = scene.RegionInfo.RegionHandle;
|
||||||
region2 = scene2.RegionInfo.RegionHandle;
|
region2 = scene2.RegionInfo.RegionHandle;
|
||||||
region3 = scene3.RegionInfo.RegionHandle;
|
region3 = scene3.RegionInfo.RegionHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Test adding a root agent to a scene. Doesn't yet actually complete crossing the agent into the scene.
|
|
||||||
/// </summary>
|
|
||||||
[Test]
|
[Test]
|
||||||
public void T010_TestAddRootAgent()
|
public void TestCloseAgent()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
string firstName = "testfirstname";
|
TestScene scene = SceneHelpers.SetupScene();
|
||||||
|
ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));
|
||||||
|
|
||||||
AgentCircuitData agent = new AgentCircuitData();
|
Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Not.Null);
|
||||||
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);
|
scene.IncomingCloseAgent(sp.UUID);
|
||||||
|
|
||||||
string reason;
|
Assert.That(scene.GetScenePresence(sp.UUID), Is.Null);
|
||||||
scene.NewUserConnection(agent, (uint)TeleportFlags.ViaLogin, out reason);
|
Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Null);
|
||||||
testclient = new TestClient(agent, scene);
|
|
||||||
scene.AddNewClient(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>
|
/// <summary>
|
||||||
/// Test removing an uncrossed root agent from a scene.
|
/// Test that if a root agent logs into a region, a child agent is also established in the neighbouring region
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Please note that unlike the other tests here, this doesn't rely on structures
|
||||||
|
/// </remarks>
|
||||||
[Test]
|
[Test]
|
||||||
public void T011_TestRemoveRootAgent()
|
public void TestChildAgentEstablished()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
IConfigSource configSource = new IniConfigSource();
|
||||||
|
configSource.AddConfig("Modules").Set("EntityTransferModule", "BasicEntityTransferModule");
|
||||||
|
EntityTransferModule etm = new EntityTransferModule();
|
||||||
|
|
||||||
|
SceneHelpers.SetupSceneModules(myScene1, configSource, etm);
|
||||||
|
|
||||||
|
SceneHelpers.AddScenePresence(myScene1, agent1Id);
|
||||||
|
// ScenePresence childPresence = myScene2.GetScenePresence(agent1);
|
||||||
|
|
||||||
scene.RemoveClient(agent1);
|
// TODO: Need to do a fair amount of work to allow synchronous establishment of child agents
|
||||||
|
// Assert.That(childPresence, Is.Not.Null);
|
||||||
ScenePresence presence = scene.GetScenePresence(agent1);
|
// Assert.That(childPresence.IsChildAgent, Is.True);
|
||||||
|
|
||||||
Assert.That(presence, Is.Null, "presence is not null");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// /// <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.AddNewClient(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");
|
||||||
|
// }
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void T012_TestAddNeighbourRegion()
|
public void T012_TestAddNeighbourRegion()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
string reason;
|
string reason;
|
||||||
|
|
||||||
|
@ -157,7 +207,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
scene.NewUserConnection(acd1, 0, out reason);
|
scene.NewUserConnection(acd1, 0, out reason);
|
||||||
if (testclient == null)
|
if (testclient == null)
|
||||||
testclient = new TestClient(acd1, scene);
|
testclient = new TestClient(acd1, scene);
|
||||||
scene.AddNewClient(testclient);
|
scene.AddNewClient(testclient, PresenceType.User);
|
||||||
|
|
||||||
ScenePresence presence = scene.GetScenePresence(agent1);
|
ScenePresence presence = scene.GetScenePresence(agent1);
|
||||||
presence.MakeRootAgent(new Vector3(90,90,90),false);
|
presence.MakeRootAgent(new Vector3(90,90,90),false);
|
||||||
|
@ -175,7 +225,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void T013_TestRemoveNeighbourRegion()
|
public void T013_TestRemoveNeighbourRegion()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
ScenePresence presence = scene.GetScenePresence(agent1);
|
ScenePresence presence = scene.GetScenePresence(agent1);
|
||||||
presence.RemoveNeighbourRegion(region3);
|
presence.RemoveNeighbourRegion(region3);
|
||||||
|
@ -188,37 +238,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
CompleteAvatarMovement
|
CompleteAvatarMovement
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Test that if a root agent logs into a region, a child agent is also established in the neighbouring region
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Please note that unlike the other tests here, this doesn't rely on structures
|
|
||||||
/// </remarks>
|
|
||||||
[Test]
|
|
||||||
public void TestChildAgentEstablished()
|
|
||||||
{
|
|
||||||
TestHelper.InMethod();
|
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
|
||||||
|
|
||||||
UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001");
|
|
||||||
|
|
||||||
TestScene myScene1 = SceneSetupHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000);
|
|
||||||
TestScene myScene2 = SceneSetupHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000);
|
|
||||||
|
|
||||||
IConfigSource configSource = new IniConfigSource();
|
|
||||||
configSource.AddConfig("Modules").Set("EntityTransferModule", "BasicEntityTransferModule");
|
|
||||||
EntityTransferModule etm = new EntityTransferModule();
|
|
||||||
|
|
||||||
SceneSetupHelpers.SetupSceneModules(myScene1, configSource, etm);
|
|
||||||
|
|
||||||
SceneSetupHelpers.AddClient(myScene1, agent1Id);
|
|
||||||
ScenePresence childPresence = myScene2.GetScenePresence(agent1);
|
|
||||||
|
|
||||||
// TODO: Need to do a fair amount of work to allow synchronous establishment of child agents
|
|
||||||
// Assert.That(childPresence, Is.Not.Null);
|
|
||||||
// Assert.That(childPresence.IsChildAgent, Is.True);
|
|
||||||
}
|
|
||||||
|
|
||||||
// I'm commenting this test because it does not represent
|
// I'm commenting this test because it does not represent
|
||||||
// crossings. The Thread.Sleep's in here are not meaningful mocks,
|
// crossings. The Thread.Sleep's in here are not meaningful mocks,
|
||||||
|
@ -230,7 +249,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
//[Test]
|
//[Test]
|
||||||
public void T021_TestCrossToNewRegion()
|
public void T021_TestCrossToNewRegion()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
scene.RegisterRegionWithGrid();
|
scene.RegisterRegionWithGrid();
|
||||||
scene2.RegisterRegionWithGrid();
|
scene2.RegisterRegionWithGrid();
|
||||||
|
@ -238,7 +257,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
// Adding child agent to region 1001
|
// Adding child agent to region 1001
|
||||||
string reason;
|
string reason;
|
||||||
scene2.NewUserConnection(acd1,0, out reason);
|
scene2.NewUserConnection(acd1,0, out reason);
|
||||||
scene2.AddNewClient(testclient);
|
scene2.AddNewClient(testclient, PresenceType.User);
|
||||||
|
|
||||||
ScenePresence presence = scene.GetScenePresence(agent1);
|
ScenePresence presence = scene.GetScenePresence(agent1);
|
||||||
presence.MakeRootAgent(new Vector3(0,unchecked(Constants.RegionSize-1),0), true);
|
presence.MakeRootAgent(new Vector3(0,unchecked(Constants.RegionSize-1),0), true);
|
||||||
|
@ -349,37 +368,5 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
capsPath = capsPath.Remove(capsPath.Length - 4, 4);
|
capsPath = capsPath.Remove(capsPath.Length - 4, 4);
|
||||||
return capsPath;
|
return capsPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
private SceneObjectGroup NewSOG(UUID uuid, Scene scene, UUID agent)
|
|
||||||
{
|
|
||||||
SceneObjectPart sop = new SceneObjectPart();
|
|
||||||
sop.Name = RandomName();
|
|
||||||
sop.Description = RandomName();
|
|
||||||
sop.Text = RandomName();
|
|
||||||
sop.SitName = RandomName();
|
|
||||||
sop.TouchName = RandomName();
|
|
||||||
sop.UUID = uuid;
|
|
||||||
sop.Shape = PrimitiveBaseShape.Default;
|
|
||||||
sop.Shape.State = 1;
|
|
||||||
sop.OwnerID = agent;
|
|
||||||
|
|
||||||
SceneObjectGroup sog = new SceneObjectGroup(sop);
|
|
||||||
sog.SetScene(scene);
|
|
||||||
|
|
||||||
return sog;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string RandomName()
|
|
||||||
{
|
|
||||||
StringBuilder name = new StringBuilder();
|
|
||||||
int size = random.Next(5,12);
|
|
||||||
char ch ;
|
|
||||||
for (int i=0; i<size; i++)
|
|
||||||
{
|
|
||||||
ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))) ;
|
|
||||||
name.Append(ch);
|
|
||||||
}
|
|
||||||
return name.ToString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -44,7 +44,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
/// Teleport tests in a standalone OpenSim
|
/// Teleport tests in a standalone OpenSim
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class StandaloneTeleportTests
|
public class ScenePresenceTeleportTests
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Test a teleport between two regions that are not neighbours and do not share any neighbours in common.
|
/// Test a teleport between two regions that are not neighbours and do not share any neighbours in common.
|
||||||
|
@ -54,7 +54,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
//[Test, LongRunning]
|
//[Test, LongRunning]
|
||||||
public void TestSimpleNotNeighboursTeleport()
|
public void TestSimpleNotNeighboursTeleport()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
ThreadRunResults results = new ThreadRunResults();
|
ThreadRunResults results = new ThreadRunResults();
|
||||||
results.Result = false;
|
results.Result = false;
|
||||||
results.Message = "Test did not run";
|
results.Message = "Test did not run";
|
||||||
|
@ -116,16 +116,16 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
ISharedRegionModule interregionComms = new LocalSimulationConnectorModule();
|
ISharedRegionModule interregionComms = new LocalSimulationConnectorModule();
|
||||||
|
|
||||||
|
|
||||||
Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010);
|
Scene sceneB = SceneHelpers.SetupScene("sceneB", sceneBId, 1010, 1010);
|
||||||
SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms);
|
SceneHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms);
|
||||||
sceneB.RegisterRegionWithGrid();
|
sceneB.RegisterRegionWithGrid();
|
||||||
|
|
||||||
Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000);
|
Scene sceneA = SceneHelpers.SetupScene("sceneA", sceneAId, 1000, 1000);
|
||||||
SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms);
|
SceneHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms);
|
||||||
sceneA.RegisterRegionWithGrid();
|
sceneA.RegisterRegionWithGrid();
|
||||||
|
|
||||||
UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041");
|
UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041");
|
||||||
TestClient client = SceneSetupHelpers.AddClient(sceneA, agentId);
|
TestClient client = (TestClient)SceneHelpers.AddScenePresence(sceneA, agentId).ControllingClient;
|
||||||
|
|
||||||
ICapabilitiesModule sceneACapsModule = sceneA.RequestModuleInterface<ICapabilitiesModule>();
|
ICapabilitiesModule sceneACapsModule = sceneA.RequestModuleInterface<ICapabilitiesModule>();
|
||||||
|
|
|
@ -58,9 +58,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestUpdateScene()
|
public void TestUpdateScene()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
scene.Update();
|
scene.Update();
|
||||||
|
|
||||||
Assert.That(scene.Frame, Is.EqualTo(1));
|
Assert.That(scene.Frame, Is.EqualTo(1));
|
||||||
|
|
|
@ -55,12 +55,12 @@ namespace OpenSim.Region.Framework.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestRezObjectFromInventoryItem()
|
public void TestRezObjectFromInventoryItem()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
|
UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
|
||||||
SceneObjectGroup sog1 = SceneSetupHelpers.CreateSceneObject(1, user1.PrincipalID);
|
SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID);
|
||||||
SceneObjectPart sop1 = sog1.RootPart;
|
SceneObjectPart sop1 = sog1.RootPart;
|
||||||
|
|
||||||
// Create an object embedded inside the first
|
// Create an object embedded inside the first
|
||||||
|
@ -98,12 +98,12 @@ namespace OpenSim.Region.Framework.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestMoveTaskInventoryItem()
|
public void TestMoveTaskInventoryItem()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
|
UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
|
||||||
SceneObjectGroup sog1 = SceneSetupHelpers.CreateSceneObject(1, user1.PrincipalID);
|
SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID);
|
||||||
SceneObjectPart sop1 = sog1.RootPart;
|
SceneObjectPart sop1 = sog1.RootPart;
|
||||||
TaskInventoryItem sopItem1 = TaskInventoryHelpers.AddNotecard(scene, sop1);
|
TaskInventoryItem sopItem1 = TaskInventoryHelpers.AddNotecard(scene, sop1);
|
||||||
|
|
||||||
|
@ -125,12 +125,12 @@ namespace OpenSim.Region.Framework.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestMoveTaskInventoryItemNoParent()
|
public void TestMoveTaskInventoryItemNoParent()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
|
UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
|
||||||
SceneObjectGroup sog1 = SceneSetupHelpers.CreateSceneObject(1, user1.PrincipalID);
|
SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID);
|
||||||
SceneObjectPart sop1 = sog1.RootPart;
|
SceneObjectPart sop1 = sog1.RootPart;
|
||||||
TaskInventoryItem sopItem1 = TaskInventoryHelpers.AddNotecard(scene, sop1);
|
TaskInventoryItem sopItem1 = TaskInventoryHelpers.AddNotecard(scene, sop1);
|
||||||
|
|
||||||
|
|
|
@ -55,12 +55,12 @@ namespace OpenSim.Region.Framework.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestGiveInventoryItem()
|
public void TestGiveInventoryItem()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, 1001);
|
UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001));
|
||||||
UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene, 1002);
|
UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1002));
|
||||||
InventoryItemBase item1 = UserInventoryHelpers.CreateInventoryItem(scene, "item1", user1.PrincipalID);
|
InventoryItemBase item1 = UserInventoryHelpers.CreateInventoryItem(scene, "item1", user1.PrincipalID);
|
||||||
|
|
||||||
scene.GiveInventoryItem(user2.PrincipalID, user1.PrincipalID, item1.ID);
|
scene.GiveInventoryItem(user2.PrincipalID, user1.PrincipalID, item1.ID);
|
||||||
|
@ -82,12 +82,12 @@ namespace OpenSim.Region.Framework.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestGiveInventoryFolder()
|
public void TestGiveInventoryFolder()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, 1001);
|
UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1001));
|
||||||
UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene, 1002);
|
UserAccount user2 = UserAccountHelpers.CreateUserWithInventory(scene, TestHelpers.ParseTail(1002));
|
||||||
InventoryFolderBase folder1
|
InventoryFolderBase folder1
|
||||||
= UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, user1.PrincipalID, "folder1");
|
= UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, user1.PrincipalID, "folder1");
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
// FIXME: We don't need a full scene here - it would be enough to set up the asset service.
|
// FIXME: We don't need a full scene here - it would be enough to set up the asset service.
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
m_assetService = scene.AssetService;
|
m_assetService = scene.AssetService;
|
||||||
m_uuidGatherer = new UuidGatherer(m_assetService);
|
m_uuidGatherer = new UuidGatherer(m_assetService);
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestCorruptAsset()
|
public void TestCorruptAsset()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
UUID corruptAssetUuid = UUID.Parse("00000000-0000-0000-0000-000000000666");
|
UUID corruptAssetUuid = UUID.Parse("00000000-0000-0000-0000-000000000666");
|
||||||
AssetBase corruptAsset
|
AssetBase corruptAsset
|
||||||
|
@ -75,7 +75,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestMissingAsset()
|
public void TestMissingAsset()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
|
|
||||||
UUID missingAssetUuid = UUID.Parse("00000000-0000-0000-0000-000000000666");
|
UUID missingAssetUuid = UUID.Parse("00000000-0000-0000-0000-000000000666");
|
||||||
IDictionary<UUID, AssetType> foundAssetUuids = new Dictionary<UUID, AssetType>();
|
IDictionary<UUID, AssetType> foundAssetUuids = new Dictionary<UUID, AssetType>();
|
||||||
|
|
|
@ -677,7 +677,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
|
||||||
public event DeRezObject OnDeRezObject;
|
public event DeRezObject OnDeRezObject;
|
||||||
public event Action<IClientAPI> OnRegionHandShakeReply;
|
public event Action<IClientAPI> OnRegionHandShakeReply;
|
||||||
public event GenericCall1 OnRequestWearables;
|
public event GenericCall1 OnRequestWearables;
|
||||||
public event GenericCall1 OnCompleteMovementToRegion;
|
public event Action<IClientAPI, bool> OnCompleteMovementToRegion;
|
||||||
public event UpdateAgent OnPreAgentUpdate;
|
public event UpdateAgent OnPreAgentUpdate;
|
||||||
public event UpdateAgent OnAgentUpdate;
|
public event UpdateAgent OnAgentUpdate;
|
||||||
public event AgentRequestSit OnAgentRequestSit;
|
public event AgentRequestSit OnAgentRequestSit;
|
||||||
|
@ -806,7 +806,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
|
||||||
public event ScriptReset OnScriptReset;
|
public event ScriptReset OnScriptReset;
|
||||||
public event GetScriptRunning OnGetScriptRunning;
|
public event GetScriptRunning OnGetScriptRunning;
|
||||||
public event SetScriptRunning OnSetScriptRunning;
|
public event SetScriptRunning OnSetScriptRunning;
|
||||||
public event Action<Vector3> OnAutoPilotGo;
|
public event Action<Vector3, bool> OnAutoPilotGo;
|
||||||
public event TerrainUnacked OnUnackedTerrain;
|
public event TerrainUnacked OnUnackedTerrain;
|
||||||
public event ActivateGesture OnActivateGesture;
|
public event ActivateGesture OnActivateGesture;
|
||||||
public event DeactivateGesture OnDeactivateGesture;
|
public event DeactivateGesture OnDeactivateGesture;
|
||||||
|
@ -893,7 +893,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
|
||||||
|
|
||||||
public void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
Scene.AddNewClient(this);
|
Scene.AddNewClient(this, PresenceType.User);
|
||||||
|
|
||||||
// Mimicking LLClientView which gets always set appearance from client.
|
// Mimicking LLClientView which gets always set appearance from client.
|
||||||
Scene scene = (Scene)Scene;
|
Scene scene = (Scene)Scene;
|
||||||
|
@ -913,7 +913,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
|
||||||
|
|
||||||
if (OnCompleteMovementToRegion != null)
|
if (OnCompleteMovementToRegion != null)
|
||||||
{
|
{
|
||||||
OnCompleteMovementToRegion(this);
|
OnCompleteMovementToRegion(this, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,16 +47,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestBasic()
|
public void TestBasic()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
TestScene scene = SceneSetupHelpers.SetupScene();
|
TestScene scene = SceneHelpers.SetupScene();
|
||||||
IConfigSource configSource = new IniConfigSource();
|
IConfigSource configSource = new IniConfigSource();
|
||||||
IConfig config = configSource.AddConfig("Groups");
|
IConfig config = configSource.AddConfig("Groups");
|
||||||
config.Set("Enabled", true);
|
config.Set("Enabled", true);
|
||||||
config.Set("Module", "GroupsModule");
|
config.Set("Module", "GroupsModule");
|
||||||
config.Set("DebugEnabled", true);
|
config.Set("DebugEnabled", true);
|
||||||
SceneSetupHelpers.SetupSceneModules(
|
SceneHelpers.SetupSceneModules(
|
||||||
scene, configSource, new object[] { new MockGroupsServicesConnector() });
|
scene, configSource, new object[] { new MockGroupsServicesConnector() });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,6 +126,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
||||||
m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue;
|
m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue;
|
||||||
m_scene.EventManager.OnOarFileLoaded -= OnOarFileLoaded;
|
m_scene.EventManager.OnOarFileLoaded -= OnOarFileLoaded;
|
||||||
|
|
||||||
|
if(m_uri != string.Empty)
|
||||||
|
{
|
||||||
|
RRAlert("shutdown");
|
||||||
|
}
|
||||||
|
|
||||||
m_scene = null;
|
m_scene = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||||
{
|
{
|
||||||
public class NPCAvatar : IClientAPI
|
public class NPCAvatar : IClientAPI
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Signal whether the avatar should land when it reaches a move target
|
||||||
|
/// </summary>
|
||||||
|
public bool LandAtTarget { get; set; }
|
||||||
|
|
||||||
private readonly string m_firstname;
|
private readonly string m_firstname;
|
||||||
private readonly string m_lastname;
|
private readonly string m_lastname;
|
||||||
private readonly Vector3 m_startPos;
|
private readonly Vector3 m_startPos;
|
||||||
|
@ -190,7 +195,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||||
public event DeRezObject OnDeRezObject;
|
public event DeRezObject OnDeRezObject;
|
||||||
public event Action<IClientAPI> OnRegionHandShakeReply;
|
public event Action<IClientAPI> OnRegionHandShakeReply;
|
||||||
public event GenericCall1 OnRequestWearables;
|
public event GenericCall1 OnRequestWearables;
|
||||||
public event GenericCall1 OnCompleteMovementToRegion;
|
public event Action<IClientAPI, bool> OnCompleteMovementToRegion;
|
||||||
public event UpdateAgent OnPreAgentUpdate;
|
public event UpdateAgent OnPreAgentUpdate;
|
||||||
public event UpdateAgent OnAgentUpdate;
|
public event UpdateAgent OnAgentUpdate;
|
||||||
public event AgentRequestSit OnAgentRequestSit;
|
public event AgentRequestSit OnAgentRequestSit;
|
||||||
|
@ -328,7 +333,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||||
public event ScriptReset OnScriptReset;
|
public event ScriptReset OnScriptReset;
|
||||||
public event GetScriptRunning OnGetScriptRunning;
|
public event GetScriptRunning OnGetScriptRunning;
|
||||||
public event SetScriptRunning OnSetScriptRunning;
|
public event SetScriptRunning OnSetScriptRunning;
|
||||||
public event Action<Vector3> OnAutoPilotGo;
|
public event Action<Vector3, bool> OnAutoPilotGo;
|
||||||
|
|
||||||
public event TerrainUnacked OnUnackedTerrain;
|
public event TerrainUnacked OnUnackedTerrain;
|
||||||
|
|
||||||
|
@ -745,12 +750,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||||
{
|
{
|
||||||
OnRegionHandShakeReply(this);
|
OnRegionHandShakeReply(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OnCompleteMovementToRegion != null)
|
|
||||||
{
|
|
||||||
OnCompleteMovementToRegion(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID)
|
public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -841,6 +842,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||||
|
|
||||||
public void Close()
|
public void Close()
|
||||||
{
|
{
|
||||||
|
// Remove ourselves from the scene
|
||||||
|
m_scene.RemoveClient(AgentId, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Start()
|
public void Start()
|
||||||
|
|
|
@ -45,7 +45,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private Dictionary<UUID, NPCAvatar> m_avatars = new Dictionary<UUID, NPCAvatar>();
|
private Dictionary<UUID, NPCAvatar> m_avatars = new Dictionary<UUID, NPCAvatar>();
|
||||||
private Dictionary<UUID, AvatarAppearance> m_appearanceCache = new Dictionary<UUID, AvatarAppearance>();
|
|
||||||
|
|
||||||
public void Initialise(Scene scene, IConfigSource source)
|
public void Initialise(Scene scene, IConfigSource source)
|
||||||
{
|
{
|
||||||
|
@ -75,35 +74,44 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||||
// We are close enough to the target
|
// We are close enough to the target
|
||||||
m_log.DebugFormat("[NPC MODULE]: Stopping movement of npc {0}", presence.Name);
|
m_log.DebugFormat("[NPC MODULE]: Stopping movement of npc {0}", presence.Name);
|
||||||
|
|
||||||
if (presence.PhysicsActor.Flying)
|
|
||||||
{
|
|
||||||
Vector3 targetPos = presence.MoveToPositionTarget;
|
|
||||||
float terrainHeight = (float)presence.Scene.Heightmap[(int)targetPos.X, (int)targetPos.Y];
|
|
||||||
if (targetPos.Z - terrainHeight < 0.2)
|
|
||||||
{
|
|
||||||
presence.PhysicsActor.Flying = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
presence.Velocity = Vector3.Zero;
|
presence.Velocity = Vector3.Zero;
|
||||||
presence.AbsolutePosition = presence.MoveToPositionTarget;
|
presence.AbsolutePosition = presence.MoveToPositionTarget;
|
||||||
presence.ResetMoveToTarget();
|
presence.ResetMoveToTarget();
|
||||||
|
|
||||||
// FIXME: This doesn't work
|
|
||||||
if (presence.PhysicsActor.Flying)
|
if (presence.PhysicsActor.Flying)
|
||||||
presence.Animator.TrySetMovementAnimation("HOVER");
|
{
|
||||||
else
|
// A horrible hack to stop the NPC dead in its tracks rather than having them overshoot
|
||||||
presence.Animator.TrySetMovementAnimation("STAND");
|
// the target if flying.
|
||||||
|
// We really need to be more subtle (slow the avatar as it approaches the target) or at
|
||||||
|
// least be able to set collision status once, rather than 5 times to give it enough
|
||||||
|
// weighting so that that PhysicsActor thinks it really is colliding.
|
||||||
|
for (int i = 0; i < 5; i++)
|
||||||
|
presence.PhysicsActor.IsColliding = true;
|
||||||
|
|
||||||
|
// Vector3 targetPos = presence.MoveToPositionTarget;
|
||||||
|
if (m_avatars[presence.UUID].LandAtTarget)
|
||||||
|
presence.PhysicsActor.Flying = false;
|
||||||
|
|
||||||
|
// float terrainHeight = (float)presence.Scene.Heightmap[(int)targetPos.X, (int)targetPos.Y];
|
||||||
|
// if (targetPos.Z - terrainHeight < 0.2)
|
||||||
|
// {
|
||||||
|
// presence.PhysicsActor.Flying = false;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
// m_log.DebugFormat(
|
||||||
|
// "[NPC MODULE]: AgentControlFlags {0}, MovementFlag {1} for {2}",
|
||||||
|
// presence.AgentControlFlags, presence.MovementFlag, presence.Name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
"[NPC MODULE]: Updating npc {0} at {1} for next movement to {2}",
|
// "[NPC MODULE]: Updating npc {0} at {1} for next movement to {2}",
|
||||||
presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget);
|
// presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget);
|
||||||
|
|
||||||
Vector3 agent_control_v3 = new Vector3();
|
Vector3 agent_control_v3 = new Vector3();
|
||||||
presence.HandleMoveToTargetUpdate(ref agent_control_v3, presence.Rotation);
|
presence.HandleMoveToTargetUpdate(ref agent_control_v3);
|
||||||
presence.AddNewMovement(agent_control_v3, presence.Rotation);
|
presence.AddNewMovement(agent_control_v3);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
//// presence.DoMoveToPositionUpdate((0, presence.MoveToPositionTarget, null);
|
//// presence.DoMoveToPositionUpdate((0, presence.MoveToPositionTarget, null);
|
||||||
|
@ -115,29 +123,48 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private AvatarAppearance GetAppearance(UUID target, Scene scene)
|
public bool IsNPC(UUID agentId, Scene scene)
|
||||||
{
|
{
|
||||||
if (m_appearanceCache.ContainsKey(target))
|
ScenePresence sp = scene.GetScenePresence(agentId);
|
||||||
return m_appearanceCache[target];
|
if (sp == null || sp.IsChildAgent)
|
||||||
|
return false;
|
||||||
|
|
||||||
ScenePresence originalPresence = scene.GetScenePresence(target);
|
lock (m_avatars)
|
||||||
|
return m_avatars.ContainsKey(agentId);
|
||||||
if (originalPresence != null)
|
|
||||||
{
|
|
||||||
AvatarAppearance originalAppearance = originalPresence.Appearance;
|
|
||||||
m_appearanceCache.Add(target, originalAppearance);
|
|
||||||
return originalAppearance;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_log.DebugFormat(
|
|
||||||
"[NPC MODULE]: Avatar {0} is not in the scene for us to grab baked textures from them. Using defaults.", target);
|
|
||||||
|
|
||||||
return new AvatarAppearance();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUID CreateNPC(string firstname, string lastname, Vector3 position, Scene scene, UUID cloneAppearanceFrom)
|
public bool SetNPCAppearance(UUID agentId, AvatarAppearance appearance, Scene scene)
|
||||||
|
{
|
||||||
|
ScenePresence sp = scene.GetScenePresence(agentId);
|
||||||
|
if (sp == null || sp.IsChildAgent)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
lock (m_avatars)
|
||||||
|
if (!m_avatars.ContainsKey(agentId))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// FIXME: An extremely bad bit of code that reaches directly into the attachments list and manipulates it
|
||||||
|
List<SceneObjectGroup> attachments = sp.Attachments;
|
||||||
|
lock (attachments)
|
||||||
|
{
|
||||||
|
foreach (SceneObjectGroup att in attachments)
|
||||||
|
scene.DeleteSceneObject(att, false);
|
||||||
|
|
||||||
|
attachments.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
AvatarAppearance npcAppearance = new AvatarAppearance(appearance, true);
|
||||||
|
sp.Appearance = npcAppearance;
|
||||||
|
sp.RezAttachments();
|
||||||
|
|
||||||
|
IAvatarFactory module = scene.RequestModuleInterface<IAvatarFactory>();
|
||||||
|
module.SendAppearance(sp.UUID);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UUID CreateNPC(
|
||||||
|
string firstname, string lastname, Vector3 position, Scene scene, AvatarAppearance appearance)
|
||||||
{
|
{
|
||||||
NPCAvatar npcAvatar = new NPCAvatar(firstname, lastname, position, scene);
|
NPCAvatar npcAvatar = new NPCAvatar(firstname, lastname, position, scene);
|
||||||
npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, int.MaxValue);
|
npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, int.MaxValue);
|
||||||
|
@ -152,8 +179,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||||
acd.lastname = lastname;
|
acd.lastname = lastname;
|
||||||
acd.ServiceURLs = new Dictionary<string, object>();
|
acd.ServiceURLs = new Dictionary<string, object>();
|
||||||
|
|
||||||
AvatarAppearance originalAppearance = GetAppearance(cloneAppearanceFrom, scene);
|
AvatarAppearance npcAppearance = new AvatarAppearance(appearance, true);
|
||||||
AvatarAppearance npcAppearance = new AvatarAppearance(originalAppearance, true);
|
|
||||||
acd.Appearance = npcAppearance;
|
acd.Appearance = npcAppearance;
|
||||||
|
|
||||||
// for (int i = 0; i < acd.Appearance.Texture.FaceTextures.Length; i++)
|
// for (int i = 0; i < acd.Appearance.Texture.FaceTextures.Length; i++)
|
||||||
|
@ -164,7 +190,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||||
// }
|
// }
|
||||||
|
|
||||||
scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode, acd);
|
scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode, acd);
|
||||||
scene.AddNewClient(npcAvatar);
|
scene.AddNewClient(npcAvatar, PresenceType.Npc);
|
||||||
|
|
||||||
ScenePresence sp;
|
ScenePresence sp;
|
||||||
if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp))
|
if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp))
|
||||||
|
@ -172,13 +198,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[NPC MODULE]: Successfully retrieved scene presence for NPC {0} {1}", sp.Name, sp.UUID);
|
"[NPC MODULE]: Successfully retrieved scene presence for NPC {0} {1}", sp.Name, sp.UUID);
|
||||||
|
|
||||||
// Shouldn't call this - temporary.
|
sp.CompleteMovement(npcAvatar, false);
|
||||||
sp.CompleteMovement(npcAvatar);
|
|
||||||
|
|
||||||
// sp.SendAppearanceToAllOtherAgents();
|
|
||||||
//
|
|
||||||
// // Send animations back to the avatar as well
|
|
||||||
// sp.Animator.SendAnimPack();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -193,7 +213,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||||
return npcAvatar.AgentId;
|
return npcAvatar.AgentId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MoveToTarget(UUID agentID, Scene scene, Vector3 pos)
|
public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget)
|
||||||
{
|
{
|
||||||
lock (m_avatars)
|
lock (m_avatars)
|
||||||
{
|
{
|
||||||
|
@ -203,34 +223,70 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||||
scene.TryGetScenePresence(agentID, out sp);
|
scene.TryGetScenePresence(agentID, out sp);
|
||||||
|
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[NPC MODULE]: Moving {0} to {1} in {2}", sp.Name, pos, scene.RegionInfo.RegionName);
|
"[NPC MODULE]: Moving {0} to {1} in {2}, noFly {3}, landAtTarget {4}",
|
||||||
|
sp.Name, pos, scene.RegionInfo.RegionName, noFly, landAtTarget);
|
||||||
|
|
||||||
sp.MoveToTarget(pos);
|
m_avatars[agentID].LandAtTarget = landAtTarget;
|
||||||
|
sp.MoveToTarget(pos, noFly);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Say(UUID agentID, Scene scene, string text)
|
public bool StopMoveToTarget(UUID agentID, Scene scene)
|
||||||
{
|
{
|
||||||
lock (m_avatars)
|
lock (m_avatars)
|
||||||
{
|
{
|
||||||
if (m_avatars.ContainsKey(agentID))
|
if (m_avatars.ContainsKey(agentID))
|
||||||
{
|
{
|
||||||
|
ScenePresence sp;
|
||||||
|
scene.TryGetScenePresence(agentID, out sp);
|
||||||
|
|
||||||
|
sp.Velocity = Vector3.Zero;
|
||||||
|
sp.ResetMoveToTarget();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Say(UUID agentID, Scene scene, string text)
|
||||||
|
{
|
||||||
|
lock (m_avatars)
|
||||||
|
{
|
||||||
|
if (m_avatars.ContainsKey(agentID))
|
||||||
|
{
|
||||||
|
ScenePresence sp;
|
||||||
|
scene.TryGetScenePresence(agentID, out sp);
|
||||||
|
|
||||||
m_avatars[agentID].Say(text);
|
m_avatars[agentID].Say(text);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DeleteNPC(UUID agentID, Scene scene)
|
public bool DeleteNPC(UUID agentID, Scene scene)
|
||||||
{
|
{
|
||||||
lock (m_avatars)
|
lock (m_avatars)
|
||||||
{
|
{
|
||||||
if (m_avatars.ContainsKey(agentID))
|
if (m_avatars.ContainsKey(agentID))
|
||||||
{
|
{
|
||||||
scene.RemoveClient(agentID);
|
scene.RemoveClient(agentID, false);
|
||||||
m_avatars.Remove(agentID);
|
m_avatars.Remove(agentID);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PostInitialise()
|
public void PostInitialise()
|
||||||
|
|
|
@ -34,6 +34,7 @@ using OpenMetaverse;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using OpenSim.Framework.Communications;
|
using OpenSim.Framework.Communications;
|
||||||
using OpenSim.Region.CoreModules.Avatar.AvatarFactory;
|
using OpenSim.Region.CoreModules.Avatar.AvatarFactory;
|
||||||
|
using OpenSim.Region.CoreModules.Framework.UserManagement;
|
||||||
using OpenSim.Region.CoreModules.ServiceConnectorsOut.Avatar;
|
using OpenSim.Region.CoreModules.ServiceConnectorsOut.Avatar;
|
||||||
using OpenSim.Region.Framework.Interfaces;
|
using OpenSim.Region.Framework.Interfaces;
|
||||||
using OpenSim.Region.Framework.Scenes;
|
using OpenSim.Region.Framework.Scenes;
|
||||||
|
@ -49,7 +50,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestCreate()
|
public void TestCreate()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
IConfigSource config = new IniConfigSource();
|
IConfigSource config = new IniConfigSource();
|
||||||
|
@ -57,13 +58,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
|
||||||
config.Configs["NPC"].Set("Enabled", "true");
|
config.Configs["NPC"].Set("Enabled", "true");
|
||||||
|
|
||||||
AvatarFactoryModule afm = new AvatarFactoryModule();
|
AvatarFactoryModule afm = new AvatarFactoryModule();
|
||||||
TestScene scene = SceneSetupHelpers.SetupScene();
|
UserManagementModule umm = new UserManagementModule();
|
||||||
SceneSetupHelpers.SetupSceneModules(scene, config, afm, new NPCModule());
|
|
||||||
TestClient originalClient = SceneSetupHelpers.AddClient(scene, TestHelper.ParseTail(0x1));
|
TestScene scene = SceneHelpers.SetupScene();
|
||||||
|
SceneHelpers.SetupSceneModules(scene, config, afm, umm, new NPCModule());
|
||||||
|
ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));
|
||||||
// ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId);
|
// ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId);
|
||||||
|
|
||||||
// 8 is the index of the first baked texture in AvatarAppearance
|
// 8 is the index of the first baked texture in AvatarAppearance
|
||||||
UUID originalFace8TextureId = TestHelper.ParseTail(0x10);
|
UUID originalFace8TextureId = TestHelpers.ParseTail(0x10);
|
||||||
Primitive.TextureEntry originalTe = new Primitive.TextureEntry(UUID.Zero);
|
Primitive.TextureEntry originalTe = new Primitive.TextureEntry(UUID.Zero);
|
||||||
Primitive.TextureEntryFace originalTef = originalTe.CreateFace(8);
|
Primitive.TextureEntryFace originalTef = originalTe.CreateFace(8);
|
||||||
originalTef.TextureID = originalFace8TextureId;
|
originalTef.TextureID = originalFace8TextureId;
|
||||||
|
@ -72,21 +75,22 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
|
||||||
// ScenePresence.SendInitialData() to reset our entire appearance.
|
// ScenePresence.SendInitialData() to reset our entire appearance.
|
||||||
scene.AssetService.Store(AssetHelpers.CreateAsset(originalFace8TextureId));
|
scene.AssetService.Store(AssetHelpers.CreateAsset(originalFace8TextureId));
|
||||||
|
|
||||||
afm.SetAppearance(originalClient, originalTe, null);
|
afm.SetAppearanceFromClient(sp.ControllingClient, originalTe, null);
|
||||||
|
|
||||||
INPCModule npcModule = scene.RequestModuleInterface<INPCModule>();
|
INPCModule npcModule = scene.RequestModuleInterface<INPCModule>();
|
||||||
UUID npcId = npcModule.CreateNPC("John", "Smith", new Vector3(128, 128, 30), scene, originalClient.AgentId);
|
UUID npcId = npcModule.CreateNPC("John", "Smith", new Vector3(128, 128, 30), scene, sp.Appearance);
|
||||||
|
|
||||||
ScenePresence npc = scene.GetScenePresence(npcId);
|
ScenePresence npc = scene.GetScenePresence(npcId);
|
||||||
|
|
||||||
Assert.That(npc, Is.Not.Null);
|
Assert.That(npc, Is.Not.Null);
|
||||||
Assert.That(npc.Appearance.Texture.FaceTextures[8].TextureID, Is.EqualTo(originalFace8TextureId));
|
Assert.That(npc.Appearance.Texture.FaceTextures[8].TextureID, Is.EqualTo(originalFace8TextureId));
|
||||||
|
Assert.That(umm.GetUserName(npc.UUID), Is.EqualTo(string.Format("{0} {1}", npc.Firstname, npc.Lastname)));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestMove()
|
public void TestMove()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
IConfigSource config = new IniConfigSource();
|
IConfigSource config = new IniConfigSource();
|
||||||
|
@ -94,14 +98,14 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
|
||||||
config.AddConfig("NPC");
|
config.AddConfig("NPC");
|
||||||
config.Configs["NPC"].Set("Enabled", "true");
|
config.Configs["NPC"].Set("Enabled", "true");
|
||||||
|
|
||||||
TestScene scene = SceneSetupHelpers.SetupScene();
|
TestScene scene = SceneHelpers.SetupScene();
|
||||||
SceneSetupHelpers.SetupSceneModules(scene, config, new NPCModule());
|
SceneHelpers.SetupSceneModules(scene, config, new NPCModule());
|
||||||
TestClient originalClient = SceneSetupHelpers.AddClient(scene, TestHelper.ParseTail(0x1));
|
ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));
|
||||||
// ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId);
|
// ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId);
|
||||||
|
|
||||||
Vector3 startPos = new Vector3(128, 128, 30);
|
Vector3 startPos = new Vector3(128, 128, 30);
|
||||||
INPCModule npcModule = scene.RequestModuleInterface<INPCModule>();
|
INPCModule npcModule = scene.RequestModuleInterface<INPCModule>();
|
||||||
UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, scene, originalClient.AgentId);
|
UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, scene, sp.Appearance);
|
||||||
|
|
||||||
ScenePresence npc = scene.GetScenePresence(npcId);
|
ScenePresence npc = scene.GetScenePresence(npcId);
|
||||||
Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos));
|
Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos));
|
||||||
|
@ -113,7 +117,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
|
||||||
Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos));
|
Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos));
|
||||||
|
|
||||||
Vector3 targetPos = startPos + new Vector3(0, 0, 10);
|
Vector3 targetPos = startPos + new Vector3(0, 0, 10);
|
||||||
npcModule.MoveToTarget(npc.UUID, scene, targetPos);
|
npcModule.MoveToTarget(npc.UUID, scene, targetPos, false, false);
|
||||||
|
|
||||||
Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos));
|
Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos));
|
||||||
|
|
||||||
|
@ -131,11 +135,12 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
|
||||||
double distanceToTarget = Util.GetDistanceTo(npc.AbsolutePosition, targetPos);
|
double distanceToTarget = Util.GetDistanceTo(npc.AbsolutePosition, targetPos);
|
||||||
Assert.That(distanceToTarget, Is.LessThan(1), "NPC not within 1 unit of target position on first move");
|
Assert.That(distanceToTarget, Is.LessThan(1), "NPC not within 1 unit of target position on first move");
|
||||||
Assert.That(npc.AbsolutePosition, Is.EqualTo(targetPos));
|
Assert.That(npc.AbsolutePosition, Is.EqualTo(targetPos));
|
||||||
|
Assert.That(npc.AgentControlFlags, Is.EqualTo((uint)AgentManager.ControlFlags.NONE));
|
||||||
|
|
||||||
// Try a second movement
|
// Try a second movement
|
||||||
startPos = npc.AbsolutePosition;
|
startPos = npc.AbsolutePosition;
|
||||||
targetPos = startPos + new Vector3(10, 0, 0);
|
targetPos = startPos + new Vector3(10, 0, 0);
|
||||||
npcModule.MoveToTarget(npc.UUID, scene, targetPos);
|
npcModule.MoveToTarget(npc.UUID, scene, targetPos, false, false);
|
||||||
|
|
||||||
scene.Update();
|
scene.Update();
|
||||||
|
|
||||||
|
|
|
@ -258,7 +258,11 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
public override bool Flying
|
public override bool Flying
|
||||||
{
|
{
|
||||||
get { return flying; }
|
get { return flying; }
|
||||||
set { flying = value; }
|
set
|
||||||
|
{
|
||||||
|
flying = value;
|
||||||
|
// m_log.DebugFormat("[PHYSICS]: Set OdeCharacter Flying to {0}", flying);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -305,10 +309,12 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
{
|
{
|
||||||
m_iscolliding = true;
|
m_iscolliding = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_wascolliding != m_iscolliding)
|
if (m_wascolliding != m_iscolliding)
|
||||||
{
|
{
|
||||||
//base.SendCollisionUpdate(new CollisionEventUpdate());
|
//base.SendCollisionUpdate(new CollisionEventUpdate());
|
||||||
}
|
}
|
||||||
|
|
||||||
m_wascolliding = m_iscolliding;
|
m_wascolliding = m_iscolliding;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -369,7 +369,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert a LSL_Rotation to a Quaternion
|
// convert a LSL_Rotation to a Quaternion
|
||||||
protected Quaternion Rot2Quaternion(LSL_Rotation r)
|
public static Quaternion Rot2Quaternion(LSL_Rotation r)
|
||||||
{
|
{
|
||||||
Quaternion q = new Quaternion((float)r.x, (float)r.y, (float)r.z, (float)r.s);
|
Quaternion q = new Quaternion((float)r.x, (float)r.y, (float)r.z, (float)r.s);
|
||||||
q.Normalize();
|
q.Normalize();
|
||||||
|
@ -1204,10 +1204,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
if ((status & ScriptBaseClass.STATUS_PHANTOM) == ScriptBaseClass.STATUS_PHANTOM)
|
if ((status & ScriptBaseClass.STATUS_PHANTOM) == ScriptBaseClass.STATUS_PHANTOM)
|
||||||
{
|
{
|
||||||
if (value != 0)
|
if (m_host.ParentGroup != null)
|
||||||
m_host.ScriptSetPhantomStatus(true);
|
m_host.ParentGroup.ScriptSetPhantomStatus(value != 0);
|
||||||
else
|
|
||||||
m_host.ScriptSetPhantomStatus(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((status & ScriptBaseClass.STATUS_CAST_SHADOWS) == ScriptBaseClass.STATUS_CAST_SHADOWS)
|
if ((status & ScriptBaseClass.STATUS_CAST_SHADOWS) == ScriptBaseClass.STATUS_CAST_SHADOWS)
|
||||||
|
@ -2063,6 +2061,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
return llGetRootRotation();
|
return llGetRootRotation();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
Quaternion q = m_host.GetWorldRotation();
|
Quaternion q = m_host.GetWorldRotation();
|
||||||
return new LSL_Rotation(q.X, q.Y, q.Z, q.W);
|
return new LSL_Rotation(q.X, q.Y, q.Z, q.W);
|
||||||
|
@ -6446,9 +6445,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
if (m_host.ParentGroup != null)
|
if (m_host.ParentGroup != null)
|
||||||
{
|
{
|
||||||
if (!m_host.ParentGroup.IsDeleted)
|
if (!m_host.ParentGroup.IsDeleted)
|
||||||
{
|
m_host.ParentGroup.ScriptSetVolumeDetect(detect != 0);
|
||||||
m_host.ParentGroup.RootPart.ScriptSetVolumeDetect(detect!=0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6456,7 +6453,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
/// This is a depecated function so this just replicates the result of
|
/// This is a depecated function so this just replicates the result of
|
||||||
/// invoking it in SL
|
/// invoking it in SL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
||||||
public void llRemoteLoadScript(string target, string name, int running, int start_param)
|
public void llRemoteLoadScript(string target, string name, int running, int start_param)
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
@ -7254,14 +7250,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return;
|
return;
|
||||||
|
|
||||||
string ph = rules.Data[idx++].ToString();
|
string ph = rules.Data[idx++].ToString();
|
||||||
bool phantom;
|
|
||||||
|
|
||||||
if (ph.Equals("1"))
|
if (m_host.ParentGroup != null)
|
||||||
phantom = true;
|
m_host.ParentGroup.ScriptSetPhantomStatus(ph.Equals("1"));
|
||||||
else
|
|
||||||
phantom = false;
|
|
||||||
|
|
||||||
part.ScriptSetPhantomStatus(phantom);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case (int)ScriptBaseClass.PRIM_PHYSICS:
|
case (int)ScriptBaseClass.PRIM_PHYSICS:
|
||||||
|
@ -7282,14 +7274,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
if (remain < 1)
|
if (remain < 1)
|
||||||
return;
|
return;
|
||||||
string temp = rules.Data[idx++].ToString();
|
string temp = rules.Data[idx++].ToString();
|
||||||
bool tempOnRez;
|
|
||||||
|
|
||||||
if (temp.Equals("1"))
|
if (m_host.ParentGroup != null)
|
||||||
tempOnRez = true;
|
m_host.ParentGroup.ScriptSetTemporaryStatus(temp.Equals("1"));
|
||||||
else
|
|
||||||
tempOnRez = false;
|
|
||||||
|
|
||||||
part.ScriptSetTemporaryStatus(tempOnRez);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case (int)ScriptBaseClass.PRIM_TEXGEN:
|
case (int)ScriptBaseClass.PRIM_TEXGEN:
|
||||||
|
@ -7662,7 +7650,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
case ScriptBaseClass.PRIM_TYPE_BOX:
|
case ScriptBaseClass.PRIM_TYPE_BOX:
|
||||||
case ScriptBaseClass.PRIM_TYPE_CYLINDER:
|
case ScriptBaseClass.PRIM_TYPE_CYLINDER:
|
||||||
case ScriptBaseClass.PRIM_TYPE_PRISM:
|
case ScriptBaseClass.PRIM_TYPE_PRISM:
|
||||||
res.Add(new LSL_Integer(Shape.ProfileCurve));
|
res.Add(new LSL_Integer(Shape.ProfileCurve) & 0xf0); // Isolate hole shape nibble.
|
||||||
res.Add(new LSL_Vector(Shape.ProfileBegin / 50000.0, 1 - Shape.ProfileEnd / 50000.0, 0));
|
res.Add(new LSL_Vector(Shape.ProfileBegin / 50000.0, 1 - Shape.ProfileEnd / 50000.0, 0));
|
||||||
res.Add(new LSL_Float(Shape.ProfileHollow / 50000.0));
|
res.Add(new LSL_Float(Shape.ProfileHollow / 50000.0));
|
||||||
res.Add(new LSL_Vector(Shape.PathTwistBegin / 100.0, Shape.PathTwist / 100.0, 0));
|
res.Add(new LSL_Vector(Shape.PathTwistBegin / 100.0, Shape.PathTwist / 100.0, 0));
|
||||||
|
@ -7671,7 +7659,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ScriptBaseClass.PRIM_TYPE_SPHERE:
|
case ScriptBaseClass.PRIM_TYPE_SPHERE:
|
||||||
res.Add(new LSL_Integer(Shape.ProfileCurve));
|
res.Add(new LSL_Integer(Shape.ProfileCurve) & 0xf0); // Isolate hole shape nibble.
|
||||||
res.Add(new LSL_Vector(Shape.PathBegin / 50000.0, 1 - Shape.PathEnd / 50000.0, 0));
|
res.Add(new LSL_Vector(Shape.PathBegin / 50000.0, 1 - Shape.PathEnd / 50000.0, 0));
|
||||||
res.Add(new LSL_Float(Shape.ProfileHollow / 50000.0));
|
res.Add(new LSL_Float(Shape.ProfileHollow / 50000.0));
|
||||||
res.Add(new LSL_Vector(Shape.PathTwistBegin / 100.0, Shape.PathTwist / 100.0, 0));
|
res.Add(new LSL_Vector(Shape.PathTwistBegin / 100.0, Shape.PathTwist / 100.0, 0));
|
||||||
|
@ -7687,7 +7675,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
case ScriptBaseClass.PRIM_TYPE_TUBE:
|
case ScriptBaseClass.PRIM_TYPE_TUBE:
|
||||||
case ScriptBaseClass.PRIM_TYPE_TORUS:
|
case ScriptBaseClass.PRIM_TYPE_TORUS:
|
||||||
// holeshape
|
// holeshape
|
||||||
res.Add(new LSL_Integer(Shape.ProfileCurve));
|
res.Add(new LSL_Integer(Shape.ProfileCurve) & 0xf0); // Isolate hole shape nibble.
|
||||||
|
|
||||||
// cut
|
// cut
|
||||||
res.Add(new LSL_Vector(Shape.PathBegin / 50000.0, 1 - Shape.PathEnd / 50000.0, 0));
|
res.Add(new LSL_Vector(Shape.PathBegin / 50000.0, 1 - Shape.PathEnd / 50000.0, 0));
|
||||||
|
@ -10578,9 +10566,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetLine(UUID assetID, int line, int maxLength)
|
/// <summary>
|
||||||
|
/// Get a notecard line.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="assetID"></param>
|
||||||
|
/// <param name="line">Lines start at index 0</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string GetLine(UUID assetID, int lineNumber)
|
||||||
{
|
{
|
||||||
if (line < 0)
|
if (lineNumber < 0)
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
string data;
|
string data;
|
||||||
|
@ -10592,17 +10586,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_Notecards[assetID].lastRef = DateTime.Now;
|
m_Notecards[assetID].lastRef = DateTime.Now;
|
||||||
|
|
||||||
if (line >= m_Notecards[assetID].text.Length)
|
if (lineNumber >= m_Notecards[assetID].text.Length)
|
||||||
return "\n\n\n";
|
return "\n\n\n";
|
||||||
|
|
||||||
data = m_Notecards[assetID].text[line];
|
data = m_Notecards[assetID].text[lineNumber];
|
||||||
if (data.Length > maxLength)
|
|
||||||
data = data.Substring(0, maxLength);
|
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a notecard line.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="assetID"></param>
|
||||||
|
/// <param name="line">Lines start at index 0</param>
|
||||||
|
/// <param name="maxLength">Maximum length of the returned line. Longer lines will be truncated</para>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string GetLine(UUID assetID, int lineNumber, int maxLength)
|
||||||
|
{
|
||||||
|
string line = GetLine(assetID, lineNumber);
|
||||||
|
|
||||||
|
if (line.Length > maxLength)
|
||||||
|
line = line.Substring(0, maxLength);
|
||||||
|
|
||||||
|
return line;
|
||||||
|
}
|
||||||
|
|
||||||
public static void CacheCheck()
|
public static void CacheCheck()
|
||||||
{
|
{
|
||||||
foreach (UUID key in new List<UUID>(m_Notecards.Keys))
|
foreach (UUID key in new List<UUID>(m_Notecards.Keys))
|
||||||
|
|
|
@ -28,11 +28,16 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Reflection;
|
||||||
using System.Runtime.Remoting.Lifetime;
|
using System.Runtime.Remoting.Lifetime;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Xml;
|
||||||
|
using log4net;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
|
using OpenMetaverse.StructuredData;
|
||||||
using Nini.Config;
|
using Nini.Config;
|
||||||
using OpenSim;
|
using OpenSim;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
|
@ -119,6 +124,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class OSSL_Api : MarshalByRefObject, IOSSL_Api, IScriptApi
|
public class OSSL_Api : MarshalByRefObject, IOSSL_Api, IScriptApi
|
||||||
{
|
{
|
||||||
|
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
internal IScriptEngine m_ScriptEngine;
|
internal IScriptEngine m_ScriptEngine;
|
||||||
internal ILSL_Api m_LSL_Api = null; // get a reference to the LSL API so we can call methods housed there
|
internal ILSL_Api m_LSL_Api = null; // get a reference to the LSL API so we can call methods housed there
|
||||||
internal SceneObjectPart m_host;
|
internal SceneObjectPart m_host;
|
||||||
|
@ -348,20 +355,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
System.Threading.Thread.Sleep(delay);
|
System.Threading.Thread.Sleep(delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// OpenSim functions
|
|
||||||
//
|
|
||||||
public LSL_Integer osSetTerrainHeight(int x, int y, double val)
|
public LSL_Integer osSetTerrainHeight(int x, int y, double val)
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.High, "osSetTerrainHeight");
|
CheckThreatLevel(ThreatLevel.High, "osSetTerrainHeight");
|
||||||
return SetTerrainHeight(x, y, val);
|
return SetTerrainHeight(x, y, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LSL_Integer osTerrainSetHeight(int x, int y, double val)
|
public LSL_Integer osTerrainSetHeight(int x, int y, double val)
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.High, "osTerrainSetHeight");
|
CheckThreatLevel(ThreatLevel.High, "osTerrainSetHeight");
|
||||||
OSSLDeprecated("osTerrainSetHeight", "osSetTerrainHeight");
|
OSSLDeprecated("osTerrainSetHeight", "osSetTerrainHeight");
|
||||||
return SetTerrainHeight(x, y, val);
|
return SetTerrainHeight(x, y, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
private LSL_Integer SetTerrainHeight(int x, int y, double val)
|
private LSL_Integer SetTerrainHeight(int x, int y, double val)
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
@ -384,12 +390,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
CheckThreatLevel(ThreatLevel.None, "osGetTerrainHeight");
|
CheckThreatLevel(ThreatLevel.None, "osGetTerrainHeight");
|
||||||
return GetTerrainHeight(x, y);
|
return GetTerrainHeight(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LSL_Float osTerrainGetHeight(int x, int y)
|
public LSL_Float osTerrainGetHeight(int x, int y)
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.None, "osTerrainGetHeight");
|
CheckThreatLevel(ThreatLevel.None, "osTerrainGetHeight");
|
||||||
OSSLDeprecated("osTerrainGetHeight", "osGetTerrainHeight");
|
OSSLDeprecated("osTerrainGetHeight", "osGetTerrainHeight");
|
||||||
return GetTerrainHeight(x, y);
|
return GetTerrainHeight(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
private LSL_Float GetTerrainHeight(int x, int y)
|
private LSL_Float GetTerrainHeight(int x, int y)
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
@ -862,7 +870,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
ScenePresence target = (ScenePresence)World.Entities[avatarID];
|
ScenePresence target = (ScenePresence)World.Entities[avatarID];
|
||||||
if (target != null)
|
if (target != null)
|
||||||
{
|
{
|
||||||
UUID animID=UUID.Zero;
|
UUID animID = UUID.Zero;
|
||||||
lock (m_host.TaskInventory)
|
lock (m_host.TaskInventory)
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||||
|
@ -1021,6 +1029,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
drawList += "PenColor " + color + "; ";
|
drawList += "PenColor " + color + "; ";
|
||||||
return drawList;
|
return drawList;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated
|
// Deprecated
|
||||||
public string osSetPenColour(string drawList, string colour)
|
public string osSetPenColour(string drawList, string colour)
|
||||||
{
|
{
|
||||||
|
@ -1182,11 +1191,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
OSSLDeprecated("osSunGetParam", "osGetSunParam");
|
OSSLDeprecated("osSunGetParam", "osGetSunParam");
|
||||||
return GetSunParam(param);
|
return GetSunParam(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
public double osGetSunParam(string param)
|
public double osGetSunParam(string param)
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.None, "osGetSunParam");
|
CheckThreatLevel(ThreatLevel.None, "osGetSunParam");
|
||||||
return GetSunParam(param);
|
return GetSunParam(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
private double GetSunParam(string param)
|
private double GetSunParam(string param)
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
@ -1208,11 +1219,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
OSSLDeprecated("osSunSetParam", "osSetSunParam");
|
OSSLDeprecated("osSunSetParam", "osSetSunParam");
|
||||||
SetSunParam(param, value);
|
SetSunParam(param, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void osSetSunParam(string param, double value)
|
public void osSetSunParam(string param, double value)
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.None, "osSetSunParam");
|
CheckThreatLevel(ThreatLevel.None, "osSetSunParam");
|
||||||
SetSunParam(param, value);
|
SetSunParam(param, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetSunParam(string param, double value)
|
private void SetSunParam(string param, double value)
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
@ -1222,10 +1235,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
module.SetSunParameter(param, value);
|
module.SetSunParameter(param, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public string osWindActiveModelPluginName()
|
public string osWindActiveModelPluginName()
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.None, "osWindActiveModelPluginName");
|
CheckThreatLevel(ThreatLevel.None, "osWindActiveModelPluginName");
|
||||||
|
@ -1304,12 +1315,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
OSSLDeprecated(functionName, "osSetParcelDetails");
|
OSSLDeprecated(functionName, "osSetParcelDetails");
|
||||||
SetParcelDetails(pos, rules, functionName);
|
SetParcelDetails(pos, rules, functionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void osSetParcelDetails(LSL_Vector pos, LSL_List rules)
|
public void osSetParcelDetails(LSL_Vector pos, LSL_List rules)
|
||||||
{
|
{
|
||||||
const string functionName = "osSetParcelDetails";
|
const string functionName = "osSetParcelDetails";
|
||||||
CheckThreatLevel(ThreatLevel.High, functionName);
|
CheckThreatLevel(ThreatLevel.High, functionName);
|
||||||
SetParcelDetails(pos, rules, functionName);
|
SetParcelDetails(pos, rules, functionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetParcelDetails(LSL_Vector pos, LSL_List rules, string functionName)
|
private void SetParcelDetails(LSL_Vector pos, LSL_List rules, string functionName)
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
@ -1429,8 +1442,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
voiceModule.setLandSIPAddress(SIPAddress,land.LandData.GlobalID);
|
voiceModule.setLandSIPAddress(SIPAddress,land.LandData.GlobalID);
|
||||||
else
|
else
|
||||||
OSSLError("osSetParcelSIPAddress: No voice module enabled for this land");
|
OSSLError("osSetParcelSIPAddress: No voice module enabled for this land");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string osGetScriptEngineName()
|
public string osGetScriptEngineName()
|
||||||
|
@ -1683,8 +1694,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return jsondata;
|
return jsondata;
|
||||||
}
|
}
|
||||||
|
|
||||||
// send a message to to object identified by the given UUID, a script in the object must implement the dataserver function
|
/// <summary>
|
||||||
// the dataserver function is passed the ID of the calling function and a string message
|
/// Send a message to to object identified by the given UUID
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// A script in the object must implement the dataserver function
|
||||||
|
/// the dataserver function is passed the ID of the calling function and a string message
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="objectUUID"></param>
|
||||||
|
/// <param name="message"></param>
|
||||||
public void osMessageObject(LSL_Key objectUUID, string message)
|
public void osMessageObject(LSL_Key objectUUID, string message)
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.Low, "osMessageObject");
|
CheckThreatLevel(ThreatLevel.Low, "osMessageObject");
|
||||||
|
@ -1699,34 +1717,56 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
"dataserver", resobj, new DetectParams[0]));
|
"dataserver", resobj, new DetectParams[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
// This needs ThreatLevel high. It is an excellent griefer tool,
|
/// Write a notecard directly to the prim's inventory.
|
||||||
// In a loop, it can cause asset bloat and DOS levels of asset
|
/// </summary>
|
||||||
// writes.
|
/// <remarks>
|
||||||
//
|
/// This needs ThreatLevel high. It is an excellent griefer tool,
|
||||||
|
/// In a loop, it can cause asset bloat and DOS levels of asset
|
||||||
|
/// writes.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="notecardName">The name of the notecard to write.</param>
|
||||||
|
/// <param name="contents">The contents of the notecard.</param>
|
||||||
public void osMakeNotecard(string notecardName, LSL_Types.list contents)
|
public void osMakeNotecard(string notecardName, LSL_Types.list contents)
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.High, "osMakeNotecard");
|
CheckThreatLevel(ThreatLevel.High, "osMakeNotecard");
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
|
StringBuilder notecardData = new StringBuilder();
|
||||||
|
|
||||||
|
for (int i = 0; i < contents.Length; i++)
|
||||||
|
notecardData.Append((string)(contents.GetLSLStringItem(i) + "\n"));
|
||||||
|
|
||||||
|
SaveNotecard(notecardName, "Script generated notecard", notecardData.ToString(), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Save a notecard to prim inventory.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
/// <param name="description">Description of notecard</param>
|
||||||
|
/// <param name="notecardData"></param>
|
||||||
|
/// <param name="forceSameName">
|
||||||
|
/// If true, then if an item exists with the same name, it is replaced.
|
||||||
|
/// If false, then a new item is created witha slightly different name (e.g. name 1)
|
||||||
|
/// </param>
|
||||||
|
/// <returns>Prim inventory item created.</returns>
|
||||||
|
protected TaskInventoryItem SaveNotecard(string name, string description, string data, bool forceSameName)
|
||||||
|
{
|
||||||
// Create new asset
|
// Create new asset
|
||||||
AssetBase asset = new AssetBase(UUID.Random(), notecardName, (sbyte)AssetType.Notecard, m_host.OwnerID.ToString());
|
AssetBase asset = new AssetBase(UUID.Random(), name, (sbyte)AssetType.Notecard, m_host.OwnerID.ToString());
|
||||||
asset.Description = "Script Generated Notecard";
|
asset.Description = description;
|
||||||
string notecardData = String.Empty;
|
|
||||||
|
|
||||||
for (int i = 0; i < contents.Length; i++) {
|
int textLength = data.Length;
|
||||||
notecardData += contents.GetLSLStringItem(i) + "\n";
|
data
|
||||||
}
|
= "Linden text version 2\n{\nLLEmbeddedItems version 1\n{\ncount 0\n}\nText length "
|
||||||
|
+ textLength.ToString() + "\n" + data + "}\n";
|
||||||
|
|
||||||
int textLength = notecardData.Length;
|
asset.Data = Util.UTF8.GetBytes(data);
|
||||||
notecardData = "Linden text version 2\n{\nLLEmbeddedItems version 1\n{\ncount 0\n}\nText length "
|
|
||||||
+ textLength.ToString() + "\n" + notecardData + "}\n";
|
|
||||||
|
|
||||||
asset.Data = Util.UTF8.GetBytes(notecardData);
|
|
||||||
World.AssetService.Store(asset);
|
World.AssetService.Store(asset);
|
||||||
|
|
||||||
// Create Task Entry
|
// Create Task Entry
|
||||||
TaskInventoryItem taskItem=new TaskInventoryItem();
|
TaskInventoryItem taskItem = new TaskInventoryItem();
|
||||||
|
|
||||||
taskItem.ResetIDs(m_host.UUID);
|
taskItem.ResetIDs(m_host.UUID);
|
||||||
taskItem.ParentID = m_host.UUID;
|
taskItem.ParentID = m_host.UUID;
|
||||||
|
@ -1748,33 +1788,96 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
taskItem.PermsMask = 0;
|
taskItem.PermsMask = 0;
|
||||||
taskItem.AssetID = asset.FullID;
|
taskItem.AssetID = asset.FullID;
|
||||||
|
|
||||||
m_host.Inventory.AddInventoryItem(taskItem, false);
|
if (forceSameName)
|
||||||
|
m_host.Inventory.AddInventoryItemExclusive(taskItem, false);
|
||||||
|
else
|
||||||
|
m_host.Inventory.AddInventoryItem(taskItem, false);
|
||||||
|
|
||||||
|
return taskItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Load the notecard data found at the given prim inventory item name or asset uuid.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="notecardNameOrUuid"></param>
|
||||||
|
/// <returns>The text loaded. Null if no notecard was found.</returns>
|
||||||
|
protected string LoadNotecard(string notecardNameOrUuid)
|
||||||
|
{
|
||||||
|
UUID assetID = CacheNotecard(notecardNameOrUuid);
|
||||||
|
StringBuilder notecardData = new StringBuilder();
|
||||||
|
|
||||||
/*Instead of using the LSL Dataserver event to pull notecard data,
|
for (int count = 0; count < NotecardCache.GetLines(assetID); count++)
|
||||||
this will simply read the requested line and return its data as a string.
|
{
|
||||||
|
string line = NotecardCache.GetLine(assetID, count) + "\n";
|
||||||
|
|
||||||
Warning - due to the synchronous method this function uses to fetch assets, its use
|
// m_log.DebugFormat("[OSSL]: From notecard {0} loading line {1}", notecardNameOrUuid, line);
|
||||||
may be dangerous and unreliable while running in grid mode.
|
|
||||||
*/
|
notecardData.Append(line);
|
||||||
|
}
|
||||||
|
|
||||||
|
return notecardData.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Cache a notecard's contents.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="notecardNameOrUuid"></param>
|
||||||
|
/// <returns>
|
||||||
|
/// The asset id of the notecard, which is used for retrieving the cached data.
|
||||||
|
/// UUID.Zero if no asset could be found.
|
||||||
|
/// </returns>
|
||||||
|
protected UUID CacheNotecard(string notecardNameOrUuid)
|
||||||
|
{
|
||||||
|
UUID assetID = UUID.Zero;
|
||||||
|
|
||||||
|
if (!UUID.TryParse(notecardNameOrUuid, out assetID))
|
||||||
|
{
|
||||||
|
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
||||||
|
{
|
||||||
|
if (item.Type == 7 && item.Name == notecardNameOrUuid)
|
||||||
|
{
|
||||||
|
assetID = item.AssetID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (assetID == UUID.Zero)
|
||||||
|
return UUID.Zero;
|
||||||
|
|
||||||
|
if (!NotecardCache.IsCached(assetID))
|
||||||
|
{
|
||||||
|
AssetBase a = World.AssetService.Get(assetID.ToString());
|
||||||
|
|
||||||
|
if (a == null)
|
||||||
|
return UUID.Zero;
|
||||||
|
|
||||||
|
System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();
|
||||||
|
string data = enc.GetString(a.Data);
|
||||||
|
NotecardCache.Cache(assetID, data);
|
||||||
|
};
|
||||||
|
|
||||||
|
return assetID;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Directly get an entire notecard at once.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Instead of using the LSL Dataserver event to pull notecard data
|
||||||
|
/// this will simply read the entire notecard and return its data as a string.
|
||||||
|
///
|
||||||
|
/// Warning - due to the synchronous method this function uses to fetch assets, its use
|
||||||
|
/// may be dangerous and unreliable while running in grid mode.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="name">Name of the notecard or its asset id</param>
|
||||||
|
/// <param name="line">The line number to read. The first line is line 0</param>
|
||||||
|
/// <returns>Notecard line</returns>
|
||||||
public string osGetNotecardLine(string name, int line)
|
public string osGetNotecardLine(string name, int line)
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.VeryHigh, "osGetNotecardLine");
|
CheckThreatLevel(ThreatLevel.VeryHigh, "osGetNotecardLine");
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
UUID assetID = UUID.Zero;
|
UUID assetID = CacheNotecard(name);
|
||||||
|
|
||||||
if (!UUID.TryParse(name, out assetID))
|
|
||||||
{
|
|
||||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
|
||||||
{
|
|
||||||
if (item.Type == 7 && item.Name == name)
|
|
||||||
{
|
|
||||||
assetID = item.AssetID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (assetID == UUID.Zero)
|
if (assetID == UUID.Zero)
|
||||||
{
|
{
|
||||||
|
@ -1782,109 +1885,57 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return "ERROR!";
|
return "ERROR!";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!NotecardCache.IsCached(assetID))
|
return NotecardCache.GetLine(assetID, line);
|
||||||
{
|
|
||||||
AssetBase a = World.AssetService.Get(assetID.ToString());
|
|
||||||
if (a != null)
|
|
||||||
{
|
|
||||||
System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();
|
|
||||||
string data = enc.GetString(a.Data);
|
|
||||||
NotecardCache.Cache(assetID, data);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
OSSLShoutError("Notecard '" + name + "' could not be found.");
|
|
||||||
return "ERROR!";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return NotecardCache.GetLine(assetID, line, 255);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Instead of using the LSL Dataserver event to pull notecard data line by line,
|
/// <summary>
|
||||||
this will simply read the entire notecard and return its data as a string.
|
/// Get an entire notecard at once.
|
||||||
|
/// </summary>
|
||||||
Warning - due to the synchronous method this function uses to fetch assets, its use
|
/// <remarks>
|
||||||
may be dangerous and unreliable while running in grid mode.
|
/// Instead of using the LSL Dataserver event to pull notecard data line by line,
|
||||||
*/
|
/// this will simply read the entire notecard and return its data as a string.
|
||||||
|
///
|
||||||
|
/// Warning - due to the synchronous method this function uses to fetch assets, its use
|
||||||
|
/// may be dangerous and unreliable while running in grid mode.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="name">Name of the notecard or its asset id</param>
|
||||||
|
/// <returns>Notecard text</returns>
|
||||||
public string osGetNotecard(string name)
|
public string osGetNotecard(string name)
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.VeryHigh, "osGetNotecard");
|
CheckThreatLevel(ThreatLevel.VeryHigh, "osGetNotecard");
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
UUID assetID = UUID.Zero;
|
string text = LoadNotecard(name);
|
||||||
string NotecardData = "";
|
|
||||||
|
|
||||||
if (!UUID.TryParse(name, out assetID))
|
if (text == null)
|
||||||
{
|
|
||||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
|
||||||
{
|
|
||||||
if (item.Type == 7 && item.Name == name)
|
|
||||||
{
|
|
||||||
assetID = item.AssetID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (assetID == UUID.Zero)
|
|
||||||
{
|
{
|
||||||
OSSLShoutError("Notecard '" + name + "' could not be found.");
|
OSSLShoutError("Notecard '" + name + "' could not be found.");
|
||||||
return "ERROR!";
|
return "ERROR!";
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (!NotecardCache.IsCached(assetID))
|
|
||||||
{
|
{
|
||||||
AssetBase a = World.AssetService.Get(assetID.ToString());
|
return text;
|
||||||
if (a != null)
|
|
||||||
{
|
|
||||||
System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();
|
|
||||||
string data = enc.GetString(a.Data);
|
|
||||||
NotecardCache.Cache(assetID, data);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
OSSLShoutError("Notecard '" + name + "' could not be found.");
|
|
||||||
return "ERROR!";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
for (int count = 0; count < NotecardCache.GetLines(assetID); count++)
|
|
||||||
{
|
|
||||||
NotecardData += NotecardCache.GetLine(assetID, count, 255) + "\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NotecardData;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Instead of using the LSL Dataserver event to pull notecard data,
|
/// <summary>
|
||||||
this will simply read the number of note card lines and return this data as an integer.
|
/// Get the number of lines in the given notecard.
|
||||||
|
/// </summary>
|
||||||
Warning - due to the synchronous method this function uses to fetch assets, its use
|
/// <remarks>
|
||||||
may be dangerous and unreliable while running in grid mode.
|
/// Instead of using the LSL Dataserver event to pull notecard data,
|
||||||
*/
|
/// this will simply read the number of note card lines and return this data as an integer.
|
||||||
|
///
|
||||||
|
/// Warning - due to the synchronous method this function uses to fetch assets, its use
|
||||||
|
/// may be dangerous and unreliable while running in grid mode.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="name">Name of the notecard or its asset id</param>
|
||||||
|
/// <returns></returns>
|
||||||
public int osGetNumberOfNotecardLines(string name)
|
public int osGetNumberOfNotecardLines(string name)
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.VeryHigh, "osGetNumberOfNotecardLines");
|
CheckThreatLevel(ThreatLevel.VeryHigh, "osGetNumberOfNotecardLines");
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
UUID assetID = UUID.Zero;
|
UUID assetID = CacheNotecard(name);
|
||||||
|
|
||||||
if (!UUID.TryParse(name, out assetID))
|
|
||||||
{
|
|
||||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
|
||||||
{
|
|
||||||
if (item.Type == 7 && item.Name == name)
|
|
||||||
{
|
|
||||||
assetID = item.AssetID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (assetID == UUID.Zero)
|
if (assetID == UUID.Zero)
|
||||||
{
|
{
|
||||||
|
@ -1892,22 +1943,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!NotecardCache.IsCached(assetID))
|
|
||||||
{
|
|
||||||
AssetBase a = World.AssetService.Get(assetID.ToString());
|
|
||||||
if (a != null)
|
|
||||||
{
|
|
||||||
System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();
|
|
||||||
string data = enc.GetString(a.Data);
|
|
||||||
NotecardCache.Cache(assetID, data);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
OSSLShoutError("Notecard '" + name + "' could not be found.");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return NotecardCache.GetLines(assetID);
|
return NotecardCache.GetLines(assetID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1947,15 +1982,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get the nickname of this grid, as set in the [GridInfo] config section.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
/// Threat level is Moderate because intentional abuse, for instance
|
/// Threat level is Moderate because intentional abuse, for instance
|
||||||
/// scripts that are written to be malicious only on one grid,
|
/// scripts that are written to be malicious only on one grid,
|
||||||
/// for instance in a HG scenario, are a distinct possibility.
|
/// for instance in a HG scenario, are a distinct possibility.
|
||||||
///
|
/// </remarks>
|
||||||
/// Use value from the config file and return it.
|
/// <returns></returns>
|
||||||
///
|
|
||||||
public string osGetGridNick()
|
public string osGetGridNick()
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.Moderate, "osGetGridNick");
|
CheckThreatLevel(ThreatLevel.Moderate, "osGetGridNick");
|
||||||
|
@ -2063,12 +2100,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return World.RegionInfo.RegionSettings.LoadedCreationID;
|
return World.RegionInfo.RegionSettings.LoadedCreationID;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Threat level is 'Low' because certain users could possibly be tricked into
|
/// <summary>
|
||||||
// dropping an unverified script into one of their own objects, which could
|
/// Get the primitive parameters of a linked prim.
|
||||||
// then gather the physical construction details of the object and transmit it
|
/// </summary>
|
||||||
// to an unscrupulous third party, thus permitting unauthorized duplication of
|
/// <remarks>
|
||||||
// the object's form.
|
/// Threat level is 'Low' because certain users could possibly be tricked into
|
||||||
//
|
/// dropping an unverified script into one of their own objects, which could
|
||||||
|
/// then gather the physical construction details of the object and transmit it
|
||||||
|
/// to an unscrupulous third party, thus permitting unauthorized duplication of
|
||||||
|
/// the object's form.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="linknumber"></param>
|
||||||
|
/// <param name="rules"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public LSL_List osGetLinkPrimitiveParams(int linknumber, LSL_List rules)
|
public LSL_List osGetLinkPrimitiveParams(int linknumber, LSL_List rules)
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.High, "osGetLinkPrimitiveParams");
|
CheckThreatLevel(ThreatLevel.High, "osGetLinkPrimitiveParams");
|
||||||
|
@ -2083,25 +2127,122 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, LSL_Key cloneFrom)
|
public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard)
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.High, "osNpcCreate");
|
CheckThreatLevel(ThreatLevel.High, "osNpcCreate");
|
||||||
//QueueUserWorkItem
|
|
||||||
|
|
||||||
INPCModule module = World.RequestModuleInterface<INPCModule>();
|
INPCModule module = World.RequestModuleInterface<INPCModule>();
|
||||||
if (module != null)
|
if (module != null)
|
||||||
{
|
{
|
||||||
|
AvatarAppearance appearance = null;
|
||||||
|
|
||||||
|
UUID id;
|
||||||
|
if (UUID.TryParse(notecard, out id))
|
||||||
|
{
|
||||||
|
ScenePresence clonePresence = World.GetScenePresence(id);
|
||||||
|
if (clonePresence != null)
|
||||||
|
appearance = clonePresence.Appearance;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (appearance == null)
|
||||||
|
{
|
||||||
|
string appearanceSerialized = LoadNotecard(notecard);
|
||||||
|
|
||||||
|
if (appearanceSerialized != null)
|
||||||
|
{
|
||||||
|
OSDMap appearanceOsd = (OSDMap)OSDParser.DeserializeLLSDXml(appearanceSerialized);
|
||||||
|
appearance = new AvatarAppearance();
|
||||||
|
appearance.Unpack(appearanceOsd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (appearance == null)
|
||||||
|
return new LSL_Key(UUID.Zero.ToString());
|
||||||
|
|
||||||
UUID x = module.CreateNPC(firstname,
|
UUID x = module.CreateNPC(firstname,
|
||||||
lastname,
|
lastname,
|
||||||
new Vector3((float) position.x, (float) position.y, (float) position.z),
|
new Vector3((float) position.x, (float) position.y, (float) position.z),
|
||||||
World,
|
World,
|
||||||
new UUID(cloneFrom));
|
appearance);
|
||||||
|
|
||||||
return new LSL_Key(x.ToString());
|
return new LSL_Key(x.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
return new LSL_Key(UUID.Zero.ToString());
|
return new LSL_Key(UUID.Zero.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Save the current appearance of the NPC permanently to the named notecard.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="avatar"></param>
|
||||||
|
/// <param name="notecard">The name of the notecard to which to save the appearance.</param>
|
||||||
|
/// <returns>The asset ID of the notecard saved.</returns>
|
||||||
|
public LSL_Key osNpcSaveAppearance(LSL_Key npc, string notecard)
|
||||||
|
{
|
||||||
|
CheckThreatLevel(ThreatLevel.High, "osNpcSaveAppearance");
|
||||||
|
|
||||||
|
INPCModule npcModule = World.RequestModuleInterface<INPCModule>();
|
||||||
|
|
||||||
|
if (npcModule != null)
|
||||||
|
{
|
||||||
|
UUID npcId;
|
||||||
|
if (!UUID.TryParse(npc.m_string, out npcId))
|
||||||
|
return new LSL_Key(UUID.Zero.ToString());
|
||||||
|
|
||||||
|
if (!npcModule.IsNPC(npcId, m_host.ParentGroup.Scene))
|
||||||
|
return new LSL_Key(UUID.Zero.ToString());
|
||||||
|
|
||||||
|
return SaveAppearanceToNotecard(npcId, notecard);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new LSL_Key(UUID.Zero.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void osNpcLoadAppearance(LSL_Key npc, string notecard)
|
||||||
|
{
|
||||||
|
CheckThreatLevel(ThreatLevel.High, "osNpcLoadAppearance");
|
||||||
|
|
||||||
|
INPCModule npcModule = World.RequestModuleInterface<INPCModule>();
|
||||||
|
|
||||||
|
if (npcModule != null)
|
||||||
|
{
|
||||||
|
UUID npcId;
|
||||||
|
if (!UUID.TryParse(npc.m_string, out npcId))
|
||||||
|
return;
|
||||||
|
|
||||||
|
string appearanceSerialized = LoadNotecard(notecard);
|
||||||
|
OSDMap appearanceOsd = (OSDMap)OSDParser.DeserializeLLSDXml(appearanceSerialized);
|
||||||
|
// OSD a = OSDParser.DeserializeLLSDXml(appearanceSerialized);
|
||||||
|
// Console.WriteLine("appearanceSerialized {0}", appearanceSerialized);
|
||||||
|
// Console.WriteLine("a.Type {0}, a.ToString() {1}", a.Type, a);
|
||||||
|
AvatarAppearance appearance = new AvatarAppearance();
|
||||||
|
appearance.Unpack(appearanceOsd);
|
||||||
|
|
||||||
|
npcModule.SetNPCAppearance(npcId, appearance, m_host.ParentGroup.Scene);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public LSL_Vector osNpcGetPos(LSL_Key npc)
|
||||||
|
{
|
||||||
|
CheckThreatLevel(ThreatLevel.High, "osNpcGetPos");
|
||||||
|
|
||||||
|
INPCModule npcModule = World.RequestModuleInterface<INPCModule>();
|
||||||
|
if (npcModule != null)
|
||||||
|
{
|
||||||
|
UUID npcId;
|
||||||
|
if (!UUID.TryParse(npc.m_string, out npcId))
|
||||||
|
return new LSL_Vector(0, 0, 0);
|
||||||
|
|
||||||
|
if (!npcModule.IsNPC(npcId, m_host.ParentGroup.Scene))
|
||||||
|
return new LSL_Vector(0, 0, 0);
|
||||||
|
|
||||||
|
Vector3 pos = World.GetScenePresence(npcId).AbsolutePosition;
|
||||||
|
return new LSL_Vector(pos.X, pos.Y, pos.Z);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new LSL_Vector(0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
public void osNpcMoveTo(LSL_Key npc, LSL_Vector position)
|
public void osNpcMoveTo(LSL_Key npc, LSL_Vector position)
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.High, "osNpcMoveTo");
|
CheckThreatLevel(ThreatLevel.High, "osNpcMoveTo");
|
||||||
|
@ -2109,11 +2250,87 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
INPCModule module = World.RequestModuleInterface<INPCModule>();
|
INPCModule module = World.RequestModuleInterface<INPCModule>();
|
||||||
if (module != null)
|
if (module != null)
|
||||||
{
|
{
|
||||||
|
UUID npcId;
|
||||||
|
if (!UUID.TryParse(npc.m_string, out npcId))
|
||||||
|
return;
|
||||||
|
|
||||||
Vector3 pos = new Vector3((float) position.x, (float) position.y, (float) position.z);
|
Vector3 pos = new Vector3((float) position.x, (float) position.y, (float) position.z);
|
||||||
module.MoveToTarget(new UUID(npc.m_string), World, pos);
|
module.MoveToTarget(npcId, World, pos, false, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void osNpcMoveToTarget(LSL_Key npc, LSL_Vector target, int options)
|
||||||
|
{
|
||||||
|
CheckThreatLevel(ThreatLevel.High, "osNpcMoveToTarget");
|
||||||
|
|
||||||
|
INPCModule module = World.RequestModuleInterface<INPCModule>();
|
||||||
|
if (module != null)
|
||||||
|
{
|
||||||
|
UUID npcId;
|
||||||
|
if (!UUID.TryParse(npc.m_string, out npcId))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Vector3 pos = new Vector3((float)target.x, (float)target.y, (float)target.z);
|
||||||
|
module.MoveToTarget(
|
||||||
|
new UUID(npc.m_string),
|
||||||
|
World,
|
||||||
|
pos,
|
||||||
|
(options & ScriptBaseClass.OS_NPC_NO_FLY) != 0,
|
||||||
|
(options & ScriptBaseClass.OS_NPC_LAND_AT_TARGET) != 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public LSL_Rotation osNpcGetRot(LSL_Key npc)
|
||||||
|
{
|
||||||
|
CheckThreatLevel(ThreatLevel.High, "osNpcGetRot");
|
||||||
|
|
||||||
|
INPCModule npcModule = World.RequestModuleInterface<INPCModule>();
|
||||||
|
if (npcModule != null)
|
||||||
|
{
|
||||||
|
UUID npcId;
|
||||||
|
if (!UUID.TryParse(npc.m_string, out npcId))
|
||||||
|
return new LSL_Rotation(Quaternion.Identity.X, Quaternion.Identity.Y, Quaternion.Identity.Z, Quaternion.Identity.W);
|
||||||
|
|
||||||
|
if (!npcModule.IsNPC(npcId, m_host.ParentGroup.Scene))
|
||||||
|
return new LSL_Rotation(Quaternion.Identity.X, Quaternion.Identity.Y, Quaternion.Identity.Z, Quaternion.Identity.W);
|
||||||
|
|
||||||
|
ScenePresence sp = World.GetScenePresence(npcId);
|
||||||
|
Quaternion rot = sp.Rotation;
|
||||||
|
|
||||||
|
return new LSL_Rotation(rot.X, rot.Y, rot.Z, rot.W);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new LSL_Rotation(Quaternion.Identity.X, Quaternion.Identity.Y, Quaternion.Identity.Z, Quaternion.Identity.W);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void osNpcSetRot(LSL_Key npc, LSL_Rotation rotation)
|
||||||
|
{
|
||||||
|
CheckThreatLevel(ThreatLevel.High, "osNpcSetRot");
|
||||||
|
|
||||||
|
INPCModule npcModule = World.RequestModuleInterface<INPCModule>();
|
||||||
|
if (npcModule != null)
|
||||||
|
{
|
||||||
|
UUID npcId;
|
||||||
|
if (!UUID.TryParse(npc.m_string, out npcId))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!npcModule.IsNPC(npcId, m_host.ParentGroup.Scene))
|
||||||
|
return;
|
||||||
|
|
||||||
|
ScenePresence sp = World.GetScenePresence(npcId);
|
||||||
|
sp.Rotation = LSL_Api.Rot2Quaternion(rotation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void osNpcStopMoveToTarget(LSL_Key npc)
|
||||||
|
{
|
||||||
|
CheckThreatLevel(ThreatLevel.VeryLow, "osNpcStopMoveTo");
|
||||||
|
|
||||||
|
INPCModule module = World.RequestModuleInterface<INPCModule>();
|
||||||
|
if (module != null)
|
||||||
|
module.StopMoveToTarget(new UUID(npc.m_string), World);
|
||||||
|
}
|
||||||
|
|
||||||
public void osNpcSay(LSL_Key npc, string message)
|
public void osNpcSay(LSL_Key npc, string message)
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.High, "osNpcSay");
|
CheckThreatLevel(ThreatLevel.High, "osNpcSay");
|
||||||
|
@ -2135,6 +2352,64 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
module.DeleteNPC(new UUID(npc.m_string), World);
|
module.DeleteNPC(new UUID(npc.m_string), World);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Save the current appearance of the script owner permanently to the named notecard.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="notecard">The name of the notecard to which to save the appearance.</param>
|
||||||
|
/// <returns>The asset ID of the notecard saved.</returns>
|
||||||
|
public LSL_Key osOwnerSaveAppearance(string notecard)
|
||||||
|
{
|
||||||
|
CheckThreatLevel(ThreatLevel.High, "osOwnerSaveAppearance");
|
||||||
|
|
||||||
|
return SaveAppearanceToNotecard(m_host.OwnerID, notecard);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LSL_Key osAgentSaveAppearance(LSL_Key avatarId, string notecard)
|
||||||
|
{
|
||||||
|
CheckThreatLevel(ThreatLevel.VeryHigh, "osAgentSaveAppearance");
|
||||||
|
|
||||||
|
return SaveAppearanceToNotecard(avatarId, notecard);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected LSL_Key SaveAppearanceToNotecard(ScenePresence sp, string notecard)
|
||||||
|
{
|
||||||
|
IAvatarFactory appearanceModule = World.RequestModuleInterface<IAvatarFactory>();
|
||||||
|
|
||||||
|
if (appearanceModule != null)
|
||||||
|
{
|
||||||
|
appearanceModule.SaveBakedTextures(sp.UUID);
|
||||||
|
OSDMap appearancePacked = sp.Appearance.Pack();
|
||||||
|
|
||||||
|
TaskInventoryItem item
|
||||||
|
= SaveNotecard(notecard, "Avatar Appearance", Util.GetFormattedXml(appearancePacked as OSD), true);
|
||||||
|
|
||||||
|
return new LSL_Key(item.AssetID.ToString());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return new LSL_Key(UUID.Zero.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected LSL_Key SaveAppearanceToNotecard(UUID avatarId, string notecard)
|
||||||
|
{
|
||||||
|
ScenePresence sp = World.GetScenePresence(avatarId);
|
||||||
|
|
||||||
|
if (sp == null || sp.IsChildAgent)
|
||||||
|
return new LSL_Key(UUID.Zero.ToString());
|
||||||
|
|
||||||
|
return SaveAppearanceToNotecard(sp, notecard);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected LSL_Key SaveAppearanceToNotecard(LSL_Key rawAvatarId, string notecard)
|
||||||
|
{
|
||||||
|
UUID avatarId;
|
||||||
|
if (!UUID.TryParse(rawAvatarId, out avatarId))
|
||||||
|
return new LSL_Key(UUID.Zero.ToString());
|
||||||
|
|
||||||
|
return SaveAppearanceToNotecard(avatarId, notecard);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get current region's map texture UUID
|
/// Get current region's map texture UUID
|
||||||
|
@ -2344,10 +2619,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
obj.Shape.ProjectionFocus = (float)focus;
|
obj.Shape.ProjectionFocus = (float)focus;
|
||||||
obj.Shape.ProjectionAmbiance = (float)amb;
|
obj.Shape.ProjectionAmbiance = (float)amb;
|
||||||
|
|
||||||
|
|
||||||
obj.ParentGroup.HasGroupChanged = true;
|
obj.ParentGroup.HasGroupChanged = true;
|
||||||
obj.ScheduleFullUpdate();
|
obj.ScheduleFullUpdate();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -2372,6 +2645,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2391,4 +2665,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return date.ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ");
|
return date.ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -168,12 +168,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||||
|
|
||||||
LSL_List osGetLinkPrimitiveParams(int linknumber, LSL_List rules);
|
LSL_List osGetLinkPrimitiveParams(int linknumber, LSL_List rules);
|
||||||
|
|
||||||
|
key osNpcCreate(string user, string name, vector position, string notecard);
|
||||||
key osNpcCreate(string user, string name, vector position, key cloneFrom);
|
LSL_Key osNpcSaveAppearance(key npc, string notecard);
|
||||||
|
void osNpcLoadAppearance(key npc, string notecard);
|
||||||
|
vector osNpcGetPos(key npc);
|
||||||
void osNpcMoveTo(key npc, vector position);
|
void osNpcMoveTo(key npc, vector position);
|
||||||
|
void osNpcMoveToTarget(key npc, vector target, int options);
|
||||||
|
rotation osNpcGetRot(key npc);
|
||||||
|
void osNpcSetRot(LSL_Key npc, rotation rot);
|
||||||
|
void osNpcStopMoveToTarget(LSL_Key npc);
|
||||||
void osNpcSay(key npc, string message);
|
void osNpcSay(key npc, string message);
|
||||||
void osNpcRemove(key npc);
|
void osNpcRemove(key npc);
|
||||||
|
|
||||||
|
LSL_Key osOwnerSaveAppearance(string notecard);
|
||||||
|
LSL_Key osAgentSaveAppearance(key agentId, string notecard);
|
||||||
|
|
||||||
key osGetMapTexture();
|
key osGetMapTexture();
|
||||||
key osGetRegionMapTexture(string regionName);
|
key osGetRegionMapTexture(string regionName);
|
||||||
LSL_List osGetRegionStats();
|
LSL_List osGetRegionStats();
|
||||||
|
|
|
@ -591,6 +591,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
public const int STATS_ACTIVE_SCRIPTS = 19;
|
public const int STATS_ACTIVE_SCRIPTS = 19;
|
||||||
public const int STATS_SCRIPT_LPS = 20;
|
public const int STATS_SCRIPT_LPS = 20;
|
||||||
|
|
||||||
|
// Constants for osNpc* functions
|
||||||
|
public const int OS_NPC_FLY = 0;
|
||||||
|
public const int OS_NPC_NO_FLY = 1;
|
||||||
|
public const int OS_NPC_LAND_AT_TARGET = 2;
|
||||||
|
|
||||||
public const string URL_REQUEST_GRANTED = "URL_REQUEST_GRANTED";
|
public const string URL_REQUEST_GRANTED = "URL_REQUEST_GRANTED";
|
||||||
public const string URL_REQUEST_DENIED = "URL_REQUEST_DENIED";
|
public const string URL_REQUEST_DENIED = "URL_REQUEST_DENIED";
|
||||||
|
|
||||||
|
|
|
@ -483,11 +483,46 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
return m_OSSL_Functions.osNpcCreate(user, name, position, cloneFrom);
|
return m_OSSL_Functions.osNpcCreate(user, name, position, cloneFrom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public key osNpcSaveAppearance(key npc, string notecard)
|
||||||
|
{
|
||||||
|
return m_OSSL_Functions.osNpcSaveAppearance(npc, notecard);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void osNpcLoadAppearance(key npc, string notecard)
|
||||||
|
{
|
||||||
|
m_OSSL_Functions.osNpcLoadAppearance(npc, notecard);
|
||||||
|
}
|
||||||
|
|
||||||
|
public vector osNpcGetPos(LSL_Key npc)
|
||||||
|
{
|
||||||
|
return m_OSSL_Functions.osNpcGetPos(npc);
|
||||||
|
}
|
||||||
|
|
||||||
public void osNpcMoveTo(key npc, vector position)
|
public void osNpcMoveTo(key npc, vector position)
|
||||||
{
|
{
|
||||||
m_OSSL_Functions.osNpcMoveTo(npc, position);
|
m_OSSL_Functions.osNpcMoveTo(npc, position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void osNpcMoveToTarget(key npc, vector target, int options)
|
||||||
|
{
|
||||||
|
m_OSSL_Functions.osNpcMoveToTarget(npc, target, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
public rotation osNpcGetRot(key npc)
|
||||||
|
{
|
||||||
|
return m_OSSL_Functions.osNpcGetRot(npc);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void osNpcSetRot(key npc, rotation rot)
|
||||||
|
{
|
||||||
|
m_OSSL_Functions.osNpcSetRot(npc, rot);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void osNpcStopMoveToTarget(LSL_Key npc)
|
||||||
|
{
|
||||||
|
m_OSSL_Functions.osNpcStopMoveToTarget(npc);
|
||||||
|
}
|
||||||
|
|
||||||
public void osNpcSay(key npc, string message)
|
public void osNpcSay(key npc, string message)
|
||||||
{
|
{
|
||||||
m_OSSL_Functions.osNpcSay(npc, message);
|
m_OSSL_Functions.osNpcSay(npc, message);
|
||||||
|
@ -498,6 +533,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
m_OSSL_Functions.osNpcRemove(npc);
|
m_OSSL_Functions.osNpcRemove(npc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LSL_Key osOwnerSaveAppearance(string notecard)
|
||||||
|
{
|
||||||
|
return m_OSSL_Functions.osOwnerSaveAppearance(notecard);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LSL_Key osAgentSaveAppearance(LSL_Key agentId, string notecard)
|
||||||
|
{
|
||||||
|
return m_OSSL_Functions.osAgentSaveAppearance(agentId, notecard);
|
||||||
|
}
|
||||||
|
|
||||||
public OSSLPrim Prim;
|
public OSSLPrim Prim;
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
|
|
|
@ -27,11 +27,13 @@
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
using OpenSim.Framework;
|
||||||
using OpenSim.Tests.Common;
|
using OpenSim.Tests.Common;
|
||||||
using OpenSim.Region.ScriptEngine.Shared;
|
using OpenSim.Region.ScriptEngine.Shared;
|
||||||
using OpenSim.Region.Framework.Scenes;
|
using OpenSim.Region.Framework.Scenes;
|
||||||
using Nini.Config;
|
using Nini.Config;
|
||||||
using OpenSim.Region.ScriptEngine.Shared.Api;
|
using OpenSim.Region.ScriptEngine.Shared.Api;
|
||||||
|
using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
using System;
|
using System;
|
||||||
using OpenSim.Tests.Common.Mock;
|
using OpenSim.Tests.Common.Mock;
|
||||||
|
@ -47,6 +49,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
|
|
||||||
private const double ANGLE_ACCURACY_IN_RADIANS = 1E-6;
|
private const double ANGLE_ACCURACY_IN_RADIANS = 1E-6;
|
||||||
private const double VECTOR_COMPONENT_ACCURACY = 0.0000005d;
|
private const double VECTOR_COMPONENT_ACCURACY = 0.0000005d;
|
||||||
|
private const double FLOAT_ACCURACY = 0.00005d;
|
||||||
private LSL_Api m_lslApi;
|
private LSL_Api m_lslApi;
|
||||||
|
|
||||||
[SetUp]
|
[SetUp]
|
||||||
|
@ -57,8 +60,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
IConfig config = initConfigSource.AddConfig("XEngine");
|
IConfig config = initConfigSource.AddConfig("XEngine");
|
||||||
config.Set("Enabled", "true");
|
config.Set("Enabled", "true");
|
||||||
|
|
||||||
Scene scene = SceneSetupHelpers.SetupScene();
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene);
|
SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
|
||||||
|
|
||||||
XEngine.XEngine engine = new XEngine.XEngine();
|
XEngine.XEngine engine = new XEngine.XEngine();
|
||||||
engine.Initialise(initConfigSource);
|
engine.Initialise(initConfigSource);
|
||||||
|
@ -165,6 +168,178 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
Assert.Less(eulerCalc.z, eulerCheck.z + ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Z upper bounds check fail");
|
Assert.Less(eulerCalc.z, eulerCheck.z + ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Z upper bounds check fail");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
// llSetPrimitiveParams and llGetPrimitiveParams test.
|
||||||
|
public void TestllSetPrimitiveParams()
|
||||||
|
{
|
||||||
|
// Create Prim1.
|
||||||
|
Scene scene = SceneHelpers.SetupScene();
|
||||||
|
string obj1Name = "Prim1";
|
||||||
|
UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001");
|
||||||
|
SceneObjectPart part1 =
|
||||||
|
new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default,
|
||||||
|
Vector3.Zero, Quaternion.Identity,
|
||||||
|
Vector3.Zero) { Name = obj1Name, UUID = objUuid };
|
||||||
|
Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part1), false), Is.True);
|
||||||
|
|
||||||
|
// Test a sphere.
|
||||||
|
CheckllSetPrimitiveParams(
|
||||||
|
"test 1", // Prim test identification string
|
||||||
|
new LSL_Types.Vector3(6.0d, 9.9d, 9.9d), // Prim size
|
||||||
|
ScriptBaseClass.PRIM_TYPE_SPHERE, // Prim type
|
||||||
|
ScriptBaseClass.PRIM_HOLE_DEFAULT, // Prim hole type
|
||||||
|
new LSL_Types.Vector3(0.0d, 0.075d, 0.0d), // Prim cut
|
||||||
|
0.80d, // Prim hollow
|
||||||
|
new LSL_Types.Vector3(0.0d, 0.0d, 0.0d), // Prim twist
|
||||||
|
new LSL_Types.Vector3(0.32d, 0.76d, 0.0d)); // Prim dimple
|
||||||
|
|
||||||
|
// Test a prism.
|
||||||
|
CheckllSetPrimitiveParams(
|
||||||
|
"test 2", // Prim test identification string
|
||||||
|
new LSL_Types.Vector3(3.5d, 3.5d, 3.5d), // Prim size
|
||||||
|
ScriptBaseClass.PRIM_TYPE_PRISM, // Prim type
|
||||||
|
ScriptBaseClass.PRIM_HOLE_CIRCLE, // Prim hole type
|
||||||
|
new LSL_Types.Vector3(0.0d, 1.0d, 0.0d), // Prim cut
|
||||||
|
0.90d, // Prim hollow
|
||||||
|
new LSL_Types.Vector3(0.0d, 0.0d, 0.0d), // Prim twist
|
||||||
|
new LSL_Types.Vector3(2.0d, 1.0d, 0.0d), // Prim taper
|
||||||
|
new LSL_Types.Vector3(0.0d, 0.0d, 0.0d)); // Prim shear
|
||||||
|
|
||||||
|
// Test a box.
|
||||||
|
CheckllSetPrimitiveParams(
|
||||||
|
"test 3", // Prim test identification string
|
||||||
|
new LSL_Types.Vector3(3.5d, 3.5d, 3.5d), // Prim size
|
||||||
|
ScriptBaseClass.PRIM_TYPE_BOX, // Prim type
|
||||||
|
ScriptBaseClass.PRIM_HOLE_TRIANGLE, // Prim hole type
|
||||||
|
new LSL_Types.Vector3(0.0d, 1.0d, 0.0d), // Prim cut
|
||||||
|
0.90d, // Prim hollow
|
||||||
|
new LSL_Types.Vector3(1.0d, 0.0d, 0.0d), // Prim twist
|
||||||
|
new LSL_Types.Vector3(1.0d, 1.0d, 0.0d), // Prim taper
|
||||||
|
new LSL_Types.Vector3(0.0d, 0.0d, 0.0d)); // Prim shear
|
||||||
|
|
||||||
|
// Test a tube.
|
||||||
|
CheckllSetPrimitiveParams(
|
||||||
|
"test 4", // Prim test identification string
|
||||||
|
new LSL_Types.Vector3(4.2d, 4.2d, 4.2d), // Prim size
|
||||||
|
ScriptBaseClass.PRIM_TYPE_TUBE, // Prim type
|
||||||
|
ScriptBaseClass.PRIM_HOLE_SQUARE, // Prim hole type
|
||||||
|
new LSL_Types.Vector3(0.0d, 1.0d, 0.0d), // Prim cut
|
||||||
|
0.00d, // Prim hollow
|
||||||
|
new LSL_Types.Vector3(1.0d, -1.0d, 0.0d), // Prim twist
|
||||||
|
new LSL_Types.Vector3(1.0d, 0.5d, 0.0d), // Prim hole size
|
||||||
|
new LSL_Types.Vector3(0.0d, 0.0d, 0.0d), // Prim shear
|
||||||
|
new LSL_Types.Vector3(0.0d, 1.0d, 0.0d), // Prim profile cut
|
||||||
|
new LSL_Types.Vector3(-1.0d, 1.0d, 0.0d), // Prim taper
|
||||||
|
1.0d, // Prim revolutions
|
||||||
|
1.0d, // Prim radius
|
||||||
|
0.0d); // Prim skew
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set prim params for a box, cylinder or prism and check results.
|
||||||
|
public void CheckllSetPrimitiveParams(string primTest,
|
||||||
|
LSL_Types.Vector3 primSize, int primType, int primHoleType, LSL_Types.Vector3 primCut,
|
||||||
|
double primHollow, LSL_Types.Vector3 primTwist, LSL_Types.Vector3 primTaper, LSL_Types.Vector3 primShear)
|
||||||
|
{
|
||||||
|
// Set the prim params.
|
||||||
|
m_lslApi.llSetPrimitiveParams(new LSL_Types.list(ScriptBaseClass.PRIM_SIZE, primSize,
|
||||||
|
ScriptBaseClass.PRIM_TYPE, primType, primHoleType,
|
||||||
|
primCut, primHollow, primTwist, primTaper, primShear));
|
||||||
|
|
||||||
|
// Get params for prim to validate settings.
|
||||||
|
LSL_Types.list primParams =
|
||||||
|
m_lslApi.llGetPrimitiveParams(new LSL_Types.list(ScriptBaseClass.PRIM_SIZE, ScriptBaseClass.PRIM_TYPE));
|
||||||
|
|
||||||
|
// Validate settings.
|
||||||
|
CheckllSetPrimitiveParamsVector(primSize, m_lslApi.llList2Vector(primParams, 0), primTest + " prim size");
|
||||||
|
Assert.AreEqual(primType, m_lslApi.llList2Integer(primParams, 1),
|
||||||
|
"TestllSetPrimitiveParams " + primTest + " prim type check fail");
|
||||||
|
Assert.AreEqual(primHoleType, m_lslApi.llList2Integer(primParams, 2),
|
||||||
|
"TestllSetPrimitiveParams " + primTest + " prim hole default check fail");
|
||||||
|
CheckllSetPrimitiveParamsVector(primCut, m_lslApi.llList2Vector(primParams, 3), primTest + " prim cut");
|
||||||
|
Assert.AreEqual(primHollow, m_lslApi.llList2Float(primParams, 4), FLOAT_ACCURACY,
|
||||||
|
"TestllSetPrimitiveParams " + primTest + " prim hollow check fail");
|
||||||
|
CheckllSetPrimitiveParamsVector(primTwist, m_lslApi.llList2Vector(primParams, 5), primTest + " prim twist");
|
||||||
|
CheckllSetPrimitiveParamsVector(primTaper, m_lslApi.llList2Vector(primParams, 6), primTest + " prim taper");
|
||||||
|
CheckllSetPrimitiveParamsVector(primShear, m_lslApi.llList2Vector(primParams, 7), primTest + " prim shear");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set prim params for a sphere and check results.
|
||||||
|
public void CheckllSetPrimitiveParams(string primTest,
|
||||||
|
LSL_Types.Vector3 primSize, int primType, int primHoleType, LSL_Types.Vector3 primCut,
|
||||||
|
double primHollow, LSL_Types.Vector3 primTwist, LSL_Types.Vector3 primDimple)
|
||||||
|
{
|
||||||
|
// Set the prim params.
|
||||||
|
m_lslApi.llSetPrimitiveParams(new LSL_Types.list(ScriptBaseClass.PRIM_SIZE, primSize,
|
||||||
|
ScriptBaseClass.PRIM_TYPE, primType, primHoleType,
|
||||||
|
primCut, primHollow, primTwist, primDimple));
|
||||||
|
|
||||||
|
// Get params for prim to validate settings.
|
||||||
|
LSL_Types.list primParams =
|
||||||
|
m_lslApi.llGetPrimitiveParams(new LSL_Types.list(ScriptBaseClass.PRIM_SIZE, ScriptBaseClass.PRIM_TYPE));
|
||||||
|
|
||||||
|
// Validate settings.
|
||||||
|
CheckllSetPrimitiveParamsVector(primSize, m_lslApi.llList2Vector(primParams, 0), primTest + " prim size");
|
||||||
|
Assert.AreEqual(primType, m_lslApi.llList2Integer(primParams, 1),
|
||||||
|
"TestllSetPrimitiveParams " + primTest + " prim type check fail");
|
||||||
|
Assert.AreEqual(primHoleType, m_lslApi.llList2Integer(primParams, 2),
|
||||||
|
"TestllSetPrimitiveParams " + primTest + " prim hole default check fail");
|
||||||
|
CheckllSetPrimitiveParamsVector(primCut, m_lslApi.llList2Vector(primParams, 3), primTest + " prim cut");
|
||||||
|
Assert.AreEqual(primHollow, m_lslApi.llList2Float(primParams, 4), FLOAT_ACCURACY,
|
||||||
|
"TestllSetPrimitiveParams " + primTest + " prim hollow check fail");
|
||||||
|
CheckllSetPrimitiveParamsVector(primTwist, m_lslApi.llList2Vector(primParams, 5), primTest + " prim twist");
|
||||||
|
CheckllSetPrimitiveParamsVector(primDimple, m_lslApi.llList2Vector(primParams, 6), primTest + " prim dimple");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set prim params for a torus, tube or ring and check results.
|
||||||
|
public void CheckllSetPrimitiveParams(string primTest,
|
||||||
|
LSL_Types.Vector3 primSize, int primType, int primHoleType, LSL_Types.Vector3 primCut,
|
||||||
|
double primHollow, LSL_Types.Vector3 primTwist, LSL_Types.Vector3 primHoleSize,
|
||||||
|
LSL_Types.Vector3 primShear, LSL_Types.Vector3 primProfCut, LSL_Types.Vector3 primTaper,
|
||||||
|
double primRev, double primRadius, double primSkew)
|
||||||
|
{
|
||||||
|
// Set the prim params.
|
||||||
|
m_lslApi.llSetPrimitiveParams(new LSL_Types.list(ScriptBaseClass.PRIM_SIZE, primSize,
|
||||||
|
ScriptBaseClass.PRIM_TYPE, primType, primHoleType,
|
||||||
|
primCut, primHollow, primTwist, primHoleSize, primShear, primProfCut,
|
||||||
|
primTaper, primRev, primRadius, primSkew));
|
||||||
|
|
||||||
|
// Get params for prim to validate settings.
|
||||||
|
LSL_Types.list primParams =
|
||||||
|
m_lslApi.llGetPrimitiveParams(new LSL_Types.list(ScriptBaseClass.PRIM_SIZE, ScriptBaseClass.PRIM_TYPE));
|
||||||
|
|
||||||
|
// Valdate settings.
|
||||||
|
CheckllSetPrimitiveParamsVector(primSize, m_lslApi.llList2Vector(primParams, 0), primTest + " prim size");
|
||||||
|
Assert.AreEqual(primType, m_lslApi.llList2Integer(primParams, 1),
|
||||||
|
"TestllSetPrimitiveParams " + primTest + " prim type check fail");
|
||||||
|
Assert.AreEqual(primHoleType, m_lslApi.llList2Integer(primParams, 2),
|
||||||
|
"TestllSetPrimitiveParams " + primTest + " prim hole default check fail");
|
||||||
|
CheckllSetPrimitiveParamsVector(primCut, m_lslApi.llList2Vector(primParams, 3), primTest + " prim cut");
|
||||||
|
Assert.AreEqual(primHollow, m_lslApi.llList2Float(primParams, 4), FLOAT_ACCURACY,
|
||||||
|
"TestllSetPrimitiveParams " + primTest + " prim hollow check fail");
|
||||||
|
CheckllSetPrimitiveParamsVector(primTwist, m_lslApi.llList2Vector(primParams, 5), primTest + " prim twist");
|
||||||
|
CheckllSetPrimitiveParamsVector(primHoleSize, m_lslApi.llList2Vector(primParams, 6), primTest + " prim hole size");
|
||||||
|
CheckllSetPrimitiveParamsVector(primShear, m_lslApi.llList2Vector(primParams, 7), primTest + " prim shear");
|
||||||
|
CheckllSetPrimitiveParamsVector(primProfCut, m_lslApi.llList2Vector(primParams, 8), primTest + " prim profile cut");
|
||||||
|
CheckllSetPrimitiveParamsVector(primTaper, m_lslApi.llList2Vector(primParams, 9), primTest + " prim taper");
|
||||||
|
Assert.AreEqual(primRev, m_lslApi.llList2Float(primParams, 10), FLOAT_ACCURACY,
|
||||||
|
"TestllSetPrimitiveParams " + primTest + " prim revolution fail");
|
||||||
|
Assert.AreEqual(primRadius, m_lslApi.llList2Float(primParams, 11), FLOAT_ACCURACY,
|
||||||
|
"TestllSetPrimitiveParams " + primTest + " prim radius fail");
|
||||||
|
Assert.AreEqual(primSkew, m_lslApi.llList2Float(primParams, 12), FLOAT_ACCURACY,
|
||||||
|
"TestllSetPrimitiveParams " + primTest + " prim skew fail");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CheckllSetPrimitiveParamsVector(LSL_Types.Vector3 vecCheck, LSL_Types.Vector3 vecReturned, string msg)
|
||||||
|
{
|
||||||
|
// Check each vector component against expected result.
|
||||||
|
Assert.AreEqual(vecCheck.x, vecReturned.x, VECTOR_COMPONENT_ACCURACY,
|
||||||
|
"TestllSetPrimitiveParams " + msg + " vector check fail on x component");
|
||||||
|
Assert.AreEqual(vecCheck.y, vecReturned.y, VECTOR_COMPONENT_ACCURACY,
|
||||||
|
"TestllSetPrimitiveParams " + msg + " vector check fail on y component");
|
||||||
|
Assert.AreEqual(vecCheck.z, vecReturned.z, VECTOR_COMPONENT_ACCURACY,
|
||||||
|
"TestllSetPrimitiveParams " + msg + " vector check fail on z component");
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
// llVecNorm test.
|
// llVecNorm test.
|
||||||
public void TestllVecNorm()
|
public void TestllVecNorm()
|
||||||
|
|
|
@ -0,0 +1,229 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) Contributors, http://opensimulator.org/
|
||||||
|
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of the OpenSimulator Project nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Text;
|
||||||
|
using log4net;
|
||||||
|
using Nini.Config;
|
||||||
|
using NUnit.Framework;
|
||||||
|
using OpenMetaverse;
|
||||||
|
using OpenMetaverse.Assets;
|
||||||
|
using OpenMetaverse.StructuredData;
|
||||||
|
using OpenSim.Framework;
|
||||||
|
using OpenSim.Region.CoreModules.Avatar.AvatarFactory;
|
||||||
|
using OpenSim.Region.OptionalModules.World.NPC;
|
||||||
|
using OpenSim.Region.Framework.Scenes;
|
||||||
|
using OpenSim.Region.ScriptEngine.Shared;
|
||||||
|
using OpenSim.Region.ScriptEngine.Shared.Api;
|
||||||
|
using OpenSim.Services.Interfaces;
|
||||||
|
using OpenSim.Tests.Common;
|
||||||
|
using OpenSim.Tests.Common.Mock;
|
||||||
|
|
||||||
|
namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Tests for OSSL_Api
|
||||||
|
/// </summary>
|
||||||
|
[TestFixture]
|
||||||
|
public class OSSL_ApiAppearanceTest
|
||||||
|
{
|
||||||
|
protected Scene m_scene;
|
||||||
|
protected XEngine.XEngine m_engine;
|
||||||
|
|
||||||
|
[SetUp]
|
||||||
|
public void SetUp()
|
||||||
|
{
|
||||||
|
IConfigSource initConfigSource = new IniConfigSource();
|
||||||
|
IConfig config = initConfigSource.AddConfig("XEngine");
|
||||||
|
config.Set("Enabled", "true");
|
||||||
|
config.Set("AllowOSFunctions", "true");
|
||||||
|
config.Set("OSFunctionThreatLevel", "Severe");
|
||||||
|
config = initConfigSource.AddConfig("NPC");
|
||||||
|
config.Set("Enabled", "true");
|
||||||
|
|
||||||
|
m_scene = SceneHelpers.SetupScene();
|
||||||
|
SceneHelpers.SetupSceneModules(m_scene, initConfigSource, new AvatarFactoryModule(), new NPCModule());
|
||||||
|
|
||||||
|
m_engine = new XEngine.XEngine();
|
||||||
|
m_engine.Initialise(initConfigSource);
|
||||||
|
m_engine.AddRegion(m_scene);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test creation of an NPC where the appearance data comes from a notecard
|
||||||
|
/// </summary>
|
||||||
|
[Test]
|
||||||
|
public void TestOsNpcCreateFromNotecard()
|
||||||
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
|
// Store an avatar with a different height from default in a notecard.
|
||||||
|
UUID userId = TestHelpers.ParseTail(0x1);
|
||||||
|
float newHeight = 1.9f;
|
||||||
|
|
||||||
|
ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, userId);
|
||||||
|
sp.Appearance.AvatarHeight = newHeight;
|
||||||
|
SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, userId);
|
||||||
|
SceneObjectPart part = so.RootPart;
|
||||||
|
m_scene.AddSceneObject(so);
|
||||||
|
|
||||||
|
OSSL_Api osslApi = new OSSL_Api();
|
||||||
|
osslApi.Initialize(m_engine, part, part.LocalId, part.UUID);
|
||||||
|
|
||||||
|
string notecardName = "appearanceNc";
|
||||||
|
osslApi.osOwnerSaveAppearance(notecardName);
|
||||||
|
|
||||||
|
// Try creating a bot using the appearance in the notecard.
|
||||||
|
string npcRaw = osslApi.osNpcCreate("Jane", "Doe", new LSL_Types.Vector3(128, 128, 128), notecardName);
|
||||||
|
Assert.That(npcRaw, Is.Not.Null);
|
||||||
|
|
||||||
|
UUID npcId = new UUID(npcRaw);
|
||||||
|
ScenePresence npc = m_scene.GetScenePresence(npcId);
|
||||||
|
Assert.That(npc, Is.Not.Null);
|
||||||
|
Assert.That(npc.Appearance.AvatarHeight, Is.EqualTo(newHeight));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Test creation of an NPC where the appearance data comes from an avatar already in the region.
|
||||||
|
/// </summary>
|
||||||
|
[Test]
|
||||||
|
public void TestOsNpcCreateFromAvatar()
|
||||||
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
|
// Store an avatar with a different height from default in a notecard.
|
||||||
|
UUID userId = TestHelpers.ParseTail(0x1);
|
||||||
|
float newHeight = 1.9f;
|
||||||
|
|
||||||
|
ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, userId);
|
||||||
|
sp.Appearance.AvatarHeight = newHeight;
|
||||||
|
SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, userId);
|
||||||
|
SceneObjectPart part = so.RootPart;
|
||||||
|
m_scene.AddSceneObject(so);
|
||||||
|
|
||||||
|
OSSL_Api osslApi = new OSSL_Api();
|
||||||
|
osslApi.Initialize(m_engine, part, part.LocalId, part.UUID);
|
||||||
|
|
||||||
|
string notecardName = "appearanceNc";
|
||||||
|
osslApi.osOwnerSaveAppearance(notecardName);
|
||||||
|
|
||||||
|
// Try creating a bot using the existing avatar's appearance
|
||||||
|
string npcRaw = osslApi.osNpcCreate("Jane", "Doe", new LSL_Types.Vector3(128, 128, 128), sp.UUID.ToString());
|
||||||
|
Assert.That(npcRaw, Is.Not.Null);
|
||||||
|
|
||||||
|
UUID npcId = new UUID(npcRaw);
|
||||||
|
ScenePresence npc = m_scene.GetScenePresence(npcId);
|
||||||
|
Assert.That(npc, Is.Not.Null);
|
||||||
|
Assert.That(npc.Appearance.AvatarHeight, Is.EqualTo(newHeight));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestOsOwnerSaveAppearance()
|
||||||
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
|
UUID userId = TestHelpers.ParseTail(0x1);
|
||||||
|
float newHeight = 1.9f;
|
||||||
|
|
||||||
|
ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, userId);
|
||||||
|
sp.Appearance.AvatarHeight = newHeight;
|
||||||
|
SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, userId);
|
||||||
|
SceneObjectPart part = so.RootPart;
|
||||||
|
m_scene.AddSceneObject(so);
|
||||||
|
|
||||||
|
OSSL_Api osslApi = new OSSL_Api();
|
||||||
|
osslApi.Initialize(m_engine, part, part.LocalId, part.UUID);
|
||||||
|
|
||||||
|
string notecardName = "appearanceNc";
|
||||||
|
|
||||||
|
osslApi.osOwnerSaveAppearance(notecardName);
|
||||||
|
|
||||||
|
IList<TaskInventoryItem> items = part.Inventory.GetInventoryItems(notecardName);
|
||||||
|
Assert.That(items.Count, Is.EqualTo(1));
|
||||||
|
|
||||||
|
TaskInventoryItem ncItem = items[0];
|
||||||
|
Assert.That(ncItem.Name, Is.EqualTo(notecardName));
|
||||||
|
|
||||||
|
AssetBase ncAsset = m_scene.AssetService.Get(ncItem.AssetID.ToString());
|
||||||
|
Assert.That(ncAsset, Is.Not.Null);
|
||||||
|
|
||||||
|
AssetNotecard anc = new AssetNotecard(UUID.Zero, ncAsset.Data);
|
||||||
|
anc.Decode();
|
||||||
|
OSDMap appearanceOsd = (OSDMap)OSDParser.DeserializeLLSDXml(anc.BodyText);
|
||||||
|
AvatarAppearance savedAppearance = new AvatarAppearance();
|
||||||
|
savedAppearance.Unpack(appearanceOsd);
|
||||||
|
|
||||||
|
Assert.That(savedAppearance.AvatarHeight, Is.EqualTo(sp.Appearance.AvatarHeight));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestOsAgentSaveAppearance()
|
||||||
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
|
UUID ownerId = TestHelpers.ParseTail(0x1);
|
||||||
|
UUID nonOwnerId = TestHelpers.ParseTail(0x2);
|
||||||
|
float newHeight = 1.9f;
|
||||||
|
|
||||||
|
ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, nonOwnerId);
|
||||||
|
sp.Appearance.AvatarHeight = newHeight;
|
||||||
|
SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, ownerId);
|
||||||
|
SceneObjectPart part = so.RootPart;
|
||||||
|
m_scene.AddSceneObject(so);
|
||||||
|
|
||||||
|
OSSL_Api osslApi = new OSSL_Api();
|
||||||
|
osslApi.Initialize(m_engine, part, part.LocalId, part.UUID);
|
||||||
|
|
||||||
|
string notecardName = "appearanceNc";
|
||||||
|
|
||||||
|
osslApi.osAgentSaveAppearance(new LSL_Types.LSLString(nonOwnerId.ToString()), notecardName);
|
||||||
|
|
||||||
|
IList<TaskInventoryItem> items = part.Inventory.GetInventoryItems(notecardName);
|
||||||
|
Assert.That(items.Count, Is.EqualTo(1));
|
||||||
|
|
||||||
|
TaskInventoryItem ncItem = items[0];
|
||||||
|
Assert.That(ncItem.Name, Is.EqualTo(notecardName));
|
||||||
|
|
||||||
|
AssetBase ncAsset = m_scene.AssetService.Get(ncItem.AssetID.ToString());
|
||||||
|
Assert.That(ncAsset, Is.Not.Null);
|
||||||
|
|
||||||
|
AssetNotecard anc = new AssetNotecard(UUID.Zero, ncAsset.Data);
|
||||||
|
anc.Decode();
|
||||||
|
OSDMap appearanceOsd = (OSDMap)OSDParser.DeserializeLLSDXml(anc.BodyText);
|
||||||
|
AvatarAppearance savedAppearance = new AvatarAppearance();
|
||||||
|
savedAppearance.Unpack(appearanceOsd);
|
||||||
|
|
||||||
|
Assert.That(savedAppearance.AvatarHeight, Is.EqualTo(sp.Appearance.AvatarHeight));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -174,10 +174,12 @@ namespace OpenSim.Services.AssetService
|
||||||
|
|
||||||
public virtual string Store(AssetBase asset)
|
public virtual string Store(AssetBase asset)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat(
|
if (!m_Database.ExistsAsset(asset.FullID))
|
||||||
// "[ASSET SERVICE]: Storing asset {0} {1}, bytes {2}", asset.Name, asset.ID, asset.Data.Length);
|
{
|
||||||
|
// m_log.DebugFormat(
|
||||||
m_Database.StoreAsset(asset);
|
// "[ASSET SERVICE]: Storing asset {0} {1}, bytes {2}", asset.Name, asset.FullID, asset.Data.Length);
|
||||||
|
m_Database.StoreAsset(asset);
|
||||||
|
}
|
||||||
|
|
||||||
return asset.ID;
|
return asset.ID;
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.DebugFormat("[SIMIAN ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName);
|
// m_log.DebugFormat("[SIMIAN ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName);
|
||||||
m_GridUserService.LoggedOut(client.AgentId.ToString(), client.SessionId, client.Scene.RegionInfo.RegionID, position, lookat);
|
m_GridUserService.LoggedOut(client.AgentId.ToString(), client.SessionId, client.Scene.RegionInfo.RegionID, position, lookat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -510,8 +510,9 @@ namespace OpenSim.Services.GridService
|
||||||
OpenSim.Data.RegionFlags flags = (OpenSim.Data.RegionFlags)Convert.ToInt32(r.Data["flags"]);
|
OpenSim.Data.RegionFlags flags = (OpenSim.Data.RegionFlags)Convert.ToInt32(r.Data["flags"]);
|
||||||
MainConsole.Instance.Output(String.Format("{0,-20} {1}\n{2,-20} {3}\n{4,-39} {5}\n\n",
|
MainConsole.Instance.Output(String.Format("{0,-20} {1}\n{2,-20} {3}\n{4,-39} {5}\n\n",
|
||||||
r.RegionName, r.RegionID,
|
r.RegionName, r.RegionID,
|
||||||
String.Format("{0},{1}", r.posX, r.posY), r.Data["serverURI"],
|
String.Format("{0},{1}", r.posX / Constants.RegionSize, r.posY / Constants.RegionSize),
|
||||||
r.Data["owner_uuid"].ToString(), flags.ToString()));
|
r.Data["serverURI"],
|
||||||
|
r.Data["owner_uuid"], flags));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,7 +95,6 @@ namespace OpenSim.Services.HypergridService
|
||||||
m_InGatekeeper = serverConfig.GetBoolean("InGatekeeper", false);
|
m_InGatekeeper = serverConfig.GetBoolean("InGatekeeper", false);
|
||||||
m_log.DebugFormat("[HG IM SERVICE]: Starting... InRobust? {0}", m_InGatekeeper);
|
m_log.DebugFormat("[HG IM SERVICE]: Starting... InRobust? {0}", m_InGatekeeper);
|
||||||
|
|
||||||
|
|
||||||
if (gridService == string.Empty || presenceService == string.Empty)
|
if (gridService == string.Empty || presenceService == string.Empty)
|
||||||
throw new Exception(String.Format("Incomplete specifications, InstantMessage Service cannot function."));
|
throw new Exception(String.Format("Incomplete specifications, InstantMessage Service cannot function."));
|
||||||
|
|
||||||
|
@ -120,8 +119,8 @@ namespace OpenSim.Services.HypergridService
|
||||||
|
|
||||||
public bool IncomingInstantMessage(GridInstantMessage im)
|
public bool IncomingInstantMessage(GridInstantMessage im)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[HG IM SERVICE]: Received message from {0} to {1}", im.fromAgentID, im.toAgentID);
|
// m_log.DebugFormat("[HG IM SERVICE]: Received message from {0} to {1}", im.fromAgentID, im.toAgentID);
|
||||||
UUID toAgentID = new UUID(im.toAgentID);
|
// UUID toAgentID = new UUID(im.toAgentID);
|
||||||
|
|
||||||
bool success = false;
|
bool success = false;
|
||||||
if (m_IMSimConnector != null)
|
if (m_IMSimConnector != null)
|
||||||
|
@ -142,7 +141,7 @@ namespace OpenSim.Services.HypergridService
|
||||||
|
|
||||||
public bool OutgoingInstantMessage(GridInstantMessage im, string url, bool foreigner)
|
public bool OutgoingInstantMessage(GridInstantMessage im, string url, bool foreigner)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[HG IM SERVICE]: Sending message from {0} to {1}@{2}", im.fromAgentID, im.toAgentID, url);
|
// m_log.DebugFormat("[HG IM SERVICE]: Sending message from {0} to {1}@{2}", im.fromAgentID, im.toAgentID, url);
|
||||||
if (url != string.Empty)
|
if (url != string.Empty)
|
||||||
return TrySendInstantMessage(im, url, true, foreigner);
|
return TrySendInstantMessage(im, url, true, foreigner);
|
||||||
else
|
else
|
||||||
|
@ -333,7 +332,7 @@ namespace OpenSim.Services.HypergridService
|
||||||
if (m_RestURL != string.Empty && (im.offline != 0)
|
if (m_RestURL != string.Empty && (im.offline != 0)
|
||||||
&& (!im.fromGroup || (im.fromGroup && m_ForwardOfflineGroupMessages)))
|
&& (!im.fromGroup || (im.fromGroup && m_ForwardOfflineGroupMessages)))
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[HG IM SERVICE]: Message saved");
|
// m_log.DebugFormat("[HG IM SERVICE]: Message saved");
|
||||||
|
|
||||||
return SynchronousRestObjectRequester.MakeRequest<GridInstantMessage, bool>(
|
return SynchronousRestObjectRequester.MakeRequest<GridInstantMessage, bool>(
|
||||||
"POST", m_RestURL + "/SaveMessage/", im);
|
"POST", m_RestURL + "/SaveMessage/", im);
|
||||||
|
|
|
@ -56,7 +56,7 @@ namespace OpenSim.Services.Interfaces
|
||||||
byte[] GetData(string id);
|
byte[] GetData(string id);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Synchronously fetches an asset from the local cache only
|
/// Synchronously fetches an asset from the local cache only.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id">Asset ID</param>
|
/// <param name="id">Asset ID</param>
|
||||||
/// <returns>The fetched asset, or null if it did not exist in the local cache</returns>
|
/// <returns>The fetched asset, or null if it did not exist in the local cache</returns>
|
||||||
|
@ -75,7 +75,9 @@ namespace OpenSim.Services.Interfaces
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new asset
|
/// Creates a new asset
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// Returns a random ID if none is passed into it
|
/// <remarks>
|
||||||
|
/// Returns a random ID if none is passed via the asset argument.
|
||||||
|
/// </remarks>
|
||||||
/// <param name="asset"></param>
|
/// <param name="asset"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
string Store(AssetBase asset);
|
string Store(AssetBase asset);
|
||||||
|
@ -83,7 +85,9 @@ namespace OpenSim.Services.Interfaces
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update an asset's content
|
/// Update an asset's content
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
/// Attachments and bare scripts need this!!
|
/// Attachments and bare scripts need this!!
|
||||||
|
/// </remarks>
|
||||||
/// <param name="id"> </param>
|
/// <param name="id"> </param>
|
||||||
/// <param name="data"></param>
|
/// <param name="data"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
|
|
@ -183,6 +183,8 @@ namespace OpenSim.Services.LLLoginService
|
||||||
|
|
||||||
private BuddyList m_buddyList = null;
|
private BuddyList m_buddyList = null;
|
||||||
|
|
||||||
|
private string currency;
|
||||||
|
|
||||||
static LLLoginResponse()
|
static LLLoginResponse()
|
||||||
{
|
{
|
||||||
// This is being set, but it's not used
|
// This is being set, but it's not used
|
||||||
|
@ -218,7 +220,7 @@ namespace OpenSim.Services.LLLoginService
|
||||||
public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo,
|
public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo,
|
||||||
GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService,
|
GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService,
|
||||||
string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message,
|
string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message,
|
||||||
GridRegion home, IPEndPoint clientIP, string mapTileURL, string searchURL)
|
GridRegion home, IPEndPoint clientIP, string mapTileURL, string searchURL, string currency)
|
||||||
: this()
|
: this()
|
||||||
{
|
{
|
||||||
FillOutInventoryData(invSkel, libService);
|
FillOutInventoryData(invSkel, libService);
|
||||||
|
@ -236,6 +238,7 @@ namespace OpenSim.Services.LLLoginService
|
||||||
StartLocation = where;
|
StartLocation = where;
|
||||||
MapTileURL = mapTileURL;
|
MapTileURL = mapTileURL;
|
||||||
SearchURL = searchURL;
|
SearchURL = searchURL;
|
||||||
|
Currency = currency;
|
||||||
|
|
||||||
FillOutHomeData(pinfo, home);
|
FillOutHomeData(pinfo, home);
|
||||||
LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z);
|
LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z);
|
||||||
|
@ -382,6 +385,8 @@ namespace OpenSim.Services.LLLoginService
|
||||||
initialOutfit.Add(InitialOutfitHash);
|
initialOutfit.Add(InitialOutfitHash);
|
||||||
mapTileURL = String.Empty;
|
mapTileURL = String.Empty;
|
||||||
searchURL = String.Empty;
|
searchURL = String.Empty;
|
||||||
|
|
||||||
|
currency = String.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -456,6 +461,12 @@ namespace OpenSim.Services.LLLoginService
|
||||||
responseData["buddy-list"] = m_buddyList.ToArray();
|
responseData["buddy-list"] = m_buddyList.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (currency != String.Empty)
|
||||||
|
{
|
||||||
|
// responseData["real_currency"] = currency;
|
||||||
|
responseData["currency"] = currency;
|
||||||
|
}
|
||||||
|
|
||||||
responseData["login"] = "true";
|
responseData["login"] = "true";
|
||||||
|
|
||||||
return responseData;
|
return responseData;
|
||||||
|
@ -940,6 +951,12 @@ namespace OpenSim.Services.LLLoginService
|
||||||
set { m_buddyList = value; }
|
set { m_buddyList = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string Currency
|
||||||
|
{
|
||||||
|
get { return currency; }
|
||||||
|
set { currency = value; }
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public class UserInfo
|
public class UserInfo
|
||||||
|
|
|
@ -75,6 +75,7 @@ namespace OpenSim.Services.LLLoginService
|
||||||
protected bool m_AllowRemoteSetLoginLevel;
|
protected bool m_AllowRemoteSetLoginLevel;
|
||||||
protected string m_MapTileURL;
|
protected string m_MapTileURL;
|
||||||
protected string m_SearchURL;
|
protected string m_SearchURL;
|
||||||
|
protected string m_Currency;
|
||||||
|
|
||||||
protected string m_AllowedClients;
|
protected string m_AllowedClients;
|
||||||
protected string m_DeniedClients;
|
protected string m_DeniedClients;
|
||||||
|
@ -108,6 +109,7 @@ namespace OpenSim.Services.LLLoginService
|
||||||
m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty);
|
m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty);
|
||||||
m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty);
|
m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty);
|
||||||
m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty);
|
m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty);
|
||||||
|
m_Currency = m_LoginServerConfig.GetString("Currency", string.Empty);
|
||||||
|
|
||||||
m_AllowedClients = m_LoginServerConfig.GetString("AllowedClients", string.Empty);
|
m_AllowedClients = m_LoginServerConfig.GetString("AllowedClients", string.Empty);
|
||||||
m_DeniedClients = m_LoginServerConfig.GetString("DeniedClients", string.Empty);
|
m_DeniedClients = m_LoginServerConfig.GetString("DeniedClients", string.Empty);
|
||||||
|
@ -408,7 +410,7 @@ namespace OpenSim.Services.LLLoginService
|
||||||
// Finally, fill out the response and return it
|
// Finally, fill out the response and return it
|
||||||
//
|
//
|
||||||
LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService,
|
LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService,
|
||||||
where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL, m_SearchURL);
|
where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL, m_SearchURL, m_Currency);
|
||||||
|
|
||||||
m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client.");
|
m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client.");
|
||||||
return response;
|
return response;
|
||||||
|
|
|
@ -54,7 +54,7 @@ namespace OpenSim.Tests.Common
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helpers for setting up scenes.
|
/// Helpers for setting up scenes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class SceneSetupHelpers
|
public class SceneHelpers
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set up a test scene
|
/// Set up a test scene
|
||||||
|
@ -331,6 +331,7 @@ namespace OpenSim.Tests.Common
|
||||||
agentData.InventoryFolder = UUID.Zero;
|
agentData.InventoryFolder = UUID.Zero;
|
||||||
agentData.startpos = Vector3.Zero;
|
agentData.startpos = Vector3.Zero;
|
||||||
agentData.CapsPath = "http://wibble.com";
|
agentData.CapsPath = "http://wibble.com";
|
||||||
|
agentData.ServiceURLs = new Dictionary<string, object>();
|
||||||
|
|
||||||
return agentData;
|
return agentData;
|
||||||
}
|
}
|
||||||
|
@ -341,9 +342,9 @@ namespace OpenSim.Tests.Common
|
||||||
/// <param name="scene"></param>
|
/// <param name="scene"></param>
|
||||||
/// <param name="agentId"></param>
|
/// <param name="agentId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static TestClient AddClient(Scene scene, UUID agentId)
|
public static ScenePresence AddScenePresence(Scene scene, UUID agentId)
|
||||||
{
|
{
|
||||||
return AddClient(scene, GenerateAgentData(agentId));
|
return AddScenePresence(scene, GenerateAgentData(agentId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -364,7 +365,7 @@ namespace OpenSim.Tests.Common
|
||||||
/// <param name="scene"></param>
|
/// <param name="scene"></param>
|
||||||
/// <param name="agentData"></param>
|
/// <param name="agentData"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static TestClient AddClient(Scene scene, AgentCircuitData agentData)
|
public static ScenePresence AddScenePresence(Scene scene, AgentCircuitData agentData)
|
||||||
{
|
{
|
||||||
string reason;
|
string reason;
|
||||||
|
|
||||||
|
@ -379,14 +380,14 @@ namespace OpenSim.Tests.Common
|
||||||
|
|
||||||
// Stage 2: add the new client as a child agent to the scene
|
// Stage 2: add the new client as a child agent to the scene
|
||||||
TestClient client = new TestClient(agentData, scene);
|
TestClient client = new TestClient(agentData, scene);
|
||||||
scene.AddNewClient(client);
|
scene.AddNewClient(client, PresenceType.User);
|
||||||
|
|
||||||
// Stage 3: Complete the entrance into the region. This converts the child agent into a root agent.
|
// Stage 3: Complete the entrance into the region. This converts the child agent into a root agent.
|
||||||
ScenePresence scp = scene.GetScenePresence(agentData.AgentID);
|
ScenePresence scp = scene.GetScenePresence(agentData.AgentID);
|
||||||
scp.CompleteMovement(client);
|
scp.CompleteMovement(client, true);
|
||||||
//scp.MakeRootAgent(new Vector3(90, 90, 90), true);
|
//scp.MakeRootAgent(new Vector3(90, 90, 90), true);
|
||||||
|
|
||||||
return client;
|
return scp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
|
@ -74,7 +74,7 @@ namespace OpenSim.Tests.Common
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
public static TaskInventoryItem AddSceneObject(Scene scene, SceneObjectPart sop, string itemName, UUID id)
|
public static TaskInventoryItem AddSceneObject(Scene scene, SceneObjectPart sop, string itemName, UUID id)
|
||||||
{
|
{
|
||||||
SceneObjectGroup taskSceneObject = SceneSetupHelpers.CreateSceneObject(1, UUID.Zero);
|
SceneObjectGroup taskSceneObject = SceneHelpers.CreateSceneObject(1, UUID.Zero);
|
||||||
AssetBase taskSceneObjectAsset = AssetHelpers.CreateAsset(0x10, taskSceneObject);
|
AssetBase taskSceneObjectAsset = AssetHelpers.CreateAsset(0x10, taskSceneObject);
|
||||||
scene.AssetService.Store(taskSceneObjectAsset);
|
scene.AssetService.Store(taskSceneObjectAsset);
|
||||||
TaskInventoryItem taskSceneObjectItem
|
TaskInventoryItem taskSceneObjectItem
|
||||||
|
|
|
@ -118,13 +118,12 @@ namespace OpenSim.Tests.Common
|
||||||
|
|
||||||
public static UserAccount CreateUserWithInventory(Scene scene)
|
public static UserAccount CreateUserWithInventory(Scene scene)
|
||||||
{
|
{
|
||||||
return CreateUserWithInventory(scene, 99);
|
return CreateUserWithInventory(scene, TestHelpers.ParseTail(99));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static UserAccount CreateUserWithInventory(Scene scene, int uuidTail)
|
public static UserAccount CreateUserWithInventory(Scene scene, UUID userId)
|
||||||
{
|
{
|
||||||
return CreateUserWithInventory(
|
return CreateUserWithInventory(scene, "Bill", "Bailey", userId, "troll");
|
||||||
scene, "Bill", "Bailey", new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", uuidTail)), "troll");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static UserAccount CreateUserWithInventory(
|
public static UserAccount CreateUserWithInventory(
|
||||||
|
@ -139,7 +138,6 @@ namespace OpenSim.Tests.Common
|
||||||
{
|
{
|
||||||
// FIXME: This should really be set up by UserAccount itself
|
// FIXME: This should really be set up by UserAccount itself
|
||||||
ua.ServiceURLs = new Dictionary<string, object>();
|
ua.ServiceURLs = new Dictionary<string, object>();
|
||||||
|
|
||||||
scene.UserAccountService.StoreUserAccount(ua);
|
scene.UserAccountService.StoreUserAccount(ua);
|
||||||
scene.InventoryService.CreateUserInventory(ua.PrincipalID);
|
scene.InventoryService.CreateUserInventory(ua.PrincipalID);
|
||||||
scene.AuthenticationService.SetPassword(ua.PrincipalID, pw);
|
scene.AuthenticationService.SetPassword(ua.PrincipalID, pw);
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue