From eb273b808ee9723ff386729b0f19e5770ef86af4 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 7 Nov 2012 19:59:54 -0800 Subject: [PATCH 1/6] HG: Hopefully this fixes the issues with port 80 once and for all. --- .../Hypergrid/GatekeeperServiceConnector.cs | 2 +- .../HypergridService/GatekeeperService.cs | 23 ++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index 19dffc35ac..5bcff4883d 100644 --- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs @@ -321,7 +321,7 @@ namespace OpenSim.Services.Connectors.Hypergrid args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); args["teleport_flags"] = OSD.FromString(flags.ToString()); - OSDMap result = WebUtil.PostToService(uri, args, 20000); + OSDMap result = WebUtil.PostToService(uri, args, 80000); if (result["Success"].AsBoolean()) { OSDMap unpacked = (OSDMap)result["_Result"]; diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index 004311f2ef..7b84d55ded 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs @@ -68,6 +68,7 @@ namespace OpenSim.Services.HypergridService private static UUID m_ScopeID; private static bool m_AllowTeleportsToAnyRegion; private static string m_ExternalName; + private static Uri m_Uri; private static GridRegion m_DefaultGatewayRegion; public GatekeeperService(IConfigSource config, ISimulationService simService) @@ -99,6 +100,15 @@ namespace OpenSim.Services.HypergridService if (m_ExternalName != string.Empty && !m_ExternalName.EndsWith("/")) m_ExternalName = m_ExternalName + "/"; + try + { + m_Uri = new Uri(m_ExternalName); + } + catch + { + m_log.WarnFormat("[GATEKEEPER SERVICE]: Malformed gatekeeper address {0}", m_ExternalName); + } + Object[] args = new Object[] { config }; m_GridService = ServerUtils.LoadPlugin(gridService, args); m_PresenceService = ServerUtils.LoadPlugin(presenceService, args); @@ -433,7 +443,18 @@ namespace OpenSim.Services.HypergridService string externalname = m_ExternalName.TrimEnd(trailing_slash); m_log.DebugFormat("[GATEKEEPER SERVICE]: Verifying {0} against {1}", addressee, externalname); - return string.Equals(addressee, externalname, StringComparison.OrdinalIgnoreCase); + Uri uri; + try + { + uri = new Uri(addressee); + } + catch + { + m_log.DebugFormat("[GATEKEEPER SERVICE]: Visitor provided malformed service address {0}", addressee); + return false; + } + + return string.Equals(uri.GetLeftPart(UriPartial.Authority), m_Uri.GetLeftPart(UriPartial.Authority), StringComparison.OrdinalIgnoreCase) ; } #endregion From 9bc0419679ac8b05cd9b6a5cf340f1e6b8d5d288 Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Thu, 8 Nov 2012 01:18:25 -0800 Subject: [PATCH 2/6] ODECharacter overrides TargetVelocity. No change to existing behavior --- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index c73655791b..319f6ab884 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -661,6 +661,20 @@ namespace OpenSim.Region.Physics.OdePlugin set { return; } } + public override Vector3 TargetVelocity + { + get + { + return m_taintTargetVelocity; + } + + set + { + Velocity = value; + } + } + + public override Vector3 Velocity { get @@ -1394,4 +1408,4 @@ namespace OpenSim.Region.Physics.OdePlugin m_eventsubscription += p; } } -} \ No newline at end of file +} From 75c880a6f3631a527b532773a8a493309a96028e Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 9 Nov 2012 00:59:18 +0000 Subject: [PATCH 3/6] Update parent inventory folder version numbers when folders are moved/created/deleted to match version numbers cached by viewers. This is done in the way that one would expect (e.g. moving a folder increments version number on both source and destination parent folders). This should hopefully improve viewer reuse of its cached inventory information. Currently MySQL only but will be implement for SQLite/MSSQL if there are no issues. --- OpenSim/Data/IXInventoryData.cs | 15 ++ OpenSim/Data/MSSQL/MSSQLXInventoryData.cs | 130 ++++++++++++------ OpenSim/Data/MySQL/MySQLXInventoryData.cs | 94 ++++++++++++- OpenSim/Data/SQLite/SQLiteXInventoryData.cs | 30 +++- .../InventoryService/XInventoryService.cs | 11 +- .../Common/Mock/TestXInventoryDataPlugin.cs | 1 + 6 files changed, 223 insertions(+), 58 deletions(-) diff --git a/OpenSim/Data/IXInventoryData.cs b/OpenSim/Data/IXInventoryData.cs index e64a82820d..0df71f5cad 100644 --- a/OpenSim/Data/IXInventoryData.cs +++ b/OpenSim/Data/IXInventoryData.cs @@ -116,7 +116,22 @@ namespace OpenSim.Data /// true if the delete was successful, false if it was not bool DeleteItems(string[] fields, string[] vals); + /// + /// Move an item to a new folder. + /// + /// /returns> + /// UUID of the item + /// UUID of the new folder. bool MoveItem(string id, string newParent); + + /// + /// Move a folder to a new folder. + /// + /// /returns> + /// UUID of the item + /// UUID of the new folder. + bool MoveFolder(string id, string newParent); + XInventoryItem[] GetActiveGestures(UUID principalID); int GetAssetPermissions(UUID principalID, UUID assetID); } diff --git a/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs b/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs index b19a0da872..7ab0ebbe7b 100644 --- a/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs +++ b/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs @@ -43,12 +43,12 @@ namespace OpenSim.Data.MSSQL // private static readonly ILog m_log = LogManager.GetLogger( // MethodBase.GetCurrentMethod().DeclaringType); - private MSSQLGenericTableHandler m_Folders; + private MSSQLFolderHandler m_Folders; private MSSQLItemHandler m_Items; public MSSQLXInventoryData(string conn, string realm) { - m_Folders = new MSSQLGenericTableHandler( + m_Folders = new MSSQLFolderHandler( conn, "inventoryfolders", "InventoryStore"); m_Items = new MSSQLItemHandler( conn, "inventoryitems", String.Empty); @@ -85,6 +85,7 @@ namespace OpenSim.Data.MSSQL { return m_Folders.Delete(field, val); } + public bool DeleteFolders(string[] fields, string[] vals) { return m_Folders.Delete(fields, vals); @@ -94,15 +95,22 @@ namespace OpenSim.Data.MSSQL { return m_Items.Delete(field, val); } + public bool DeleteItems(string[] fields, string[] vals) { return m_Items.Delete(fields, vals); } + public bool MoveItem(string id, string newParent) { return m_Items.MoveItem(id, newParent); } + public bool MoveFolder(string id, string newParent) + { + return m_Folders.MoveFolder(id, newParent); + } + public XInventoryItem[] GetActiveGestures(UUID principalID) { return m_Items.GetActiveGestures(principalID); @@ -124,79 +132,115 @@ namespace OpenSim.Data.MSSQL public bool MoveItem(string id, string newParent) { using (SqlConnection conn = new SqlConnection(m_ConnectionString)) - using (SqlCommand cmd = new SqlCommand()) { + using (SqlCommand cmd = new SqlCommand()) + { - cmd.CommandText = String.Format("update {0} set parentFolderID = @ParentFolderID where inventoryID = @InventoryID", m_Realm); - cmd.Parameters.Add(m_database.CreateParameter("@ParentFolderID", newParent)); - cmd.Parameters.Add(m_database.CreateParameter("@InventoryID", id)); - cmd.Connection = conn; - conn.Open(); - return cmd.ExecuteNonQuery() == 0 ? false : true; + cmd.CommandText = String.Format("update {0} set parentFolderID = @ParentFolderID where inventoryID = @InventoryID", m_Realm); + cmd.Parameters.Add(m_database.CreateParameter("@ParentFolderID", newParent)); + cmd.Parameters.Add(m_database.CreateParameter("@InventoryID", id)); + cmd.Connection = conn; + conn.Open(); + return cmd.ExecuteNonQuery() == 0 ? false : true; + } } } public XInventoryItem[] GetActiveGestures(UUID principalID) { using (SqlConnection conn = new SqlConnection(m_ConnectionString)) - using (SqlCommand cmd = new SqlCommand()) { - cmd.CommandText = String.Format("select * from inventoryitems where avatarId = @uuid and assetType = @type and flags = 1", m_Realm); + using (SqlCommand cmd = new SqlCommand()) + { + cmd.CommandText = String.Format("select * from inventoryitems where avatarId = @uuid and assetType = @type and flags = 1", m_Realm); - cmd.Parameters.Add(m_database.CreateParameter("@uuid", principalID.ToString())); - cmd.Parameters.Add(m_database.CreateParameter("@type", (int)AssetType.Gesture)); - cmd.Connection = conn; - conn.Open(); - return DoQuery(cmd); + cmd.Parameters.Add(m_database.CreateParameter("@uuid", principalID.ToString())); + cmd.Parameters.Add(m_database.CreateParameter("@type", (int)AssetType.Gesture)); + cmd.Connection = conn; + conn.Open(); + return DoQuery(cmd); + } } } public int GetAssetPermissions(UUID principalID, UUID assetID) { using (SqlConnection conn = new SqlConnection(m_ConnectionString)) - using (SqlCommand cmd = new SqlCommand()) { - cmd.CommandText = String.Format("select bit_or(inventoryCurrentPermissions) as inventoryCurrentPermissions from inventoryitems where avatarID = @PrincipalID and assetID = @AssetID group by assetID", m_Realm); - cmd.Parameters.Add(m_database.CreateParameter("@PrincipalID", principalID.ToString())); - cmd.Parameters.Add(m_database.CreateParameter("@AssetID", assetID.ToString())); - cmd.Connection = conn; - conn.Open(); - using (SqlDataReader reader = cmd.ExecuteReader()) + using (SqlCommand cmd = new SqlCommand()) { - - int perms = 0; - - if (reader.Read()) + cmd.CommandText = String.Format("select bit_or(inventoryCurrentPermissions) as inventoryCurrentPermissions from inventoryitems where avatarID = @PrincipalID and assetID = @AssetID group by assetID", m_Realm); + cmd.Parameters.Add(m_database.CreateParameter("@PrincipalID", principalID.ToString())); + cmd.Parameters.Add(m_database.CreateParameter("@AssetID", assetID.ToString())); + cmd.Connection = conn; + conn.Open(); + using (SqlDataReader reader = cmd.ExecuteReader()) { - perms = Convert.ToInt32(reader["inventoryCurrentPermissions"]); + + int perms = 0; + + if (reader.Read()) + { + perms = Convert.ToInt32(reader["inventoryCurrentPermissions"]); + } + + return perms; } - return perms; } - } } + public override bool Store(XInventoryItem item) { if (!base.Store(item)) return false; + string sql = "update inventoryfolders set version=version+1 where folderID = @folderID"; using (SqlConnection conn = new SqlConnection(m_ConnectionString)) - using (SqlCommand cmd = new SqlCommand(sql, conn)) { - conn.Open(); + using (SqlCommand cmd = new SqlCommand(sql, conn)) + { + conn.Open(); - cmd.Parameters.AddWithValue("@folderID", item.parentFolderID.ToString()); - try - { - cmd.ExecuteNonQuery(); - } - catch (Exception) - { - return false; - } + cmd.Parameters.AddWithValue("@folderID", item.parentFolderID.ToString()); + try + { + cmd.ExecuteNonQuery(); + } + catch (Exception) + { + return false; + } + } + + return true; } - return true; } } -} + + public class MSSQLFolderHandler : MSSQLGenericTableHandler + { + public MSSQLFolderHandler(string c, string t, string m) : + base(c, t, m) + { + } + + public bool MoveFolder(string id, string newParentFolderID) + { + using (SqlConnection conn = new SqlConnection(m_ConnectionString)) + { + using (SqlCommand cmd = new SqlCommand()) + { + + cmd.CommandText = String.Format("update {0} set parentFolderID = @ParentFolderID where folderID = @folderID", m_Realm); + cmd.Parameters.Add(m_database.CreateParameter("@ParentFolderID", newParentFolderID)); + cmd.Parameters.Add(m_database.CreateParameter("@folderID", id)); + cmd.Connection = conn; + conn.Open(); + return cmd.ExecuteNonQuery() == 0 ? false : true; + } + } + } + } +} \ No newline at end of file diff --git a/OpenSim/Data/MySQL/MySQLXInventoryData.cs b/OpenSim/Data/MySQL/MySQLXInventoryData.cs index cccc500861..7a3b5b4084 100644 --- a/OpenSim/Data/MySQL/MySQLXInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLXInventoryData.cs @@ -42,12 +42,12 @@ namespace OpenSim.Data.MySQL /// public class MySQLXInventoryData : IXInventoryData { - private MySQLGenericTableHandler m_Folders; + private MySqlFolderHandler m_Folders; private MySqlItemHandler m_Items; public MySQLXInventoryData(string conn, string realm) { - m_Folders = new MySQLGenericTableHandler( + m_Folders = new MySqlFolderHandler( conn, "inventoryfolders", "InventoryStore"); m_Items = new MySqlItemHandler( conn, "inventoryitems", String.Empty); @@ -106,6 +106,11 @@ namespace OpenSim.Data.MySQL return m_Items.MoveItem(id, newParent); } + public bool MoveFolder(string id, string newParent) + { + return m_Folders.MoveFolder(id, newParent); + } + public XInventoryItem[] GetActiveGestures(UUID principalID) { return m_Items.GetActiveGestures(principalID); @@ -275,4 +280,89 @@ namespace OpenSim.Data.MySQL return true; } } + + public class MySqlFolderHandler : MySQLGenericTableHandler + { +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + public MySqlFolderHandler(string c, string t, string m) : + base(c, t, m) + { + } + + public bool MoveFolder(string id, string newParentFolderID) + { + XInventoryFolder[] folders = Get(new string[] { "folderID" }, new string[] { id }); + + if (folders.Length == 0) + return false; + + UUID oldParentFolderUUID = folders[0].parentFolderID; + + using (MySqlCommand cmd = new MySqlCommand()) + { + cmd.CommandText + = String.Format( + "update {0} set parentFolderID = ?ParentFolderID where folderID = ?folderID", m_Realm); + cmd.Parameters.AddWithValue("?ParentFolderID", newParentFolderID); + cmd.Parameters.AddWithValue("?folderID", id); + + if (ExecuteNonQuery(cmd) == 0) + return false; + } + + IncrementFolderVersion(oldParentFolderUUID); + IncrementFolderVersion(newParentFolderID); + + return true; + } + + public override bool Store(XInventoryFolder folder) + { + if (!base.Store(folder)) + return false; + + IncrementFolderVersion(folder.parentFolderID); + + return true; + } + + private bool IncrementFolderVersion(UUID folderID) + { + return IncrementFolderVersion(folderID.ToString()); + } + + private bool IncrementFolderVersion(string folderID) + { +// m_log.DebugFormat("[MYSQL FOLDER HANDLER]: Incrementing version on folder {0}", folderID); +// Util.PrintCallStack(); + + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); + + using (MySqlCommand cmd = new MySqlCommand()) + { + cmd.Connection = dbcon; + + cmd.CommandText = String.Format("update inventoryfolders set version=version+1 where folderID = ?folderID"); + cmd.Parameters.AddWithValue("?folderID", folderID); + + try + { + cmd.ExecuteNonQuery(); + } + catch (Exception) + { + return false; + } + cmd.Dispose(); + } + + dbcon.Close(); + } + + return true; + } + } } \ No newline at end of file diff --git a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs index 1f369867ce..75f8c8754c 100644 --- a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs +++ b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs @@ -47,7 +47,7 @@ namespace OpenSim.Data.SQLite { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private SQLiteGenericTableHandler m_Folders; + private SqliteFolderHandler m_Folders; private SqliteItemHandler m_Items; public SQLiteXInventoryData(string conn, string realm) @@ -55,7 +55,7 @@ namespace OpenSim.Data.SQLite if (Util.IsWindows()) Util.LoadArchSpecificWindowsDll("sqlite3.dll"); - m_Folders = new SQLiteGenericTableHandler( + m_Folders = new SqliteFolderHandler( conn, "inventoryfolders", "XInventoryStore"); m_Items = new SqliteItemHandler( conn, "inventoryitems", String.Empty); @@ -114,6 +114,11 @@ namespace OpenSim.Data.SQLite return m_Items.MoveItem(id, newParent); } + public bool MoveFolder(string id, string newParent) + { + return m_Folders.MoveFolder(id, newParent); + } + public XInventoryItem[] GetActiveGestures(UUID principalID) { return m_Items.GetActiveGestures(principalID); @@ -177,4 +182,23 @@ namespace OpenSim.Data.SQLite return perms; } } -} + + public class SqliteFolderHandler : SQLiteGenericTableHandler + { + public SqliteFolderHandler(string c, string t, string m) : + base(c, t, m) + { + } + + public bool MoveFolder(string id, string newParentFolderID) + { + SqliteCommand cmd = new SqliteCommand(); + + cmd.CommandText = String.Format("update {0} set parentFolderID = :ParentFolderID where folderID = :FolderID", m_Realm); + cmd.Parameters.Add(new SqliteParameter(":ParentFolderID", newParentFolderID)); + cmd.Parameters.Add(new SqliteParameter(":FolderID", id)); + + return ExecuteNonQuery(cmd, m_Connection) == 0 ? false : true; + } + } +} \ No newline at end of file diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index 309dab4501..9abc5e4f72 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs @@ -400,16 +400,7 @@ namespace OpenSim.Services.InventoryService public virtual bool MoveFolder(InventoryFolderBase folder) { - XInventoryFolder[] x = m_Database.GetFolders( - new string[] { "folderID" }, - new string[] { folder.ID.ToString() }); - - if (x.Length == 0) - return false; - - x[0].parentFolderID = folder.ParentID; - - return m_Database.StoreFolder(x[0]); + return m_Database.MoveFolder(folder.ID.ToString(), folder.ParentID.ToString()); } // We don't check the principal's ID here diff --git a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs index bca5979e50..f9bf768da3 100644 --- a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs @@ -125,6 +125,7 @@ namespace OpenSim.Tests.Common.Mock } public bool MoveItem(string id, string newParent) { throw new NotImplementedException(); } + public bool MoveFolder(string id, string newParent) { throw new NotImplementedException(); } public XInventoryItem[] GetActiveGestures(UUID principalID) { throw new NotImplementedException(); } public int GetAssetPermissions(UUID principalID, UUID assetID) { throw new NotImplementedException(); } } From 61b816ebba57307410d877c4190e81b6469718cb Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 9 Nov 2012 01:18:11 +0000 Subject: [PATCH 4/6] minor: Adjust method doc on IXInventoryData MoveItem() and MoveFolder() to make it clear we're moving to an existing folder. --- OpenSim/Data/IXInventoryData.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/OpenSim/Data/IXInventoryData.cs b/OpenSim/Data/IXInventoryData.cs index 0df71f5cad..ca4750660a 100644 --- a/OpenSim/Data/IXInventoryData.cs +++ b/OpenSim/Data/IXInventoryData.cs @@ -117,20 +117,20 @@ namespace OpenSim.Data bool DeleteItems(string[] fields, string[] vals); /// - /// Move an item to a new folder. + /// Move an item to another folder. /// /// /returns> /// UUID of the item - /// UUID of the new folder. - bool MoveItem(string id, string newParent); + /// UUID of the new parent folder. + bool MoveItem(string id, string newParentFolderID); /// - /// Move a folder to a new folder. + /// Move a folder to another folder. /// /// /returns> /// UUID of the item - /// UUID of the new folder. - bool MoveFolder(string id, string newParent); + /// UUID of the new parent folder. + bool MoveFolder(string id, string newParentFolderID); XInventoryItem[] GetActiveGestures(UUID principalID); int GetAssetPermissions(UUID principalID, UUID assetID); From 5bff7415441d2e3943229a759ef963d45e165ceb Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Sun, 4 Nov 2012 11:13:03 +0000 Subject: [PATCH 5/6] marking IRegionModule interface as obsolete via System.ObsoleteAttribute, intentionally triggering a bunch of warnings in compiler output in hopes of encouraging other developers to refactor built-in modules when they have free time. --- OpenSim/Region/Framework/Interfaces/IRegionModule.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OpenSim/Region/Framework/Interfaces/IRegionModule.cs b/OpenSim/Region/Framework/Interfaces/IRegionModule.cs index 2bb0c75b99..aacc26b001 100644 --- a/OpenSim/Region/Framework/Interfaces/IRegionModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IRegionModule.cs @@ -24,6 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using Nini.Config; using OpenSim.Region.Framework.Scenes; @@ -33,6 +34,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// DEPRECATED! Use INonSharedRegionModule or ISharedRegionModule instead /// + [Obsolete("Use INonSharedRegionModule or ISharedRegionModule instead", false)] public interface IRegionModule { /// From 64c80aec644b2fede1b08ad360f54a658d4849cb Mon Sep 17 00:00:00 2001 From: PixelTomsen Date: Mon, 5 Nov 2012 19:16:46 +0100 Subject: [PATCH 6/6] llSetLinkCamera implementation wiki: http://wiki.secondlife.com/wiki/LlSetLinkCamera mantis: http://opensimulator.org/mantis/view.php?id=6397 --- .../Shared/Api/Implementation/LSL_Api.cs | 30 +++++++++++++++++++ .../Shared/Api/Interface/ILSL_Api.cs | 1 + .../Shared/Api/Runtime/LSL_Stub.cs | 5 ++++ 3 files changed, 36 insertions(+) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index be030af5db..acf4d8c1d2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -6637,6 +6637,36 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.SetCameraAtOffset(offset); } + public void llSetLinkCamera(LSL_Integer link, LSL_Vector eye, LSL_Vector at) + { + m_host.AddScriptLPS(1); + + if (link == ScriptBaseClass.LINK_SET || + link == ScriptBaseClass.LINK_ALL_CHILDREN || + link == ScriptBaseClass.LINK_ALL_OTHERS) return; + + SceneObjectPart part = null; + + switch (link) + { + case ScriptBaseClass.LINK_ROOT: + part = m_host.ParentGroup.RootPart; + break; + case ScriptBaseClass.LINK_THIS: + part = m_host; + break; + default: + part = m_host.ParentGroup.GetLinkNumPart(link); + break; + } + + if (null != part) + { + part.SetCameraEyeOffset(eye); + part.SetCameraAtOffset(at); + } + } + public LSL_String llDumpList2String(LSL_List src, string seperator) { m_host.AddScriptLPS(1); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs index e97ff9d1ba..98f8be7175 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs @@ -333,6 +333,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces void llSetBuoyancy(double buoyancy); void llSetCameraAtOffset(LSL_Vector offset); void llSetCameraEyeOffset(LSL_Vector offset); + void llSetLinkCamera(LSL_Integer link, LSL_Vector eye, LSL_Vector at); void llSetCameraParams(LSL_List rules); void llSetClickAction(int action); void llSetColor(LSL_Vector color, int face); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index c4578804c2..36803a4ae2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs @@ -1498,6 +1498,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase m_LSL_Functions.llSetCameraEyeOffset(offset); } + public void llSetLinkCamera(LSL_Integer link, LSL_Vector eye, LSL_Vector at) + { + m_LSL_Functions.llSetLinkCamera(link, eye, at); + } + public void llSetCameraParams(LSL_List rules) { m_LSL_Functions.llSetCameraParams(rules);