last round of warning squashing. calling it a day now.
parent
20940951b2
commit
748f72326d
|
@ -370,7 +370,7 @@ namespace OpenSim.Data.MSSQL
|
||||||
int revision = Util.UnixTimeSinceEpoch();
|
int revision = Util.UnixTimeSinceEpoch();
|
||||||
m_log.Info("[REGION DB]: Storing terrain revision r" + revision.ToString());
|
m_log.Info("[REGION DB]: Storing terrain revision r" + revision.ToString());
|
||||||
|
|
||||||
DataTable terrain = m_dataSet.Tables["terrain"];
|
// DataTable terrain = m_dataSet.Tables["terrain"];
|
||||||
lock (m_dataSet)
|
lock (m_dataSet)
|
||||||
{
|
{
|
||||||
SqlCommand cmd = new SqlCommand("insert into terrain(RegionUUID, Revision, Heightfield)" +
|
SqlCommand cmd = new SqlCommand("insert into terrain(RegionUUID, Revision, Heightfield)" +
|
||||||
|
@ -400,7 +400,7 @@ namespace OpenSim.Data.MSSQL
|
||||||
where RegionUUID=@RegionUUID order by Revision desc"
|
where RegionUUID=@RegionUUID order by Revision desc"
|
||||||
, m_connection);
|
, m_connection);
|
||||||
|
|
||||||
SqlParameter param = new SqlParameter();
|
// SqlParameter param = new SqlParameter();
|
||||||
cmd.Parameters.Add(new SqlParameter("@RegionUUID", regionID.UUID));
|
cmd.Parameters.Add(new SqlParameter("@RegionUUID", regionID.UUID));
|
||||||
|
|
||||||
if (m_connection.State != ConnectionState.Open)
|
if (m_connection.State != ConnectionState.Open)
|
||||||
|
|
|
@ -434,11 +434,11 @@ namespace OpenSim.Data.MSSQL
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge)
|
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge)
|
||||||
{
|
{
|
||||||
SHA512Managed HashProvider = new SHA512Managed();
|
// SHA512Managed HashProvider = new SHA512Managed();
|
||||||
Encoding TextProvider = new UTF8Encoding();
|
// Encoding TextProvider = new UTF8Encoding();
|
||||||
|
|
||||||
byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge);
|
// byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge);
|
||||||
byte[] hash = HashProvider.ComputeHash(stream);
|
// byte[] hash = HashProvider.ComputeHash(stream);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -544,7 +544,7 @@ namespace OpenSim.Data.MSSQL
|
||||||
public string getVersion()
|
public string getVersion()
|
||||||
{
|
{
|
||||||
Module module = GetType().Module;
|
Module module = GetType().Module;
|
||||||
string dllName = module.Assembly.ManifestModule.Name;
|
// string dllName = module.Assembly.ManifestModule.Name;
|
||||||
Version dllVersion = module.Assembly.GetName().Version;
|
Version dllVersion = module.Assembly.GetName().Version;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -120,16 +120,16 @@ namespace OpenSim.Data.MySQL
|
||||||
/// </list>
|
/// </list>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="oldVersion"></param>
|
/// <param name="oldVersion"></param>
|
||||||
private void UpgradeAssetsTable(string oldVersion)
|
// private void UpgradeAssetsTable(string oldVersion)
|
||||||
{
|
// {
|
||||||
// null as the version, indicates that the table didn't exist
|
// // null as the version, indicates that the table didn't exist
|
||||||
if (oldVersion == null)
|
// if (oldVersion == null)
|
||||||
{
|
// {
|
||||||
m_log.Info("[ASSETS DB]: Creating new database tables");
|
// m_log.Info("[ASSETS DB]: Creating new database tables");
|
||||||
_dbConnection.ExecuteResourceSql("CreateAssetsTable.sql");
|
// _dbConnection.ExecuteResourceSql("CreateAssetsTable.sql");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Ensure that the assets related tables exists and are at the latest version
|
/// Ensure that the assets related tables exists and are at the latest version
|
||||||
|
|
|
@ -272,19 +272,19 @@ namespace OpenSim.Data.MySQL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="oldVersion"></param>
|
/// <param name="oldVersion"></param>
|
||||||
/// <param name="dbconn">The database connection handler</param>
|
/// <param name="dbconn">The database connection handler</param>
|
||||||
private void UpgradeLandTable(string oldVersion, MySqlConnection dbconn)
|
// private void UpgradeLandTable(string oldVersion, MySqlConnection dbconn)
|
||||||
{
|
// {
|
||||||
// null as the version, indicates that the table didn't exist
|
// // null as the version, indicates that the table didn't exist
|
||||||
if (oldVersion == null)
|
// if (oldVersion == null)
|
||||||
{
|
// {
|
||||||
ExecuteResourceSql("CreateLandTable.sql",dbconn);
|
// ExecuteResourceSql("CreateLandTable.sql",dbconn);
|
||||||
oldVersion = "Rev. 2; InnoDB free: 0 kB";
|
// oldVersion = "Rev. 2; InnoDB free: 0 kB";
|
||||||
}
|
// }
|
||||||
if (!oldVersion.Contains("Rev."))
|
// if (!oldVersion.Contains("Rev."))
|
||||||
{
|
// {
|
||||||
ExecuteResourceSql("UpgradeLandTableToVersion2.sql", dbconn);
|
// ExecuteResourceSql("UpgradeLandTableToVersion2.sql", dbconn);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds an object into region storage
|
/// Adds an object into region storage
|
||||||
|
@ -534,7 +534,7 @@ namespace OpenSim.Data.MySQL
|
||||||
where RegionUUID=?RegionUUID order by Revision desc limit 1"
|
where RegionUUID=?RegionUUID order by Revision desc limit 1"
|
||||||
, m_connection);
|
, m_connection);
|
||||||
|
|
||||||
MySqlParameter param = new MySqlParameter();
|
// MySqlParameter param = new MySqlParameter();
|
||||||
cmd.Parameters.Add(new MySqlParameter("?RegionUUID", Util.ToRawUuidString(regionID)));
|
cmd.Parameters.Add(new MySqlParameter("?RegionUUID", Util.ToRawUuidString(regionID)));
|
||||||
|
|
||||||
if (m_connection.State != ConnectionState.Open)
|
if (m_connection.State != ConnectionState.Open)
|
||||||
|
@ -1768,30 +1768,30 @@ namespace OpenSim.Data.MySQL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="dt"></param>
|
/// <param name="dt"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private static string defineTable(DataTable dt)
|
// private static string defineTable(DataTable dt)
|
||||||
{
|
// {
|
||||||
string sql = "create table " + dt.TableName + "(";
|
// string sql = "create table " + dt.TableName + "(";
|
||||||
string subsql = String.Empty;
|
// string subsql = String.Empty;
|
||||||
foreach (DataColumn col in dt.Columns)
|
// foreach (DataColumn col in dt.Columns)
|
||||||
{
|
// {
|
||||||
if (subsql.Length > 0)
|
// if (subsql.Length > 0)
|
||||||
{
|
// {
|
||||||
// a map function would rock so much here
|
// // a map function would rock so much here
|
||||||
subsql += ",\n";
|
// subsql += ",\n";
|
||||||
}
|
// }
|
||||||
subsql += col.ColumnName + " " + MySqlType(col.DataType);
|
// subsql += col.ColumnName + " " + MySqlType(col.DataType);
|
||||||
if (dt.PrimaryKey.Length > 0 && col == dt.PrimaryKey[0])
|
// if (dt.PrimaryKey.Length > 0 && col == dt.PrimaryKey[0])
|
||||||
{
|
// {
|
||||||
subsql += " primary key";
|
// subsql += " primary key";
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
sql += subsql;
|
// sql += subsql;
|
||||||
sql += ")";
|
// sql += ")";
|
||||||
|
|
||||||
//m_log.InfoFormat("[DATASTORE]: defineTable() sql {0}", sql);
|
// //m_log.InfoFormat("[DATASTORE]: defineTable() sql {0}", sql);
|
||||||
|
|
||||||
return sql;
|
// return sql;
|
||||||
}
|
// }
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
|
@ -1944,93 +1944,93 @@ namespace OpenSim.Data.MySQL
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="conn">MySQL connection handler</param>
|
/// <param name="conn">MySQL connection handler</param>
|
||||||
private static void InitDB(MySqlConnection conn)
|
// private static void InitDB(MySqlConnection conn)
|
||||||
{
|
// {
|
||||||
string createPrims = defineTable(createPrimTable());
|
// string createPrims = defineTable(createPrimTable());
|
||||||
string createShapes = defineTable(createShapeTable());
|
// string createShapes = defineTable(createShapeTable());
|
||||||
string createItems = defineTable(createItemsTable());
|
// string createItems = defineTable(createItemsTable());
|
||||||
string createTerrain = defineTable(createTerrainTable());
|
// string createTerrain = defineTable(createTerrainTable());
|
||||||
|
|
||||||
// Land table is created from the Versionable Test Table routine now.
|
// // Land table is created from the Versionable Test Table routine now.
|
||||||
//string createLand = defineTable(createLandTable());
|
// //string createLand = defineTable(createLandTable());
|
||||||
string createLandAccessList = defineTable(createLandAccessListTable());
|
// string createLandAccessList = defineTable(createLandAccessListTable());
|
||||||
|
|
||||||
MySqlCommand pcmd = new MySqlCommand(createPrims, conn);
|
// MySqlCommand pcmd = new MySqlCommand(createPrims, conn);
|
||||||
MySqlCommand scmd = new MySqlCommand(createShapes, conn);
|
// MySqlCommand scmd = new MySqlCommand(createShapes, conn);
|
||||||
MySqlCommand icmd = new MySqlCommand(createItems, conn);
|
// MySqlCommand icmd = new MySqlCommand(createItems, conn);
|
||||||
MySqlCommand tcmd = new MySqlCommand(createTerrain, conn);
|
// MySqlCommand tcmd = new MySqlCommand(createTerrain, conn);
|
||||||
//MySqlCommand lcmd = new MySqlCommand(createLand, conn);
|
// //MySqlCommand lcmd = new MySqlCommand(createLand, conn);
|
||||||
MySqlCommand lalcmd = new MySqlCommand(createLandAccessList, conn);
|
// MySqlCommand lalcmd = new MySqlCommand(createLandAccessList, conn);
|
||||||
|
|
||||||
if (conn.State != ConnectionState.Open)
|
// if (conn.State != ConnectionState.Open)
|
||||||
{
|
// {
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
conn.Open();
|
// conn.Open();
|
||||||
}
|
// }
|
||||||
catch (Exception ex)
|
// catch (Exception ex)
|
||||||
{
|
// {
|
||||||
m_log.Error("[REGION DB]: Error connecting to MySQL server: " + ex.Message);
|
// m_log.Error("[REGION DB]: Error connecting to MySQL server: " + ex.Message);
|
||||||
m_log.Error("[REGION DB]: Application is terminating!");
|
// m_log.Error("[REGION DB]: Application is terminating!");
|
||||||
Thread.CurrentThread.Abort();
|
// Thread.CurrentThread.Abort();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
pcmd.ExecuteNonQuery();
|
// pcmd.ExecuteNonQuery();
|
||||||
}
|
// }
|
||||||
catch (MySqlException e)
|
// catch (MySqlException e)
|
||||||
{
|
// {
|
||||||
m_log.WarnFormat("[REGION DB]: Primitives Table Already Exists: {0}", e);
|
// m_log.WarnFormat("[REGION DB]: Primitives Table Already Exists: {0}", e);
|
||||||
}
|
// }
|
||||||
|
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
scmd.ExecuteNonQuery();
|
// scmd.ExecuteNonQuery();
|
||||||
}
|
// }
|
||||||
catch (MySqlException e)
|
// catch (MySqlException e)
|
||||||
{
|
// {
|
||||||
m_log.WarnFormat("[REGION DB]: Shapes Table Already Exists: {0}", e);
|
// m_log.WarnFormat("[REGION DB]: Shapes Table Already Exists: {0}", e);
|
||||||
}
|
// }
|
||||||
|
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
icmd.ExecuteNonQuery();
|
// icmd.ExecuteNonQuery();
|
||||||
}
|
// }
|
||||||
catch (MySqlException e)
|
// catch (MySqlException e)
|
||||||
{
|
// {
|
||||||
m_log.WarnFormat("[REGION DB]: Items Table Already Exists: {0}", e);
|
// m_log.WarnFormat("[REGION DB]: Items Table Already Exists: {0}", e);
|
||||||
}
|
// }
|
||||||
|
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
tcmd.ExecuteNonQuery();
|
// tcmd.ExecuteNonQuery();
|
||||||
}
|
// }
|
||||||
catch (MySqlException e)
|
// catch (MySqlException e)
|
||||||
{
|
// {
|
||||||
m_log.WarnFormat("[REGION DB]: Terrain Table Already Exists: {0}", e);
|
// m_log.WarnFormat("[REGION DB]: Terrain Table Already Exists: {0}", e);
|
||||||
}
|
// }
|
||||||
|
|
||||||
//try
|
// //try
|
||||||
//{
|
// //{
|
||||||
//lcmd.ExecuteNonQuery();
|
// //lcmd.ExecuteNonQuery();
|
||||||
//}
|
// //}
|
||||||
//catch (MySqlException e)
|
// //catch (MySqlException e)
|
||||||
//{
|
// //{
|
||||||
//m_log.WarnFormat("[MySql]: Land Table Already Exists: {0}", e);
|
// //m_log.WarnFormat("[MySql]: Land Table Already Exists: {0}", e);
|
||||||
//}
|
// //}
|
||||||
|
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
lalcmd.ExecuteNonQuery();
|
// lalcmd.ExecuteNonQuery();
|
||||||
}
|
// }
|
||||||
catch (MySqlException e)
|
// catch (MySqlException e)
|
||||||
{
|
// {
|
||||||
m_log.WarnFormat("[REGION DB]: LandAccessList Table Already Exists: {0}", e);
|
// m_log.WarnFormat("[REGION DB]: LandAccessList Table Already Exists: {0}", e);
|
||||||
}
|
// }
|
||||||
conn.Close();
|
// conn.Close();
|
||||||
}
|
// }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
@ -2189,32 +2189,32 @@ namespace OpenSim.Data.MySQL
|
||||||
/// <param name="type"></param>
|
/// <param name="type"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <remarks>this is something we'll need to implement for each db slightly differently.</remarks>
|
/// <remarks>this is something we'll need to implement for each db slightly differently.</remarks>
|
||||||
private static string MySqlType(Type type)
|
// private static string MySqlType(Type type)
|
||||||
{
|
// {
|
||||||
if (type == typeof (String))
|
// if (type == typeof (String))
|
||||||
{
|
// {
|
||||||
return "varchar(255)";
|
// return "varchar(255)";
|
||||||
}
|
// }
|
||||||
else if (type == typeof (Int32))
|
// else if (type == typeof (Int32))
|
||||||
{
|
// {
|
||||||
return "integer";
|
// return "integer";
|
||||||
}
|
// }
|
||||||
else if (type == typeof (Int64))
|
// else if (type == typeof (Int64))
|
||||||
{
|
// {
|
||||||
return "bigint";
|
// return "bigint";
|
||||||
}
|
// }
|
||||||
else if (type == typeof (Double))
|
// else if (type == typeof (Double))
|
||||||
{
|
// {
|
||||||
return "float";
|
// return "float";
|
||||||
}
|
// }
|
||||||
else if (type == typeof (Byte[]))
|
// else if (type == typeof (Byte[]))
|
||||||
{
|
// {
|
||||||
return "longblob";
|
// return "longblob";
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
return "string";
|
// return "string";
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -402,11 +402,11 @@ namespace OpenSim.Data.MySQL
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge)
|
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge)
|
||||||
{
|
{
|
||||||
SHA512Managed HashProvider = new SHA512Managed();
|
// SHA512Managed HashProvider = new SHA512Managed();
|
||||||
Encoding TextProvider = new UTF8Encoding();
|
// Encoding TextProvider = new UTF8Encoding();
|
||||||
|
|
||||||
byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge);
|
// byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge);
|
||||||
byte[] hash = HashProvider.ComputeHash(stream);
|
// byte[] hash = HashProvider.ComputeHash(stream);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,7 +156,7 @@ namespace OpenSim.Data.MySQL
|
||||||
public string getVersion()
|
public string getVersion()
|
||||||
{
|
{
|
||||||
Module module = GetType().Module;
|
Module module = GetType().Module;
|
||||||
string dllName = module.Assembly.ManifestModule.Name;
|
// string dllName = module.Assembly.ManifestModule.Name;
|
||||||
Version dllVersion = module.Assembly.GetName().Version;
|
Version dllVersion = module.Assembly.GetName().Version;
|
||||||
|
|
||||||
return
|
return
|
||||||
|
@ -916,8 +916,12 @@ namespace OpenSim.Data.MySQL
|
||||||
IDbCommand result = Query(sql, parameters);
|
IDbCommand result = Query(sql, parameters);
|
||||||
|
|
||||||
//Console.WriteLine(result.CommandText);
|
//Console.WriteLine(result.CommandText);
|
||||||
int x;
|
// int x;
|
||||||
if ((x = result.ExecuteNonQuery()) > 0)
|
// if ((x = result.ExecuteNonQuery()) > 0)
|
||||||
|
// {
|
||||||
|
// returnval = true;
|
||||||
|
// }
|
||||||
|
if (result.ExecuteNonQuery() > 0)
|
||||||
{
|
{
|
||||||
returnval = true;
|
returnval = true;
|
||||||
}
|
}
|
||||||
|
@ -952,8 +956,12 @@ namespace OpenSim.Data.MySQL
|
||||||
|
|
||||||
IDbCommand result = Query(sql, parameters);
|
IDbCommand result = Query(sql, parameters);
|
||||||
|
|
||||||
int x;
|
// int x;
|
||||||
if ((x = result.ExecuteNonQuery()) > 0)
|
// if ((x = result.ExecuteNonQuery()) > 0)
|
||||||
|
// {
|
||||||
|
// returnval = true;
|
||||||
|
// }
|
||||||
|
if (result.ExecuteNonQuery() > 0)
|
||||||
{
|
{
|
||||||
returnval = true;
|
returnval = true;
|
||||||
}
|
}
|
||||||
|
@ -1000,8 +1008,12 @@ namespace OpenSim.Data.MySQL
|
||||||
IDbCommand result = Query(sql, parameters);
|
IDbCommand result = Query(sql, parameters);
|
||||||
|
|
||||||
//Console.WriteLine(result.CommandText);
|
//Console.WriteLine(result.CommandText);
|
||||||
int x;
|
// int x;
|
||||||
if ((x = result.ExecuteNonQuery()) > 0)
|
// if ((x = result.ExecuteNonQuery()) > 0)
|
||||||
|
// {
|
||||||
|
// returnval = true;
|
||||||
|
// }
|
||||||
|
if (result.ExecuteNonQuery() > 0)
|
||||||
{
|
{
|
||||||
returnval = true;
|
returnval = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,18 +137,18 @@ namespace OpenSim.Data.NHibernate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LogAssetLoad(AssetBase asset)
|
// private void LogAssetLoad(AssetBase asset)
|
||||||
{
|
// {
|
||||||
string temporary = asset.Temporary ? "Temporary" : "Stored";
|
// string temporary = asset.Temporary ? "Temporary" : "Stored";
|
||||||
string local = asset.Local ? "Local" : "Remote";
|
// string local = asset.Local ? "Local" : "Remote";
|
||||||
|
|
||||||
int assetLength = (asset.Data != null) ? asset.Data.Length : 0;
|
// int assetLength = (asset.Data != null) ? asset.Data.Length : 0;
|
||||||
|
|
||||||
m_log.Info("[SQLITE]: " +
|
// m_log.Info("[SQLITE]: " +
|
||||||
string.Format("Loaded {6} {5} Asset: [{0}][{3}/{4}] \"{1}\":{2} ({7} bytes)",
|
// string.Format("Loaded {6} {5} Asset: [{0}][{3}/{4}] \"{1}\":{2} ({7} bytes)",
|
||||||
asset.FullID, asset.Name, asset.Description, asset.Type,
|
// asset.FullID, asset.Name, asset.Description, asset.Type,
|
||||||
asset.InvType, temporary, local, assetLength));
|
// asset.InvType, temporary, local, assetLength));
|
||||||
}
|
// }
|
||||||
|
|
||||||
override public bool ExistsAsset(LLUUID uuid)
|
override public bool ExistsAsset(LLUUID uuid)
|
||||||
{
|
{
|
||||||
|
|
|
@ -277,7 +277,7 @@ namespace OpenSim.Data.NHibernate
|
||||||
public string getVersion()
|
public string getVersion()
|
||||||
{
|
{
|
||||||
Module module = GetType().Module;
|
Module module = GetType().Module;
|
||||||
string dllName = module.Assembly.ManifestModule.Name;
|
// string dllName = module.Assembly.ManifestModule.Name;
|
||||||
Version dllVersion = module.Assembly.GetName().Version;
|
Version dllVersion = module.Assembly.GetName().Version;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,11 +33,11 @@ namespace OpenSim.Data.NHibernate
|
||||||
{
|
{
|
||||||
internal class NHibernateManager
|
internal class NHibernateManager
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private ISessionFactory factory;
|
// private ISessionFactory factory;
|
||||||
private ISession session;
|
// private ISession session;
|
||||||
private ITransaction transaction;
|
// private ITransaction transaction;
|
||||||
|
|
||||||
public NHibernateManager()
|
public NHibernateManager()
|
||||||
{
|
{
|
||||||
|
|
|
@ -91,7 +91,7 @@ namespace OpenSim.Data.NHibernate
|
||||||
{
|
{
|
||||||
user = session.Load(typeof(UserProfileData), uuid) as UserProfileData;
|
user = session.Load(typeof(UserProfileData), uuid) as UserProfileData;
|
||||||
}
|
}
|
||||||
catch (ObjectNotFoundException e)
|
catch (ObjectNotFoundException)
|
||||||
{
|
{
|
||||||
user = null;
|
user = null;
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,7 @@ namespace OpenSim.Data.NHibernate
|
||||||
user = session.Load(typeof(UserProfileData), uuid) as UserProfileData;
|
user = session.Load(typeof(UserProfileData), uuid) as UserProfileData;
|
||||||
user.CurrentAgent = GetAgentByUUID(uuid);
|
user.CurrentAgent = GetAgentByUUID(uuid);
|
||||||
}
|
}
|
||||||
catch (ObjectNotFoundException e)
|
catch (ObjectNotFoundException)
|
||||||
{
|
{
|
||||||
user = null;
|
user = null;
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,7 @@ namespace OpenSim.Data.NHibernate
|
||||||
UserAgentData old = session.Load(typeof(UserAgentData), uuid) as UserAgentData;
|
UserAgentData old = session.Load(typeof(UserAgentData), uuid) as UserAgentData;
|
||||||
session.Delete(old);
|
session.Delete(old);
|
||||||
}
|
}
|
||||||
catch (ObjectNotFoundException e)
|
catch (ObjectNotFoundException)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
session.Save(agent);
|
session.Save(agent);
|
||||||
|
@ -173,7 +173,7 @@ namespace OpenSim.Data.NHibernate
|
||||||
UserAgentData old = session.Load(typeof(UserAgentData), agent.ProfileID) as UserAgentData;
|
UserAgentData old = session.Load(typeof(UserAgentData), agent.ProfileID) as UserAgentData;
|
||||||
session.Delete(old);
|
session.Delete(old);
|
||||||
}
|
}
|
||||||
catch (ObjectNotFoundException e)
|
catch (ObjectNotFoundException)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
session.Save(agent);
|
session.Save(agent);
|
||||||
|
@ -260,7 +260,7 @@ namespace OpenSim.Data.NHibernate
|
||||||
// TODO: I'm sure I'll have to do something silly here
|
// TODO: I'm sure I'll have to do something silly here
|
||||||
try {
|
try {
|
||||||
appearance = session.Load(typeof(AvatarAppearance), user) as AvatarAppearance;
|
appearance = session.Load(typeof(AvatarAppearance), user) as AvatarAppearance;
|
||||||
} catch (ObjectNotFoundException e) {
|
} catch (ObjectNotFoundException) {
|
||||||
appearance = null;
|
appearance = null;
|
||||||
}
|
}
|
||||||
return appearance;
|
return appearance;
|
||||||
|
@ -271,7 +271,7 @@ namespace OpenSim.Data.NHibernate
|
||||||
AvatarAppearance appearance;
|
AvatarAppearance appearance;
|
||||||
try {
|
try {
|
||||||
appearance = session.Load(typeof(AvatarAppearance), uuid) as AvatarAppearance;
|
appearance = session.Load(typeof(AvatarAppearance), uuid) as AvatarAppearance;
|
||||||
} catch (ObjectNotFoundException e) {
|
} catch (ObjectNotFoundException) {
|
||||||
appearance = null;
|
appearance = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -250,22 +250,22 @@ namespace OpenSim.Data.SQLite
|
||||||
/// Create the "assets" table
|
/// Create the "assets" table
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private static DataTable createAssetsTable()
|
// private static DataTable createAssetsTable()
|
||||||
{
|
// {
|
||||||
DataTable assets = new DataTable("assets");
|
// DataTable assets = new DataTable("assets");
|
||||||
|
|
||||||
SQLiteUtil.createCol(assets, "UUID", typeof (String));
|
// SQLiteUtil.createCol(assets, "UUID", typeof (String));
|
||||||
SQLiteUtil.createCol(assets, "Name", typeof (String));
|
// SQLiteUtil.createCol(assets, "Name", typeof (String));
|
||||||
SQLiteUtil.createCol(assets, "Description", typeof (String));
|
// SQLiteUtil.createCol(assets, "Description", typeof (String));
|
||||||
SQLiteUtil.createCol(assets, "Type", typeof (Int32));
|
// SQLiteUtil.createCol(assets, "Type", typeof (Int32));
|
||||||
SQLiteUtil.createCol(assets, "InvType", typeof (Int32));
|
// SQLiteUtil.createCol(assets, "InvType", typeof (Int32));
|
||||||
SQLiteUtil.createCol(assets, "Local", typeof (Boolean));
|
// SQLiteUtil.createCol(assets, "Local", typeof (Boolean));
|
||||||
SQLiteUtil.createCol(assets, "Temporary", typeof (Boolean));
|
// SQLiteUtil.createCol(assets, "Temporary", typeof (Boolean));
|
||||||
SQLiteUtil.createCol(assets, "Data", typeof (Byte[]));
|
// SQLiteUtil.createCol(assets, "Data", typeof (Byte[]));
|
||||||
// Add in contraints
|
// // Add in contraints
|
||||||
assets.PrimaryKey = new DataColumn[] {assets.Columns["UUID"]};
|
// assets.PrimaryKey = new DataColumn[] {assets.Columns["UUID"]};
|
||||||
return assets;
|
// return assets;
|
||||||
}
|
// }
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
|
@ -312,12 +312,12 @@ namespace OpenSim.Data.SQLite
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="conn"></param>
|
/// <param name="conn"></param>
|
||||||
private static void InitDB(SqliteConnection conn)
|
// private static void InitDB(SqliteConnection conn)
|
||||||
{
|
// {
|
||||||
string createAssets = SQLiteUtil.defineTable(createAssetsTable());
|
// string createAssets = SQLiteUtil.defineTable(createAssetsTable());
|
||||||
SqliteCommand pcmd = new SqliteCommand(createAssets, conn);
|
// SqliteCommand pcmd = new SqliteCommand(createAssets, conn);
|
||||||
pcmd.ExecuteNonQuery();
|
// pcmd.ExecuteNonQuery();
|
||||||
}
|
// }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
@ -358,7 +358,7 @@ namespace OpenSim.Data.SQLite
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
Module module = GetType().Module;
|
Module module = GetType().Module;
|
||||||
string dllName = module.Assembly.ManifestModule.Name;
|
// string dllName = module.Assembly.ManifestModule.Name;
|
||||||
Version dllVersion = module.Assembly.GetName().Version;
|
Version dllVersion = module.Assembly.GetName().Version;
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
|
@ -230,11 +230,11 @@ namespace OpenSim.Data.SQLite
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge)
|
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge)
|
||||||
{
|
{
|
||||||
SHA512Managed HashProvider = new SHA512Managed();
|
// SHA512Managed HashProvider = new SHA512Managed();
|
||||||
Encoding TextProvider = new UTF8Encoding();
|
// Encoding TextProvider = new UTF8Encoding();
|
||||||
|
|
||||||
byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge);
|
// byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge);
|
||||||
byte[] hash = HashProvider.ComputeHash(stream);
|
// byte[] hash = HashProvider.ComputeHash(stream);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -297,7 +297,7 @@ namespace OpenSim.Data.SQLite
|
||||||
public string getVersion()
|
public string getVersion()
|
||||||
{
|
{
|
||||||
Module module = GetType().Module;
|
Module module = GetType().Module;
|
||||||
string dllName = module.Assembly.ManifestModule.Name;
|
// string dllName = module.Assembly.ManifestModule.Name;
|
||||||
Version dllVersion = module.Assembly.GetName().Version;
|
Version dllVersion = module.Assembly.GetName().Version;
|
||||||
|
|
||||||
|
|
||||||
|
@ -741,17 +741,17 @@ namespace OpenSim.Data.SQLite
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="conn"></param>
|
/// <param name="conn"></param>
|
||||||
private static void InitDB(SqliteConnection conn)
|
// private static void InitDB(SqliteConnection conn)
|
||||||
{
|
// {
|
||||||
string createInventoryItems = defineTable(createInventoryItemsTable());
|
// string createInventoryItems = defineTable(createInventoryItemsTable());
|
||||||
string createInventoryFolders = defineTable(createInventoryFoldersTable());
|
// string createInventoryFolders = defineTable(createInventoryFoldersTable());
|
||||||
|
|
||||||
SqliteCommand pcmd = new SqliteCommand(createInventoryItems, conn);
|
// SqliteCommand pcmd = new SqliteCommand(createInventoryItems, conn);
|
||||||
SqliteCommand scmd = new SqliteCommand(createInventoryFolders, conn);
|
// SqliteCommand scmd = new SqliteCommand(createInventoryFolders, conn);
|
||||||
|
|
||||||
pcmd.ExecuteNonQuery();
|
// pcmd.ExecuteNonQuery();
|
||||||
scmd.ExecuteNonQuery();
|
// scmd.ExecuteNonQuery();
|
||||||
}
|
// }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
|
|
@ -1686,27 +1686,27 @@ namespace OpenSim.Data.SQLite
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="dt">Data Table</param>
|
/// <param name="dt">Data Table</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private static string defineTable(DataTable dt)
|
// private static string defineTable(DataTable dt)
|
||||||
{
|
// {
|
||||||
string sql = "create table " + dt.TableName + "(";
|
// string sql = "create table " + dt.TableName + "(";
|
||||||
string subsql = String.Empty;
|
// string subsql = String.Empty;
|
||||||
foreach (DataColumn col in dt.Columns)
|
// foreach (DataColumn col in dt.Columns)
|
||||||
{
|
// {
|
||||||
if (subsql.Length > 0)
|
// if (subsql.Length > 0)
|
||||||
{
|
// {
|
||||||
// a map function would rock so much here
|
// // a map function would rock so much here
|
||||||
subsql += ",\n";
|
// subsql += ",\n";
|
||||||
}
|
// }
|
||||||
subsql += col.ColumnName + " " + sqliteType(col.DataType);
|
// subsql += col.ColumnName + " " + sqliteType(col.DataType);
|
||||||
if (dt.PrimaryKey.Length > 0 && col == dt.PrimaryKey[0])
|
// if (dt.PrimaryKey.Length > 0 && col == dt.PrimaryKey[0])
|
||||||
{
|
// {
|
||||||
subsql += " primary key";
|
// subsql += " primary key";
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
sql += subsql;
|
// sql += subsql;
|
||||||
sql += ")";
|
// sql += ")";
|
||||||
return sql;
|
// return sql;
|
||||||
}
|
// }
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
|
@ -2083,32 +2083,32 @@ namespace OpenSim.Data.SQLite
|
||||||
/// <param name="type">a Type</param>
|
/// <param name="type">a Type</param>
|
||||||
/// <returns>an sqliteType</returns>
|
/// <returns>an sqliteType</returns>
|
||||||
/// <remarks>this is something we'll need to implement for each db slightly differently.</remarks>
|
/// <remarks>this is something we'll need to implement for each db slightly differently.</remarks>
|
||||||
private static string sqliteType(Type type)
|
// private static string sqliteType(Type type)
|
||||||
{
|
// {
|
||||||
if (type == typeof (String))
|
// if (type == typeof (String))
|
||||||
{
|
// {
|
||||||
return "varchar(255)";
|
// return "varchar(255)";
|
||||||
}
|
// }
|
||||||
else if (type == typeof (Int32))
|
// else if (type == typeof (Int32))
|
||||||
{
|
// {
|
||||||
return "integer";
|
// return "integer";
|
||||||
}
|
// }
|
||||||
else if (type == typeof (Int64))
|
// else if (type == typeof (Int64))
|
||||||
{
|
// {
|
||||||
return "integer";
|
// return "integer";
|
||||||
}
|
// }
|
||||||
else if (type == typeof (Double))
|
// else if (type == typeof (Double))
|
||||||
{
|
// {
|
||||||
return "float";
|
// return "float";
|
||||||
}
|
// }
|
||||||
else if (type == typeof (Byte[]))
|
// else if (type == typeof (Byte[]))
|
||||||
{
|
// {
|
||||||
return "blob";
|
// return "blob";
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
return "string";
|
// return "string";
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -557,8 +557,8 @@ namespace OpenSim.Data.SQLite
|
||||||
try {
|
try {
|
||||||
aa = aplist[user];
|
aa = aplist[user];
|
||||||
m_log.Info("[APPEARANCE] Found appearance for " + user.ToString() + aa.ToString());
|
m_log.Info("[APPEARANCE] Found appearance for " + user.ToString() + aa.ToString());
|
||||||
} catch (System.Collections.Generic.KeyNotFoundException e) {
|
} catch (System.Collections.Generic.KeyNotFoundException) {
|
||||||
m_log.Info("[APPEARANCE] No appearance found for " + user.ToString());
|
m_log.InfoFormat("[APPEARANCE] No appearance found for {0}", user.ToString());
|
||||||
}
|
}
|
||||||
return aa;
|
return aa;
|
||||||
}
|
}
|
||||||
|
@ -971,7 +971,7 @@ namespace OpenSim.Data.SQLite
|
||||||
private static bool TestTables(SqliteConnection conn, Migration m)
|
private static bool TestTables(SqliteConnection conn, Migration m)
|
||||||
{
|
{
|
||||||
SqliteCommand cmd = new SqliteCommand(userSelect, conn);
|
SqliteCommand cmd = new SqliteCommand(userSelect, conn);
|
||||||
SqliteCommand fcmd = new SqliteCommand(userFriendsSelect, conn);
|
// SqliteCommand fcmd = new SqliteCommand(userFriendsSelect, conn);
|
||||||
SqliteDataAdapter pDa = new SqliteDataAdapter(cmd);
|
SqliteDataAdapter pDa = new SqliteDataAdapter(cmd);
|
||||||
SqliteDataAdapter fDa = new SqliteDataAdapter(cmd);
|
SqliteDataAdapter fDa = new SqliteDataAdapter(cmd);
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ namespace OpenSim.Grid.AssetServer
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private OpenAsset_Main m_assetManager;
|
// private OpenAsset_Main m_assetManager;
|
||||||
private IAssetProvider m_assetProvider;
|
private IAssetProvider m_assetProvider;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -56,7 +56,7 @@ namespace OpenSim.Grid.AssetServer
|
||||||
: base("GET", "/assets")
|
: base("GET", "/assets")
|
||||||
{
|
{
|
||||||
m_log.Info("[REST]: In Get Request");
|
m_log.Info("[REST]: In Get Request");
|
||||||
m_assetManager = assetManager;
|
// m_assetManager = assetManager;
|
||||||
m_assetProvider = assetProvider;
|
m_assetProvider = assetProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ namespace OpenSim.Grid.AssetServer
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private OpenAsset_Main m_assetManager;
|
// private OpenAsset_Main m_assetManager;
|
||||||
private IAssetProvider m_assetProvider;
|
private IAssetProvider m_assetProvider;
|
||||||
|
|
||||||
public override byte[] Handle(string path, Stream request,
|
public override byte[] Handle(string path, Stream request,
|
||||||
|
@ -131,7 +131,7 @@ namespace OpenSim.Grid.AssetServer
|
||||||
LLUUID assetId;
|
LLUUID assetId;
|
||||||
if (param.Length > 0)
|
if (param.Length > 0)
|
||||||
LLUUID.TryParse(param, out assetId);
|
LLUUID.TryParse(param, out assetId);
|
||||||
byte[] txBuffer = new byte[4096];
|
// byte[] txBuffer = new byte[4096];
|
||||||
|
|
||||||
XmlSerializer xs = new XmlSerializer(typeof (AssetBase));
|
XmlSerializer xs = new XmlSerializer(typeof (AssetBase));
|
||||||
AssetBase asset = (AssetBase) xs.Deserialize(request);
|
AssetBase asset = (AssetBase) xs.Deserialize(request);
|
||||||
|
@ -146,7 +146,7 @@ namespace OpenSim.Grid.AssetServer
|
||||||
public PostAssetStreamHandler(OpenAsset_Main assetManager, IAssetProvider assetProvider)
|
public PostAssetStreamHandler(OpenAsset_Main assetManager, IAssetProvider assetProvider)
|
||||||
: base("POST", "/assets")
|
: base("POST", "/assets")
|
||||||
{
|
{
|
||||||
m_assetManager = assetManager;
|
// m_assetManager = assetManager;
|
||||||
m_assetProvider = assetProvider;
|
m_assetProvider = assetProvider;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace OpenSim.Grid.MessagingServer
|
||||||
private MessageServerConfig Cfg;
|
private MessageServerConfig Cfg;
|
||||||
private MessageService msgsvc;
|
private MessageService msgsvc;
|
||||||
|
|
||||||
private LLUUID m_lastCreatedUser = LLUUID.Random();
|
// private LLUUID m_lastCreatedUser = LLUUID.Random();
|
||||||
|
|
||||||
[STAThread]
|
[STAThread]
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
|
|
|
@ -58,7 +58,7 @@ namespace OpenSim.Grid.MessagingServer
|
||||||
private Hashtable m_presence_BackReferences = new Hashtable();
|
private Hashtable m_presence_BackReferences = new Hashtable();
|
||||||
|
|
||||||
// Hashtable containing work units that need to be processed
|
// Hashtable containing work units that need to be processed
|
||||||
private Hashtable m_unProcessedWorkUnits = new Hashtable();
|
// private Hashtable m_unProcessedWorkUnits = new Hashtable();
|
||||||
|
|
||||||
public MessageService(MessageServerConfig cfg)
|
public MessageService(MessageServerConfig cfg)
|
||||||
{
|
{
|
||||||
|
@ -588,9 +588,9 @@ namespace OpenSim.Grid.MessagingServer
|
||||||
uint regX = Convert.ToUInt32((string)responseData["region_locx"]);
|
uint regX = Convert.ToUInt32((string)responseData["region_locx"]);
|
||||||
uint regY = Convert.ToUInt32((string)responseData["region_locy"]);
|
uint regY = Convert.ToUInt32((string)responseData["region_locy"]);
|
||||||
string internalIpStr = (string)responseData["sim_ip"];
|
string internalIpStr = (string)responseData["sim_ip"];
|
||||||
uint port = Convert.ToUInt32(responseData["sim_port"]);
|
// uint port = Convert.ToUInt32(responseData["sim_port"]);
|
||||||
string externalUri = (string)responseData["sim_uri"];
|
// string externalUri = (string)responseData["sim_uri"];
|
||||||
string neighbourExternalUri = externalUri;
|
// string neighbourExternalUri = externalUri;
|
||||||
|
|
||||||
regionProfile = new RegionProfileData();
|
regionProfile = new RegionProfileData();
|
||||||
regionProfile.httpPort = (uint)Convert.ToInt32((string)responseData["http_port"]);
|
regionProfile.httpPort = (uint)Convert.ToInt32((string)responseData["http_port"]);
|
||||||
|
@ -655,7 +655,7 @@ namespace OpenSim.Grid.MessagingServer
|
||||||
throw(ex);
|
throw(ex);
|
||||||
}
|
}
|
||||||
Hashtable GridRespData = (Hashtable)UserResp.Value;
|
Hashtable GridRespData = (Hashtable)UserResp.Value;
|
||||||
Hashtable griddatahash = GridRespData;
|
// Hashtable griddatahash = GridRespData;
|
||||||
|
|
||||||
// Process Response
|
// Process Response
|
||||||
if (GridRespData.ContainsKey("responsestring"))
|
if (GridRespData.ContainsKey("responsestring"))
|
||||||
|
@ -704,7 +704,7 @@ namespace OpenSim.Grid.MessagingServer
|
||||||
throw (ex);
|
throw (ex);
|
||||||
}
|
}
|
||||||
Hashtable UserRespData = (Hashtable)UserResp.Value;
|
Hashtable UserRespData = (Hashtable)UserResp.Value;
|
||||||
Hashtable userdatahash = UserRespData;
|
// Hashtable userdatahash = UserRespData;
|
||||||
|
|
||||||
// Process Response
|
// Process Response
|
||||||
if (UserRespData.ContainsKey("responsestring"))
|
if (UserRespData.ContainsKey("responsestring"))
|
||||||
|
|
|
@ -118,7 +118,8 @@ namespace OpenSim.Grid.MessagingServer
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
XmlRpcResponse RegionResp = RegionReq.Send(whichRegion.httpServerURI, 6000);
|
// XmlRpcResponse RegionResp = RegionReq.Send(whichRegion.httpServerURI, 6000);
|
||||||
|
RegionReq.Send(whichRegion.httpServerURI, 6000);
|
||||||
}
|
}
|
||||||
catch (WebException)
|
catch (WebException)
|
||||||
{
|
{
|
||||||
|
|
|
@ -84,7 +84,7 @@ namespace OpenSim.Grid.MessagingServer
|
||||||
|
|
||||||
public class PostXMPPStreamHandler : BaseStreamHandler
|
public class PostXMPPStreamHandler : BaseStreamHandler
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
public override byte[] Handle(string path, Stream request,
|
public override byte[] Handle(string path, Stream request,
|
||||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||||
|
@ -94,7 +94,7 @@ namespace OpenSim.Grid.MessagingServer
|
||||||
LLUUID assetId;
|
LLUUID assetId;
|
||||||
if (param.Length > 0)
|
if (param.Length > 0)
|
||||||
LLUUID.TryParse(param, out assetId);
|
LLUUID.TryParse(param, out assetId);
|
||||||
byte[] txBuffer = new byte[4096];
|
// byte[] txBuffer = new byte[4096];
|
||||||
|
|
||||||
// TODO: Read POST serialize XMPP stanzas
|
// TODO: Read POST serialize XMPP stanzas
|
||||||
|
|
||||||
|
|
|
@ -29,13 +29,13 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer.Region
|
||||||
{
|
{
|
||||||
public class RegionConnectionManager : RegionBase
|
public class RegionConnectionManager : RegionBase
|
||||||
{
|
{
|
||||||
private ScriptServerMain m_ScriptServerMain;
|
// private ScriptServerMain m_ScriptServerMain;
|
||||||
private object m_Connection;
|
// private object m_Connection;
|
||||||
|
|
||||||
public RegionConnectionManager(ScriptServerMain scm, object Connection)
|
public RegionConnectionManager(ScriptServerMain scm, object Connection)
|
||||||
{
|
{
|
||||||
m_ScriptServerMain = scm;
|
// m_ScriptServerMain = scm;
|
||||||
m_Connection = Connection;
|
// m_Connection = Connection;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -34,12 +34,12 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer
|
||||||
{
|
{
|
||||||
private ScriptEngineLoader ScriptEngineLoader;
|
private ScriptEngineLoader ScriptEngineLoader;
|
||||||
private List<ScriptServerInterfaces.ScriptEngine> scriptEngines = new List<ScriptServerInterfaces.ScriptEngine>();
|
private List<ScriptServerInterfaces.ScriptEngine> scriptEngines = new List<ScriptServerInterfaces.ScriptEngine>();
|
||||||
private ScriptServerMain m_ScriptServerMain;
|
// private ScriptServerMain m_ScriptServerMain;
|
||||||
|
|
||||||
// Initialize
|
// Initialize
|
||||||
public ScriptEngineManager(ScriptServerMain scm)
|
public ScriptEngineManager(ScriptServerMain scm)
|
||||||
{
|
{
|
||||||
m_ScriptServerMain = scm;
|
// m_ScriptServerMain = scm;
|
||||||
ScriptEngineLoader = new ScriptEngineLoader();
|
ScriptEngineLoader = new ScriptEngineLoader();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -140,12 +140,12 @@ namespace OpenSim.Grid.UserServer
|
||||||
|
|
||||||
if (requestData.Contains("fromuri"))
|
if (requestData.Contains("fromuri"))
|
||||||
{
|
{
|
||||||
string sURI = (string)requestData["fromuri"];
|
// string sURI = (string)requestData["fromuri"];
|
||||||
string sagentID = (string)requestData["agentid"];
|
// string sagentID = (string)requestData["agentid"];
|
||||||
string ssessionID = (string)requestData["sessionid"];
|
// string ssessionID = (string)requestData["sessionid"];
|
||||||
string scurrentRegionID = (string)requestData["regionid"];
|
// string scurrentRegionID = (string)requestData["regionid"];
|
||||||
string sregionhandle = (string)requestData["regionhandle"];
|
// string sregionhandle = (string)requestData["regionhandle"];
|
||||||
string scurrentpos = (string)requestData["currentpos"];
|
// string scurrentpos = (string)requestData["currentpos"];
|
||||||
//LLVector3.TryParse((string)reader["currentPos"], out retval.currentPos);
|
//LLVector3.TryParse((string)reader["currentPos"], out retval.currentPos);
|
||||||
// TODO: Okay now raise event so the user server can pass this data to the Usermanager
|
// TODO: Okay now raise event so the user server can pass this data to the Usermanager
|
||||||
|
|
||||||
|
|
|
@ -164,7 +164,7 @@ namespace OpenSim.Grid.UserServer
|
||||||
|
|
||||||
public XmlRpcResponse XmlRPCGetAvatarPickerAvatar(XmlRpcRequest request)
|
public XmlRpcResponse XmlRPCGetAvatarPickerAvatar(XmlRpcRequest request)
|
||||||
{
|
{
|
||||||
XmlRpcResponse response = new XmlRpcResponse();
|
// XmlRpcResponse response = new XmlRpcResponse();
|
||||||
Hashtable requestData = (Hashtable) request.Params[0];
|
Hashtable requestData = (Hashtable) request.Params[0];
|
||||||
List<AvatarPickerAvatar> returnAvatar = new List<AvatarPickerAvatar>();
|
List<AvatarPickerAvatar> returnAvatar = new List<AvatarPickerAvatar>();
|
||||||
LLUUID queryID = new LLUUID(LLUUID.Zero.ToString());
|
LLUUID queryID = new LLUUID(LLUUID.Zero.ToString());
|
||||||
|
@ -188,25 +188,25 @@ namespace OpenSim.Grid.UserServer
|
||||||
|
|
||||||
if (requestData.Contains("avatar_id") && requestData.Contains("region_handle") && requestData.Contains("region_uuid"))
|
if (requestData.Contains("avatar_id") && requestData.Contains("region_handle") && requestData.Contains("region_uuid"))
|
||||||
{
|
{
|
||||||
ulong cregionhandle = 0;
|
// ulong cregionhandle = 0;
|
||||||
LLUUID regionUUID = LLUUID.Zero;
|
LLUUID regionUUID = LLUUID.Zero;
|
||||||
LLUUID AvatarID = LLUUID.Zero;
|
LLUUID AvatarID = LLUUID.Zero;
|
||||||
|
|
||||||
Helpers.TryParse((string)requestData["avatar_id"], out AvatarID);
|
Helpers.TryParse((string)requestData["avatar_id"], out AvatarID);
|
||||||
Helpers.TryParse((string)requestData["region_uuid"], out regionUUID);
|
Helpers.TryParse((string)requestData["region_uuid"], out regionUUID);
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
cregionhandle = (ulong)Convert.ToInt64((string)requestData["region_handle"]);
|
// cregionhandle = (ulong)Convert.ToInt64((string)requestData["region_handle"]);
|
||||||
}
|
// }
|
||||||
catch (ArgumentException)
|
// catch (ArgumentException)
|
||||||
{
|
// {
|
||||||
}
|
// }
|
||||||
catch (OverflowException)
|
// catch (OverflowException)
|
||||||
{
|
// {
|
||||||
}
|
// }
|
||||||
catch (FormatException)
|
// catch (FormatException)
|
||||||
{
|
// {
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (AvatarID != LLUUID.Zero)
|
if (AvatarID != LLUUID.Zero)
|
||||||
{
|
{
|
||||||
|
@ -285,9 +285,9 @@ namespace OpenSim.Grid.UserServer
|
||||||
|
|
||||||
public XmlRpcResponse XmlRpcResponseXmlRPCGetUserFriendList(XmlRpcRequest request)
|
public XmlRpcResponse XmlRpcResponseXmlRPCGetUserFriendList(XmlRpcRequest request)
|
||||||
{
|
{
|
||||||
XmlRpcResponse response = new XmlRpcResponse();
|
// XmlRpcResponse response = new XmlRpcResponse();
|
||||||
Hashtable requestData = (Hashtable)request.Params[0];
|
Hashtable requestData = (Hashtable)request.Params[0];
|
||||||
Hashtable responseData = new Hashtable();
|
// Hashtable responseData = new Hashtable();
|
||||||
|
|
||||||
List<FriendListItem> returndata = new List<FriendListItem>();
|
List<FriendListItem> returndata = new List<FriendListItem>();
|
||||||
|
|
||||||
|
@ -354,14 +354,14 @@ namespace OpenSim.Grid.UserServer
|
||||||
|
|
||||||
public XmlRpcResponse XmlRPCGetUserMethodName(XmlRpcRequest request)
|
public XmlRpcResponse XmlRPCGetUserMethodName(XmlRpcRequest request)
|
||||||
{
|
{
|
||||||
XmlRpcResponse response = new XmlRpcResponse();
|
// XmlRpcResponse response = new XmlRpcResponse();
|
||||||
Hashtable requestData = (Hashtable) request.Params[0];
|
Hashtable requestData = (Hashtable) request.Params[0];
|
||||||
UserProfileData userProfile;
|
UserProfileData userProfile;
|
||||||
if (requestData.Contains("avatar_name"))
|
if (requestData.Contains("avatar_name"))
|
||||||
{
|
{
|
||||||
string query = (string) requestData["avatar_name"];
|
string query = (string) requestData["avatar_name"];
|
||||||
|
|
||||||
Regex objAlphaNumericPattern = new Regex("[^a-zA-Z0-9]");
|
// Regex objAlphaNumericPattern = new Regex("[^a-zA-Z0-9]");
|
||||||
|
|
||||||
string[] querysplit;
|
string[] querysplit;
|
||||||
querysplit = query.Split(' ');
|
querysplit = query.Split(' ');
|
||||||
|
@ -389,7 +389,7 @@ namespace OpenSim.Grid.UserServer
|
||||||
|
|
||||||
public XmlRpcResponse XmlRPCGetUserMethodUUID(XmlRpcRequest request)
|
public XmlRpcResponse XmlRPCGetUserMethodUUID(XmlRpcRequest request)
|
||||||
{
|
{
|
||||||
XmlRpcResponse response = new XmlRpcResponse();
|
// XmlRpcResponse response = new XmlRpcResponse();
|
||||||
Hashtable requestData = (Hashtable) request.Params[0];
|
Hashtable requestData = (Hashtable) request.Params[0];
|
||||||
UserProfileData userProfile;
|
UserProfileData userProfile;
|
||||||
//CFK: this clogs the UserServer log and is not necessary at this time.
|
//CFK: this clogs the UserServer log and is not necessary at this time.
|
||||||
|
|
|
@ -153,7 +153,7 @@ namespace OpenSim
|
||||||
|
|
||||||
m_config = new OpenSimConfigSource();
|
m_config = new OpenSimConfigSource();
|
||||||
m_config.Source = new IniConfigSource();
|
m_config.Source = new IniConfigSource();
|
||||||
IConfigSource icong;
|
// IConfigSource icong;
|
||||||
|
|
||||||
//check for .INI file (either default or name passed in command line)
|
//check for .INI file (either default or name passed in command line)
|
||||||
if (File.Exists(Application.iniFilePath))
|
if (File.Exists(Application.iniFilePath))
|
||||||
|
|
|
@ -253,9 +253,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
private UpdateVector handlerUpdatePrimGroupScale = null; //OnUpdateGroupScale;
|
private UpdateVector handlerUpdatePrimGroupScale = null; //OnUpdateGroupScale;
|
||||||
private UpdateVector handlerUpdateVector = null; //OnUpdatePrimGroupPosition;
|
private UpdateVector handlerUpdateVector = null; //OnUpdatePrimGroupPosition;
|
||||||
private UpdatePrimRotation handlerUpdatePrimRotation = null; //OnUpdatePrimGroupRotation;
|
private UpdatePrimRotation handlerUpdatePrimRotation = null; //OnUpdatePrimGroupRotation;
|
||||||
private UpdatePrimGroupRotation handlerUpdatePrimGroupRotation = null; //OnUpdatePrimGroupMouseRotation;
|
// private UpdatePrimGroupRotation handlerUpdatePrimGroupRotation = null; //OnUpdatePrimGroupMouseRotation;
|
||||||
private PacketStats handlerPacketStats = null; // OnPacketStats;#
|
private PacketStats handlerPacketStats = null; // OnPacketStats;#
|
||||||
private RequestAsset handlerRequestAsset = null; // OnRequestAsset;
|
// private RequestAsset handlerRequestAsset = null; // OnRequestAsset;
|
||||||
private UUIDNameRequest handlerTeleportHomeRequest = null;
|
private UUIDNameRequest handlerTeleportHomeRequest = null;
|
||||||
|
|
||||||
private ScriptAnswer handlerScriptAnswer = null;
|
private ScriptAnswer handlerScriptAnswer = null;
|
||||||
|
@ -3467,7 +3467,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LLUUID partId = part.UUID;
|
// LLUUID partId = part.UUID;
|
||||||
UpdatePrimRotation handlerUpdatePrimRotation = OnUpdatePrimGroupRotation;
|
UpdatePrimRotation handlerUpdatePrimRotation = OnUpdatePrimGroupRotation;
|
||||||
UpdatePrimGroupRotation handlerUpdatePrimGroupRotation = OnUpdatePrimGroupMouseRotation;
|
UpdatePrimGroupRotation handlerUpdatePrimGroupRotation = OnUpdatePrimGroupMouseRotation;
|
||||||
|
|
||||||
|
@ -4135,7 +4135,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
byte[] message = inchatpack.ChatData.Message;
|
byte[] message = inchatpack.ChatData.Message;
|
||||||
byte type = inchatpack.ChatData.Type;
|
byte type = inchatpack.ChatData.Type;
|
||||||
LLVector3 fromPos = new LLVector3(); // ClientAvatar.Pos;
|
LLVector3 fromPos = new LLVector3(); // ClientAvatar.Pos;
|
||||||
LLUUID fromAgentID = AgentId;
|
// LLUUID fromAgentID = AgentId;
|
||||||
|
|
||||||
int channel = inchatpack.ChatData.Channel;
|
int channel = inchatpack.ChatData.Channel;
|
||||||
|
|
||||||
|
@ -4388,7 +4388,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
DetachAttachmentIntoInvPacket detachtoInv = (DetachAttachmentIntoInvPacket)Pack;
|
DetachAttachmentIntoInvPacket detachtoInv = (DetachAttachmentIntoInvPacket)Pack;
|
||||||
|
|
||||||
LLUUID itemID = detachtoInv.ObjectData.ItemID;
|
LLUUID itemID = detachtoInv.ObjectData.ItemID;
|
||||||
LLUUID ATTACH_agentID = detachtoInv.ObjectData.AgentID;
|
// LLUUID ATTACH_agentID = detachtoInv.ObjectData.AgentID;
|
||||||
|
|
||||||
handlerDetachAttachmentIntoInv(itemID, this);
|
handlerDetachAttachmentIntoInv(itemID, this);
|
||||||
}
|
}
|
||||||
|
@ -5938,7 +5938,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PacketType.RequestRegionInfo:
|
case PacketType.RequestRegionInfo:
|
||||||
RequestRegionInfoPacket.AgentDataBlock mPacket = ((RequestRegionInfoPacket)Pack).AgentData;
|
// RequestRegionInfoPacket.AgentDataBlock mPacket = ((RequestRegionInfoPacket)Pack).AgentData;
|
||||||
|
|
||||||
handlerRegionInfoRequest = OnRegionInfoRequest;
|
handlerRegionInfoRequest = OnRegionInfoRequest;
|
||||||
if (handlerRegionInfoRequest != null)
|
if (handlerRegionInfoRequest != null)
|
||||||
|
@ -5948,8 +5948,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
break;
|
break;
|
||||||
case PacketType.EstateCovenantRequest:
|
case PacketType.EstateCovenantRequest:
|
||||||
|
|
||||||
EstateCovenantRequestPacket.AgentDataBlock epack =
|
// EstateCovenantRequestPacket.AgentDataBlock epack =
|
||||||
((EstateCovenantRequestPacket)Pack).AgentData;
|
// ((EstateCovenantRequestPacket)Pack).AgentData;
|
||||||
|
|
||||||
handlerEstateCovenantRequest = OnEstateCovenantRequest;
|
handlerEstateCovenantRequest = OnEstateCovenantRequest;
|
||||||
if (handlerEstateCovenantRequest != null)
|
if (handlerEstateCovenantRequest != null)
|
||||||
|
@ -6287,7 +6287,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
public void SendLandStatReply(uint reportType, uint requestFlags, uint resultCount, LandStatReportItem[] lsrpia)
|
public void SendLandStatReply(uint reportType, uint requestFlags, uint resultCount, LandStatReportItem[] lsrpia)
|
||||||
{
|
{
|
||||||
LandStatReplyPacket lsrp = new LandStatReplyPacket();
|
LandStatReplyPacket lsrp = new LandStatReplyPacket();
|
||||||
LandStatReplyPacket.RequestDataBlock lsreqdpb = new LandStatReplyPacket.RequestDataBlock();
|
// LandStatReplyPacket.RequestDataBlock lsreqdpb = new LandStatReplyPacket.RequestDataBlock();
|
||||||
LandStatReplyPacket.ReportDataBlock[] lsrepdba = new LandStatReplyPacket.ReportDataBlock[lsrpia.Length];
|
LandStatReplyPacket.ReportDataBlock[] lsrepdba = new LandStatReplyPacket.ReportDataBlock[lsrpia.Length];
|
||||||
//LandStatReplyPacket.ReportDataBlock lsrepdb = new LandStatReplyPacket.ReportDataBlock();
|
//LandStatReplyPacket.ReportDataBlock lsrepdb = new LandStatReplyPacket.ReportDataBlock();
|
||||||
// lsrepdb.
|
// lsrepdb.
|
||||||
|
|
|
@ -57,8 +57,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
private Queue<LLQueItem> TextureOutgoingPacketQueue;
|
private Queue<LLQueItem> TextureOutgoingPacketQueue;
|
||||||
private Queue<LLQueItem> AssetOutgoingPacketQueue;
|
private Queue<LLQueItem> AssetOutgoingPacketQueue;
|
||||||
|
|
||||||
private Dictionary<uint, uint> PendingAcks = new Dictionary<uint, uint>();
|
// private Dictionary<uint, uint> PendingAcks = new Dictionary<uint, uint>();
|
||||||
private Dictionary<uint, Packet> NeedAck = new Dictionary<uint, Packet>();
|
// private Dictionary<uint, Packet> NeedAck = new Dictionary<uint, Packet>();
|
||||||
|
|
||||||
// All throttle times and number of bytes are calculated by dividing by this value
|
// All throttle times and number of bytes are calculated by dividing by this value
|
||||||
// This value also determines how many times per throttletimems the timer will run
|
// This value also determines how many times per throttletimems the timer will run
|
||||||
|
|
|
@ -418,9 +418,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
m_socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
|
m_socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
|
||||||
m_socket.Bind(ServerIncoming);
|
m_socket.Bind(ServerIncoming);
|
||||||
// Add flags to the UDP socket to prevent "Socket forcibly closed by host"
|
// Add flags to the UDP socket to prevent "Socket forcibly closed by host"
|
||||||
uint IOC_IN = 0x80000000;
|
// uint IOC_IN = 0x80000000;
|
||||||
uint IOC_VENDOR = 0x18000000;
|
// uint IOC_VENDOR = 0x18000000;
|
||||||
uint SIO_UDP_CONNRESET = IOC_IN | IOC_VENDOR | 12;
|
// uint SIO_UDP_CONNRESET = IOC_IN | IOC_VENDOR | 12;
|
||||||
// TODO: this apparently works in .NET but not in Mono, need to sort out the right flags here.
|
// TODO: this apparently works in .NET but not in Mono, need to sort out the right flags here.
|
||||||
// m_socket.IOControl((int)SIO_UDP_CONNRESET, new byte[] { Convert.ToByte(false) }, null);
|
// m_socket.IOControl((int)SIO_UDP_CONNRESET, new byte[] { Convert.ToByte(false) }, null);
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ namespace OpenSim.Region.DataSnapshot
|
||||||
|
|
||||||
//Program objects
|
//Program objects
|
||||||
private SnapshotStore m_snapStore = null;
|
private SnapshotStore m_snapStore = null;
|
||||||
private DataRequestHandler m_requests = null;
|
// private DataRequestHandler m_requests = null;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ namespace OpenSim.Region.DataSnapshot
|
||||||
m_passedCheck.Start();
|
m_passedCheck.Start();
|
||||||
|
|
||||||
//Hand it the first scene, assuming that all scenes have the same BaseHTTPServer
|
//Hand it the first scene, assuming that all scenes have the same BaseHTTPServer
|
||||||
m_requests = new DataRequestHandler(scene, this);
|
// m_requests = new DataRequestHandler(scene, this);
|
||||||
|
|
||||||
m_hostname = scene.RegionInfo.ExternalHostName;
|
m_hostname = scene.RegionInfo.ExternalHostName;
|
||||||
m_snapStore = new SnapshotStore(m_snapsDir, m_gridinfo, m_listener_port, m_hostname);
|
m_snapStore = new SnapshotStore(m_snapsDir, m_gridinfo, m_listener_port, m_hostname);
|
||||||
|
@ -325,17 +325,18 @@ namespace OpenSim.Region.DataSnapshot
|
||||||
m_log.Warn("[DATASNAPSHOT] Ignoring unknown exception " + e.ToString());
|
m_log.Warn("[DATASNAPSHOT] Ignoring unknown exception " + e.ToString());
|
||||||
}
|
}
|
||||||
byte[] response = new byte[1024];
|
byte[] response = new byte[1024];
|
||||||
int n = 0;
|
// int n = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
n = reply.Read(response, 0, 1024);
|
// n = reply.Read(response, 0, 1024);
|
||||||
|
reply.Read(response, 0, 1024);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_log.Warn("[DATASNAPSHOT] Unable to decode reply from data service. Ignoring. " + e.StackTrace);
|
m_log.WarnFormat("[DATASNAPSHOT] Unable to decode reply from data service. Ignoring. {0}", e.StackTrace);
|
||||||
}
|
}
|
||||||
// This is not quite working, so...
|
// This is not quite working, so...
|
||||||
string responseStr = Encoding.UTF8.GetString(response);
|
// string responseStr = Encoding.UTF8.GetString(response);
|
||||||
m_log.Info("[DATASNAPSHOT] data service notified: " + url);
|
m_log.Info("[DATASNAPSHOT] data service notified: " + url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace OpenSim.Region.DataSnapshot.Providers
|
||||||
* I don't think anything changes the fields beyond RegionModule PostInit, however.
|
* I don't think anything changes the fields beyond RegionModule PostInit, however.
|
||||||
*/
|
*/
|
||||||
private Scene m_scene = null;
|
private Scene m_scene = null;
|
||||||
private DataSnapshotManager m_parent = null;
|
// private DataSnapshotManager m_parent = null;
|
||||||
private bool m_stale = true;
|
private bool m_stale = true;
|
||||||
|
|
||||||
#region IDataSnapshotProvider Members
|
#region IDataSnapshotProvider Members
|
||||||
|
@ -84,7 +84,7 @@ namespace OpenSim.Region.DataSnapshot.Providers
|
||||||
public void Initialize(Scene scene, DataSnapshotManager parent)
|
public void Initialize(Scene scene, DataSnapshotManager parent)
|
||||||
{
|
{
|
||||||
m_scene = scene;
|
m_scene = scene;
|
||||||
m_parent = parent;
|
// m_parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Scene GetParentScene
|
public Scene GetParentScene
|
||||||
|
|
|
@ -43,7 +43,7 @@ namespace OpenSim.Region.DataSnapshot.Providers
|
||||||
public class LandSnapshot : IDataSnapshotProvider
|
public class LandSnapshot : IDataSnapshotProvider
|
||||||
{
|
{
|
||||||
private Scene m_scene = null;
|
private Scene m_scene = null;
|
||||||
private DataSnapshotManager m_parent = null;
|
// private DataSnapshotManager m_parent = null;
|
||||||
//private Dictionary<int, Land> m_landIndexed = new Dictionary<int, Land>();
|
//private Dictionary<int, Land> m_landIndexed = new Dictionary<int, Land>();
|
||||||
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_stale = true;
|
private bool m_stale = true;
|
||||||
|
@ -106,7 +106,7 @@ namespace OpenSim.Region.DataSnapshot.Providers
|
||||||
public void Initialize(Scene scene, DataSnapshotManager parent)
|
public void Initialize(Scene scene, DataSnapshotManager parent)
|
||||||
{
|
{
|
||||||
m_scene = scene;
|
m_scene = scene;
|
||||||
m_parent = parent;
|
// m_parent = parent;
|
||||||
|
|
||||||
//Brought back from the dead for staleness checks.
|
//Brought back from the dead for staleness checks.
|
||||||
m_scene.EventManager.OnNewClient += OnNewClient;
|
m_scene.EventManager.OnNewClient += OnNewClient;
|
||||||
|
|
|
@ -40,14 +40,14 @@ namespace OpenSim.Region.DataSnapshot.Providers
|
||||||
public class ObjectSnapshot : IDataSnapshotProvider
|
public class ObjectSnapshot : IDataSnapshotProvider
|
||||||
{
|
{
|
||||||
private Scene m_scene = null;
|
private Scene m_scene = null;
|
||||||
private DataSnapshotManager m_parent = null;
|
// private DataSnapshotManager m_parent = null;
|
||||||
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_stale = true;
|
private bool m_stale = true;
|
||||||
|
|
||||||
public void Initialize(Scene scene, DataSnapshotManager parent)
|
public void Initialize(Scene scene, DataSnapshotManager parent)
|
||||||
{
|
{
|
||||||
m_scene = scene;
|
m_scene = scene;
|
||||||
m_parent = parent;
|
// m_parent = parent;
|
||||||
|
|
||||||
//To check for staleness, we must catch all incoming client packets.
|
//To check for staleness, we must catch all incoming client packets.
|
||||||
m_scene.EventManager.OnNewClient += OnNewClient;
|
m_scene.EventManager.OnNewClient += OnNewClient;
|
||||||
|
|
|
@ -72,7 +72,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
|
||||||
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = ".ncd";
|
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = ".ncd";
|
||||||
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = ".oob";
|
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = ".oob";
|
||||||
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.RootFolder] = ".rfd"; // Not sure if we'll ever see this
|
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.RootFolder] = ".rfd"; // Not sure if we'll ever see this
|
||||||
|
#pragma warning disable 0612
|
||||||
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Script] = ".spt"; // Not sure if we'll ever see this
|
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Script] = ".spt"; // Not sure if we'll ever see this
|
||||||
|
#pragma warning restore 0612
|
||||||
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Simstate] = ".sst"; // Not sure if we'll ever see this
|
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Simstate] = ".sst"; // Not sure if we'll ever see this
|
||||||
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SnapshotFolder] = ".sfd"; // Not sure if we'll ever see this
|
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SnapshotFolder] = ".sfd"; // Not sure if we'll ever see this
|
||||||
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Sound] = ".ogg";
|
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Sound] = ".ogg";
|
||||||
|
@ -95,7 +97,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
|
||||||
EXTENSION_TO_ASSET_TYPE[".ncd"] = (sbyte)AssetType.Notecard;
|
EXTENSION_TO_ASSET_TYPE[".ncd"] = (sbyte)AssetType.Notecard;
|
||||||
EXTENSION_TO_ASSET_TYPE[".oob"] = (sbyte)AssetType.Object;
|
EXTENSION_TO_ASSET_TYPE[".oob"] = (sbyte)AssetType.Object;
|
||||||
EXTENSION_TO_ASSET_TYPE[".rfd"] = (sbyte)AssetType.RootFolder;
|
EXTENSION_TO_ASSET_TYPE[".rfd"] = (sbyte)AssetType.RootFolder;
|
||||||
|
#pragma warning disable 0612
|
||||||
EXTENSION_TO_ASSET_TYPE[".spt"] = (sbyte)AssetType.Script;
|
EXTENSION_TO_ASSET_TYPE[".spt"] = (sbyte)AssetType.Script;
|
||||||
|
#pragma warning restore 0612
|
||||||
EXTENSION_TO_ASSET_TYPE[".sst"] = (sbyte)AssetType.Simstate;
|
EXTENSION_TO_ASSET_TYPE[".sst"] = (sbyte)AssetType.Simstate;
|
||||||
EXTENSION_TO_ASSET_TYPE[".sfd"] = (sbyte)AssetType.SnapshotFolder;
|
EXTENSION_TO_ASSET_TYPE[".sfd"] = (sbyte)AssetType.SnapshotFolder;
|
||||||
EXTENSION_TO_ASSET_TYPE[".ogg"] = (sbyte)AssetType.Sound;
|
EXTENSION_TO_ASSET_TYPE[".ogg"] = (sbyte)AssetType.Sound;
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ArchiverModule : IRegionModule, IRegionArchiver
|
public class ArchiverModule : IRegionModule, IRegionArchiver
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Scene to which this module belongs
|
/// Scene to which this module belongs
|
||||||
|
|
|
@ -34,17 +34,17 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
|
||||||
{
|
{
|
||||||
public class NPCModule : IRegionModule
|
public class NPCModule : IRegionModule
|
||||||
{
|
{
|
||||||
private const bool m_enabled = false;
|
// private const bool m_enabled = false;
|
||||||
|
|
||||||
public void Initialise(Scene scene, IConfigSource source)
|
public void Initialise(Scene scene, IConfigSource source)
|
||||||
{
|
{
|
||||||
if (m_enabled)
|
// if (m_enabled)
|
||||||
{
|
// {
|
||||||
NPCAvatar testAvatar = new NPCAvatar("Jack", "NPC", new LLVector3(128, 128, 40), scene);
|
// NPCAvatar testAvatar = new NPCAvatar("Jack", "NPC", new LLVector3(128, 128, 40), scene);
|
||||||
NPCAvatar testAvatar2 = new NPCAvatar("Jill", "NPC", new LLVector3(136, 128, 40), scene);
|
// NPCAvatar testAvatar2 = new NPCAvatar("Jill", "NPC", new LLVector3(136, 128, 40), scene);
|
||||||
scene.AddNewClient(testAvatar, false);
|
// scene.AddNewClient(testAvatar, false);
|
||||||
scene.AddNewClient(testAvatar2, false);
|
// scene.AddNewClient(testAvatar2, false);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PostInitialise()
|
public void PostInitialise()
|
||||||
|
|
|
@ -57,16 +57,16 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
private double m_day_length = 0;
|
private double m_day_length = 0;
|
||||||
private int m_year_length = 0;
|
private int m_year_length = 0;
|
||||||
private double m_day_night = 0;
|
private double m_day_night = 0;
|
||||||
private double m_longitude = 0;
|
// private double m_longitude = 0;
|
||||||
private double m_latitude = 0;
|
// private double m_latitude = 0;
|
||||||
// Configurable defaults Defaults close to SL
|
// Configurable defaults Defaults close to SL
|
||||||
private string d_mode = "SL";
|
private string d_mode = "SL";
|
||||||
private int d_frame_mod = 100; // Every 10 seconds (actually less)
|
private int d_frame_mod = 100; // Every 10 seconds (actually less)
|
||||||
private double d_day_length = 4; // A VW day is 4 RW hours long
|
private double d_day_length = 4; // A VW day is 4 RW hours long
|
||||||
private int d_year_length = 60; // There are 60 VW days in a VW year
|
private int d_year_length = 60; // There are 60 VW days in a VW year
|
||||||
private double d_day_night = 0.45; // axis offset: ratio of light-to-dark, approx 1:3
|
private double d_day_night = 0.45; // axis offset: ratio of light-to-dark, approx 1:3
|
||||||
private double d_longitude = -73.53;
|
// private double d_longitude = -73.53;
|
||||||
private double d_latitude = 41.29;
|
// private double d_latitude = 41.29;
|
||||||
|
|
||||||
// Frame counter
|
// Frame counter
|
||||||
private uint m_frame = 0;
|
private uint m_frame = 0;
|
||||||
|
@ -80,7 +80,7 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
private uint SecondsPerYear; // Length of a virtual year in RW seconds
|
private uint SecondsPerYear; // Length of a virtual year in RW seconds
|
||||||
private double SunSpeed; // Rate of passage in radians/second
|
private double SunSpeed; // Rate of passage in radians/second
|
||||||
private double SeasonSpeed; // Rate of change for seasonal effects
|
private double SeasonSpeed; // Rate of change for seasonal effects
|
||||||
private double HoursToRadians; // Rate of change for seasonal effects
|
// private double HoursToRadians; // Rate of change for seasonal effects
|
||||||
private long TicksOffset = 0; // seconds offset from UTC
|
private long TicksOffset = 0; // seconds offset from UTC
|
||||||
// Calculated every update
|
// Calculated every update
|
||||||
private float OrbitalPosition; // Orbital placement at a point in time
|
private float OrbitalPosition; // Orbital placement at a point in time
|
||||||
|
@ -88,7 +88,7 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
private double TotalDistanceTravelled; // Distance since beginning of time (in radians)
|
private double TotalDistanceTravelled; // Distance since beginning of time (in radians)
|
||||||
private double SeasonalOffset; // Seaonal variation of tilt
|
private double SeasonalOffset; // Seaonal variation of tilt
|
||||||
private float Magnitude; // Normal tilt
|
private float Magnitude; // Normal tilt
|
||||||
private double VWTimeRatio; // VW time as a ratio of real time
|
// private double VWTimeRatio; // VW time as a ratio of real time
|
||||||
|
|
||||||
// Working values
|
// Working values
|
||||||
private LLVector3 Position = new LLVector3(0,0,0);
|
private LLVector3 Position = new LLVector3(0,0,0);
|
||||||
|
@ -173,9 +173,9 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
// Mode: determines how the sun is handled
|
// Mode: determines how the sun is handled
|
||||||
m_mode = config.Configs["Sun"].GetString("mode", d_mode);
|
m_mode = config.Configs["Sun"].GetString("mode", d_mode);
|
||||||
// Mode: determines how the sun is handled
|
// Mode: determines how the sun is handled
|
||||||
m_latitude = config.Configs["Sun"].GetDouble("latitude", d_latitude);
|
// m_latitude = config.Configs["Sun"].GetDouble("latitude", d_latitude);
|
||||||
// Mode: determines how the sun is handled
|
// Mode: determines how the sun is handled
|
||||||
m_longitude = config.Configs["Sun"].GetDouble("longitude", d_longitude);
|
// m_longitude = config.Configs["Sun"].GetDouble("longitude", d_longitude);
|
||||||
// Day length in decimal hours
|
// Day length in decimal hours
|
||||||
m_year_length = config.Configs["Sun"].GetInt("year_length", d_year_length);
|
m_year_length = config.Configs["Sun"].GetInt("year_length", d_year_length);
|
||||||
// Day length in decimal hours
|
// Day length in decimal hours
|
||||||
|
@ -193,8 +193,8 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
m_day_length = d_day_length;
|
m_day_length = d_day_length;
|
||||||
m_day_night = d_day_night;
|
m_day_night = d_day_night;
|
||||||
m_frame_mod = d_frame_mod;
|
m_frame_mod = d_frame_mod;
|
||||||
m_latitude = d_latitude;
|
// m_latitude = d_latitude;
|
||||||
m_longitude = d_longitude;
|
// m_longitude = d_longitude;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (m_mode)
|
switch (m_mode)
|
||||||
|
@ -209,7 +209,7 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
|
|
||||||
// Ration of real-to-virtual time
|
// Ration of real-to-virtual time
|
||||||
|
|
||||||
VWTimeRatio = 24/m_day_length;
|
// VWTimeRatio = 24/m_day_length;
|
||||||
|
|
||||||
// Speed of rotation needed to complete a cycle in the
|
// Speed of rotation needed to complete a cycle in the
|
||||||
// designated period (day and season)
|
// designated period (day and season)
|
||||||
|
@ -220,7 +220,7 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
// Horizon translation
|
// Horizon translation
|
||||||
|
|
||||||
HorizonShift = m_day_night; // Z axis translation
|
HorizonShift = m_day_night; // Z axis translation
|
||||||
HoursToRadians = (SunCycle/24)*VWTimeRatio;
|
// HoursToRadians = (SunCycle/24)*VWTimeRatio;
|
||||||
|
|
||||||
// Insert our event handling hooks
|
// Insert our event handling hooks
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public InnerScene m_innerScene;
|
public InnerScene m_innerScene;
|
||||||
|
|
||||||
private Random Rand = new Random();
|
// private Random Rand = new Random();
|
||||||
private uint _primCount = 720000;
|
private uint _primCount = 720000;
|
||||||
private readonly Mutex _primAllocateMutex = new Mutex(false);
|
private readonly Mutex _primAllocateMutex = new Mutex(false);
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class SceneObjectGroup : EntityBase
|
public partial class SceneObjectGroup : EntityBase
|
||||||
{
|
{
|
||||||
private PrimCountTaintedDelegate handlerPrimCountTainted = null;
|
// private PrimCountTaintedDelegate handlerPrimCountTainted = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Signal whether the non-inventory attributes of any prims in the group have changed
|
/// Signal whether the non-inventory attributes of any prims in the group have changed
|
||||||
|
@ -107,7 +107,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
protected ulong m_regionHandle;
|
protected ulong m_regionHandle;
|
||||||
protected SceneObjectPart m_rootPart;
|
protected SceneObjectPart m_rootPart;
|
||||||
private Dictionary<LLUUID, scriptEvents> m_scriptEvents = new Dictionary<LLUUID, scriptEvents>();
|
// private Dictionary<LLUUID, scriptEvents> m_scriptEvents = new Dictionary<LLUUID, scriptEvents>();
|
||||||
|
|
||||||
private Dictionary<uint, scriptPosTarget> m_targets = new Dictionary<uint, scriptPosTarget>();
|
private Dictionary<uint, scriptPosTarget> m_targets = new Dictionary<uint, scriptPosTarget>();
|
||||||
|
|
||||||
|
|
|
@ -169,7 +169,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
private Color m_color = Color.Black;
|
private Color m_color = Color.Black;
|
||||||
private string m_description = String.Empty;
|
private string m_description = String.Empty;
|
||||||
private List<uint> m_lastColliders = new List<uint>();
|
private List<uint> m_lastColliders = new List<uint>();
|
||||||
private PhysicsVector m_lastRotationalVelocity = PhysicsVector.Zero;
|
// private PhysicsVector m_lastRotationalVelocity = PhysicsVector.Zero;
|
||||||
private int m_linkNum = 0;
|
private int m_linkNum = 0;
|
||||||
[XmlIgnore]
|
[XmlIgnore]
|
||||||
private int m_scriptAccessPin = 0;
|
private int m_scriptAccessPin = 0;
|
||||||
|
|
|
@ -48,9 +48,9 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||||
|
|
||||||
public void PostInitialise()
|
public void PostInitialise()
|
||||||
{
|
{
|
||||||
RegionInfo regionInfo = m_scene.RegionInfo;
|
// RegionInfo regionInfo = m_scene.RegionInfo;
|
||||||
|
|
||||||
LLVector3 pos = new LLVector3(110, 129, 27);
|
// LLVector3 pos = new LLVector3(110, 129, 27);
|
||||||
|
|
||||||
//AddCpuCounter(regionInfo, pos);
|
//AddCpuCounter(regionInfo, pos);
|
||||||
// AddComplexObjects(regionInfo, pos);
|
// AddComplexObjects(regionInfo, pos);
|
||||||
|
@ -58,27 +58,27 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||||
// AddFileSystemObjects();
|
// AddFileSystemObjects();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddFileSystemObjects()
|
// private void AddFileSystemObjects()
|
||||||
{
|
// {
|
||||||
DirectoryInfo dirInfo = new DirectoryInfo(".");
|
// DirectoryInfo dirInfo = new DirectoryInfo(".");
|
||||||
|
|
||||||
float x = 0;
|
// float x = 0;
|
||||||
float z = 0;
|
// float z = 0;
|
||||||
|
|
||||||
foreach (FileInfo fileInfo in dirInfo.GetFiles())
|
// foreach (FileInfo fileInfo in dirInfo.GetFiles())
|
||||||
{
|
// {
|
||||||
LLVector3 filePos = new LLVector3(100 + x, 129, 27 + z);
|
// LLVector3 filePos = new LLVector3(100 + x, 129, 27 + z);
|
||||||
x = x + 2;
|
// x = x + 2;
|
||||||
if (x > 50)
|
// if (x > 50)
|
||||||
{
|
// {
|
||||||
x = 0;
|
// x = 0;
|
||||||
z = z + 2;
|
// z = z + 2;
|
||||||
}
|
// }
|
||||||
|
|
||||||
FileSystemObject fileObject = new FileSystemObject(m_scene, fileInfo, filePos);
|
// FileSystemObject fileObject = new FileSystemObject(m_scene, fileInfo, filePos);
|
||||||
m_scene.AddNewSceneObject(fileObject, true);
|
// m_scene.AddNewSceneObject(fileObject, true);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
private void AddAvatars()
|
private void AddAvatars()
|
||||||
{
|
{
|
||||||
|
@ -96,27 +96,27 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddComplexObjects(RegionInfo regionInfo, LLVector3 pos)
|
// private void AddComplexObjects(RegionInfo regionInfo, LLVector3 pos)
|
||||||
{
|
// {
|
||||||
int objs = 3;
|
// int objs = 3;
|
||||||
|
|
||||||
for (int i = 0; i < (objs*objs*objs); i++)
|
// for (int i = 0; i < (objs*objs*objs); i++)
|
||||||
{
|
// {
|
||||||
LLVector3 posOffset = new LLVector3((i % objs) * 4, ((i % (objs*objs)) / (objs)) * 4, (i / (objs*objs)) * 4);
|
// LLVector3 posOffset = new LLVector3((i % objs) * 4, ((i % (objs*objs)) / (objs)) * 4, (i / (objs*objs)) * 4);
|
||||||
ComplexObject complexObject =
|
// ComplexObject complexObject =
|
||||||
new ComplexObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(),
|
// new ComplexObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(),
|
||||||
pos + posOffset);
|
// pos + posOffset);
|
||||||
m_scene.AddNewSceneObject(complexObject, true);
|
// m_scene.AddNewSceneObject(complexObject, true);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
private void AddCpuCounter(RegionInfo regionInfo, LLVector3 pos)
|
// private void AddCpuCounter(RegionInfo regionInfo, LLVector3 pos)
|
||||||
{
|
// {
|
||||||
SceneObjectGroup sceneObject =
|
// SceneObjectGroup sceneObject =
|
||||||
new CpuCounterObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(),
|
// new CpuCounterObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(),
|
||||||
pos + new LLVector3(1f, 1f, 1f));
|
// pos + new LLVector3(1f, 1f, 1f));
|
||||||
m_scene.AddNewSceneObject(sceneObject, true);
|
// m_scene.AddNewSceneObject(sceneObject, true);
|
||||||
}
|
// }
|
||||||
|
|
||||||
public void Close()
|
public void Close()
|
||||||
{
|
{
|
||||||
|
|
|
@ -132,7 +132,7 @@ namespace OpenSim.Region.Modules.AvatarFactory
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LLUUID assetId;
|
// LLUUID assetId;
|
||||||
|
|
||||||
InventoryItemBase baseItem = profile.RootFolder.FindItem(appearance.Wearables[i].ItemID);
|
InventoryItemBase baseItem = profile.RootFolder.FindItem(appearance.Wearables[i].ItemID);
|
||||||
|
|
||||||
|
|
|
@ -133,21 +133,21 @@ namespace OpenSim.Region.Modules.SvnSerialiser
|
||||||
m_svnClient.Checkout2(m_svnurl, m_svndir, revision, revision, true, false);
|
m_svnClient.Checkout2(m_svnurl, m_svndir, revision, revision, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckoutSvnPartial(string subdir)
|
// private void CheckoutSvnPartial(string subdir)
|
||||||
{
|
// {
|
||||||
if (!Directory.Exists(m_svndir + Slash.DirectorySeparatorChar + subdir))
|
// if (!Directory.Exists(m_svndir + Slash.DirectorySeparatorChar + subdir))
|
||||||
Directory.CreateDirectory(m_svndir + Slash.DirectorySeparatorChar + subdir);
|
// Directory.CreateDirectory(m_svndir + Slash.DirectorySeparatorChar + subdir);
|
||||||
|
|
||||||
m_svnClient.Checkout2(m_svnurl + "/" + subdir, m_svndir, Svn.Revision.Head, Svn.Revision.Head, true, false);
|
// m_svnClient.Checkout2(m_svnurl + "/" + subdir, m_svndir, Svn.Revision.Head, Svn.Revision.Head, true, false);
|
||||||
}
|
// }
|
||||||
|
|
||||||
private void CheckoutSvnPartial(string subdir, SvnRevision revision)
|
// private void CheckoutSvnPartial(string subdir, SvnRevision revision)
|
||||||
{
|
// {
|
||||||
if (!Directory.Exists(m_svndir + Slash.DirectorySeparatorChar + subdir))
|
// if (!Directory.Exists(m_svndir + Slash.DirectorySeparatorChar + subdir))
|
||||||
Directory.CreateDirectory(m_svndir + Slash.DirectorySeparatorChar + subdir);
|
// Directory.CreateDirectory(m_svndir + Slash.DirectorySeparatorChar + subdir);
|
||||||
|
|
||||||
m_svnClient.Checkout2(m_svnurl + "/" + subdir, m_svndir, revision, revision, true, false);
|
// m_svnClient.Checkout2(m_svnurl + "/" + subdir, m_svndir, revision, revision, true, false);
|
||||||
}
|
// }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -193,6 +193,9 @@ public class Vertex : PhysicsVector, IComparable<Vertex>
|
||||||
return new Vertex(Y * v.Z - Z * v.Y, Z * v.X - X * v.Z, X * v.Y - Y * v.X);
|
return new Vertex(Y * v.Z - Z * v.Y, Z * v.X - X * v.Z, X * v.Y - Y * v.X);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// mono compiler moans about overloading operators hiding base
|
||||||
|
// operator but should not according to C# language spec
|
||||||
|
#pragma warning disable 0108
|
||||||
public static Vertex operator *(Vertex v, Quaternion q)
|
public static Vertex operator *(Vertex v, Quaternion q)
|
||||||
{
|
{
|
||||||
Matrix4 tm = q.computeMatrix();
|
Matrix4 tm = q.computeMatrix();
|
||||||
|
@ -250,6 +253,7 @@ public class Vertex : PhysicsVector, IComparable<Vertex>
|
||||||
v1.Z *= mul;
|
v1.Z *= mul;
|
||||||
return v1;
|
return v1;
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0108
|
||||||
|
|
||||||
|
|
||||||
public float dot(Vertex v)
|
public float dot(Vertex v)
|
||||||
|
|
|
@ -3122,7 +3122,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double angle = 2 * Math.Acos(rot.s);
|
// double angle = 2 * Math.Acos(rot.s);
|
||||||
double s = Math.Sqrt(1 - rot.s * rot.s);
|
double s = Math.Sqrt(1 - rot.s * rot.s);
|
||||||
if (s < 0.001)
|
if (s < 0.001)
|
||||||
{
|
{
|
||||||
|
@ -3960,7 +3960,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
{
|
{
|
||||||
int index = str.IndexOf(delimiters[i].ToString());
|
int index = str.IndexOf(delimiters[i].ToString());
|
||||||
bool found = index != -1;
|
bool found = index != -1;
|
||||||
if (found && String.Empty != delimiters[i])
|
if (found && String.Empty != (string)delimiters[i])
|
||||||
{
|
{
|
||||||
if ((cindex > index) || (cindex == -1))
|
if ((cindex > index) || (cindex == -1))
|
||||||
{
|
{
|
||||||
|
@ -4049,7 +4049,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
|
|
||||||
private String[] GetNotecardLines(string name)
|
private String[] GetNotecardLines(string name)
|
||||||
{
|
{
|
||||||
bool found = false;
|
// bool found = false;
|
||||||
int notecardIndex = 0;
|
int notecardIndex = 0;
|
||||||
String[] notecardLines = { "0" };
|
String[] notecardLines = { "0" };
|
||||||
notecardLines[0] = String.Empty;
|
notecardLines[0] = String.Empty;
|
||||||
|
|
|
@ -125,7 +125,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private ScriptEngine lastScriptEngine; // Keep track of what ScriptEngine instance we are at so we can give exception
|
// private ScriptEngine lastScriptEngine; // Keep track of what ScriptEngine instance we are at so we can give exception
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A thread should run in this loop and check all running scripts
|
/// A thread should run in this loop and check all running scripts
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -171,7 +171,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||||
//{
|
//{
|
||||||
foreach (ScriptEngine m_ScriptEngine in new ArrayList(ScriptEngine.ScriptEngines))
|
foreach (ScriptEngine m_ScriptEngine in new ArrayList(ScriptEngine.ScriptEngines))
|
||||||
{
|
{
|
||||||
lastScriptEngine = m_ScriptEngine;
|
// lastScriptEngine = m_ScriptEngine;
|
||||||
// Re-reading config every x seconds
|
// Re-reading config every x seconds
|
||||||
if (MaintenanceLoopTicks_Other_Count >= MaintenanceLoopTicks_Other)
|
if (MaintenanceLoopTicks_Other_Count >= MaintenanceLoopTicks_Other)
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,7 +59,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||||
|
|
||||||
private Thread scriptLoadUnloadThread;
|
private Thread scriptLoadUnloadThread;
|
||||||
private static Thread staticScriptLoadUnloadThread;
|
private static Thread staticScriptLoadUnloadThread;
|
||||||
private int scriptLoadUnloadThread_IdleSleepms;
|
// private int scriptLoadUnloadThread_IdleSleepms;
|
||||||
private Queue<LUStruct> LUQueue = new Queue<LUStruct>();
|
private Queue<LUStruct> LUQueue = new Queue<LUStruct>();
|
||||||
private static bool PrivateThread;
|
private static bool PrivateThread;
|
||||||
private int LoadUnloadMaxQueueSize;
|
private int LoadUnloadMaxQueueSize;
|
||||||
|
@ -100,7 +100,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||||
|
|
||||||
public void ReadConfig()
|
public void ReadConfig()
|
||||||
{
|
{
|
||||||
scriptLoadUnloadThread_IdleSleepms = m_scriptEngine.ScriptConfigSource.GetInt("ScriptLoadUnloadLoopms", 30);
|
// scriptLoadUnloadThread_IdleSleepms = m_scriptEngine.ScriptConfigSource.GetInt("ScriptLoadUnloadLoopms", 30);
|
||||||
// TODO: Requires sharing of all ScriptManagers to single thread
|
// TODO: Requires sharing of all ScriptManagers to single thread
|
||||||
PrivateThread = true; // m_scriptEngine.ScriptConfigSource.GetBoolean("PrivateScriptLoadUnloadThread", false);
|
PrivateThread = true; // m_scriptEngine.ScriptConfigSource.GetBoolean("PrivateScriptLoadUnloadThread", false);
|
||||||
LoadUnloadMaxQueueSize = m_scriptEngine.ScriptConfigSource.GetInt("LoadUnloadMaxQueueSize", 100);
|
LoadUnloadMaxQueueSize = m_scriptEngine.ScriptConfigSource.GetInt("LoadUnloadMaxQueueSize", 100);
|
||||||
|
@ -245,7 +245,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||||
|
|
||||||
#region Start/Stop/Reset script
|
#region Start/Stop/Reset script
|
||||||
|
|
||||||
private readonly Object startStopLock = new Object();
|
// private readonly Object startStopLock = new Object();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fetches, loads and hooks up a script to an objects events
|
/// Fetches, loads and hooks up a script to an objects events
|
||||||
|
|
|
@ -65,7 +65,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
|
||||||
private enumCompileType DefaultCompileLanguage;
|
private enumCompileType DefaultCompileLanguage;
|
||||||
private bool WriteScriptSourceToDebugFile;
|
private bool WriteScriptSourceToDebugFile;
|
||||||
private bool CompileWithDebugInformation;
|
private bool CompileWithDebugInformation;
|
||||||
private bool CleanUpOldScriptsOnStartup;
|
// private bool CleanUpOldScriptsOnStartup;
|
||||||
private Dictionary<string, bool> AllowedCompilers = new Dictionary<string, bool>(StringComparer.CurrentCultureIgnoreCase);
|
private Dictionary<string, bool> AllowedCompilers = new Dictionary<string, bool>(StringComparer.CurrentCultureIgnoreCase);
|
||||||
private Dictionary<string, enumCompileType> LanguageMapping = new Dictionary<string, enumCompileType>(StringComparer.CurrentCultureIgnoreCase);
|
private Dictionary<string, enumCompileType> LanguageMapping = new Dictionary<string, enumCompileType>(StringComparer.CurrentCultureIgnoreCase);
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
|
||||||
// Get some config
|
// Get some config
|
||||||
WriteScriptSourceToDebugFile = m_scriptEngine.ScriptConfigSource.GetBoolean("WriteScriptSourceToDebugFile", true);
|
WriteScriptSourceToDebugFile = m_scriptEngine.ScriptConfigSource.GetBoolean("WriteScriptSourceToDebugFile", true);
|
||||||
CompileWithDebugInformation = m_scriptEngine.ScriptConfigSource.GetBoolean("CompileWithDebugInformation", true);
|
CompileWithDebugInformation = m_scriptEngine.ScriptConfigSource.GetBoolean("CompileWithDebugInformation", true);
|
||||||
CleanUpOldScriptsOnStartup = m_scriptEngine.ScriptConfigSource.GetBoolean("CleanUpOldScriptsOnStartup", true);
|
// CleanUpOldScriptsOnStartup = m_scriptEngine.ScriptConfigSource.GetBoolean("CleanUpOldScriptsOnStartup", true);
|
||||||
|
|
||||||
// Get file prefix from scriptengine name and make it file system safe:
|
// Get file prefix from scriptengine name and make it file system safe:
|
||||||
FilePrefix = m_scriptEngine.ScriptEngineName;
|
FilePrefix = m_scriptEngine.ScriptEngineName;
|
||||||
|
|
|
@ -69,11 +69,14 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
|
||||||
YP.tell(myCS_SW);
|
YP.tell(myCS_SW);
|
||||||
|
|
||||||
//Console.WriteLine("Mycode\n ===================================\n" + myCode+"\n");
|
//Console.WriteLine("Mycode\n ===================================\n" + myCode+"\n");
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in Parser.parseInput(TermList))
|
foreach (bool l1 in Parser.parseInput(TermList))
|
||||||
{
|
{
|
||||||
foreach (bool l2 in YPCompiler.makeFunctionPseudoCode(TermList, FunctionCode))
|
foreach (bool l2 in YPCompiler.makeFunctionPseudoCode(TermList, FunctionCode))
|
||||||
{
|
{
|
||||||
ListPair VFC = new ListPair(FunctionCode, new Variable());
|
// ListPair VFC = new ListPair(FunctionCode, new Variable());
|
||||||
//Console.WriteLine("-------------------------")
|
//Console.WriteLine("-------------------------")
|
||||||
//Console.WriteLine(FunctionCode.ToString())
|
//Console.WriteLine(FunctionCode.ToString())
|
||||||
//Console.WriteLine("-------------------------")
|
//Console.WriteLine("-------------------------")
|
||||||
|
@ -81,6 +84,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
|
||||||
//YPCompiler.convertStringCodesCSharp(VFC);
|
//YPCompiler.convertStringCodesCSharp(VFC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168
|
||||||
YP.seen();
|
YP.seen();
|
||||||
myCS_SW.Close();
|
myCS_SW.Close();
|
||||||
YP.told();
|
YP.told();
|
||||||
|
|
|
@ -113,6 +113,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For each result, unify the _freeVariables and unify bagArrayVariable with the associated bag.
|
/// For each result, unify the _freeVariables and unify bagArrayVariable with the associated bag.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -204,6 +208,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
|
||||||
bagOfAnswers.add();
|
bagOfAnswers.add();
|
||||||
return bagOfAnswers.resultSet(Bag);
|
return bagOfAnswers.resultSet(Bag);
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A TermArrayEqualityComparer implements IEqualityComparer to compare two object arrays using YP.termEqual.
|
/// A TermArrayEqualityComparer implements IEqualityComparer to compare two object arrays using YP.termEqual.
|
||||||
|
|
|
@ -71,6 +71,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
|
||||||
return YP.unify(Bag, result);
|
return YP.unify(Bag, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is a simplified findall when the goal is a single call.
|
/// This is a simplified findall when the goal is a single call.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -99,5 +103,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
|
||||||
findallAnswers.add();
|
findallAnswers.add();
|
||||||
return findallAnswers.resultArray();
|
return findallAnswers.resultArray();
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
public IEnumerable<bool> unify(object arg)
|
public IEnumerable<bool> unify(object arg)
|
||||||
{
|
{
|
||||||
arg = YP.getValue(arg);
|
arg = YP.getValue(arg);
|
||||||
|
@ -67,6 +70,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
|
||||||
yield return false;
|
yield return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168
|
||||||
|
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,6 +51,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
public IEnumerable<bool> unify(object arg)
|
public IEnumerable<bool> unify(object arg)
|
||||||
{
|
{
|
||||||
arg = YP.getValue(arg);
|
arg = YP.getValue(arg);
|
||||||
|
@ -72,6 +75,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
|
||||||
yield return false;
|
yield return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168
|
||||||
|
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
|
|
|
@ -53,6 +53,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
public IEnumerable<bool> unify(object arg)
|
public IEnumerable<bool> unify(object arg)
|
||||||
{
|
{
|
||||||
arg = YP.getValue(arg);
|
arg = YP.getValue(arg);
|
||||||
|
@ -77,6 +80,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
|
||||||
yield return false;
|
yield return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,6 +44,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
|
||||||
yield return false;
|
yield return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168, 0219
|
||||||
|
|
||||||
// Debug: Hand-modify this central predicate to do tail recursion.
|
// Debug: Hand-modify this central predicate to do tail recursion.
|
||||||
public static IEnumerable<bool> read_tokens(object arg1, object arg2, object arg3)
|
public static IEnumerable<bool> read_tokens(object arg1, object arg2, object arg3)
|
||||||
{
|
{
|
||||||
|
@ -188,7 +192,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
|
||||||
// Compiler output follows.
|
// Compiler output follows.
|
||||||
|
|
||||||
class YPInnerClass { }
|
class YPInnerClass { }
|
||||||
static Type getDeclaringClass() { return typeof(YPInnerClass).DeclaringType; }
|
// static Type getDeclaringClass() { return typeof(YPInnerClass).DeclaringType; }
|
||||||
|
|
||||||
public static IEnumerable<bool> parseInput(object TermList)
|
public static IEnumerable<bool> parseInput(object TermList)
|
||||||
{
|
{
|
||||||
|
@ -224,11 +228,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
|
||||||
if (YP.termEqual(Term, Atom.a(@"end_of_file")))
|
if (YP.termEqual(Term, Atom.a(@"end_of_file")))
|
||||||
{
|
{
|
||||||
yield break;
|
yield break;
|
||||||
goto cutIf1;
|
// goto cutIf1;
|
||||||
}
|
}
|
||||||
yield return false;
|
yield return false;
|
||||||
cutIf1:
|
// cutIf1:
|
||||||
{ }
|
// { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4452,6 +4456,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
|
||||||
{ }
|
{ }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168, 0219
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,8 +92,12 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in YP.unify(this, arg))
|
foreach (bool l1 in YP.unify(this, arg))
|
||||||
yield return false;
|
yield return false;
|
||||||
|
#pragma warning restore 0168
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -561,6 +561,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
|
||||||
return _repeat;
|
return _repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
public static IEnumerable<bool> univ(object Term, object List)
|
public static IEnumerable<bool> univ(object Term, object List)
|
||||||
{
|
{
|
||||||
Term = YP.getValue(Term);
|
Term = YP.getValue(Term);
|
||||||
|
@ -1414,7 +1417,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static void script_event(object script_event, object script_params)
|
public static void script_event(object script_event, object script_params)
|
||||||
{
|
{
|
||||||
string function = ((Atom)YP.getValue(script_event))._name;
|
// string function = ((Atom)YP.getValue(script_event))._name;
|
||||||
object[] array = ListPair.toArray(script_params);
|
object[] array = ListPair.toArray(script_params);
|
||||||
if (array == null)
|
if (array == null)
|
||||||
return; // YP.fail();
|
return; // YP.fail();
|
||||||
|
@ -1640,5 +1643,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,6 +202,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
|
||||||
return YP.unify(Symbol, Atom.a(Base.ToString() + ++((CompilerState)State)._gensymCounter));
|
return YP.unify(Symbol, Atom.a(Base.ToString() + ++((CompilerState)State)._gensymCounter));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
public static bool isDetNoneOut(object State, object Term)
|
public static bool isDetNoneOut(object State, object Term)
|
||||||
{
|
{
|
||||||
State = YP.getValue(State);
|
State = YP.getValue(State);
|
||||||
|
@ -239,6 +242,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Return false if any of args is out, otherwise true.
|
/// Return false if any of args is out, otherwise true.
|
||||||
|
@ -275,6 +279,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168, 0219
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Use makeFunctionPseudoCode, convertFunctionCSharp and compileAnonymousFunction
|
/// Use makeFunctionPseudoCode, convertFunctionCSharp and compileAnonymousFunction
|
||||||
/// to return an anonymous YP.IClause for the Head and Body of a rule clause.
|
/// to return an anonymous YP.IClause for the Head and Body of a rule clause.
|
||||||
|
@ -395,7 +403,7 @@ namespace Temporary {
|
||||||
public static void repeatWrite(object arg1, object N)
|
public static void repeatWrite(object arg1, object N)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
object _Value = arg1;
|
// object _Value = arg1;
|
||||||
if (YP.termEqual(N, 0))
|
if (YP.termEqual(N, 0))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -470,7 +478,7 @@ namespace Temporary {
|
||||||
public static void processCompilerDirectives(object arg1, object arg2)
|
public static void processCompilerDirectives(object arg1, object arg2)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
object _State = arg2;
|
// object _State = arg2;
|
||||||
foreach (bool l2 in YP.unify(arg1, Atom.NIL))
|
foreach (bool l2 in YP.unify(arg1, Atom.NIL))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -3939,12 +3947,12 @@ namespace Temporary {
|
||||||
YP.nl();
|
YP.nl();
|
||||||
convertStatementListCSharp(RestStatements, Level);
|
convertStatementListCSharp(RestStatements, Level);
|
||||||
return;
|
return;
|
||||||
goto cutIf1;
|
// goto cutIf1;
|
||||||
}
|
}
|
||||||
convertStatementListCSharp(RestStatements, Level);
|
convertStatementListCSharp(RestStatements, Level);
|
||||||
return;
|
return;
|
||||||
cutIf1:
|
// cutIf1:
|
||||||
{ }
|
// { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
@ -4111,12 +4119,12 @@ namespace Temporary {
|
||||||
YP.write(Atom.a(@", "));
|
YP.write(Atom.a(@", "));
|
||||||
convertArgListCSharp(Tail);
|
convertArgListCSharp(Tail);
|
||||||
return;
|
return;
|
||||||
goto cutIf1;
|
// goto cutIf1;
|
||||||
}
|
}
|
||||||
convertArgListCSharp(Tail);
|
convertArgListCSharp(Tail);
|
||||||
return;
|
return;
|
||||||
cutIf1:
|
// cutIf1:
|
||||||
{ }
|
// { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4266,13 +4274,13 @@ namespace Temporary {
|
||||||
YP.put_code(Code);
|
YP.put_code(Code);
|
||||||
convertStringCodesCSharp(RestCodes);
|
convertStringCodesCSharp(RestCodes);
|
||||||
return;
|
return;
|
||||||
goto cutIf1;
|
// goto cutIf1;
|
||||||
}
|
}
|
||||||
YP.put_code(Code);
|
YP.put_code(Code);
|
||||||
convertStringCodesCSharp(RestCodes);
|
convertStringCodesCSharp(RestCodes);
|
||||||
return;
|
return;
|
||||||
cutIf1:
|
// cutIf1:
|
||||||
{ }
|
// { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4623,12 +4631,12 @@ namespace Temporary {
|
||||||
YP.write(Atom.a(@", "));
|
YP.write(Atom.a(@", "));
|
||||||
convertArgListJavascript(Tail);
|
convertArgListJavascript(Tail);
|
||||||
return;
|
return;
|
||||||
goto cutIf1;
|
// goto cutIf1;
|
||||||
}
|
}
|
||||||
convertArgListJavascript(Tail);
|
convertArgListJavascript(Tail);
|
||||||
return;
|
return;
|
||||||
cutIf1:
|
// cutIf1:
|
||||||
{ }
|
// { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4777,7 +4785,7 @@ namespace Temporary {
|
||||||
YP.put_code(Code);
|
YP.put_code(Code);
|
||||||
convertStringCodesJavascript(RestCodes);
|
convertStringCodesJavascript(RestCodes);
|
||||||
return;
|
return;
|
||||||
goto cutIf1;
|
// goto cutIf1;
|
||||||
}
|
}
|
||||||
if (YP.termEqual(Code, 92))
|
if (YP.termEqual(Code, 92))
|
||||||
{
|
{
|
||||||
|
@ -4785,13 +4793,13 @@ namespace Temporary {
|
||||||
YP.put_code(Code);
|
YP.put_code(Code);
|
||||||
convertStringCodesJavascript(RestCodes);
|
convertStringCodesJavascript(RestCodes);
|
||||||
return;
|
return;
|
||||||
goto cutIf1;
|
// goto cutIf1;
|
||||||
}
|
}
|
||||||
YP.put_code(Code);
|
YP.put_code(Code);
|
||||||
convertStringCodesJavascript(RestCodes);
|
convertStringCodesJavascript(RestCodes);
|
||||||
return;
|
return;
|
||||||
cutIf1:
|
// cutIf1:
|
||||||
{ }
|
// { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5420,12 +5428,12 @@ namespace Temporary {
|
||||||
YP.write(Atom.a(@", "));
|
YP.write(Atom.a(@", "));
|
||||||
convertArgListPython(Tail);
|
convertArgListPython(Tail);
|
||||||
return;
|
return;
|
||||||
goto cutIf1;
|
// goto cutIf1;
|
||||||
}
|
}
|
||||||
convertArgListPython(Tail);
|
convertArgListPython(Tail);
|
||||||
return;
|
return;
|
||||||
cutIf1:
|
// cutIf1:
|
||||||
{ }
|
// { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5573,7 +5581,7 @@ namespace Temporary {
|
||||||
YP.put_code(Code);
|
YP.put_code(Code);
|
||||||
convertStringCodesPython(RestCodes);
|
convertStringCodesPython(RestCodes);
|
||||||
return;
|
return;
|
||||||
goto cutIf1;
|
// goto cutIf1;
|
||||||
}
|
}
|
||||||
if (YP.termEqual(Code, 92))
|
if (YP.termEqual(Code, 92))
|
||||||
{
|
{
|
||||||
|
@ -5581,13 +5589,13 @@ namespace Temporary {
|
||||||
YP.put_code(Code);
|
YP.put_code(Code);
|
||||||
convertStringCodesPython(RestCodes);
|
convertStringCodesPython(RestCodes);
|
||||||
return;
|
return;
|
||||||
goto cutIf1;
|
// goto cutIf1;
|
||||||
}
|
}
|
||||||
YP.put_code(Code);
|
YP.put_code(Code);
|
||||||
convertStringCodesPython(RestCodes);
|
convertStringCodesPython(RestCodes);
|
||||||
return;
|
return;
|
||||||
cutIf1:
|
// cutIf1:
|
||||||
{ }
|
// { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5646,6 +5654,6 @@ namespace Temporary {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168, 0219
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2776,7 +2776,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
uint partLocalID;
|
// uint partLocalID;
|
||||||
LLUUID partItemID;
|
LLUUID partItemID;
|
||||||
|
|
||||||
switch ((int)linknum)
|
switch ((int)linknum)
|
||||||
|
@ -2790,7 +2790,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
if (item.Type == 10)
|
if (item.Type == 10)
|
||||||
{
|
{
|
||||||
partLocalID = part.LocalId;
|
// partLocalID = part.LocalId;
|
||||||
partItemID = item.ItemID;
|
partItemID = item.ItemID;
|
||||||
|
|
||||||
object[] resobj = new object[]
|
object[] resobj = new object[]
|
||||||
|
@ -2815,7 +2815,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
if (item.Type == 10)
|
if (item.Type == 10)
|
||||||
{
|
{
|
||||||
partLocalID = partInst.LocalId;
|
// partLocalID = partInst.LocalId;
|
||||||
partItemID = item.ItemID;
|
partItemID = item.ItemID;
|
||||||
Object[] resobj = new object[]
|
Object[] resobj = new object[]
|
||||||
{
|
{
|
||||||
|
@ -2843,7 +2843,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
if (item.Type == 10)
|
if (item.Type == 10)
|
||||||
{
|
{
|
||||||
partLocalID = partInst.LocalId;
|
// partLocalID = partInst.LocalId;
|
||||||
partItemID = item.ItemID;
|
partItemID = item.ItemID;
|
||||||
Object[] resobj = new object[]
|
Object[] resobj = new object[]
|
||||||
{
|
{
|
||||||
|
@ -2873,7 +2873,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
if (item.Type == 10)
|
if (item.Type == 10)
|
||||||
{
|
{
|
||||||
partLocalID = partInst.LocalId;
|
// partLocalID = partInst.LocalId;
|
||||||
partItemID = item.ItemID;
|
partItemID = item.ItemID;
|
||||||
Object[] resobj = new object[]
|
Object[] resobj = new object[]
|
||||||
{
|
{
|
||||||
|
@ -2924,7 +2924,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
if (item.Type == 10)
|
if (item.Type == 10)
|
||||||
{
|
{
|
||||||
partLocalID = partInst.LocalId;
|
// partLocalID = partInst.LocalId;
|
||||||
partItemID = item.ItemID;
|
partItemID = item.ItemID;
|
||||||
Object[] resObjDef = new object[]
|
Object[] resObjDef = new object[]
|
||||||
{
|
{
|
||||||
|
@ -3049,7 +3049,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double angle = 2 * Math.Acos(rot.s);
|
// double angle = 2 * Math.Acos(rot.s);
|
||||||
double s = Math.Sqrt(1 - rot.s * rot.s);
|
double s = Math.Sqrt(1 - rot.s * rot.s);
|
||||||
if (s < 0.001)
|
if (s < 0.001)
|
||||||
{
|
{
|
||||||
|
@ -6592,7 +6592,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
while (count < len)
|
while (count < len)
|
||||||
{
|
{
|
||||||
int l = input[idx].Length;
|
// int l = input[idx].Length;
|
||||||
string ln = input[idx];
|
string ln = input[idx];
|
||||||
|
|
||||||
int need = len-count-1;
|
int need = len-count-1;
|
||||||
|
|
|
@ -127,19 +127,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
// No unbound free variables, so we only filled one bag. If empty, bagof fails.
|
// No unbound free variables, so we only filled one bag. If empty, bagof fails.
|
||||||
if (_findallBagArray.Count > 0)
|
if (_findallBagArray.Count > 0)
|
||||||
{
|
{
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in bagArrayVariable.unify(_findallBagArray))
|
foreach (bool l1 in bagArrayVariable.unify(_findallBagArray))
|
||||||
yield return false;
|
yield return false;
|
||||||
|
#pragma warning restore 0168
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<object[], List<object>> valuesAndBag in _bagForFreeVariables)
|
foreach (KeyValuePair<object[], List<object>> valuesAndBag in _bagForFreeVariables)
|
||||||
{
|
{
|
||||||
|
// disable warning on l1 and l2, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in YP.unifyArrays(_freeVariables, valuesAndBag.Key))
|
foreach (bool l1 in YP.unifyArrays(_freeVariables, valuesAndBag.Key))
|
||||||
{
|
{
|
||||||
foreach (bool l2 in bagArrayVariable.unify(valuesAndBag.Value))
|
foreach (bool l2 in bagArrayVariable.unify(valuesAndBag.Value))
|
||||||
yield return false;
|
yield return false;
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168
|
||||||
// Debug: Should we free memory of the answers already returned?
|
// Debug: Should we free memory of the answers already returned?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -153,11 +161,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
public IEnumerable<bool> result(object Bag)
|
public IEnumerable<bool> result(object Bag)
|
||||||
{
|
{
|
||||||
Variable bagArrayVariable = new Variable();
|
Variable bagArrayVariable = new Variable();
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in resultArray(bagArrayVariable))
|
foreach (bool l1 in resultArray(bagArrayVariable))
|
||||||
{
|
{
|
||||||
foreach (bool l2 in YP.unify(Bag, ListPair.make((List<object>)bagArrayVariable.getValue())))
|
foreach (bool l2 in YP.unify(Bag, ListPair.make((List<object>)bagArrayVariable.getValue())))
|
||||||
yield return false;
|
yield return false;
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -169,6 +181,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
public IEnumerable<bool> resultSet(object Bag)
|
public IEnumerable<bool> resultSet(object Bag)
|
||||||
{
|
{
|
||||||
Variable bagArrayVariable = new Variable();
|
Variable bagArrayVariable = new Variable();
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in resultArray(bagArrayVariable))
|
foreach (bool l1 in resultArray(bagArrayVariable))
|
||||||
{
|
{
|
||||||
List<object> bagArray = (List<object>)bagArrayVariable.getValue();
|
List<object> bagArray = (List<object>)bagArrayVariable.getValue();
|
||||||
|
@ -176,14 +191,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
foreach (bool l2 in YP.unify(Bag, ListPair.makeWithoutRepeatedTerms(bagArray)))
|
foreach (bool l2 in YP.unify(Bag, ListPair.makeWithoutRepeatedTerms(bagArray)))
|
||||||
yield return false;
|
yield return false;
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IEnumerable<bool> bagofArray
|
public static IEnumerable<bool> bagofArray
|
||||||
(object Template, object Goal, IEnumerable<bool> goalIterator, Variable bagArrayVariable)
|
(object Template, object Goal, IEnumerable<bool> goalIterator, Variable bagArrayVariable)
|
||||||
{
|
{
|
||||||
BagofAnswers bagOfAnswers = new BagofAnswers(Template, Goal);
|
BagofAnswers bagOfAnswers = new BagofAnswers(Template, Goal);
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in goalIterator)
|
foreach (bool l1 in goalIterator)
|
||||||
bagOfAnswers.add();
|
bagOfAnswers.add();
|
||||||
|
#pragma warning restore 0168
|
||||||
return bagOfAnswers.resultArray(bagArrayVariable);
|
return bagOfAnswers.resultArray(bagArrayVariable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,8 +211,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
(object Template, object Goal, IEnumerable<bool> goalIterator, object Bag)
|
(object Template, object Goal, IEnumerable<bool> goalIterator, object Bag)
|
||||||
{
|
{
|
||||||
BagofAnswers bagOfAnswers = new BagofAnswers(Template, Goal);
|
BagofAnswers bagOfAnswers = new BagofAnswers(Template, Goal);
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in goalIterator)
|
foreach (bool l1 in goalIterator)
|
||||||
bagOfAnswers.add();
|
bagOfAnswers.add();
|
||||||
|
#pragma warning restore 0168
|
||||||
return bagOfAnswers.result(Bag);
|
return bagOfAnswers.result(Bag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,8 +224,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
(object Template, object Goal, IEnumerable<bool> goalIterator, object Bag)
|
(object Template, object Goal, IEnumerable<bool> goalIterator, object Bag)
|
||||||
{
|
{
|
||||||
BagofAnswers bagOfAnswers = new BagofAnswers(Template, Goal);
|
BagofAnswers bagOfAnswers = new BagofAnswers(Template, Goal);
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in goalIterator)
|
foreach (bool l1 in goalIterator)
|
||||||
bagOfAnswers.add();
|
bagOfAnswers.add();
|
||||||
|
#pragma warning restore 0168
|
||||||
return bagOfAnswers.resultSet(Bag);
|
return bagOfAnswers.resultSet(Bag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,8 +81,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
public static IEnumerable<bool> findall(object Template, IEnumerable<bool> goal, object Bag)
|
public static IEnumerable<bool> findall(object Template, IEnumerable<bool> goal, object Bag)
|
||||||
{
|
{
|
||||||
FindallAnswers findallAnswers = new FindallAnswers(Template);
|
FindallAnswers findallAnswers = new FindallAnswers(Template);
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in goal)
|
foreach (bool l1 in goal)
|
||||||
findallAnswers.add();
|
findallAnswers.add();
|
||||||
|
#pragma warning restore 0168
|
||||||
return findallAnswers.result(Bag);
|
return findallAnswers.result(Bag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,8 +99,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
public static List<object> findallArray(object Template, IEnumerable<bool> goal)
|
public static List<object> findallArray(object Template, IEnumerable<bool> goal)
|
||||||
{
|
{
|
||||||
FindallAnswers findallAnswers = new FindallAnswers(Template);
|
FindallAnswers findallAnswers = new FindallAnswers(Template);
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in goal)
|
foreach (bool l1 in goal)
|
||||||
findallAnswers.add();
|
findallAnswers.add();
|
||||||
|
#pragma warning restore 0168
|
||||||
return findallAnswers.resultArray();
|
return findallAnswers.resultArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,14 +57,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
Functor1 argFunctor = (Functor1)arg;
|
Functor1 argFunctor = (Functor1)arg;
|
||||||
if (_name.Equals(argFunctor._name))
|
if (_name.Equals(argFunctor._name))
|
||||||
{
|
{
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in YP.unify(_arg1, argFunctor._arg1))
|
foreach (bool l1 in YP.unify(_arg1, argFunctor._arg1))
|
||||||
yield return false;
|
yield return false;
|
||||||
|
#pragma warning restore 0168
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (arg is Variable)
|
else if (arg is Variable)
|
||||||
{
|
{
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in ((Variable)arg).unify(this))
|
foreach (bool l1 in ((Variable)arg).unify(this))
|
||||||
yield return false;
|
yield return false;
|
||||||
|
#pragma warning restore 0168
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,17 +59,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
Functor2 argFunctor = (Functor2)arg;
|
Functor2 argFunctor = (Functor2)arg;
|
||||||
if (_name.Equals(argFunctor._name))
|
if (_name.Equals(argFunctor._name))
|
||||||
{
|
{
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in YP.unify(_arg1, argFunctor._arg1))
|
foreach (bool l1 in YP.unify(_arg1, argFunctor._arg1))
|
||||||
{
|
{
|
||||||
foreach (bool l2 in YP.unify(_arg2, argFunctor._arg2))
|
foreach (bool l2 in YP.unify(_arg2, argFunctor._arg2))
|
||||||
yield return false;
|
yield return false;
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (arg is Variable)
|
else if (arg is Variable)
|
||||||
{
|
{
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in ((Variable)arg).unify(this))
|
foreach (bool l1 in ((Variable)arg).unify(this))
|
||||||
yield return false;
|
yield return false;
|
||||||
|
#pragma warning restore 0168
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
Functor3 argFunctor = (Functor3)arg;
|
Functor3 argFunctor = (Functor3)arg;
|
||||||
if (_name.Equals(argFunctor._name))
|
if (_name.Equals(argFunctor._name))
|
||||||
{
|
{
|
||||||
|
// disable warning on l1, l2, l3 don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in YP.unify(_arg1, argFunctor._arg1))
|
foreach (bool l1 in YP.unify(_arg1, argFunctor._arg1))
|
||||||
{
|
{
|
||||||
foreach (bool l2 in YP.unify(_arg2, argFunctor._arg2))
|
foreach (bool l2 in YP.unify(_arg2, argFunctor._arg2))
|
||||||
|
@ -69,12 +72,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
yield return false;
|
yield return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (arg is Variable)
|
else if (arg is Variable)
|
||||||
{
|
{
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in ((Variable)arg).unify(this))
|
foreach (bool l1 in ((Variable)arg).unify(this))
|
||||||
yield return false;
|
yield return false;
|
||||||
|
#pragma warning restore 0168
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
yield return false;
|
yield return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// disable warning about unused variables: the following code
|
||||||
|
// is infested with it.
|
||||||
|
#pragma warning disable 0168, 0219
|
||||||
|
|
||||||
// Debug: Hand-modify this central predicate to do tail recursion.
|
// Debug: Hand-modify this central predicate to do tail recursion.
|
||||||
public static IEnumerable<bool> read_tokens(object arg1, object arg2, object arg3)
|
public static IEnumerable<bool> read_tokens(object arg1, object arg2, object arg3)
|
||||||
{
|
{
|
||||||
|
@ -188,7 +192,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
// Compiler output follows.
|
// Compiler output follows.
|
||||||
|
|
||||||
class YPInnerClass { }
|
class YPInnerClass { }
|
||||||
static Type getDeclaringClass() { return typeof(YPInnerClass).DeclaringType; }
|
// static Type getDeclaringClass() { return typeof(YPInnerClass).DeclaringType; }
|
||||||
|
|
||||||
public static IEnumerable<bool> parseInput(object TermList)
|
public static IEnumerable<bool> parseInput(object TermList)
|
||||||
{
|
{
|
||||||
|
@ -224,10 +228,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
if (YP.termEqual(Term, Atom.a(@"end_of_file")))
|
if (YP.termEqual(Term, Atom.a(@"end_of_file")))
|
||||||
{
|
{
|
||||||
yield break;
|
yield break;
|
||||||
goto cutIf1;
|
// unreachable code:
|
||||||
|
// goto cutIf1;
|
||||||
}
|
}
|
||||||
yield return false;
|
yield return false;
|
||||||
cutIf1:
|
// cutIf1:
|
||||||
{ }
|
{ }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4452,6 +4457,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
{ }
|
{ }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,8 +92,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in YP.unify(this, arg))
|
foreach (bool l1 in YP.unify(this, arg))
|
||||||
yield return false;
|
yield return false;
|
||||||
|
#pragma warning restore 0168
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -572,6 +572,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
|
|
||||||
Variable Name = new Variable();
|
Variable Name = new Variable();
|
||||||
Variable ArgList = new Variable();
|
Variable ArgList = new Variable();
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in new ListPair(Name, ArgList).unify(List))
|
foreach (bool l1 in new ListPair(Name, ArgList).unify(List))
|
||||||
{
|
{
|
||||||
object[] args = ListPair.toArray(ArgList);
|
object[] args = ListPair.toArray(ArgList);
|
||||||
|
@ -585,6 +588,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
|
|
||||||
return YP.unify(Term, Functor.make((Atom)YP.getValue(Name), args));
|
return YP.unify(Term, Functor.make((Atom)YP.getValue(Name), args));
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168
|
||||||
|
|
||||||
return YP.fail();
|
return YP.fail();
|
||||||
}
|
}
|
||||||
|
@ -597,11 +601,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
|
|
||||||
if (!(Term is Variable))
|
if (!(Term is Variable))
|
||||||
{
|
{
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in YP.unify(FunctorName, getFunctorName(Term)))
|
foreach (bool l1 in YP.unify(FunctorName, getFunctorName(Term)))
|
||||||
{
|
{
|
||||||
foreach (bool l2 in YP.unify(Arity, getFunctorArgs(Term).Length))
|
foreach (bool l2 in YP.unify(Arity, getFunctorArgs(Term).Length))
|
||||||
yield return false;
|
yield return false;
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
throw new NotImplementedException("Debug: must finish functor/3");
|
throw new NotImplementedException("Debug: must finish functor/3");
|
||||||
|
@ -621,8 +629,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
if (argNumberInt >= 1 && argNumberInt <= termArgs.Length)
|
if (argNumberInt >= 1 && argNumberInt <= termArgs.Length)
|
||||||
{
|
{
|
||||||
// The first ArgNumber is at 1, not 0.
|
// The first ArgNumber is at 1, not 0.
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in YP.unify(Value, termArgs[argNumberInt - 1]))
|
foreach (bool l1 in YP.unify(Value, termArgs[argNumberInt - 1]))
|
||||||
yield return false;
|
yield return false;
|
||||||
|
#pragma warning restore 0168
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -814,8 +826,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
object[] args = new object[] { Priority, Specifier, Operator };
|
object[] args = new object[] { Priority, Specifier, Operator };
|
||||||
foreach (object[] answer in _operatorTable)
|
foreach (object[] answer in _operatorTable)
|
||||||
{
|
{
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in YP.unifyArrays(args, answer))
|
foreach (bool l1 in YP.unifyArrays(args, answer))
|
||||||
yield return false;
|
yield return false;
|
||||||
|
#pragma warning restore 0168
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -847,12 +863,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
int afterInt = atomAtom._name.Length - (beforeInt + lengthInt);
|
int afterInt = atomAtom._name.Length - (beforeInt + lengthInt);
|
||||||
if (afterInt >= 0)
|
if (afterInt >= 0)
|
||||||
{
|
{
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in YP.unify(After, afterInt))
|
foreach (bool l1 in YP.unify(After, afterInt))
|
||||||
{
|
{
|
||||||
foreach (bool l2 in YP.unify
|
foreach (bool l2 in YP.unify
|
||||||
(Sub_atom, Atom.a(atomAtom._name.Substring(beforeInt, lengthInt))))
|
(Sub_atom, Atom.a(atomAtom._name.Substring(beforeInt, lengthInt))))
|
||||||
yield return false;
|
yield return false;
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1201,9 +1221,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
if (arity == 2 && (name == Atom.a(",") || name == Atom.a(";") || name == Atom.DOT))
|
if (arity == 2 && (name == Atom.a(",") || name == Atom.a(";") || name == Atom.DOT))
|
||||||
return false;
|
return false;
|
||||||
// Use the same mapping to static predicates in YP as the compiler.
|
// Use the same mapping to static predicates in YP as the compiler.
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in YPCompiler.functorCallYPFunctionName(name, arity, new Variable()))
|
foreach (bool l1 in YPCompiler.functorCallYPFunctionName(name, arity, new Variable()))
|
||||||
return false;
|
return false;
|
||||||
// Debug: Do we need to check if name._module is null?
|
// Debug: Do we need to check if name._module is null?
|
||||||
|
#pragma warning restore 0168
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1342,9 +1366,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
|
|
||||||
foreach (NameArity key in _predicatesStore.Keys)
|
foreach (NameArity key in _predicatesStore.Keys)
|
||||||
{
|
{
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in YP.unify
|
foreach (bool l1 in YP.unify
|
||||||
(new Functor2(Atom.SLASH, key._name, key._arity), NameSlashArity))
|
(new Functor2(Atom.SLASH, key._name, key._arity), NameSlashArity))
|
||||||
yield return false;
|
yield return false;
|
||||||
|
#pragma warning restore 0168
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1414,7 +1442,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static void script_event(object script_event, object script_params)
|
public static void script_event(object script_event, object script_params)
|
||||||
{
|
{
|
||||||
string function = ((Atom)YP.getValue(script_event))._name;
|
// string function = ((Atom)YP.getValue(script_event))._name;
|
||||||
object[] array = ListPair.toArray(script_params);
|
object[] array = ListPair.toArray(script_params);
|
||||||
if (array == null)
|
if (array == null)
|
||||||
return; // YP.fail();
|
return; // YP.fail();
|
||||||
|
@ -1600,11 +1628,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
if (_exception != null)
|
if (_exception != null)
|
||||||
{
|
{
|
||||||
bool didUnify = false;
|
bool didUnify = false;
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in YP.unify(_exception._term, Catcher))
|
foreach (bool l1 in YP.unify(_exception._term, Catcher))
|
||||||
{
|
{
|
||||||
didUnify = true;
|
didUnify = true;
|
||||||
yield return false;
|
yield return false;
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168
|
||||||
|
|
||||||
if (!didUnify)
|
if (!didUnify)
|
||||||
throw _exception;
|
throw _exception;
|
||||||
}
|
}
|
||||||
|
|
|
@ -209,6 +209,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
object[] functorArgs = YP.getFunctorArgs(Term);
|
object[] functorArgs = YP.getFunctorArgs(Term);
|
||||||
|
|
||||||
Variable pred = new Variable();
|
Variable pred = new Variable();
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in ((CompilerState)State)._pred.match
|
foreach (bool l1 in ((CompilerState)State)._pred.match
|
||||||
(new object[] { functorName, functorArgs.Length, pred, Atom.a("det") }))
|
(new object[] { functorName, functorArgs.Length, pred, Atom.a("det") }))
|
||||||
{
|
{
|
||||||
|
@ -217,6 +220,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -228,6 +232,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
object[] functorArgs = YP.getFunctorArgs(Term);
|
object[] functorArgs = YP.getFunctorArgs(Term);
|
||||||
|
|
||||||
Variable pred = new Variable();
|
Variable pred = new Variable();
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in ((CompilerState)State)._pred.match
|
foreach (bool l1 in ((CompilerState)State)._pred.match
|
||||||
(new object[] { functorName, functorArgs.Length, pred, Atom.a("semidet") }))
|
(new object[] { functorName, functorArgs.Length, pred, Atom.a("semidet") }))
|
||||||
{
|
{
|
||||||
|
@ -236,6 +243,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -275,6 +283,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// disable warning unused variables, the following code is
|
||||||
|
// infested with it.
|
||||||
|
#pragma warning disable 0168, 0219
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Use makeFunctionPseudoCode, convertFunctionCSharp and compileAnonymousFunction
|
/// Use makeFunctionPseudoCode, convertFunctionCSharp and compileAnonymousFunction
|
||||||
/// to return an anonymous YP.IClause for the Head and Body of a rule clause.
|
/// to return an anonymous YP.IClause for the Head and Body of a rule clause.
|
||||||
|
@ -3939,12 +3951,12 @@ namespace Temporary {
|
||||||
YP.nl();
|
YP.nl();
|
||||||
convertStatementListCSharp(RestStatements, Level);
|
convertStatementListCSharp(RestStatements, Level);
|
||||||
return;
|
return;
|
||||||
goto cutIf1;
|
// goto cutIf1;
|
||||||
}
|
}
|
||||||
convertStatementListCSharp(RestStatements, Level);
|
convertStatementListCSharp(RestStatements, Level);
|
||||||
return;
|
return;
|
||||||
cutIf1:
|
// cutIf1:
|
||||||
{ }
|
// { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
@ -4111,12 +4123,12 @@ namespace Temporary {
|
||||||
YP.write(Atom.a(@", "));
|
YP.write(Atom.a(@", "));
|
||||||
convertArgListCSharp(Tail);
|
convertArgListCSharp(Tail);
|
||||||
return;
|
return;
|
||||||
goto cutIf1;
|
// goto cutIf1;
|
||||||
}
|
}
|
||||||
convertArgListCSharp(Tail);
|
convertArgListCSharp(Tail);
|
||||||
return;
|
return;
|
||||||
cutIf1:
|
// cutIf1:
|
||||||
{ }
|
// { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4266,13 +4278,13 @@ namespace Temporary {
|
||||||
YP.put_code(Code);
|
YP.put_code(Code);
|
||||||
convertStringCodesCSharp(RestCodes);
|
convertStringCodesCSharp(RestCodes);
|
||||||
return;
|
return;
|
||||||
goto cutIf1;
|
// goto cutIf1;
|
||||||
}
|
}
|
||||||
YP.put_code(Code);
|
YP.put_code(Code);
|
||||||
convertStringCodesCSharp(RestCodes);
|
convertStringCodesCSharp(RestCodes);
|
||||||
return;
|
return;
|
||||||
cutIf1:
|
// cutIf1:
|
||||||
{ }
|
// { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4623,12 +4635,12 @@ namespace Temporary {
|
||||||
YP.write(Atom.a(@", "));
|
YP.write(Atom.a(@", "));
|
||||||
convertArgListJavascript(Tail);
|
convertArgListJavascript(Tail);
|
||||||
return;
|
return;
|
||||||
goto cutIf1;
|
// goto cutIf1;
|
||||||
}
|
}
|
||||||
convertArgListJavascript(Tail);
|
convertArgListJavascript(Tail);
|
||||||
return;
|
return;
|
||||||
cutIf1:
|
// cutIf1:
|
||||||
{ }
|
// { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4777,7 +4789,7 @@ namespace Temporary {
|
||||||
YP.put_code(Code);
|
YP.put_code(Code);
|
||||||
convertStringCodesJavascript(RestCodes);
|
convertStringCodesJavascript(RestCodes);
|
||||||
return;
|
return;
|
||||||
goto cutIf1;
|
// goto cutIf1;
|
||||||
}
|
}
|
||||||
if (YP.termEqual(Code, 92))
|
if (YP.termEqual(Code, 92))
|
||||||
{
|
{
|
||||||
|
@ -4785,13 +4797,13 @@ namespace Temporary {
|
||||||
YP.put_code(Code);
|
YP.put_code(Code);
|
||||||
convertStringCodesJavascript(RestCodes);
|
convertStringCodesJavascript(RestCodes);
|
||||||
return;
|
return;
|
||||||
goto cutIf1;
|
// goto cutIf1;
|
||||||
}
|
}
|
||||||
YP.put_code(Code);
|
YP.put_code(Code);
|
||||||
convertStringCodesJavascript(RestCodes);
|
convertStringCodesJavascript(RestCodes);
|
||||||
return;
|
return;
|
||||||
cutIf1:
|
// cutIf1:
|
||||||
{ }
|
// { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5420,12 +5432,12 @@ namespace Temporary {
|
||||||
YP.write(Atom.a(@", "));
|
YP.write(Atom.a(@", "));
|
||||||
convertArgListPython(Tail);
|
convertArgListPython(Tail);
|
||||||
return;
|
return;
|
||||||
goto cutIf1;
|
// goto cutIf1;
|
||||||
}
|
}
|
||||||
convertArgListPython(Tail);
|
convertArgListPython(Tail);
|
||||||
return;
|
return;
|
||||||
cutIf1:
|
// cutIf1:
|
||||||
{ }
|
// { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5573,7 +5585,7 @@ namespace Temporary {
|
||||||
YP.put_code(Code);
|
YP.put_code(Code);
|
||||||
convertStringCodesPython(RestCodes);
|
convertStringCodesPython(RestCodes);
|
||||||
return;
|
return;
|
||||||
goto cutIf1;
|
// goto cutIf1;
|
||||||
}
|
}
|
||||||
if (YP.termEqual(Code, 92))
|
if (YP.termEqual(Code, 92))
|
||||||
{
|
{
|
||||||
|
@ -5581,13 +5593,13 @@ namespace Temporary {
|
||||||
YP.put_code(Code);
|
YP.put_code(Code);
|
||||||
convertStringCodesPython(RestCodes);
|
convertStringCodesPython(RestCodes);
|
||||||
return;
|
return;
|
||||||
goto cutIf1;
|
// goto cutIf1;
|
||||||
}
|
}
|
||||||
YP.put_code(Code);
|
YP.put_code(Code);
|
||||||
convertStringCodesPython(RestCodes);
|
convertStringCodesPython(RestCodes);
|
||||||
return;
|
return;
|
||||||
cutIf1:
|
// cutIf1:
|
||||||
{ }
|
// { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5646,6 +5658,7 @@ namespace Temporary {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,8 +40,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
||||||
{
|
{
|
||||||
public class Compiler
|
public class Compiler
|
||||||
{
|
{
|
||||||
private static readonly log4net.ILog m_log
|
// private static readonly log4net.ILog m_log
|
||||||
= log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
// * Uses "LSL2Converter" to convert LSL to C# if necessary.
|
// * Uses "LSL2Converter" to convert LSL to C# if necessary.
|
||||||
// * Compiles C#-code into an assembly
|
// * Compiles C#-code into an assembly
|
||||||
|
@ -79,7 +79,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
||||||
private static CSharpCodeProvider YPcodeProvider = new CSharpCodeProvider(); // YP is translated into CSharp
|
private static CSharpCodeProvider YPcodeProvider = new CSharpCodeProvider(); // YP is translated into CSharp
|
||||||
private static YP2CSConverter YP_Converter = new YP2CSConverter();
|
private static YP2CSConverter YP_Converter = new YP2CSConverter();
|
||||||
|
|
||||||
private static int instanceID = new Random().Next(0, int.MaxValue); // Unique number to use on our compiled files
|
// private static int instanceID = new Random().Next(0, int.MaxValue); // Unique number to use on our compiled files
|
||||||
private static UInt64 scriptCompileCounter = 0; // And a counter
|
private static UInt64 scriptCompileCounter = 0; // And a counter
|
||||||
|
|
||||||
public IScriptEngine m_scriptEngine;
|
public IScriptEngine m_scriptEngine;
|
||||||
|
@ -273,7 +273,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(ScriptEnginesPath);
|
Directory.CreateDirectory(ScriptEnginesPath);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -285,7 +285,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(ScriptEnginesPath);
|
Directory.CreateDirectory(ScriptEnginesPath);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -486,7 +486,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
||||||
// }
|
// }
|
||||||
|
|
||||||
string rootPath = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory);
|
string rootPath = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory);
|
||||||
string rootPathSE = Path.GetDirectoryName(GetType().Assembly.Location);
|
// string rootPathSE = Path.GetDirectoryName(GetType().Assembly.Location);
|
||||||
//Console.WriteLine("Assembly location: " + rootPath);
|
//Console.WriteLine("Assembly location: " + rootPath);
|
||||||
parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Shared.dll"));
|
parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Shared.dll"));
|
||||||
parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Shared.Api.Runtime.dll"));
|
parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Shared.Api.Runtime.dll"));
|
||||||
|
|
|
@ -69,11 +69,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
||||||
YP.tell(myCS_SW);
|
YP.tell(myCS_SW);
|
||||||
|
|
||||||
//Console.WriteLine("Mycode\n ===================================\n" + myCode+"\n");
|
//Console.WriteLine("Mycode\n ===================================\n" + myCode+"\n");
|
||||||
|
// disable warning on l1, don't see how we can
|
||||||
|
// code this differently
|
||||||
|
#pragma warning disable 0168
|
||||||
foreach (bool l1 in Parser.parseInput(TermList))
|
foreach (bool l1 in Parser.parseInput(TermList))
|
||||||
{
|
{
|
||||||
foreach (bool l2 in YPCompiler.makeFunctionPseudoCode(TermList, FunctionCode))
|
foreach (bool l2 in YPCompiler.makeFunctionPseudoCode(TermList, FunctionCode))
|
||||||
{
|
{
|
||||||
ListPair VFC = new ListPair(FunctionCode, new Variable());
|
// ListPair VFC = new ListPair(FunctionCode, new Variable());
|
||||||
//Console.WriteLine("-------------------------")
|
//Console.WriteLine("-------------------------")
|
||||||
//Console.WriteLine(FunctionCode.ToString())
|
//Console.WriteLine(FunctionCode.ToString())
|
||||||
//Console.WriteLine("-------------------------")
|
//Console.WriteLine("-------------------------")
|
||||||
|
@ -81,6 +84,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
||||||
//YPCompiler.convertStringCodesCSharp(VFC);
|
//YPCompiler.convertStringCodesCSharp(VFC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#pragma warning restore 0168
|
||||||
YP.seen();
|
YP.seen();
|
||||||
myCS_SW.Close();
|
myCS_SW.Close();
|
||||||
YP.told();
|
YP.told();
|
||||||
|
|
|
@ -73,7 +73,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
eventFlags |= kvp.Value;
|
eventFlags |= kvp.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception)
|
||||||
{
|
{
|
||||||
//Console.WriteLine("Exeption in GetMethod:\n"+e.ToString());
|
//Console.WriteLine("Exeption in GetMethod:\n"+e.ToString());
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
private Scene m_Scene;
|
private Scene m_Scene;
|
||||||
private IConfig m_ScriptConfig;
|
private IConfig m_ScriptConfig;
|
||||||
private Compiler m_Compiler;
|
private Compiler m_Compiler;
|
||||||
private EventManager m_EventManager;
|
// private EventManager m_EventManager;
|
||||||
private int m_EventLimit;
|
private int m_EventLimit;
|
||||||
private bool m_KillTimedOutScripts;
|
private bool m_KillTimedOutScripts;
|
||||||
public AsyncCommandManager m_AsyncCommands;
|
public AsyncCommandManager m_AsyncCommands;
|
||||||
|
@ -111,12 +111,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
get { return m_ScriptEngines; }
|
get { return m_ScriptEngines; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private struct RezScriptParms
|
// private struct RezScriptParms
|
||||||
{
|
// {
|
||||||
uint LocalID;
|
// uint LocalID;
|
||||||
LLUUID ItemID;
|
// LLUUID ItemID;
|
||||||
string Script;
|
// string Script;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public IConfig Config
|
public IConfig Config
|
||||||
{
|
{
|
||||||
|
@ -190,7 +190,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
m_ScriptEngines.Add(this);
|
m_ScriptEngines.Add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_EventManager = new EventManager(this);
|
// m_EventManager = new EventManager(this);
|
||||||
|
|
||||||
StartEngine(minThreads, maxThreads, idleTimeout, prio,
|
StartEngine(minThreads, maxThreads, idleTimeout, prio,
|
||||||
maxScriptQueue, stackSize);
|
maxScriptQueue, stackSize);
|
||||||
|
@ -527,7 +527,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
if (File.Exists(m_Assemblies[assetID]+".mdb"))
|
if (File.Exists(m_Assemblies[assetID]+".mdb"))
|
||||||
File.Delete(m_Assemblies[assetID]+".mdb");
|
File.Delete(m_Assemblies[assetID]+".mdb");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
m_Assemblies.Remove(assetID);
|
m_Assemblies.Remove(assetID);
|
||||||
|
|
|
@ -131,13 +131,15 @@ namespace Amib.Threading.Internal
|
||||||
// *********** Remark for .NET 2.0 ***********
|
// *********** Remark for .NET 2.0 ***********
|
||||||
// If you are here, it means you got the warning that this overload
|
// If you are here, it means you got the warning that this overload
|
||||||
// of the method is deprecated in .NET 2.0. To use the correct
|
// of the method is deprecated in .NET 2.0. To use the correct
|
||||||
// method overload, uncomment the third argument of the method.
|
// method overload, uncomment the third argument of
|
||||||
|
// the method.
|
||||||
|
#pragma warning disable 0618
|
||||||
PerformanceCounterCategory.Create(
|
PerformanceCounterCategory.Create(
|
||||||
_stpCategoryName,
|
_stpCategoryName,
|
||||||
_stpCategoryHelp,
|
_stpCategoryHelp,
|
||||||
//PerformanceCounterCategoryType.MultiInstance,
|
//PerformanceCounterCategoryType.MultiInstance,
|
||||||
counters);
|
counters);
|
||||||
|
#pragma warning restore 0618
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,7 +247,7 @@ namespace Amib.Threading.Internal
|
||||||
public STPInstancePerformanceCounters(string instance)
|
public STPInstancePerformanceCounters(string instance)
|
||||||
{
|
{
|
||||||
_pcs = new STPInstancePerformanceCounter[(int)STPPerformanceCounterType.LastCounter];
|
_pcs = new STPInstancePerformanceCounter[(int)STPPerformanceCounterType.LastCounter];
|
||||||
STPPerformanceCounters counters = STPPerformanceCounters.Instance;
|
// STPPerformanceCounters counters = STPPerformanceCounters.Instance;
|
||||||
for (int i = 0; i < _pcs.Length; i++)
|
for (int i = 0; i < _pcs.Length; i++)
|
||||||
{
|
{
|
||||||
if (instance != null)
|
if (instance != null)
|
||||||
|
|
Loading…
Reference in New Issue