Merge branch 'careminster' into tests
commit
2c3f6aaa87
|
@ -158,6 +158,7 @@ This software uses components from the following developers:
|
||||||
* Nini (http://nini.sourceforge.net/)
|
* Nini (http://nini.sourceforge.net/)
|
||||||
* log4net (http://logging.apache.org/log4net/)
|
* log4net (http://logging.apache.org/log4net/)
|
||||||
* GlynnTucker.Cache (http://gtcache.sourceforge.net/)
|
* GlynnTucker.Cache (http://gtcache.sourceforge.net/)
|
||||||
|
* NDesk.Options 0.2.1 (http://www.ndesk.org/Options)
|
||||||
|
|
||||||
Some plugins are based on Cable Beach
|
Some plugins are based on Cable Beach
|
||||||
Cable Beach is Copyright (c) 2008 Intel Corporation
|
Cable Beach is Copyright (c) 2008 Intel Corporation
|
||||||
|
|
|
@ -213,9 +213,59 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
if (!m_app.SceneManager.TryGetScene(regionID, out rebootedScene))
|
if (!m_app.SceneManager.TryGetScene(regionID, out rebootedScene))
|
||||||
throw new Exception("region not found");
|
throw new Exception("region not found");
|
||||||
|
|
||||||
|
int timeout = 30000;
|
||||||
|
string message;
|
||||||
|
|
||||||
|
if (requestData.ContainsKey("restart")
|
||||||
|
&& ((string)requestData["restart"] == "delayed")
|
||||||
|
&& requestData.ContainsKey("milliseconds"))
|
||||||
|
{
|
||||||
|
timeout = Int32.Parse(requestData["milliseconds"].ToString());
|
||||||
|
|
||||||
|
if (timeout < 15000)
|
||||||
|
{
|
||||||
|
//It must be at least 15 seconds or we'll cancel the reboot request
|
||||||
|
timeout = 15000;
|
||||||
|
}
|
||||||
|
|
||||||
|
message
|
||||||
|
= "Region is restarting in " + ((int)(timeout / 1000)).ToString()
|
||||||
|
+ " second(s). Please save what you are doing and log out.";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
message = "Region is restarting in 30 second(s). Please save what you are doing and log out.";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (requestData.ContainsKey("noticetype")
|
||||||
|
&& ((string)requestData["noticetype"] == "dialog"))
|
||||||
|
{
|
||||||
|
m_app.SceneManager.ForEachScene(
|
||||||
|
delegate(Scene scene)
|
||||||
|
{
|
||||||
|
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||||
|
if (dialogModule != null)
|
||||||
|
dialogModule.SendNotificationToUsersInRegion(UUID.Zero, "System", message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!requestData.ContainsKey("noticetype")
|
||||||
|
|| ((string)requestData["noticetype"] != "none"))
|
||||||
|
{
|
||||||
|
m_app.SceneManager.ForEachScene(
|
||||||
|
delegate(Scene scene)
|
||||||
|
{
|
||||||
|
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||||
|
if (dialogModule != null)
|
||||||
|
dialogModule.SendGeneralAlert(message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
responseData["rebooting"] = true;
|
responseData["rebooting"] = true;
|
||||||
response.Value = responseData;
|
response.Value = responseData;
|
||||||
rebootedScene.Restart(30);
|
rebootedScene.Restart(timeout / 1000,false);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -419,13 +469,33 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
message = "Region is going down now.";
|
message = "Region is going down now.";
|
||||||
}
|
}
|
||||||
|
|
||||||
m_app.SceneManager.ForEachScene(
|
if (requestData.ContainsKey("noticetype")
|
||||||
|
&& ((string) requestData["noticetype"] == "dialog"))
|
||||||
|
{
|
||||||
|
m_app.SceneManager.ForEachScene(
|
||||||
delegate(Scene scene)
|
delegate(Scene scene)
|
||||||
|
{
|
||||||
|
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||||
|
if (dialogModule != null)
|
||||||
|
dialogModule.SendNotificationToUsersInRegion(UUID.Zero, "System", message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!requestData.ContainsKey("noticetype")
|
||||||
|
|| ((string)requestData["noticetype"] != "none"))
|
||||||
|
{
|
||||||
|
m_app.SceneManager.ForEachScene(
|
||||||
|
delegate(Scene scene)
|
||||||
{
|
{
|
||||||
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||||
if (dialogModule != null)
|
if (dialogModule != null)
|
||||||
dialogModule.SendGeneralAlert(message);
|
dialogModule.SendGeneralAlert(message);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Perform shutdown
|
// Perform shutdown
|
||||||
System.Timers.Timer shutdownTimer = new System.Timers.Timer(timeout); // Wait before firing
|
System.Timers.Timer shutdownTimer = new System.Timers.Timer(timeout); // Wait before firing
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.IO;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using log4net;
|
using log4net;
|
||||||
|
@ -463,6 +464,125 @@ namespace OpenSim.Data.MySQL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Inventory Rollback-via-.sql Support
|
||||||
|
/// <summary>
|
||||||
|
/// Not a good SQL escape function, but it'll do the job (if mutilate the data.)
|
||||||
|
/// Someone may want to write something better here.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="str"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private static string cheapSQLescape(string str)
|
||||||
|
{
|
||||||
|
str = str.Replace("\\", "");
|
||||||
|
str = str.Replace("'", "");
|
||||||
|
str = str.Replace("\"", "");
|
||||||
|
return "'" + str + "'";
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string InventoryItemToSql(InventoryItemBase item)
|
||||||
|
{
|
||||||
|
string sql =
|
||||||
|
"REPLACE /*! INVITEM AT ***$SUBS$*** */ INTO inventoryitems (inventoryID, assetID, assetType, parentFolderID, avatarID, inventoryName"
|
||||||
|
+ ", inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType"
|
||||||
|
+ ", creatorID, inventoryBasePermissions, inventoryEveryOnePermissions, inventoryGroupPermissions, salePrice, saleType"
|
||||||
|
+ ", creationDate, groupID, groupOwned, flags) VALUES ";
|
||||||
|
sql +=
|
||||||
|
"(?inventoryID, ?assetID, ?assetType, ?parentFolderID, ?avatarID, ?inventoryName, ?inventoryDescription"
|
||||||
|
+ ", ?inventoryNextPermissions, ?inventoryCurrentPermissions, ?invType, ?creatorID"
|
||||||
|
+ ", ?inventoryBasePermissions, ?inventoryEveryOnePermissions, ?inventoryGroupPermissions, ?salePrice, ?saleType, ?creationDate"
|
||||||
|
+ ", ?groupID, ?groupOwned, ?flags);\r\n";
|
||||||
|
|
||||||
|
string itemName = item.Name;
|
||||||
|
string itemDesc = item.Description;
|
||||||
|
|
||||||
|
sql = sql.Replace("$SUBS$", Util.UnixTimeSinceEpoch().ToString());
|
||||||
|
|
||||||
|
sql = sql.Replace("?inventoryID", cheapSQLescape(item.ID.ToString()));
|
||||||
|
sql = sql.Replace("?assetID", cheapSQLescape(item.AssetID.ToString()));
|
||||||
|
sql = sql.Replace("?assetType", cheapSQLescape(item.AssetType.ToString()));
|
||||||
|
sql = sql.Replace("?parentFolderID", cheapSQLescape(item.Folder.ToString()));
|
||||||
|
sql = sql.Replace("?avatarID", cheapSQLescape(item.Owner.ToString()));
|
||||||
|
sql = sql.Replace("?inventoryName", cheapSQLescape(itemName));
|
||||||
|
sql = sql.Replace("?inventoryDescription", cheapSQLescape(itemDesc));
|
||||||
|
sql = sql.Replace("?inventoryNextPermissions", cheapSQLescape(item.NextPermissions.ToString()));
|
||||||
|
sql = sql.Replace("?inventoryCurrentPermissions", cheapSQLescape(item.CurrentPermissions.ToString()));
|
||||||
|
sql = sql.Replace("?invType", cheapSQLescape(item.InvType.ToString()));
|
||||||
|
sql = sql.Replace("?creatorID", cheapSQLescape(item.CreatorId));
|
||||||
|
sql = sql.Replace("?inventoryBasePermissions", cheapSQLescape(item.BasePermissions.ToString()));
|
||||||
|
sql = sql.Replace("?inventoryEveryOnePermissions", cheapSQLescape(item.EveryOnePermissions.ToString()));
|
||||||
|
sql = sql.Replace("?inventoryGroupPermissions", cheapSQLescape(item.GroupPermissions.ToString()));
|
||||||
|
sql = sql.Replace("?salePrice", cheapSQLescape(item.SalePrice.ToString()));
|
||||||
|
sql = sql.Replace("?saleType", cheapSQLescape(unchecked((sbyte)item.SaleType).ToString()));
|
||||||
|
sql = sql.Replace("?creationDate", cheapSQLescape(item.CreationDate.ToString()));
|
||||||
|
sql = sql.Replace("?groupID", cheapSQLescape(item.GroupID.ToString()));
|
||||||
|
sql = sql.Replace("?groupOwned", cheapSQLescape(item.GroupOwned.ToString()));
|
||||||
|
sql = sql.Replace("?flags", cheapSQLescape(item.Flags.ToString()));
|
||||||
|
|
||||||
|
return sql;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string InventoryFolderToSql(InventoryFolderBase folder)
|
||||||
|
{
|
||||||
|
string sql =
|
||||||
|
"REPLACE /*! INVFOLDER AT ***$SUBS$*** */ INTO inventoryfolders (folderID, agentID, parentFolderID, folderName, type, version) VALUES ";
|
||||||
|
sql += "(?folderID, ?agentID, ?parentFolderID, ?folderName, ?type, ?version);\r\n";
|
||||||
|
|
||||||
|
string folderName = folder.Name;
|
||||||
|
|
||||||
|
sql = sql.Replace("$SUBS$", Util.UnixTimeSinceEpoch().ToString());
|
||||||
|
|
||||||
|
sql = sql.Replace("?folderID", cheapSQLescape(folder.ID.ToString()));
|
||||||
|
sql = sql.Replace("?agentID", cheapSQLescape(folder.Owner.ToString()));
|
||||||
|
sql = sql.Replace("?parentFolderID", cheapSQLescape(folder.ParentID.ToString()));
|
||||||
|
sql = sql.Replace("?folderName", cheapSQLescape(folderName));
|
||||||
|
sql = sql.Replace("?type", cheapSQLescape(folder.Type.ToString()));
|
||||||
|
sql = sql.Replace("?version", cheapSQLescape(folder.Version.ToString()));
|
||||||
|
|
||||||
|
return sql;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string getRollbackFolderDate()
|
||||||
|
{
|
||||||
|
return DateTime.UtcNow.Year.ToString() + "-" + DateTime.UtcNow.Month.ToString() + "-" +
|
||||||
|
DateTime.UtcNow.Day.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void StoreRollbackItem(UUID ItemID)
|
||||||
|
{
|
||||||
|
if(rollbackStore == true)
|
||||||
|
{
|
||||||
|
string todaysPath = RollbackGetTodaysPath();
|
||||||
|
|
||||||
|
InventoryItemBase imb = getInventoryItem(ItemID);
|
||||||
|
string sql = InventoryItemToSql(imb);
|
||||||
|
File.AppendAllText(Path.Combine(todaysPath, imb.Owner.ToString()), sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void StoreRollbackFolder(UUID FolderID)
|
||||||
|
{
|
||||||
|
if (rollbackStore == true)
|
||||||
|
{
|
||||||
|
string todaysPath = RollbackGetTodaysPath();
|
||||||
|
|
||||||
|
InventoryFolderBase ifb = getInventoryFolder(FolderID);
|
||||||
|
string sql = InventoryFolderToSql(ifb);
|
||||||
|
File.AppendAllText(Path.Combine(todaysPath, ifb.Owner.ToString()), sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string RollbackGetTodaysPath()
|
||||||
|
{
|
||||||
|
if (!Directory.Exists(rollbackDir))
|
||||||
|
Directory.CreateDirectory(rollbackDir);
|
||||||
|
|
||||||
|
string todaysPath = Path.Combine(rollbackDir, getRollbackFolderDate());
|
||||||
|
if (!Directory.Exists(todaysPath))
|
||||||
|
Directory.CreateDirectory(todaysPath);
|
||||||
|
return todaysPath;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds a specified item to the database
|
/// Adds a specified item to the database
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -549,6 +669,8 @@ namespace OpenSim.Data.MySQL
|
||||||
/// <param name="item">Inventory item to update</param>
|
/// <param name="item">Inventory item to update</param>
|
||||||
public void updateInventoryItem(InventoryItemBase item)
|
public void updateInventoryItem(InventoryItemBase item)
|
||||||
{
|
{
|
||||||
|
StoreRollbackItem(item.ID);
|
||||||
|
|
||||||
addInventoryItem(item);
|
addInventoryItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -558,6 +680,8 @@ namespace OpenSim.Data.MySQL
|
||||||
/// <param name="item">The inventory item UUID to delete</param>
|
/// <param name="item">The inventory item UUID to delete</param>
|
||||||
public void deleteInventoryItem(UUID itemID)
|
public void deleteInventoryItem(UUID itemID)
|
||||||
{
|
{
|
||||||
|
StoreRollbackItem(itemID);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
database.CheckConnection();
|
database.CheckConnection();
|
||||||
|
@ -634,6 +758,7 @@ namespace OpenSim.Data.MySQL
|
||||||
/// <param name="folder">Folder to update</param>
|
/// <param name="folder">Folder to update</param>
|
||||||
public void updateInventoryFolder(InventoryFolderBase folder)
|
public void updateInventoryFolder(InventoryFolderBase folder)
|
||||||
{
|
{
|
||||||
|
StoreRollbackFolder(folder.ID);
|
||||||
addInventoryFolder(folder);
|
addInventoryFolder(folder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -644,6 +769,8 @@ namespace OpenSim.Data.MySQL
|
||||||
/// <remarks>UPDATE inventoryfolders SET parentFolderID=?parentFolderID WHERE folderID=?folderID</remarks>
|
/// <remarks>UPDATE inventoryfolders SET parentFolderID=?parentFolderID WHERE folderID=?folderID</remarks>
|
||||||
public void moveInventoryFolder(InventoryFolderBase folder)
|
public void moveInventoryFolder(InventoryFolderBase folder)
|
||||||
{
|
{
|
||||||
|
StoreRollbackFolder(folder.ID);
|
||||||
|
|
||||||
string sql =
|
string sql =
|
||||||
"UPDATE inventoryfolders SET parentFolderID=?parentFolderID WHERE folderID=?folderID";
|
"UPDATE inventoryfolders SET parentFolderID=?parentFolderID WHERE folderID=?folderID";
|
||||||
|
|
||||||
|
@ -805,6 +932,8 @@ namespace OpenSim.Data.MySQL
|
||||||
/// <param name="folderID">the folder UUID</param>
|
/// <param name="folderID">the folder UUID</param>
|
||||||
protected void deleteOneFolder(UUID folderID)
|
protected void deleteOneFolder(UUID folderID)
|
||||||
{
|
{
|
||||||
|
StoreRollbackFolder(folderID);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
database.CheckConnection();
|
database.CheckConnection();
|
||||||
|
@ -831,6 +960,14 @@ namespace OpenSim.Data.MySQL
|
||||||
/// <param name="folderID">the folder UUID</param>
|
/// <param name="folderID">the folder UUID</param>
|
||||||
protected void deleteItemsInFolder(UUID folderID)
|
protected void deleteItemsInFolder(UUID folderID)
|
||||||
{
|
{
|
||||||
|
if (rollbackStore)
|
||||||
|
{
|
||||||
|
foreach (InventoryItemBase itemBase in getInventoryInFolder(folderID))
|
||||||
|
{
|
||||||
|
StoreRollbackItem(itemBase.ID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
database.CheckConnection();
|
database.CheckConnection();
|
||||||
|
@ -865,17 +1002,34 @@ namespace OpenSim.Data.MySQL
|
||||||
//Delete all sub-folders
|
//Delete all sub-folders
|
||||||
foreach (InventoryFolderBase f in subFolders)
|
foreach (InventoryFolderBase f in subFolders)
|
||||||
{
|
{
|
||||||
|
StoreRollbackFolder(f.ID);
|
||||||
deleteOneFolder(f.ID);
|
deleteOneFolder(f.ID);
|
||||||
|
|
||||||
|
if(rollbackStore)
|
||||||
|
{
|
||||||
|
foreach (InventoryItemBase itemBase in getInventoryInFolder(f.ID))
|
||||||
|
{
|
||||||
|
StoreRollbackItem(itemBase.ID);
|
||||||
|
}
|
||||||
|
}
|
||||||
deleteItemsInFolder(f.ID);
|
deleteItemsInFolder(f.ID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StoreRollbackFolder(folderID);
|
||||||
//Delete the actual row
|
//Delete the actual row
|
||||||
deleteOneFolder(folderID);
|
deleteOneFolder(folderID);
|
||||||
|
|
||||||
// Just delete the folder context in OGM
|
// Just delete the folder context in OGM
|
||||||
if (opengridmode == false)
|
if (opengridmode == false)
|
||||||
{
|
{
|
||||||
|
if (rollbackStore)
|
||||||
|
{
|
||||||
|
foreach (InventoryItemBase itemBase in getInventoryInFolder(folderID))
|
||||||
|
{
|
||||||
|
StoreRollbackItem(itemBase.ID);
|
||||||
|
}
|
||||||
|
}
|
||||||
deleteItemsInFolder(folderID);
|
deleteItemsInFolder(folderID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,6 @@ namespace OpenSim.Framework
|
||||||
{
|
{
|
||||||
public delegate void ExpectUserDelegate(AgentCircuitData agent);
|
public delegate void ExpectUserDelegate(AgentCircuitData agent);
|
||||||
|
|
||||||
public delegate bool ExpectPrimDelegate(UUID primID, string objData, int XMLMethod);
|
|
||||||
|
|
||||||
public delegate void UpdateNeighbours(List<RegionInfo> neighbours);
|
public delegate void UpdateNeighbours(List<RegionInfo> neighbours);
|
||||||
|
|
||||||
|
@ -55,7 +54,6 @@ namespace OpenSim.Framework
|
||||||
public interface IRegionCommsListener
|
public interface IRegionCommsListener
|
||||||
{
|
{
|
||||||
event ExpectUserDelegate OnExpectUser;
|
event ExpectUserDelegate OnExpectUser;
|
||||||
event ExpectPrimDelegate OnExpectPrim;
|
|
||||||
event GenericCall2 OnExpectChildAgent;
|
event GenericCall2 OnExpectChildAgent;
|
||||||
event AgentCrossing OnAvatarCrossingIntoRegion;
|
event AgentCrossing OnAvatarCrossingIntoRegion;
|
||||||
event PrimCrossing OnPrimCrossingIntoRegion;
|
event PrimCrossing OnPrimCrossingIntoRegion;
|
||||||
|
|
|
@ -38,6 +38,6 @@ namespace OpenSim.Framework
|
||||||
string ExtraToXmlString();
|
string ExtraToXmlString();
|
||||||
void ExtraFromXmlString(string xmlstr);
|
void ExtraFromXmlString(string xmlstr);
|
||||||
string GetStateSnapshot();
|
string GetStateSnapshot();
|
||||||
void SetState(string xmlstr, UUID regionID);
|
void SetState(string xmlstr, IScene s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,6 @@ namespace OpenSim.Framework
|
||||||
private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate;
|
private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate;
|
||||||
private CloseAgentConnection handlerCloseAgentConnection = null; // OnCloseAgentConnection;
|
private CloseAgentConnection handlerCloseAgentConnection = null; // OnCloseAgentConnection;
|
||||||
private GenericCall2 handlerExpectChildAgent = null; // OnExpectChildAgent;
|
private GenericCall2 handlerExpectChildAgent = null; // OnExpectChildAgent;
|
||||||
private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim;
|
|
||||||
private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser
|
private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser
|
||||||
private UpdateNeighbours handlerNeighboursUpdate = null; // OnNeighboursUpdate;
|
private UpdateNeighbours handlerNeighboursUpdate = null; // OnNeighboursUpdate;
|
||||||
private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion;
|
private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion;
|
||||||
|
@ -53,7 +52,6 @@ namespace OpenSim.Framework
|
||||||
#region IRegionCommsListener Members
|
#region IRegionCommsListener Members
|
||||||
|
|
||||||
public event ExpectUserDelegate OnExpectUser;
|
public event ExpectUserDelegate OnExpectUser;
|
||||||
public event ExpectPrimDelegate OnExpectPrim;
|
|
||||||
public event GenericCall2 OnExpectChildAgent;
|
public event GenericCall2 OnExpectChildAgent;
|
||||||
public event AgentCrossing OnAvatarCrossingIntoRegion;
|
public event AgentCrossing OnAvatarCrossingIntoRegion;
|
||||||
public event PrimCrossing OnPrimCrossingIntoRegion;
|
public event PrimCrossing OnPrimCrossingIntoRegion;
|
||||||
|
@ -95,17 +93,6 @@ namespace OpenSim.Framework
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool TriggerExpectPrim(UUID primID, string objData, int XMLMethod)
|
|
||||||
{
|
|
||||||
handlerExpectPrim = OnExpectPrim;
|
|
||||||
if (handlerExpectPrim != null)
|
|
||||||
{
|
|
||||||
handlerExpectPrim(primID, objData, XMLMethod);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual bool TriggerChildAgentUpdate(ChildAgentDataUpdate cAgentData)
|
public virtual bool TriggerChildAgentUpdate(ChildAgentDataUpdate cAgentData)
|
||||||
{
|
{
|
||||||
handlerChildAgentUpdate = OnChildAgentUpdate;
|
handlerChildAgentUpdate = OnChildAgentUpdate;
|
||||||
|
@ -128,18 +115,6 @@ namespace OpenSim.Framework
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool TriggerExpectPrimCrossing(UUID primID, Vector3 position,
|
|
||||||
bool isPhysical)
|
|
||||||
{
|
|
||||||
handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion;
|
|
||||||
if (handlerPrimCrossingIntoRegion != null)
|
|
||||||
{
|
|
||||||
handlerPrimCrossingIntoRegion(primID, position, isPhysical);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual bool TriggerAcknowledgeAgentCrossed(UUID agentID)
|
public virtual bool TriggerAcknowledgeAgentCrossed(UUID agentID)
|
||||||
{
|
{
|
||||||
handlerAcknowledgeAgentCrossed = OnAcknowledgeAgentCrossed;
|
handlerAcknowledgeAgentCrossed = OnAcknowledgeAgentCrossed;
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace OpenSim
|
||||||
{
|
{
|
||||||
public class VersionInfo
|
public class VersionInfo
|
||||||
{
|
{
|
||||||
private const string VERSION_NUMBER = "0.6.8";
|
private const string VERSION_NUMBER = "0.6.9-CM";
|
||||||
private const Flavour VERSION_FLAVOUR = Flavour.Dev;
|
private const Flavour VERSION_FLAVOUR = Flavour.Dev;
|
||||||
|
|
||||||
public enum Flavour
|
public enum Flavour
|
||||||
|
|
|
@ -27,9 +27,12 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Reflection;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.Xml.Schema;
|
using System.Xml.Schema;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
|
using log4net;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
|
|
||||||
namespace OpenSim.Framework
|
namespace OpenSim.Framework
|
||||||
|
@ -45,6 +48,105 @@ namespace OpenSim.Framework
|
||||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private static XmlSerializer tiiSerializer = new XmlSerializer(typeof (TaskInventoryItem));
|
private static XmlSerializer tiiSerializer = new XmlSerializer(typeof (TaskInventoryItem));
|
||||||
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
|
private Thread LockedByThread;
|
||||||
|
/// <value>
|
||||||
|
/// An advanced lock for inventory data
|
||||||
|
/// </value>
|
||||||
|
private System.Threading.ReaderWriterLockSlim m_itemLock = new System.Threading.ReaderWriterLockSlim();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Are we readlocked by the calling thread?
|
||||||
|
/// </summary>
|
||||||
|
public bool IsReadLockedByMe()
|
||||||
|
{
|
||||||
|
if (m_itemLock.RecursiveReadCount > 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Lock our inventory list for reading (many can read, one can write)
|
||||||
|
/// </summary>
|
||||||
|
public void LockItemsForRead(bool locked)
|
||||||
|
{
|
||||||
|
if (locked)
|
||||||
|
{
|
||||||
|
if (m_itemLock.IsWriteLockHeld && LockedByThread != null)
|
||||||
|
{
|
||||||
|
if (!LockedByThread.IsAlive)
|
||||||
|
{
|
||||||
|
//Locked by dead thread, reset.
|
||||||
|
m_itemLock = new System.Threading.ReaderWriterLockSlim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_itemLock.RecursiveReadCount > 0)
|
||||||
|
{
|
||||||
|
m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
|
||||||
|
m_itemLock.ExitReadLock();
|
||||||
|
}
|
||||||
|
if (m_itemLock.RecursiveWriteCount > 0)
|
||||||
|
{
|
||||||
|
m_log.Error("[TaskInventoryDictionary] Recursive write lock requested. This should not happen and means something needs to be fixed.");
|
||||||
|
m_itemLock.ExitWriteLock();
|
||||||
|
}
|
||||||
|
|
||||||
|
while (!m_itemLock.TryEnterReadLock(60000))
|
||||||
|
{
|
||||||
|
m_log.Error("Thread lock detected while trying to aquire READ lock in TaskInventoryDictionary. Locked by thread " + LockedByThread.Name + ". I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
|
||||||
|
if (m_itemLock.IsWriteLockHeld)
|
||||||
|
{
|
||||||
|
m_itemLock = new System.Threading.ReaderWriterLockSlim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_itemLock.ExitReadLock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Lock our inventory list for writing (many can read, one can write)
|
||||||
|
/// </summary>
|
||||||
|
public void LockItemsForWrite(bool locked)
|
||||||
|
{
|
||||||
|
if (locked)
|
||||||
|
{
|
||||||
|
//Enter a write lock, wait indefinately for one to open.
|
||||||
|
if (m_itemLock.RecursiveReadCount > 0)
|
||||||
|
{
|
||||||
|
m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
|
||||||
|
m_itemLock.ExitReadLock();
|
||||||
|
}
|
||||||
|
if (m_itemLock.RecursiveWriteCount > 0)
|
||||||
|
{
|
||||||
|
m_log.Error("[TaskInventoryDictionary] Recursive write lock requested. This should not happen and means something needs to be fixed.");
|
||||||
|
m_itemLock.ExitWriteLock();
|
||||||
|
}
|
||||||
|
while (!m_itemLock.TryEnterWriteLock(60000))
|
||||||
|
{
|
||||||
|
m_log.Error("Thread lock detected while trying to aquire WRITE lock in TaskInventoryDictionary. Locked by thread " + LockedByThread.Name + ". I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
|
||||||
|
if (m_itemLock.IsWriteLockHeld)
|
||||||
|
{
|
||||||
|
m_itemLock = new System.Threading.ReaderWriterLockSlim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LockedByThread = Thread.CurrentThread;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_itemLock.ExitWriteLock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#region ICloneable Members
|
#region ICloneable Members
|
||||||
|
|
||||||
|
@ -52,13 +154,12 @@ namespace OpenSim.Framework
|
||||||
{
|
{
|
||||||
TaskInventoryDictionary clone = new TaskInventoryDictionary();
|
TaskInventoryDictionary clone = new TaskInventoryDictionary();
|
||||||
|
|
||||||
lock (this)
|
m_itemLock.EnterReadLock();
|
||||||
|
foreach (UUID uuid in Keys)
|
||||||
{
|
{
|
||||||
foreach (UUID uuid in Keys)
|
clone.Add(uuid, (TaskInventoryItem) this[uuid].Clone());
|
||||||
{
|
|
||||||
clone.Add(uuid, (TaskInventoryItem) this[uuid].Clone());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
m_itemLock.ExitReadLock();
|
||||||
|
|
||||||
return clone;
|
return clone;
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,8 @@ namespace OpenSim.Framework.Tests
|
||||||
cachedItem.Store(foo);
|
cachedItem.Store(foo);
|
||||||
cache.Store(cacheItemUUID.ToString(), cachedItem);
|
cache.Store(cacheItemUUID.ToString(), cachedItem);
|
||||||
|
|
||||||
object citem = cache.Get(cacheItemUUID.ToString());
|
cache.Get(cacheItemUUID.ToString());
|
||||||
|
//object citem = cache.Get(cacheItemUUID.ToString());
|
||||||
//Assert.That(citem == null, "Item should not be in Cache because the expiry time was before now");
|
//Assert.That(citem == null, "Item should not be in Cache because the expiry time was before now");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,7 +95,8 @@ namespace OpenSim.Framework.Tests
|
||||||
cachedItem.Store(foo);
|
cachedItem.Store(foo);
|
||||||
cache.Store(cacheItemUUID.ToString(), cachedItem);
|
cache.Store(cacheItemUUID.ToString(), cachedItem);
|
||||||
cache.Invalidate(ImmediateExpiryUUID.ToString());
|
cache.Invalidate(ImmediateExpiryUUID.ToString());
|
||||||
object citem = cache.Get(cacheItemUUID.ToString());
|
cache.Get(cacheItemUUID.ToString());
|
||||||
|
//object citem = cache.Get(cacheItemUUID.ToString());
|
||||||
//Assert.That(citem == null, "Item should not be in Cache because we manually invalidated it");
|
//Assert.That(citem == null, "Item should not be in Cache because we manually invalidated it");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -990,19 +990,19 @@ namespace OpenSim.Framework
|
||||||
{
|
{
|
||||||
string os = String.Empty;
|
string os = String.Empty;
|
||||||
|
|
||||||
if (Environment.OSVersion.Platform != PlatformID.Unix)
|
// if (Environment.OSVersion.Platform != PlatformID.Unix)
|
||||||
{
|
// {
|
||||||
os = Environment.OSVersion.ToString();
|
// os = Environment.OSVersion.ToString();
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
os = ReadEtcIssue();
|
// os = ReadEtcIssue();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (os.Length > 45)
|
// if (os.Length > 45)
|
||||||
{
|
// {
|
||||||
os = os.Substring(0, 45);
|
// os = os.Substring(0, 45);
|
||||||
}
|
// }
|
||||||
|
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace OpenSim
|
||||||
{
|
{
|
||||||
public class HGCommands
|
public class HGCommands
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
public static Scene CreateScene(RegionInfo regionInfo, AgentCircuitManager circuitManager, CommunicationsManager m_commsManager,
|
public static Scene CreateScene(RegionInfo regionInfo, AgentCircuitManager circuitManager, CommunicationsManager m_commsManager,
|
||||||
StorageManager storageManager, ModuleLoader m_moduleLoader, ConfigSettings m_configSettings, OpenSimConfigSource m_config, string m_version)
|
StorageManager storageManager, ModuleLoader m_moduleLoader, ConfigSettings m_configSettings, OpenSimConfigSource m_config, string m_version)
|
||||||
|
|
|
@ -232,7 +232,7 @@ namespace OpenSim
|
||||||
"Save named prim to XML2", SavePrimsXml2);
|
"Save named prim to XML2", SavePrimsXml2);
|
||||||
|
|
||||||
m_console.Commands.AddCommand("region", false, "load oar",
|
m_console.Commands.AddCommand("region", false, "load oar",
|
||||||
"load oar <oar name>",
|
"load oar [--merge] <oar name>",
|
||||||
"Load a region's data from OAR archive", LoadOar);
|
"Load a region's data from OAR archive", LoadOar);
|
||||||
|
|
||||||
m_console.Commands.AddCommand("region", false, "save oar",
|
m_console.Commands.AddCommand("region", false, "save oar",
|
||||||
|
@ -1294,14 +1294,7 @@ namespace OpenSim
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (cmdparams.Length > 2)
|
m_sceneManager.LoadArchiveToCurrentScene(cmdparams);
|
||||||
{
|
|
||||||
m_sceneManager.LoadArchiveToCurrentScene(cmdparams[2]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_sceneManager.LoadArchiveToCurrentScene(DEFAULT_OAR_BACKUP_FILENAME);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -1315,14 +1308,7 @@ namespace OpenSim
|
||||||
/// <param name="cmdparams"></param>
|
/// <param name="cmdparams"></param>
|
||||||
protected void SaveOar(string module, string[] cmdparams)
|
protected void SaveOar(string module, string[] cmdparams)
|
||||||
{
|
{
|
||||||
if (cmdparams.Length > 2)
|
m_sceneManager.SaveCurrentSceneToArchive(cmdparams);
|
||||||
{
|
|
||||||
m_sceneManager.SaveCurrentSceneToArchive(cmdparams[2]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_sceneManager.SaveCurrentSceneToArchive(DEFAULT_OAR_BACKUP_FILENAME);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string CombineParams(string[] commandParams, int pos)
|
private static string CombineParams(string[] commandParams, int pos)
|
||||||
|
|
|
@ -75,11 +75,6 @@ namespace OpenSim
|
||||||
/// </value>
|
/// </value>
|
||||||
protected const string DEFAULT_PRIM_BACKUP_FILENAME = "prim-backup.xml";
|
protected const string DEFAULT_PRIM_BACKUP_FILENAME = "prim-backup.xml";
|
||||||
|
|
||||||
/// <value>
|
|
||||||
/// The file used to load and save an opensimulator archive if no filename has been specified
|
|
||||||
/// </value>
|
|
||||||
protected const string DEFAULT_OAR_BACKUP_FILENAME = "region.oar";
|
|
||||||
|
|
||||||
public ConfigSettings ConfigurationSettings
|
public ConfigSettings ConfigurationSettings
|
||||||
{
|
{
|
||||||
get { return m_configSettings; }
|
get { return m_configSettings; }
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -49,7 +49,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||||
private int m_shoutdistance = 100;
|
private int m_shoutdistance = 100;
|
||||||
private int m_whisperdistance = 10;
|
private int m_whisperdistance = 10;
|
||||||
private List<Scene> m_scenes = new List<Scene>();
|
private List<Scene> m_scenes = new List<Scene>();
|
||||||
|
private string m_adminPrefix = "";
|
||||||
internal object m_syncy = new object();
|
internal object m_syncy = new object();
|
||||||
|
|
||||||
internal IConfig m_config;
|
internal IConfig m_config;
|
||||||
|
@ -57,25 +57,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||||
#region ISharedRegionModule Members
|
#region ISharedRegionModule Members
|
||||||
public virtual void Initialise(IConfigSource config)
|
public virtual void Initialise(IConfigSource config)
|
||||||
{
|
{
|
||||||
|
|
||||||
m_config = config.Configs["Chat"];
|
m_config = config.Configs["Chat"];
|
||||||
|
|
||||||
if (null == m_config)
|
if (null == m_config)
|
||||||
{
|
{
|
||||||
m_log.Info("[CHAT]: no config found, plugin disabled");
|
m_log.Info("[CHAT]: no config found, plugin disabled");
|
||||||
|
m_enabled = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_config.GetBoolean("enabled", false))
|
if (!m_config.GetBoolean("enabled", true))
|
||||||
{
|
{
|
||||||
m_log.Info("[CHAT]: plugin disabled by configuration");
|
m_log.Info("[CHAT]: plugin disabled by configuration");
|
||||||
|
m_enabled = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_enabled = true;
|
|
||||||
|
|
||||||
m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance);
|
m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance);
|
||||||
m_saydistance = config.Configs["Chat"].GetInt("say_distance", m_saydistance);
|
m_saydistance = config.Configs["Chat"].GetInt("say_distance", m_saydistance);
|
||||||
m_shoutdistance = config.Configs["Chat"].GetInt("shout_distance", m_shoutdistance);
|
m_shoutdistance = config.Configs["Chat"].GetInt("shout_distance", m_shoutdistance);
|
||||||
|
m_adminPrefix = config.Configs["Chat"].GetString("admin_prefix", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void AddRegion(Scene scene)
|
public virtual void AddRegion(Scene scene)
|
||||||
|
@ -185,6 +186,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||||
protected virtual void DeliverChatToAvatars(ChatSourceType sourceType, OSChatMessage c)
|
protected virtual void DeliverChatToAvatars(ChatSourceType sourceType, OSChatMessage c)
|
||||||
{
|
{
|
||||||
string fromName = c.From;
|
string fromName = c.From;
|
||||||
|
string fromNamePrefix = "";
|
||||||
UUID fromID = UUID.Zero;
|
UUID fromID = UUID.Zero;
|
||||||
string message = c.Message;
|
string message = c.Message;
|
||||||
IScene scene = c.Scene;
|
IScene scene = c.Scene;
|
||||||
|
@ -207,7 +209,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||||
fromPos = avatar.AbsolutePosition;
|
fromPos = avatar.AbsolutePosition;
|
||||||
fromName = avatar.Name;
|
fromName = avatar.Name;
|
||||||
fromID = c.Sender.AgentId;
|
fromID = c.Sender.AgentId;
|
||||||
|
if (avatar.GodLevel > 200)
|
||||||
|
{
|
||||||
|
fromNamePrefix = m_adminPrefix;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ChatSourceType.Object:
|
case ChatSourceType.Object:
|
||||||
|
@ -227,7 +232,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||||
s.ForEachScenePresence(
|
s.ForEachScenePresence(
|
||||||
delegate(ScenePresence presence)
|
delegate(ScenePresence presence)
|
||||||
{
|
{
|
||||||
TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType);
|
TrySendChatMessage(presence, fromPos, regionPos, fromID, fromNamePrefix+fromName, c.Type, message, sourceType);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -266,25 +271,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||||
}
|
}
|
||||||
|
|
||||||
// m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType);
|
// m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType);
|
||||||
|
if (c.Scene != null)
|
||||||
|
{
|
||||||
|
((Scene)c.Scene).ForEachScenePresence
|
||||||
|
(
|
||||||
|
delegate(ScenePresence presence)
|
||||||
|
{
|
||||||
|
// ignore chat from child agents
|
||||||
|
if (presence.IsChildAgent) return;
|
||||||
|
|
||||||
((Scene)c.Scene).ForEachScenePresence(
|
IClientAPI client = presence.ControllingClient;
|
||||||
delegate(ScenePresence presence)
|
|
||||||
{
|
|
||||||
// ignore chat from child agents
|
|
||||||
if (presence.IsChildAgent) return;
|
|
||||||
|
|
||||||
IClientAPI client = presence.ControllingClient;
|
// don't forward SayOwner chat from objects to
|
||||||
|
// non-owner agents
|
||||||
|
if ((c.Type == ChatTypeEnum.Owner) &&
|
||||||
|
(null != c.SenderObject) &&
|
||||||
|
(((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId))
|
||||||
|
return;
|
||||||
|
|
||||||
// don't forward SayOwner chat from objects to
|
client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID,
|
||||||
// non-owner agents
|
(byte)sourceType, (byte)ChatAudibleLevel.Fully);
|
||||||
if ((c.Type == ChatTypeEnum.Owner) &&
|
}
|
||||||
(null != c.SenderObject) &&
|
);
|
||||||
(((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId))
|
}
|
||||||
return;
|
|
||||||
|
|
||||||
client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID,
|
|
||||||
(byte)sourceType, (byte)ChatAudibleLevel.Fully);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -121,45 +121,51 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
|
|
||||||
byte[] data;
|
byte[] data;
|
||||||
TarArchiveReader.TarEntryType entryType;
|
TarArchiveReader.TarEntryType entryType;
|
||||||
while ((data = archive.ReadEntry(out filePath, out entryType)) != null)
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
|
while ((data = archive.ReadEntry(out filePath, out entryType)) != null)
|
||||||
{
|
{
|
||||||
if (LoadAsset(filePath, data))
|
if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
|
||||||
successfulAssetRestores++;
|
|
||||||
else
|
|
||||||
failedAssetRestores++;
|
|
||||||
|
|
||||||
if ((successfulAssetRestores) % 50 == 0)
|
|
||||||
m_log.DebugFormat(
|
|
||||||
"[INVENTORY ARCHIVER]: Loaded {0} assets...",
|
|
||||||
successfulAssetRestores);
|
|
||||||
}
|
|
||||||
else if (filePath.StartsWith(ArchiveConstants.INVENTORY_PATH))
|
|
||||||
{
|
|
||||||
InventoryFolderBase foundFolder
|
|
||||||
= ReplicateArchivePathToUserInventory(
|
|
||||||
filePath, TarArchiveReader.TarEntryType.TYPE_DIRECTORY == entryType,
|
|
||||||
rootDestinationFolder, foldersCreated, nodesLoaded);
|
|
||||||
|
|
||||||
if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY != entryType)
|
|
||||||
{
|
{
|
||||||
InventoryItemBase item = LoadItem(data, foundFolder);
|
if (LoadAsset(filePath, data))
|
||||||
|
successfulAssetRestores++;
|
||||||
|
else
|
||||||
|
failedAssetRestores++;
|
||||||
|
|
||||||
if (item != null)
|
if ((successfulAssetRestores) % 50 == 0)
|
||||||
|
m_log.DebugFormat(
|
||||||
|
"[INVENTORY ARCHIVER]: Loaded {0} assets...",
|
||||||
|
successfulAssetRestores);
|
||||||
|
}
|
||||||
|
else if (filePath.StartsWith(ArchiveConstants.INVENTORY_PATH))
|
||||||
|
{
|
||||||
|
InventoryFolderBase foundFolder
|
||||||
|
= ReplicateArchivePathToUserInventory(
|
||||||
|
filePath, TarArchiveReader.TarEntryType.TYPE_DIRECTORY == entryType,
|
||||||
|
rootDestinationFolder, foldersCreated, nodesLoaded);
|
||||||
|
|
||||||
|
if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY != entryType)
|
||||||
{
|
{
|
||||||
successfulItemRestores++;
|
InventoryItemBase item = LoadItem(data, foundFolder);
|
||||||
|
|
||||||
// If we're loading an item directly into the given destination folder then we need to record
|
if (item != null)
|
||||||
// it separately from any loaded root folders
|
{
|
||||||
if (rootDestinationFolder == foundFolder)
|
successfulItemRestores++;
|
||||||
nodesLoaded.Add(item);
|
|
||||||
|
// If we're loading an item directly into the given destination folder then we need to record
|
||||||
|
// it separately from any loaded root folders
|
||||||
|
if (rootDestinationFolder == foundFolder)
|
||||||
|
nodesLoaded.Add(item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
archive.Close();
|
{
|
||||||
|
archive.Close();
|
||||||
|
}
|
||||||
|
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[INVENTORY ARCHIVER]: Successfully loaded {0} assets with {1} failures",
|
"[INVENTORY ARCHIVER]: Successfully loaded {0} assets with {1} failures",
|
||||||
|
@ -342,9 +348,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
|
|
||||||
UUID ospResolvedId = OspResolver.ResolveOspa(item.CreatorId, m_scene.CommsManager);
|
UUID ospResolvedId = OspResolver.ResolveOspa(item.CreatorId, m_scene.CommsManager);
|
||||||
if (UUID.Zero != ospResolvedId)
|
if (UUID.Zero != ospResolvedId)
|
||||||
|
{
|
||||||
item.CreatorIdAsUuid = ospResolvedId;
|
item.CreatorIdAsUuid = ospResolvedId;
|
||||||
|
|
||||||
|
// XXX: For now, don't preserve the OSPA in the creator id (which actually gets persisted to the
|
||||||
|
// database). Instead, replace with the UUID that we found.
|
||||||
|
item.CreatorId = ospResolvedId.ToString();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
item.CreatorIdAsUuid = m_userInfo.UserProfile.ID;
|
item.CreatorIdAsUuid = m_userInfo.UserProfile.ID;
|
||||||
|
}
|
||||||
|
|
||||||
item.Owner = m_userInfo.UserProfile.ID;
|
item.Owner = m_userInfo.UserProfile.ID;
|
||||||
|
|
||||||
|
|
|
@ -118,18 +118,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
|
|
||||||
protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids)
|
protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids)
|
||||||
{
|
{
|
||||||
// We're almost done. Just need to write out the control file now
|
|
||||||
m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile());
|
|
||||||
m_log.InfoFormat("[ARCHIVER]: Added control file to archive.");
|
|
||||||
|
|
||||||
Exception reportedException = null;
|
Exception reportedException = null;
|
||||||
bool succeeded = true;
|
bool succeeded = true;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
// We're almost done. Just need to write out the control file now
|
||||||
|
m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile());
|
||||||
|
m_log.InfoFormat("[ARCHIVER]: Added control file to archive.");
|
||||||
|
|
||||||
m_archiveWriter.Close();
|
m_archiveWriter.Close();
|
||||||
}
|
}
|
||||||
catch (IOException e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_saveStream.Close();
|
m_saveStream.Close();
|
||||||
reportedException = e;
|
reportedException = e;
|
||||||
|
@ -261,29 +261,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
//inventoryItem = m_userInfo.RootFolder.FindItemByPath(m_invPath);
|
//inventoryItem = m_userInfo.RootFolder.FindItemByPath(m_invPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_archiveWriter = new TarArchiveWriter(m_saveStream);
|
if (null == inventoryFolder && null == inventoryItem)
|
||||||
|
|
||||||
if (inventoryFolder != null)
|
|
||||||
{
|
|
||||||
m_log.DebugFormat(
|
|
||||||
"[INVENTORY ARCHIVER]: Found folder {0} {1} at {2}",
|
|
||||||
inventoryFolder.Name, inventoryFolder.ID, m_invPath);
|
|
||||||
|
|
||||||
//recurse through all dirs getting dirs and files
|
|
||||||
SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !foundStar);
|
|
||||||
}
|
|
||||||
else if (inventoryItem != null)
|
|
||||||
{
|
|
||||||
m_log.DebugFormat(
|
|
||||||
"[INVENTORY ARCHIVER]: Found item {0} {1} at {2}",
|
|
||||||
inventoryItem.Name, inventoryItem.ID, m_invPath);
|
|
||||||
|
|
||||||
SaveInvItem(inventoryItem, ArchiveConstants.INVENTORY_PATH);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
// We couldn't find the path indicated
|
// We couldn't find the path indicated
|
||||||
m_saveStream.Close();
|
|
||||||
string errorMessage = string.Format("Aborted save. Could not find inventory path {0}", m_invPath);
|
string errorMessage = string.Format("Aborted save. Could not find inventory path {0}", m_invPath);
|
||||||
m_log.ErrorFormat("[INVENTORY ARCHIVER]: {0}", errorMessage);
|
m_log.ErrorFormat("[INVENTORY ARCHIVER]: {0}", errorMessage);
|
||||||
m_module.TriggerInventoryArchiveSaved(
|
m_module.TriggerInventoryArchiveSaved(
|
||||||
|
@ -292,8 +272,36 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't put all this profile information into the archive right now.
|
m_archiveWriter = new TarArchiveWriter(m_saveStream);
|
||||||
//SaveUsers();
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (inventoryFolder != null)
|
||||||
|
{
|
||||||
|
m_log.DebugFormat(
|
||||||
|
"[INVENTORY ARCHIVER]: Found folder {0} {1} at {2}",
|
||||||
|
inventoryFolder.Name, inventoryFolder.ID, m_invPath);
|
||||||
|
|
||||||
|
//recurse through all dirs getting dirs and files
|
||||||
|
SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !foundStar);
|
||||||
|
}
|
||||||
|
else if (inventoryItem != null)
|
||||||
|
{
|
||||||
|
m_log.DebugFormat(
|
||||||
|
"[INVENTORY ARCHIVER]: Found item {0} {1} at {2}",
|
||||||
|
inventoryItem.Name, inventoryItem.ID, m_invPath);
|
||||||
|
|
||||||
|
SaveInvItem(inventoryItem, ArchiveConstants.INVENTORY_PATH);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't put all this profile information into the archive right now.
|
||||||
|
//SaveUsers();
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
m_archiveWriter.Close();
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
new AssetsRequest(
|
new AssetsRequest(
|
||||||
new AssetsArchiver(m_archiveWriter), m_assetUuids.Keys,
|
new AssetsArchiver(m_archiveWriter), m_assetUuids.Keys,
|
||||||
|
|
|
@ -92,12 +92,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
scene.AddCommand(
|
scene.AddCommand(
|
||||||
this, "load iar",
|
this, "load iar",
|
||||||
"load iar <first> <last> <inventory path> <password> [<archive path>]",
|
"load iar <first> <last> <inventory path> <password> [<archive path>]",
|
||||||
"Load user inventory archive. EXPERIMENTAL", HandleLoadInvConsoleCommand);
|
"Load user inventory archive.", HandleLoadInvConsoleCommand);
|
||||||
|
|
||||||
scene.AddCommand(
|
scene.AddCommand(
|
||||||
this, "save iar",
|
this, "save iar",
|
||||||
"save iar <first> <last> <inventory path> <password> [<archive path>]",
|
"save iar <first> <last> <inventory path> <password> [<archive path>]",
|
||||||
"Save user inventory archive. EXPERIMENTAL", HandleSaveInvConsoleCommand);
|
"Save user inventory archive.", HandleSaveInvConsoleCommand);
|
||||||
|
|
||||||
m_aScene = scene;
|
m_aScene = scene;
|
||||||
}
|
}
|
||||||
|
@ -280,7 +280,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
string savePath = (cmdparams.Length > 6 ? cmdparams[6] : DEFAULT_INV_BACKUP_FILENAME);
|
string savePath = (cmdparams.Length > 6 ? cmdparams[6] : DEFAULT_INV_BACKUP_FILENAME);
|
||||||
|
|
||||||
m_log.InfoFormat(
|
m_log.InfoFormat(
|
||||||
"[INVENTORY ARCHIVER]: Saving archive {0} from inventory path {1} for {2} {3}",
|
"[INVENTORY ARCHIVER]: Saving archive {0} using inventory path {1} for {2} {3}",
|
||||||
savePath, invPath, firstName, lastName);
|
savePath, invPath, firstName, lastName);
|
||||||
|
|
||||||
Guid id = Guid.NewGuid();
|
Guid id = Guid.NewGuid();
|
||||||
|
|
|
@ -259,9 +259,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||||
= InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, item1Name);
|
= InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, item1Name);
|
||||||
|
|
||||||
Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1");
|
Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1");
|
||||||
|
|
||||||
|
// We have to disable this check since loaded items that did find users via OSPA resolution are now only storing the
|
||||||
|
// UUID, not the OSPA itself.
|
||||||
|
// Assert.That(
|
||||||
|
// foundItem1.CreatorId, Is.EqualTo(item1.CreatorId),
|
||||||
|
// "Loaded item non-uuid creator doesn't match original");
|
||||||
Assert.That(
|
Assert.That(
|
||||||
foundItem1.CreatorId, Is.EqualTo(item1.CreatorId),
|
foundItem1.CreatorId, Is.EqualTo(userItemCreatorUuid.ToString()),
|
||||||
"Loaded item non-uuid creator doesn't match original");
|
"Loaded item non-uuid creator doesn't match original");
|
||||||
|
|
||||||
Assert.That(
|
Assert.That(
|
||||||
foundItem1.CreatorIdAsUuid, Is.EqualTo(userItemCreatorUuid),
|
foundItem1.CreatorIdAsUuid, Is.EqualTo(userItemCreatorUuid),
|
||||||
"Loaded item uuid creator doesn't match original");
|
"Loaded item uuid creator doesn't match original");
|
||||||
|
|
|
@ -389,7 +389,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||||
{
|
{
|
||||||
// Check if this is ours to handle
|
// Check if this is ours to handle
|
||||||
//
|
//
|
||||||
m_log.Info("OnFridInstantMessage");
|
//m_log.Info("OnFridInstantMessage");
|
||||||
if (msg.dialog != (byte) InstantMessageDialog.InventoryOffered)
|
if (msg.dialog != (byte) InstantMessageDialog.InventoryOffered)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -263,8 +263,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
|
||||||
{
|
{
|
||||||
// We need to make a local copy of the object
|
// We need to make a local copy of the object
|
||||||
ISceneObject sogClone = sog.CloneForNewScene();
|
ISceneObject sogClone = sog.CloneForNewScene();
|
||||||
sogClone.SetState(sog.GetStateSnapshot(),
|
sogClone.SetState(sog.GetStateSnapshot(), s);
|
||||||
s.RegionInfo.RegionID);
|
|
||||||
return s.IncomingCreateObject(sogClone);
|
return s.IncomingCreateObject(sogClone);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -294,15 +293,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
|
||||||
|
|
||||||
#region Misc
|
#region Misc
|
||||||
|
|
||||||
public UUID GetRegionID(ulong regionhandle)
|
public Scene GetScene(ulong regionhandle)
|
||||||
{
|
{
|
||||||
foreach (Scene s in m_sceneList)
|
foreach (Scene s in m_sceneList)
|
||||||
{
|
{
|
||||||
if (s.RegionInfo.RegionHandle == regionhandle)
|
if (s.RegionInfo.RegionHandle == regionhandle)
|
||||||
return s.RegionInfo.RegionID;
|
return s;
|
||||||
}
|
}
|
||||||
// ? weird. should not happen
|
// ? weird. should not happen
|
||||||
return m_sceneList[0].RegionInfo.RegionID;
|
return m_sceneList[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsLocalRegion(ulong regionhandle)
|
public bool IsLocalRegion(ulong regionhandle)
|
||||||
|
|
|
@ -641,7 +641,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
|
||||||
if (args["extra"] != null)
|
if (args["extra"] != null)
|
||||||
extraStr = args["extra"].AsString();
|
extraStr = args["extra"].AsString();
|
||||||
|
|
||||||
UUID regionID = m_localBackend.GetRegionID(regionhandle);
|
IScene s = m_localBackend.GetScene(regionhandle);
|
||||||
SceneObjectGroup sog = null;
|
SceneObjectGroup sog = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -663,7 +663,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
sog.SetState(stateXmlStr, regionID);
|
sog.SetState(stateXmlStr, s);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -695,8 +695,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
|
||||||
if (args["itemid"] != null)
|
if (args["itemid"] != null)
|
||||||
itemID = args["itemid"].AsUUID();
|
itemID = args["itemid"].AsUUID();
|
||||||
|
|
||||||
//UUID regionID = m_localBackend.GetRegionID(regionhandle);
|
|
||||||
|
|
||||||
// This is the meaning of PUT object
|
// This is the meaning of PUT object
|
||||||
bool result = m_localBackend.SendCreateObject(regionhandle, userID, itemID);
|
bool result = m_localBackend.SendCreateObject(regionhandle, userID, itemID);
|
||||||
|
|
||||||
|
|
|
@ -104,13 +104,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
List<string> serialisedParcels = new List<string>();
|
List<string> serialisedParcels = new List<string>();
|
||||||
string filePath = "NONE";
|
string filePath = "NONE";
|
||||||
|
|
||||||
|
TarArchiveReader archive = new TarArchiveReader(m_loadStream);
|
||||||
|
byte[] data;
|
||||||
|
TarArchiveReader.TarEntryType entryType;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
TarArchiveReader archive = new TarArchiveReader(m_loadStream);
|
|
||||||
|
|
||||||
byte[] data;
|
|
||||||
TarArchiveReader.TarEntryType entryType;
|
|
||||||
|
|
||||||
while ((data = archive.ReadEntry(out filePath, out entryType)) != null)
|
while ((data = archive.ReadEntry(out filePath, out entryType)) != null)
|
||||||
{
|
{
|
||||||
//m_log.DebugFormat(
|
//m_log.DebugFormat(
|
||||||
|
@ -152,8 +151,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
}
|
}
|
||||||
|
|
||||||
//m_log.Debug("[ARCHIVER]: Reached end of archive");
|
//m_log.Debug("[ARCHIVER]: Reached end of archive");
|
||||||
|
|
||||||
archive.Close();
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -163,6 +160,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
m_scene.EventManager.TriggerOarFileLoaded(m_requestId, m_errorMessage);
|
m_scene.EventManager.TriggerOarFileLoaded(m_requestId, m_errorMessage);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
archive.Close();
|
||||||
|
}
|
||||||
|
|
||||||
m_log.InfoFormat("[ARCHIVER]: Restored {0} assets", successfulAssetRestores);
|
m_log.InfoFormat("[ARCHIVER]: Restored {0} assets", successfulAssetRestores);
|
||||||
|
|
||||||
|
@ -246,21 +247,20 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
// Fix ownership/creator of inventory items
|
// Fix ownership/creator of inventory items
|
||||||
// Not doing so results in inventory items
|
// Not doing so results in inventory items
|
||||||
// being no copy/no mod for everyone
|
// being no copy/no mod for everyone
|
||||||
lock (part.TaskInventory)
|
part.TaskInventory.LockItemsForRead(true);
|
||||||
|
TaskInventoryDictionary inv = part.TaskInventory;
|
||||||
|
foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv)
|
||||||
{
|
{
|
||||||
TaskInventoryDictionary inv = part.TaskInventory;
|
if (!ResolveUserUuid(kvp.Value.OwnerID))
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv)
|
|
||||||
{
|
{
|
||||||
if (!ResolveUserUuid(kvp.Value.OwnerID))
|
kvp.Value.OwnerID = masterAvatarId;
|
||||||
{
|
}
|
||||||
kvp.Value.OwnerID = masterAvatarId;
|
if (!ResolveUserUuid(kvp.Value.CreatorID))
|
||||||
}
|
{
|
||||||
if (!ResolveUserUuid(kvp.Value.CreatorID))
|
kvp.Value.CreatorID = masterAvatarId;
|
||||||
{
|
|
||||||
kvp.Value.CreatorID = masterAvatarId;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
part.TaskInventory.LockItemsForRead(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_scene.AddRestoredSceneObject(sceneObject, true, false))
|
if (m_scene.AddRestoredSceneObject(sceneObject, true, false))
|
||||||
|
|
|
@ -79,6 +79,22 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
|
|
||||||
protected internal void ReceivedAllAssets(
|
protected internal void ReceivedAllAssets(
|
||||||
ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids)
|
ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Save(assetsFoundUuids, assetsNotFoundUuids);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
m_archiveWriter.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
m_log.InfoFormat("[ARCHIVER]: Finished writing out OAR for {0}", m_scene.RegionInfo.RegionName);
|
||||||
|
|
||||||
|
m_scene.EventManager.TriggerOarFileSaved(m_requestId, String.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected internal void Save(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids)
|
||||||
{
|
{
|
||||||
foreach (UUID uuid in assetsNotFoundUuids)
|
foreach (UUID uuid in assetsNotFoundUuids)
|
||||||
{
|
{
|
||||||
|
@ -143,12 +159,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.InfoFormat("[ARCHIVER]: Added scene objects to archive.");
|
m_log.InfoFormat("[ARCHIVER]: Added scene objects to archive.");
|
||||||
|
|
||||||
m_archiveWriter.Close();
|
|
||||||
|
|
||||||
m_log.InfoFormat("[ARCHIVER]: Finished writing out OAR for {0}", m_scene.RegionInfo.RegionName);
|
|
||||||
|
|
||||||
m_scene.EventManager.TriggerOarFileSaved(m_requestId, String.Empty);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -56,6 +56,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor
|
/// Constructor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="scene"></param>
|
||||||
|
/// <param name="savePath">The path to which to save data.</param>
|
||||||
|
/// <param name="requestId">The id associated with this request</param>
|
||||||
|
/// <exception cref="System.IO.IOException">
|
||||||
|
/// If there was a problem opening a stream for the file specified by the savePath
|
||||||
|
/// </exception>
|
||||||
public ArchiveWriteRequestPreparation(Scene scene, string savePath, Guid requestId)
|
public ArchiveWriteRequestPreparation(Scene scene, string savePath, Guid requestId)
|
||||||
{
|
{
|
||||||
m_scene = scene;
|
m_scene = scene;
|
||||||
|
@ -87,6 +93,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
List<EntityBase> entities = m_scene.GetEntities();
|
List<EntityBase> entities = m_scene.GetEntities();
|
||||||
List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
|
List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
|
||||||
|
|
||||||
|
/*
|
||||||
|
foreach (ILandObject lo in m_scene.LandChannel.AllParcels())
|
||||||
|
{
|
||||||
|
if (name == lo.LandData.Name)
|
||||||
|
{
|
||||||
|
// This is the parcel we want
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// Filter entities so that we only have scene objects.
|
// Filter entities so that we only have scene objects.
|
||||||
// FIXME: Would be nicer to have this as a proper list in SceneGraph, since lots of methods
|
// FIXME: Would be nicer to have this as a proper list in SceneGraph, since lots of methods
|
||||||
// end up having to do this
|
// end up having to do this
|
||||||
|
|
|
@ -26,9 +26,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using log4net;
|
using log4net;
|
||||||
|
using NDesk.Options;
|
||||||
using Nini.Config;
|
using Nini.Config;
|
||||||
using OpenSim.Region.Framework.Interfaces;
|
using OpenSim.Region.Framework.Interfaces;
|
||||||
using OpenSim.Region.Framework.Scenes;
|
using OpenSim.Region.Framework.Scenes;
|
||||||
|
@ -45,6 +47,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
|
|
||||||
private Scene m_scene;
|
private Scene m_scene;
|
||||||
|
|
||||||
|
/// <value>
|
||||||
|
/// The file used to load and save an opensimulator archive if no filename has been specified
|
||||||
|
/// </value>
|
||||||
|
protected const string DEFAULT_OAR_BACKUP_FILENAME = "region.oar";
|
||||||
|
|
||||||
public string Name
|
public string Name
|
||||||
{
|
{
|
||||||
get { return "RegionArchiverModule"; }
|
get { return "RegionArchiverModule"; }
|
||||||
|
@ -80,6 +87,48 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Load a whole region from an opensimulator archive.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cmdparams"></param>
|
||||||
|
public void HandleLoadOarConsoleCommand(string module, string[] cmdparams)
|
||||||
|
{
|
||||||
|
bool mergeOar = false;
|
||||||
|
|
||||||
|
OptionSet options = new OptionSet().Add("m|merge", delegate (string v) { mergeOar = v != null; });
|
||||||
|
List<string> mainParams = options.Parse(cmdparams);
|
||||||
|
|
||||||
|
// m_log.DebugFormat("MERGE OAR IS [{0}]", mergeOar);
|
||||||
|
//
|
||||||
|
// foreach (string param in mainParams)
|
||||||
|
// m_log.DebugFormat("GOT PARAM [{0}]", param);
|
||||||
|
|
||||||
|
if (mainParams.Count > 2)
|
||||||
|
{
|
||||||
|
DearchiveRegion(mainParams[2], mergeOar, Guid.Empty);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DearchiveRegion(DEFAULT_OAR_BACKUP_FILENAME, mergeOar, Guid.Empty);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Save a region to a file, including all the assets needed to restore it.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cmdparams"></param>
|
||||||
|
public void HandleSaveOarConsoleCommand(string module, string[] cmdparams)
|
||||||
|
{
|
||||||
|
if (cmdparams.Length > 2)
|
||||||
|
{
|
||||||
|
ArchiveRegion(cmdparams[2]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ArchiveRegion(DEFAULT_OAR_BACKUP_FILENAME);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void ArchiveRegion(string savePath)
|
public void ArchiveRegion(string savePath)
|
||||||
{
|
{
|
||||||
ArchiveRegion(savePath, Guid.Empty);
|
ArchiveRegion(savePath, Guid.Empty);
|
||||||
|
|
|
@ -154,6 +154,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
m_landManagementModule.UpdateLandObject(localID, data);
|
m_landManagementModule.UpdateLandObject(localID, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient)
|
public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient)
|
||||||
{
|
{
|
||||||
if (m_landManagementModule != null)
|
if (m_landManagementModule != null)
|
||||||
|
|
|
@ -67,7 +67,14 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
private const int landArrayMax = ((int)((int)Constants.RegionSize / 4) >= 64) ? (int)((int)Constants.RegionSize / 4) : 64;
|
private const int landArrayMax = ((int)((int)Constants.RegionSize / 4) >= 64) ? (int)((int)Constants.RegionSize / 4) : 64;
|
||||||
#pragma warning restore 0429
|
#pragma warning restore 0429
|
||||||
|
|
||||||
|
/// <value>
|
||||||
|
/// Local land ids at specified region co-ordinates (region size / 4)
|
||||||
|
/// </value>
|
||||||
private readonly int[,] m_landIDList = new int[landArrayMax, landArrayMax];
|
private readonly int[,] m_landIDList = new int[landArrayMax, landArrayMax];
|
||||||
|
|
||||||
|
/// <value>
|
||||||
|
/// Land objects keyed by local id
|
||||||
|
/// </value>
|
||||||
private readonly Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>();
|
private readonly Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>();
|
||||||
|
|
||||||
private bool m_landPrimCountTainted;
|
private bool m_landPrimCountTainted;
|
||||||
|
@ -570,6 +577,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
|
|
||||||
if (x_float > Constants.RegionSize || x_float <= 0 || y_float > Constants.RegionSize || y_float <= 0)
|
if (x_float > Constants.RegionSize || x_float <= 0 || y_float > Constants.RegionSize || y_float <= 0)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
x = Convert.ToInt32(Math.Floor(Convert.ToDouble(x_float) / 4.0));
|
x = Convert.ToInt32(Math.Floor(Convert.ToDouble(x_float) / 4.0));
|
||||||
|
@ -584,6 +592,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
lock (m_landList)
|
lock (m_landList)
|
||||||
{
|
{
|
||||||
// Corner case. If an autoreturn happens during sim startup
|
// Corner case. If an autoreturn happens during sim startup
|
||||||
|
@ -603,6 +612,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
// they happen every time at border crossings
|
// they happen every time at border crossings
|
||||||
throw new Exception("Error: Parcel not found at point " + x + ", " + y);
|
throw new Exception("Error: Parcel not found at point " + x + ", " + y);
|
||||||
}
|
}
|
||||||
|
|
||||||
lock (m_landIDList)
|
lock (m_landIDList)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
@ -184,12 +184,6 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
List<UUID> GetInventoryList();
|
List<UUID> GetInventoryList();
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get the names of the assemblies associated with scripts in this inventory.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
string[] GetScriptAssemblies();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the xml representing the saved states of scripts in this inventory.
|
/// Get the xml representing the saved states of scripts in this inventory.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -197,7 +191,5 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
/// A <see cref="Dictionary`2"/>
|
/// A <see cref="Dictionary`2"/>
|
||||||
/// </returns>
|
/// </returns>
|
||||||
Dictionary<UUID, string> GetScriptStates();
|
Dictionary<UUID, string> GetScriptStates();
|
||||||
|
|
||||||
bool CanBeDeleted();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,27 +33,42 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
{
|
{
|
||||||
public interface ILandChannel
|
public interface ILandChannel
|
||||||
{
|
{
|
||||||
List<ILandObject> ParcelsNearPoint(Vector3 position);
|
/// <summary>
|
||||||
|
/// Get all parcels
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
List<ILandObject> AllParcels();
|
List<ILandObject> AllParcels();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the land object at the specified point
|
/// Get the parcel at the specified point
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="x">Value between 0 - 256 on the x axis of the point</param>
|
/// <param name="x">Value between 0 - 256 on the x axis of the point</param>
|
||||||
/// <param name="y">Value between 0 - 256 on the y axis of the point</param>
|
/// <param name="y">Value between 0 - 256 on the y axis of the point</param>
|
||||||
/// <returns>Land object at the point supplied</returns>
|
/// <returns>Land object at the point supplied</returns>
|
||||||
ILandObject GetLandObject(int x, int y);
|
ILandObject GetLandObject(int x, int y);
|
||||||
|
|
||||||
ILandObject GetLandObject(int localID);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the land object at the specified point
|
/// Get the parcel at the specified point
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="x">Value between 0 - 256 on the x axis of the point</param>
|
/// <param name="x">Value between 0 - 256 on the x axis of the point</param>
|
||||||
/// <param name="y">Value between 0 - 256 on the y axis of the point</param>
|
/// <param name="y">Value between 0 - 256 on the y axis of the point</param>
|
||||||
/// <returns>Land object at the point supplied</returns>
|
/// <returns>Land object at the point supplied</returns>
|
||||||
ILandObject GetLandObject(float x, float y);
|
ILandObject GetLandObject(float x, float y);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get the parcels near the specified point
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="position"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
List<ILandObject> ParcelsNearPoint(Vector3 position);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get the parcel given the land's local id.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="localID"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
ILandObject GetLandObject(int localID);
|
||||||
|
|
||||||
bool IsLandPrimCountTainted();
|
bool IsLandPrimCountTainted();
|
||||||
bool IsForcefulBansAllowed();
|
bool IsForcefulBansAllowed();
|
||||||
void UpdateLandObject(int localID, LandData data);
|
void UpdateLandObject(int localID, LandData data);
|
||||||
|
|
|
@ -35,6 +35,9 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IRegionArchiverModule
|
public interface IRegionArchiverModule
|
||||||
{
|
{
|
||||||
|
void HandleLoadOarConsoleCommand(string module, string[] cmdparams);
|
||||||
|
void HandleSaveOarConsoleCommand(string module, string[] cmdparams);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Archive the region to the given path
|
/// Archive the region to the given path
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -34,9 +34,8 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
{
|
{
|
||||||
string ScriptEngineName { get; }
|
string ScriptEngineName { get; }
|
||||||
|
|
||||||
string GetAssemblyName(UUID itemID);
|
|
||||||
string GetXMLState(UUID itemID);
|
string GetXMLState(UUID itemID);
|
||||||
bool CanBeDeleted(UUID itemID);
|
void SetXMLState(UUID itemID, string xml);
|
||||||
|
|
||||||
bool PostScriptEvent(UUID itemID, string name, Object[] args);
|
bool PostScriptEvent(UUID itemID, string name, Object[] args);
|
||||||
bool PostObjectEvent(UUID itemID, string name, Object[] args);
|
bool PostObjectEvent(UUID itemID, string name, Object[] args);
|
||||||
|
|
|
@ -163,8 +163,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||||
// Check control flags
|
// Check control flags
|
||||||
bool heldForward = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_AT_POS || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS);
|
bool heldForward = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_AT_POS || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS);
|
||||||
bool heldBack = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG);
|
bool heldBack = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG);
|
||||||
bool heldLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS;
|
bool heldLeft = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS);
|
||||||
bool heldRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG;
|
bool heldRight = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG);
|
||||||
//bool heldTurnLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT;
|
//bool heldTurnLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT;
|
||||||
//bool heldTurnRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT;
|
//bool heldTurnRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT;
|
||||||
bool heldUp = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) == AgentManager.ControlFlags.AGENT_CONTROL_UP_POS;
|
bool heldUp = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) == AgentManager.ControlFlags.AGENT_CONTROL_UP_POS;
|
||||||
|
@ -252,8 +252,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||||
else if (m_movementAnimation == "LAND")
|
else if (m_movementAnimation == "LAND")
|
||||||
{
|
{
|
||||||
float landElapsed = (float)(Environment.TickCount - m_animTickFall) / 1000f;
|
float landElapsed = (float)(Environment.TickCount - m_animTickFall) / 1000f;
|
||||||
|
if ((m_animTickFall != 0) && (landElapsed <= FALL_DELAY))
|
||||||
if (landElapsed <= FALL_DELAY)
|
|
||||||
return "LAND";
|
return "LAND";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -131,11 +131,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (left > 0)
|
if (left > 0)
|
||||||
{
|
{
|
||||||
x = m_inventoryDeletes.Dequeue();
|
x = m_inventoryDeletes.Dequeue();
|
||||||
if (!x.objectGroup.CanBeDeleted())
|
|
||||||
{
|
|
||||||
m_inventoryDeletes.Enqueue(x);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[SCENE]: Sending object to user's inventory, {0} item(s) remaining.", left);
|
"[SCENE]: Sending object to user's inventory, {0} item(s) remaining.", left);
|
||||||
|
|
|
@ -840,8 +840,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
public void RemoveTaskInventory(IClientAPI remoteClient, UUID itemID, uint localID)
|
public void RemoveTaskInventory(IClientAPI remoteClient, UUID itemID, uint localID)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = GetSceneObjectPart(localID);
|
SceneObjectPart part = GetSceneObjectPart(localID);
|
||||||
SceneObjectGroup group = part.ParentGroup;
|
SceneObjectGroup group = null;
|
||||||
if (group != null)
|
if (part != null)
|
||||||
|
{
|
||||||
|
group = part.ParentGroup;
|
||||||
|
}
|
||||||
|
if (part != null && group != null)
|
||||||
{
|
{
|
||||||
TaskInventoryItem item = group.GetInventoryItem(localID, itemID);
|
TaskInventoryItem item = group.GetInventoryItem(localID, itemID);
|
||||||
if (item == null)
|
if (item == null)
|
||||||
|
|
|
@ -388,6 +388,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
get { return StatsReporter.getLastReportedSimFPS(); }
|
get { return StatsReporter.getLastReportedSimFPS(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float[] SimulatorStats
|
||||||
|
{
|
||||||
|
get { return StatsReporter.getLastReportedSimStats(); }
|
||||||
|
}
|
||||||
|
|
||||||
public string DefaultScriptEngine
|
public string DefaultScriptEngine
|
||||||
{
|
{
|
||||||
get { return m_defaultScriptEngine; }
|
get { return m_defaultScriptEngine; }
|
||||||
|
@ -618,7 +623,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
startupConfig.GetLong("MaximumTimeBeforePersistenceConsidered", DEFAULT_MAX_TIME_FOR_PERSISTENCE);
|
startupConfig.GetLong("MaximumTimeBeforePersistenceConsidered", DEFAULT_MAX_TIME_FOR_PERSISTENCE);
|
||||||
m_persistAfter *= 10000000;
|
m_persistAfter *= 10000000;
|
||||||
|
|
||||||
m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "DotNetEngine");
|
m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "XEngine");
|
||||||
|
|
||||||
IConfig packetConfig = m_config.Configs["PacketPool"];
|
IConfig packetConfig = m_config.Configs["PacketPool"];
|
||||||
if (packetConfig != null)
|
if (packetConfig != null)
|
||||||
|
@ -872,6 +877,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="seconds">float indicating duration before restart.</param>
|
/// <param name="seconds">float indicating duration before restart.</param>
|
||||||
public virtual void Restart(float seconds)
|
public virtual void Restart(float seconds)
|
||||||
|
{
|
||||||
|
Restart(seconds, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Given float seconds, this will restart the region. showDialog will optionally alert the users.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="seconds">float indicating duration before restart.</param>
|
||||||
|
public virtual void Restart(float seconds, bool showDialog)
|
||||||
{
|
{
|
||||||
// notifications are done in 15 second increments
|
// notifications are done in 15 second increments
|
||||||
// so .. if the number of seconds is less then 15 seconds, it's not really a restart request
|
// so .. if the number of seconds is less then 15 seconds, it's not really a restart request
|
||||||
|
@ -893,8 +907,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed);
|
m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed);
|
||||||
m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes");
|
m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes");
|
||||||
m_restartTimer.Start();
|
m_restartTimer.Start();
|
||||||
m_dialogModule.SendNotificationToUsersInRegion(
|
if (showDialog)
|
||||||
UUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in 2 Minutes");
|
{
|
||||||
|
m_dialogModule.SendNotificationToUsersInRegion(
|
||||||
|
UUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in " + (seconds / 60).ToString() + " Minutes");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2381,103 +2398,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return successYN;
|
return successYN;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handle a scene object that is crossing into this region from another.
|
|
||||||
/// NOTE: Unused as of 2009-02-09. Soon to be deleted.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="regionHandle"></param>
|
|
||||||
/// <param name="primID"></param>
|
|
||||||
/// <param name="objXMLData"></param>
|
|
||||||
/// <param name="XMLMethod"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool IncomingInterRegionPrimGroup(UUID primID, string objXMLData, int XMLMethod)
|
|
||||||
{
|
|
||||||
if (XMLMethod == 0)
|
|
||||||
{
|
|
||||||
m_log.DebugFormat("[INTERREGION]: A new prim {0} arrived from a neighbor", primID);
|
|
||||||
SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData);
|
|
||||||
if (sceneObject.IsAttachment)
|
|
||||||
sceneObject.RootPart.ObjectFlags |= (uint)PrimFlags.Phantom;
|
|
||||||
|
|
||||||
return AddSceneObject(sceneObject);
|
|
||||||
}
|
|
||||||
else if ((XMLMethod == 100) && m_allowScriptCrossings)
|
|
||||||
{
|
|
||||||
m_log.Warn("[INTERREGION]: Prim state data arrived from a neighbor");
|
|
||||||
|
|
||||||
XmlDocument doc = new XmlDocument();
|
|
||||||
doc.LoadXml(objXMLData);
|
|
||||||
|
|
||||||
XmlNodeList rootL = doc.GetElementsByTagName("ScriptData");
|
|
||||||
if (rootL.Count == 1)
|
|
||||||
{
|
|
||||||
XmlNode rootNode = rootL[0];
|
|
||||||
if (rootNode != null)
|
|
||||||
{
|
|
||||||
XmlNodeList partL = rootNode.ChildNodes;
|
|
||||||
|
|
||||||
foreach (XmlNode part in partL)
|
|
||||||
{
|
|
||||||
XmlNodeList nodeL = part.ChildNodes;
|
|
||||||
|
|
||||||
switch (part.Name)
|
|
||||||
{
|
|
||||||
case "Assemblies":
|
|
||||||
foreach (XmlNode asm in nodeL)
|
|
||||||
{
|
|
||||||
string fn = asm.Attributes.GetNamedItem("Filename").Value;
|
|
||||||
|
|
||||||
Byte[] filedata = Convert.FromBase64String(asm.InnerText);
|
|
||||||
string path = Path.Combine("ScriptEngines", RegionInfo.RegionID.ToString());
|
|
||||||
path = Path.Combine(path, fn);
|
|
||||||
|
|
||||||
if (!File.Exists(path))
|
|
||||||
{
|
|
||||||
FileStream fs = File.Create(path);
|
|
||||||
fs.Write(filedata, 0, filedata.Length);
|
|
||||||
fs.Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "ScriptStates":
|
|
||||||
foreach (XmlNode st in nodeL)
|
|
||||||
{
|
|
||||||
string id = st.Attributes.GetNamedItem("UUID").Value;
|
|
||||||
UUID uuid = new UUID(id);
|
|
||||||
XmlNode state = st.ChildNodes[0];
|
|
||||||
|
|
||||||
XmlDocument sdoc = new XmlDocument();
|
|
||||||
XmlNode sxmlnode = sdoc.CreateNode(
|
|
||||||
XmlNodeType.XmlDeclaration,
|
|
||||||
"", "");
|
|
||||||
sdoc.AppendChild(sxmlnode);
|
|
||||||
|
|
||||||
XmlNode newnode = sdoc.ImportNode(state, true);
|
|
||||||
sdoc.AppendChild(newnode);
|
|
||||||
|
|
||||||
string spath = Path.Combine("ScriptEngines", RegionInfo.RegionID.ToString());
|
|
||||||
spath = Path.Combine(spath, uuid.ToString());
|
|
||||||
FileStream sfs = File.Create(spath + ".state");
|
|
||||||
ASCIIEncoding enc = new ASCIIEncoding();
|
|
||||||
Byte[] buf = enc.GetBytes(sdoc.InnerXml);
|
|
||||||
sfs.Write(buf, 0, buf.Length);
|
|
||||||
sfs.Close();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SceneObjectPart RootPrim = GetSceneObjectPart(primID);
|
|
||||||
RootPrim.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, 1);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IncomingCreateObject(ISceneObject sog)
|
public bool IncomingCreateObject(ISceneObject sog)
|
||||||
{
|
{
|
||||||
//m_log.Debug(" >>> IncomingCreateObject <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted);
|
//m_log.Debug(" >>> IncomingCreateObject <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted);
|
||||||
|
@ -3350,7 +3270,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_sceneGridService.OnCloseAgentConnection += IncomingCloseAgent;
|
m_sceneGridService.OnCloseAgentConnection += IncomingCloseAgent;
|
||||||
//m_eventManager.OnRegionUp += OtherRegionUp;
|
//m_eventManager.OnRegionUp += OtherRegionUp;
|
||||||
//m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate;
|
//m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate;
|
||||||
m_sceneGridService.OnExpectPrim += IncomingInterRegionPrimGroup;
|
|
||||||
//m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar;
|
//m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar;
|
||||||
m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid;
|
m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid;
|
||||||
m_sceneGridService.KiPrimitive += SendKillObject;
|
m_sceneGridService.KiPrimitive += SendKillObject;
|
||||||
|
@ -3374,7 +3293,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_sceneGridService.KiPrimitive -= SendKillObject;
|
m_sceneGridService.KiPrimitive -= SendKillObject;
|
||||||
m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid;
|
m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid;
|
||||||
//m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar;
|
//m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar;
|
||||||
m_sceneGridService.OnExpectPrim -= IncomingInterRegionPrimGroup;
|
|
||||||
//m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate;
|
//m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate;
|
||||||
//m_eventManager.OnRegionUp -= OtherRegionUp;
|
//m_eventManager.OnRegionUp -= OtherRegionUp;
|
||||||
m_sceneGridService.OnExpectUser -= HandleNewUserConnection;
|
m_sceneGridService.OnExpectUser -= HandleNewUserConnection;
|
||||||
|
|
|
@ -85,7 +85,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Prim will arrive shortly
|
/// A Prim will arrive shortly
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event ExpectPrimDelegate OnExpectPrim;
|
|
||||||
public event CloseAgentConnection OnCloseAgentConnection;
|
public event CloseAgentConnection OnCloseAgentConnection;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -116,7 +115,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion;
|
private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion;
|
||||||
private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser;
|
private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser;
|
||||||
private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim;
|
|
||||||
private CloseAgentConnection handlerCloseAgentConnection = null; // OnCloseAgentConnection;
|
private CloseAgentConnection handlerCloseAgentConnection = null; // OnCloseAgentConnection;
|
||||||
private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion;
|
private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion;
|
||||||
//private RegionUp handlerRegionUp = null; // OnRegionUp;
|
//private RegionUp handlerRegionUp = null; // OnRegionUp;
|
||||||
|
@ -147,30 +145,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <exception cref="System.Exception">Thrown if region registration fails.</exception>
|
/// <exception cref="System.Exception">Thrown if region registration fails.</exception>
|
||||||
public void RegisterRegion(IInterregionCommsOut comms_out, RegionInfo regionInfos)
|
public void RegisterRegion(IInterregionCommsOut comms_out, RegionInfo regionInfos)
|
||||||
{
|
{
|
||||||
//m_interregionCommsOut = comms_out;
|
|
||||||
|
|
||||||
//m_regionInfo = regionInfos;
|
|
||||||
//m_commsProvider.GridService.gdebugRegionName = regionInfos.RegionName;
|
|
||||||
//regionCommsHost = m_commsProvider.GridService.RegisterRegion(m_regionInfo);
|
|
||||||
|
|
||||||
//if (regionCommsHost != null)
|
|
||||||
//{
|
|
||||||
// //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: registered with gridservice and got" + regionCommsHost.ToString());
|
|
||||||
|
|
||||||
// regionCommsHost.debugRegionName = regionInfos.RegionName;
|
|
||||||
// regionCommsHost.OnExpectPrim += IncomingPrimCrossing;
|
|
||||||
// regionCommsHost.OnExpectUser += NewUserConnection;
|
|
||||||
// regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing;
|
|
||||||
// regionCommsHost.OnCloseAgentConnection += CloseConnection;
|
|
||||||
// regionCommsHost.OnRegionUp += newRegionUp;
|
|
||||||
// regionCommsHost.OnChildAgentUpdate += ChildAgentUpdate;
|
|
||||||
// regionCommsHost.OnLogOffUser += GridLogOffUser;
|
|
||||||
// regionCommsHost.OnGetLandData += FetchLandData;
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
//{
|
|
||||||
// //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: registered with gridservice and got null");
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -179,31 +153,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Close()
|
public void Close()
|
||||||
{
|
{
|
||||||
|
|
||||||
//if (regionCommsHost != null)
|
|
||||||
//{
|
|
||||||
// regionCommsHost.OnLogOffUser -= GridLogOffUser;
|
|
||||||
// regionCommsHost.OnChildAgentUpdate -= ChildAgentUpdate;
|
|
||||||
// regionCommsHost.OnRegionUp -= newRegionUp;
|
|
||||||
// regionCommsHost.OnExpectUser -= NewUserConnection;
|
|
||||||
// regionCommsHost.OnExpectPrim -= IncomingPrimCrossing;
|
|
||||||
// regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing;
|
|
||||||
// regionCommsHost.OnCloseAgentConnection -= CloseConnection;
|
|
||||||
// regionCommsHost.OnGetLandData -= FetchLandData;
|
|
||||||
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// m_commsProvider.GridService.DeregisterRegion(m_regionInfo);
|
|
||||||
// }
|
|
||||||
// catch (Exception e)
|
|
||||||
// {
|
|
||||||
// m_log.ErrorFormat(
|
|
||||||
// "[GRID]: Deregistration of region {0} from the grid failed - {1}. Continuing",
|
|
||||||
// m_regionInfo.RegionName, e);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// regionCommsHost = null;
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region CommsManager Event handlers
|
#region CommsManager Event handlers
|
||||||
|
@ -263,27 +212,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// We have a new prim from a neighbor
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="primID">unique ID for the primative</param>
|
|
||||||
/// <param name="objXMLData">XML2 encoded data of the primative</param>
|
|
||||||
/// <param name="XMLMethod">An Int that represents the version of the XMLMethod</param>
|
|
||||||
/// <returns>True if the prim was accepted, false if it was not</returns>
|
|
||||||
protected bool IncomingPrimCrossing(UUID primID, String objXMLData, int XMLMethod)
|
|
||||||
{
|
|
||||||
handlerExpectPrim = OnExpectPrim;
|
|
||||||
if (handlerExpectPrim != null)
|
|
||||||
{
|
|
||||||
return handlerExpectPrim(primID, objXMLData, XMLMethod);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void PrimCrossing(UUID primID, Vector3 position, bool isPhysical)
|
protected void PrimCrossing(UUID primID, Vector3 position, bool isPhysical)
|
||||||
{
|
{
|
||||||
handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion;
|
handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion;
|
||||||
|
|
|
@ -241,24 +241,24 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// Save the current scene to an OpenSimulator archive. This archive will eventually include the prim's assets
|
/// Save the current scene to an OpenSimulator archive. This archive will eventually include the prim's assets
|
||||||
/// as well as the details of the prims themselves.
|
/// as well as the details of the prims themselves.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="filename"></param>
|
/// <param name="cmdparams"></param>
|
||||||
public void SaveCurrentSceneToArchive(string filename)
|
public void SaveCurrentSceneToArchive(string[] cmdparams)
|
||||||
{
|
{
|
||||||
IRegionArchiverModule archiver = CurrentOrFirstScene.RequestModuleInterface<IRegionArchiverModule>();
|
IRegionArchiverModule archiver = CurrentOrFirstScene.RequestModuleInterface<IRegionArchiverModule>();
|
||||||
if (archiver != null)
|
if (archiver != null)
|
||||||
archiver.ArchiveRegion(filename);
|
archiver.HandleSaveOarConsoleCommand(string.Empty, cmdparams);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Load an OpenSim archive into the current scene. This will load both the shapes of the prims and upload
|
/// Load an OpenSim archive into the current scene. This will load both the shapes of the prims and upload
|
||||||
/// their assets to the asset service.
|
/// their assets to the asset service.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="filename"></param>
|
/// <param name="cmdparams"></param>
|
||||||
public void LoadArchiveToCurrentScene(string filename)
|
public void LoadArchiveToCurrentScene(string[] cmdparams)
|
||||||
{
|
{
|
||||||
IRegionArchiverModule archiver = CurrentOrFirstScene.RequestModuleInterface<IRegionArchiverModule>();
|
IRegionArchiverModule archiver = CurrentOrFirstScene.RequestModuleInterface<IRegionArchiverModule>();
|
||||||
if (archiver != null)
|
if (archiver != null)
|
||||||
archiver.DearchiveRegion(filename);
|
archiver.HandleLoadOarConsoleCommand(string.Empty, cmdparams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string SaveCurrentSceneMapToXmlString()
|
public string SaveCurrentSceneMapToXmlString()
|
||||||
|
|
|
@ -309,26 +309,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public string GetStateSnapshot()
|
public string GetStateSnapshot()
|
||||||
{
|
{
|
||||||
//m_log.Debug(" >>> GetStateSnapshot <<<");
|
|
||||||
|
|
||||||
List<string> assemblies = new List<string>();
|
|
||||||
Dictionary<UUID, string> states = new Dictionary<UUID, string>();
|
Dictionary<UUID, string> states = new Dictionary<UUID, string>();
|
||||||
|
|
||||||
foreach (SceneObjectPart part in m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
foreach (string a in part.Inventory.GetScriptAssemblies())
|
|
||||||
{
|
|
||||||
if (a != "" && !assemblies.Contains(a))
|
|
||||||
assemblies.Add(a);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (KeyValuePair<UUID, string> s in part.Inventory.GetScriptStates())
|
foreach (KeyValuePair<UUID, string> s in part.Inventory.GetScriptStates())
|
||||||
{
|
|
||||||
states[s.Key] = s.Value;
|
states[s.Key] = s.Value;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (states.Count < 1 || assemblies.Count < 1)
|
if (states.Count < 1)
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
XmlDocument xmldoc = new XmlDocument();
|
XmlDocument xmldoc = new XmlDocument();
|
||||||
|
@ -342,104 +331,49 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
xmldoc.AppendChild(rootElement);
|
xmldoc.AppendChild(rootElement);
|
||||||
|
|
||||||
XmlElement wrapper = xmldoc.CreateElement("", "Assemblies",
|
|
||||||
"");
|
|
||||||
|
|
||||||
rootElement.AppendChild(wrapper);
|
XmlElement wrapper = xmldoc.CreateElement("", "ScriptStates",
|
||||||
|
|
||||||
foreach (string assembly in assemblies)
|
|
||||||
{
|
|
||||||
string fn = Path.GetFileName(assembly);
|
|
||||||
if (fn == String.Empty)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
String filedata = String.Empty;
|
|
||||||
|
|
||||||
if (File.Exists(assembly+".text"))
|
|
||||||
{
|
|
||||||
FileInfo tfi = new FileInfo(assembly+".text");
|
|
||||||
|
|
||||||
if (tfi == null)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
Byte[] tdata = new Byte[tfi.Length];
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
FileStream tfs = File.Open(assembly+".text", FileMode.Open, FileAccess.Read);
|
|
||||||
tfs.Read(tdata, 0, tdata.Length);
|
|
||||||
tfs.Close();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
m_log.DebugFormat("[SOG]: Unable to open script textfile {0}, reason: {1}", assembly+".text", e.Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
filedata = new System.Text.ASCIIEncoding().GetString(tdata);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FileInfo fi = new FileInfo(assembly);
|
|
||||||
|
|
||||||
if (fi == null)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
Byte[] data = new Byte[fi.Length];
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
FileStream fs = File.Open(assembly, FileMode.Open, FileAccess.Read);
|
|
||||||
fs.Read(data, 0, data.Length);
|
|
||||||
fs.Close();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
m_log.DebugFormat("[SOG]: Unable to open script assembly {0}, reason: {1}", assembly, e.Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
filedata = System.Convert.ToBase64String(data);
|
|
||||||
}
|
|
||||||
XmlElement assemblyData = xmldoc.CreateElement("", "Assembly", "");
|
|
||||||
XmlAttribute assemblyName = xmldoc.CreateAttribute("", "Filename", "");
|
|
||||||
assemblyName.Value = fn;
|
|
||||||
assemblyData.Attributes.Append(assemblyName);
|
|
||||||
|
|
||||||
assemblyData.InnerText = filedata;
|
|
||||||
|
|
||||||
wrapper.AppendChild(assemblyData);
|
|
||||||
}
|
|
||||||
|
|
||||||
wrapper = xmldoc.CreateElement("", "ScriptStates",
|
|
||||||
"");
|
"");
|
||||||
|
|
||||||
rootElement.AppendChild(wrapper);
|
rootElement.AppendChild(wrapper);
|
||||||
|
|
||||||
foreach (KeyValuePair<UUID, string> state in states)
|
foreach (KeyValuePair<UUID, string> state in states)
|
||||||
{
|
{
|
||||||
XmlElement stateData = xmldoc.CreateElement("", "State", "");
|
|
||||||
|
|
||||||
XmlAttribute stateID = xmldoc.CreateAttribute("", "UUID", "");
|
|
||||||
stateID.Value = state.Key.ToString();
|
|
||||||
stateData.Attributes.Append(stateID);
|
|
||||||
|
|
||||||
XmlDocument sdoc = new XmlDocument();
|
XmlDocument sdoc = new XmlDocument();
|
||||||
sdoc.LoadXml(state.Value);
|
sdoc.LoadXml(state.Value);
|
||||||
XmlNodeList rootL = sdoc.GetElementsByTagName("ScriptState");
|
XmlNodeList rootL = sdoc.GetElementsByTagName("State");
|
||||||
XmlNode rootNode = rootL[0];
|
XmlNode rootNode = rootL[0];
|
||||||
|
|
||||||
XmlNode newNode = xmldoc.ImportNode(rootNode, true);
|
XmlNode newNode = xmldoc.ImportNode(rootNode, true);
|
||||||
stateData.AppendChild(newNode);
|
wrapper.AppendChild(newNode);
|
||||||
wrapper.AppendChild(stateData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return xmldoc.InnerXml;
|
return xmldoc.InnerXml;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetState(string objXMLData, UUID RegionID)
|
public void SetState(string objXMLData, IScene ins)
|
||||||
{
|
{
|
||||||
|
if (!(ins is Scene))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Scene s = (Scene)ins;
|
||||||
|
|
||||||
if (objXMLData == String.Empty)
|
if (objXMLData == String.Empty)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
IScriptModule scriptModule = null;
|
||||||
|
|
||||||
|
foreach (IScriptModule sm in s.RequestModuleInterfaces<IScriptModule>())
|
||||||
|
{
|
||||||
|
if (sm.ScriptEngineName == s.DefaultScriptEngine)
|
||||||
|
scriptModule = sm;
|
||||||
|
else if (scriptModule == null)
|
||||||
|
scriptModule = sm;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (scriptModule == null)
|
||||||
|
return;
|
||||||
|
|
||||||
XmlDocument doc = new XmlDocument();
|
XmlDocument doc = new XmlDocument();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -457,69 +391,23 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
XmlNodeList rootL = doc.GetElementsByTagName("ScriptData");
|
XmlNodeList rootL = doc.GetElementsByTagName("ScriptData");
|
||||||
if (rootL.Count == 1)
|
if (rootL.Count != 1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
XmlElement rootE = (XmlElement)rootL[0];
|
||||||
|
|
||||||
|
XmlNodeList dataL = rootE.GetElementsByTagName("ScriptStates");
|
||||||
|
if (dataL.Count != 1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
XmlElement dataE = (XmlElement)dataL[0];
|
||||||
|
|
||||||
|
foreach (XmlNode n in dataE.ChildNodes)
|
||||||
{
|
{
|
||||||
XmlNode rootNode = rootL[0];
|
XmlElement stateE = (XmlElement)n;
|
||||||
if (rootNode != null)
|
UUID itemID = new UUID(stateE.GetAttribute("UUID"));
|
||||||
{
|
|
||||||
XmlNodeList partL = rootNode.ChildNodes;
|
|
||||||
|
|
||||||
foreach (XmlNode part in partL)
|
scriptModule.SetXMLState(itemID, n.OuterXml);
|
||||||
{
|
|
||||||
XmlNodeList nodeL = part.ChildNodes;
|
|
||||||
|
|
||||||
switch (part.Name)
|
|
||||||
{
|
|
||||||
case "Assemblies":
|
|
||||||
foreach (XmlNode asm in nodeL)
|
|
||||||
{
|
|
||||||
string fn = asm.Attributes.GetNamedItem("Filename").Value;
|
|
||||||
|
|
||||||
Byte[] filedata = Convert.FromBase64String(asm.InnerText);
|
|
||||||
string path = Path.Combine("ScriptEngines", RegionID.ToString());
|
|
||||||
path = Path.Combine(path, fn);
|
|
||||||
|
|
||||||
if (!File.Exists(path))
|
|
||||||
{
|
|
||||||
FileStream fs = File.Create(path);
|
|
||||||
fs.Write(filedata, 0, filedata.Length);
|
|
||||||
fs.Close();
|
|
||||||
|
|
||||||
Byte[] textbytes = new System.Text.ASCIIEncoding().GetBytes(asm.InnerText);
|
|
||||||
fs = File.Create(path+".text");
|
|
||||||
fs.Write(textbytes, 0, textbytes.Length);
|
|
||||||
fs.Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "ScriptStates":
|
|
||||||
foreach (XmlNode st in nodeL)
|
|
||||||
{
|
|
||||||
string id = st.Attributes.GetNamedItem("UUID").Value;
|
|
||||||
UUID uuid = new UUID(id);
|
|
||||||
XmlNode state = st.ChildNodes[0];
|
|
||||||
|
|
||||||
XmlDocument sdoc = new XmlDocument();
|
|
||||||
XmlNode sxmlnode = sdoc.CreateNode(
|
|
||||||
XmlNodeType.XmlDeclaration,
|
|
||||||
"", "");
|
|
||||||
sdoc.AppendChild(sxmlnode);
|
|
||||||
|
|
||||||
XmlNode newnode = sdoc.ImportNode(state, true);
|
|
||||||
sdoc.AppendChild(newnode);
|
|
||||||
|
|
||||||
string spath = Path.Combine("ScriptEngines", RegionID.ToString());
|
|
||||||
spath = Path.Combine(spath, uuid.ToString());
|
|
||||||
FileStream sfs = File.Create(spath + ".state");
|
|
||||||
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
|
|
||||||
Byte[] buf = enc.GetBytes(sdoc.InnerXml);
|
|
||||||
sfs.Write(buf, 0, buf.Length);
|
|
||||||
sfs.Close();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3380,17 +3380,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public bool CanBeDeleted()
|
|
||||||
{
|
|
||||||
foreach (SceneObjectPart part in Children.Values)
|
|
||||||
{
|
|
||||||
if (!part.CanBeDeleted())
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double GetUpdatePriority(IClientAPI client)
|
public double GetUpdatePriority(IClientAPI client)
|
||||||
{
|
{
|
||||||
switch (Scene.UpdatePrioritizationScheme)
|
switch (Scene.UpdatePrioritizationScheme)
|
||||||
|
|
|
@ -389,12 +389,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <value>
|
/// <value>
|
||||||
/// Access should be via Inventory directly - this property temporarily remains for xml serialization purposes
|
/// Get the inventory list
|
||||||
/// </value>
|
/// </value>
|
||||||
public TaskInventoryDictionary TaskInventory
|
public TaskInventoryDictionary TaskInventory
|
||||||
{
|
{
|
||||||
get { return m_inventory.Items; }
|
get {
|
||||||
set { m_inventory.Items = value; }
|
return m_inventory.Items;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
m_inventory.Items = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint ObjectFlags
|
public uint ObjectFlags
|
||||||
|
@ -2101,17 +2105,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
//Trys to fetch sound id from prim's inventory.
|
//Trys to fetch sound id from prim's inventory.
|
||||||
//Prim's inventory doesn't support non script items yet
|
//Prim's inventory doesn't support non script items yet
|
||||||
|
|
||||||
lock (TaskInventory)
|
TaskInventory.LockItemsForRead(true);
|
||||||
|
|
||||||
|
foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory)
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory)
|
if (item.Value.Name == sound)
|
||||||
{
|
{
|
||||||
if (item.Value.Name == sound)
|
soundID = item.Value.ItemID;
|
||||||
{
|
break;
|
||||||
soundID = item.Value.ItemID;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TaskInventory.LockItemsForRead(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ScenePresence> avatarts = m_parentGroup.Scene.GetAvatars();
|
List<ScenePresence> avatarts = m_parentGroup.Scene.GetAvatars();
|
||||||
|
@ -2457,17 +2462,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (!UUID.TryParse(sound, out soundID))
|
if (!UUID.TryParse(sound, out soundID))
|
||||||
{
|
{
|
||||||
// search sound file from inventory
|
// search sound file from inventory
|
||||||
lock (TaskInventory)
|
TaskInventory.LockItemsForRead(true);
|
||||||
|
foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory)
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory)
|
if (item.Value.Name == sound && item.Value.Type == (int)AssetType.Sound)
|
||||||
{
|
{
|
||||||
if (item.Value.Name == sound && item.Value.Type == (int)AssetType.Sound)
|
soundID = item.Value.ItemID;
|
||||||
{
|
break;
|
||||||
soundID = item.Value.ItemID;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
TaskInventory.LockItemsForRead(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (soundID == UUID.Zero)
|
if (soundID == UUID.Zero)
|
||||||
|
@ -3803,10 +3807,5 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
Inventory.ApplyNextOwnerPermissions();
|
Inventory.ApplyNextOwnerPermissions();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanBeDeleted()
|
|
||||||
{
|
|
||||||
return Inventory.CanBeDeleted();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </value>
|
/// </value>
|
||||||
protected internal TaskInventoryDictionary Items
|
protected internal TaskInventoryDictionary Items
|
||||||
{
|
{
|
||||||
get { return m_items; }
|
get {
|
||||||
|
return m_items;
|
||||||
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
m_items = value;
|
m_items = value;
|
||||||
|
@ -116,22 +118,25 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="linkNum">Link number for the part</param>
|
/// <param name="linkNum">Link number for the part</param>
|
||||||
public void ResetInventoryIDs()
|
public void ResetInventoryIDs()
|
||||||
{
|
{
|
||||||
lock (Items)
|
m_items.LockItemsForWrite(true);
|
||||||
|
|
||||||
|
if (0 == Items.Count)
|
||||||
{
|
{
|
||||||
if (0 == Items.Count)
|
m_items.LockItemsForWrite(false);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
HasInventoryChanged = true;
|
|
||||||
m_part.ParentGroup.HasGroupChanged = true;
|
|
||||||
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
|
|
||||||
Items.Clear();
|
|
||||||
|
|
||||||
foreach (TaskInventoryItem item in items)
|
|
||||||
{
|
|
||||||
item.ResetIDs(m_part.UUID);
|
|
||||||
Items.Add(item.ItemID, item);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HasInventoryChanged = true;
|
||||||
|
m_part.ParentGroup.HasGroupChanged = true;
|
||||||
|
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
|
||||||
|
Items.Clear();
|
||||||
|
|
||||||
|
foreach (TaskInventoryItem item in items)
|
||||||
|
{
|
||||||
|
item.ResetIDs(m_part.UUID);
|
||||||
|
Items.Add(item.ItemID, item);
|
||||||
|
}
|
||||||
|
m_items.LockItemsForWrite(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -140,25 +145,25 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="ownerId"></param>
|
/// <param name="ownerId"></param>
|
||||||
public void ChangeInventoryOwner(UUID ownerId)
|
public void ChangeInventoryOwner(UUID ownerId)
|
||||||
{
|
{
|
||||||
lock (Items)
|
m_items.LockItemsForWrite(true);
|
||||||
|
if (0 == Items.Count)
|
||||||
{
|
{
|
||||||
if (0 == Items.Count)
|
m_items.LockItemsForWrite(false);
|
||||||
{
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
HasInventoryChanged = true;
|
HasInventoryChanged = true;
|
||||||
m_part.ParentGroup.HasGroupChanged = true;
|
m_part.ParentGroup.HasGroupChanged = true;
|
||||||
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
|
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
|
||||||
foreach (TaskInventoryItem item in items)
|
foreach (TaskInventoryItem item in items)
|
||||||
|
{
|
||||||
|
if (ownerId != item.OwnerID)
|
||||||
{
|
{
|
||||||
if (ownerId != item.OwnerID)
|
item.LastOwnerID = item.OwnerID;
|
||||||
{
|
item.OwnerID = ownerId;
|
||||||
item.LastOwnerID = item.OwnerID;
|
|
||||||
item.OwnerID = ownerId;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_items.LockItemsForWrite(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -167,24 +172,24 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="groupID"></param>
|
/// <param name="groupID"></param>
|
||||||
public void ChangeInventoryGroup(UUID groupID)
|
public void ChangeInventoryGroup(UUID groupID)
|
||||||
{
|
{
|
||||||
lock (Items)
|
m_items.LockItemsForWrite(true);
|
||||||
|
if (0 == Items.Count)
|
||||||
{
|
{
|
||||||
if (0 == Items.Count)
|
m_items.LockItemsForWrite(false);
|
||||||
{
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
HasInventoryChanged = true;
|
HasInventoryChanged = true;
|
||||||
m_part.ParentGroup.HasGroupChanged = true;
|
m_part.ParentGroup.HasGroupChanged = true;
|
||||||
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
|
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
|
||||||
foreach (TaskInventoryItem item in items)
|
foreach (TaskInventoryItem item in items)
|
||||||
|
{
|
||||||
|
if (groupID != item.GroupID)
|
||||||
{
|
{
|
||||||
if (groupID != item.GroupID)
|
item.GroupID = groupID;
|
||||||
{
|
|
||||||
item.GroupID = groupID;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_items.LockItemsForWrite(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -192,14 +197,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource)
|
public void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource)
|
||||||
{
|
{
|
||||||
lock (m_items)
|
Items.LockItemsForRead(true);
|
||||||
|
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
|
||||||
|
Items.LockItemsForRead(false);
|
||||||
|
foreach (TaskInventoryItem item in items)
|
||||||
{
|
{
|
||||||
foreach (TaskInventoryItem item in Items.Values)
|
if ((int)InventoryType.LSL == item.InvType)
|
||||||
{
|
{
|
||||||
if ((int)InventoryType.LSL == item.InvType)
|
CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
|
||||||
{
|
|
||||||
CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -209,17 +214,20 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void RemoveScriptInstances()
|
public void RemoveScriptInstances()
|
||||||
{
|
{
|
||||||
lock (Items)
|
Items.LockItemsForRead(true);
|
||||||
|
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
|
||||||
|
Items.LockItemsForRead(false);
|
||||||
|
|
||||||
|
foreach (TaskInventoryItem item in items)
|
||||||
{
|
{
|
||||||
foreach (TaskInventoryItem item in Items.Values)
|
if ((int)InventoryType.LSL == item.InvType)
|
||||||
{
|
{
|
||||||
if ((int)InventoryType.LSL == item.InvType)
|
RemoveScriptInstance(item.ItemID);
|
||||||
{
|
m_part.RemoveScriptEvents(item.ItemID);
|
||||||
RemoveScriptInstance(item.ItemID);
|
|
||||||
m_part.RemoveScriptEvents(item.ItemID);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -244,8 +252,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (stateSource == 1 && // Prim crossing
|
if (stateSource == 1 && // Prim crossing
|
||||||
m_part.ParentGroup.Scene.m_trustBinaries)
|
m_part.ParentGroup.Scene.m_trustBinaries)
|
||||||
{
|
{
|
||||||
|
m_items.LockItemsForWrite(true);
|
||||||
m_items[item.ItemID].PermsMask = 0;
|
m_items[item.ItemID].PermsMask = 0;
|
||||||
m_items[item.ItemID].PermsGranter = UUID.Zero;
|
m_items[item.ItemID].PermsGranter = UUID.Zero;
|
||||||
|
m_items.LockItemsForWrite(false);
|
||||||
m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
|
m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
|
||||||
m_part.LocalId, item.ItemID, String.Empty, startParam, postOnRez, engine, stateSource);
|
m_part.LocalId, item.ItemID, String.Empty, startParam, postOnRez, engine, stateSource);
|
||||||
m_part.ParentGroup.AddActiveScriptCount(1);
|
m_part.ParentGroup.AddActiveScriptCount(1);
|
||||||
|
@ -266,8 +276,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
if (m_part.ParentGroup.m_savedScriptState != null)
|
if (m_part.ParentGroup.m_savedScriptState != null)
|
||||||
RestoreSavedScriptState(item.OldItemID, item.ItemID);
|
RestoreSavedScriptState(item.OldItemID, item.ItemID);
|
||||||
|
m_items.LockItemsForWrite(true);
|
||||||
m_items[item.ItemID].PermsMask = 0;
|
m_items[item.ItemID].PermsMask = 0;
|
||||||
m_items[item.ItemID].PermsGranter = UUID.Zero;
|
m_items[item.ItemID].PermsGranter = UUID.Zero;
|
||||||
|
m_items.LockItemsForWrite(false);
|
||||||
string script = Utils.BytesToString(asset.Data);
|
string script = Utils.BytesToString(asset.Data);
|
||||||
m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
|
m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
|
||||||
m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource);
|
m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource);
|
||||||
|
@ -302,20 +314,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </param>
|
/// </param>
|
||||||
public void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource)
|
public void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource)
|
||||||
{
|
{
|
||||||
lock (m_items)
|
m_items.LockItemsForRead(true);
|
||||||
|
if (m_items.ContainsKey(itemId))
|
||||||
{
|
{
|
||||||
if (m_items.ContainsKey(itemId))
|
TaskInventoryItem item = m_items[itemId];
|
||||||
{
|
m_items.LockItemsForRead(false);
|
||||||
CreateScriptInstance(m_items[itemId], startParam, postOnRez, engine, stateSource);
|
CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_log.ErrorFormat(
|
|
||||||
"[PRIM INVENTORY]: " +
|
|
||||||
"Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2}",
|
|
||||||
itemId, m_part.Name, m_part.UUID);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_items.LockItemsForRead(false);
|
||||||
|
m_log.ErrorFormat(
|
||||||
|
"[PRIM INVENTORY]: " +
|
||||||
|
"Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2}",
|
||||||
|
itemId, m_part.Name, m_part.UUID);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -346,11 +360,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private bool InventoryContainsName(string name)
|
private bool InventoryContainsName(string name)
|
||||||
{
|
{
|
||||||
foreach (TaskInventoryItem item in Items.Values)
|
m_items.LockItemsForRead(true);
|
||||||
|
foreach (TaskInventoryItem item in m_items.Values)
|
||||||
{
|
{
|
||||||
if (item.Name == name)
|
if (item.Name == name)
|
||||||
|
{
|
||||||
|
m_items.LockItemsForRead(false);
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
m_items.LockItemsForRead(false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -392,7 +411,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="item"></param>
|
/// <param name="item"></param>
|
||||||
public void AddInventoryItemExclusive(TaskInventoryItem item, bool allowedDrop)
|
public void AddInventoryItemExclusive(TaskInventoryItem item, bool allowedDrop)
|
||||||
{
|
{
|
||||||
|
m_items.LockItemsForRead(true);
|
||||||
List<TaskInventoryItem> il = new List<TaskInventoryItem>(m_items.Values);
|
List<TaskInventoryItem> il = new List<TaskInventoryItem>(m_items.Values);
|
||||||
|
m_items.LockItemsForRead(false);
|
||||||
foreach (TaskInventoryItem i in il)
|
foreach (TaskInventoryItem i in il)
|
||||||
{
|
{
|
||||||
if (i.Name == item.Name)
|
if (i.Name == item.Name)
|
||||||
|
@ -429,15 +450,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
item.ParentPartID = m_part.UUID;
|
item.ParentPartID = m_part.UUID;
|
||||||
item.Name = name;
|
item.Name = name;
|
||||||
|
|
||||||
lock (m_items)
|
m_items.LockItemsForWrite(true);
|
||||||
{
|
m_items.Add(item.ItemID, item);
|
||||||
m_items.Add(item.ItemID, item);
|
m_items.LockItemsForWrite(false);
|
||||||
|
|
||||||
if (allowedDrop)
|
if (allowedDrop)
|
||||||
m_part.TriggerScriptChangedEvent(Changed.ALLOWED_DROP);
|
m_part.TriggerScriptChangedEvent(Changed.ALLOWED_DROP);
|
||||||
else
|
else
|
||||||
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
||||||
}
|
|
||||||
|
|
||||||
m_inventorySerial++;
|
m_inventorySerial++;
|
||||||
//m_inventorySerial += 2;
|
//m_inventorySerial += 2;
|
||||||
|
@ -454,14 +474,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="items"></param>
|
/// <param name="items"></param>
|
||||||
public void RestoreInventoryItems(ICollection<TaskInventoryItem> items)
|
public void RestoreInventoryItems(ICollection<TaskInventoryItem> items)
|
||||||
{
|
{
|
||||||
lock (m_items)
|
m_items.LockItemsForWrite(true);
|
||||||
|
foreach (TaskInventoryItem item in items)
|
||||||
{
|
{
|
||||||
foreach (TaskInventoryItem item in items)
|
m_items.Add(item.ItemID, item);
|
||||||
{
|
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
||||||
m_items.Add(item.ItemID, item);
|
|
||||||
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
m_items.LockItemsForWrite(false);
|
||||||
|
|
||||||
m_inventorySerial++;
|
m_inventorySerial++;
|
||||||
}
|
}
|
||||||
|
@ -474,8 +493,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
public TaskInventoryItem GetInventoryItem(UUID itemId)
|
public TaskInventoryItem GetInventoryItem(UUID itemId)
|
||||||
{
|
{
|
||||||
TaskInventoryItem item;
|
TaskInventoryItem item;
|
||||||
|
m_items.LockItemsForRead(true);
|
||||||
m_items.TryGetValue(itemId, out item);
|
m_items.TryGetValue(itemId, out item);
|
||||||
|
m_items.LockItemsForRead(false);
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -487,45 +507,45 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <returns>false if the item did not exist, true if the update occurred successfully</returns>
|
/// <returns>false if the item did not exist, true if the update occurred successfully</returns>
|
||||||
public bool UpdateInventoryItem(TaskInventoryItem item)
|
public bool UpdateInventoryItem(TaskInventoryItem item)
|
||||||
{
|
{
|
||||||
lock (m_items)
|
m_items.LockItemsForWrite(true);
|
||||||
|
|
||||||
|
if (m_items.ContainsKey(item.ItemID))
|
||||||
{
|
{
|
||||||
if (m_items.ContainsKey(item.ItemID))
|
item.ParentID = m_part.UUID;
|
||||||
|
item.ParentPartID = m_part.UUID;
|
||||||
|
item.Flags = m_items[item.ItemID].Flags;
|
||||||
|
if (item.AssetID == UUID.Zero)
|
||||||
{
|
{
|
||||||
item.ParentID = m_part.UUID;
|
item.AssetID = m_items[item.ItemID].AssetID;
|
||||||
item.ParentPartID = m_part.UUID;
|
|
||||||
item.Flags = m_items[item.ItemID].Flags;
|
|
||||||
if (item.AssetID == UUID.Zero)
|
|
||||||
{
|
|
||||||
item.AssetID = m_items[item.ItemID].AssetID;
|
|
||||||
}
|
|
||||||
else if ((InventoryType)item.Type == InventoryType.Notecard)
|
|
||||||
{
|
|
||||||
ScenePresence presence = m_part.ParentGroup.Scene.GetScenePresence(item.OwnerID);
|
|
||||||
|
|
||||||
if (presence != null)
|
|
||||||
{
|
|
||||||
presence.ControllingClient.SendAgentAlertMessage(
|
|
||||||
"Notecard saved", false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_items[item.ItemID] = item;
|
|
||||||
m_inventorySerial++;
|
|
||||||
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
|
||||||
|
|
||||||
HasInventoryChanged = true;
|
|
||||||
m_part.ParentGroup.HasGroupChanged = true;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
else
|
else if ((InventoryType)item.Type == InventoryType.Notecard)
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat(
|
ScenePresence presence = m_part.ParentGroup.Scene.GetScenePresence(item.OwnerID);
|
||||||
"[PRIM INVENTORY]: " +
|
|
||||||
"Tried to retrieve item ID {0} from prim {1}, {2} but the item does not exist in this inventory",
|
if (presence != null)
|
||||||
item.ItemID, m_part.Name, m_part.UUID);
|
{
|
||||||
|
presence.ControllingClient.SendAgentAlertMessage(
|
||||||
|
"Notecard saved", false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_items[item.ItemID] = item;
|
||||||
|
m_inventorySerial++;
|
||||||
|
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
||||||
|
|
||||||
|
HasInventoryChanged = true;
|
||||||
|
m_part.ParentGroup.HasGroupChanged = true;
|
||||||
|
m_items.LockItemsForWrite(false);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_log.ErrorFormat(
|
||||||
|
"[PRIM INVENTORY]: " +
|
||||||
|
"Tried to retrieve item ID {0} from prim {1}, {2} but the item does not exist in this inventory",
|
||||||
|
item.ItemID, m_part.Name, m_part.UUID);
|
||||||
|
}
|
||||||
|
m_items.LockItemsForWrite(false);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -538,51 +558,54 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// in this prim's inventory.</returns>
|
/// in this prim's inventory.</returns>
|
||||||
public int RemoveInventoryItem(UUID itemID)
|
public int RemoveInventoryItem(UUID itemID)
|
||||||
{
|
{
|
||||||
lock (m_items)
|
m_items.LockItemsForRead(true);
|
||||||
|
|
||||||
|
if (m_items.ContainsKey(itemID))
|
||||||
{
|
{
|
||||||
if (m_items.ContainsKey(itemID))
|
int type = m_items[itemID].InvType;
|
||||||
|
m_items.LockItemsForRead(false);
|
||||||
|
if (type == 10) // Script
|
||||||
{
|
{
|
||||||
int type = m_items[itemID].InvType;
|
m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemID);
|
||||||
if (type == 10) // Script
|
|
||||||
{
|
|
||||||
m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemID);
|
|
||||||
}
|
|
||||||
m_items.Remove(itemID);
|
|
||||||
m_inventorySerial++;
|
|
||||||
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
|
||||||
|
|
||||||
HasInventoryChanged = true;
|
|
||||||
m_part.ParentGroup.HasGroupChanged = true;
|
|
||||||
|
|
||||||
int scriptcount = 0;
|
|
||||||
lock (m_items)
|
|
||||||
{
|
|
||||||
foreach (TaskInventoryItem item in m_items.Values)
|
|
||||||
{
|
|
||||||
if (item.Type == 10)
|
|
||||||
{
|
|
||||||
scriptcount++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (scriptcount <= 0)
|
|
||||||
{
|
|
||||||
m_part.RemFlag(PrimFlags.Scripted);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_part.ScheduleFullUpdate();
|
|
||||||
|
|
||||||
return type;
|
|
||||||
}
|
}
|
||||||
else
|
m_items.LockItemsForWrite(true);
|
||||||
|
m_items.Remove(itemID);
|
||||||
|
m_items.LockItemsForWrite(false);
|
||||||
|
m_inventorySerial++;
|
||||||
|
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
||||||
|
|
||||||
|
HasInventoryChanged = true;
|
||||||
|
m_part.ParentGroup.HasGroupChanged = true;
|
||||||
|
|
||||||
|
int scriptcount = 0;
|
||||||
|
m_items.LockItemsForRead(true);
|
||||||
|
foreach (TaskInventoryItem item in m_items.Values)
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat(
|
if (item.Type == 10)
|
||||||
"[PRIM INVENTORY]: " +
|
{
|
||||||
"Tried to remove item ID {0} from prim {1}, {2} but the item does not exist in this inventory",
|
scriptcount++;
|
||||||
itemID, m_part.Name, m_part.UUID);
|
}
|
||||||
}
|
}
|
||||||
|
m_items.LockItemsForRead(false);
|
||||||
|
|
||||||
|
|
||||||
|
if (scriptcount <= 0)
|
||||||
|
{
|
||||||
|
m_part.RemFlag(PrimFlags.Scripted);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_part.ScheduleFullUpdate();
|
||||||
|
|
||||||
|
return type;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_log.ErrorFormat(
|
||||||
|
"[PRIM INVENTORY]: " +
|
||||||
|
"Tried to remove item ID {0} from prim {1}, {2} but the item does not exist in this inventory",
|
||||||
|
itemID, m_part.Name, m_part.UUID);
|
||||||
|
}
|
||||||
|
m_items.LockItemsForWrite(false);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -635,52 +658,53 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// isn't available (such as drag from prim inventory to agent inventory)
|
// isn't available (such as drag from prim inventory to agent inventory)
|
||||||
InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero);
|
InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero);
|
||||||
|
|
||||||
lock (m_items)
|
m_items.LockItemsForRead(true);
|
||||||
|
|
||||||
|
foreach (TaskInventoryItem item in m_items.Values)
|
||||||
{
|
{
|
||||||
foreach (TaskInventoryItem item in m_items.Values)
|
UUID ownerID = item.OwnerID;
|
||||||
{
|
uint everyoneMask = 0;
|
||||||
UUID ownerID = item.OwnerID;
|
uint baseMask = item.BasePermissions;
|
||||||
uint everyoneMask = 0;
|
uint ownerMask = item.CurrentPermissions;
|
||||||
uint baseMask = item.BasePermissions;
|
|
||||||
uint ownerMask = item.CurrentPermissions;
|
|
||||||
|
|
||||||
invString.AddItemStart();
|
invString.AddItemStart();
|
||||||
invString.AddNameValueLine("item_id", item.ItemID.ToString());
|
invString.AddNameValueLine("item_id", item.ItemID.ToString());
|
||||||
invString.AddNameValueLine("parent_id", m_part.UUID.ToString());
|
invString.AddNameValueLine("parent_id", m_part.UUID.ToString());
|
||||||
|
|
||||||
invString.AddPermissionsStart();
|
invString.AddPermissionsStart();
|
||||||
|
|
||||||
invString.AddNameValueLine("base_mask", Utils.UIntToHexString(baseMask));
|
invString.AddNameValueLine("base_mask", Utils.UIntToHexString(baseMask));
|
||||||
invString.AddNameValueLine("owner_mask", Utils.UIntToHexString(ownerMask));
|
invString.AddNameValueLine("owner_mask", Utils.UIntToHexString(ownerMask));
|
||||||
invString.AddNameValueLine("group_mask", Utils.UIntToHexString(0));
|
invString.AddNameValueLine("group_mask", Utils.UIntToHexString(0));
|
||||||
invString.AddNameValueLine("everyone_mask", Utils.UIntToHexString(everyoneMask));
|
invString.AddNameValueLine("everyone_mask", Utils.UIntToHexString(everyoneMask));
|
||||||
invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions));
|
invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions));
|
||||||
|
|
||||||
invString.AddNameValueLine("creator_id", item.CreatorID.ToString());
|
invString.AddNameValueLine("creator_id", item.CreatorID.ToString());
|
||||||
invString.AddNameValueLine("owner_id", ownerID.ToString());
|
invString.AddNameValueLine("owner_id", ownerID.ToString());
|
||||||
|
|
||||||
invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString());
|
invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString());
|
||||||
|
|
||||||
invString.AddNameValueLine("group_id", item.GroupID.ToString());
|
invString.AddNameValueLine("group_id", item.GroupID.ToString());
|
||||||
invString.AddSectionEnd();
|
invString.AddSectionEnd();
|
||||||
|
|
||||||
invString.AddNameValueLine("asset_id", item.AssetID.ToString());
|
invString.AddNameValueLine("asset_id", item.AssetID.ToString());
|
||||||
invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]);
|
invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]);
|
||||||
invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]);
|
invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]);
|
||||||
invString.AddNameValueLine("flags", Utils.UIntToHexString(item.Flags));
|
invString.AddNameValueLine("flags", Utils.UIntToHexString(item.Flags));
|
||||||
|
|
||||||
invString.AddSaleStart();
|
invString.AddSaleStart();
|
||||||
invString.AddNameValueLine("sale_type", "not");
|
invString.AddNameValueLine("sale_type", "not");
|
||||||
invString.AddNameValueLine("sale_price", "0");
|
invString.AddNameValueLine("sale_price", "0");
|
||||||
invString.AddSectionEnd();
|
invString.AddSectionEnd();
|
||||||
|
|
||||||
invString.AddNameValueLine("name", item.Name + "|");
|
invString.AddNameValueLine("name", item.Name + "|");
|
||||||
invString.AddNameValueLine("desc", item.Description + "|");
|
invString.AddNameValueLine("desc", item.Description + "|");
|
||||||
|
|
||||||
invString.AddNameValueLine("creation_date", item.CreationDate.ToString());
|
invString.AddNameValueLine("creation_date", item.CreationDate.ToString());
|
||||||
invString.AddSectionEnd();
|
invString.AddSectionEnd();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
int count = m_items.Count;
|
||||||
|
m_items.LockItemsForRead(false);
|
||||||
|
|
||||||
fileData = Utils.StringToBytes(invString.BuildString);
|
fileData = Utils.StringToBytes(invString.BuildString);
|
||||||
|
|
||||||
|
@ -701,10 +725,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
if (HasInventoryChanged)
|
if (HasInventoryChanged)
|
||||||
{
|
{
|
||||||
lock (Items)
|
Items.LockItemsForRead(true);
|
||||||
{
|
datastore.StorePrimInventory(m_part.UUID, Items.Values);
|
||||||
datastore.StorePrimInventory(m_part.UUID, Items.Values);
|
Items.LockItemsForRead(false);
|
||||||
}
|
|
||||||
|
|
||||||
HasInventoryChanged = false;
|
HasInventoryChanged = false;
|
||||||
}
|
}
|
||||||
|
@ -857,36 +880,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string[] GetScriptAssemblies()
|
|
||||||
{
|
|
||||||
IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
|
|
||||||
|
|
||||||
List<string> ret = new List<string>();
|
|
||||||
if (engines == null) // No engine at all
|
|
||||||
return new string[0];
|
|
||||||
|
|
||||||
foreach (TaskInventoryItem item in m_items.Values)
|
|
||||||
{
|
|
||||||
if (item.InvType == (int)InventoryType.LSL)
|
|
||||||
{
|
|
||||||
foreach (IScriptModule e in engines)
|
|
||||||
{
|
|
||||||
if (e != null)
|
|
||||||
{
|
|
||||||
string n = e.GetAssemblyName(item.ItemID);
|
|
||||||
if (n != String.Empty)
|
|
||||||
{
|
|
||||||
if (!ret.Contains(n))
|
|
||||||
ret.Add(n);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ret.ToArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Dictionary<UUID, string> GetScriptStates()
|
public Dictionary<UUID, string> GetScriptStates()
|
||||||
{
|
{
|
||||||
IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
|
IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
|
||||||
|
@ -916,30 +909,5 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanBeDeleted()
|
|
||||||
{
|
|
||||||
if (!ContainsScripts())
|
|
||||||
return true;
|
|
||||||
|
|
||||||
IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
|
|
||||||
|
|
||||||
if (engines == null) // No engine at all
|
|
||||||
return true;
|
|
||||||
|
|
||||||
foreach (TaskInventoryItem item in m_items.Values)
|
|
||||||
{
|
|
||||||
if (item.InvType == (int)InventoryType.LSL)
|
|
||||||
{
|
|
||||||
foreach (IScriptModule e in engines)
|
|
||||||
{
|
|
||||||
if (!e.CanBeDeleted(item.ItemID))
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -171,7 +171,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
protected RegionInfo m_regionInfo;
|
protected RegionInfo m_regionInfo;
|
||||||
protected ulong crossingFromRegion;
|
protected ulong crossingFromRegion;
|
||||||
|
|
||||||
private readonly Vector3[] Dir_Vectors = new Vector3[9];
|
private readonly Vector3[] Dir_Vectors = new Vector3[11];
|
||||||
private bool m_isNudging = false;
|
private bool m_isNudging = false;
|
||||||
|
|
||||||
// Position of agent's camera in world (region cordinates)
|
// Position of agent's camera in world (region cordinates)
|
||||||
|
@ -241,6 +241,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
DIR_CONTROL_FLAG_DOWN = AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG,
|
DIR_CONTROL_FLAG_DOWN = AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG,
|
||||||
DIR_CONTROL_FLAG_FORWARD_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS,
|
DIR_CONTROL_FLAG_FORWARD_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS,
|
||||||
DIR_CONTROL_FLAG_BACK_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG,
|
DIR_CONTROL_FLAG_BACK_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG,
|
||||||
|
DIR_CONTROL_FLAG_LEFT_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS,
|
||||||
|
DIR_CONTROL_FLAG_RIGHT_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG,
|
||||||
DIR_CONTROL_FLAG_DOWN_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG
|
DIR_CONTROL_FLAG_DOWN_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -725,12 +727,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
Dir_Vectors[5] = -Vector3.UnitZ; //DOWN
|
Dir_Vectors[5] = -Vector3.UnitZ; //DOWN
|
||||||
Dir_Vectors[6] = new Vector3(0.5f, 0f, 0f); //FORWARD_NUDGE
|
Dir_Vectors[6] = new Vector3(0.5f, 0f, 0f); //FORWARD_NUDGE
|
||||||
Dir_Vectors[7] = new Vector3(-0.5f, 0f, 0f); //BACK_NUDGE
|
Dir_Vectors[7] = new Vector3(-0.5f, 0f, 0f); //BACK_NUDGE
|
||||||
Dir_Vectors[8] = new Vector3(0f, 0f, -0.5f); //DOWN_Nudge
|
Dir_Vectors[8] = new Vector3(0f, 0.5f, 0f); //LEFT_NUDGE
|
||||||
|
Dir_Vectors[9] = new Vector3(0f, -0.5f, 0f); //RIGHT_NUDGE
|
||||||
|
Dir_Vectors[10] = new Vector3(0f, 0f, -0.5f); //DOWN_Nudge
|
||||||
}
|
}
|
||||||
|
|
||||||
private Vector3[] GetWalkDirectionVectors()
|
private Vector3[] GetWalkDirectionVectors()
|
||||||
{
|
{
|
||||||
Vector3[] vector = new Vector3[9];
|
Vector3[] vector = new Vector3[11];
|
||||||
vector[0] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD
|
vector[0] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD
|
||||||
vector[1] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK
|
vector[1] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK
|
||||||
vector[2] = Vector3.UnitY; //LEFT
|
vector[2] = Vector3.UnitY; //LEFT
|
||||||
|
@ -739,13 +743,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
vector[5] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN
|
vector[5] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN
|
||||||
vector[6] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD_NUDGE
|
vector[6] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD_NUDGE
|
||||||
vector[7] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK_NUDGE
|
vector[7] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK_NUDGE
|
||||||
vector[8] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN_Nudge
|
vector[8] = Vector3.UnitY; //LEFT_NUDGE
|
||||||
|
vector[9] = -Vector3.UnitY; //RIGHT_NUDGE
|
||||||
|
vector[10] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN_NUDGE
|
||||||
return vector;
|
return vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool[] GetDirectionIsNudge()
|
private bool[] GetDirectionIsNudge()
|
||||||
{
|
{
|
||||||
bool[] isNudge = new bool[9];
|
bool[] isNudge = new bool[11];
|
||||||
isNudge[0] = false; //FORWARD
|
isNudge[0] = false; //FORWARD
|
||||||
isNudge[1] = false; //BACK
|
isNudge[1] = false; //BACK
|
||||||
isNudge[2] = false; //LEFT
|
isNudge[2] = false; //LEFT
|
||||||
|
@ -754,7 +760,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
isNudge[5] = false; //DOWN
|
isNudge[5] = false; //DOWN
|
||||||
isNudge[6] = true; //FORWARD_NUDGE
|
isNudge[6] = true; //FORWARD_NUDGE
|
||||||
isNudge[7] = true; //BACK_NUDGE
|
isNudge[7] = true; //BACK_NUDGE
|
||||||
isNudge[8] = true; //DOWN_Nudge
|
isNudge[8] = true; //LEFT_NUDGE
|
||||||
|
isNudge[9] = true; //RIGHT_NUDGE
|
||||||
|
isNudge[10] = true; //DOWN_Nudge
|
||||||
return isNudge;
|
return isNudge;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1618,21 +1626,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
SceneObjectPart part = m_scene.GetSceneObjectPart(m_parentID);
|
SceneObjectPart part = m_scene.GetSceneObjectPart(m_parentID);
|
||||||
if (part != null)
|
if (part != null)
|
||||||
{
|
{
|
||||||
|
part.TaskInventory.LockItemsForRead(true);
|
||||||
TaskInventoryDictionary taskIDict = part.TaskInventory;
|
TaskInventoryDictionary taskIDict = part.TaskInventory;
|
||||||
if (taskIDict != null)
|
if (taskIDict != null)
|
||||||
{
|
{
|
||||||
lock (taskIDict)
|
foreach (UUID taskID in taskIDict.Keys)
|
||||||
{
|
{
|
||||||
foreach (UUID taskID in taskIDict.Keys)
|
UnRegisterControlEventsToScript(LocalId, taskID);
|
||||||
{
|
taskIDict[taskID].PermsMask &= ~(
|
||||||
UnRegisterControlEventsToScript(LocalId, taskID);
|
2048 | //PERMISSION_CONTROL_CAMERA
|
||||||
taskIDict[taskID].PermsMask &= ~(
|
4); // PERMISSION_TAKE_CONTROLS
|
||||||
2048 | //PERMISSION_CONTROL_CAMERA
|
|
||||||
4); // PERMISSION_TAKE_CONTROLS
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
part.TaskInventory.LockItemsForRead(false);
|
||||||
// Reset sit target.
|
// Reset sit target.
|
||||||
if (part.GetAvatarOnSitTarget() == UUID)
|
if (part.GetAvatarOnSitTarget() == UUID)
|
||||||
part.SetAvatarOnSitTarget(UUID.Zero);
|
part.SetAvatarOnSitTarget(UUID.Zero);
|
||||||
|
|
|
@ -82,6 +82,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
private int m_fps = 0;
|
private int m_fps = 0;
|
||||||
// saved last reported value so there is something available for llGetRegionFPS
|
// saved last reported value so there is something available for llGetRegionFPS
|
||||||
private float lastReportedSimFPS = 0;
|
private float lastReportedSimFPS = 0;
|
||||||
|
private float[] lastReportedSimStats = new float[21];
|
||||||
private float m_pfps = 0;
|
private float m_pfps = 0;
|
||||||
private int m_agentUpdates = 0;
|
private int m_agentUpdates = 0;
|
||||||
|
|
||||||
|
@ -260,6 +261,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
sb[20].StatID = (uint)Stats.ScriptLinesPerSecond;
|
sb[20].StatID = (uint)Stats.ScriptLinesPerSecond;
|
||||||
sb[20].StatValue = m_scriptLinesPerSecond / statsUpdateFactor;
|
sb[20].StatValue = m_scriptLinesPerSecond / statsUpdateFactor;
|
||||||
|
|
||||||
|
for (int i = 0; i < 21; i++)
|
||||||
|
{
|
||||||
|
lastReportedSimStats[i] = sb[i].StatValue;
|
||||||
|
}
|
||||||
|
|
||||||
SimStats simStats
|
SimStats simStats
|
||||||
= new SimStats(
|
= new SimStats(
|
||||||
ReportingRegion.RegionLocX, ReportingRegion.RegionLocY, regionFlags, (uint)objectCapacity, rb, sb, m_scene.RegionInfo.originRegionID);
|
ReportingRegion.RegionLocX, ReportingRegion.RegionLocY, regionFlags, (uint)objectCapacity, rb, sb, m_scene.RegionInfo.originRegionID);
|
||||||
|
@ -439,6 +445,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return lastReportedSimFPS;
|
return lastReportedSimFPS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float[] getLastReportedSimStats()
|
||||||
|
{
|
||||||
|
return lastReportedSimStats;
|
||||||
|
}
|
||||||
|
|
||||||
public void AddPacketsStats(int inPackets, int outPackets, int unAckedBytes)
|
public void AddPacketsStats(int inPackets, int outPackets, int unAckedBytes)
|
||||||
{
|
{
|
||||||
AddInPackets(inPackets);
|
AddInPackets(inPackets);
|
||||||
|
|
|
@ -62,7 +62,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
||||||
|
|
||||||
public void Initialise(IConfigSource config)
|
public void Initialise(IConfigSource config)
|
||||||
{
|
{
|
||||||
m_log.Info("[RegionReady] Initialising");
|
//m_log.Info("[RegionReady] Initialising");
|
||||||
|
|
||||||
m_config = config.Configs["RegionReady"];
|
m_config = config.Configs["RegionReady"];
|
||||||
if (m_config != null)
|
if (m_config != null)
|
||||||
|
@ -74,8 +74,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_enabled)
|
// if (!m_enabled)
|
||||||
m_log.Info("[RegionReady] disabled.");
|
// m_log.Info("[RegionReady] disabled.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddRegion(Scene scene)
|
public void AddRegion(Scene scene)
|
||||||
|
@ -92,7 +92,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
||||||
m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue;
|
m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue;
|
||||||
m_scene.EventManager.OnOarFileLoaded += OnOarFileLoaded;
|
m_scene.EventManager.OnOarFileLoaded += OnOarFileLoaded;
|
||||||
|
|
||||||
m_log.InfoFormat("[RegionReady]: Enabled for region {0}", scene.RegionInfo.RegionName);
|
m_log.DebugFormat("[RegionReady]: Enabled for region {0}", scene.RegionInfo.RegionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveRegion(Scene scene)
|
public void RemoveRegion(Scene scene)
|
||||||
|
@ -121,7 +121,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
void OnEmptyScriptCompileQueue(int numScriptsFailed, string message)
|
void OnEmptyScriptCompileQueue(int numScriptsFailed, string message)
|
||||||
{
|
{
|
||||||
if (m_firstEmptyCompileQueue || m_oarFileLoading)
|
if (m_firstEmptyCompileQueue || m_oarFileLoading)
|
||||||
|
|
|
@ -835,7 +835,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
// allows us to have different settings
|
// allows us to have different settings
|
||||||
|
|
||||||
// We only need to test p2 for 'jump crouch purposes'
|
// We only need to test p2 for 'jump crouch purposes'
|
||||||
if (p2 is OdeCharacter)
|
if (p2 is OdeCharacter && p1.PhysicsActorType == (int)ActorTypes.Prim)
|
||||||
{
|
{
|
||||||
// Testing if the collision is at the feet of the avatar
|
// Testing if the collision is at the feet of the avatar
|
||||||
|
|
||||||
|
|
|
@ -118,6 +118,7 @@ public class RegionCombinerLargeLandChannel : ILandChannel
|
||||||
return regionData.RegionScene.LandChannel.GetLandObject(x - offsetX, y - offsetY);
|
return regionData.RegionScene.LandChannel.GetLandObject(x - offsetX, y - offsetY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene);
|
ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene);
|
||||||
obj.LandData.Name = "NO LAND";
|
obj.LandData.Name = "NO LAND";
|
||||||
return obj;
|
return obj;
|
||||||
|
|
|
@ -96,7 +96,6 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
|
||||||
UUID GetDetectID(int idx);
|
UUID GetDetectID(int idx);
|
||||||
void SaveState(string assembly);
|
void SaveState(string assembly);
|
||||||
void DestroyScriptInstance();
|
void DestroyScriptInstance();
|
||||||
bool CanBeDeleted();
|
|
||||||
|
|
||||||
IScriptApi GetApi(string name);
|
IScriptApi GetApi(string name);
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics; //for [DebuggerNonUserCode]
|
||||||
using System.Runtime.Remoting.Lifetime;
|
using System.Runtime.Remoting.Lifetime;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
@ -151,6 +152,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
get { return m_ScriptEngine.World; }
|
get { return m_ScriptEngine.World; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DebuggerNonUserCode]
|
||||||
public void state(string newState)
|
public void state(string newState)
|
||||||
{
|
{
|
||||||
m_ScriptEngine.SetState(m_itemID, newState);
|
m_ScriptEngine.SetState(m_itemID, newState);
|
||||||
|
@ -160,6 +162,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
/// Reset the named script. The script must be present
|
/// Reset the named script. The script must be present
|
||||||
/// in the same prim.
|
/// in the same prim.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[DebuggerNonUserCode]
|
||||||
public void llResetScript()
|
public void llResetScript()
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
@ -272,40 +275,48 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
protected UUID InventorySelf()
|
protected UUID InventorySelf()
|
||||||
{
|
{
|
||||||
UUID invItemID = new UUID();
|
UUID invItemID = new UUID();
|
||||||
|
bool unlock = false;
|
||||||
lock (m_host.TaskInventory)
|
if (!m_host.TaskInventory.IsReadLockedByMe())
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
unlock = true;
|
||||||
|
}
|
||||||
|
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||||
|
{
|
||||||
|
if (inv.Value.Type == 10 && inv.Value.ItemID == m_itemID)
|
||||||
{
|
{
|
||||||
if (inv.Value.Type == 10 && inv.Value.ItemID == m_itemID)
|
invItemID = inv.Key;
|
||||||
{
|
break;
|
||||||
invItemID = inv.Key;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (unlock)
|
||||||
|
{
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
}
|
||||||
return invItemID;
|
return invItemID;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected UUID InventoryKey(string name, int type)
|
protected UUID InventoryKey(string name, int type)
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
if (inv.Value.Name == name)
|
||||||
{
|
{
|
||||||
if (inv.Value.Name == name)
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
{
|
|
||||||
if (inv.Value.Type != type)
|
|
||||||
return UUID.Zero;
|
|
||||||
|
|
||||||
return inv.Value.AssetID;
|
if (inv.Value.Type != type)
|
||||||
|
{
|
||||||
|
return UUID.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return inv.Value.AssetID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
return UUID.Zero;
|
return UUID.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -313,17 +324,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
|
||||||
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
|
||||||
|
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
if (inv.Value.Name == name)
|
||||||
{
|
{
|
||||||
if (inv.Value.Name == name)
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
{
|
return inv.Value.AssetID;
|
||||||
return inv.Value.AssetID;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
|
|
||||||
return UUID.Zero;
|
return UUID.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1987,6 +2002,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
//KF: Do NOT use this next line if using ODE physics engine. This need a switch based on .ini Phys Engine type
|
//KF: Do NOT use this next line if using ODE physics engine. This need a switch based on .ini Phys Engine type
|
||||||
// part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition;
|
// part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition;
|
||||||
|
|
||||||
|
// So, after thinking about this for a bit, the issue with the part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition line
|
||||||
|
// is it isn't compatible with vehicles because it causes the vehicle body to have to be broken down and rebuilt
|
||||||
|
// It's perfectly okay when the object is not an active physical body though.
|
||||||
|
// So, part.ParentGroup.ResetChildPrimPhysicsPositions(); does the thing that Kitto is warning against
|
||||||
|
// but only if the object is not physial and active. This is important for rotating doors.
|
||||||
|
// without the absoluteposition = absoluteposition happening, the doors do not move in the physics
|
||||||
|
// scene
|
||||||
|
if (part.PhysActor != null && !part.PhysActor.IsPhysical)
|
||||||
|
{
|
||||||
|
part.ParentGroup.ResetChildPrimPhysicsPositions();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -2534,12 +2561,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
TaskInventoryItem item = m_host.TaskInventory[invItemID];
|
TaskInventoryItem item = m_host.TaskInventory[invItemID];
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
lock (m_host.TaskInventory)
|
|
||||||
{
|
|
||||||
item = m_host.TaskInventory[invItemID];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.PermsGranter == UUID.Zero)
|
if (item.PermsGranter == UUID.Zero)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2614,6 +2638,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
if (dist > m_ScriptDistanceFactor * 10.0f)
|
if (dist > m_ScriptDistanceFactor * 10.0f)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
//Clone is thread-safe
|
||||||
TaskInventoryDictionary partInventory = (TaskInventoryDictionary)m_host.TaskInventory.Clone();
|
TaskInventoryDictionary partInventory = (TaskInventoryDictionary)m_host.TaskInventory.Clone();
|
||||||
|
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in partInventory)
|
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in partInventory)
|
||||||
|
@ -2747,13 +2772,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
TaskInventoryItem item;
|
TaskInventoryItem item;
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
|
||||||
{
|
{
|
||||||
if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
return;
|
return;
|
||||||
else
|
|
||||||
item = m_host.TaskInventory[InventorySelf()];
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
item = m_host.TaskInventory[InventorySelf()];
|
||||||
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
if (item.PermsGranter != UUID.Zero)
|
if (item.PermsGranter != UUID.Zero)
|
||||||
{
|
{
|
||||||
|
@ -2775,13 +2804,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
TaskInventoryItem item;
|
TaskInventoryItem item;
|
||||||
|
|
||||||
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
lock (m_host.TaskInventory)
|
lock (m_host.TaskInventory)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
|
if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
|
||||||
|
{
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
item = m_host.TaskInventory[InventorySelf()];
|
item = m_host.TaskInventory[InventorySelf()];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
|
@ -2818,13 +2855,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
TaskInventoryItem item;
|
TaskInventoryItem item;
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
|
||||||
|
if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
|
||||||
{
|
{
|
||||||
if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
return;
|
return;
|
||||||
else
|
|
||||||
item = m_host.TaskInventory[InventorySelf()];
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
item = m_host.TaskInventory[InventorySelf()];
|
||||||
|
}
|
||||||
|
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
if (item.PermsGranter != m_host.OwnerID)
|
if (item.PermsGranter != m_host.OwnerID)
|
||||||
return;
|
return;
|
||||||
|
@ -2850,13 +2893,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
TaskInventoryItem item;
|
TaskInventoryItem item;
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
|
||||||
|
if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
|
||||||
{
|
{
|
||||||
if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
return;
|
return;
|
||||||
else
|
|
||||||
item = m_host.TaskInventory[InventorySelf()];
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
item = m_host.TaskInventory[InventorySelf()];
|
||||||
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
|
|
||||||
if (item.PermsGranter != m_host.OwnerID)
|
if (item.PermsGranter != m_host.OwnerID)
|
||||||
return;
|
return;
|
||||||
|
@ -3080,14 +3129,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
TaskInventoryItem item;
|
TaskInventoryItem item;
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
|
||||||
{
|
{
|
||||||
if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
return;
|
return;
|
||||||
else
|
|
||||||
item = m_host.TaskInventory[InventorySelf()];
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
item = m_host.TaskInventory[InventorySelf()];
|
||||||
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
if (item.PermsGranter == UUID.Zero)
|
if (item.PermsGranter == UUID.Zero)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -3117,13 +3169,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
TaskInventoryItem item;
|
TaskInventoryItem item;
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
|
||||||
{
|
{
|
||||||
if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
return;
|
return;
|
||||||
else
|
|
||||||
item = m_host.TaskInventory[InventorySelf()];
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
item = m_host.TaskInventory[InventorySelf()];
|
||||||
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
|
|
||||||
if (item.PermsGranter == UUID.Zero)
|
if (item.PermsGranter == UUID.Zero)
|
||||||
return;
|
return;
|
||||||
|
@ -3196,10 +3253,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
TaskInventoryItem item;
|
TaskInventoryItem item;
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
|
||||||
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
if (!m_host.TaskInventory.ContainsKey(invItemID))
|
||||||
|
{
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
item = m_host.TaskInventory[invItemID];
|
item = m_host.TaskInventory[invItemID];
|
||||||
}
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
if (agentID == UUID.Zero || perm == 0) // Releasing permissions
|
if (agentID == UUID.Zero || perm == 0) // Releasing permissions
|
||||||
{
|
{
|
||||||
|
@ -3231,11 +3296,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
if ((perm & (~implicitPerms)) == 0) // Requested only implicit perms
|
if ((perm & (~implicitPerms)) == 0) // Requested only implicit perms
|
||||||
{
|
{
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForWrite(true);
|
||||||
{
|
m_host.TaskInventory[invItemID].PermsGranter = agentID;
|
||||||
m_host.TaskInventory[invItemID].PermsGranter = agentID;
|
m_host.TaskInventory[invItemID].PermsMask = perm;
|
||||||
m_host.TaskInventory[invItemID].PermsMask = perm;
|
m_host.TaskInventory.LockItemsForWrite(false);
|
||||||
}
|
|
||||||
|
|
||||||
m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
|
m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
|
||||||
"run_time_permissions", new Object[] {
|
"run_time_permissions", new Object[] {
|
||||||
|
@ -3255,11 +3319,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
if ((perm & (~implicitPerms)) == 0) // Requested only implicit perms
|
if ((perm & (~implicitPerms)) == 0) // Requested only implicit perms
|
||||||
{
|
{
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForWrite(true);
|
||||||
{
|
m_host.TaskInventory[invItemID].PermsGranter = agentID;
|
||||||
m_host.TaskInventory[invItemID].PermsGranter = agentID;
|
m_host.TaskInventory[invItemID].PermsMask = perm;
|
||||||
m_host.TaskInventory[invItemID].PermsMask = perm;
|
m_host.TaskInventory.LockItemsForWrite(false);
|
||||||
}
|
|
||||||
|
|
||||||
m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
|
m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
|
||||||
"run_time_permissions", new Object[] {
|
"run_time_permissions", new Object[] {
|
||||||
|
@ -3280,11 +3343,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
if (!m_waitingForScriptAnswer)
|
if (!m_waitingForScriptAnswer)
|
||||||
{
|
{
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForWrite(true);
|
||||||
{
|
m_host.TaskInventory[invItemID].PermsGranter = agentID;
|
||||||
m_host.TaskInventory[invItemID].PermsGranter = agentID;
|
m_host.TaskInventory[invItemID].PermsMask = 0;
|
||||||
m_host.TaskInventory[invItemID].PermsMask = 0;
|
m_host.TaskInventory.LockItemsForWrite(false);
|
||||||
}
|
|
||||||
|
|
||||||
presence.ControllingClient.OnScriptAnswer += handleScriptAnswer;
|
presence.ControllingClient.OnScriptAnswer += handleScriptAnswer;
|
||||||
m_waitingForScriptAnswer=true;
|
m_waitingForScriptAnswer=true;
|
||||||
|
@ -3319,10 +3381,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
if ((answer & ScriptBaseClass.PERMISSION_TAKE_CONTROLS) == 0)
|
if ((answer & ScriptBaseClass.PERMISSION_TAKE_CONTROLS) == 0)
|
||||||
llReleaseControls();
|
llReleaseControls();
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
|
||||||
{
|
m_host.TaskInventory.LockItemsForWrite(true);
|
||||||
m_host.TaskInventory[invItemID].PermsMask = answer;
|
m_host.TaskInventory[invItemID].PermsMask = answer;
|
||||||
}
|
m_host.TaskInventory.LockItemsForWrite(false);
|
||||||
|
|
||||||
|
|
||||||
m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
|
m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
|
||||||
"run_time_permissions", new Object[] {
|
"run_time_permissions", new Object[] {
|
||||||
|
@ -3334,16 +3397,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
|
||||||
|
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
||||||
{
|
{
|
||||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
if (item.Type == 10 && item.ItemID == m_itemID)
|
||||||
{
|
{
|
||||||
if (item.Type == 10 && item.ItemID == m_itemID)
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
{
|
return item.PermsGranter.ToString();
|
||||||
return item.PermsGranter.ToString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
return UUID.Zero.ToString();
|
return UUID.Zero.ToString();
|
||||||
}
|
}
|
||||||
|
@ -3352,19 +3416,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
|
||||||
|
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
||||||
{
|
{
|
||||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
if (item.Type == 10 && item.ItemID == m_itemID)
|
||||||
{
|
{
|
||||||
if (item.Type == 10 && item.ItemID == m_itemID)
|
int perms = item.PermsMask;
|
||||||
{
|
if (m_automaticLinkPermission)
|
||||||
int perms = item.PermsMask;
|
perms |= ScriptBaseClass.PERMISSION_CHANGE_LINKS;
|
||||||
if (m_automaticLinkPermission)
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
perms |= ScriptBaseClass.PERMISSION_CHANGE_LINKS;
|
return perms;
|
||||||
return perms;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -3397,10 +3462,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
UUID invItemID = InventorySelf();
|
UUID invItemID = InventorySelf();
|
||||||
|
|
||||||
TaskInventoryItem item;
|
TaskInventoryItem item;
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
{
|
item = m_host.TaskInventory[invItemID];
|
||||||
item = m_host.TaskInventory[invItemID];
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
}
|
|
||||||
|
|
||||||
if ((item.PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0
|
if ((item.PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0
|
||||||
&& !m_automaticLinkPermission)
|
&& !m_automaticLinkPermission)
|
||||||
|
@ -3454,15 +3518,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
UUID invItemID = InventorySelf();
|
UUID invItemID = InventorySelf();
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
{
|
|
||||||
if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0
|
if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0
|
||||||
&& !m_automaticLinkPermission)
|
&& !m_automaticLinkPermission)
|
||||||
{
|
{
|
||||||
ShoutError("Script trying to link but PERMISSION_CHANGE_LINKS permission not set!");
|
ShoutError("Script trying to link but PERMISSION_CHANGE_LINKS permission not set!");
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
if (linknum < ScriptBaseClass.LINK_THIS)
|
if (linknum < ScriptBaseClass.LINK_THIS)
|
||||||
return;
|
return;
|
||||||
|
@ -3632,17 +3696,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
if (inv.Value.Type == type || type == -1)
|
||||||
{
|
{
|
||||||
if (inv.Value.Type == type || type == -1)
|
count = count + 1;
|
||||||
{
|
|
||||||
count = count + 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3651,16 +3714,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
ArrayList keys = new ArrayList();
|
ArrayList keys = new ArrayList();
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
if (inv.Value.Type == type || type == -1)
|
||||||
{
|
{
|
||||||
if (inv.Value.Type == type || type == -1)
|
keys.Add(inv.Value.Name);
|
||||||
{
|
|
||||||
keys.Add(inv.Value.Name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
if (keys.Count == 0)
|
if (keys.Count == 0)
|
||||||
{
|
{
|
||||||
|
@ -3697,20 +3759,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
|
|
||||||
// move the first object found with this inventory name
|
// move the first object found with this inventory name
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
if (inv.Value.Name == inventory)
|
||||||
{
|
{
|
||||||
if (inv.Value.Name == inventory)
|
found = true;
|
||||||
{
|
objId = inv.Key;
|
||||||
found = true;
|
assetType = inv.Value.Type;
|
||||||
objId = inv.Key;
|
objName = inv.Value.Name;
|
||||||
assetType = inv.Value.Type;
|
break;
|
||||||
objName = inv.Value.Name;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
|
@ -3755,24 +3816,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
ScriptSleep(3000);
|
ScriptSleep(3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DebuggerNonUserCode]
|
||||||
public void llRemoveInventory(string name)
|
public void llRemoveInventory(string name)
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
||||||
{
|
{
|
||||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
if (item.Name == name)
|
||||||
{
|
{
|
||||||
if (item.Name == name)
|
if (item.ItemID == m_itemID)
|
||||||
{
|
throw new ScriptDeleteException();
|
||||||
if (item.ItemID == m_itemID)
|
else
|
||||||
throw new ScriptDeleteException();
|
m_host.Inventory.RemoveInventoryItem(item.ItemID);
|
||||||
else
|
|
||||||
m_host.Inventory.RemoveInventoryItem(item.ItemID);
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void llSetText(string text, LSL_Vector color, double alpha)
|
public void llSetText(string text, LSL_Vector color, double alpha)
|
||||||
|
@ -3861,6 +3924,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
|
//Clone is thread safe
|
||||||
TaskInventoryDictionary itemDictionary = (TaskInventoryDictionary)m_host.TaskInventory.Clone();
|
TaskInventoryDictionary itemDictionary = (TaskInventoryDictionary)m_host.TaskInventory.Clone();
|
||||||
|
|
||||||
foreach (TaskInventoryItem item in itemDictionary.Values)
|
foreach (TaskInventoryItem item in itemDictionary.Values)
|
||||||
|
@ -3951,17 +4015,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
UUID soundId = UUID.Zero;
|
UUID soundId = UUID.Zero;
|
||||||
if (!UUID.TryParse(impact_sound, out soundId))
|
if (!UUID.TryParse(impact_sound, out soundId))
|
||||||
{
|
{
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
||||||
{
|
{
|
||||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
if (item.Type == (int)AssetType.Sound && item.Name == impact_sound)
|
||||||
{
|
{
|
||||||
if (item.Type == (int)AssetType.Sound && item.Name == impact_sound)
|
soundId = item.AssetID;
|
||||||
{
|
break;
|
||||||
soundId = item.AssetID;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
}
|
}
|
||||||
m_host.CollisionSound = soundId;
|
m_host.CollisionSound = soundId;
|
||||||
m_host.CollisionSoundVolume = (float)impact_volume;
|
m_host.CollisionSoundVolume = (float)impact_volume;
|
||||||
|
@ -4007,6 +4070,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
UUID partItemID;
|
UUID partItemID;
|
||||||
foreach (SceneObjectPart part in parts)
|
foreach (SceneObjectPart part in parts)
|
||||||
{
|
{
|
||||||
|
//Clone is thread safe
|
||||||
TaskInventoryDictionary itemsDictionary = (TaskInventoryDictionary)part.TaskInventory.Clone();
|
TaskInventoryDictionary itemsDictionary = (TaskInventoryDictionary)part.TaskInventory.Clone();
|
||||||
|
|
||||||
foreach (TaskInventoryItem item in itemsDictionary.Values)
|
foreach (TaskInventoryItem item in itemsDictionary.Values)
|
||||||
|
@ -4214,17 +4278,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
||||||
{
|
{
|
||||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
if (item.Type == 10 && item.ItemID == m_itemID)
|
||||||
{
|
{
|
||||||
if (item.Type == 10 && item.ItemID == m_itemID)
|
result = item.Name!=null?item.Name:String.Empty;
|
||||||
{
|
break;
|
||||||
result = item.Name!=null?item.Name:String.Empty;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -4482,23 +4545,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
if (inv.Value.Name == name)
|
||||||
{
|
{
|
||||||
if (inv.Value.Name == name)
|
if ((inv.Value.CurrentPermissions & (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify)) == (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify))
|
||||||
{
|
{
|
||||||
if ((inv.Value.CurrentPermissions & (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify)) == (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify))
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
{
|
return inv.Value.AssetID.ToString();
|
||||||
return inv.Value.AssetID.ToString();
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
return UUID.Zero.ToString();
|
return UUID.Zero.ToString();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
return UUID.Zero.ToString();
|
return UUID.Zero.ToString();
|
||||||
}
|
}
|
||||||
|
@ -5777,6 +5841,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return World.SimulatorFPS;
|
return World.SimulatorFPS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* particle system rules should be coming into this routine as doubles, that is
|
/* particle system rules should be coming into this routine as doubles, that is
|
||||||
rule[0] should be an integer from this list and rule[1] should be the arg
|
rule[0] should be an integer from this list and rule[1] should be the arg
|
||||||
for the same integer. wiki.secondlife.com has most of this mapping, but some
|
for the same integer. wiki.secondlife.com has most of this mapping, but some
|
||||||
|
@ -5993,14 +6058,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
protected UUID GetTaskInventoryItem(string name)
|
protected UUID GetTaskInventoryItem(string name)
|
||||||
{
|
{
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
if (inv.Value.Name == name)
|
||||||
{
|
{
|
||||||
if (inv.Value.Name == name)
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
return inv.Key;
|
return inv.Key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
return UUID.Zero;
|
return UUID.Zero;
|
||||||
}
|
}
|
||||||
|
@ -6311,22 +6378,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy the first script found with this inventory name
|
// copy the first script found with this inventory name
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
if (inv.Value.Name == name)
|
||||||
{
|
{
|
||||||
if (inv.Value.Name == name)
|
// make sure the object is a script
|
||||||
|
if (10 == inv.Value.Type)
|
||||||
{
|
{
|
||||||
// make sure the object is a script
|
found = true;
|
||||||
if (10 == inv.Value.Type)
|
srcId = inv.Key;
|
||||||
{
|
break;
|
||||||
found = true;
|
|
||||||
srcId = inv.Key;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
|
@ -8129,28 +8195,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
if (inv.Value.Name == item)
|
||||||
{
|
{
|
||||||
if (inv.Value.Name == item)
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
switch (mask)
|
||||||
{
|
{
|
||||||
switch (mask)
|
case 0:
|
||||||
{
|
return (int)inv.Value.BasePermissions;
|
||||||
case 0:
|
case 1:
|
||||||
return (int)inv.Value.BasePermissions;
|
return (int)inv.Value.CurrentPermissions;
|
||||||
case 1:
|
case 2:
|
||||||
return (int)inv.Value.CurrentPermissions;
|
return (int)inv.Value.GroupPermissions;
|
||||||
case 2:
|
case 3:
|
||||||
return (int)inv.Value.GroupPermissions;
|
return (int)inv.Value.EveryonePermissions;
|
||||||
case 3:
|
case 4:
|
||||||
return (int)inv.Value.EveryonePermissions;
|
return (int)inv.Value.NextPermissions;
|
||||||
case 4:
|
|
||||||
return (int)inv.Value.NextPermissions;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -8165,16 +8231,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
if (inv.Value.Name == item)
|
||||||
{
|
{
|
||||||
if (inv.Value.Name == item)
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
{
|
return inv.Value.CreatorID.ToString();
|
||||||
return inv.Value.CreatorID.ToString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
llSay(0, "No item name '" + item + "'");
|
llSay(0, "No item name '" + item + "'");
|
||||||
|
|
||||||
|
@ -8698,16 +8764,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
if (inv.Value.Name == name)
|
||||||
{
|
{
|
||||||
if (inv.Value.Name == name)
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
{
|
return inv.Value.Type;
|
||||||
return inv.Value.Type;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -8738,18 +8804,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
if (invItemID == UUID.Zero)
|
if (invItemID == UUID.Zero)
|
||||||
return new LSL_Vector();
|
return new LSL_Vector();
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero)
|
||||||
{
|
{
|
||||||
if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero)
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
return new LSL_Vector();
|
return new LSL_Vector();
|
||||||
|
|
||||||
if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0)
|
|
||||||
{
|
|
||||||
ShoutError("No permissions to track the camera");
|
|
||||||
return new LSL_Vector();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0)
|
||||||
|
{
|
||||||
|
ShoutError("No permissions to track the camera");
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
return new LSL_Vector();
|
||||||
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
|
ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
|
||||||
if (presence != null)
|
if (presence != null)
|
||||||
{
|
{
|
||||||
|
@ -8766,17 +8835,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
if (invItemID == UUID.Zero)
|
if (invItemID == UUID.Zero)
|
||||||
return new LSL_Rotation();
|
return new LSL_Rotation();
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero)
|
||||||
{
|
{
|
||||||
if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero)
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
return new LSL_Rotation();
|
return new LSL_Rotation();
|
||||||
|
|
||||||
if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0)
|
|
||||||
{
|
|
||||||
ShoutError("No permissions to track the camera");
|
|
||||||
return new LSL_Rotation();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0)
|
||||||
|
{
|
||||||
|
ShoutError("No permissions to track the camera");
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
return new LSL_Rotation();
|
||||||
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
|
ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
|
||||||
if (presence != null)
|
if (presence != null)
|
||||||
|
@ -8926,14 +8997,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
if (objectID == UUID.Zero) return;
|
if (objectID == UUID.Zero) return;
|
||||||
|
|
||||||
UUID agentID;
|
UUID agentID;
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
{
|
// we need the permission first, to know which avatar we want to set the camera for
|
||||||
// we need the permission first, to know which avatar we want to set the camera for
|
agentID = m_host.TaskInventory[invItemID].PermsGranter;
|
||||||
agentID = m_host.TaskInventory[invItemID].PermsGranter;
|
|
||||||
|
|
||||||
if (agentID == UUID.Zero) return;
|
if (agentID == UUID.Zero)
|
||||||
if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return;
|
{
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0)
|
||||||
|
{
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
ScenePresence presence = World.GetScenePresence(agentID);
|
ScenePresence presence = World.GetScenePresence(agentID);
|
||||||
|
|
||||||
|
@ -8983,12 +9061,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
// we need the permission first, to know which avatar we want to clear the camera for
|
// we need the permission first, to know which avatar we want to clear the camera for
|
||||||
UUID agentID;
|
UUID agentID;
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
agentID = m_host.TaskInventory[invItemID].PermsGranter;
|
||||||
|
if (agentID == UUID.Zero)
|
||||||
{
|
{
|
||||||
agentID = m_host.TaskInventory[invItemID].PermsGranter;
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
if (agentID == UUID.Zero) return;
|
return;
|
||||||
if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return;
|
|
||||||
}
|
}
|
||||||
|
if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0)
|
||||||
|
{
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
ScenePresence presence = World.GetScenePresence(agentID);
|
ScenePresence presence = World.GetScenePresence(agentID);
|
||||||
|
|
||||||
|
@ -9445,15 +9530,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
internal UUID ScriptByName(string name)
|
internal UUID ScriptByName(string name)
|
||||||
{
|
{
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
|
||||||
|
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
||||||
{
|
{
|
||||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
if (item.Type == 10 && item.Name == name)
|
||||||
{
|
{
|
||||||
if (item.Type == 10 && item.Name == name)
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
return item.ItemID;
|
return item.ItemID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
return UUID.Zero;
|
return UUID.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9494,6 +9583,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
|
//Clone is thread safe
|
||||||
TaskInventoryDictionary itemsDictionary = (TaskInventoryDictionary)m_host.TaskInventory.Clone();
|
TaskInventoryDictionary itemsDictionary = (TaskInventoryDictionary)m_host.TaskInventory.Clone();
|
||||||
|
|
||||||
UUID assetID = UUID.Zero;
|
UUID assetID = UUID.Zero;
|
||||||
|
@ -9556,6 +9646,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
|
//Clone is thread safe
|
||||||
TaskInventoryDictionary itemsDictionary = (TaskInventoryDictionary)m_host.TaskInventory.Clone();
|
TaskInventoryDictionary itemsDictionary = (TaskInventoryDictionary)m_host.TaskInventory.Clone();
|
||||||
|
|
||||||
UUID assetID = UUID.Zero;
|
UUID assetID = UUID.Zero;
|
||||||
|
|
|
@ -636,13 +636,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
|
|
||||||
// Teleport functions
|
// Teleport functions
|
||||||
public void osTeleportAgent(string agent, uint regionX, uint regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
|
public void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
|
||||||
{
|
{
|
||||||
// High because there is no security check. High griefer potential
|
// High because there is no security check. High griefer potential
|
||||||
//
|
//
|
||||||
CheckThreatLevel(ThreatLevel.High, "osTeleportAgent");
|
CheckThreatLevel(ThreatLevel.High, "osTeleportAgent");
|
||||||
|
|
||||||
ulong regionHandle = Util.UIntsToLong((regionX * (uint)Constants.RegionSize), (regionY * (uint)Constants.RegionSize));
|
ulong regionHandle = Util.UIntsToLong(((uint)regionX * (uint)Constants.RegionSize), ((uint)regionY * (uint)Constants.RegionSize));
|
||||||
|
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
UUID agentId = new UUID();
|
UUID agentId = new UUID();
|
||||||
|
@ -728,18 +728,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
if (target != null)
|
if (target != null)
|
||||||
{
|
{
|
||||||
UUID animID=UUID.Zero;
|
UUID animID=UUID.Zero;
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
if (inv.Value.Name == animation)
|
||||||
{
|
{
|
||||||
if (inv.Value.Name == animation)
|
if (inv.Value.Type == (int)AssetType.Animation)
|
||||||
{
|
animID = inv.Value.AssetID;
|
||||||
if (inv.Value.Type == (int)AssetType.Animation)
|
continue;
|
||||||
animID = inv.Value.AssetID;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
if (animID == UUID.Zero)
|
if (animID == UUID.Zero)
|
||||||
target.Animator.AddAnimation(animation, m_host.UUID);
|
target.Animator.AddAnimation(animation, m_host.UUID);
|
||||||
else
|
else
|
||||||
|
@ -761,18 +760,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
if (target != null)
|
if (target != null)
|
||||||
{
|
{
|
||||||
UUID animID=UUID.Zero;
|
UUID animID=UUID.Zero;
|
||||||
lock (m_host.TaskInventory)
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
|
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
if (inv.Value.Name == animation)
|
||||||
{
|
{
|
||||||
if (inv.Value.Name == animation)
|
if (inv.Value.Type == (int)AssetType.Animation)
|
||||||
{
|
animID = inv.Value.AssetID;
|
||||||
if (inv.Value.Type == (int)AssetType.Animation)
|
continue;
|
||||||
animID = inv.Value.AssetID;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
if (animID == UUID.Zero)
|
if (animID == UUID.Zero)
|
||||||
target.Animator.RemoveAnimation(animation);
|
target.Animator.RemoveAnimation(animation);
|
||||||
|
@ -1541,6 +1539,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
if (!UUID.TryParse(name, out assetID))
|
if (!UUID.TryParse(name, out assetID))
|
||||||
{
|
{
|
||||||
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
||||||
{
|
{
|
||||||
if (item.Type == 7 && item.Name == name)
|
if (item.Type == 7 && item.Name == name)
|
||||||
|
@ -1548,6 +1547,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
assetID = item.AssetID;
|
assetID = item.AssetID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (assetID == UUID.Zero)
|
if (assetID == UUID.Zero)
|
||||||
|
@ -1594,6 +1594,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
if (!UUID.TryParse(name, out assetID))
|
if (!UUID.TryParse(name, out assetID))
|
||||||
{
|
{
|
||||||
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
||||||
{
|
{
|
||||||
if (item.Type == 7 && item.Name == name)
|
if (item.Type == 7 && item.Name == name)
|
||||||
|
@ -1601,6 +1602,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
assetID = item.AssetID;
|
assetID = item.AssetID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (assetID == UUID.Zero)
|
if (assetID == UUID.Zero)
|
||||||
|
@ -1651,6 +1653,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
if (!UUID.TryParse(name, out assetID))
|
if (!UUID.TryParse(name, out assetID))
|
||||||
{
|
{
|
||||||
|
m_host.TaskInventory.LockItemsForRead(true);
|
||||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
||||||
{
|
{
|
||||||
if (item.Type == 7 && item.Name == name)
|
if (item.Type == 7 && item.Name == name)
|
||||||
|
@ -1658,6 +1661,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
assetID = item.AssetID;
|
assetID = item.AssetID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_host.TaskInventory.LockItemsForRead(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (assetID == UUID.Zero)
|
if (assetID == UUID.Zero)
|
||||||
|
@ -1948,5 +1952,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
return key.ToString();
|
return key.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return information regarding various simulator statistics (sim fps, physics fps, time
|
||||||
|
/// dilation, total number of prims, total number of active scripts, script lps, various
|
||||||
|
/// timing data, packets in/out, etc. Basically much the information that's shown in the
|
||||||
|
/// client's Statistics Bar (Ctrl-Shift-1)
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>List of floats</returns>
|
||||||
|
public LSL_List osGetRegionStats()
|
||||||
|
{
|
||||||
|
CheckThreatLevel(ThreatLevel.Moderate, "osGetRegionStats");
|
||||||
|
m_host.AddScriptLPS(1);
|
||||||
|
LSL_List ret = new LSL_List();
|
||||||
|
float[] stats = World.SimulatorStats;
|
||||||
|
|
||||||
|
for (int i = 0; i < 21; i++)
|
||||||
|
{
|
||||||
|
ret.Add(new LSL_Float( stats[i] ));
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||||
|
|
||||||
// Teleport commands
|
// Teleport commands
|
||||||
void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
|
void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
|
||||||
void osTeleportAgent(string agent, uint regionX, uint regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
|
void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
|
||||||
void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
|
void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
|
||||||
|
|
||||||
// Animation commands
|
// Animation commands
|
||||||
|
@ -162,5 +162,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||||
|
|
||||||
key osGetMapTexture();
|
key osGetMapTexture();
|
||||||
key osGetRegionMapTexture(string regionName);
|
key osGetRegionMapTexture(string regionName);
|
||||||
|
LSL_List osGetRegionStats();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics; //for [DebuggerNonUserCode]
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.Remoting.Lifetime;
|
using System.Runtime.Remoting.Lifetime;
|
||||||
using OpenSim.Region.ScriptEngine.Shared;
|
using OpenSim.Region.ScriptEngine.Shared;
|
||||||
|
@ -131,6 +132,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
return (eventFlags);
|
return (eventFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DebuggerNonUserCode]
|
||||||
public void ExecuteEvent(string state, string FunctionName, object[] args)
|
public void ExecuteEvent(string state, string FunctionName, object[] args)
|
||||||
{
|
{
|
||||||
// IMPORTANT: Types and MemberInfo-derived objects require a LOT of memory.
|
// IMPORTANT: Types and MemberInfo-derived objects require a LOT of memory.
|
||||||
|
|
|
@ -516,5 +516,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
public const string TEXTURE_TRANSPARENT = "8dcd4a48-2d37-4909-9f78-f7a9eb4ef903";
|
public const string TEXTURE_TRANSPARENT = "8dcd4a48-2d37-4909-9f78-f7a9eb4ef903";
|
||||||
public const string TEXTURE_MEDIA = "8b5fec65-8d8d-9dc5-cda8-8fdf2716e361";
|
public const string TEXTURE_MEDIA = "8b5fec65-8d8d-9dc5-cda8-8fdf2716e361";
|
||||||
|
|
||||||
|
// Constants for osGetRegionStats
|
||||||
|
public const int STATS_TIME_DILATION = 0;
|
||||||
|
public const int STATS_SIM_FPS = 1;
|
||||||
|
public const int STATS_PHYSICS_FPS = 2;
|
||||||
|
public const int STATS_AGENT_UPDATES = 3;
|
||||||
|
public const int STATS_ROOT_AGENTS = 4;
|
||||||
|
public const int STATS_CHILD_AGENTS = 5;
|
||||||
|
public const int STATS_TOTAL_PRIMS = 6;
|
||||||
|
public const int STATS_ACTIVE_PRIMS = 7;
|
||||||
|
public const int STATS_FRAME_MS = 8;
|
||||||
|
public const int STATS_NET_MS = 9;
|
||||||
|
public const int STATS_PHYSICS_MS = 10;
|
||||||
|
public const int STATS_IMAGE_MS = 11;
|
||||||
|
public const int STATS_OTHER_MS = 12;
|
||||||
|
public const int STATS_IN_PACKETS_PER_SECOND = 13;
|
||||||
|
public const int STATS_OUT_PACKETS_PER_SECOND = 14;
|
||||||
|
public const int STATS_UNACKED_BYTES = 15;
|
||||||
|
public const int STATS_AGENT_MS = 16;
|
||||||
|
public const int STATS_PENDING_DOWNLOADS = 17;
|
||||||
|
public const int STATS_PENDING_UPLOADS = 18;
|
||||||
|
public const int STATS_ACTIVE_SCRIPTS = 19;
|
||||||
|
public const int STATS_SCRIPT_LPS = 20;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -201,9 +201,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
m_OSSL_Functions.osTeleportAgent(agent, regionName, position, lookat);
|
m_OSSL_Functions.osTeleportAgent(agent, regionName, position, lookat);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void osTeleportAgent(string agent, long regionX, long regionY, vector position, vector lookat)
|
public void osTeleportAgent(string agent, int regionX, int regionY, vector position, vector lookat)
|
||||||
{
|
{
|
||||||
m_OSSL_Functions.osTeleportAgent(agent, (uint) regionX, (uint) regionY, position, lookat);
|
m_OSSL_Functions.osTeleportAgent(agent, regionX, regionY, position, lookat);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void osTeleportAgent(string agent, vector position, vector lookat)
|
public void osTeleportAgent(string agent, vector position, vector lookat)
|
||||||
|
@ -632,5 +632,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
{
|
{
|
||||||
return m_OSSL_Functions.osGetRegionMapTexture(regionName);
|
return m_OSSL_Functions.osGetRegionMapTexture(regionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LSL_List osGetRegionStats()
|
||||||
|
{
|
||||||
|
return m_OSSL_Functions.osGetRegionStats();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@ using System.Threading;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics; //for [DebuggerNonUserCode]
|
||||||
using OpenSim.Region.ScriptEngine.Interfaces;
|
using OpenSim.Region.ScriptEngine.Interfaces;
|
||||||
using OpenSim.Region.ScriptEngine.Shared;
|
using OpenSim.Region.ScriptEngine.Shared;
|
||||||
using OpenSim.Region.ScriptEngine.Shared.Api.Runtime;
|
using OpenSim.Region.ScriptEngine.Shared.Api.Runtime;
|
||||||
|
@ -90,6 +91,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
return (int)m_Executor.GetStateEventFlags(state);
|
return (int)m_Executor.GetStateEventFlags(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DebuggerNonUserCode]
|
||||||
public void ExecuteEvent(string state, string FunctionName, object[] args)
|
public void ExecuteEvent(string state, string FunctionName, object[] args)
|
||||||
{
|
{
|
||||||
m_Executor.ExecuteEvent(state, FunctionName, args);
|
m_Executor.ExecuteEvent(state, FunctionName, args);
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Diagnostics; //for [DebuggerNonUserCode]
|
||||||
using System.Runtime.Remoting;
|
using System.Runtime.Remoting;
|
||||||
using System.Runtime.Remoting.Lifetime;
|
using System.Runtime.Remoting.Lifetime;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
@ -237,13 +238,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
|
|
||||||
if (part != null)
|
if (part != null)
|
||||||
{
|
{
|
||||||
lock (part.TaskInventory)
|
part.TaskInventory.LockItemsForRead(true);
|
||||||
|
if (part.TaskInventory.ContainsKey(m_ItemID))
|
||||||
{
|
{
|
||||||
if (part.TaskInventory.ContainsKey(m_ItemID))
|
m_thisScriptTask = part.TaskInventory[m_ItemID];
|
||||||
{
|
|
||||||
m_thisScriptTask = part.TaskInventory[m_ItemID];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
part.TaskInventory.LockItemsForRead(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
ApiManager am = new ApiManager();
|
ApiManager am = new ApiManager();
|
||||||
|
@ -428,14 +428,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
{
|
{
|
||||||
int permsMask;
|
int permsMask;
|
||||||
UUID permsGranter;
|
UUID permsGranter;
|
||||||
lock (part.TaskInventory)
|
part.TaskInventory.LockItemsForRead(true);
|
||||||
|
if (!part.TaskInventory.ContainsKey(m_ItemID))
|
||||||
{
|
{
|
||||||
if (!part.TaskInventory.ContainsKey(m_ItemID))
|
part.TaskInventory.LockItemsForRead(false);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
permsGranter = part.TaskInventory[m_ItemID].PermsGranter;
|
|
||||||
permsMask = part.TaskInventory[m_ItemID].PermsMask;
|
|
||||||
}
|
}
|
||||||
|
permsGranter = part.TaskInventory[m_ItemID].PermsGranter;
|
||||||
|
permsMask = part.TaskInventory[m_ItemID].PermsMask;
|
||||||
|
part.TaskInventory.LockItemsForRead(false);
|
||||||
|
|
||||||
if ((permsMask & ScriptBaseClass.PERMISSION_TAKE_CONTROLS) != 0)
|
if ((permsMask & ScriptBaseClass.PERMISSION_TAKE_CONTROLS) != 0)
|
||||||
{
|
{
|
||||||
|
@ -544,6 +545,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DebuggerNonUserCode] //Prevents the debugger from farting in this function
|
||||||
public void SetState(string state)
|
public void SetState(string state)
|
||||||
{
|
{
|
||||||
if (state == State)
|
if (state == State)
|
||||||
|
@ -637,140 +639,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public object EventProcessor()
|
public object EventProcessor()
|
||||||
|
{
|
||||||
|
|
||||||
|
EventParams data = null;
|
||||||
|
|
||||||
|
lock (m_EventQueue)
|
||||||
{
|
{
|
||||||
lock (m_Script)
|
lock (m_Script)
|
||||||
{
|
{
|
||||||
EventParams data = null;
|
data = (EventParams) m_EventQueue.Dequeue();
|
||||||
|
if (data == null) // Shouldn't happen
|
||||||
lock (m_EventQueue)
|
|
||||||
{
|
|
||||||
data = (EventParams) m_EventQueue.Dequeue();
|
|
||||||
if (data == null) // Shouldn't happen
|
|
||||||
{
|
|
||||||
if ((m_EventQueue.Count > 0) && m_RunEvents && (!m_ShuttingDown))
|
|
||||||
{
|
|
||||||
m_CurrentResult = m_Engine.QueueEventHandler(this);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_CurrentResult = null;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.EventName == "timer")
|
|
||||||
m_TimerQueued = false;
|
|
||||||
if (data.EventName == "control")
|
|
||||||
{
|
|
||||||
if (m_ControlEventsInQueue > 0)
|
|
||||||
m_ControlEventsInQueue--;
|
|
||||||
}
|
|
||||||
if (data.EventName == "collision")
|
|
||||||
m_CollisionInQueue = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//m_log.DebugFormat("[XENGINE]: Processing event {0} for {1}", data.EventName, this);
|
|
||||||
|
|
||||||
m_DetectParams = data.DetectParams;
|
|
||||||
|
|
||||||
if (data.EventName == "state") // Hardcoded state change
|
|
||||||
{
|
|
||||||
// m_log.DebugFormat("[Script] Script {0}.{1} state set to {2}",
|
|
||||||
// m_PrimName, m_ScriptName, data.Params[0].ToString());
|
|
||||||
m_State=data.Params[0].ToString();
|
|
||||||
AsyncCommandManager.RemoveScript(m_Engine,
|
|
||||||
m_LocalID, m_ItemID);
|
|
||||||
|
|
||||||
SceneObjectPart part = m_Engine.World.GetSceneObjectPart(
|
|
||||||
m_LocalID);
|
|
||||||
if (part != null)
|
|
||||||
{
|
|
||||||
part.SetScriptEvents(m_ItemID,
|
|
||||||
(int)m_Script.GetStateEventFlags(State));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (m_Engine.World.PipeEventsForScript(m_LocalID) ||
|
|
||||||
data.EventName == "control") // Don't freeze avies!
|
|
||||||
{
|
|
||||||
SceneObjectPart part = m_Engine.World.GetSceneObjectPart(
|
|
||||||
m_LocalID);
|
|
||||||
// m_log.DebugFormat("[Script] Delivered event {2} in state {3} to {0}.{1}",
|
|
||||||
// m_PrimName, m_ScriptName, data.EventName, m_State);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
m_CurrentEvent = data.EventName;
|
|
||||||
m_EventStart = DateTime.Now;
|
|
||||||
m_InEvent = true;
|
|
||||||
|
|
||||||
m_Script.ExecuteEvent(State, data.EventName, data.Params);
|
|
||||||
|
|
||||||
m_InEvent = false;
|
|
||||||
m_CurrentEvent = String.Empty;
|
|
||||||
|
|
||||||
if (m_SaveState)
|
|
||||||
{
|
|
||||||
// This will be the very first event we deliver
|
|
||||||
// (state_entry) in default state
|
|
||||||
//
|
|
||||||
|
|
||||||
SaveState(m_Assembly);
|
|
||||||
|
|
||||||
m_SaveState = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
// m_log.DebugFormat("[SCRIPT] Exception: {0}", e.Message);
|
|
||||||
m_InEvent = false;
|
|
||||||
m_CurrentEvent = String.Empty;
|
|
||||||
|
|
||||||
if ((!(e is TargetInvocationException) || (!(e.InnerException is SelfDeleteException) && !(e.InnerException is ScriptDeleteException))) && !(e is ThreadAbortException))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// DISPLAY ERROR INWORLD
|
|
||||||
string text = FormatException(e);
|
|
||||||
|
|
||||||
if (text.Length > 1000)
|
|
||||||
text = text.Substring(0, 1000);
|
|
||||||
m_Engine.World.SimChat(Utils.StringToBytes(text),
|
|
||||||
ChatTypeEnum.DebugChannel, 2147483647,
|
|
||||||
part.AbsolutePosition,
|
|
||||||
part.Name, part.UUID, false);
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
// catch (Exception e2) // LEGIT: User Scripting
|
|
||||||
// {
|
|
||||||
// m_log.Error("[SCRIPT]: "+
|
|
||||||
// "Error displaying error in-world: " +
|
|
||||||
// e2.ToString());
|
|
||||||
// m_log.Error("[SCRIPT]: " +
|
|
||||||
// "Errormessage: Error compiling script:\r\n" +
|
|
||||||
// e.ToString());
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
else if ((e is TargetInvocationException) && (e.InnerException is SelfDeleteException))
|
|
||||||
{
|
|
||||||
m_InSelfDelete = true;
|
|
||||||
if (part != null && part.ParentGroup != null)
|
|
||||||
m_Engine.World.DeleteSceneObject(part.ParentGroup, false);
|
|
||||||
}
|
|
||||||
else if ((e is TargetInvocationException) && (e.InnerException is ScriptDeleteException))
|
|
||||||
{
|
|
||||||
m_InSelfDelete = true;
|
|
||||||
if (part != null && part.ParentGroup != null)
|
|
||||||
part.Inventory.RemoveInventoryItem(m_ItemID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
lock (m_EventQueue)
|
|
||||||
{
|
{
|
||||||
if ((m_EventQueue.Count > 0) && m_RunEvents && (!m_ShuttingDown))
|
if ((m_EventQueue.Count > 0) && m_RunEvents && (!m_ShuttingDown))
|
||||||
{
|
{
|
||||||
|
@ -780,13 +658,141 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
{
|
{
|
||||||
m_CurrentResult = null;
|
m_CurrentResult = null;
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_DetectParams = null;
|
if (data.EventName == "timer")
|
||||||
|
m_TimerQueued = false;
|
||||||
return 0;
|
if (data.EventName == "control")
|
||||||
|
{
|
||||||
|
if (m_ControlEventsInQueue > 0)
|
||||||
|
m_ControlEventsInQueue--;
|
||||||
|
}
|
||||||
|
if (data.EventName == "collision")
|
||||||
|
m_CollisionInQueue = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
lock(m_Script)
|
||||||
|
{
|
||||||
|
|
||||||
|
//m_log.DebugFormat("[XENGINE]: Processing event {0} for {1}", data.EventName, this);
|
||||||
|
|
||||||
|
m_DetectParams = data.DetectParams;
|
||||||
|
|
||||||
|
if (data.EventName == "state") // Hardcoded state change
|
||||||
|
{
|
||||||
|
// m_log.DebugFormat("[Script] Script {0}.{1} state set to {2}",
|
||||||
|
// m_PrimName, m_ScriptName, data.Params[0].ToString());
|
||||||
|
m_State=data.Params[0].ToString();
|
||||||
|
AsyncCommandManager.RemoveScript(m_Engine,
|
||||||
|
m_LocalID, m_ItemID);
|
||||||
|
|
||||||
|
SceneObjectPart part = m_Engine.World.GetSceneObjectPart(
|
||||||
|
m_LocalID);
|
||||||
|
if (part != null)
|
||||||
|
{
|
||||||
|
part.SetScriptEvents(m_ItemID,
|
||||||
|
(int)m_Script.GetStateEventFlags(State));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (m_Engine.World.PipeEventsForScript(m_LocalID) ||
|
||||||
|
data.EventName == "control") // Don't freeze avies!
|
||||||
|
{
|
||||||
|
SceneObjectPart part = m_Engine.World.GetSceneObjectPart(
|
||||||
|
m_LocalID);
|
||||||
|
// m_log.DebugFormat("[Script] Delivered event {2} in state {3} to {0}.{1}",
|
||||||
|
// m_PrimName, m_ScriptName, data.EventName, m_State);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
m_CurrentEvent = data.EventName;
|
||||||
|
m_EventStart = DateTime.Now;
|
||||||
|
m_InEvent = true;
|
||||||
|
|
||||||
|
m_Script.ExecuteEvent(State, data.EventName, data.Params);
|
||||||
|
|
||||||
|
m_InEvent = false;
|
||||||
|
m_CurrentEvent = String.Empty;
|
||||||
|
|
||||||
|
if (m_SaveState)
|
||||||
|
{
|
||||||
|
// This will be the very first event we deliver
|
||||||
|
// (state_entry) in default state
|
||||||
|
//
|
||||||
|
|
||||||
|
SaveState(m_Assembly);
|
||||||
|
|
||||||
|
m_SaveState = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
// m_log.DebugFormat("[SCRIPT] Exception: {0}", e.Message);
|
||||||
|
m_InEvent = false;
|
||||||
|
m_CurrentEvent = String.Empty;
|
||||||
|
|
||||||
|
if ((!(e is TargetInvocationException) || (!(e.InnerException is SelfDeleteException) && !(e.InnerException is ScriptDeleteException))) && !(e is ThreadAbortException))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// DISPLAY ERROR INWORLD
|
||||||
|
string text = FormatException(e);
|
||||||
|
|
||||||
|
if (text.Length > 1000)
|
||||||
|
text = text.Substring(0, 1000);
|
||||||
|
m_Engine.World.SimChat(Utils.StringToBytes(text),
|
||||||
|
ChatTypeEnum.DebugChannel, 2147483647,
|
||||||
|
part.AbsolutePosition,
|
||||||
|
part.Name, part.UUID, false);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
// catch (Exception e2) // LEGIT: User Scripting
|
||||||
|
// {
|
||||||
|
// m_log.Error("[SCRIPT]: "+
|
||||||
|
// "Error displaying error in-world: " +
|
||||||
|
// e2.ToString());
|
||||||
|
// m_log.Error("[SCRIPT]: " +
|
||||||
|
// "Errormessage: Error compiling script:\r\n" +
|
||||||
|
// e.ToString());
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
else if ((e is TargetInvocationException) && (e.InnerException is SelfDeleteException))
|
||||||
|
{
|
||||||
|
m_InSelfDelete = true;
|
||||||
|
if (part != null && part.ParentGroup != null)
|
||||||
|
m_Engine.World.DeleteSceneObject(part.ParentGroup, false);
|
||||||
|
}
|
||||||
|
else if ((e is TargetInvocationException) && (e.InnerException is ScriptDeleteException))
|
||||||
|
{
|
||||||
|
m_InSelfDelete = true;
|
||||||
|
if (part != null && part.ParentGroup != null)
|
||||||
|
part.Inventory.RemoveInventoryItem(m_ItemID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lock (m_EventQueue)
|
||||||
|
{
|
||||||
|
if ((m_EventQueue.Count > 0) && m_RunEvents && (!m_ShuttingDown))
|
||||||
|
{
|
||||||
|
m_CurrentResult = m_Engine.QueueEventHandler(this);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_CurrentResult = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_DetectParams = null;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public int EventTime()
|
public int EventTime()
|
||||||
{
|
{
|
||||||
|
@ -824,6 +830,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
new Object[0], new DetectParams[0]));
|
new Object[0], new DetectParams[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DebuggerNonUserCode] //Stops the VS debugger from farting in this function
|
||||||
public void ApiResetScript()
|
public void ApiResetScript()
|
||||||
{
|
{
|
||||||
// bool running = Running;
|
// bool running = Running;
|
||||||
|
@ -1011,10 +1018,5 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
{
|
{
|
||||||
get { return m_RegionID; }
|
get { return m_RegionID; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanBeDeleted()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -429,6 +429,11 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int Size
|
||||||
|
{
|
||||||
|
get { return 0; }
|
||||||
|
}
|
||||||
|
|
||||||
public object[] Data
|
public object[] Data
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
|
|
|
@ -30,6 +30,7 @@ using System.IO;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics; //for [DebuggerNonUserCode]
|
||||||
using System.Security;
|
using System.Security;
|
||||||
using System.Security.Policy;
|
using System.Security.Policy;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
@ -1119,6 +1120,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DebuggerNonUserCode]
|
||||||
public void ApiResetScript(UUID itemID)
|
public void ApiResetScript(UUID itemID)
|
||||||
{
|
{
|
||||||
IScriptInstance instance = GetInstance(itemID);
|
IScriptInstance instance = GetInstance(itemID);
|
||||||
|
@ -1170,6 +1172,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
return UUID.Zero;
|
return UUID.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DebuggerNonUserCode]
|
||||||
public void SetState(UUID itemID, string newState)
|
public void SetState(UUID itemID, string newState)
|
||||||
{
|
{
|
||||||
IScriptInstance instance = GetInstance(itemID);
|
IScriptInstance instance = GetInstance(itemID);
|
||||||
|
@ -1245,34 +1248,219 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetAssemblyName(UUID itemID)
|
|
||||||
{
|
|
||||||
IScriptInstance instance = GetInstance(itemID);
|
|
||||||
if (instance == null)
|
|
||||||
return "";
|
|
||||||
return instance.GetAssemblyName();
|
|
||||||
}
|
|
||||||
|
|
||||||
public string GetXMLState(UUID itemID)
|
public string GetXMLState(UUID itemID)
|
||||||
{
|
{
|
||||||
IScriptInstance instance = GetInstance(itemID);
|
IScriptInstance instance = GetInstance(itemID);
|
||||||
if (instance == null)
|
if (instance == null)
|
||||||
return "";
|
return "";
|
||||||
return instance.GetXMLState();
|
string xml = instance.GetXMLState();
|
||||||
}
|
|
||||||
|
|
||||||
public bool CanBeDeleted(UUID itemID)
|
XmlDocument sdoc = new XmlDocument();
|
||||||
{
|
sdoc.LoadXml(xml);
|
||||||
IScriptInstance instance = GetInstance(itemID);
|
XmlNodeList rootL = sdoc.GetElementsByTagName("ScriptState");
|
||||||
if (instance == null)
|
XmlNode rootNode = rootL[0];
|
||||||
return true;
|
|
||||||
|
|
||||||
return instance.CanBeDeleted();
|
// Create <State UUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx">
|
||||||
|
XmlDocument doc = new XmlDocument();
|
||||||
|
XmlElement stateData = doc.CreateElement("", "State", "");
|
||||||
|
XmlAttribute stateID = doc.CreateAttribute("", "UUID", "");
|
||||||
|
stateID.Value = itemID.ToString();
|
||||||
|
stateData.Attributes.Append(stateID);
|
||||||
|
XmlAttribute assetID = doc.CreateAttribute("", "Asset", "");
|
||||||
|
assetID.Value = instance.AssetID.ToString();
|
||||||
|
stateData.Attributes.Append(assetID);
|
||||||
|
doc.AppendChild(stateData);
|
||||||
|
|
||||||
|
// Add <ScriptState>...</ScriptState>
|
||||||
|
XmlNode xmlstate = doc.ImportNode(rootNode, true);
|
||||||
|
stateData.AppendChild(xmlstate);
|
||||||
|
|
||||||
|
string assemName = instance.GetAssemblyName();
|
||||||
|
|
||||||
|
string fn = Path.GetFileName(assemName);
|
||||||
|
|
||||||
|
string assem = String.Empty;
|
||||||
|
|
||||||
|
if (File.Exists(assemName + ".text"))
|
||||||
|
{
|
||||||
|
FileInfo tfi = new FileInfo(assemName + ".text");
|
||||||
|
|
||||||
|
if (tfi != null)
|
||||||
|
{
|
||||||
|
Byte[] tdata = new Byte[tfi.Length];
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FileStream tfs = File.Open(assemName + ".text",
|
||||||
|
FileMode.Open, FileAccess.Read);
|
||||||
|
tfs.Read(tdata, 0, tdata.Length);
|
||||||
|
tfs.Close();
|
||||||
|
|
||||||
|
assem = new System.Text.ASCIIEncoding().GetString(tdata);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[XEngine]: Unable to open script textfile {0}, reason: {1}", assemName+".text", e.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FileInfo fi = new FileInfo(assemName);
|
||||||
|
|
||||||
|
if (fi != null)
|
||||||
|
{
|
||||||
|
Byte[] data = new Byte[fi.Length];
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FileStream fs = File.Open(assemName, FileMode.Open, FileAccess.Read);
|
||||||
|
fs.Read(data, 0, data.Length);
|
||||||
|
fs.Close();
|
||||||
|
|
||||||
|
assem = System.Convert.ToBase64String(data);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[XEngine]: Unable to open script assembly {0}, reason: {1}", assemName, e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string map = String.Empty;
|
||||||
|
|
||||||
|
if (File.Exists(fn + ".map"))
|
||||||
|
{
|
||||||
|
FileStream mfs = File.Open(fn + ".map", FileMode.Open, FileAccess.Read);
|
||||||
|
StreamReader msr = new StreamReader(mfs);
|
||||||
|
|
||||||
|
map = msr.ReadToEnd();
|
||||||
|
|
||||||
|
msr.Close();
|
||||||
|
mfs.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
XmlElement assemblyData = doc.CreateElement("", "Assembly", "");
|
||||||
|
XmlAttribute assemblyName = doc.CreateAttribute("", "Filename", "");
|
||||||
|
|
||||||
|
assemblyName.Value = fn;
|
||||||
|
assemblyData.Attributes.Append(assemblyName);
|
||||||
|
|
||||||
|
assemblyData.InnerText = assem;
|
||||||
|
|
||||||
|
stateData.AppendChild(assemblyData);
|
||||||
|
|
||||||
|
XmlElement mapData = doc.CreateElement("", "LineMap", "");
|
||||||
|
XmlAttribute mapName = doc.CreateAttribute("", "Filename", "");
|
||||||
|
|
||||||
|
mapName.Value = fn + ".map";
|
||||||
|
mapData.Attributes.Append(mapName);
|
||||||
|
|
||||||
|
mapData.InnerText = map;
|
||||||
|
|
||||||
|
stateData.AppendChild(mapData);
|
||||||
|
return doc.InnerXml;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool ShowScriptSaveResponse(UUID ownerID, UUID assetID, string text, bool compiled)
|
private bool ShowScriptSaveResponse(UUID ownerID, UUID assetID, string text, bool compiled)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetXMLState(UUID itemID, string xml)
|
||||||
|
{
|
||||||
|
if (xml == String.Empty)
|
||||||
|
return;
|
||||||
|
|
||||||
|
XmlDocument doc = new XmlDocument();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
doc.LoadXml(xml);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
m_log.Error("[XEngine]: Exception decoding XML data from region transfer");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
XmlNodeList rootL = doc.GetElementsByTagName("State");
|
||||||
|
if (rootL.Count < 1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
XmlElement rootE = (XmlElement)rootL[0];
|
||||||
|
|
||||||
|
if (rootE.GetAttribute("UUID") != itemID.ToString())
|
||||||
|
return;
|
||||||
|
|
||||||
|
string assetID = rootE.GetAttribute("Asset");
|
||||||
|
|
||||||
|
XmlNodeList stateL = rootE.GetElementsByTagName("ScriptState");
|
||||||
|
|
||||||
|
if (stateL.Count != 1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
XmlElement stateE = (XmlElement)stateL[0];
|
||||||
|
|
||||||
|
if (World.m_trustBinaries)
|
||||||
|
{
|
||||||
|
XmlNodeList assemL = rootE.GetElementsByTagName("Assembly");
|
||||||
|
|
||||||
|
if (assemL.Count != 1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
XmlElement assemE = (XmlElement)assemL[0];
|
||||||
|
|
||||||
|
string fn = assemE.GetAttribute("Filename");
|
||||||
|
string base64 = assemE.InnerText;
|
||||||
|
|
||||||
|
string path = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString());
|
||||||
|
path = Path.Combine(path, fn);
|
||||||
|
|
||||||
|
if (!File.Exists(path))
|
||||||
|
{
|
||||||
|
Byte[] filedata = Convert.FromBase64String(base64);
|
||||||
|
|
||||||
|
FileStream fs = File.Create(path);
|
||||||
|
fs.Write(filedata, 0, filedata.Length);
|
||||||
|
fs.Close();
|
||||||
|
|
||||||
|
fs = File.Create(path + ".text");
|
||||||
|
StreamWriter sw = new StreamWriter(fs);
|
||||||
|
|
||||||
|
sw.Write(base64);
|
||||||
|
|
||||||
|
sw.Close();
|
||||||
|
fs.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string statepath = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString());
|
||||||
|
statepath = Path.Combine(statepath, itemID.ToString() + ".state");
|
||||||
|
|
||||||
|
FileStream sfs = File.Create(statepath);
|
||||||
|
StreamWriter ssw = new StreamWriter(sfs);
|
||||||
|
|
||||||
|
ssw.Write(stateE.OuterXml);
|
||||||
|
|
||||||
|
ssw.Close();
|
||||||
|
sfs.Close();
|
||||||
|
|
||||||
|
XmlNodeList mapL = rootE.GetElementsByTagName("LineMap");
|
||||||
|
|
||||||
|
XmlElement mapE = (XmlElement)mapL[0];
|
||||||
|
|
||||||
|
string mappath = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString());
|
||||||
|
mappath = Path.Combine(mappath, mapE.GetAttribute("Filename"));
|
||||||
|
|
||||||
|
FileStream mfs = File.Create(mappath);
|
||||||
|
StreamWriter msw = new StreamWriter(mfs);
|
||||||
|
|
||||||
|
msw.Write(mapE.InnerText);
|
||||||
|
|
||||||
|
msw.Close();
|
||||||
|
mfs.Close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,8 @@ namespace OpenSim.Tools.LSL.Compiler
|
||||||
{
|
{
|
||||||
class Program
|
class Program
|
||||||
{
|
{
|
||||||
private static Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> m_positionMap;
|
// Commented out because generated warning since m_positionMap could never be anything other than null
|
||||||
|
// private static Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> m_positionMap;
|
||||||
private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider();
|
private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider();
|
||||||
|
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
|
@ -210,16 +211,16 @@ namespace OpenSim.Tools.LSL.Compiler
|
||||||
sfs.Close();
|
sfs.Close();
|
||||||
|
|
||||||
string posmap = String.Empty;
|
string posmap = String.Empty;
|
||||||
if (m_positionMap != null)
|
// if (m_positionMap != null)
|
||||||
{
|
// {
|
||||||
foreach (KeyValuePair<KeyValuePair<int, int>, KeyValuePair<int, int>> kvp in m_positionMap)
|
// foreach (KeyValuePair<KeyValuePair<int, int>, KeyValuePair<int, int>> kvp in m_positionMap)
|
||||||
{
|
// {
|
||||||
KeyValuePair<int, int> k = kvp.Key;
|
// KeyValuePair<int, int> k = kvp.Key;
|
||||||
KeyValuePair<int, int> v = kvp.Value;
|
// KeyValuePair<int, int> v = kvp.Value;
|
||||||
posmap += String.Format("{0},{1},{2},{3}\n",
|
// posmap += String.Format("{0},{1},{2},{3}\n",
|
||||||
k.Key, k.Value, v.Key, v.Value);
|
// k.Key, k.Value, v.Key, v.Value);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
buf = enc.GetBytes(posmap);
|
buf = enc.GetBytes(posmap);
|
||||||
|
|
||||||
|
@ -253,7 +254,8 @@ namespace OpenSim.Tools.LSL.Compiler
|
||||||
|
|
||||||
private static KeyValuePair<int, int> FindErrorPosition(int line, int col)
|
private static KeyValuePair<int, int> FindErrorPosition(int line, int col)
|
||||||
{
|
{
|
||||||
return FindErrorPosition(line, col, m_positionMap);
|
//return FindErrorPosition(line, col, m_positionMap);
|
||||||
|
return FindErrorPosition(line, col, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class kvpSorter : IComparer<KeyValuePair<int,int>>
|
private class kvpSorter : IComparer<KeyValuePair<int,int>>
|
||||||
|
|
Binary file not shown.
|
@ -455,6 +455,9 @@
|
||||||
; Distance in meters that shouts should travel. Default is 100m
|
; Distance in meters that shouts should travel. Default is 100m
|
||||||
shout_distance = 100
|
shout_distance = 100
|
||||||
|
|
||||||
|
; Append a prefix to the god avatar names appearing in chat whilst in god mode
|
||||||
|
; admin_prefix = "@"
|
||||||
|
|
||||||
|
|
||||||
[Messaging]
|
[Messaging]
|
||||||
; Control which region module is used for instant messaging.
|
; Control which region module is used for instant messaging.
|
||||||
|
|
|
@ -1596,6 +1596,7 @@
|
||||||
<Reference name="System.Xml"/>
|
<Reference name="System.Xml"/>
|
||||||
<Reference name="System.Drawing"/>
|
<Reference name="System.Drawing"/>
|
||||||
<Reference name="System.Web"/>
|
<Reference name="System.Web"/>
|
||||||
|
<Reference name="NDesk.Options"/>
|
||||||
<Reference name="OpenMetaverseTypes.dll"/>
|
<Reference name="OpenMetaverseTypes.dll"/>
|
||||||
<Reference name="OpenMetaverse.StructuredData.dll"/>
|
<Reference name="OpenMetaverse.StructuredData.dll"/>
|
||||||
<Reference name="OpenMetaverse.dll"/>
|
<Reference name="OpenMetaverse.dll"/>
|
||||||
|
@ -3414,7 +3415,7 @@
|
||||||
</Files>
|
</Files>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
||||||
<?include file="addon-modules/*/prebuild.xml" ?>
|
<?include file="addon-modules/*/prebuild*.xml" ?>
|
||||||
|
|
||||||
</Solution>
|
</Solution>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue