Merge branch 'master' into careminster
Conflicts: OpenSim/Data/MySQL/MySQLSimulationData.cs OpenSim/Data/MySQL/Resources/RegionStore.migrations OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs OpenSim/Region/Framework/Scenes/Scene.cs OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.csavinationmerge
commit
884c0e7bb1
|
@ -146,6 +146,7 @@ what it is today.
|
||||||
* Stefan_Boom / stoehr
|
* Stefan_Boom / stoehr
|
||||||
* Strawberry Fride
|
* Strawberry Fride
|
||||||
* Talun
|
* Talun
|
||||||
|
* TechplexEngineer (Blake Bourque)
|
||||||
* TBG Renfold
|
* TBG Renfold
|
||||||
* tglion
|
* tglion
|
||||||
* tlaukkan/Tommil (Tommi S. E. Laukkanen, Bubble Cloud)
|
* tlaukkan/Tommil (Tommi S. E. Laukkanen, Bubble Cloud)
|
||||||
|
|
|
@ -0,0 +1,68 @@
|
||||||
|
/*
|
||||||
|
* 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 OpenMetaverse;
|
||||||
|
|
||||||
|
namespace OpenSim.Framework.Capabilities
|
||||||
|
{
|
||||||
|
[OSDMap]
|
||||||
|
public class LLSDEnvironmentRequest
|
||||||
|
{
|
||||||
|
public UUID messageID;
|
||||||
|
public UUID regionID;
|
||||||
|
}
|
||||||
|
|
||||||
|
[OSDMap]
|
||||||
|
public class LLSDEnvironmentSetResponse
|
||||||
|
{
|
||||||
|
public UUID regionID;
|
||||||
|
public UUID messageID;
|
||||||
|
public Boolean success;
|
||||||
|
public String fail_reason;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EnvironmentSettings
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// generates a empty llsd settings response for viewer
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="messageID">the message UUID</param>
|
||||||
|
/// <param name="regionID">the region UUID</param>
|
||||||
|
public static string EmptySettings(UUID messageID, UUID regionID)
|
||||||
|
{
|
||||||
|
OSDArray arr = new OSDArray();
|
||||||
|
LLSDEnvironmentRequest msg = new LLSDEnvironmentRequest();
|
||||||
|
msg.messageID = messageID;
|
||||||
|
msg.regionID = regionID;
|
||||||
|
arr.Array.Add(msg);
|
||||||
|
return LLSDHelpers.SerialiseLLSDReply(arr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1181,6 +1181,72 @@ VALUES
|
||||||
// }
|
// }
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Environment Settings
|
||||||
|
public string LoadRegionEnvironmentSettings(UUID regionUUID)
|
||||||
|
{
|
||||||
|
string sql = "select * from [regionenvironment] where region_id = @region_id";
|
||||||
|
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||||
|
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||||
|
{
|
||||||
|
cmd.Parameters.Add(_Database.CreateParameter("@region_id", regionUUID));
|
||||||
|
conn.Open();
|
||||||
|
using (SqlDataReader result = cmd.ExecuteReader())
|
||||||
|
{
|
||||||
|
if (!result.Read())
|
||||||
|
{
|
||||||
|
return String.Empty;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Convert.ToString(result["llsd_settings"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings)
|
||||||
|
{
|
||||||
|
{
|
||||||
|
string sql = "DELETE FROM [regionenvironment] WHERE region_id = @region_id";
|
||||||
|
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||||
|
|
||||||
|
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||||
|
{
|
||||||
|
cmd.Parameters.Add(_Database.CreateParameter("@region_id", regionUUID));
|
||||||
|
conn.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
sql = "INSERT INTO [regionenvironment] (region_id, llsd_settings) VALUES (@region_id, @llsd_settings)";
|
||||||
|
|
||||||
|
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||||
|
|
||||||
|
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||||
|
{
|
||||||
|
cmd.Parameters.Add(_Database.CreateParameter("@region_id", regionUUID));
|
||||||
|
cmd.Parameters.Add(_Database.CreateParameter("@llsd_settings", settings));
|
||||||
|
|
||||||
|
conn.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveRegionEnvironmentSettings(UUID regionUUID)
|
||||||
|
{
|
||||||
|
string sql = "delete from [regionenvironment] where region_id = @region_id";
|
||||||
|
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||||
|
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||||
|
{
|
||||||
|
cmd.Parameters.Add(_Database.CreateParameter("@region_id", regionUUID));
|
||||||
|
|
||||||
|
conn.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads the settings of a region.
|
/// Loads the settings of a region.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1134,3 +1134,17 @@ ALTER TABLE landaccesslist ADD Expires integer NOT NULL DEFAULT 0;
|
||||||
|
|
||||||
COMMIT
|
COMMIT
|
||||||
|
|
||||||
|
:VERSION 37 #---------------- Environment Settings
|
||||||
|
|
||||||
|
BEGIN TRANSACTION
|
||||||
|
|
||||||
|
CREATE TABLE [dbo].[regionenvironment](
|
||||||
|
[region_id] [uniqueidentifier] NOT NULL,
|
||||||
|
[llsd_settings] [varchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
|
||||||
|
PRIMARY KEY CLUSTERED
|
||||||
|
(
|
||||||
|
[region_id] ASC
|
||||||
|
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
|
||||||
|
) ON [PRIMARY]
|
||||||
|
|
||||||
|
COMMIT
|
||||||
|
|
|
@ -994,6 +994,68 @@ namespace OpenSim.Data.MySQL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region RegionEnvironmentSettings
|
||||||
|
public string LoadRegionEnvironmentSettings(UUID regionUUID)
|
||||||
|
{
|
||||||
|
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||||
|
{
|
||||||
|
dbcon.Open();
|
||||||
|
|
||||||
|
string command = "select * from `regionenvironment` where region_id = ?region_id";
|
||||||
|
|
||||||
|
using (MySqlCommand cmd = new MySqlCommand(command))
|
||||||
|
{
|
||||||
|
cmd.Connection = dbcon;
|
||||||
|
|
||||||
|
cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString());
|
||||||
|
|
||||||
|
IDataReader result = ExecuteReader(cmd);
|
||||||
|
if (!result.Read())
|
||||||
|
{
|
||||||
|
return String.Empty;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Convert.ToString(result["llsd_settings"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings)
|
||||||
|
{
|
||||||
|
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||||
|
{
|
||||||
|
dbcon.Open();
|
||||||
|
|
||||||
|
using (MySqlCommand cmd = dbcon.CreateCommand())
|
||||||
|
{
|
||||||
|
cmd.CommandText = "REPLACE INTO `regionenvironment` (`region_id`, `llsd_settings`) VALUES (?region_id, ?llsd_settings)";
|
||||||
|
|
||||||
|
cmd.Parameters.AddWithValue("region_id", regionUUID);
|
||||||
|
cmd.Parameters.AddWithValue("llsd_settings", settings);
|
||||||
|
|
||||||
|
ExecuteNonQuery(cmd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveRegionEnvironmentSettings(UUID regionUUID)
|
||||||
|
{
|
||||||
|
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||||
|
{
|
||||||
|
dbcon.Open();
|
||||||
|
|
||||||
|
using (MySqlCommand cmd = dbcon.CreateCommand())
|
||||||
|
{
|
||||||
|
cmd.CommandText = "delete from `regionenvironment` where region_id = ?region_id";
|
||||||
|
cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString());
|
||||||
|
ExecuteNonQuery(cmd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
public virtual void StoreRegionSettings(RegionSettings rs)
|
public virtual void StoreRegionSettings(RegionSettings rs)
|
||||||
{
|
{
|
||||||
lock (m_dbLock)
|
lock (m_dbLock)
|
||||||
|
|
|
@ -883,3 +883,15 @@ ALTER TABLE `regionsettings` MODIFY COLUMN `TelehubObject` VARCHAR(36) NOT NULL
|
||||||
|
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
|
:VERSION 44 #--------------------- Environment Settings
|
||||||
|
|
||||||
|
BEGIN;
|
||||||
|
|
||||||
|
CREATE TABLE `regionenvironment` (
|
||||||
|
`region_id` varchar(36) NOT NULL,
|
||||||
|
`llsd_settings` TEXT NOT NULL,
|
||||||
|
PRIMARY KEY (`region_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,24 @@ namespace OpenSim.Data.Null
|
||||||
//This connector doesn't support the windlight module yet
|
//This connector doesn't support the windlight module yet
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Environment Settings
|
||||||
|
public string LoadRegionEnvironmentSettings(UUID regionUUID)
|
||||||
|
{
|
||||||
|
//This connector doesn't support the Environment module yet
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings)
|
||||||
|
{
|
||||||
|
//This connector doesn't support the Environment module yet
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveRegionEnvironmentSettings(UUID regionUUID)
|
||||||
|
{
|
||||||
|
//This connector doesn't support the Environment module yet
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
public RegionSettings LoadRegionSettings(UUID regionUUID)
|
public RegionSettings LoadRegionSettings(UUID regionUUID)
|
||||||
{
|
{
|
||||||
RegionSettings rs = new RegionSettings();
|
RegionSettings rs = new RegionSettings();
|
||||||
|
|
|
@ -564,3 +564,14 @@ COMMIT;
|
||||||
BEGIN;
|
BEGIN;
|
||||||
ALTER TABLE `regionsettings` ADD COLUMN `parcel_tile_ID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
|
ALTER TABLE `regionsettings` ADD COLUMN `parcel_tile_ID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
|
:VERSION 26
|
||||||
|
|
||||||
|
BEGIN;
|
||||||
|
|
||||||
|
CREATE TABLE `regionenvironment` (
|
||||||
|
`region_id` varchar(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000' PRIMARY KEY,
|
||||||
|
`llsd_settings` TEXT NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
|
|
|
@ -61,6 +61,7 @@ namespace OpenSim.Data.SQLite
|
||||||
private const string regionbanListSelect = "select * from regionban";
|
private const string regionbanListSelect = "select * from regionban";
|
||||||
private const string regionSettingsSelect = "select * from regionsettings";
|
private const string regionSettingsSelect = "select * from regionsettings";
|
||||||
private const string regionWindlightSelect = "select * from regionwindlight";
|
private const string regionWindlightSelect = "select * from regionwindlight";
|
||||||
|
private const string regionEnvironmentSelect = "select * from regionenvironment";
|
||||||
private const string regionSpawnPointsSelect = "select * from spawn_points";
|
private const string regionSpawnPointsSelect = "select * from spawn_points";
|
||||||
|
|
||||||
private DataSet ds;
|
private DataSet ds;
|
||||||
|
@ -72,6 +73,7 @@ namespace OpenSim.Data.SQLite
|
||||||
private SqliteDataAdapter landAccessListDa;
|
private SqliteDataAdapter landAccessListDa;
|
||||||
private SqliteDataAdapter regionSettingsDa;
|
private SqliteDataAdapter regionSettingsDa;
|
||||||
private SqliteDataAdapter regionWindlightDa;
|
private SqliteDataAdapter regionWindlightDa;
|
||||||
|
private SqliteDataAdapter regionEnvironmentDa;
|
||||||
private SqliteDataAdapter regionSpawnPointsDa;
|
private SqliteDataAdapter regionSpawnPointsDa;
|
||||||
|
|
||||||
private SqliteConnection m_conn;
|
private SqliteConnection m_conn;
|
||||||
|
@ -146,6 +148,9 @@ namespace OpenSim.Data.SQLite
|
||||||
SqliteCommand regionWindlightSelectCmd = new SqliteCommand(regionWindlightSelect, m_conn);
|
SqliteCommand regionWindlightSelectCmd = new SqliteCommand(regionWindlightSelect, m_conn);
|
||||||
regionWindlightDa = new SqliteDataAdapter(regionWindlightSelectCmd);
|
regionWindlightDa = new SqliteDataAdapter(regionWindlightSelectCmd);
|
||||||
|
|
||||||
|
SqliteCommand regionEnvironmentSelectCmd = new SqliteCommand(regionEnvironmentSelect, m_conn);
|
||||||
|
regionEnvironmentDa = new SqliteDataAdapter(regionEnvironmentSelectCmd);
|
||||||
|
|
||||||
SqliteCommand regionSpawnPointsSelectCmd = new SqliteCommand(regionSpawnPointsSelect, m_conn);
|
SqliteCommand regionSpawnPointsSelectCmd = new SqliteCommand(regionSpawnPointsSelect, m_conn);
|
||||||
regionSpawnPointsDa = new SqliteDataAdapter(regionSpawnPointsSelectCmd);
|
regionSpawnPointsDa = new SqliteDataAdapter(regionSpawnPointsSelectCmd);
|
||||||
|
|
||||||
|
@ -179,6 +184,9 @@ namespace OpenSim.Data.SQLite
|
||||||
ds.Tables.Add(createRegionWindlightTable());
|
ds.Tables.Add(createRegionWindlightTable());
|
||||||
setupRegionWindlightCommands(regionWindlightDa, m_conn);
|
setupRegionWindlightCommands(regionWindlightDa, m_conn);
|
||||||
|
|
||||||
|
ds.Tables.Add(createRegionEnvironmentTable());
|
||||||
|
setupRegionEnvironmentCommands(regionEnvironmentDa, m_conn);
|
||||||
|
|
||||||
ds.Tables.Add(createRegionSpawnPointsTable());
|
ds.Tables.Add(createRegionSpawnPointsTable());
|
||||||
setupRegionSpawnPointsCommands(regionSpawnPointsDa, m_conn);
|
setupRegionSpawnPointsCommands(regionSpawnPointsDa, m_conn);
|
||||||
|
|
||||||
|
@ -258,6 +266,15 @@ namespace OpenSim.Data.SQLite
|
||||||
m_log.ErrorFormat("[SQLITE REGION DB]: Caught fill error on regionwindlight table :{0}", e.Message);
|
m_log.ErrorFormat("[SQLITE REGION DB]: Caught fill error on regionwindlight table :{0}", e.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
regionEnvironmentDa.Fill(ds.Tables["regionenvironment"]);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.ErrorFormat("[SQLITE REGION DB]: Caught fill error on regionenvironment table :{0}", e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
regionSpawnPointsDa.Fill(ds.Tables["spawn_points"]);
|
regionSpawnPointsDa.Fill(ds.Tables["spawn_points"]);
|
||||||
|
@ -278,12 +295,13 @@ namespace OpenSim.Data.SQLite
|
||||||
CreateDataSetMapping(landAccessListDa, "landaccesslist");
|
CreateDataSetMapping(landAccessListDa, "landaccesslist");
|
||||||
CreateDataSetMapping(regionSettingsDa, "regionsettings");
|
CreateDataSetMapping(regionSettingsDa, "regionsettings");
|
||||||
CreateDataSetMapping(regionWindlightDa, "regionwindlight");
|
CreateDataSetMapping(regionWindlightDa, "regionwindlight");
|
||||||
|
CreateDataSetMapping(regionEnvironmentDa, "regionenvironment");
|
||||||
CreateDataSetMapping(regionSpawnPointsDa, "spawn_points");
|
CreateDataSetMapping(regionSpawnPointsDa, "spawn_points");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat("[SQLITE REGION DB]: ", e);
|
m_log.ErrorFormat("[SQLITE REGION DB]: {0} - {1}", e.Message, e.StackTrace);
|
||||||
Environment.Exit(23);
|
Environment.Exit(23);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -341,6 +359,11 @@ namespace OpenSim.Data.SQLite
|
||||||
regionWindlightDa.Dispose();
|
regionWindlightDa.Dispose();
|
||||||
regionWindlightDa = null;
|
regionWindlightDa = null;
|
||||||
}
|
}
|
||||||
|
if (regionEnvironmentDa != null)
|
||||||
|
{
|
||||||
|
regionEnvironmentDa.Dispose();
|
||||||
|
regionEnvironmentDa = null;
|
||||||
|
}
|
||||||
if (regionSpawnPointsDa != null)
|
if (regionSpawnPointsDa != null)
|
||||||
{
|
{
|
||||||
regionSpawnPointsDa.Dispose();
|
regionSpawnPointsDa.Dispose();
|
||||||
|
@ -474,6 +497,63 @@ namespace OpenSim.Data.SQLite
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Region Environment Settings
|
||||||
|
public string LoadRegionEnvironmentSettings(UUID regionUUID)
|
||||||
|
{
|
||||||
|
lock (ds)
|
||||||
|
{
|
||||||
|
DataTable environmentTable = ds.Tables["regionenvironment"];
|
||||||
|
DataRow row = environmentTable.Rows.Find(regionUUID.ToString());
|
||||||
|
if (row == null)
|
||||||
|
{
|
||||||
|
return String.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (String)row["llsd_settings"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings)
|
||||||
|
{
|
||||||
|
lock (ds)
|
||||||
|
{
|
||||||
|
DataTable environmentTable = ds.Tables["regionenvironment"];
|
||||||
|
DataRow row = environmentTable.Rows.Find(regionUUID.ToString());
|
||||||
|
|
||||||
|
if (row == null)
|
||||||
|
{
|
||||||
|
row = environmentTable.NewRow();
|
||||||
|
row["region_id"] = regionUUID.ToString();
|
||||||
|
row["llsd_settings"] = settings;
|
||||||
|
environmentTable.Rows.Add(row);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
row["llsd_settings"] = settings;
|
||||||
|
}
|
||||||
|
|
||||||
|
regionEnvironmentDa.Update(ds, "regionenvironment");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveRegionEnvironmentSettings(UUID regionUUID)
|
||||||
|
{
|
||||||
|
lock (ds)
|
||||||
|
{
|
||||||
|
DataTable environmentTable = ds.Tables["regionenvironment"];
|
||||||
|
DataRow row = environmentTable.Rows.Find(regionUUID.ToString());
|
||||||
|
|
||||||
|
if (row != null)
|
||||||
|
{
|
||||||
|
row.Delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
regionEnvironmentDa.Update(ds, "regionenvironment");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
public RegionSettings LoadRegionSettings(UUID regionUUID)
|
public RegionSettings LoadRegionSettings(UUID regionUUID)
|
||||||
{
|
{
|
||||||
lock (ds)
|
lock (ds)
|
||||||
|
@ -1430,6 +1510,17 @@ namespace OpenSim.Data.SQLite
|
||||||
return regionwindlight;
|
return regionwindlight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static DataTable createRegionEnvironmentTable()
|
||||||
|
{
|
||||||
|
DataTable regionEnvironment = new DataTable("regionenvironment");
|
||||||
|
createCol(regionEnvironment, "region_id", typeof(String));
|
||||||
|
createCol(regionEnvironment, "llsd_settings", typeof(String));
|
||||||
|
|
||||||
|
regionEnvironment.PrimaryKey = new DataColumn[] { regionEnvironment.Columns["region_id"] };
|
||||||
|
|
||||||
|
return regionEnvironment;
|
||||||
|
}
|
||||||
|
|
||||||
private static DataTable createRegionSpawnPointsTable()
|
private static DataTable createRegionSpawnPointsTable()
|
||||||
{
|
{
|
||||||
DataTable spawn_points = new DataTable("spawn_points");
|
DataTable spawn_points = new DataTable("spawn_points");
|
||||||
|
@ -2691,6 +2782,14 @@ namespace OpenSim.Data.SQLite
|
||||||
da.UpdateCommand.Connection = conn;
|
da.UpdateCommand.Connection = conn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setupRegionEnvironmentCommands(SqliteDataAdapter da, SqliteConnection conn)
|
||||||
|
{
|
||||||
|
da.InsertCommand = createInsertCommand("regionenvironment", ds.Tables["regionenvironment"]);
|
||||||
|
da.InsertCommand.Connection = conn;
|
||||||
|
da.UpdateCommand = createUpdateCommand("regionenvironment", "region_id=:region_id", ds.Tables["regionenvironment"]);
|
||||||
|
da.UpdateCommand.Connection = conn;
|
||||||
|
}
|
||||||
|
|
||||||
private void setupRegionSpawnPointsCommands(SqliteDataAdapter da, SqliteConnection conn)
|
private void setupRegionSpawnPointsCommands(SqliteDataAdapter da, SqliteConnection conn)
|
||||||
{
|
{
|
||||||
da.InsertCommand = createInsertCommand("spawn_points", ds.Tables["spawn_points"]);
|
da.InsertCommand = createInsertCommand("spawn_points", ds.Tables["spawn_points"]);
|
||||||
|
|
|
@ -0,0 +1,112 @@
|
||||||
|
/*
|
||||||
|
* 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.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace OpenSim.Framework.Console
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Used to generated a formatted table for the console.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Currently subject to change. If you use this, be prepared to change your code when this class changes.
|
||||||
|
/// </remarks>
|
||||||
|
public class ConsoleDisplayList
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The default divider between key and value for a list item.
|
||||||
|
/// </summary>
|
||||||
|
public const string DefaultKeyValueDivider = " : ";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The divider used between key and value for a list item.
|
||||||
|
/// </summary>
|
||||||
|
public string KeyValueDivider { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Table rows
|
||||||
|
/// </summary>
|
||||||
|
public List<KeyValuePair<string, string>> Rows { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Number of spaces to indent the list.
|
||||||
|
/// </summary>
|
||||||
|
public int Indent { get; set; }
|
||||||
|
|
||||||
|
public ConsoleDisplayList()
|
||||||
|
{
|
||||||
|
Rows = new List<KeyValuePair<string, string>>();
|
||||||
|
KeyValueDivider = DefaultKeyValueDivider;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
AddToStringBuilder(sb);
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddToStringBuilder(StringBuilder sb)
|
||||||
|
{
|
||||||
|
string formatString = GetFormatString();
|
||||||
|
// System.Console.WriteLine("FORMAT STRING [{0}]", formatString);
|
||||||
|
|
||||||
|
// rows
|
||||||
|
foreach (KeyValuePair<string, string> row in Rows)
|
||||||
|
sb.AppendFormat(formatString, row.Key, row.Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the format string for the table.
|
||||||
|
/// </summary>
|
||||||
|
private string GetFormatString()
|
||||||
|
{
|
||||||
|
StringBuilder formatSb = new StringBuilder();
|
||||||
|
|
||||||
|
int longestKey = -1;
|
||||||
|
|
||||||
|
foreach (KeyValuePair<string, string> row in Rows)
|
||||||
|
if (row.Key.Length > longestKey)
|
||||||
|
longestKey = row.Key.Length;
|
||||||
|
|
||||||
|
formatSb.Append(' ', Indent);
|
||||||
|
|
||||||
|
// Can only do left formatting for now
|
||||||
|
formatSb.AppendFormat("{{0,-{0}}}{1}{{1}}\n", longestKey, KeyValueDivider);
|
||||||
|
|
||||||
|
return formatSb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddRow(object key, object value)
|
||||||
|
{
|
||||||
|
Rows.Add(new KeyValuePair<string, string>(key.ToString(), value.ToString()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -38,7 +38,7 @@ namespace OpenSim.Framework.Console
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Currently subject to change. If you use this, be prepared to change your code when this class changes.
|
/// Currently subject to change. If you use this, be prepared to change your code when this class changes.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public class ConsoleTable
|
public class ConsoleDisplayTable
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Default number of spaces between table columns.
|
/// Default number of spaces between table columns.
|
||||||
|
@ -48,12 +48,12 @@ namespace OpenSim.Framework.Console
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Table columns.
|
/// Table columns.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<ConsoleTableColumn> Columns { get; private set; }
|
public List<ConsoleDisplayTableColumn> Columns { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Table rows
|
/// Table rows
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<ConsoleTableRow> Rows { get; private set; }
|
public List<ConsoleDisplayTableRow> Rows { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of spaces to indent the table.
|
/// Number of spaces to indent the table.
|
||||||
|
@ -65,11 +65,11 @@ namespace OpenSim.Framework.Console
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int TableSpacing { get; set; }
|
public int TableSpacing { get; set; }
|
||||||
|
|
||||||
public ConsoleTable()
|
public ConsoleDisplayTable()
|
||||||
{
|
{
|
||||||
TableSpacing = DefaultTableSpacing;
|
TableSpacing = DefaultTableSpacing;
|
||||||
Columns = new List<ConsoleTableColumn>();
|
Columns = new List<ConsoleDisplayTableColumn>();
|
||||||
Rows = new List<ConsoleTableRow>();
|
Rows = new List<ConsoleDisplayTableRow>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
|
@ -88,7 +88,7 @@ namespace OpenSim.Framework.Console
|
||||||
sb.AppendFormat(formatString, Columns.ConvertAll(c => c.Header).ToArray());
|
sb.AppendFormat(formatString, Columns.ConvertAll(c => c.Header).ToArray());
|
||||||
|
|
||||||
// rows
|
// rows
|
||||||
foreach (ConsoleTableRow row in Rows)
|
foreach (ConsoleDisplayTableRow row in Rows)
|
||||||
sb.AppendFormat(formatString, row.Cells.ToArray());
|
sb.AppendFormat(formatString, row.Cells.ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,23 +115,23 @@ namespace OpenSim.Framework.Console
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct ConsoleTableColumn
|
public struct ConsoleDisplayTableColumn
|
||||||
{
|
{
|
||||||
public string Header { get; set; }
|
public string Header { get; set; }
|
||||||
public int Width { get; set; }
|
public int Width { get; set; }
|
||||||
|
|
||||||
public ConsoleTableColumn(string header, int width) : this()
|
public ConsoleDisplayTableColumn(string header, int width) : this()
|
||||||
{
|
{
|
||||||
Header = header;
|
Header = header;
|
||||||
Width = width;
|
Width = width;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct ConsoleTableRow
|
public struct ConsoleDisplayTableRow
|
||||||
{
|
{
|
||||||
public List<string> Cells { get; private set; }
|
public List<string> Cells { get; private set; }
|
||||||
|
|
||||||
public ConsoleTableRow(List<string> cells) : this()
|
public ConsoleDisplayTableRow(List<string> cells) : this()
|
||||||
{
|
{
|
||||||
Cells = cells;
|
Cells = cells;
|
||||||
}
|
}
|
|
@ -28,143 +28,252 @@
|
||||||
namespace OpenSim.Framework.Servers.HttpServer
|
namespace OpenSim.Framework.Servers.HttpServer
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// HTTP status codes (almost) as defined by W3C in
|
/// HTTP status codes (almost) as defined by W3C in http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html and IETF in http://tools.ietf.org/html/rfc6585
|
||||||
/// http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum OSHttpStatusCode : int
|
public enum OSHttpStatusCode : int
|
||||||
{
|
{
|
||||||
// 1xx Informational status codes providing a provisional
|
#region 1xx Informational status codes providing a provisional response.
|
||||||
// response.
|
|
||||||
// 100 Tells client that to keep on going sending its request
|
/// <summary>
|
||||||
|
/// 100 Tells client that to keep on going sending its request
|
||||||
|
/// </summary>
|
||||||
InfoContinue = 100,
|
InfoContinue = 100,
|
||||||
// 101 Server understands request, proposes to switch to different
|
|
||||||
// application level protocol
|
/// <summary>
|
||||||
|
/// 101 Server understands request, proposes to switch to different application level protocol
|
||||||
|
/// </summary>
|
||||||
InfoSwitchingProtocols = 101,
|
InfoSwitchingProtocols = 101,
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
// 2xx Success codes
|
#region 2xx Success codes
|
||||||
// 200 Request successful
|
|
||||||
|
/// <summary>
|
||||||
|
/// 200 Request successful
|
||||||
|
/// </summary>
|
||||||
SuccessOk = 200,
|
SuccessOk = 200,
|
||||||
// 201 Request successful, new resource created
|
|
||||||
|
/// <summary>
|
||||||
|
/// 201 Request successful, new resource created
|
||||||
|
/// </summary>
|
||||||
SuccessOkCreated = 201,
|
SuccessOkCreated = 201,
|
||||||
// 202 Request accepted, processing still on-going
|
|
||||||
|
/// <summary>
|
||||||
|
/// 202 Request accepted, processing still on-going
|
||||||
|
/// </summary>
|
||||||
SuccessOkAccepted = 202,
|
SuccessOkAccepted = 202,
|
||||||
// 203 Request successful, meta information not authoritative
|
|
||||||
|
/// <summary>
|
||||||
|
/// 203 Request successful, meta information not authoritative
|
||||||
|
/// </summary>
|
||||||
SuccessOkNonAuthoritativeInformation = 203,
|
SuccessOkNonAuthoritativeInformation = 203,
|
||||||
// 204 Request successful, nothing to return in the body
|
|
||||||
|
/// <summary>
|
||||||
|
/// 204 Request successful, nothing to return in the body
|
||||||
|
/// </summary>
|
||||||
SuccessOkNoContent = 204,
|
SuccessOkNoContent = 204,
|
||||||
// 205 Request successful, reset displayed content
|
|
||||||
|
/// <summary>
|
||||||
|
/// 205 Request successful, reset displayed content
|
||||||
|
/// </summary>
|
||||||
SuccessOkResetContent = 205,
|
SuccessOkResetContent = 205,
|
||||||
// 206 Request successful, partial content returned
|
|
||||||
|
/// <summary>
|
||||||
|
/// 206 Request successful, partial content returned
|
||||||
|
/// </summary>
|
||||||
SuccessOkPartialContent = 206,
|
SuccessOkPartialContent = 206,
|
||||||
|
|
||||||
// 3xx Redirect code: user agent needs to go somewhere else
|
#endregion
|
||||||
// 300 Redirect: different presentation forms available, take
|
|
||||||
// a pick
|
#region 3xx Redirect code: user agent needs to go somewhere else
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 300 Redirect: different presentation forms available, take a pick
|
||||||
|
/// </summary>
|
||||||
RedirectMultipleChoices = 300,
|
RedirectMultipleChoices = 300,
|
||||||
// 301 Redirect: requested resource has moved and now lives
|
|
||||||
// somewhere else
|
/// <summary>
|
||||||
|
/// 301 Redirect: requested resource has moved and now lives somewhere else
|
||||||
|
/// </summary>
|
||||||
RedirectMovedPermanently = 301,
|
RedirectMovedPermanently = 301,
|
||||||
// 302 Redirect: Resource temporarily somewhere else, location
|
|
||||||
// might change
|
/// <summary>
|
||||||
|
/// 302 Redirect: Resource temporarily somewhere else, location might change
|
||||||
|
/// </summary>
|
||||||
RedirectFound = 302,
|
RedirectFound = 302,
|
||||||
// 303 Redirect: See other as result of a POST
|
|
||||||
|
/// <summary>
|
||||||
|
/// 303 Redirect: See other as result of a POST
|
||||||
|
/// </summary>
|
||||||
RedirectSeeOther = 303,
|
RedirectSeeOther = 303,
|
||||||
// 304 Redirect: Resource still the same as before
|
|
||||||
|
/// <summary>
|
||||||
|
/// 304 Redirect: Resource still the same as before
|
||||||
|
/// </summary>
|
||||||
RedirectNotModified = 304,
|
RedirectNotModified = 304,
|
||||||
// 305 Redirect: Resource must be accessed via proxy provided
|
|
||||||
// in location field
|
/// <summary>
|
||||||
|
/// 305 Redirect: Resource must be accessed via proxy provided in location field
|
||||||
|
/// </summary>
|
||||||
RedirectUseProxy = 305,
|
RedirectUseProxy = 305,
|
||||||
// 307 Redirect: Resource temporarily somewhere else, location
|
|
||||||
// might change
|
/// <summary>
|
||||||
|
/// 307 Redirect: Resource temporarily somewhere else, location might change
|
||||||
|
/// </summary>
|
||||||
RedirectMovedTemporarily = 307,
|
RedirectMovedTemporarily = 307,
|
||||||
|
|
||||||
// 4xx Client error: the client borked the request
|
#endregion
|
||||||
// 400 Client error: bad request, server does not grok what
|
|
||||||
// the client wants
|
#region 4xx Client error: the client borked the request
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 400 Client error: bad request, server does not grok what the client wants
|
||||||
|
/// </summary>
|
||||||
ClientErrorBadRequest = 400,
|
ClientErrorBadRequest = 400,
|
||||||
// 401 Client error: the client is not authorized, response
|
|
||||||
// provides WWW-Authenticate header field with a challenge
|
/// <summary>
|
||||||
|
/// 401 Client error: the client is not authorized, response provides WWW-Authenticate header field with a challenge
|
||||||
|
/// </summary>
|
||||||
ClientErrorUnauthorized = 401,
|
ClientErrorUnauthorized = 401,
|
||||||
// 402 Client error: Payment required (reserved for future use)
|
|
||||||
|
/// <summary>
|
||||||
|
/// 402 Client error: Payment required (reserved for future use)
|
||||||
|
/// </summary>
|
||||||
ClientErrorPaymentRequired = 402,
|
ClientErrorPaymentRequired = 402,
|
||||||
// 403 Client error: Server understood request, will not
|
|
||||||
// deliver, do not try again.
|
/// <summary>
|
||||||
|
/// 403 Client error: Server understood request, will not deliver, do not try again.
|
||||||
ClientErrorForbidden = 403,
|
ClientErrorForbidden = 403,
|
||||||
// 404 Client error: Server cannot find anything matching the
|
|
||||||
// client request.
|
/// <summary>
|
||||||
|
/// 404 Client error: Server cannot find anything matching the client request.
|
||||||
|
/// </summary>
|
||||||
ClientErrorNotFound = 404,
|
ClientErrorNotFound = 404,
|
||||||
// 405 Client error: The method specified by the client in the
|
|
||||||
// request is not allowed for the resource requested
|
/// <summary>
|
||||||
|
/// 405 Client error: The method specified by the client in the request is not allowed for the resource requested
|
||||||
|
/// </summary>
|
||||||
ClientErrorMethodNotAllowed = 405,
|
ClientErrorMethodNotAllowed = 405,
|
||||||
// 406 Client error: Server cannot generate suitable response
|
|
||||||
// for the resource and content characteristics requested by
|
/// <summary>
|
||||||
// the client
|
/// 406 Client error: Server cannot generate suitable response for the resource and content characteristics requested by the client
|
||||||
|
/// </summary>
|
||||||
ClientErrorNotAcceptable = 406,
|
ClientErrorNotAcceptable = 406,
|
||||||
// 407 Client error: Similar to 401, Server requests that
|
|
||||||
// client authenticate itself with the proxy first
|
/// <summary>
|
||||||
|
/// 407 Client error: Similar to 401, Server requests that client authenticate itself with the proxy first
|
||||||
|
/// </summary>
|
||||||
ClientErrorProxyAuthRequired = 407,
|
ClientErrorProxyAuthRequired = 407,
|
||||||
// 408 Client error: Server got impatient with client and
|
|
||||||
// decided to give up waiting for the client's request to
|
/// <summary>
|
||||||
// arrive
|
/// 408 Client error: Server got impatient with client and decided to give up waiting for the client's request to arrive
|
||||||
|
/// </summary>
|
||||||
ClientErrorRequestTimeout = 408,
|
ClientErrorRequestTimeout = 408,
|
||||||
// 409 Client error: Server could not fulfill the request for
|
|
||||||
// a resource as there is a conflict with the current state of
|
/// <summary>
|
||||||
// the resource but thinks client can do something about this
|
/// 409 Client error: Server could not fulfill the request for a resource as there is a conflict with the current state of the resource but thinks client can do something about this
|
||||||
|
/// </summary>
|
||||||
ClientErrorConflict = 409,
|
ClientErrorConflict = 409,
|
||||||
// 410 Client error: The resource has moved somewhere else,
|
|
||||||
// but server has no clue where.
|
/// <summary>
|
||||||
|
/// 410 Client error: The resource has moved somewhere else, but server has no clue where.
|
||||||
|
/// </summary>
|
||||||
ClientErrorGone = 410,
|
ClientErrorGone = 410,
|
||||||
// 411 Client error: The server is picky again and insists on
|
|
||||||
// having a content-length header field in the request
|
/// <summary>
|
||||||
|
/// 411 Client error: The server is picky again and insists on having a content-length header field in the request
|
||||||
|
/// </summary>
|
||||||
ClientErrorLengthRequired = 411,
|
ClientErrorLengthRequired = 411,
|
||||||
// 412 Client error: one or more preconditions supplied in the
|
|
||||||
// client's request is false
|
/// <summary>
|
||||||
|
/// 412 Client error: one or more preconditions supplied in the client's request is false
|
||||||
|
/// </summary>
|
||||||
ClientErrorPreconditionFailed = 412,
|
ClientErrorPreconditionFailed = 412,
|
||||||
// 413 Client error: For fear of reflux, the server refuses to
|
|
||||||
// swallow that much data.
|
/// <summary>
|
||||||
|
/// 413 Client error: For fear of reflux, the server refuses to swallow that much data.
|
||||||
|
/// </summary>
|
||||||
ClientErrorRequestEntityToLarge = 413,
|
ClientErrorRequestEntityToLarge = 413,
|
||||||
// 414 Client error: The server considers the Request-URI to
|
|
||||||
// be indecently long and refuses to even look at it.
|
/// <summary>
|
||||||
|
/// 414 Client error: The server considers the Request-URI to be indecently long and refuses to even look at it.
|
||||||
|
/// </summary>
|
||||||
ClientErrorRequestURITooLong = 414,
|
ClientErrorRequestURITooLong = 414,
|
||||||
// 415 Client error: The server has no clue about the media
|
|
||||||
// type requested by the client (contrary to popular belief it
|
/// <summary>
|
||||||
// is not a warez server)
|
/// 415 Client error: The server has no clue about the media type requested by the client (contrary to popular belief it is not a warez server)
|
||||||
|
/// </summary>
|
||||||
ClientErrorUnsupportedMediaType = 415,
|
ClientErrorUnsupportedMediaType = 415,
|
||||||
// 416 Client error: The requested range cannot be delivered
|
|
||||||
// by the server.
|
/// <summary>
|
||||||
|
/// 416 Client error: The requested range cannot be delivered by the server.
|
||||||
|
/// </summary>
|
||||||
ClientErrorRequestRangeNotSatisfiable = 416,
|
ClientErrorRequestRangeNotSatisfiable = 416,
|
||||||
// 417 Client error: The expectations of the client as
|
|
||||||
// expressed in one or more Expect header fields cannot be met
|
/// <summary>
|
||||||
// by the server, the server is awfully sorry about this.
|
/// 417 Client error: The expectations of the client as expressed in one or more Expect header fields cannot be met by the server, the server is awfully sorry about this.
|
||||||
|
/// </summary>
|
||||||
ClientErrorExpectationFailed = 417,
|
ClientErrorExpectationFailed = 417,
|
||||||
// 499 Client error: Wildcard error.
|
|
||||||
|
/// <summary>
|
||||||
|
/// 428 Client error :The 428 status code indicates that the origin server requires the request to be conditional.
|
||||||
|
/// </summary>
|
||||||
|
ClientErrorPreconditionRequired = 428,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 429 Client error: The 429 status code indicates that the user has sent too many requests in a given amount of time ("rate limiting").
|
||||||
|
/// </summary>
|
||||||
|
ClientErrorTooManyRequests = 429,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 431 Client error: The 431 status code indicates that the server is unwilling to process the request because its header fields are too large. The request MAY be resubmitted after reducing the size of the request header fields.
|
||||||
|
/// </summary>
|
||||||
|
ClientErrorRequestHeaderFieldsTooLarge = 431,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 499 Client error: Wildcard error.
|
||||||
|
/// </summary>
|
||||||
ClientErrorJoker = 499,
|
ClientErrorJoker = 499,
|
||||||
|
|
||||||
// 5xx Server errors (rare)
|
#endregion
|
||||||
// 500 Server error: something really strange and unexpected
|
|
||||||
// happened
|
#region 5xx Server errors (rare)
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 500 Server error: something really strange and unexpected happened
|
||||||
|
/// </summary>
|
||||||
ServerErrorInternalError = 500,
|
ServerErrorInternalError = 500,
|
||||||
// 501 Server error: The server does not do the functionality
|
|
||||||
// required to carry out the client request. not at
|
/// <summary>
|
||||||
// all. certainly not before breakfast. but also not after
|
/// 501 Server error: The server does not do the functionality required to carry out the client request. not at all. certainly not before breakfast. but also not after breakfast.
|
||||||
// breakfast.
|
/// </summary>
|
||||||
ServerErrorNotImplemented = 501,
|
ServerErrorNotImplemented = 501,
|
||||||
// 502 Server error: While acting as a proxy or a gateway, the
|
|
||||||
// server got ditched by the upstream server and as a
|
/// <summary>
|
||||||
// consequence regretfully cannot fulfill the client's request
|
/// 502 Server error: While acting as a proxy or a gateway, the server got ditched by the upstream server and as a consequence regretfully cannot fulfill the client's request
|
||||||
|
/// </summary>
|
||||||
ServerErrorBadGateway = 502,
|
ServerErrorBadGateway = 502,
|
||||||
// 503 Server error: Due to unforseen circumstances the server
|
|
||||||
// cannot currently deliver the service requested. Retry-After
|
/// <summary>
|
||||||
// header might indicate when to try again.
|
/// 503 Server error: Due to unforseen circumstances the server cannot currently deliver the service requested. Retry-After header might indicate when to try again.
|
||||||
|
/// </summary>
|
||||||
ServerErrorServiceUnavailable = 503,
|
ServerErrorServiceUnavailable = 503,
|
||||||
// 504 Server error: The server blames the upstream server
|
|
||||||
// for not being able to deliver the service requested and
|
/// <summary>
|
||||||
// claims that the upstream server is too slow delivering the
|
/// 504 Server error: The server blames the upstream server for not being able to deliver the service requested and claims that the upstream server is too slow delivering the goods.
|
||||||
// goods.
|
/// </summary>
|
||||||
ServerErrorGatewayTimeout = 504,
|
ServerErrorGatewayTimeout = 504,
|
||||||
// 505 Server error: The server does not support the HTTP
|
|
||||||
// version conveyed in the client's request.
|
/// <summary>
|
||||||
|
/// 505 Server error: The server does not support the HTTP version conveyed in the client's request.
|
||||||
|
/// </summary>
|
||||||
ServerErrorHttpVersionNotSupported = 505,
|
ServerErrorHttpVersionNotSupported = 505,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 511 Server error: The 511 status code indicates that the client needs to authenticate to gain network access.
|
||||||
|
/// </summary>
|
||||||
|
ServerErrorNetworkAuthenticationRequired = 511,
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private Scene m_scene;
|
private Scene m_scene;
|
||||||
private IDialogModule m_dialogModule;
|
private IInventoryAccessModule m_invAccessModule;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Are attachments enabled?
|
/// Are attachments enabled?
|
||||||
|
@ -72,7 +72,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
public void AddRegion(Scene scene)
|
public void AddRegion(Scene scene)
|
||||||
{
|
{
|
||||||
m_scene = scene;
|
m_scene = scene;
|
||||||
m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>();
|
|
||||||
m_scene.RegisterModuleInterface<IAttachmentsModule>(this);
|
m_scene.RegisterModuleInterface<IAttachmentsModule>(this);
|
||||||
|
|
||||||
if (Enabled)
|
if (Enabled)
|
||||||
|
@ -89,7 +88,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
m_scene.EventManager.OnNewClient -= SubscribeToClientEvents;
|
m_scene.EventManager.OnNewClient -= SubscribeToClientEvents;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RegionLoaded(Scene scene) {}
|
public void RegionLoaded(Scene scene)
|
||||||
|
{
|
||||||
|
m_invAccessModule = m_scene.RequestModuleInterface<IInventoryAccessModule>();
|
||||||
|
}
|
||||||
|
|
||||||
public void Close()
|
public void Close()
|
||||||
{
|
{
|
||||||
|
@ -629,6 +631,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
/// <returns>The user inventory item created that holds the attachment.</returns>
|
/// <returns>The user inventory item created that holds the attachment.</returns>
|
||||||
private InventoryItemBase AddSceneObjectAsNewAttachmentInInv(IScenePresence sp, SceneObjectGroup grp)
|
private InventoryItemBase AddSceneObjectAsNewAttachmentInInv(IScenePresence sp, SceneObjectGroup grp)
|
||||||
{
|
{
|
||||||
|
if (m_invAccessModule == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[ATTACHMENTS MODULE]: Called AddSceneObjectAsAttachment for object {0} {1} for {2}",
|
// "[ATTACHMENTS MODULE]: Called AddSceneObjectAsAttachment for object {0} {1} for {2}",
|
||||||
// grp.Name, grp.LocalId, remoteClient.Name);
|
// grp.Name, grp.LocalId, remoteClient.Name);
|
||||||
|
@ -702,16 +707,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
// sets itemID so client can show item as 'attached' in inventory
|
// sets itemID so client can show item as 'attached' in inventory
|
||||||
grp.FromItemID = item.ID;
|
grp.FromItemID = item.ID;
|
||||||
|
|
||||||
if (m_scene.AddInventoryItem(item))
|
|
||||||
{
|
|
||||||
sp.ControllingClient.SendInventoryItemCreateUpdate(item, 0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (m_dialogModule != null)
|
|
||||||
m_dialogModule.SendAlertToUser(sp.ControllingClient, "Operation failed");
|
|
||||||
}
|
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -760,19 +755,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal(
|
protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal(
|
||||||
IScenePresence sp, UUID itemID, UUID assetID, uint attachmentPt, XmlDocument doc)
|
IScenePresence sp, UUID itemID, UUID assetID, uint attachmentPt, XmlDocument doc)
|
||||||
{
|
{
|
||||||
IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>();
|
if (m_invAccessModule == null)
|
||||||
if (invAccess != null)
|
return null;
|
||||||
{
|
|
||||||
lock (sp.AttachmentsSyncLock)
|
lock (sp.AttachmentsSyncLock)
|
||||||
{
|
{
|
||||||
SceneObjectGroup objatt;
|
SceneObjectGroup objatt;
|
||||||
|
|
||||||
if (itemID != UUID.Zero)
|
if (itemID != UUID.Zero)
|
||||||
objatt = invAccess.RezObject(sp.ControllingClient,
|
objatt = m_invAccessModule.RezObject(sp.ControllingClient,
|
||||||
itemID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true,
|
itemID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true,
|
||||||
false, false, sp.UUID, true);
|
false, false, sp.UUID, true);
|
||||||
else
|
else
|
||||||
objatt = invAccess.RezObject(sp.ControllingClient,
|
objatt = m_invAccessModule.RezObject(sp.ControllingClient,
|
||||||
null, assetID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true,
|
null, assetID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true,
|
||||||
false, false, sp.UUID, true);
|
false, false, sp.UUID, true);
|
||||||
|
|
||||||
|
@ -805,15 +800,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tainted)
|
|
||||||
objatt.HasGroupChanged = true;
|
|
||||||
|
|
||||||
if (doc != null)
|
if (doc != null)
|
||||||
{
|
{
|
||||||
objatt.LoadScriptState(doc);
|
objatt.LoadScriptState(doc);
|
||||||
objatt.ResetOwnerChangeFlag();
|
objatt.ResetOwnerChangeFlag();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tainted)
|
||||||
|
objatt.HasGroupChanged = true;
|
||||||
|
|
||||||
// Fire after attach, so we don't get messy perms dialogs
|
// Fire after attach, so we don't get messy perms dialogs
|
||||||
// 4 == AttachedRez
|
// 4 == AttachedRez
|
||||||
objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 4);
|
objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 4);
|
||||||
|
@ -831,7 +826,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
itemID, sp.Name, attachmentPt);
|
itemID, sp.Name, attachmentPt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,12 +99,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||||
public void TestAddAttachmentFromGround()
|
public void TestAddAttachmentFromGround()
|
||||||
{
|
{
|
||||||
TestHelpers.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// TestHelpers.EnableLogging();
|
||||||
|
|
||||||
AddPresence();
|
AddPresence();
|
||||||
string attName = "att";
|
string attName = "att";
|
||||||
|
|
||||||
SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, attName).ParentGroup;
|
SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, attName, m_presence.UUID).ParentGroup;
|
||||||
|
|
||||||
m_attMod.AttachObject(m_presence, so, (uint)AttachmentPoint.Chest, false);
|
m_attMod.AttachObject(m_presence, so, (uint)AttachmentPoint.Chest, false);
|
||||||
|
|
||||||
|
@ -123,6 +123,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||||
Assert.That(
|
Assert.That(
|
||||||
m_presence.Appearance.GetAttachpoint(attSo.FromItemID),
|
m_presence.Appearance.GetAttachpoint(attSo.FromItemID),
|
||||||
Is.EqualTo((int)AttachmentPoint.Chest));
|
Is.EqualTo((int)AttachmentPoint.Chest));
|
||||||
|
|
||||||
|
InventoryItemBase attachmentItem = scene.InventoryService.GetItem(new InventoryItemBase(attSo.FromItemID));
|
||||||
|
Assert.That(attachmentItem, Is.Not.Null);
|
||||||
|
Assert.That(attachmentItem.Name, Is.EqualTo(attName));
|
||||||
|
|
||||||
|
InventoryFolderBase targetFolder = scene.InventoryService.GetFolderForType(m_presence.UUID, AssetType.Object);
|
||||||
|
Assert.That(attachmentItem.Folder, Is.EqualTo(targetFolder.ID));
|
||||||
|
|
||||||
|
// TestHelpers.DisableLogging();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|
|
@ -415,12 +415,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
|
|
||||||
protected override void StoreBackwards(UUID friendID, UUID agentID)
|
protected override void StoreBackwards(UUID friendID, UUID agentID)
|
||||||
{
|
{
|
||||||
Boolean agentIsLocal = true;
|
bool agentIsLocal = true;
|
||||||
Boolean friendIsLocal = true;
|
// bool friendIsLocal = true;
|
||||||
|
|
||||||
if (UserManagementModule != null)
|
if (UserManagementModule != null)
|
||||||
{
|
{
|
||||||
agentIsLocal = UserManagementModule.IsLocalGridUser(agentID);
|
agentIsLocal = UserManagementModule.IsLocalGridUser(agentID);
|
||||||
friendIsLocal = UserManagementModule.IsLocalGridUser(friendID);
|
// friendIsLocal = UserManagementModule.IsLocalGridUser(friendID);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is the requester a local user?
|
// Is the requester a local user?
|
||||||
|
@ -507,7 +508,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
{
|
{
|
||||||
friendUUI = finfo.Friend;
|
friendUUI = finfo.Friend;
|
||||||
theFriendUUID = friendUUI;
|
theFriendUUID = friendUUI;
|
||||||
UUID utmp = UUID.Zero; String url = String.Empty; String first = String.Empty, last = String.Empty, tmp = String.Empty;
|
UUID utmp = UUID.Zero;
|
||||||
|
string url = String.Empty;
|
||||||
|
string first = String.Empty;
|
||||||
|
string last = String.Empty;
|
||||||
|
|
||||||
// If it's confirming the friendship, we already have the full UUI with the secret
|
// If it's confirming the friendship, we already have the full UUI with the secret
|
||||||
if (Util.ParseUniversalUserIdentifier(theFriendUUID, out utmp, out url, out first, out last, out secret))
|
if (Util.ParseUniversalUserIdentifier(theFriendUUID, out utmp, out url, out first, out last, out secret))
|
||||||
{
|
{
|
||||||
|
|
|
@ -46,7 +46,30 @@ using Nini.Config;
|
||||||
|
|
||||||
namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
{
|
{
|
||||||
public class EntityTransferModule : ISharedRegionModule, IEntityTransferModule
|
/// <summary>
|
||||||
|
/// The possible states that an agent can be in when its being transferred between regions.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This is a state machine.
|
||||||
|
///
|
||||||
|
/// [Entry] => Preparing
|
||||||
|
/// Preparing => { Transferring || CleaningUp || [Exit] }
|
||||||
|
/// Transferring => { ReceivedAtDestination || CleaningUp }
|
||||||
|
/// ReceivedAtDestination => CleaningUp
|
||||||
|
/// CleaningUp => [Exit]
|
||||||
|
///
|
||||||
|
/// In other words, agents normally travel throwing Preparing => Transferring => ReceivedAtDestination => CleaningUp
|
||||||
|
/// However, any state can transition to CleaningUp if the teleport has failed.
|
||||||
|
/// </remarks>
|
||||||
|
enum AgentTransferState
|
||||||
|
{
|
||||||
|
Preparing, // The agent is being prepared for transfer
|
||||||
|
Transferring, // The agent is in the process of being transferred to a destination
|
||||||
|
ReceivedAtDestination, // The destination has notified us that the agent has been successfully received
|
||||||
|
CleaningUp // The agent is being changed to child/removed after a transfer
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EntityTransferModule : INonSharedRegionModule, IEntityTransferModule
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
|
@ -65,12 +88,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
public bool EnableWaitForCallbackFromTeleportDest { get; set; }
|
public bool EnableWaitForCallbackFromTeleportDest { get; set; }
|
||||||
|
|
||||||
protected bool m_Enabled = false;
|
protected bool m_Enabled = false;
|
||||||
protected Scene m_aScene;
|
|
||||||
protected List<Scene> m_Scenes = new List<Scene>();
|
protected Scene m_scene;
|
||||||
protected List<UUID> m_agentsInTransit;
|
|
||||||
|
private Dictionary<UUID, AgentTransferState> m_agentsInTransit;
|
||||||
|
|
||||||
private ExpiringCache<UUID, ExpiringCache<ulong, DateTime>> m_bannedRegions =
|
private ExpiringCache<UUID, ExpiringCache<ulong, DateTime>> m_bannedRegions =
|
||||||
new ExpiringCache<UUID, ExpiringCache<ulong, DateTime>>();
|
new ExpiringCache<UUID, ExpiringCache<ulong, DateTime>>();
|
||||||
|
|
||||||
|
private IEventQueue m_eqModule;
|
||||||
|
|
||||||
#region ISharedRegionModule
|
#region ISharedRegionModule
|
||||||
|
|
||||||
public Type ReplaceableInterface
|
public Type ReplaceableInterface
|
||||||
|
@ -116,7 +143,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
MaxTransferDistance = DefaultMaxTransferDistance;
|
MaxTransferDistance = DefaultMaxTransferDistance;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_agentsInTransit = new List<UUID>();
|
m_agentsInTransit = new Dictionary<UUID, AgentTransferState>();
|
||||||
m_Enabled = true;
|
m_Enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,10 +156,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
if (!m_Enabled)
|
if (!m_Enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_aScene == null)
|
m_scene = scene;
|
||||||
m_aScene = scene;
|
|
||||||
|
|
||||||
m_Scenes.Add(scene);
|
|
||||||
scene.RegisterModuleInterface<IEntityTransferModule>(this);
|
scene.RegisterModuleInterface<IEntityTransferModule>(this);
|
||||||
scene.EventManager.OnNewClient += OnNewClient;
|
scene.EventManager.OnNewClient += OnNewClient;
|
||||||
}
|
}
|
||||||
|
@ -143,26 +168,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
client.OnTeleportLandmarkRequest += RequestTeleportLandmark;
|
client.OnTeleportLandmarkRequest += RequestTeleportLandmark;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Close()
|
public virtual void Close() {}
|
||||||
{
|
|
||||||
if (!m_Enabled)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void RemoveRegion(Scene scene)
|
public virtual void RemoveRegion(Scene scene) {}
|
||||||
{
|
|
||||||
if (!m_Enabled)
|
|
||||||
return;
|
|
||||||
if (scene == m_aScene)
|
|
||||||
m_aScene = null;
|
|
||||||
|
|
||||||
m_Scenes.Remove(scene);
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void RegionLoaded(Scene scene)
|
public virtual void RegionLoaded(Scene scene)
|
||||||
{
|
{
|
||||||
if (!m_Enabled)
|
if (!m_Enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
m_eqModule = m_scene.RequestModuleInterface<IEventQueue>();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -230,6 +245,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
"[ENTITY TRANSFER MODULE]: Teleport for {0} to {1} within {2}",
|
"[ENTITY TRANSFER MODULE]: Teleport for {0} to {1} within {2}",
|
||||||
sp.Name, position, sp.Scene.RegionInfo.RegionName);
|
sp.Name, position, sp.Scene.RegionInfo.RegionName);
|
||||||
|
|
||||||
|
if (!SetInTransit(sp.UUID))
|
||||||
|
{
|
||||||
|
m_log.DebugFormat(
|
||||||
|
"[ENTITY TRANSFER MODULE]: Ignoring within region teleport request of {0} {1} to {2} - agent is already in transit.",
|
||||||
|
sp.Name, sp.UUID, position);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Teleport within the same region
|
// Teleport within the same region
|
||||||
if (IsOutsideRegion(sp.Scene, position) || position.Z < 0)
|
if (IsOutsideRegion(sp.Scene, position) || position.Z < 0)
|
||||||
{
|
{
|
||||||
|
@ -258,6 +282,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
position.Z = newPosZ;
|
position.Z = newPosZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UpdateInTransit(sp.UUID, AgentTransferState.Transferring);
|
||||||
|
|
||||||
sp.ControllingClient.SendTeleportStart(teleportFlags);
|
sp.ControllingClient.SendTeleportStart(teleportFlags);
|
||||||
|
|
||||||
sp.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags);
|
sp.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags);
|
||||||
|
@ -265,10 +291,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
sp.Velocity = Vector3.Zero;
|
sp.Velocity = Vector3.Zero;
|
||||||
sp.Teleport(position);
|
sp.Teleport(position);
|
||||||
|
|
||||||
|
UpdateInTransit(sp.UUID, AgentTransferState.ReceivedAtDestination);
|
||||||
|
|
||||||
foreach (SceneObjectGroup grp in sp.GetAttachments())
|
foreach (SceneObjectGroup grp in sp.GetAttachments())
|
||||||
{
|
{
|
||||||
sp.Scene.EventManager.TriggerOnScriptChangedEvent(grp.LocalId, (uint)Changed.TELEPORT);
|
sp.Scene.EventManager.TriggerOnScriptChangedEvent(grp.LocalId, (uint)Changed.TELEPORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp);
|
||||||
|
ResetFromTransit(sp.UUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -286,7 +317,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
{
|
{
|
||||||
uint x = 0, y = 0;
|
uint x = 0, y = 0;
|
||||||
Utils.LongToUInts(regionHandle, out x, out y);
|
Utils.LongToUInts(regionHandle, out x, out y);
|
||||||
GridRegion reg = m_aScene.GridService.GetRegionByPosition(sp.Scene.RegionInfo.ScopeID, (int)x, (int)y);
|
GridRegion reg = m_scene.GridService.GetRegionByPosition(sp.Scene.RegionInfo.ScopeID, (int)x, (int)y);
|
||||||
|
|
||||||
if (reg != null)
|
if (reg != null)
|
||||||
{
|
{
|
||||||
|
@ -366,6 +397,30 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
ScenePresence sp, GridRegion reg, GridRegion finalDestination,
|
ScenePresence sp, GridRegion reg, GridRegion finalDestination,
|
||||||
Vector3 position, Vector3 lookAt, uint teleportFlags)
|
Vector3 position, Vector3 lookAt, uint teleportFlags)
|
||||||
{
|
{
|
||||||
|
// Record that this agent is in transit so that we can prevent simultaneous requests and do later detection
|
||||||
|
// of whether the destination region completes the teleport.
|
||||||
|
if (!SetInTransit(sp.UUID))
|
||||||
|
{
|
||||||
|
m_log.DebugFormat(
|
||||||
|
"[ENTITY TRANSFER MODULE]: Ignoring teleport request of {0} {1} to {2} ({3}) {4}/{5} - agent is already in transit.",
|
||||||
|
sp.Name, sp.UUID, reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (reg == null || finalDestination == null)
|
||||||
|
{
|
||||||
|
sp.ControllingClient.SendTeleportFailed("Unable to locate destination");
|
||||||
|
ResetFromTransit(sp.UUID);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_log.DebugFormat(
|
||||||
|
"[ENTITY TRANSFER MODULE]: Teleporting {0} {1} from {2} to {3} ({4}) {5}/{6}",
|
||||||
|
sp.Name, sp.UUID, sp.Scene.RegionInfo.RegionName,
|
||||||
|
reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position);
|
||||||
|
|
||||||
RegionInfo sourceRegion = sp.Scene.RegionInfo;
|
RegionInfo sourceRegion = sp.Scene.RegionInfo;
|
||||||
|
|
||||||
if (!IsWithinMaxTeleportDistance(sourceRegion, finalDestination))
|
if (!IsWithinMaxTeleportDistance(sourceRegion, finalDestination))
|
||||||
|
@ -377,31 +432,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
sourceRegion.RegionName, sourceRegion.RegionLocX, sourceRegion.RegionLocY,
|
sourceRegion.RegionName, sourceRegion.RegionLocX, sourceRegion.RegionLocY,
|
||||||
MaxTransferDistance));
|
MaxTransferDistance));
|
||||||
|
|
||||||
return;
|
ResetFromTransit(sp.UUID);
|
||||||
}
|
|
||||||
|
|
||||||
IEventQueue eq = sp.Scene.RequestModuleInterface<IEventQueue>();
|
|
||||||
|
|
||||||
if (reg == null || finalDestination == null)
|
|
||||||
{
|
|
||||||
sp.ControllingClient.SendTeleportFailed("Unable to locate destination");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!SetInTransit(sp.UUID)) // Avie is already on the way. Caller shouldn't do this.
|
|
||||||
{
|
|
||||||
m_log.DebugFormat(
|
|
||||||
"[ENTITY TRANSFER MODULE]: Ignoring teleport request of {0} {1} to {2} ({3}) {4}/{5} - agent is already in transit.",
|
|
||||||
sp.Name, sp.UUID, reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.DebugFormat(
|
|
||||||
"[ENTITY TRANSFER MODULE]: Teleporting {0} {1} from {2} to {3} ({4}) {5}/{6}",
|
|
||||||
sp.Name, sp.UUID, sp.Scene.RegionInfo.RegionName,
|
|
||||||
reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position);
|
|
||||||
|
|
||||||
uint newRegionX = (uint)(reg.RegionHandle >> 40);
|
uint newRegionX = (uint)(reg.RegionHandle >> 40);
|
||||||
uint newRegionY = (((uint)(reg.RegionHandle)) >> 8);
|
uint newRegionY = (((uint)(reg.RegionHandle)) >> 8);
|
||||||
uint oldRegionX = (uint)(sp.Scene.RegionInfo.RegionHandle >> 40);
|
uint oldRegionX = (uint)(sp.Scene.RegionInfo.RegionHandle >> 40);
|
||||||
|
@ -415,10 +450,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
IPEndPoint endPoint = finalDestination.ExternalEndPoint;
|
IPEndPoint endPoint = finalDestination.ExternalEndPoint;
|
||||||
if (endPoint != null && endPoint.Address != null)
|
if (endPoint != null && endPoint.Address != null)
|
||||||
{
|
{
|
||||||
// Fixing a bug where teleporting while sitting results in the avatar ending up removed from
|
sp.ControllingClient.SendTeleportFailed("Remote Region appears to be down");
|
||||||
// both regions
|
ResetFromTransit(sp.UUID);
|
||||||
if (sp.ParentID != (uint)0)
|
|
||||||
sp.StandUp();
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!sp.ValidateAttachments())
|
if (!sp.ValidateAttachments())
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
|
@ -433,7 +469,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
|
|
||||||
string reason;
|
string reason;
|
||||||
string version;
|
string version;
|
||||||
if (!m_aScene.SimulationService.QueryAccess(
|
if (!m_scene.SimulationService.QueryAccess(
|
||||||
finalDestination, sp.ControllingClient.AgentId, Vector3.Zero, out version, out reason))
|
finalDestination, sp.ControllingClient.AgentId, Vector3.Zero, out version, out reason))
|
||||||
{
|
{
|
||||||
sp.ControllingClient.SendTeleportFailed(reason);
|
sp.ControllingClient.SendTeleportFailed(reason);
|
||||||
|
@ -448,6 +484,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
|
|
||||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Destination is running version {0}", version);
|
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Destination is running version {0}", version);
|
||||||
|
|
||||||
|
// Fixing a bug where teleporting while sitting results in the avatar ending up removed from
|
||||||
|
// both regions
|
||||||
|
if (sp.ParentID != (uint)0)
|
||||||
|
sp.StandUp();
|
||||||
|
|
||||||
sp.ControllingClient.SendTeleportStart(teleportFlags);
|
sp.ControllingClient.SendTeleportStart(teleportFlags);
|
||||||
|
|
||||||
// the avatar.Close below will clear the child region list. We need this below for (possibly)
|
// the avatar.Close below will clear the child region list. We need this below for (possibly)
|
||||||
|
@ -495,6 +536,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Past this point we have to attempt clean up if the teleport fails, so update transfer state.
|
||||||
|
UpdateInTransit(sp.UUID, AgentTransferState.Transferring);
|
||||||
|
|
||||||
// OK, it got this agent. Let's close some child agents
|
// OK, it got this agent. Let's close some child agents
|
||||||
sp.CloseChildAgents(newRegionX, newRegionY);
|
sp.CloseChildAgents(newRegionX, newRegionY);
|
||||||
|
|
||||||
|
@ -511,16 +555,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
#endregion
|
#endregion
|
||||||
capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
|
capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
|
||||||
|
|
||||||
if (eq != null)
|
if (m_eqModule != null)
|
||||||
{
|
{
|
||||||
eq.EnableSimulator(destinationHandle, endPoint, sp.UUID);
|
m_eqModule.EnableSimulator(destinationHandle, endPoint, sp.UUID);
|
||||||
|
|
||||||
// ES makes the client send a UseCircuitCode message to the destination,
|
// ES makes the client send a UseCircuitCode message to the destination,
|
||||||
// which triggers a bunch of things there.
|
// which triggers a bunch of things there.
|
||||||
// So let's wait
|
// So let's wait
|
||||||
Thread.Sleep(200);
|
Thread.Sleep(200);
|
||||||
|
|
||||||
eq.EstablishAgentCommunication(sp.UUID, endPoint, capsPath);
|
m_eqModule.EstablishAgentCommunication(sp.UUID, endPoint, capsPath);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -559,10 +603,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
"[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} from {1} to {2}",
|
"[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} from {1} to {2}",
|
||||||
capsPath, sp.Scene.RegionInfo.RegionName, sp.Name);
|
capsPath, sp.Scene.RegionInfo.RegionName, sp.Name);
|
||||||
|
|
||||||
if (eq != null)
|
if (m_eqModule != null)
|
||||||
{
|
{
|
||||||
eq.TeleportFinishEvent(destinationHandle, 13, endPoint,
|
m_eqModule.TeleportFinishEvent(destinationHandle, 13, endPoint, 0, teleportFlags, capsPath, sp.UUID);
|
||||||
0, teleportFlags, capsPath, sp.UUID);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -586,6 +629,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp);
|
||||||
|
|
||||||
// For backwards compatibility
|
// For backwards compatibility
|
||||||
if (version == "Unknown" || version == string.Empty)
|
if (version == "Unknown" || version == string.Empty)
|
||||||
{
|
{
|
||||||
|
@ -612,8 +657,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
// We need to delay here because Imprudence viewers, unlike v1 or v3, have a short (<200ms, <500ms) delay before
|
// We need to delay here because Imprudence viewers, unlike v1 or v3, have a short (<200ms, <500ms) delay before
|
||||||
// they regard the new region as the current region after receiving the AgentMovementComplete
|
// they regard the new region as the current region after receiving the AgentMovementComplete
|
||||||
// response. If close is sent before then, it will cause the viewer to quit instead.
|
// response. If close is sent before then, it will cause the viewer to quit instead.
|
||||||
// However, if this delay is longer, then a viewer can teleport back to this region and experience
|
//
|
||||||
// a failure because the old ScenePresence has not yet been cleaned up.
|
// This sleep can be increased if necessary. However, whilst it's active,
|
||||||
|
// an agent cannot teleport back to this region if it has teleported away.
|
||||||
Thread.Sleep(2000);
|
Thread.Sleep(2000);
|
||||||
|
|
||||||
sp.Close();
|
sp.Close();
|
||||||
|
@ -632,11 +678,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
"[ENTITY TRANSFER MODULE]: User {0} is going to another region, profile cache removed",
|
"[ENTITY TRANSFER MODULE]: User {0} is going to another region, profile cache removed",
|
||||||
sp.UUID);
|
sp.UUID);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
ResetFromTransit(sp.UUID);
|
||||||
{
|
|
||||||
sp.ControllingClient.SendTeleportFailed("Remote Region appears to be down");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void Fail(ScenePresence sp, GridRegion finalDestination, bool logout)
|
protected virtual void Fail(ScenePresence sp, GridRegion finalDestination, bool logout)
|
||||||
|
@ -652,7 +695,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
EnableChildAgents(sp);
|
EnableChildAgents(sp);
|
||||||
|
|
||||||
// Finally, kill the agent we just created at the destination.
|
// Finally, kill the agent we just created at the destination.
|
||||||
m_aScene.SimulationService.CloseAgent(finalDestination, sp.UUID);
|
m_scene.SimulationService.CloseAgent(finalDestination, sp.UUID);
|
||||||
|
|
||||||
sp.Scene.EventManager.TriggerTeleportFail(sp.ControllingClient, logout);
|
sp.Scene.EventManager.TriggerTeleportFail(sp.ControllingClient, logout);
|
||||||
}
|
}
|
||||||
|
@ -660,7 +703,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout)
|
protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout)
|
||||||
{
|
{
|
||||||
logout = false;
|
logout = false;
|
||||||
bool success = m_aScene.SimulationService.CreateAgent(finalDestination, agentCircuit, teleportFlags, out reason);
|
bool success = m_scene.SimulationService.CreateAgent(finalDestination, agentCircuit, teleportFlags, out reason);
|
||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
sp.Scene.EventManager.TriggerTeleportStart(sp.ControllingClient, reg, finalDestination, teleportFlags, logout);
|
sp.Scene.EventManager.TriggerTeleportStart(sp.ControllingClient, reg, finalDestination, teleportFlags, logout);
|
||||||
|
@ -670,7 +713,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
|
|
||||||
protected virtual bool UpdateAgent(GridRegion reg, GridRegion finalDestination, AgentData agent)
|
protected virtual bool UpdateAgent(GridRegion reg, GridRegion finalDestination, AgentData agent)
|
||||||
{
|
{
|
||||||
return m_aScene.SimulationService.UpdateAgent(finalDestination, agent);
|
return m_scene.SimulationService.UpdateAgent(finalDestination, agent);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void SetCallbackURL(AgentData agent, RegionInfo region)
|
protected virtual void SetCallbackURL(AgentData agent, RegionInfo region)
|
||||||
|
@ -722,7 +765,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Landmark Teleport
|
#region Landmark Teleport
|
||||||
|
@ -734,7 +776,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
/// <param name="position"></param>
|
/// <param name="position"></param>
|
||||||
public virtual void RequestTeleportLandmark(IClientAPI remoteClient, AssetLandmark lm)
|
public virtual void RequestTeleportLandmark(IClientAPI remoteClient, AssetLandmark lm)
|
||||||
{
|
{
|
||||||
GridRegion info = m_aScene.GridService.GetRegionByUUID(UUID.Zero, lm.RegionID);
|
GridRegion info = m_scene.GridService.GetRegionByUUID(UUID.Zero, lm.RegionID);
|
||||||
|
|
||||||
if (info == null)
|
if (info == null)
|
||||||
{
|
{
|
||||||
|
@ -760,8 +802,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.Name, client.AgentId);
|
"[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.Name, client.AgentId);
|
||||||
|
|
||||||
//OpenSim.Services.Interfaces.PresenceInfo pinfo = m_aScene.PresenceService.GetAgent(client.SessionId);
|
//OpenSim.Services.Interfaces.PresenceInfo pinfo = m_scene.PresenceService.GetAgent(client.SessionId);
|
||||||
GridUserInfo uinfo = m_aScene.GridUserService.GetGridUserInfo(client.AgentId.ToString());
|
GridUserInfo uinfo = m_scene.GridUserService.GetGridUserInfo(client.AgentId.ToString());
|
||||||
|
|
||||||
if (uinfo != null)
|
if (uinfo != null)
|
||||||
{
|
{
|
||||||
|
@ -771,7 +813,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
client.SendTeleportFailed("You don't have a home position set.");
|
client.SendTeleportFailed("You don't have a home position set.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
GridRegion regionInfo = m_aScene.GridService.GetRegionByUUID(UUID.Zero, uinfo.HomeRegionID);
|
GridRegion regionInfo = m_scene.GridService.GetRegionByUUID(UUID.Zero, uinfo.HomeRegionID);
|
||||||
if (regionInfo == null)
|
if (regionInfo == null)
|
||||||
{
|
{
|
||||||
// can't find the Home region: Tell viewer and abort
|
// can't find the Home region: Tell viewer and abort
|
||||||
|
@ -1016,16 +1058,21 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, GridRegion neighbourRegion,
|
ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, GridRegion neighbourRegion,
|
||||||
bool isFlying, string version)
|
bool isFlying, string version)
|
||||||
{
|
{
|
||||||
|
if (neighbourRegion == null)
|
||||||
|
return agent;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
SetInTransit(agent.UUID);
|
||||||
|
|
||||||
ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize));
|
ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize));
|
||||||
|
|
||||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} to {2}-{3} running version {4}", agent.Firstname, agent.Lastname, neighbourx, neighboury, version);
|
m_log.DebugFormat(
|
||||||
|
"[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} to {2}-{3} running version {4}",
|
||||||
|
agent.Firstname, agent.Lastname, neighbourx, neighboury, version);
|
||||||
|
|
||||||
Scene m_scene = agent.Scene;
|
Scene m_scene = agent.Scene;
|
||||||
|
|
||||||
if (neighbourRegion != null)
|
|
||||||
{
|
|
||||||
if (!agent.ValidateAttachments())
|
if (!agent.ValidateAttachments())
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[ENTITY TRANSFER MODULE]: Failed validation of all attachments for region crossing of {0} from {1} to {2}. Continuing.",
|
"[ENTITY TRANSFER MODULE]: Failed validation of all attachments for region crossing of {0} from {1} to {2}. Continuing.",
|
||||||
|
@ -1035,7 +1082,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
Vector3 vel2 = new Vector3(agent.Velocity.X, agent.Velocity.Y, 0);
|
Vector3 vel2 = new Vector3(agent.Velocity.X, agent.Velocity.Y, 0);
|
||||||
|
|
||||||
agent.RemoveFromPhysicalScene();
|
agent.RemoveFromPhysicalScene();
|
||||||
SetInTransit(agent.UUID);
|
|
||||||
|
|
||||||
AgentData cAgent = new AgentData();
|
AgentData cAgent = new AgentData();
|
||||||
agent.CopyTo(cAgent);
|
agent.CopyTo(cAgent);
|
||||||
|
@ -1046,12 +1092,18 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
// We don't need the callback anymnore
|
// We don't need the callback anymnore
|
||||||
cAgent.CallbackURI = String.Empty;
|
cAgent.CallbackURI = String.Empty;
|
||||||
|
|
||||||
|
// Beyond this point, extra cleanup is needed beyond removing transit state
|
||||||
|
UpdateInTransit(agent.UUID, AgentTransferState.Transferring);
|
||||||
|
|
||||||
if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
|
if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
|
||||||
{
|
{
|
||||||
// region doesn't take it
|
// region doesn't take it
|
||||||
|
UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp);
|
||||||
|
|
||||||
ReInstantiateScripts(agent);
|
ReInstantiateScripts(agent);
|
||||||
agent.AddToPhysicalScene(isFlying);
|
agent.AddToPhysicalScene(isFlying);
|
||||||
ResetFromTransit(agent.UUID);
|
ResetFromTransit(agent.UUID);
|
||||||
|
|
||||||
return agent;
|
return agent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1075,10 +1127,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
|
|
||||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
|
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
|
||||||
|
|
||||||
IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>();
|
if (m_eqModule != null)
|
||||||
if (eq != null)
|
|
||||||
{
|
{
|
||||||
eq.CrossRegion(neighbourHandle, pos, vel2 /* agent.Velocity */, neighbourRegion.ExternalEndPoint,
|
m_eqModule.CrossRegion(
|
||||||
|
neighbourHandle, pos, vel2 /* agent.Velocity */, neighbourRegion.ExternalEndPoint,
|
||||||
capsPath, agent.UUID, agent.ControllingClient.SessionId);
|
capsPath, agent.UUID, agent.ControllingClient.SessionId);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1088,7 +1140,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
}
|
}
|
||||||
|
|
||||||
// SUCCESS!
|
// SUCCESS!
|
||||||
|
UpdateInTransit(agent.UUID, AgentTransferState.ReceivedAtDestination);
|
||||||
|
|
||||||
|
// Unlike a teleport, here we do not wait for the destination region to confirm the receipt.
|
||||||
|
UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp);
|
||||||
|
|
||||||
agent.MakeChildAgent();
|
agent.MakeChildAgent();
|
||||||
|
|
||||||
|
// FIXME: Possibly this should occur lower down after other commands to close other agents,
|
||||||
|
// but not sure yet what the side effects would be.
|
||||||
ResetFromTransit(agent.UUID);
|
ResetFromTransit(agent.UUID);
|
||||||
|
|
||||||
// now we have a child agent in this region. Request all interesting data about other (root) agents
|
// now we have a child agent in this region. Request all interesting data about other (root) agents
|
||||||
|
@ -1103,7 +1163,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true);
|
CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Next, let's close the child agent connections that are too far away.
|
// Next, let's close the child agent connections that are too far away.
|
||||||
agent.CloseChildAgents(neighbourx, neighboury);
|
agent.CloseChildAgents(neighbourx, neighboury);
|
||||||
|
|
||||||
|
@ -1117,7 +1176,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[ENTITY TRANSFER MODULE]: User {0} is going to another region", agent.UUID);
|
"[ENTITY TRANSFER MODULE]: User {0} is going to another region", agent.UUID);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//m_log.Debug("AFTER CROSS");
|
//m_log.Debug("AFTER CROSS");
|
||||||
//Scene.DumpChildrenSeeds(UUID);
|
//Scene.DumpChildrenSeeds(UUID);
|
||||||
|
@ -1128,6 +1186,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
m_log.ErrorFormat(
|
m_log.ErrorFormat(
|
||||||
"[ENTITY TRANSFER MODULE]: Problem crossing user {0} to new region {1} from {2}. Exception {3}{4}",
|
"[ENTITY TRANSFER MODULE]: Problem crossing user {0} to new region {1} from {2}. Exception {3}{4}",
|
||||||
agent.Name, neighbourRegion.RegionName, agent.Scene.RegionInfo.RegionName, e.Message, e.StackTrace);
|
agent.Name, neighbourRegion.RegionName, agent.Scene.RegionInfo.RegionName, e.Message, e.StackTrace);
|
||||||
|
|
||||||
|
// TODO: Might be worth attempting other restoration here such as reinstantiation of scripts, etc.
|
||||||
}
|
}
|
||||||
|
|
||||||
return agent;
|
return agent;
|
||||||
|
@ -1431,8 +1491,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
|
|
||||||
if (regionAccepted && newAgent)
|
if (regionAccepted && newAgent)
|
||||||
{
|
{
|
||||||
IEventQueue eq = sp.Scene.RequestModuleInterface<IEventQueue>();
|
if (m_eqModule != null)
|
||||||
if (eq != null)
|
|
||||||
{
|
{
|
||||||
#region IP Translation for NAT
|
#region IP Translation for NAT
|
||||||
IClientIPEndpoint ipepClient;
|
IClientIPEndpoint ipepClient;
|
||||||
|
@ -1446,8 +1505,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
"and EstablishAgentCommunication with seed cap {4}",
|
"and EstablishAgentCommunication with seed cap {4}",
|
||||||
scene.RegionInfo.RegionName, sp.Name, reg.RegionName, reg.RegionHandle, capsPath);
|
scene.RegionInfo.RegionName, sp.Name, reg.RegionName, reg.RegionHandle, capsPath);
|
||||||
|
|
||||||
eq.EnableSimulator(reg.RegionHandle, endPoint, sp.UUID);
|
m_eqModule.EnableSimulator(reg.RegionHandle, endPoint, sp.UUID);
|
||||||
eq.EstablishAgentCommunication(sp.UUID, endPoint, capsPath);
|
m_eqModule.EstablishAgentCommunication(sp.UUID, endPoint, capsPath);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1573,8 +1632,37 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
#region Agent Arrived
|
#region Agent Arrived
|
||||||
public void AgentArrivedAtDestination(UUID id)
|
public void AgentArrivedAtDestination(UUID id)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Agent {0} released", id);
|
lock (m_agentsInTransit)
|
||||||
ResetFromTransit(id);
|
{
|
||||||
|
if (!m_agentsInTransit.ContainsKey(id))
|
||||||
|
{
|
||||||
|
m_log.WarnFormat(
|
||||||
|
"[ENTITY TRANSFER MODULE]: Region {0} received notification of arrival in destination scene of agent {1} but no teleport request is active",
|
||||||
|
m_scene.RegionInfo.RegionName, id);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
AgentTransferState currentState = m_agentsInTransit[id];
|
||||||
|
|
||||||
|
if (currentState == AgentTransferState.ReceivedAtDestination)
|
||||||
|
{
|
||||||
|
// An anomoly but don't make this an outright failure - destination region could be overzealous in sending notification.
|
||||||
|
m_log.WarnFormat(
|
||||||
|
"[ENTITY TRANSFER MODULE]: Region {0} received notification of arrival in destination scene of agent {1} but notification has already previously been received",
|
||||||
|
m_scene.RegionInfo.RegionName, id);
|
||||||
|
}
|
||||||
|
else if (currentState != AgentTransferState.Transferring)
|
||||||
|
{
|
||||||
|
m_log.ErrorFormat(
|
||||||
|
"[ENTITY TRANSFER MODULE]: Region {0} received notification of arrival in destination scene of agent {1} but agent is in transfer state {2}",
|
||||||
|
m_scene.RegionInfo.RegionName, id, currentState);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_agentsInTransit[id] = AgentTransferState.ReceivedAtDestination;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -1845,8 +1933,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
//// And the new channel...
|
//// And the new channel...
|
||||||
//if (m_interregionCommsOut != null)
|
//if (m_interregionCommsOut != null)
|
||||||
// successYN = m_interregionCommsOut.SendCreateObject(newRegionHandle, grp, true);
|
// successYN = m_interregionCommsOut.SendCreateObject(newRegionHandle, grp, true);
|
||||||
if (m_aScene.SimulationService != null)
|
if (m_scene.SimulationService != null)
|
||||||
successYN = m_aScene.SimulationService.CreateObject(destination, newPosition, grp, true);
|
successYN = m_scene.SimulationService.CreateObject(destination, newPosition, grp, true);
|
||||||
|
|
||||||
if (successYN)
|
if (successYN)
|
||||||
{
|
{
|
||||||
|
@ -1925,10 +2013,29 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
|
|
||||||
#region Misc
|
#region Misc
|
||||||
|
|
||||||
protected bool WaitForCallback(UUID id)
|
private bool WaitForCallback(UUID id)
|
||||||
{
|
{
|
||||||
|
lock (m_agentsInTransit)
|
||||||
|
{
|
||||||
|
if (!IsInTransit(id))
|
||||||
|
throw new Exception(
|
||||||
|
string.Format(
|
||||||
|
"Asked to wait for destination callback for agent with ID {0} but it is not in transit"));
|
||||||
|
|
||||||
|
AgentTransferState currentState = m_agentsInTransit[id];
|
||||||
|
|
||||||
|
if (currentState != AgentTransferState.Transferring && currentState != AgentTransferState.ReceivedAtDestination)
|
||||||
|
throw new Exception(
|
||||||
|
string.Format(
|
||||||
|
"Asked to wait for destination callback for agent with ID {0} but it is in state {1}",
|
||||||
|
currentState));
|
||||||
|
}
|
||||||
|
|
||||||
int count = 200;
|
int count = 200;
|
||||||
while (m_agentsInTransit.Contains(id) && count-- > 0)
|
|
||||||
|
// There should be no race condition here since no other code should be removing the agent transfer or
|
||||||
|
// changing the state to another other than Transferring => ReceivedAtDestination.
|
||||||
|
while (m_agentsInTransit[id] != AgentTransferState.ReceivedAtDestination && count-- > 0)
|
||||||
{
|
{
|
||||||
// m_log.Debug(" >>> Waiting... " + count);
|
// m_log.Debug(" >>> Waiting... " + count);
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
|
@ -1938,17 +2045,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set that an agent is in the process of being teleported.
|
/// Set that an agent is in transit.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name='id'>The ID of the agent being teleported</param>
|
/// <param name='id'>The ID of the agent being teleported</param>
|
||||||
/// <returns>true if the agent was not already in transit, false if it was</returns>
|
/// <returns>true if the agent was not already in transit, false if it was</returns>
|
||||||
protected bool SetInTransit(UUID id)
|
private bool SetInTransit(UUID id)
|
||||||
{
|
{
|
||||||
lock (m_agentsInTransit)
|
lock (m_agentsInTransit)
|
||||||
{
|
{
|
||||||
if (!m_agentsInTransit.Contains(id))
|
if (!m_agentsInTransit.ContainsKey(id))
|
||||||
{
|
{
|
||||||
m_agentsInTransit.Add(id);
|
m_agentsInTransit[id] = AgentTransferState.Preparing;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1957,34 +2064,87 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Show whether the given agent is being teleported.
|
/// Updates the state of an agent that is already in transit.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>true if the agent is in the process of being teleported, false otherwise.</returns>
|
/// <param name='id'></param>
|
||||||
/// <param name='id'>The agent ID</para></param>
|
/// <param name='newState'></param>
|
||||||
protected bool IsInTransit(UUID id)
|
/// <returns></returns>
|
||||||
|
/// <exception cref='Exception'>Illegal transitions will throw an Exception</exception>
|
||||||
|
private void UpdateInTransit(UUID id, AgentTransferState newState)
|
||||||
{
|
{
|
||||||
lock (m_agentsInTransit)
|
lock (m_agentsInTransit)
|
||||||
return m_agentsInTransit.Contains(id);
|
{
|
||||||
|
// Illegal to try and update an agent that's not actually in transit.
|
||||||
|
if (!m_agentsInTransit.ContainsKey(id))
|
||||||
|
throw new Exception(string.Format("Agent with ID {0} is not registered as in transit", id));
|
||||||
|
|
||||||
|
AgentTransferState oldState = m_agentsInTransit[id];
|
||||||
|
|
||||||
|
bool transitionOkay = false;
|
||||||
|
|
||||||
|
if (newState == AgentTransferState.CleaningUp && oldState != AgentTransferState.CleaningUp)
|
||||||
|
transitionOkay = true;
|
||||||
|
else if (newState == AgentTransferState.Transferring && oldState == AgentTransferState.Preparing)
|
||||||
|
transitionOkay = true;
|
||||||
|
else if (newState == AgentTransferState.ReceivedAtDestination && oldState == AgentTransferState.Transferring)
|
||||||
|
transitionOkay = true;
|
||||||
|
|
||||||
|
if (transitionOkay)
|
||||||
|
m_agentsInTransit[id] = newState;
|
||||||
|
else
|
||||||
|
throw new Exception(
|
||||||
|
string.Format(
|
||||||
|
"Agent with ID {0} is not allowed to move from old transit state {1} to new state {2}",
|
||||||
|
id, oldState, newState));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsInTransit(UUID id)
|
||||||
|
{
|
||||||
|
lock (m_agentsInTransit)
|
||||||
|
return m_agentsInTransit.ContainsKey(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set that an agent is no longer being teleported.
|
/// Removes an agent from the transit state machine.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <param name='id'></param>
|
||||||
/// <param name='id'>
|
/// <returns>true if the agent was flagged as being teleported when this method was called, false otherwise</returns>
|
||||||
/// true if the agent was flagged as being teleported when this method was called, false otherwise
|
private bool ResetFromTransit(UUID id)
|
||||||
/// </param>
|
|
||||||
protected bool ResetFromTransit(UUID id)
|
|
||||||
{
|
{
|
||||||
lock (m_agentsInTransit)
|
lock (m_agentsInTransit)
|
||||||
{
|
{
|
||||||
if (m_agentsInTransit.Contains(id))
|
if (m_agentsInTransit.ContainsKey(id))
|
||||||
{
|
{
|
||||||
|
AgentTransferState state = m_agentsInTransit[id];
|
||||||
|
|
||||||
|
if (state == AgentTransferState.Transferring || state == AgentTransferState.ReceivedAtDestination)
|
||||||
|
{
|
||||||
|
// FIXME: For now, we allow exit from any state since a thrown exception in teleport is now guranteed
|
||||||
|
// to be handled properly - ResetFromTransit() could be invoked at any step along the process
|
||||||
|
m_log.WarnFormat(
|
||||||
|
"[ENTITY TRANSFER MODULE]: Agent with ID should not exit directly from state {1}, should go to {2} state first",
|
||||||
|
state, AgentTransferState.CleaningUp);
|
||||||
|
|
||||||
|
// throw new Exception(
|
||||||
|
// "Agent with ID {0} cannot exit directly from state {1}, it must go to {2} state first",
|
||||||
|
// state, AgentTransferState.CleaningUp);
|
||||||
|
}
|
||||||
|
|
||||||
m_agentsInTransit.Remove(id);
|
m_agentsInTransit.Remove(id);
|
||||||
|
|
||||||
|
m_log.DebugFormat(
|
||||||
|
"[ENTITY TRANSFER MODULE]: Agent {0} cleared from transit in {1}",
|
||||||
|
id, m_scene.RegionInfo.RegionName);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_log.WarnFormat(
|
||||||
|
"[ENTITY TRANSFER MODULE]: Agent {0} requested to clear from transit in {1} but was already cleared.",
|
||||||
|
id, m_scene.RegionInfo.RegionName);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,11 +45,11 @@ using Nini.Config;
|
||||||
|
|
||||||
namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
{
|
{
|
||||||
public class HGEntityTransferModule : EntityTransferModule, ISharedRegionModule, IEntityTransferModule, IUserAgentVerificationModule
|
public class HGEntityTransferModule
|
||||||
|
: EntityTransferModule, INonSharedRegionModule, IEntityTransferModule, IUserAgentVerificationModule
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private bool m_Initialized = false;
|
|
||||||
private int m_levelHGTeleport = 0;
|
private int m_levelHGTeleport = 0;
|
||||||
|
|
||||||
private GatekeeperServiceConnector m_GatekeeperConnector;
|
private GatekeeperServiceConnector m_GatekeeperConnector;
|
||||||
|
@ -64,6 +64,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
public override void Initialise(IConfigSource source)
|
public override void Initialise(IConfigSource source)
|
||||||
{
|
{
|
||||||
IConfig moduleConfig = source.Configs["Modules"];
|
IConfig moduleConfig = source.Configs["Modules"];
|
||||||
|
|
||||||
if (moduleConfig != null)
|
if (moduleConfig != null)
|
||||||
{
|
{
|
||||||
string name = moduleConfig.GetString("EntityTransferModule", "");
|
string name = moduleConfig.GetString("EntityTransferModule", "");
|
||||||
|
@ -82,11 +83,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
public override void AddRegion(Scene scene)
|
public override void AddRegion(Scene scene)
|
||||||
{
|
{
|
||||||
base.AddRegion(scene);
|
base.AddRegion(scene);
|
||||||
|
|
||||||
if (m_Enabled)
|
if (m_Enabled)
|
||||||
{
|
|
||||||
scene.RegisterModuleInterface<IUserAgentVerificationModule>(this);
|
scene.RegisterModuleInterface<IUserAgentVerificationModule>(this);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnNewClient(IClientAPI client)
|
protected override void OnNewClient(IClientAPI client)
|
||||||
{
|
{
|
||||||
|
@ -98,24 +98,18 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
public override void RegionLoaded(Scene scene)
|
public override void RegionLoaded(Scene scene)
|
||||||
{
|
{
|
||||||
base.RegionLoaded(scene);
|
base.RegionLoaded(scene);
|
||||||
|
|
||||||
if (m_Enabled)
|
if (m_Enabled)
|
||||||
if (!m_Initialized)
|
|
||||||
{
|
|
||||||
m_GatekeeperConnector = new GatekeeperServiceConnector(scene.AssetService);
|
m_GatekeeperConnector = new GatekeeperServiceConnector(scene.AssetService);
|
||||||
m_Initialized = true;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
public override void RemoveRegion(Scene scene)
|
public override void RemoveRegion(Scene scene)
|
||||||
{
|
{
|
||||||
base.AddRegion(scene);
|
base.AddRegion(scene);
|
||||||
|
|
||||||
if (m_Enabled)
|
if (m_Enabled)
|
||||||
{
|
|
||||||
scene.UnregisterModuleInterface<IUserAgentVerificationModule>(this);
|
scene.UnregisterModuleInterface<IUserAgentVerificationModule>(this);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -123,8 +117,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
|
|
||||||
protected override GridRegion GetFinalDestination(GridRegion region)
|
protected override GridRegion GetFinalDestination(GridRegion region)
|
||||||
{
|
{
|
||||||
int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, region.RegionID);
|
int flags = m_scene.GridService.GetRegionFlags(m_scene.RegionInfo.ScopeID, region.RegionID);
|
||||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: region {0} flags: {1}", region.RegionID, flags);
|
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: region {0} flags: {1}", region.RegionID, flags);
|
||||||
|
|
||||||
if ((flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0)
|
if ((flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region {0} is hyperlink", region.RegionID);
|
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region {0} is hyperlink", region.RegionID);
|
||||||
|
@ -135,6 +130,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
m_log.WarnFormat("[HG ENTITY TRANSFER MODULE]: GetHyperlinkRegion to Gatekeeper {0} failed", region.ServerURI);
|
m_log.WarnFormat("[HG ENTITY TRANSFER MODULE]: GetHyperlinkRegion to Gatekeeper {0} failed", region.ServerURI);
|
||||||
return real_destination;
|
return real_destination;
|
||||||
}
|
}
|
||||||
|
|
||||||
return region;
|
return region;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,7 +139,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
if (base.NeedsClosing(drawdist, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
|
if (base.NeedsClosing(drawdist, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID);
|
int flags = m_scene.GridService.GetRegionFlags(m_scene.RegionInfo.ScopeID, reg.RegionID);
|
||||||
if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0)
|
if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@ -156,7 +152,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
if (logout)
|
if (logout)
|
||||||
{
|
{
|
||||||
// Log them out of this grid
|
// Log them out of this grid
|
||||||
m_aScene.PresenceService.LogoutAgent(sp.ControllingClient.SessionId);
|
m_scene.PresenceService.LogoutAgent(sp.ControllingClient.SessionId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,7 +161,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: CreateAgent {0} {1}", reg.ServerURI, finalDestination.ServerURI);
|
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: CreateAgent {0} {1}", reg.ServerURI, finalDestination.ServerURI);
|
||||||
reason = string.Empty;
|
reason = string.Empty;
|
||||||
logout = false;
|
logout = false;
|
||||||
int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID);
|
int flags = m_scene.GridService.GetRegionFlags(m_scene.RegionInfo.ScopeID, reg.RegionID);
|
||||||
if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0)
|
if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0)
|
||||||
{
|
{
|
||||||
// this user is going to another grid
|
// this user is going to another grid
|
||||||
|
@ -210,7 +206,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
"[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.Name, client.AgentId);
|
"[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.Name, client.AgentId);
|
||||||
|
|
||||||
// Let's find out if this is a foreign user or a local user
|
// Let's find out if this is a foreign user or a local user
|
||||||
IUserManagement uMan = m_aScene.RequestModuleInterface<IUserManagement>();
|
IUserManagement uMan = m_scene.RequestModuleInterface<IUserManagement>();
|
||||||
if (uMan != null && uMan.IsLocalGridUser(id))
|
if (uMan != null && uMan.IsLocalGridUser(id))
|
||||||
{
|
{
|
||||||
// local grid user
|
// local grid user
|
||||||
|
@ -265,19 +261,21 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Teleporting agent via landmark to {0} region {1} position {2}",
|
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Teleporting agent via landmark to {0} region {1} position {2}",
|
||||||
(lm.Gatekeeper == string.Empty) ? "local" : lm.Gatekeeper, lm.RegionID, lm.Position);
|
(lm.Gatekeeper == string.Empty) ? "local" : lm.Gatekeeper, lm.RegionID, lm.Position);
|
||||||
|
|
||||||
if (lm.Gatekeeper == string.Empty)
|
if (lm.Gatekeeper == string.Empty)
|
||||||
{
|
{
|
||||||
base.RequestTeleportLandmark(remoteClient, lm);
|
base.RequestTeleportLandmark(remoteClient, lm);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GridRegion info = m_aScene.GridService.GetRegionByUUID(UUID.Zero, lm.RegionID);
|
GridRegion info = m_scene.GridService.GetRegionByUUID(UUID.Zero, lm.RegionID);
|
||||||
|
|
||||||
// Local region?
|
// Local region?
|
||||||
if (info != null)
|
if (info != null)
|
||||||
{
|
{
|
||||||
((Scene)(remoteClient.Scene)).RequestTeleportLocation(remoteClient, info.RegionHandle, lm.Position,
|
((Scene)(remoteClient.Scene)).RequestTeleportLocation(remoteClient, info.RegionHandle, lm.Position,
|
||||||
Vector3.Zero, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaLandmark));
|
Vector3.Zero, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaLandmark));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -288,6 +286,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
GridRegion gatekeeper = new GridRegion();
|
GridRegion gatekeeper = new GridRegion();
|
||||||
gatekeeper.ServerURI = lm.Gatekeeper;
|
gatekeeper.ServerURI = lm.Gatekeeper;
|
||||||
GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(lm.RegionID));
|
GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(lm.RegionID));
|
||||||
|
|
||||||
if (finalDestination != null)
|
if (finalDestination != null)
|
||||||
{
|
{
|
||||||
ScenePresence sp = scene.GetScenePresence(remoteClient.AgentId);
|
ScenePresence sp = scene.GetScenePresence(remoteClient.AgentId);
|
||||||
|
@ -318,7 +317,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
return security.VerifyClient(aCircuit.SessionID, token);
|
return security.VerifyClient(aCircuit.SessionID, token);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent {0} {1} does not have a HomeURI OH NO!", aCircuit.firstname, aCircuit.lastname);
|
{
|
||||||
|
m_log.DebugFormat(
|
||||||
|
"[HG ENTITY TRANSFER MODULE]: Agent {0} {1} does not have a HomeURI OH NO!",
|
||||||
|
aCircuit.firstname, aCircuit.lastname);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -335,8 +338,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
}
|
}
|
||||||
|
|
||||||
// Let's find out if this is a foreign user or a local user
|
// Let's find out if this is a foreign user or a local user
|
||||||
IUserManagement uMan = m_aScene.RequestModuleInterface<IUserManagement>();
|
IUserManagement uMan = m_scene.RequestModuleInterface<IUserManagement>();
|
||||||
UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, obj.AgentId);
|
// UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, obj.AgentId);
|
||||||
if (uMan != null && uMan.IsLocalGridUser(obj.AgentId))
|
if (uMan != null && uMan.IsLocalGridUser(obj.AgentId))
|
||||||
{
|
{
|
||||||
// local grid user
|
// local grid user
|
||||||
|
@ -359,7 +362,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
private GridRegion MakeRegion(AgentCircuitData aCircuit)
|
private GridRegion MakeRegion(AgentCircuitData aCircuit)
|
||||||
{
|
{
|
||||||
GridRegion region = new GridRegion();
|
GridRegion region = new GridRegion();
|
||||||
|
@ -376,6 +378,5 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), (int)0);
|
region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), (int)0);
|
||||||
return region;
|
return region;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -364,8 +364,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[HG INVENTORY ACCESS MODULE]: Changing root inventory for user {0}", client.Name);
|
m_log.DebugFormat("[HG INVENTORY ACCESS MODULE]: Changing root inventory for user {0}", client.Name);
|
||||||
InventoryCollection content = m_Scene.InventoryService.GetFolderContent(client.AgentId, root.ID);
|
InventoryCollection content = m_Scene.InventoryService.GetFolderContent(client.AgentId, root.ID);
|
||||||
List<UUID> fids = new List<UUID>();
|
|
||||||
List<UUID> iids = new List<UUID>();
|
|
||||||
List<InventoryFolderBase> keep = new List<InventoryFolderBase>();
|
List<InventoryFolderBase> keep = new List<InventoryFolderBase>();
|
||||||
|
|
||||||
foreach (InventoryFolderBase f in content.Folders)
|
foreach (InventoryFolderBase f in content.Folders)
|
||||||
|
|
|
@ -175,7 +175,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
sbyte assetType,
|
sbyte assetType,
|
||||||
byte wearableType, uint nextOwnerMask, int creationDate)
|
byte wearableType, uint nextOwnerMask, int creationDate)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item {0} in folder {1}", name, folderID);
|
m_log.DebugFormat("[INVENTORY ACCESS MODULE]: Received request to create inventory item {0} in folder {1}", name, folderID);
|
||||||
|
|
||||||
if (!m_Scene.Permissions.CanCreateUserInventory(invType, remoteClient.AgentId))
|
if (!m_Scene.Permissions.CanCreateUserInventory(invType, remoteClient.AgentId))
|
||||||
return;
|
return;
|
||||||
|
@ -210,7 +210,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat(
|
m_log.ErrorFormat(
|
||||||
"ScenePresence for agent uuid {0} unexpectedly not found in CreateNewInventoryItem",
|
"[INVENTORY ACCESS MODULE]: ScenePresence for agent uuid {0} unexpectedly not found in CreateNewInventoryItem",
|
||||||
remoteClient.AgentId);
|
remoteClient.AgentId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -288,16 +288,19 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat(
|
m_log.ErrorFormat(
|
||||||
"[AGENT INVENTORY]: Could not find item {0} for caps inventory update",
|
"[INVENTORY ACCESS MODULE]: Could not find item {0} for caps inventory update",
|
||||||
itemID);
|
itemID);
|
||||||
}
|
}
|
||||||
|
|
||||||
return UUID.Zero;
|
return UUID.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual UUID CopyToInventory(DeRezAction action, UUID folderID,
|
public virtual List<InventoryItemBase> CopyToInventory(
|
||||||
List<SceneObjectGroup> objectGroups, IClientAPI remoteClient)
|
DeRezAction action, UUID folderID,
|
||||||
|
List<SceneObjectGroup> objectGroups, IClientAPI remoteClient, bool asAttachment)
|
||||||
{
|
{
|
||||||
|
List<InventoryItemBase> copiedItems = new List<InventoryItemBase>();
|
||||||
|
|
||||||
Dictionary<UUID, List<SceneObjectGroup>> bundlesToCopy = new Dictionary<UUID, List<SceneObjectGroup>>();
|
Dictionary<UUID, List<SceneObjectGroup>> bundlesToCopy = new Dictionary<UUID, List<SceneObjectGroup>>();
|
||||||
|
|
||||||
if (CoalesceMultipleObjectsToInventory)
|
if (CoalesceMultipleObjectsToInventory)
|
||||||
|
@ -324,16 +327,16 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is method scoped and will be returned. It will be the
|
// m_log.DebugFormat(
|
||||||
// last created asset id
|
// "[INVENTORY ACCESS MODULE]: Copying {0} object bundles to folder {1} action {2} for {3}",
|
||||||
UUID assetID = UUID.Zero;
|
// bundlesToCopy.Count, folderID, action, remoteClient.Name);
|
||||||
|
|
||||||
// Each iteration is really a separate asset being created,
|
// Each iteration is really a separate asset being created,
|
||||||
// with distinct destinations as well.
|
// with distinct destinations as well.
|
||||||
foreach (List<SceneObjectGroup> bundle in bundlesToCopy.Values)
|
foreach (List<SceneObjectGroup> bundle in bundlesToCopy.Values)
|
||||||
assetID = CopyBundleToInventory(action, folderID, bundle, remoteClient);
|
copiedItems.Add(CopyBundleToInventory(action, folderID, bundle, remoteClient, asAttachment));
|
||||||
|
|
||||||
return assetID;
|
return copiedItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -344,12 +347,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
/// <param name="folderID"></param>
|
/// <param name="folderID"></param>
|
||||||
/// <param name="objlist"></param>
|
/// <param name="objlist"></param>
|
||||||
/// <param name="remoteClient"></param>
|
/// <param name="remoteClient"></param>
|
||||||
/// <returns></returns>
|
/// <param name="asAttachment">Should be true if the bundle is being copied as an attachment. This prevents
|
||||||
protected UUID CopyBundleToInventory(
|
/// attempted serialization of any script state which would abort any operating scripts.</param>
|
||||||
DeRezAction action, UUID folderID, List<SceneObjectGroup> objlist, IClientAPI remoteClient)
|
/// <returns>The inventory item created by the copy</returns>
|
||||||
|
protected InventoryItemBase CopyBundleToInventory(
|
||||||
|
DeRezAction action, UUID folderID, List<SceneObjectGroup> objlist, IClientAPI remoteClient,
|
||||||
|
bool asAttachment)
|
||||||
{
|
{
|
||||||
UUID assetID = UUID.Zero;
|
|
||||||
|
|
||||||
CoalescedSceneObjects coa = new CoalescedSceneObjects(UUID.Zero);
|
CoalescedSceneObjects coa = new CoalescedSceneObjects(UUID.Zero);
|
||||||
Dictionary<UUID, Vector3> originalPositions = new Dictionary<UUID, Vector3>();
|
Dictionary<UUID, Vector3> originalPositions = new Dictionary<UUID, Vector3>();
|
||||||
|
|
||||||
|
@ -401,18 +405,27 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
|
|
||||||
string itemXml;
|
string itemXml;
|
||||||
|
|
||||||
|
// If we're being called from a script, then trying to serialize that same script's state will not complete
|
||||||
|
// in any reasonable time period. Therefore, we'll avoid it. The worst that can happen is that if
|
||||||
|
// the client/server crashes rather than logging out normally, the attachment's scripts will resume
|
||||||
|
// without state on relog. Arguably, this is what we want anyway.
|
||||||
if (objlist.Count > 1)
|
if (objlist.Count > 1)
|
||||||
itemXml = CoalescedSceneObjectsSerializer.ToXml(coa);
|
itemXml = CoalescedSceneObjectsSerializer.ToXml(coa, !asAttachment);
|
||||||
else
|
else
|
||||||
itemXml = SceneObjectSerializer.ToOriginalXmlFormat(objlist[0]);
|
itemXml = SceneObjectSerializer.ToOriginalXmlFormat(objlist[0], !asAttachment);
|
||||||
|
|
||||||
// Restore the position of each group now that it has been stored to inventory.
|
// Restore the position of each group now that it has been stored to inventory.
|
||||||
foreach (SceneObjectGroup objectGroup in objlist)
|
foreach (SceneObjectGroup objectGroup in objlist)
|
||||||
objectGroup.AbsolutePosition = originalPositions[objectGroup.UUID];
|
objectGroup.AbsolutePosition = originalPositions[objectGroup.UUID];
|
||||||
|
|
||||||
InventoryItemBase item = CreateItemForObject(action, remoteClient, objlist[0], folderID);
|
InventoryItemBase item = CreateItemForObject(action, remoteClient, objlist[0], folderID);
|
||||||
|
|
||||||
|
// m_log.DebugFormat(
|
||||||
|
// "[INVENTORY ACCESS MODULE]: Created item is {0}",
|
||||||
|
// item != null ? item.ID.ToString() : "NULL");
|
||||||
|
|
||||||
if (item == null)
|
if (item == null)
|
||||||
return UUID.Zero;
|
return null;
|
||||||
|
|
||||||
// Can't know creator is the same, so null it in inventory
|
// Can't know creator is the same, so null it in inventory
|
||||||
if (objlist.Count > 1)
|
if (objlist.Count > 1)
|
||||||
|
@ -423,6 +436,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item.CreatorId = objlist[0].RootPart.CreatorID.ToString();
|
item.CreatorId = objlist[0].RootPart.CreatorID.ToString();
|
||||||
|
item.CreatorData = objlist[0].RootPart.CreatorData;
|
||||||
item.SaleType = objlist[0].RootPart.ObjectSaleType;
|
item.SaleType = objlist[0].RootPart.ObjectSaleType;
|
||||||
item.SalePrice = objlist[0].RootPart.SalePrice;
|
item.SalePrice = objlist[0].RootPart.SalePrice;
|
||||||
}
|
}
|
||||||
|
@ -436,7 +450,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
m_Scene.AssetService.Store(asset);
|
m_Scene.AssetService.Store(asset);
|
||||||
|
|
||||||
item.AssetID = asset.FullID;
|
item.AssetID = asset.FullID;
|
||||||
assetID = asset.FullID;
|
|
||||||
|
|
||||||
if (DeRezAction.SaveToExistingUserInventoryItem == action)
|
if (DeRezAction.SaveToExistingUserInventoryItem == action)
|
||||||
{
|
{
|
||||||
|
@ -469,9 +482,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
|
|
||||||
// This is a hook to do some per-asset post-processing for subclasses that need that
|
// This is a hook to do some per-asset post-processing for subclasses that need that
|
||||||
if (remoteClient != null)
|
if (remoteClient != null)
|
||||||
ExportAsset(remoteClient.AgentId, assetID);
|
ExportAsset(remoteClient.AgentId, asset.FullID);
|
||||||
|
|
||||||
return assetID;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void ExportAsset(UUID agentID, UUID assetID)
|
protected virtual void ExportAsset(UUID agentID, UUID assetID)
|
||||||
|
@ -617,7 +630,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
if (null == item)
|
if (null == item)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[AGENT INVENTORY]: Object {0} {1} scheduled for save to inventory has already been deleted.",
|
"[INVENTORY ACCESS MODULE]: Object {0} {1} scheduled for save to inventory has already been deleted.",
|
||||||
so.Name, so.UUID);
|
so.Name, so.UUID);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -668,7 +681,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
{
|
{
|
||||||
// Catch all. Use lost & found
|
// Catch all. Use lost & found
|
||||||
//
|
//
|
||||||
|
|
||||||
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
|
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -718,7 +730,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
|
|
||||||
if (item == null)
|
if (item == null)
|
||||||
{
|
{
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -748,7 +759,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_log.WarnFormat(
|
m_log.WarnFormat(
|
||||||
"[InventoryAccessModule]: Could not find asset {0} for {1} in RezObject()",
|
"[INVENTORY ACCESS MODULE]: Could not find asset {0} for {1} in RezObject()",
|
||||||
assetID, remoteClient.Name);
|
assetID, remoteClient.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -859,7 +870,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
SceneObjectPart rootPart = group.RootPart;
|
SceneObjectPart rootPart = group.RootPart;
|
||||||
|
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[InventoryAccessModule]: Preparing to rez {0} {1} {2} ownermask={3:X} nextownermask={4:X} groupmask={5:X} everyonemask={6:X} for {7}",
|
// "[INVENTORY ACCESS MODULE]: Preparing to rez {0} {1} {2} ownermask={3:X} nextownermask={4:X} groupmask={5:X} everyonemask={6:X} for {7}",
|
||||||
// group.Name, group.LocalId, group.UUID,
|
// group.Name, group.LocalId, group.UUID,
|
||||||
// group.RootPart.OwnerMask, group.RootPart.NextOwnerMask, group.RootPart.GroupMask, group.RootPart.EveryoneMask,
|
// group.RootPart.OwnerMask, group.RootPart.NextOwnerMask, group.RootPart.GroupMask, group.RootPart.EveryoneMask,
|
||||||
// remoteClient.Name);
|
// remoteClient.Name);
|
||||||
|
@ -867,7 +878,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
// Vector3 storedPosition = group.AbsolutePosition;
|
// Vector3 storedPosition = group.AbsolutePosition;
|
||||||
if (group.UUID == UUID.Zero)
|
if (group.UUID == UUID.Zero)
|
||||||
{
|
{
|
||||||
m_log.Debug("[InventoryAccessModule]: Object has UUID.Zero! Position 3");
|
m_log.Debug("[INVENTORY ACCESS MODULE]: Object has UUID.Zero! Position 3");
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (SceneObjectPart part in group.Parts)
|
foreach (SceneObjectPart part in group.Parts)
|
||||||
|
@ -928,7 +939,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
}
|
}
|
||||||
|
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[InventoryAccessModule]: Rezzed {0} {1} {2} ownermask={3:X} nextownermask={4:X} groupmask={5:X} everyonemask={6:X} for {7}",
|
// "[INVENTORY ACCESS MODULE]: Rezzed {0} {1} {2} ownermask={3:X} nextownermask={4:X} groupmask={5:X} everyonemask={6:X} for {7}",
|
||||||
// group.Name, group.LocalId, group.UUID,
|
// group.Name, group.LocalId, group.UUID,
|
||||||
// group.RootPart.OwnerMask, group.RootPart.NextOwnerMask, group.RootPart.GroupMask, group.RootPart.EveryoneMask,
|
// group.RootPart.OwnerMask, group.RootPart.NextOwnerMask, group.RootPart.GroupMask, group.RootPart.EveryoneMask,
|
||||||
// remoteClient.Name);
|
// remoteClient.Name);
|
||||||
|
@ -1023,7 +1034,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
|
|
||||||
so.FromFolderID = item.Folder;
|
so.FromFolderID = item.Folder;
|
||||||
|
|
||||||
// Console.WriteLine("rootPart.OwnedID {0}, item.Owner {1}, item.CurrentPermissions {2:X}",
|
// m_log.DebugFormat(
|
||||||
|
// "[INVENTORY ACCESS MODULE]: rootPart.OwnedID {0}, item.Owner {1}, item.CurrentPermissions {2:X}",
|
||||||
// rootPart.OwnerID, item.Owner, item.CurrentPermissions);
|
// rootPart.OwnerID, item.Owner, item.CurrentPermissions);
|
||||||
|
|
||||||
if ((rootPart.OwnerID != item.Owner) ||
|
if ((rootPart.OwnerID != item.Owner) ||
|
||||||
|
@ -1160,7 +1172,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||||
if (assetRequestItem.AssetID != requestID)
|
if (assetRequestItem.AssetID != requestID)
|
||||||
{
|
{
|
||||||
m_log.WarnFormat(
|
m_log.WarnFormat(
|
||||||
"[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}",
|
"[INVENTORY ACCESS MODULE]: {0} requested asset {1} from item {2} but this does not match item's asset {3}",
|
||||||
Name, requestID, itemID, assetRequestItem.AssetID);
|
Name, requestID, itemID, assetRequestItem.AssetID);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -0,0 +1,224 @@
|
||||||
|
/*
|
||||||
|
* 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 OpenMetaverse;
|
||||||
|
using OpenSim.Framework;
|
||||||
|
using OpenSim.Framework.Capabilities;
|
||||||
|
using OpenSim.Framework.Servers.HttpServer;
|
||||||
|
using OpenSim.Region.Framework.Interfaces;
|
||||||
|
using OpenSim.Region.Framework.Scenes;
|
||||||
|
using log4net;
|
||||||
|
using Nini.Config;
|
||||||
|
using Mono.Addins;
|
||||||
|
|
||||||
|
using Caps = OpenSim.Framework.Capabilities.Caps;
|
||||||
|
|
||||||
|
|
||||||
|
namespace OpenSim.Region.CoreModules.World.LightShare
|
||||||
|
{
|
||||||
|
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "EnvironmentModule")]
|
||||||
|
|
||||||
|
public class EnvironmentModule : INonSharedRegionModule, IEnvironmentModule
|
||||||
|
{
|
||||||
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
|
private Scene m_scene = null;
|
||||||
|
private UUID regionID = UUID.Zero;
|
||||||
|
private static bool Enabled = false;
|
||||||
|
|
||||||
|
private static readonly string capsName = "EnvironmentSettings";
|
||||||
|
private static readonly string capsBase = "/CAPS/0020/";
|
||||||
|
|
||||||
|
private LLSDEnvironmentSetResponse setResponse = null;
|
||||||
|
|
||||||
|
#region INonSharedRegionModule
|
||||||
|
public void Initialise(IConfigSource source)
|
||||||
|
{
|
||||||
|
IConfig config = source.Configs["ClientStack.LindenCaps"];
|
||||||
|
|
||||||
|
if (null == config)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (config.GetString("Cap_EnvironmentSettings", String.Empty) != "localhost")
|
||||||
|
{
|
||||||
|
m_log.InfoFormat("[{0}]: Module is disabled.", Name);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Enabled = true;
|
||||||
|
|
||||||
|
m_log.InfoFormat("[{0}]: Module is enabled.", Name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Close()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Name
|
||||||
|
{
|
||||||
|
get { return "EnvironmentModule"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public Type ReplaceableInterface
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddRegion(Scene scene)
|
||||||
|
{
|
||||||
|
if (!Enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
scene.RegisterModuleInterface<IEnvironmentModule>(this);
|
||||||
|
m_scene = scene;
|
||||||
|
regionID = scene.RegionInfo.RegionID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RegionLoaded(Scene scene)
|
||||||
|
{
|
||||||
|
if (!Enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
setResponse = new LLSDEnvironmentSetResponse();
|
||||||
|
scene.EventManager.OnRegisterCaps += OnRegisterCaps;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveRegion(Scene scene)
|
||||||
|
{
|
||||||
|
if (Enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
scene.EventManager.OnRegisterCaps -= OnRegisterCaps;
|
||||||
|
m_scene = null;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region IEnvironmentModule
|
||||||
|
public void ResetEnvironmentSettings(UUID regionUUID)
|
||||||
|
{
|
||||||
|
if (!Enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_scene.SimulationDataService.RemoveRegionEnvironmentSettings(regionUUID);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Events
|
||||||
|
private void OnRegisterCaps(UUID agentID, Caps caps)
|
||||||
|
{
|
||||||
|
// m_log.DebugFormat("[{0}]: Register capability for agentID {1} in region {2}",
|
||||||
|
// Name, agentID, caps.RegionName);
|
||||||
|
|
||||||
|
string capsPath = capsBase + UUID.Random();
|
||||||
|
|
||||||
|
// Get handler
|
||||||
|
caps.RegisterHandler(
|
||||||
|
capsName,
|
||||||
|
new RestStreamHandler(
|
||||||
|
"GET",
|
||||||
|
capsPath,
|
||||||
|
(request, path, param, httpRequest, httpResponse)
|
||||||
|
=> GetEnvironmentSettings(request, path, param, agentID, caps),
|
||||||
|
capsName,
|
||||||
|
agentID.ToString()));
|
||||||
|
|
||||||
|
// Set handler
|
||||||
|
caps.HttpListener.AddStreamHandler(
|
||||||
|
new RestStreamHandler(
|
||||||
|
"POST",
|
||||||
|
capsPath,
|
||||||
|
(request, path, param, httpRequest, httpResponse)
|
||||||
|
=> SetEnvironmentSettings(request, path, param, agentID, caps),
|
||||||
|
capsName,
|
||||||
|
agentID.ToString()));
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private string GetEnvironmentSettings(string request, string path, string param,
|
||||||
|
UUID agentID, Caps caps)
|
||||||
|
{
|
||||||
|
// m_log.DebugFormat("[{0}]: Environment GET handle for agentID {1} in region {2}",
|
||||||
|
// Name, agentID, caps.RegionName);
|
||||||
|
|
||||||
|
string env = String.Empty;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
env = m_scene.SimulationDataService.LoadRegionEnvironmentSettings(regionID);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.ErrorFormat("[{0}]: Unable to load environment settings for region {1}, Exception: {2} - {3}",
|
||||||
|
Name, caps.RegionName, e.Message, e.StackTrace);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(env))
|
||||||
|
env = EnvironmentSettings.EmptySettings(UUID.Zero, regionID);
|
||||||
|
|
||||||
|
return env;
|
||||||
|
}
|
||||||
|
|
||||||
|
private string SetEnvironmentSettings(string request, string path, string param,
|
||||||
|
UUID agentID, Caps caps)
|
||||||
|
{
|
||||||
|
|
||||||
|
// m_log.DebugFormat("[{0}]: Environment SET handle from agentID {1} in region {2}",
|
||||||
|
// Name, agentID, caps.RegionName);
|
||||||
|
|
||||||
|
setResponse.regionID = regionID;
|
||||||
|
setResponse.success = false;
|
||||||
|
|
||||||
|
if (!m_scene.Permissions.CanIssueEstateCommand(agentID, false))
|
||||||
|
{
|
||||||
|
setResponse.fail_reason = "Insufficient estate permissions, settings has not been saved.";
|
||||||
|
return LLSDHelpers.SerialiseLLSDReply(setResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
m_scene.SimulationDataService.StoreRegionEnvironmentSettings(regionID, request);
|
||||||
|
setResponse.success = true;
|
||||||
|
|
||||||
|
m_log.InfoFormat("[{0}]: New Environment settings has been saved from agentID {1} in region {2}",
|
||||||
|
Name, agentID, caps.RegionName);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.ErrorFormat("[{0}]: Environment settings has not been saved for region {1}, Exception: {2} - {3}",
|
||||||
|
Name, caps.RegionName, e.Message, e.StackTrace);
|
||||||
|
|
||||||
|
setResponse.success = false;
|
||||||
|
setResponse.fail_reason = String.Format("Environment Set for region {0} has failed, settings has not been saved.", caps.RegionName);
|
||||||
|
}
|
||||||
|
|
||||||
|
return LLSDHelpers.SerialiseLLSDReply(setResponse);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -85,6 +85,10 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||||
private IHttpServer m_HttpsServer = null;
|
private IHttpServer m_HttpsServer = null;
|
||||||
|
|
||||||
private string m_ExternalHostNameForLSL = "";
|
private string m_ExternalHostNameForLSL = "";
|
||||||
|
public string ExternalHostNameForLSL
|
||||||
|
{
|
||||||
|
get { return m_ExternalHostNameForLSL; }
|
||||||
|
}
|
||||||
|
|
||||||
public Type ReplaceableInterface
|
public Type ReplaceableInterface
|
||||||
{
|
{
|
||||||
|
|
|
@ -122,7 +122,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Hypergrid
|
||||||
ISimulationService simService = scene.RequestModuleInterface<ISimulationService>();
|
ISimulationService simService = scene.RequestModuleInterface<ISimulationService>();
|
||||||
IFriendsSimConnector friendsConn = scene.RequestModuleInterface<IFriendsSimConnector>();
|
IFriendsSimConnector friendsConn = scene.RequestModuleInterface<IFriendsSimConnector>();
|
||||||
Object[] args = new Object[] { m_Config };
|
Object[] args = new Object[] { m_Config };
|
||||||
IFriendsService friendsService = ServerUtils.LoadPlugin<IFriendsService>(m_LocalServiceDll, args);
|
// IFriendsService friendsService = ServerUtils.LoadPlugin<IFriendsService>(m_LocalServiceDll, args)
|
||||||
|
ServerUtils.LoadPlugin<IFriendsService>(m_LocalServiceDll, args);
|
||||||
|
|
||||||
m_HypergridHandler = new GatekeeperServiceInConnector(m_Config, MainServer.Instance, simService);
|
m_HypergridHandler = new GatekeeperServiceInConnector(m_Config, MainServer.Instance, simService);
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||||
|
|
||||||
m_aScene = scene;
|
m_aScene = scene;
|
||||||
|
|
||||||
scene.RegisterModuleInterface<IAssetService>(this);
|
m_aScene.RegisterModuleInterface<IAssetService>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveRegion(Scene scene)
|
public void RemoveRegion(Scene scene)
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
*/
|
*/
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using log4net;
|
using log4net;
|
||||||
using Nini.Config;
|
using Nini.Config;
|
||||||
|
@ -41,22 +42,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
public class LocalSimulationConnectorModule : ISharedRegionModule, ISimulationService
|
public class LocalSimulationConnectorModule : ISharedRegionModule, ISimulationService
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
// Version of this service
|
|
||||||
|
/// <summary>
|
||||||
|
/// Version of this service
|
||||||
|
/// </summary>
|
||||||
private const string m_Version = "SIMULATION/0.1";
|
private const string m_Version = "SIMULATION/0.1";
|
||||||
|
|
||||||
private List<Scene> m_sceneList = new List<Scene>();
|
/// <summary>
|
||||||
|
/// Map region ID to scene.
|
||||||
private IEntityTransferModule m_AgentTransferModule;
|
/// </summary>
|
||||||
protected IEntityTransferModule AgentTransferModule
|
private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>();
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (m_AgentTransferModule == null)
|
|
||||||
m_AgentTransferModule = m_sceneList[0].RequestModuleInterface<IEntityTransferModule>();
|
|
||||||
return m_AgentTransferModule;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Is this module enabled?
|
||||||
|
/// </summary>
|
||||||
private bool m_ModuleEnabled = false;
|
private bool m_ModuleEnabled = false;
|
||||||
|
|
||||||
#region IRegionModule
|
#region IRegionModule
|
||||||
|
@ -129,12 +128,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
/// <param name="scene"></param>
|
/// <param name="scene"></param>
|
||||||
public void RemoveScene(Scene scene)
|
public void RemoveScene(Scene scene)
|
||||||
{
|
{
|
||||||
lock (m_sceneList)
|
lock (m_scenes)
|
||||||
{
|
{
|
||||||
if (m_sceneList.Contains(scene))
|
if (m_scenes.ContainsKey(scene.RegionInfo.RegionID))
|
||||||
{
|
m_scenes.Remove(scene.RegionInfo.RegionID);
|
||||||
m_sceneList.Remove(scene);
|
else
|
||||||
}
|
m_log.WarnFormat(
|
||||||
|
"[LOCAL SIMULATION CONNECTOR]: Tried to remove region {0} but it was not present",
|
||||||
|
scene.RegionInfo.RegionName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,13 +145,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
/// <param name="scene"></param>
|
/// <param name="scene"></param>
|
||||||
public void Init(Scene scene)
|
public void Init(Scene scene)
|
||||||
{
|
{
|
||||||
if (!m_sceneList.Contains(scene))
|
lock (m_scenes)
|
||||||
{
|
{
|
||||||
lock (m_sceneList)
|
if (!m_scenes.ContainsKey(scene.RegionInfo.RegionID))
|
||||||
{
|
m_scenes[scene.RegionInfo.RegionID] = scene;
|
||||||
m_sceneList.Add(scene);
|
else
|
||||||
}
|
m_log.WarnFormat(
|
||||||
|
"[LOCAL SIMULATION CONNECTOR]: Tried to add region {0} but it is already present",
|
||||||
|
scene.RegionInfo.RegionName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,15 +160,24 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
|
|
||||||
#region ISimulation
|
#region ISimulation
|
||||||
|
|
||||||
public IScene GetScene(ulong regionhandle)
|
public IScene GetScene(UUID regionId)
|
||||||
{
|
{
|
||||||
foreach (Scene s in m_sceneList)
|
if (m_scenes.ContainsKey(regionId))
|
||||||
{
|
{
|
||||||
if (s.RegionInfo.RegionHandle == regionhandle)
|
return m_scenes[regionId];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// FIXME: This was pre-existing behaviour but possibly not a good idea, since it hides an error rather
|
||||||
|
// than making it obvious and fixable. Need to see if the error message comes up in practice.
|
||||||
|
Scene s = m_scenes.Values.ToArray()[0];
|
||||||
|
|
||||||
|
m_log.ErrorFormat(
|
||||||
|
"[LOCAL SIMULATION CONNECTOR]: Region with id {0} not found. Returning {1} {2} instead",
|
||||||
|
regionId, s.RegionInfo.RegionName, s.RegionInfo.RegionID);
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
// ? weird. should not happen
|
|
||||||
return m_sceneList[0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ISimulationService GetInnerService()
|
public ISimulationService GetInnerService()
|
||||||
|
@ -187,13 +198,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (Scene s in m_sceneList)
|
if (m_scenes.ContainsKey(destination.RegionID))
|
||||||
{
|
|
||||||
if (s.RegionInfo.RegionHandle == destination.RegionHandle)
|
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Found region {0} to send SendCreateChildAgent", destination.RegionName);
|
// m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Found region {0} to send SendCreateChildAgent", destination.RegionName);
|
||||||
return s.NewUserConnection(aCircuit, teleportFlags, out reason);
|
return m_scenes[destination.RegionID].NewUserConnection(aCircuit, teleportFlags, out reason);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reason = "Did not find region " + destination.RegionName;
|
reason = "Did not find region " + destination.RegionName;
|
||||||
|
@ -205,17 +213,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
if (destination == null)
|
if (destination == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
foreach (Scene s in m_sceneList)
|
if (m_scenes.ContainsKey(destination.RegionID))
|
||||||
{
|
|
||||||
if (s.RegionInfo.RegionHandle == destination.RegionHandle)
|
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate",
|
// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate",
|
||||||
// s.RegionInfo.RegionName, destination.RegionHandle);
|
// s.RegionInfo.RegionName, destination.RegionHandle);
|
||||||
|
|
||||||
s.IncomingChildAgentDataUpdate(cAgentData);
|
return m_scenes[destination.RegionID].IncomingChildAgentDataUpdate(cAgentData);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// m_log.DebugFormat("[LOCAL COMMS]: Did not find region {0} for ChildAgentUpdate", regionHandle);
|
// m_log.DebugFormat("[LOCAL COMMS]: Did not find region {0} for ChildAgentUpdate", regionHandle);
|
||||||
|
@ -231,11 +235,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
// simulator so when we receive the update we need to hand it to each of the
|
// simulator so when we receive the update we need to hand it to each of the
|
||||||
// scenes; scenes each check to see if the is a scene presence for the avatar
|
// scenes; scenes each check to see if the is a scene presence for the avatar
|
||||||
// note that we really don't need the GridRegion for this call
|
// note that we really don't need the GridRegion for this call
|
||||||
foreach (Scene s in m_sceneList)
|
foreach (Scene s in m_scenes.Values)
|
||||||
{
|
{
|
||||||
//m_log.Debug("[LOCAL COMMS]: Found region to send ChildAgentUpdate");
|
//m_log.Debug("[LOCAL COMMS]: Found region to send ChildAgentUpdate");
|
||||||
s.IncomingChildAgentDataUpdate(cAgentData);
|
s.IncomingChildAgentDataUpdate(cAgentData);
|
||||||
}
|
}
|
||||||
|
|
||||||
//m_log.Debug("[LOCAL COMMS]: region not found for ChildAgentUpdate");
|
//m_log.Debug("[LOCAL COMMS]: region not found for ChildAgentUpdate");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -247,14 +252,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
if (destination == null)
|
if (destination == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
foreach (Scene s in m_sceneList)
|
if (m_scenes.ContainsKey(destination.RegionID))
|
||||||
{
|
{
|
||||||
if (s.RegionInfo.RegionHandle == destination.RegionHandle)
|
// m_log.DebugFormat(
|
||||||
{
|
// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate",
|
||||||
//m_log.Debug("[LOCAL COMMS]: Found region to send ChildAgentUpdate");
|
// s.RegionInfo.RegionName, destination.RegionHandle);
|
||||||
return s.IncomingRetrieveRootAgent(id, out agent);
|
|
||||||
}
|
return m_scenes[destination.RegionID].IncomingRetrieveRootAgent(id, out agent);
|
||||||
}
|
}
|
||||||
|
|
||||||
//m_log.Debug("[LOCAL COMMS]: region not found for ChildAgentUpdate");
|
//m_log.Debug("[LOCAL COMMS]: region not found for ChildAgentUpdate");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -266,59 +272,49 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
if (destination == null)
|
if (destination == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
foreach (Scene s in m_sceneList)
|
if (m_scenes.ContainsKey(destination.RegionID))
|
||||||
{
|
{
|
||||||
if (s.RegionInfo.RegionID == destination.RegionID)
|
// m_log.DebugFormat(
|
||||||
return s.QueryAccess(id, position, out reason);
|
// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate",
|
||||||
|
// s.RegionInfo.RegionName, destination.RegionHandle);
|
||||||
|
|
||||||
|
return m_scenes[destination.RegionID].QueryAccess(id, position, out reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ReleaseAgent(UUID origin, UUID id, string uri)
|
public bool ReleaseAgent(UUID originId, UUID agentId, string uri)
|
||||||
{
|
{
|
||||||
foreach (Scene s in m_sceneList)
|
if (m_scenes.ContainsKey(originId))
|
||||||
{
|
{
|
||||||
if (s.RegionInfo.RegionID == origin)
|
// m_log.DebugFormat(
|
||||||
{
|
// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate",
|
||||||
// m_log.Debug("[LOCAL COMMS]: Found region to SendReleaseAgent");
|
// s.RegionInfo.RegionName, destination.RegionHandle);
|
||||||
AgentTransferModule.AgentArrivedAtDestination(id);
|
|
||||||
|
m_scenes[originId].EntityTransferModule.AgentArrivedAtDestination(agentId);
|
||||||
return true;
|
return true;
|
||||||
// return s.IncomingReleaseAgent(id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//m_log.Debug("[LOCAL COMMS]: region not found in SendReleaseAgent " + origin);
|
//m_log.Debug("[LOCAL COMMS]: region not found in SendReleaseAgent " + origin);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CloseChildAgent(GridRegion destination, UUID id)
|
||||||
|
{
|
||||||
|
return CloseAgent(destination, id);
|
||||||
|
}
|
||||||
|
|
||||||
public bool CloseAgent(GridRegion destination, UUID id)
|
public bool CloseAgent(GridRegion destination, UUID id)
|
||||||
{
|
{
|
||||||
if (destination == null)
|
if (destination == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
foreach (Scene s in m_sceneList)
|
if (m_scenes.ContainsKey(destination.RegionID))
|
||||||
{
|
{
|
||||||
if (s.RegionInfo.RegionID == destination.RegionID)
|
Util.FireAndForget(delegate { m_scenes[destination.RegionID].IncomingCloseAgent(id); });
|
||||||
{
|
return true;
|
||||||
//m_log.Debug("[LOCAL COMMS]: Found region to SendCloseAgent");
|
|
||||||
return s.IncomingCloseAgent(id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool CloseChildAgent(GridRegion destination, UUID id)
|
|
||||||
{
|
|
||||||
if (destination == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
foreach (Scene s in m_sceneList)
|
|
||||||
{
|
|
||||||
if (s.RegionInfo.RegionID == destination.RegionID)
|
|
||||||
{
|
|
||||||
//m_log.Debug("[LOCAL COMMS]: Found region to SendCloseAgent");
|
|
||||||
return s.IncomingCloseChildAgent(id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent");
|
//m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent");
|
||||||
return false;
|
return false;
|
||||||
|
@ -333,11 +329,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
if (destination == null)
|
if (destination == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
foreach (Scene s in m_sceneList)
|
if (m_scenes.ContainsKey(destination.RegionID))
|
||||||
{
|
{
|
||||||
if (s.RegionInfo.RegionHandle == destination.RegionHandle)
|
// m_log.DebugFormat(
|
||||||
{
|
// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate",
|
||||||
//m_log.Debug("[LOCAL COMMS]: Found region to SendCreateObject");
|
// s.RegionInfo.RegionName, destination.RegionHandle);
|
||||||
|
|
||||||
|
Scene s = m_scenes[destination.RegionID];
|
||||||
|
|
||||||
if (isLocalCall)
|
if (isLocalCall)
|
||||||
{
|
{
|
||||||
// We need to make a local copy of the object
|
// We need to make a local copy of the object
|
||||||
|
@ -351,7 +350,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
return s.IncomingCreateObject(newPosition, sog);
|
return s.IncomingCreateObject(newPosition, sog);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -360,13 +359,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
if (destination == null)
|
if (destination == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
foreach (Scene s in m_sceneList)
|
if (m_scenes.ContainsKey(destination.RegionID))
|
||||||
{
|
{
|
||||||
if (s.RegionInfo.RegionHandle == destination.RegionHandle)
|
// m_log.DebugFormat(
|
||||||
{
|
// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate",
|
||||||
return s.IncomingCreateObject(userID, itemID);
|
// s.RegionInfo.RegionName, destination.RegionHandle);
|
||||||
}
|
|
||||||
|
return m_scenes[destination.RegionID].IncomingCreateObject(userID, itemID);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -377,18 +378,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
|
|
||||||
public bool IsLocalRegion(ulong regionhandle)
|
public bool IsLocalRegion(ulong regionhandle)
|
||||||
{
|
{
|
||||||
foreach (Scene s in m_sceneList)
|
foreach (Scene s in m_scenes.Values)
|
||||||
if (s.RegionInfo.RegionHandle == regionhandle)
|
if (s.RegionInfo.RegionHandle == regionhandle)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsLocalRegion(UUID id)
|
public bool IsLocalRegion(UUID id)
|
||||||
{
|
{
|
||||||
foreach (Scene s in m_sceneList)
|
return m_scenes.ContainsKey(id);
|
||||||
if (s.RegionInfo.RegionID == id)
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -151,9 +151,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
|
|
||||||
#region IInterregionComms
|
#region IInterregionComms
|
||||||
|
|
||||||
public IScene GetScene(ulong handle)
|
public IScene GetScene(UUID regionId)
|
||||||
{
|
{
|
||||||
return m_localBackend.GetScene(handle);
|
return m_localBackend.GetScene(regionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ISimulationService GetInnerService()
|
public ISimulationService GetInnerService()
|
||||||
|
@ -226,13 +226,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
return m_remoteConnector.RetrieveAgent(destination, id, out agent);
|
return m_remoteConnector.RetrieveAgent(destination, id, out agent);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason)
|
public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason)
|
||||||
{
|
{
|
||||||
reason = "Communications failure";
|
reason = "Communications failure";
|
||||||
version = "Unknown";
|
version = "Unknown";
|
||||||
|
|
||||||
if (destination == null)
|
if (destination == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -245,7 +245,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
return m_remoteConnector.QueryAccess(destination, id, position, out version, out reason);
|
return m_remoteConnector.QueryAccess(destination, id, position, out version, out reason);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ReleaseAgent(UUID origin, UUID id, string uri)
|
public bool ReleaseAgent(UUID origin, UUID id, string uri)
|
||||||
|
|
|
@ -428,9 +428,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
s = sw.ToString();
|
s = sw.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_scene != null)
|
// if (m_scene != null)
|
||||||
Console.WriteLine(
|
// Console.WriteLine(
|
||||||
"[ARCHIVE WRITE REQUEST PREPARATION]: Control file for {0} is: {1}", m_scene.RegionInfo.RegionName, s);
|
// "[ARCHIVE WRITE REQUEST PREPARATION]: Control file for {0} is: {1}", m_scene.RegionInfo.RegionName, s);
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,155 @@
|
||||||
|
/*
|
||||||
|
* 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 System.Text.RegularExpressions;
|
||||||
|
using log4net;
|
||||||
|
using Mono.Addins;
|
||||||
|
using NDesk.Options;
|
||||||
|
using Nini.Config;
|
||||||
|
using OpenMetaverse;
|
||||||
|
using OpenSim.Framework;
|
||||||
|
using OpenSim.Framework.Console;
|
||||||
|
using OpenSim.Framework.Statistics;
|
||||||
|
using OpenSim.Region.Framework.Interfaces;
|
||||||
|
using OpenSim.Region.Framework.Scenes;
|
||||||
|
|
||||||
|
namespace OpenSim.Region.CoreModules.World.Objects.Commands
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A module that holds commands for manipulating objects in the scene.
|
||||||
|
/// </summary>
|
||||||
|
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RegionCommandsModule")]
|
||||||
|
public class RegionCommandsModule : INonSharedRegionModule
|
||||||
|
{
|
||||||
|
private Scene m_scene;
|
||||||
|
private ICommandConsole m_console;
|
||||||
|
|
||||||
|
public string Name { get { return "Region Commands Module"; } }
|
||||||
|
|
||||||
|
public Type ReplaceableInterface { get { return null; } }
|
||||||
|
|
||||||
|
public void Initialise(IConfigSource source)
|
||||||
|
{
|
||||||
|
// m_log.DebugFormat("[REGION COMMANDS MODULE]: INITIALIZED MODULE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void PostInitialise()
|
||||||
|
{
|
||||||
|
// m_log.DebugFormat("[REGION COMMANDS MODULE]: POST INITIALIZED MODULE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Close()
|
||||||
|
{
|
||||||
|
// m_log.DebugFormat("[REGION COMMANDS MODULE]: CLOSED MODULE");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddRegion(Scene scene)
|
||||||
|
{
|
||||||
|
// m_log.DebugFormat("[REGION COMMANDS MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName);
|
||||||
|
|
||||||
|
m_scene = scene;
|
||||||
|
m_console = MainConsole.Instance;
|
||||||
|
|
||||||
|
m_console.Commands.AddCommand(
|
||||||
|
"Regions", false, "show scene",
|
||||||
|
"show scene",
|
||||||
|
"Show live scene information for the currently selected region.", HandleShowScene);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveRegion(Scene scene)
|
||||||
|
{
|
||||||
|
// m_log.DebugFormat("[REGION COMMANDS MODULE]: REGION {0} REMOVED", scene.RegionInfo.RegionName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RegionLoaded(Scene scene)
|
||||||
|
{
|
||||||
|
// m_log.DebugFormat("[REGION COMMANDS MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HandleShowScene(string module, string[] cmd)
|
||||||
|
{
|
||||||
|
if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene))
|
||||||
|
return;
|
||||||
|
|
||||||
|
SimStatsReporter r = m_scene.StatsReporter;
|
||||||
|
float[] stats = r.LastReportedSimStats;
|
||||||
|
|
||||||
|
float timeDilation = stats[0];
|
||||||
|
float simFps = stats[1];
|
||||||
|
float physicsFps = stats[2];
|
||||||
|
float agentUpdates = stats[3];
|
||||||
|
float rootAgents = stats[4];
|
||||||
|
float childAgents = stats[5];
|
||||||
|
float totalPrims = stats[6];
|
||||||
|
float activePrims = stats[7];
|
||||||
|
float totalFrameTime = stats[8];
|
||||||
|
// float netFrameTime = stats.StatsBlock[9].StatValue; // Ignored - not used by OpenSimulator
|
||||||
|
float physicsFrameTime = stats[10];
|
||||||
|
float otherFrameTime = stats[11];
|
||||||
|
// float imageFrameTime = stats.StatsBlock[12].StatValue; // Ignored
|
||||||
|
float inPacketsPerSecond = stats[13];
|
||||||
|
float outPacketsPerSecond = stats[14];
|
||||||
|
float unackedBytes = stats[15];
|
||||||
|
// float agentFrameTime = stats.StatsBlock[16].StatValue; // Not really used
|
||||||
|
float pendingDownloads = stats[17];
|
||||||
|
float pendingUploads = stats[18];
|
||||||
|
float activeScripts = stats[19];
|
||||||
|
float scriptLinesPerSecond = stats[20];
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.AppendFormat("Scene statistics for {0}\n", m_scene.RegionInfo.RegionName);
|
||||||
|
|
||||||
|
ConsoleDisplayList dispList = new ConsoleDisplayList();
|
||||||
|
dispList.AddRow("Time Dilation", timeDilation);
|
||||||
|
dispList.AddRow("Sim FPS", simFps);
|
||||||
|
dispList.AddRow("Physics FPS", physicsFps);
|
||||||
|
dispList.AddRow("Avatars", rootAgents);
|
||||||
|
dispList.AddRow("Child agents", childAgents);
|
||||||
|
dispList.AddRow("Total prims", totalPrims);
|
||||||
|
dispList.AddRow("Scripts", activeScripts);
|
||||||
|
dispList.AddRow("Script lines processed per second", scriptLinesPerSecond);
|
||||||
|
dispList.AddRow("Physics enabled prims", activePrims);
|
||||||
|
dispList.AddRow("Total frame time", totalFrameTime);
|
||||||
|
dispList.AddRow("Physics frame time", physicsFrameTime);
|
||||||
|
dispList.AddRow("Other frame time", otherFrameTime);
|
||||||
|
dispList.AddRow("Agent Updates per second", agentUpdates);
|
||||||
|
dispList.AddRow("Packets processed from clients per second", inPacketsPerSecond);
|
||||||
|
dispList.AddRow("Packets sent to clients per second", outPacketsPerSecond);
|
||||||
|
dispList.AddRow("Bytes unacknowledged by clients", unackedBytes);
|
||||||
|
dispList.AddRow("Pending asset downloads to clients", pendingDownloads);
|
||||||
|
dispList.AddRow("Pending asset uploads from clients", pendingUploads);
|
||||||
|
|
||||||
|
dispList.AddToStringBuilder(sb);
|
||||||
|
|
||||||
|
MainConsole.Instance.Output(sb.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -59,7 +59,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||||
}
|
}
|
||||||
|
|
||||||
//Returns true if this extension is supported for terrain save-tile
|
//Returns true if this extension is supported for terrain save-tile
|
||||||
public bool SupportsTileSave()
|
public override bool SupportsTileSave()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||||
bool eof = false;
|
bool eof = false;
|
||||||
|
|
||||||
int fileXPoints = 0;
|
int fileXPoints = 0;
|
||||||
int fileYPoints = 0;
|
// int fileYPoints = 0;
|
||||||
|
|
||||||
// Terragen file
|
// Terragen file
|
||||||
while (eof == false)
|
while (eof == false)
|
||||||
|
@ -75,7 +75,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||||
{
|
{
|
||||||
case "SIZE":
|
case "SIZE":
|
||||||
fileXPoints = bs.ReadInt16() + 1;
|
fileXPoints = bs.ReadInt16() + 1;
|
||||||
fileYPoints = fileXPoints;
|
// fileYPoints = fileXPoints;
|
||||||
bs.ReadInt16();
|
bs.ReadInt16();
|
||||||
break;
|
break;
|
||||||
case "XPTS":
|
case "XPTS":
|
||||||
|
@ -83,7 +83,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||||
bs.ReadInt16();
|
bs.ReadInt16();
|
||||||
break;
|
break;
|
||||||
case "YPTS":
|
case "YPTS":
|
||||||
fileYPoints = bs.ReadInt16();
|
// fileYPoints = bs.ReadInt16();
|
||||||
|
bs.ReadInt16();
|
||||||
bs.ReadInt16();
|
bs.ReadInt16();
|
||||||
break;
|
break;
|
||||||
case "ALTW":
|
case "ALTW":
|
||||||
|
@ -164,10 +165,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||||
bool eof = false;
|
bool eof = false;
|
||||||
if (Encoding.ASCII.GetString(bs.ReadBytes(16)) == "TERRAGENTERRAIN ")
|
if (Encoding.ASCII.GetString(bs.ReadBytes(16)) == "TERRAGENTERRAIN ")
|
||||||
{
|
{
|
||||||
|
// int fileWidth = w;
|
||||||
int fileWidth = w;
|
// int fileHeight = h;
|
||||||
int fileHeight = h;
|
|
||||||
|
|
||||||
|
|
||||||
// Terragen file
|
// Terragen file
|
||||||
while (eof == false)
|
while (eof == false)
|
||||||
|
@ -176,17 +175,22 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||||
switch (tmp)
|
switch (tmp)
|
||||||
{
|
{
|
||||||
case "SIZE":
|
case "SIZE":
|
||||||
int sztmp = bs.ReadInt16() + 1;
|
// int sztmp = bs.ReadInt16() + 1;
|
||||||
fileWidth = sztmp;
|
// fileWidth = sztmp;
|
||||||
fileHeight = sztmp;
|
// fileHeight = sztmp;
|
||||||
|
bs.ReadInt16();
|
||||||
|
bs.ReadInt16();
|
||||||
|
bs.ReadInt16();
|
||||||
bs.ReadInt16();
|
bs.ReadInt16();
|
||||||
break;
|
break;
|
||||||
case "XPTS":
|
case "XPTS":
|
||||||
fileWidth = bs.ReadInt16();
|
// fileWidth = bs.ReadInt16();
|
||||||
|
bs.ReadInt16();
|
||||||
bs.ReadInt16();
|
bs.ReadInt16();
|
||||||
break;
|
break;
|
||||||
case "YPTS":
|
case "YPTS":
|
||||||
fileHeight = bs.ReadInt16();
|
// fileHeight = bs.ReadInt16();
|
||||||
|
bs.ReadInt16();
|
||||||
bs.ReadInt16();
|
bs.ReadInt16();
|
||||||
break;
|
break;
|
||||||
case "ALTW":
|
case "ALTW":
|
||||||
|
|
|
@ -165,6 +165,19 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
/// </returns>
|
/// </returns>
|
||||||
List<TaskInventoryItem> GetInventoryItems();
|
List<TaskInventoryItem> GetInventoryItems();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets an inventory item by name
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This method returns the first inventory item that matches the given name. In SL this is all you need
|
||||||
|
/// since each item in a prim inventory must have a unique name.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name='name'></param>
|
||||||
|
/// <returns>
|
||||||
|
/// The inventory item. Null if no such item was found.
|
||||||
|
/// </returns>
|
||||||
|
TaskInventoryItem GetInventoryItem(string name);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get inventory items by name.
|
/// Get inventory items by name.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -57,6 +57,13 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
void DoTeleport(ScenePresence sp, GridRegion reg, GridRegion finalDestination,
|
void DoTeleport(ScenePresence sp, GridRegion reg, GridRegion finalDestination,
|
||||||
Vector3 position, Vector3 lookAt, uint teleportFlags);
|
Vector3 position, Vector3 lookAt, uint teleportFlags);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Show whether the given agent is being teleported.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name='id'>The agent ID</para></param>
|
||||||
|
/// <returns>true if the agent is in the process of being teleported, false otherwise.</returns>
|
||||||
|
bool IsInTransit(UUID id);
|
||||||
|
|
||||||
bool Cross(ScenePresence agent, bool isFlying);
|
bool Cross(ScenePresence agent, bool isFlying);
|
||||||
|
|
||||||
void AgentArrivedAtDestination(UUID agent);
|
void AgentArrivedAtDestination(UUID agent);
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
/*
|
||||||
|
* 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 OpenMetaverse;
|
||||||
|
|
||||||
|
namespace OpenSim.Region.Framework.Interfaces
|
||||||
|
{
|
||||||
|
public interface IEnvironmentModule
|
||||||
|
{
|
||||||
|
void ResetEnvironmentSettings(UUID regionUUID);
|
||||||
|
}
|
||||||
|
}
|
|
@ -49,11 +49,15 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
/// <param name="folderID"></param>
|
/// <param name="folderID"></param>
|
||||||
/// <param name="objectGroups"></param>
|
/// <param name="objectGroups"></param>
|
||||||
/// <param name="remoteClient"></param>
|
/// <param name="remoteClient"></param>
|
||||||
|
/// <param name="asAttachment">
|
||||||
|
/// Should be true if the object(s) are begin taken as attachments. False otherwise.
|
||||||
|
/// </param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// Returns the UUID of the newly created item asset (not the item itself).
|
/// A list of the items created. If there was more than one object and objects are not being coaleseced in
|
||||||
/// FIXME: This is not very useful. It would be far more useful to return a list of items instead.
|
/// inventory, then the order of items is in the same order as the input objects.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
UUID CopyToInventory(DeRezAction action, UUID folderID, List<SceneObjectGroup> objectGroups, IClientAPI remoteClient);
|
List<InventoryItemBase> CopyToInventory(
|
||||||
|
DeRezAction action, UUID folderID, List<SceneObjectGroup> objectGroups, IClientAPI remoteClient, bool asAttachment);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Rez an object into the scene from the user's inventory
|
/// Rez an object into the scene from the user's inventory
|
||||||
|
|
|
@ -95,5 +95,26 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID);
|
RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID);
|
||||||
void StoreRegionWindlightSettings(RegionLightShareData wl);
|
void StoreRegionWindlightSettings(RegionLightShareData wl);
|
||||||
void RemoveRegionWindlightSettings(UUID regionID);
|
void RemoveRegionWindlightSettings(UUID regionID);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Load Environment settings from region storage
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="regionUUID">the region UUID</param>
|
||||||
|
/// <returns>LLSD string for viewer</returns>
|
||||||
|
string LoadRegionEnvironmentSettings(UUID regionUUID);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Store Environment settings into region storage
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="regionUUID">the region UUID</param>
|
||||||
|
/// <param name="settings">LLSD string from viewer</param>
|
||||||
|
void StoreRegionEnvironmentSettings(UUID regionUUID, string settings);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete Environment settings from region storage
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="regionUUID">the region UUID</param>
|
||||||
|
void RemoveRegionEnvironmentSettings(UUID regionUUID);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,6 +107,26 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
void StoreRegionWindlightSettings(RegionLightShareData wl);
|
void StoreRegionWindlightSettings(RegionLightShareData wl);
|
||||||
void RemoveRegionWindlightSettings(UUID regionID);
|
void RemoveRegionWindlightSettings(UUID regionID);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Load Environment settings from region storage
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="regionUUID">the region UUID</param>
|
||||||
|
/// <returns>LLSD string for viewer</returns>
|
||||||
|
string LoadRegionEnvironmentSettings(UUID regionUUID);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Store Environment settings into region storage
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="regionUUID">the region UUID</param>
|
||||||
|
/// <param name="settings">LLSD string from viewer</param>
|
||||||
|
void StoreRegionEnvironmentSettings(UUID regionUUID, string settings);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete Environment settings from region storage
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="regionUUID">the region UUID</param>
|
||||||
|
void RemoveRegionEnvironmentSettings(UUID regionUUID);
|
||||||
|
|
||||||
void Shutdown();
|
void Shutdown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
{
|
{
|
||||||
public interface IUrlModule
|
public interface IUrlModule
|
||||||
{
|
{
|
||||||
|
string ExternalHostNameForLSL { get; }
|
||||||
UUID RequestURL(IScriptModule engine, SceneObjectPart host, UUID itemID);
|
UUID RequestURL(IScriptModule engine, SceneObjectPart host, UUID itemID);
|
||||||
UUID RequestSecureURL(IScriptModule engine, SceneObjectPart host, UUID itemID);
|
UUID RequestSecureURL(IScriptModule engine, SceneObjectPart host, UUID itemID);
|
||||||
void ReleaseURL(string url);
|
void ReleaseURL(string url);
|
||||||
|
|
|
@ -155,7 +155,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>();
|
IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>();
|
||||||
if (invAccess != null)
|
if (invAccess != null)
|
||||||
invAccess.CopyToInventory(x.action, x.folderID, x.objectGroups, x.remoteClient);
|
invAccess.CopyToInventory(x.action, x.folderID, x.objectGroups, x.remoteClient, false);
|
||||||
|
|
||||||
if (x.permissionToDelete)
|
if (x.permissionToDelete)
|
||||||
{
|
{
|
||||||
|
|
|
@ -954,8 +954,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
sbyte invType, sbyte type, UUID olditemID)
|
sbyte invType, sbyte type, UUID olditemID)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[AGENT INVENTORY]: Received request from {0} to create inventory item link {1} in folder {2} pointing to {3}",
|
// "[AGENT INVENTORY]: Received request from {0} to create inventory item link {1} in folder {2} pointing to {3}, assetType {4}, inventoryType {5}",
|
||||||
// remoteClient.Name, name, folderID, olditemID);
|
// remoteClient.Name, name, folderID, olditemID, (AssetType)type, (InventoryType)invType);
|
||||||
|
|
||||||
if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId))
|
if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId))
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -77,7 +77,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
public bool DebugUpdates { get; private set; }
|
public bool DebugUpdates { get; private set; }
|
||||||
|
|
||||||
public SynchronizeSceneHandler SynchronizeScene;
|
public SynchronizeSceneHandler SynchronizeScene;
|
||||||
public SimStatsReporter StatsReporter;
|
|
||||||
|
/// <summary>
|
||||||
|
/// Statistical information for this scene.
|
||||||
|
/// </summary>
|
||||||
|
public SimStatsReporter StatsReporter { get; private set; }
|
||||||
|
|
||||||
public List<Border> NorthBorders = new List<Border>();
|
public List<Border> NorthBorders = new List<Border>();
|
||||||
public List<Border> EastBorders = new List<Border>();
|
public List<Border> EastBorders = new List<Border>();
|
||||||
public List<Border> SouthBorders = new List<Border>();
|
public List<Border> SouthBorders = new List<Border>();
|
||||||
|
@ -164,7 +169,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
protected IConfigSource m_config;
|
protected IConfigSource m_config;
|
||||||
protected IRegionSerialiserModule m_serialiser;
|
protected IRegionSerialiserModule m_serialiser;
|
||||||
protected IDialogModule m_dialogModule;
|
protected IDialogModule m_dialogModule;
|
||||||
protected IEntityTransferModule m_teleportModule;
|
|
||||||
protected ICapabilitiesModule m_capsModule;
|
protected ICapabilitiesModule m_capsModule;
|
||||||
protected IGroupsModule m_groupsModule;
|
protected IGroupsModule m_groupsModule;
|
||||||
|
|
||||||
|
@ -515,6 +519,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
public IAttachmentsModule AttachmentsModule { get; set; }
|
public IAttachmentsModule AttachmentsModule { get; set; }
|
||||||
|
public IEntityTransferModule EntityTransferModule { get; private set; }
|
||||||
|
|
||||||
public IAvatarFactoryModule AvatarFactory
|
public IAvatarFactoryModule AvatarFactory
|
||||||
{
|
{
|
||||||
|
@ -952,8 +957,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
List<ulong> old = new List<ulong>();
|
List<ulong> old = new List<ulong>();
|
||||||
old.Add(otherRegion.RegionHandle);
|
old.Add(otherRegion.RegionHandle);
|
||||||
agent.DropOldNeighbours(old);
|
agent.DropOldNeighbours(old);
|
||||||
if (m_teleportModule != null && agent.PresenceType != PresenceType.Npc)
|
if (EntityTransferModule != null && agent.PresenceType != PresenceType.Npc)
|
||||||
m_teleportModule.EnableChildAgent(agent, otherRegion);
|
EntityTransferModule.EnableChildAgent(agent, otherRegion);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (NullReferenceException)
|
catch (NullReferenceException)
|
||||||
|
@ -1060,14 +1065,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_log.Error("[REGION]: Closing");
|
||||||
|
Close();
|
||||||
|
|
||||||
if (PhysicsScene != null)
|
if (PhysicsScene != null)
|
||||||
{
|
{
|
||||||
PhysicsScene.Dispose();
|
PhysicsScene.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.Error("[REGION]: Closing");
|
|
||||||
Close();
|
|
||||||
|
|
||||||
m_log.Error("[REGION]: Firing Region Restart Message");
|
m_log.Error("[REGION]: Firing Region Restart Message");
|
||||||
|
|
||||||
base.Restart();
|
base.Restart();
|
||||||
|
@ -1090,8 +1095,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
ForEachRootScenePresence(delegate(ScenePresence agent)
|
ForEachRootScenePresence(delegate(ScenePresence agent)
|
||||||
{
|
{
|
||||||
if (m_teleportModule != null && agent.PresenceType != PresenceType.Npc)
|
if (EntityTransferModule != null && agent.PresenceType != PresenceType.Npc)
|
||||||
m_teleportModule.EnableChildAgent(agent, r);
|
EntityTransferModule.EnableChildAgent(agent, r);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (NullReferenceException)
|
catch (NullReferenceException)
|
||||||
|
@ -1281,7 +1286,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_serialiser = RequestModuleInterface<IRegionSerialiserModule>();
|
m_serialiser = RequestModuleInterface<IRegionSerialiserModule>();
|
||||||
m_dialogModule = RequestModuleInterface<IDialogModule>();
|
m_dialogModule = RequestModuleInterface<IDialogModule>();
|
||||||
m_capsModule = RequestModuleInterface<ICapabilitiesModule>();
|
m_capsModule = RequestModuleInterface<ICapabilitiesModule>();
|
||||||
m_teleportModule = RequestModuleInterface<IEntityTransferModule>();
|
EntityTransferModule = RequestModuleInterface<IEntityTransferModule>();
|
||||||
m_groupsModule = RequestModuleInterface<IGroupsModule>();
|
m_groupsModule = RequestModuleInterface<IGroupsModule>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2380,8 +2385,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_teleportModule != null)
|
if (EntityTransferModule != null)
|
||||||
m_teleportModule.Cross(grp, attemptedPosition, silent);
|
EntityTransferModule.Cross(grp, attemptedPosition, silent);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Border GetCrossedBorder(Vector3 position, Cardinals gridline)
|
public Border GetCrossedBorder(Vector3 position, Cardinals gridline)
|
||||||
|
@ -3225,8 +3230,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="client">The IClientAPI for the client</param>
|
/// <param name="client">The IClientAPI for the client</param>
|
||||||
public virtual bool TeleportClientHome(UUID agentId, IClientAPI client)
|
public virtual bool TeleportClientHome(UUID agentId, IClientAPI client)
|
||||||
{
|
{
|
||||||
if (m_teleportModule != null)
|
if (EntityTransferModule != null)
|
||||||
return m_teleportModule.TeleportHome(agentId, client);
|
{
|
||||||
|
EntityTransferModule.TeleportHome(agentId, client);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[SCENE]: Unable to teleport user home: no AgentTransferModule is active");
|
m_log.DebugFormat("[SCENE]: Unable to teleport user home: no AgentTransferModule is active");
|
||||||
|
@ -4332,8 +4339,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
position.Y -= shifty;
|
position.Y -= shifty;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_teleportModule != null)
|
if (EntityTransferModule != null)
|
||||||
m_teleportModule.Teleport(sp, regionHandle, position, lookAt, teleportFlags);
|
{
|
||||||
|
EntityTransferModule.Teleport(sp, regionHandle, position, lookAt, teleportFlags);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[SCENE]: Unable to perform teleports: no AgentTransferModule is active");
|
m_log.DebugFormat("[SCENE]: Unable to perform teleports: no AgentTransferModule is active");
|
||||||
|
@ -4344,8 +4353,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public bool CrossAgentToNewRegion(ScenePresence agent, bool isFlying)
|
public bool CrossAgentToNewRegion(ScenePresence agent, bool isFlying)
|
||||||
{
|
{
|
||||||
if (m_teleportModule != null)
|
if (EntityTransferModule != null)
|
||||||
return m_teleportModule.Cross(agent, isFlying);
|
{
|
||||||
|
return EntityTransferModule.Cross(agent, isFlying);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[SCENE]: Unable to cross agent to neighbouring region, because there is no AgentTransferModule");
|
m_log.DebugFormat("[SCENE]: Unable to cross agent to neighbouring region, because there is no AgentTransferModule");
|
||||||
|
@ -5493,16 +5504,36 @@ Environment.Exit(1);
|
||||||
throw new Exception(error);
|
throw new Exception(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method is called across the simulation connector to
|
/// <summary>
|
||||||
// determine if a given agent is allowed in this region
|
/// This method is called across the simulation connector to
|
||||||
// AS A ROOT AGENT. Returning false here will prevent them
|
/// determine if a given agent is allowed in this region
|
||||||
// from logging into the region, teleporting into the region
|
/// AS A ROOT AGENT
|
||||||
// or corssing the broder walking, but will NOT prevent
|
/// </summary>
|
||||||
// child agent creation, thereby emulating the SL behavior.
|
/// <remarks>
|
||||||
|
/// Returning false here will prevent them
|
||||||
|
/// from logging into the region, teleporting into the region
|
||||||
|
/// or corssing the broder walking, but will NOT prevent
|
||||||
|
/// child agent creation, thereby emulating the SL behavior.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name='agentID'></param>
|
||||||
|
/// <param name='position'></param>
|
||||||
|
/// <param name='reason'></param>
|
||||||
|
/// <returns></returns>
|
||||||
public bool QueryAccess(UUID agentID, Vector3 position, out string reason)
|
public bool QueryAccess(UUID agentID, Vector3 position, out string reason)
|
||||||
{
|
{
|
||||||
reason = "You are banned from the region";
|
reason = "You are banned from the region";
|
||||||
|
|
||||||
|
if (EntityTransferModule.IsInTransit(agentID))
|
||||||
|
{
|
||||||
|
reason = "Agent is still in transit from this region";
|
||||||
|
|
||||||
|
m_log.WarnFormat(
|
||||||
|
"[SCENE]: Denying agent {0} entry into {1} since region still has them registered as in transit",
|
||||||
|
agentID, RegionInfo.RegionName);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (Permissions.IsGod(agentID))
|
if (Permissions.IsGod(agentID))
|
||||||
{
|
{
|
||||||
reason = String.Empty;
|
reason = String.Empty;
|
||||||
|
|
|
@ -759,14 +759,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
public TaskInventoryItem GetInventoryItem(string name)
|
||||||
/// Get inventory items by name.
|
{
|
||||||
/// </summary>
|
m_items.LockItemsForRead(true);
|
||||||
/// <param name="name"></param>
|
foreach (TaskInventoryItem item in m_items.Values)
|
||||||
/// <returns>
|
{
|
||||||
/// A list of inventory items with that name.
|
if (item.Name == name)
|
||||||
/// If no inventory item has that name then an empty list is returned.
|
{
|
||||||
/// </returns>
|
return item;
|
||||||
|
m_items.LockItemsForRead(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_items.LockItemsForRead(false);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public List<TaskInventoryItem> GetInventoryItems(string name)
|
public List<TaskInventoryItem> GetInventoryItems(string name)
|
||||||
{
|
{
|
||||||
List<TaskInventoryItem> items = new List<TaskInventoryItem>();
|
List<TaskInventoryItem> items = new List<TaskInventoryItem>();
|
||||||
|
@ -1236,10 +1244,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
|
if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
|
||||||
item.CurrentPermissions &= ~(uint)PermissionMask.Modify;
|
item.CurrentPermissions &= ~(uint)PermissionMask.Modify;
|
||||||
}
|
}
|
||||||
item.OwnerChanged = true;
|
|
||||||
item.CurrentPermissions &= item.NextPermissions;
|
item.CurrentPermissions &= item.NextPermissions;
|
||||||
item.BasePermissions &= item.NextPermissions;
|
item.BasePermissions &= item.NextPermissions;
|
||||||
item.EveryonePermissions &= item.NextPermissions;
|
item.EveryonePermissions &= item.NextPermissions;
|
||||||
|
item.OwnerChanged = true;
|
||||||
item.PermsMask = 0;
|
item.PermsMask = 0;
|
||||||
item.PermsGranter = UUID.Zero;
|
item.PermsGranter = UUID.Zero;
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,8 +53,24 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||||
/// Serialize coalesced objects to Xml
|
/// Serialize coalesced objects to Xml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="coa"></param>
|
/// <param name="coa"></param>
|
||||||
|
/// <param name="doScriptStates">
|
||||||
|
/// If true then serialize script states. This will halt any running scripts
|
||||||
|
/// </param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string ToXml(CoalescedSceneObjects coa)
|
public static string ToXml(CoalescedSceneObjects coa)
|
||||||
|
{
|
||||||
|
return ToXml(coa, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Serialize coalesced objects to Xml
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="coa"></param>
|
||||||
|
/// <param name="doScriptStates">
|
||||||
|
/// If true then serialize script states. This will halt any running scripts
|
||||||
|
/// </param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string ToXml(CoalescedSceneObjects coa, bool doScriptStates)
|
||||||
{
|
{
|
||||||
using (StringWriter sw = new StringWriter())
|
using (StringWriter sw = new StringWriter())
|
||||||
{
|
{
|
||||||
|
@ -91,7 +107,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||||
writer.WriteAttributeString("offsety", offsets[i].Y.ToString());
|
writer.WriteAttributeString("offsety", offsets[i].Y.ToString());
|
||||||
writer.WriteAttributeString("offsetz", offsets[i].Z.ToString());
|
writer.WriteAttributeString("offsetz", offsets[i].Z.ToString());
|
||||||
|
|
||||||
SceneObjectSerializer.ToOriginalXmlFormat(obj, writer, true);
|
SceneObjectSerializer.ToOriginalXmlFormat(obj, writer, doScriptStates);
|
||||||
|
|
||||||
writer.WriteEndElement(); // SceneObjectGroup
|
writer.WriteEndElement(); // SceneObjectGroup
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,12 +110,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
|
|
||||||
UUID userId = TestHelpers.ParseTail(0x1);
|
UUID userId = TestHelpers.ParseTail(0x1);
|
||||||
|
|
||||||
EntityTransferModule etm = new EntityTransferModule();
|
EntityTransferModule etmA = new EntityTransferModule();
|
||||||
|
EntityTransferModule etmB = new EntityTransferModule();
|
||||||
LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule();
|
LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule();
|
||||||
|
|
||||||
IConfigSource config = new IniConfigSource();
|
IConfigSource config = new IniConfigSource();
|
||||||
IConfig modulesConfig = config.AddConfig("Modules");
|
IConfig modulesConfig = config.AddConfig("Modules");
|
||||||
modulesConfig.Set("EntityTransferModule", etm.Name);
|
modulesConfig.Set("EntityTransferModule", etmA.Name);
|
||||||
modulesConfig.Set("SimulationServices", lscm.Name);
|
modulesConfig.Set("SimulationServices", lscm.Name);
|
||||||
IConfig entityTransferConfig = config.AddConfig("EntityTransfer");
|
IConfig entityTransferConfig = config.AddConfig("EntityTransfer");
|
||||||
|
|
||||||
|
@ -127,7 +128,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
TestScene sceneA = sh.SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
|
TestScene sceneA = sh.SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
|
||||||
TestScene sceneB = sh.SetupScene("sceneB", TestHelpers.ParseTail(0x200), 1002, 1000);
|
TestScene sceneB = sh.SetupScene("sceneB", TestHelpers.ParseTail(0x200), 1002, 1000);
|
||||||
|
|
||||||
SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, etm, lscm);
|
SceneHelpers.SetupSceneModules(sceneA, config, etmA);
|
||||||
|
SceneHelpers.SetupSceneModules(sceneB, config, etmB);
|
||||||
|
SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm);
|
||||||
|
|
||||||
Vector3 teleportPosition = new Vector3(10, 11, 12);
|
Vector3 teleportPosition = new Vector3(10, 11, 12);
|
||||||
Vector3 teleportLookAt = new Vector3(20, 21, 22);
|
Vector3 teleportLookAt = new Vector3(20, 21, 22);
|
||||||
|
@ -174,12 +177,14 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
UUID userId = TestHelpers.ParseTail(0x1);
|
UUID userId = TestHelpers.ParseTail(0x1);
|
||||||
Vector3 preTeleportPosition = new Vector3(30, 31, 32);
|
Vector3 preTeleportPosition = new Vector3(30, 31, 32);
|
||||||
|
|
||||||
EntityTransferModule etm = new EntityTransferModule();
|
EntityTransferModule etmA = new EntityTransferModule();
|
||||||
|
EntityTransferModule etmB = new EntityTransferModule();
|
||||||
|
|
||||||
LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule();
|
LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule();
|
||||||
|
|
||||||
IConfigSource config = new IniConfigSource();
|
IConfigSource config = new IniConfigSource();
|
||||||
config.AddConfig("Modules");
|
config.AddConfig("Modules");
|
||||||
config.Configs["Modules"].Set("EntityTransferModule", etm.Name);
|
config.Configs["Modules"].Set("EntityTransferModule", etmA.Name);
|
||||||
config.Configs["Modules"].Set("SimulationServices", lscm.Name);
|
config.Configs["Modules"].Set("SimulationServices", lscm.Name);
|
||||||
|
|
||||||
config.AddConfig("EntityTransfer");
|
config.AddConfig("EntityTransfer");
|
||||||
|
@ -195,13 +200,15 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
TestScene sceneA = sh.SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
|
TestScene sceneA = sh.SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
|
||||||
TestScene sceneB = sh.SetupScene("sceneB", TestHelpers.ParseTail(0x200), 1002, 1000);
|
TestScene sceneB = sh.SetupScene("sceneB", TestHelpers.ParseTail(0x200), 1002, 1000);
|
||||||
|
|
||||||
|
SceneHelpers.SetupSceneModules(sceneA, config, etmA );
|
||||||
|
|
||||||
// We need to set up the permisions module on scene B so that our later use of agent limit to deny
|
// We need to set up the permisions module on scene B so that our later use of agent limit to deny
|
||||||
// QueryAccess won't succeed anyway because administrators are always allowed in and the default
|
// QueryAccess won't succeed anyway because administrators are always allowed in and the default
|
||||||
// IsAdministrator if no permissions module is present is true.
|
// IsAdministrator if no permissions module is present is true.
|
||||||
SceneHelpers.SetupSceneModules(sceneB, config, new object[] { new PermissionsModule() });
|
SceneHelpers.SetupSceneModules(sceneB, config, new object[] { new PermissionsModule(), etmB });
|
||||||
|
|
||||||
// Shared scene modules
|
// Shared scene modules
|
||||||
SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, etm, lscm);
|
SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm);
|
||||||
|
|
||||||
Vector3 teleportPosition = new Vector3(10, 11, 12);
|
Vector3 teleportPosition = new Vector3(10, 11, 12);
|
||||||
Vector3 teleportLookAt = new Vector3(20, 21, 22);
|
Vector3 teleportLookAt = new Vector3(20, 21, 22);
|
||||||
|
@ -249,12 +256,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
UUID userId = TestHelpers.ParseTail(0x1);
|
UUID userId = TestHelpers.ParseTail(0x1);
|
||||||
Vector3 preTeleportPosition = new Vector3(30, 31, 32);
|
Vector3 preTeleportPosition = new Vector3(30, 31, 32);
|
||||||
|
|
||||||
EntityTransferModule etm = new EntityTransferModule();
|
EntityTransferModule etmA = new EntityTransferModule();
|
||||||
|
EntityTransferModule etmB = new EntityTransferModule();
|
||||||
LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule();
|
LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule();
|
||||||
|
|
||||||
IConfigSource config = new IniConfigSource();
|
IConfigSource config = new IniConfigSource();
|
||||||
config.AddConfig("Modules");
|
config.AddConfig("Modules");
|
||||||
config.Configs["Modules"].Set("EntityTransferModule", etm.Name);
|
config.Configs["Modules"].Set("EntityTransferModule", etmA.Name);
|
||||||
config.Configs["Modules"].Set("SimulationServices", lscm.Name);
|
config.Configs["Modules"].Set("SimulationServices", lscm.Name);
|
||||||
|
|
||||||
config.AddConfig("EntityTransfer");
|
config.AddConfig("EntityTransfer");
|
||||||
|
@ -267,8 +275,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
TestScene sceneA = sh.SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
|
TestScene sceneA = sh.SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
|
||||||
TestScene sceneB = sh.SetupScene("sceneB", TestHelpers.ParseTail(0x200), 1002, 1000);
|
TestScene sceneB = sh.SetupScene("sceneB", TestHelpers.ParseTail(0x200), 1002, 1000);
|
||||||
|
|
||||||
|
SceneHelpers.SetupSceneModules(sceneA, config, etmA);
|
||||||
|
SceneHelpers.SetupSceneModules(sceneB, config, etmB);
|
||||||
|
|
||||||
// Shared scene modules
|
// Shared scene modules
|
||||||
SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, etm, lscm);
|
SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm);
|
||||||
|
|
||||||
Vector3 teleportPosition = new Vector3(10, 11, 12);
|
Vector3 teleportPosition = new Vector3(10, 11, 12);
|
||||||
Vector3 teleportLookAt = new Vector3(20, 21, 22);
|
Vector3 teleportLookAt = new Vector3(20, 21, 22);
|
||||||
|
@ -312,12 +323,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
|
|
||||||
UUID userId = TestHelpers.ParseTail(0x1);
|
UUID userId = TestHelpers.ParseTail(0x1);
|
||||||
|
|
||||||
EntityTransferModule etm = new EntityTransferModule();
|
EntityTransferModule etmA = new EntityTransferModule();
|
||||||
|
EntityTransferModule etmB = new EntityTransferModule();
|
||||||
LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule();
|
LocalSimulationConnectorModule lscm = new LocalSimulationConnectorModule();
|
||||||
|
|
||||||
IConfigSource config = new IniConfigSource();
|
IConfigSource config = new IniConfigSource();
|
||||||
IConfig modulesConfig = config.AddConfig("Modules");
|
IConfig modulesConfig = config.AddConfig("Modules");
|
||||||
modulesConfig.Set("EntityTransferModule", etm.Name);
|
modulesConfig.Set("EntityTransferModule", etmA.Name);
|
||||||
modulesConfig.Set("SimulationServices", lscm.Name);
|
modulesConfig.Set("SimulationServices", lscm.Name);
|
||||||
IConfig entityTransferConfig = config.AddConfig("EntityTransfer");
|
IConfig entityTransferConfig = config.AddConfig("EntityTransfer");
|
||||||
|
|
||||||
|
@ -329,9 +341,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
TestScene sceneA = sh.SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
|
TestScene sceneA = sh.SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
|
||||||
TestScene sceneB = sh.SetupScene("sceneB", TestHelpers.ParseTail(0x200), 1001, 1000);
|
TestScene sceneB = sh.SetupScene("sceneB", TestHelpers.ParseTail(0x200), 1001, 1000);
|
||||||
|
|
||||||
SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, etm, lscm);
|
SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm);
|
||||||
SceneHelpers.SetupSceneModules(sceneA, new CapabilitiesModule());
|
SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA);
|
||||||
SceneHelpers.SetupSceneModules(sceneB, new CapabilitiesModule());
|
SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB);
|
||||||
|
|
||||||
Vector3 teleportPosition = new Vector3(10, 11, 12);
|
Vector3 teleportPosition = new Vector3(10, 11, 12);
|
||||||
Vector3 teleportLookAt = new Vector3(20, 21, 22);
|
Vector3 teleportLookAt = new Vector3(20, 21, 22);
|
||||||
|
|
|
@ -145,12 +145,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
|
||||||
{
|
{
|
||||||
sb.AppendFormat("Attachments for {0}\n", sp.Name);
|
sb.AppendFormat("Attachments for {0}\n", sp.Name);
|
||||||
|
|
||||||
ConsoleTable ct = new ConsoleTable() { Indent = 2 };
|
ConsoleDisplayTable ct = new ConsoleDisplayTable() { Indent = 2 };
|
||||||
ct.Columns.Add(new ConsoleTableColumn("Attachment Name", 36));
|
ct.Columns.Add(new ConsoleDisplayTableColumn("Attachment Name", 36));
|
||||||
ct.Columns.Add(new ConsoleTableColumn("Local ID", 10));
|
ct.Columns.Add(new ConsoleDisplayTableColumn("Local ID", 10));
|
||||||
ct.Columns.Add(new ConsoleTableColumn("Item ID", 36));
|
ct.Columns.Add(new ConsoleDisplayTableColumn("Item ID", 36));
|
||||||
ct.Columns.Add(new ConsoleTableColumn("Attach Point", 14));
|
ct.Columns.Add(new ConsoleDisplayTableColumn("Attach Point", 14));
|
||||||
ct.Columns.Add(new ConsoleTableColumn("Position", 15));
|
ct.Columns.Add(new ConsoleDisplayTableColumn("Position", 15));
|
||||||
|
|
||||||
// sb.AppendFormat(
|
// sb.AppendFormat(
|
||||||
// " {0,-36} {1,-10} {2,-36} {3,-14} {4,-15}\n",
|
// " {0,-36} {1,-10} {2,-36} {3,-14} {4,-15}\n",
|
||||||
|
@ -176,7 +176,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
|
||||||
// attachmentObject.Name, attachmentObject.LocalId, attachmentObject.FromItemID,
|
// attachmentObject.Name, attachmentObject.LocalId, attachmentObject.FromItemID,
|
||||||
// (AttachmentPoint)attachmentObject.AttachmentPoint, attachmentObject.RootPart.AttachedPos);
|
// (AttachmentPoint)attachmentObject.AttachmentPoint, attachmentObject.RootPart.AttachedPos);
|
||||||
ct.Rows.Add(
|
ct.Rows.Add(
|
||||||
new ConsoleTableRow(
|
new ConsoleDisplayTableRow(
|
||||||
new List<string>()
|
new List<string>()
|
||||||
{
|
{
|
||||||
attachmentObject.Name,
|
attachmentObject.Name,
|
||||||
|
|
|
@ -354,51 +354,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
protected UUID InventoryKey(string name, int type)
|
protected UUID InventoryKey(string name, int type)
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name);
|
||||||
m_host.TaskInventory.LockItemsForRead(true);
|
|
||||||
|
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
if (item != null && item.Type == type)
|
||||||
{
|
return item.AssetID;
|
||||||
if (inv.Value.Name == name)
|
else
|
||||||
{
|
|
||||||
m_host.TaskInventory.LockItemsForRead(false);
|
|
||||||
|
|
||||||
if (inv.Value.Type != type)
|
|
||||||
{
|
|
||||||
return UUID.Zero;
|
return UUID.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
return inv.Value.AssetID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_host.TaskInventory.LockItemsForRead(false);
|
|
||||||
return UUID.Zero;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected UUID InventoryKey(string name)
|
|
||||||
{
|
|
||||||
m_host.AddScriptLPS(1);
|
|
||||||
|
|
||||||
|
|
||||||
m_host.TaskInventory.LockItemsForRead(true);
|
|
||||||
|
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
|
||||||
{
|
|
||||||
if (inv.Value.Name == name)
|
|
||||||
{
|
|
||||||
m_host.TaskInventory.LockItemsForRead(false);
|
|
||||||
return inv.Value.AssetID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_host.TaskInventory.LockItemsForRead(false);
|
|
||||||
|
|
||||||
|
|
||||||
return UUID.Zero;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// accepts a valid UUID, -or- a name of an inventory item.
|
/// accepts a valid UUID, -or- a name of an inventory item.
|
||||||
/// Returns a valid UUID or UUID.Zero if key invalid and item not found
|
/// Returns a valid UUID or UUID.Zero if key invalid and item not found
|
||||||
|
@ -408,19 +371,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
protected UUID KeyOrName(string k)
|
protected UUID KeyOrName(string k)
|
||||||
{
|
{
|
||||||
UUID key = UUID.Zero;
|
UUID key;
|
||||||
|
|
||||||
// if we can parse the string as a key, use it.
|
// if we can parse the string as a key, use it.
|
||||||
if (UUID.TryParse(k, out key))
|
|
||||||
{
|
|
||||||
return key;
|
|
||||||
}
|
|
||||||
// else try to locate the name in inventory of object. found returns key,
|
// else try to locate the name in inventory of object. found returns key,
|
||||||
// not found returns UUID.Zero which will translate to the default particle texture
|
// not found returns UUID.Zero
|
||||||
else
|
if (!UUID.TryParse(k, out key))
|
||||||
{
|
{
|
||||||
return InventoryKey(k);
|
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(k);
|
||||||
|
|
||||||
|
if (item != null)
|
||||||
|
key = item.AssetID;
|
||||||
|
else
|
||||||
|
key = UUID.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert a LSL_Rotation to a Quaternion
|
// convert a LSL_Rotation to a Quaternion
|
||||||
|
@ -1897,14 +1863,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
return rgb;
|
return rgb;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (face >= 0 && face < GetNumberOfSides(part))
|
if (face >= 0 && face < GetNumberOfSides(part))
|
||||||
{
|
{
|
||||||
texcolor = tex.GetFace((uint)face).RGBA;
|
texcolor = tex.GetFace((uint)face).RGBA;
|
||||||
rgb.x = texcolor.R;
|
rgb.x = texcolor.R;
|
||||||
rgb.y = texcolor.G;
|
rgb.y = texcolor.G;
|
||||||
rgb.z = texcolor.B;
|
rgb.z = texcolor.B;
|
||||||
return rgb;
|
|
||||||
|
|
||||||
|
return rgb;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -3598,17 +3565,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION) != 0)
|
if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION) != 0)
|
||||||
{
|
{
|
||||||
UUID animID = new UUID();
|
|
||||||
|
|
||||||
if (!UUID.TryParse(anim, out animID))
|
|
||||||
{
|
|
||||||
animID = InventoryKey(anim);
|
|
||||||
}
|
|
||||||
|
|
||||||
ScenePresence presence = World.GetScenePresence(m_item.PermsGranter);
|
ScenePresence presence = World.GetScenePresence(m_item.PermsGranter);
|
||||||
|
|
||||||
if (presence != null)
|
if (presence != null)
|
||||||
{
|
{
|
||||||
|
UUID animID = KeyOrName(anim);
|
||||||
|
|
||||||
if (animID == UUID.Zero)
|
if (animID == UUID.Zero)
|
||||||
presence.Animator.RemoveAnimation(anim);
|
presence.Animator.RemoveAnimation(anim);
|
||||||
else
|
else
|
||||||
|
@ -3737,9 +3699,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
|
|
||||||
ScenePresence presence = World.GetScenePresence(agentID);
|
ScenePresence presence = World.GetScenePresence(agentID);
|
||||||
|
|
||||||
if (presence != null)
|
if (presence != null)
|
||||||
{
|
{
|
||||||
|
// If permissions are being requested from an NPC and were not implicitly granted above then
|
||||||
|
// auto grant all reuqested permissions if the script is owned by the NPC or the NPCs owner
|
||||||
|
INPCModule npcModule = World.RequestModuleInterface<INPCModule>();
|
||||||
|
if (npcModule != null && npcModule.IsNPC(agentID, World))
|
||||||
|
{
|
||||||
|
if (agentID == m_host.ParentGroup.OwnerID || npcModule.GetOwner(agentID) == m_host.ParentGroup.OwnerID)
|
||||||
|
{
|
||||||
|
lock (m_host.TaskInventory)
|
||||||
|
{
|
||||||
|
m_host.TaskInventory[m_item.ItemID].PermsGranter = agentID;
|
||||||
|
m_host.TaskInventory[m_item.ItemID].PermsMask = perm;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_ScriptEngine.PostScriptEvent(
|
||||||
|
m_item.ItemID,
|
||||||
|
new EventParams(
|
||||||
|
"run_time_permissions", new Object[] { new LSL_Integer(perm) }, new DetectParams[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
// it is an NPC, exit even if the permissions werent granted above, they are not going to answer
|
||||||
|
// the question!
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
string ownerName = resolveName(m_host.ParentGroup.RootPart.OwnerID);
|
string ownerName = resolveName(m_host.ParentGroup.RootPart.OwnerID);
|
||||||
if (ownerName == String.Empty)
|
if (ownerName == String.Empty)
|
||||||
ownerName = "(hippos)";
|
ownerName = "(hippos)";
|
||||||
|
@ -3762,10 +3747,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
|
|
||||||
// Requested agent is not in range, refuse perms
|
// Requested agent is not in range, refuse perms
|
||||||
m_ScriptEngine.PostScriptEvent(m_item.ItemID, new EventParams(
|
m_ScriptEngine.PostScriptEvent(
|
||||||
"run_time_permissions", new Object[] {
|
m_item.ItemID,
|
||||||
new LSL_Integer(0) },
|
new EventParams("run_time_permissions", new Object[] { new LSL_Integer(0) }, new DetectParams[0]));
|
||||||
new DetectParams[0]));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleScriptAnswer(IClientAPI client, UUID taskID, UUID itemID, int answer)
|
void handleScriptAnswer(IClientAPI client, UUID taskID, UUID itemID, int answer)
|
||||||
|
@ -9456,7 +9440,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
public LSL_String llGetSimulatorHostname()
|
public LSL_String llGetSimulatorHostname()
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
return System.Environment.MachineName;
|
IUrlModule UrlModule = World.RequestModuleInterface<IUrlModule>();
|
||||||
|
return UrlModule.ExternalHostNameForLSL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <summary>
|
// <summary>
|
||||||
|
@ -9811,7 +9796,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
GridRegion info;
|
GridRegion info;
|
||||||
|
|
||||||
if (m_ScriptEngine.World.RegionInfo.RegionName == simulator)
|
if (m_ScriptEngine.World.RegionInfo.RegionName == simulator) //Det data for this simulator?
|
||||||
|
|
||||||
info = new GridRegion(m_ScriptEngine.World.RegionInfo);
|
info = new GridRegion(m_ScriptEngine.World.RegionInfo);
|
||||||
else
|
else
|
||||||
info = m_ScriptEngine.World.GridService.GetRegionByName(m_ScriptEngine.World.RegionInfo.ScopeID, simulator);
|
info = m_ScriptEngine.World.GridService.GetRegionByName(m_ScriptEngine.World.RegionInfo.ScopeID, simulator);
|
||||||
|
@ -9824,10 +9810,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
ScriptSleep(1000);
|
ScriptSleep(1000);
|
||||||
return UUID.Zero.ToString();
|
return UUID.Zero.ToString();
|
||||||
}
|
}
|
||||||
|
if (m_ScriptEngine.World.RegionInfo.RegionName != simulator)
|
||||||
|
{
|
||||||
|
//Hypergrid Region co-ordinates
|
||||||
|
uint rx = 0, ry = 0;
|
||||||
|
Utils.LongToUInts(Convert.ToUInt64(info.RegionSecret), out rx, out ry);
|
||||||
|
|
||||||
|
reply = new LSL_Vector(
|
||||||
|
rx,
|
||||||
|
ry,
|
||||||
|
0).ToString();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Local-cooridnates
|
||||||
reply = new LSL_Vector(
|
reply = new LSL_Vector(
|
||||||
info.RegionLocX,
|
info.RegionLocX,
|
||||||
info.RegionLocY,
|
info.RegionLocY,
|
||||||
0).ToString();
|
0).ToString();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ScriptBaseClass.DATA_SIM_STATUS:
|
case ScriptBaseClass.DATA_SIM_STATUS:
|
||||||
if (info != null)
|
if (info != null)
|
||||||
|
|
|
@ -960,21 +960,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
UUID avatarID = (UUID)avatar;
|
UUID avatarID = (UUID)avatar;
|
||||||
|
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
|
// FIXME: What we really want to do here is factor out the similar code in llStopAnimation() to a common
|
||||||
|
// method (though see that doesn't do the is animation check, which is probably a bug) and have both
|
||||||
|
// these functions call that common code. However, this does mean navigating the brain-dead requirement
|
||||||
|
// of calling InitLSL()
|
||||||
if (World.Entities.ContainsKey(avatarID) && World.Entities[avatarID] is ScenePresence)
|
if (World.Entities.ContainsKey(avatarID) && World.Entities[avatarID] is ScenePresence)
|
||||||
{
|
{
|
||||||
ScenePresence target = (ScenePresence)World.Entities[avatarID];
|
ScenePresence target = (ScenePresence)World.Entities[avatarID];
|
||||||
if (target != null)
|
if (target != null)
|
||||||
{
|
{
|
||||||
UUID animID = UUID.Zero;
|
UUID animID;
|
||||||
m_host.TaskInventory.LockItemsForRead(true);
|
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
if (!UUID.TryParse(animation, out animID))
|
||||||
{
|
{
|
||||||
if (inv.Value.Name == animation)
|
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(animation);
|
||||||
{
|
if (item != null && item.Type == (int)AssetType.Animation)
|
||||||
if (inv.Value.Type == (int)AssetType.Animation)
|
animID = item.AssetID;
|
||||||
animID = inv.Value.AssetID;
|
else
|
||||||
continue;
|
animID = UUID.Zero;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
m_host.TaskInventory.LockItemsForRead(false);
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
|
|
|
@ -149,13 +149,16 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||||
|
|
||||||
responsedata["int_response_code"] = HttpStatusCode.OK;
|
responsedata["int_response_code"] = HttpStatusCode.OK;
|
||||||
|
|
||||||
OSDMap resp = new OSDMap(2);
|
OSDMap resp = new OSDMap(3);
|
||||||
|
|
||||||
resp["success"] = OSD.FromBoolean(result);
|
resp["success"] = OSD.FromBoolean(result);
|
||||||
resp["reason"] = OSD.FromString(reason);
|
resp["reason"] = OSD.FromString(reason);
|
||||||
resp["version"] = OSD.FromString(version);
|
resp["version"] = OSD.FromString(version);
|
||||||
|
|
||||||
responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp);
|
// We must preserve defaults here, otherwise a false "success" will not be put into the JSON map!
|
||||||
|
responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true);
|
||||||
|
|
||||||
|
// Console.WriteLine("str_response_string [{0}]", responsedata["str_response_string"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void DoAgentGet(Hashtable request, Hashtable responsedata, UUID id, UUID regionID)
|
protected virtual void DoAgentGet(Hashtable request, Hashtable responsedata, UUID id, UUID regionID)
|
||||||
|
@ -569,7 +572,7 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||||
AgentData agent = new AgentData();
|
AgentData agent = new AgentData();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
agent.Unpack(args, m_SimulationService.GetScene(destination.RegionHandle));
|
agent.Unpack(args, m_SimulationService.GetScene(destination.RegionID));
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -589,7 +592,7 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||||
AgentPosition agent = new AgentPosition();
|
AgentPosition agent = new AgentPosition();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
agent.Unpack(args, m_SimulationService.GetScene(destination.RegionHandle));
|
agent.Unpack(args, m_SimulationService.GetScene(destination.RegionID));
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -161,7 +161,7 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||||
if (args.ContainsKey("extra") && args["extra"] != null)
|
if (args.ContainsKey("extra") && args["extra"] != null)
|
||||||
extraStr = args["extra"].AsString();
|
extraStr = args["extra"].AsString();
|
||||||
|
|
||||||
IScene s = m_SimulationService.GetScene(destination.RegionHandle);
|
IScene s = m_SimulationService.GetScene(destination.RegionID);
|
||||||
ISceneObject sog = null;
|
ISceneObject sog = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -148,5 +148,21 @@ namespace OpenSim.Services.Connectors
|
||||||
{
|
{
|
||||||
m_database.RemoveRegionWindlightSettings(regionID);
|
m_database.RemoveRegionWindlightSettings(regionID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string LoadRegionEnvironmentSettings(UUID regionUUID)
|
||||||
|
{
|
||||||
|
return m_database.LoadRegionEnvironmentSettings(regionUUID);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings)
|
||||||
|
{
|
||||||
|
m_database.StoreRegionEnvironmentSettings(regionUUID, settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveRegionEnvironmentSettings(UUID regionUUID)
|
||||||
|
{
|
||||||
|
m_database.RemoveRegionEnvironmentSettings(regionUUID);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||||
//m_Region = region;
|
//m_Region = region;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IScene GetScene(ulong regionHandle)
|
public IScene GetScene(UUID regionId)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -320,14 +320,24 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||||
{
|
{
|
||||||
OSDMap data = (OSDMap)result["_Result"];
|
OSDMap data = (OSDMap)result["_Result"];
|
||||||
|
|
||||||
|
// FIXME: If there is a _Result map then it's the success key here that indicates the true success
|
||||||
|
// or failure, not the sibling result node.
|
||||||
|
success = data["success"];
|
||||||
|
|
||||||
reason = data["reason"].AsString();
|
reason = data["reason"].AsString();
|
||||||
if (data["version"] != null && data["version"].AsString() != string.Empty)
|
if (data["version"] != null && data["version"].AsString() != string.Empty)
|
||||||
version = data["version"].AsString();
|
version = data["version"].AsString();
|
||||||
|
|
||||||
m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1} version {2} ({3})", uri, success, version, data["version"].AsString());
|
m_log.DebugFormat(
|
||||||
|
"[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1}, reason {2}, version {3} ({4})",
|
||||||
|
uri, success, reason, version, data["version"].AsString());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
|
{
|
||||||
|
// If we don't check this then OpenSimulator 0.7.3.1 and some period before will never see the
|
||||||
|
// actual failure message
|
||||||
|
if (!result.ContainsKey("_Result"))
|
||||||
{
|
{
|
||||||
if (result.ContainsKey("Message"))
|
if (result.ContainsKey("Message"))
|
||||||
{
|
{
|
||||||
|
@ -344,6 +354,7 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||||
{
|
{
|
||||||
reason = "Communications failure";
|
reason = "Communications failure";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -356,7 +367,7 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR] QueryAcess failed with exception; {0}",e.ToString());
|
m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR] QueryAcesss failed with exception; {0}",e.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -509,19 +509,21 @@ namespace OpenSim.Services.GridService
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MainConsole.Instance.Output("Region Name Region UUID");
|
|
||||||
MainConsole.Instance.Output("Location URI");
|
|
||||||
MainConsole.Instance.Output("Owner ID Flags");
|
|
||||||
MainConsole.Instance.Output("-------------------------------------------------------------------------------");
|
|
||||||
foreach (RegionData r in regions)
|
foreach (RegionData r in regions)
|
||||||
{
|
{
|
||||||
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",
|
|
||||||
r.RegionName, r.RegionID,
|
ConsoleDisplayList dispList = new ConsoleDisplayList();
|
||||||
String.Format("{0},{1}", r.posX / Constants.RegionSize, r.posY / Constants.RegionSize),
|
dispList.AddRow("Region Name", r.RegionName);
|
||||||
r.Data["serverURI"],
|
dispList.AddRow("Region ID", r.RegionID);
|
||||||
r.Data["owner_uuid"], flags));
|
dispList.AddRow("Location", string.Format("{0},{1}", r.coordX, r.coordY));
|
||||||
|
dispList.AddRow("URI", r.Data["serverURI"]);
|
||||||
|
dispList.AddRow("Owner ID", r.Data["owner_uuid"]);
|
||||||
|
dispList.AddRow("Flags", flags);
|
||||||
|
|
||||||
|
MainConsole.Instance.Output(dispList.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,17 @@ namespace OpenSim.Services.Interfaces
|
||||||
{
|
{
|
||||||
public interface ISimulationService
|
public interface ISimulationService
|
||||||
{
|
{
|
||||||
IScene GetScene(ulong regionHandle);
|
/// <summary>
|
||||||
|
/// Retrieve the scene with the given region ID.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name='regionId'>
|
||||||
|
/// Region identifier.
|
||||||
|
/// </param>
|
||||||
|
/// <returns>
|
||||||
|
/// The scene.
|
||||||
|
/// </returns>
|
||||||
|
IScene GetScene(UUID regionId);
|
||||||
|
|
||||||
ISimulationService GetInnerService();
|
ISimulationService GetInnerService();
|
||||||
|
|
||||||
#region Agents
|
#region Agents
|
||||||
|
|
|
@ -303,6 +303,7 @@ namespace OpenSim.Services.InventoryService
|
||||||
public virtual bool AddFolder(InventoryFolderBase folder)
|
public virtual bool AddFolder(InventoryFolderBase folder)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("[XINVENTORY]: Add folder {0} type {1} in parent {2}", folder.Name, folder.Type, folder.ParentID);
|
// m_log.DebugFormat("[XINVENTORY]: Add folder {0} type {1} in parent {2}", folder.Name, folder.Type, folder.ParentID);
|
||||||
|
|
||||||
InventoryFolderBase check = GetFolder(folder);
|
InventoryFolderBase check = GetFolder(folder);
|
||||||
if (check != null)
|
if (check != null)
|
||||||
return false;
|
return false;
|
||||||
|
@ -328,26 +329,35 @@ namespace OpenSim.Services.InventoryService
|
||||||
public virtual bool UpdateFolder(InventoryFolderBase folder)
|
public virtual bool UpdateFolder(InventoryFolderBase folder)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("[XINVENTORY]: Update folder {0} {1} ({2})", folder.Name, folder.Type, folder.ID);
|
// m_log.DebugFormat("[XINVENTORY]: Update folder {0} {1} ({2})", folder.Name, folder.Type, folder.ID);
|
||||||
|
|
||||||
XInventoryFolder xFolder = ConvertFromOpenSim(folder);
|
XInventoryFolder xFolder = ConvertFromOpenSim(folder);
|
||||||
InventoryFolderBase check = GetFolder(folder);
|
InventoryFolderBase check = GetFolder(folder);
|
||||||
|
|
||||||
if (check == null)
|
if (check == null)
|
||||||
return AddFolder(folder);
|
return AddFolder(folder);
|
||||||
|
|
||||||
if (check.Type != -1 || xFolder.type != -1)
|
if ((check.Type != (short)AssetType.Unknown || xFolder.type != (short)AssetType.Unknown)
|
||||||
|
&& (check.Type != (short)AssetType.OutfitFolder || xFolder.type != (short)AssetType.OutfitFolder))
|
||||||
{
|
{
|
||||||
if (xFolder.version < check.Version)
|
if (xFolder.version < check.Version)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("[XINVENTORY]: {0} < {1} can't do", xFolder.version, check.Version);
|
// m_log.DebugFormat("[XINVENTORY]: {0} < {1} can't do", xFolder.version, check.Version);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
check.Version = (ushort)xFolder.version;
|
check.Version = (ushort)xFolder.version;
|
||||||
xFolder = ConvertFromOpenSim(check);
|
xFolder = ConvertFromOpenSim(check);
|
||||||
//m_log.DebugFormat("[XINVENTORY]: Storing {0} {1} {2}", xFolder.folderName, xFolder.version, xFolder.type);
|
|
||||||
|
// m_log.DebugFormat(
|
||||||
|
// "[XINVENTORY]: Storing version only update to system folder {0} {1} {2}",
|
||||||
|
// xFolder.folderName, xFolder.version, xFolder.type);
|
||||||
|
|
||||||
return m_Database.StoreFolder(xFolder);
|
return m_Database.StoreFolder(xFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xFolder.version < check.Version)
|
if (xFolder.version < check.Version)
|
||||||
xFolder.version = check.Version;
|
xFolder.version = check.Version;
|
||||||
|
|
||||||
xFolder.folderID = check.ID;
|
xFolder.folderID = check.ID;
|
||||||
|
|
||||||
return m_Database.StoreFolder(xFolder);
|
return m_Database.StoreFolder(xFolder);
|
||||||
|
@ -433,7 +443,6 @@ namespace OpenSim.Services.InventoryService
|
||||||
|
|
||||||
public virtual bool UpdateItem(InventoryItemBase item)
|
public virtual bool UpdateItem(InventoryItemBase item)
|
||||||
{
|
{
|
||||||
// throw new Exception("urrgh");
|
|
||||||
if (!m_AllowDelete)
|
if (!m_AllowDelete)
|
||||||
if (item.AssetType == (sbyte)AssetType.Link || item.AssetType == (sbyte)AssetType.LinkFolder)
|
if (item.AssetType == (sbyte)AssetType.Link || item.AssetType == (sbyte)AssetType.LinkFolder)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -566,7 +566,7 @@ namespace OpenSim.Tests.Common
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static SceneObjectPart AddSceneObject(Scene scene)
|
public static SceneObjectPart AddSceneObject(Scene scene)
|
||||||
{
|
{
|
||||||
return AddSceneObject(scene, "Test Object");
|
return AddSceneObject(scene, "Test Object", UUID.Zero);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -574,10 +574,11 @@ namespace OpenSim.Tests.Common
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="scene"></param>
|
/// <param name="scene"></param>
|
||||||
/// <param name="name"></param>
|
/// <param name="name"></param>
|
||||||
|
/// <param name="ownerId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static SceneObjectPart AddSceneObject(Scene scene, string name)
|
public static SceneObjectPart AddSceneObject(Scene scene, string name, UUID ownerId)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = CreateSceneObjectPart(name, UUID.Random(), UUID.Zero);
|
SceneObjectPart part = CreateSceneObjectPart(name, UUID.Random(), ownerId);
|
||||||
|
|
||||||
//part.UpdatePrimFlags(false, false, true);
|
//part.UpdatePrimFlags(false, false, true);
|
||||||
//part.ObjectFlags |= (uint)PrimFlags.Phantom;
|
//part.ObjectFlags |= (uint)PrimFlags.Phantom;
|
||||||
|
|
|
@ -112,6 +112,21 @@ namespace OpenSim.Data.Null
|
||||||
{
|
{
|
||||||
m_store.StoreRegionWindlightSettings(wl);
|
m_store.StoreRegionWindlightSettings(wl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string LoadRegionEnvironmentSettings(UUID regionUUID)
|
||||||
|
{
|
||||||
|
return m_store.LoadRegionEnvironmentSettings(regionUUID);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings)
|
||||||
|
{
|
||||||
|
m_store.StoreRegionEnvironmentSettings(regionUUID, settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveRegionEnvironmentSettings(UUID regionUUID)
|
||||||
|
{
|
||||||
|
m_store.RemoveRegionEnvironmentSettings(regionUUID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -159,6 +174,24 @@ namespace OpenSim.Data.Null
|
||||||
//This connector doesn't support the windlight module yet
|
//This connector doesn't support the windlight module yet
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Environment Settings
|
||||||
|
public string LoadRegionEnvironmentSettings(UUID regionUUID)
|
||||||
|
{
|
||||||
|
//This connector doesn't support the Environment module yet
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings)
|
||||||
|
{
|
||||||
|
//This connector doesn't support the Environment module yet
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveRegionEnvironmentSettings(UUID regionUUID)
|
||||||
|
{
|
||||||
|
//This connector doesn't support the Environment module yet
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
public RegionSettings LoadRegionSettings(UUID regionUUID)
|
public RegionSettings LoadRegionSettings(UUID regionUUID)
|
||||||
{
|
{
|
||||||
RegionSettings rs = null;
|
RegionSettings rs = null;
|
||||||
|
|
|
@ -534,7 +534,7 @@
|
||||||
; silly vanity "Facelights" dead. Sorry, head mounted miner's lamps
|
; silly vanity "Facelights" dead. Sorry, head mounted miner's lamps
|
||||||
; will also be affected.
|
; will also be affected.
|
||||||
;
|
;
|
||||||
;DisableFacelights = "false(1815)
|
;DisableFacelights = false
|
||||||
|
|
||||||
[ClientStack.LindenCaps]
|
[ClientStack.LindenCaps]
|
||||||
;; Long list of capabilities taken from
|
;; Long list of capabilities taken from
|
||||||
|
@ -549,6 +549,7 @@
|
||||||
Cap_CopyInventoryFromNotecard = "localhost"
|
Cap_CopyInventoryFromNotecard = "localhost"
|
||||||
Cap_DispatchRegionInfo = ""
|
Cap_DispatchRegionInfo = ""
|
||||||
Cap_EstateChangeInfo = ""
|
Cap_EstateChangeInfo = ""
|
||||||
|
Cap_EnvironmentSettings = "localhost"
|
||||||
Cap_EventQueueGet = "localhost"
|
Cap_EventQueueGet = "localhost"
|
||||||
Cap_FetchInventory = ""
|
Cap_FetchInventory = ""
|
||||||
Cap_ObjectMedia = "localhost"
|
Cap_ObjectMedia = "localhost"
|
||||||
|
|
Loading…
Reference in New Issue