From 6a4c578e5eba688516af2b0123869bb43e663eda Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 30 Dec 2009 00:36:16 +0000 Subject: Fix an omission in LSL that causes a viewer crash --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 2b6d9bd..6102504 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -6260,6 +6260,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api LSLError("First parameter to llDialog needs to be a key"); return; } + if (buttons.Length < 1) + { + LSLError("No less than 1 button can be shown"); + return; + } if (buttons.Length > 12) { LSLError("No more than 12 buttons can be shown"); -- cgit v1.1 From e6cd7f28de3a8c8c98dd8c534845d2f3936d2092 Mon Sep 17 00:00:00 2001 From: Revolution Date: Thu, 31 Dec 2009 11:41:07 -0600 Subject: Readds llCollisionFilter and adds llPassCollision. Applied with whitespace cleanup Signed-off-by: Melanie --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6102504..d242506 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2752,7 +2752,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llCollisionFilter(string name, string id, int accept) { m_host.AddScriptLPS(1); - NotImplemented("llCollisionFilter"); + m_host.CollisionFilter.Clear(); + if(id != null) + { + m_host.CollisionFilter.Add(accept,id); + } + else + { + m_host.CollisionFilter.Add(accept,name); + } } public void llTakeControls(int controls, int accept, int pass_on) @@ -4232,7 +4240,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llPassCollisions(int pass) { m_host.AddScriptLPS(1); - NotImplemented("llPassCollisions"); + if(pass == 0) + { + m_host.ParentGroup.PassCollision = false; + } + else + { + m_host.ParentGroup.PassCollision = true; + } } public LSL_String llGetScriptName() -- cgit v1.1 From b63405c1a796b44b58081857d01f726372467628 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 8 Jan 2010 10:43:34 -0800 Subject: Inching ahead... This compiles, but very likely does not run. --- .../Shared/Api/Implementation/LSL_Api.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 39b597e..2bfd3fb 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -52,8 +52,9 @@ using OpenSim.Region.ScriptEngine.Shared.ScriptBase; using OpenSim.Region.ScriptEngine.Interfaces; using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; using OpenSim.Services.Interfaces; - +using OpenSim.Services.Interfaces; using GridRegion = OpenSim.Services.Interfaces.GridRegion; +using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo; using AssetLandmark = OpenSim.Framework.AssetLandmark; @@ -3842,13 +3843,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api UUID uuid = (UUID)id; - UserProfileData userProfile = - World.CommsManager.UserService.GetUserProfile(uuid); + UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, uuid); - UserAgentData userAgent = - World.CommsManager.UserService.GetAgentByUUID(uuid); + PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() }); + PresenceInfo pinfo = PresenceInfo.GetOnlinePresence(pinfos); - if (userProfile == null || userAgent == null) + if (pinfo == null) return UUID.Zero.ToString(); string reply = String.Empty; @@ -3857,17 +3857,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { case 1: // DATA_ONLINE (0|1) // TODO: implement fetching of this information - if (userProfile.CurrentAgent!=null && userProfile.CurrentAgent.AgentOnline) + if (pinfo != null) reply = "1"; - else + else reply = "0"; break; case 2: // DATA_NAME (First Last) - reply = userProfile.FirstName + " " + userProfile.SurName; + reply = account.FirstName + " " + account.LastName; break; case 3: // DATA_BORN (YYYY-MM-DD) DateTime born = new DateTime(1970, 1, 1, 0, 0, 0, 0); - born = born.AddSeconds(userProfile.Created); + born = born.AddSeconds(account.Created); reply = born.ToString("yyyy-MM-dd"); break; case 4: // DATA_RATING (0,0,0,0,0,0) -- cgit v1.1 From 1e1b2ab221851efc414678b7ea52ef2ca788ce9f Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 10 Jan 2010 10:40:07 -0800 Subject: * OMG! All but one references to UserProfileCacheService have been rerouted! * HG is seriously broken here * Compiles. Untested. --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 6 +++--- .../ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 14 ++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 2bfd3fb..876668c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -849,10 +849,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string resolveName(UUID objecUUID) { // try avatar username surname - CachedUserInfo profile = World.CommsManager.UserProfileCacheService.GetUserDetails(objecUUID); - if (profile != null && profile.UserProfile != null) + UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, objecUUID); + if (account != null) { - string avatarname = profile.UserProfile.FirstName + " " + profile.UserProfile.SurName; + string avatarname = account.Name; return avatarname; } // try an scene object diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index d8b9159..aa878e6 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1691,15 +1691,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.Low, "osAvatarName2Key"); - CachedUserInfo userInfo = World.CommsManager.UserProfileCacheService.GetUserDetails(firstname, lastname); - - if (null == userInfo) + UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, firstname, lastname); + if (null == account) { return UUID.Zero.ToString(); } else { - return userInfo.UserProfile.ID.ToString(); + return account.PrincipalID.ToString(); } } @@ -1710,15 +1709,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (UUID.TryParse(id, out key)) { - CachedUserInfo userInfo = World.CommsManager.UserProfileCacheService.GetUserDetails(key); - - if (null == userInfo) + UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, key); + if (null == account) { return ""; } else { - return userInfo.UserProfile.Name; + return account.Name; } } else -- cgit v1.1 From c5ea783526611a968400a1936e4c6764ee1c7013 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 11 Jan 2010 07:51:33 -0800 Subject: OpenSim/Framework/Communications/Cache deleted. LibraryRootFolder deleted. --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 +- .../ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 876668c..d5562f2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -38,7 +38,7 @@ using OpenMetaverse; using OpenMetaverse.Packets; using OpenSim; using OpenSim.Framework; -using OpenSim.Framework.Communications.Cache; + using OpenSim.Region.CoreModules; using OpenSim.Region.CoreModules.World.Land; using OpenSim.Region.CoreModules.World.Terrain; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index aa878e6..0ed7f51 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -36,7 +36,7 @@ using OpenMetaverse; using Nini.Config; using OpenSim; using OpenSim.Framework; -using OpenSim.Framework.Communications.Cache; + using OpenSim.Framework.Console; using OpenSim.Region.CoreModules.Avatar.NPC; using OpenSim.Region.Framework.Interfaces; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index b75a2e4..829fbb7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs @@ -29,7 +29,7 @@ using System; using System.Collections.Generic; using OpenMetaverse; using OpenSim.Framework; -using OpenSim.Framework.Communications.Cache; + using OpenSim.Region.Framework.Scenes; using OpenSim.Region.ScriptEngine.Shared; using OpenSim.Region.ScriptEngine.Shared.Api; -- cgit v1.1 From 70465f4c9073033b87c781c35172656985fedccc Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 24 Jan 2010 16:23:18 -0800 Subject: Removed obsolete interface IHyperlink. --- .../ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 7462ba0..b28976e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -607,21 +607,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // and convert the regionName to the target region if (regionName.Contains(".") && regionName.Contains(":")) { + List regions = World.GridService.GetRegionsByName(World.RegionInfo.ScopeID, regionName, 1); // Try to link the region - IHyperlinkService hyperService = World.RequestModuleInterface(); - if (hyperService != null) + if (regions != null && regions.Count > 0) { - GridRegion regInfo = hyperService.TryLinkRegion(presence.ControllingClient, - regionName); - // Get the region name - if (regInfo != null) - { - regionName = regInfo.RegionName; - } - else - { - // Might need to ping the client here in case of failure?? - } + GridRegion regInfo = regions[0]; + regionName = regInfo.RegionName; } } presence.ControllingClient.SendTeleportLocationStart(); -- cgit v1.1 From 42f978a478093da579907e15dc29680a3711b27e Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 30 Jan 2010 09:23:07 -0800 Subject: * HGScene is no more. * Moved a few key inventory access methods from Scene.Inventory to an IInventoryAccessModule module --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index b28976e..fccd07e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -41,7 +41,6 @@ using OpenSim.Framework.Console; using OpenSim.Region.CoreModules.Avatar.NPC; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; -using OpenSim.Region.Framework.Scenes.Hypergrid; using OpenSim.Region.ScriptEngine.Shared; using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; using OpenSim.Region.ScriptEngine.Shared.ScriptBase; -- cgit v1.1 From 9821c4f566e11c75c8d87721777480c5b2e2bd4e Mon Sep 17 00:00:00 2001 From: Revolution Date: Sun, 14 Feb 2010 15:41:57 -0600 Subject: Revolution is on the roll again! :) Fixes: Undo, T-pose of others on login, modifiedBulletX works again, feet now stand on the ground instead of in the ground, adds checks to CombatModule. Adds: Redo, Land Undo, checks to agentUpdate (so one can not fall off of a region), more vehicle parts. Finishes almost all of LSL (1 function left, 2 events). Direct flames and kudos to Revolution, please Signed-off-by: Melanie --- .../Shared/Api/Implementation/LSL_Api.cs | 257 ++++++++++++++++----- 1 file changed, 202 insertions(+), 55 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a1db77e..eab4754 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1181,7 +1181,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if ((status & ScriptBaseClass.STATUS_BLOCK_GRAB) == ScriptBaseClass.STATUS_BLOCK_GRAB) { - NotImplemented("llSetStatus - STATUS_BLOCK_GRAB"); + if (value != 0) + m_host.SetBlockGrab(true); + else + m_host.SetBlockGrab(false); } if ((status & ScriptBaseClass.STATUS_DIE_AT_EDGE) == ScriptBaseClass.STATUS_DIE_AT_EDGE) @@ -1194,12 +1197,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if ((status & ScriptBaseClass.STATUS_RETURN_AT_EDGE) == ScriptBaseClass.STATUS_RETURN_AT_EDGE) { - NotImplemented("llSetStatus - STATUS_RETURN_AT_EDGE"); + if (value != 0) + m_host.SetReturnAtEdge(true); + else + m_host.SetReturnAtEdge(false); } if ((status & ScriptBaseClass.STATUS_SANDBOX) == ScriptBaseClass.STATUS_SANDBOX) { - NotImplemented("llSetStatus - STATUS_SANDBOX"); + if (value != 0) + m_host.SetStatusSandbox(true); + else + m_host.SetStatusSandbox(false); } if (statusrotationaxis != 0) @@ -1236,8 +1245,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return 0; case ScriptBaseClass.STATUS_BLOCK_GRAB: - NotImplemented("llGetStatus - STATUS_BLOCK_GRAB"); - return 0; + if (m_host.GetBlockGrab()) + return 1; + else + return 0; case ScriptBaseClass.STATUS_DIE_AT_EDGE: if (m_host.GetDieAtEdge()) @@ -1246,24 +1257,34 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return 0; case ScriptBaseClass.STATUS_RETURN_AT_EDGE: - NotImplemented("llGetStatus - STATUS_RETURN_AT_EDGE"); - return 0; + if (m_host.GetReturnAtEdge()) + return 1; + else + return 0; case ScriptBaseClass.STATUS_ROTATE_X: - NotImplemented("llGetStatus - STATUS_ROTATE_X"); - return 0; + if (m_host.GetAxisRotation(2) == 2) + return 1; + else + return 0; case ScriptBaseClass.STATUS_ROTATE_Y: - NotImplemented("llGetStatus - STATUS_ROTATE_Y"); - return 0; + if (m_host.GetAxisRotation(4) == 4) + return 1; + else + return 0; case ScriptBaseClass.STATUS_ROTATE_Z: - NotImplemented("llGetStatus - STATUS_ROTATE_Z"); - return 0; + if (m_host.GetAxisRotation(8) == 8) + return 1; + else + return 0; case ScriptBaseClass.STATUS_SANDBOX: - NotImplemented("llGetStatus - STATUS_SANDBOX"); - return 0; + if (m_host.GetStatusSandbox()) + return 1; + else + return 0; } return 0; } @@ -2201,7 +2222,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); // send the sound, once, to all clients in range - m_host.SendSound(KeyOrName(sound).ToString(), volume, false, 0); + m_host.SendSound(KeyOrName(sound).ToString(), volume, false, 0, 0, false, false); } // Xantor 20080528 we should do this differently. @@ -2231,42 +2252,98 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llLoopSoundMaster(string sound, double volume) { m_host.AddScriptLPS(1); - NotImplemented("llLoopSoundMaster"); + m_host.ParentGroup.LoopSoundMasterPrim = m_host; + lock (m_host.ParentGroup.LoopSoundSlavePrims) + { + foreach (SceneObjectPart prim in m_host.ParentGroup.LoopSoundSlavePrims) + { + if (prim.Sound != UUID.Zero) + llStopSound(); + + prim.Sound = KeyOrName(sound); + prim.SoundGain = volume; + prim.SoundFlags = 1; // looping + prim.SoundRadius = 20; // Magic number, 20 seems reasonable. Make configurable? + + prim.ScheduleFullUpdate(); + prim.SendFullUpdateToAllClients(); + } + } + if (m_host.Sound != UUID.Zero) + llStopSound(); + + m_host.Sound = KeyOrName(sound); + m_host.SoundGain = volume; + m_host.SoundFlags = 1; // looping + m_host.SoundRadius = 20; // Magic number, 20 seems reasonable. Make configurable? + + m_host.ScheduleFullUpdate(); + m_host.SendFullUpdateToAllClients(); } public void llLoopSoundSlave(string sound, double volume) { m_host.AddScriptLPS(1); - NotImplemented("llLoopSoundSlave"); + lock (m_host.ParentGroup.LoopSoundSlavePrims) + { + m_host.ParentGroup.LoopSoundSlavePrims.Add(m_host); + } } public void llPlaySoundSlave(string sound, double volume) { m_host.AddScriptLPS(1); - NotImplemented("llPlaySoundSlave"); + + // send the sound, once, to all clients in range + m_host.SendSound(KeyOrName(sound).ToString(), volume, false, 0, 0, true, false); } public void llTriggerSound(string sound, double volume) { m_host.AddScriptLPS(1); // send the sound, once, to all clients in range - m_host.SendSound(KeyOrName(sound).ToString(), volume, true, 0); + m_host.SendSound(KeyOrName(sound).ToString(), volume, true, 0, 0, false, false); } // Xantor 20080528: Clear prim data of sound instead public void llStopSound() { m_host.AddScriptLPS(1); - - m_host.Sound = UUID.Zero; - m_host.SoundGain = 0; - m_host.SoundFlags = 0; - m_host.SoundRadius = 0; - - m_host.ScheduleFullUpdate(); - m_host.SendFullUpdateToAllClients(); - - // m_host.SendSound(UUID.Zero.ToString(), 1.0, false, 2); + if (m_host.ParentGroup.LoopSoundSlavePrims.Contains(m_host)) + { + if (m_host.ParentGroup.LoopSoundMasterPrim == m_host) + { + foreach (SceneObjectPart part in m_host.ParentGroup.LoopSoundSlavePrims) + { + part.Sound = UUID.Zero; + part.SoundGain = 0; + part.SoundFlags = 0; + part.SoundRadius = 0; + part.ScheduleFullUpdate(); + part.SendFullUpdateToAllClients(); + } + m_host.ParentGroup.LoopSoundMasterPrim = null; + m_host.ParentGroup.LoopSoundSlavePrims.Clear(); + } + else + { + m_host.Sound = UUID.Zero; + m_host.SoundGain = 0; + m_host.SoundFlags = 0; + m_host.SoundRadius = 0; + m_host.ScheduleFullUpdate(); + m_host.SendFullUpdateToAllClients(); + } + } + else + { + m_host.Sound = UUID.Zero; + m_host.SoundGain = 0; + m_host.SoundFlags = 0; + m_host.SoundRadius = 0; + m_host.ScheduleFullUpdate(); + m_host.SendFullUpdateToAllClients(); + } } public void llPreloadSound(string sound) @@ -2660,8 +2737,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llLookAt(LSL_Vector target, double strength, double damping) { - // partial implementation, rotates objects correctly but does not apply strength or damping attributes - m_host.AddScriptLPS(1); // Determine where we are looking from LSL_Vector from = llGetPos(); @@ -2681,9 +2756,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // the angles of rotation in radians into rotation value LSL_Types.Quaternion rot = llEuler2Rot(angle); - + Quaternion rotation = new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s); + m_host.startLookAt(rotation, (float)damping, (float)strength); // Orient the object to the angle calculated - llSetRot(rot); + //llSetRot(rot); } public void llStopLookAt() @@ -3045,8 +3121,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llRotLookAt(LSL_Rotation target, double strength, double damping) { m_host.AddScriptLPS(1); -// NotImplemented("llRotLookAt"); - m_host.RotLookAt(Rot2Quaternion(target), (float)strength, (float)damping); + Quaternion rot = new Quaternion((float)target.x, (float)target.y, (float)target.z, (float)target.s); + m_host.RotLookAt(rot, (float)strength, (float)damping); } public LSL_Integer llStringLength(string str) @@ -3144,13 +3220,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llPointAt(LSL_Vector pos) { m_host.AddScriptLPS(1); - NotImplemented("llPointAt"); + ScenePresence Owner = World.GetScenePresence(m_host.UUID); + LSL_Rotation rot = llEuler2Rot(pos); + Owner.PreviousRotation = Owner.Rotation; + Owner.Rotation = (new Quaternion((float)rot.x,(float)rot.y,(float)rot.z,(float)rot.s)); } public void llStopPointAt() { m_host.AddScriptLPS(1); - NotImplemented("llStopPointAt"); + ScenePresence Owner = m_host.ParentGroup.Scene.GetScenePresence(m_host.OwnerID); + Owner.Rotation = Owner.PreviousRotation; } public void llTargetOmega(LSL_Vector axis, double spinrate, double gain) @@ -3946,8 +4026,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llCollisionSound(string impact_sound, double impact_volume) { m_host.AddScriptLPS(1); - //NotImplemented("llCollisionSound"); - // TODO: Parameter check logic required. UUID soundId = UUID.Zero; if (!UUID.TryParse(impact_sound, out soundId)) @@ -4535,8 +4613,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llGetCenterOfMass() { m_host.AddScriptLPS(1); - NotImplemented("llGetCenterOfMass"); - return new LSL_Vector(); + Vector3 center = m_host.GetGeometricCenter(); + return new LSL_Vector(center.X,center.Y,center.Z); } public LSL_List llListSort(LSL_List src, int stride, int ascending) @@ -5269,8 +5347,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api flags |= ScriptBaseClass.AGENT_SITTING; } - //NotImplemented("llGetAgentInfo"); - return flags; } @@ -5353,7 +5429,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api LSL_Vector bottom_south_west) { m_host.AddScriptLPS(1); - NotImplemented("llTriggerSoundLimited"); + float radius1 = (float)llVecDist(llGetPos(), top_north_east); + float radius2 = (float)llVecDist(llGetPos(), bottom_south_west); + float radius = Math.Abs(radius1 - radius2); + m_host.SendSound(KeyOrName(sound).ToString(), volume, true, 0, radius, false, false); } public void llEjectFromLand(string pest) @@ -5892,7 +5971,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llGroundRepel(double height, int water, double tau) { m_host.AddScriptLPS(1); - NotImplemented("llGroundRepel"); + if (m_host.PhysActor != null) + { + float ground = (float)llGround(new LSL_Types.Vector3(0, 0, 0)); + float waterLevel = (float)llWater(new LSL_Types.Vector3(0, 0, 0)); + PIDHoverType hoverType = PIDHoverType.Ground; + if (water != 0) + { + hoverType = PIDHoverType.GroundAndWater; + if (ground < waterLevel) + height += waterLevel; + else + height += ground; + } + else + { + height += ground; + } + + m_host.SetHoverHeight((float)height, hoverType, (float)tau); + } } protected UUID GetTaskInventoryItem(string name) @@ -6021,13 +6119,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetVehicleFlags(int flags) { m_host.AddScriptLPS(1); - NotImplemented("llSetVehicleFlags"); + if (m_host.ParentGroup != null) + { + if (!m_host.ParentGroup.IsDeleted) + { + m_host.ParentGroup.RootPart.SetVehicleFlags(flags, false); + } + } } public void llRemoveVehicleFlags(int flags) { m_host.AddScriptLPS(1); - NotImplemented("llRemoveVehicleFlags"); + if (m_host.ParentGroup != null) + { + if (!m_host.ParentGroup.IsDeleted) + { + m_host.ParentGroup.RootPart.SetVehicleFlags(flags, true); + } + } } public void llSitTarget(LSL_Vector offset, LSL_Rotation rot) @@ -7049,7 +7159,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llRemoteDataSetRegion() { m_host.AddScriptLPS(1); - NotImplemented("llRemoteDataSetRegion"); + Deprecated("llRemoteDataSetRegion"); } public LSL_Float llLog10(double val) @@ -8081,7 +8191,39 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llSetInventoryPermMask(string item, int mask, int value) { m_host.AddScriptLPS(1); - NotImplemented("llSetInventoryPermMask"); + if (m_ScriptEngine.Config.GetBoolean("AllowGodFunctions", false)) + { + if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) + { + lock (m_host.TaskInventory) + { + foreach (KeyValuePair inv in m_host.TaskInventory) + { + if (inv.Value.Name == item) + { + switch (mask) + { + case 0: + inv.Value.BasePermissions = (uint)value; + break; + case 1: + inv.Value.CurrentPermissions = (uint)value; + break; + case 2: + inv.Value.GroupPermissions = (uint)value; + break; + case 3: + inv.Value.EveryonePermissions = (uint)value; + break; + case 4: + inv.Value.NextPermissions = (uint)value; + break; + } + } + } + } + } + } } public LSL_String llGetInventoryCreator(string item) @@ -8515,6 +8657,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // we send to all landData.MediaID = new UUID(texture); landData.MediaAutoScale = autoAlign ? (byte)1 : (byte)0; + landData.MediaSize[0] = width; + landData.MediaSize[1] = height; + landData.MediaType = mediaType; // do that one last, it will cause a ParcelPropertiesUpdate landObject.SetMediaUrl(url); @@ -8574,11 +8719,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); LSL_List list = new LSL_List(); //TO DO: make the implementation for the missing commands - //PARCEL_MEDIA_COMMAND_TEXTURE key uuid Use this to get or set the parcel's media texture. - //PARCEL_MEDIA_COMMAND_URL string url Used to get or set the parcel's media url. - //PARCEL_MEDIA_COMMAND_TYPE string mime_type Use this to get or set the parcel media MIME type (e.g. "text/html"). (1.19.1 RC0 or later) - //PARCEL_MEDIA_COMMAND_SIZE integer x, integer y Use this to get or set the parcel media pixel resolution. (1.19.1 RC0 or later) - //PARCEL_MEDIA_COMMAND_DESC string desc Use this to get or set the parcel media description. (1.19.1 RC0 or later) //PARCEL_MEDIA_COMMAND_LOOP_SET float loop Use this to get or set the parcel's media loop duration. (1.19.1 RC0 or later) for (int i = 0; i < aList.Data.Length; i++) { @@ -8596,6 +8736,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case ParcelMediaCommandEnum.Texture: list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaID.ToString())); break; + case ParcelMediaCommandEnum.Type: + list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaType)); + break; + case ParcelMediaCommandEnum.Size: + list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaSize[0])); + list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaSize[1])); + break; default: ParcelMediaCommandEnum mediaCommandEnum = ParcelMediaCommandEnum.Url; NotImplemented("llParcelMediaQuery parameter do not supported yet: " + Enum.Parse(mediaCommandEnum.GetType() , aList.Data[i].ToString()).ToString()); -- cgit v1.1 From af265e001d3bf043590e480cd6574a14193f6de0 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 15 Feb 2010 19:15:03 +0900 Subject: Formatting cleanup. --- .../Shared/Api/Implementation/LSL_Api.cs | 64 +++++++++++----------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index eab4754..aa876ec 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -8192,38 +8192,38 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); if (m_ScriptEngine.Config.GetBoolean("AllowGodFunctions", false)) - { - if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) - { - lock (m_host.TaskInventory) - { - foreach (KeyValuePair inv in m_host.TaskInventory) - { - if (inv.Value.Name == item) - { - switch (mask) - { - case 0: - inv.Value.BasePermissions = (uint)value; - break; - case 1: - inv.Value.CurrentPermissions = (uint)value; - break; - case 2: - inv.Value.GroupPermissions = (uint)value; - break; - case 3: - inv.Value.EveryonePermissions = (uint)value; - break; - case 4: - inv.Value.NextPermissions = (uint)value; - break; - } - } - } - } - } - } + { + if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) + { + lock (m_host.TaskInventory) + { + foreach (KeyValuePair inv in m_host.TaskInventory) + { + if (inv.Value.Name == item) + { + switch (mask) + { + case 0: + inv.Value.BasePermissions = (uint)value; + break; + case 1: + inv.Value.CurrentPermissions = (uint)value; + break; + case 2: + inv.Value.GroupPermissions = (uint)value; + break; + case 3: + inv.Value.EveryonePermissions = (uint)value; + break; + case 4: + inv.Value.NextPermissions = (uint)value; + break; + } + } + } + } + } + } } public LSL_String llGetInventoryCreator(string item) -- cgit v1.1 From 7665aad002ef066fc31fa9497225d2668641c769 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Mon, 22 Feb 2010 13:27:17 -0800 Subject: * Adds CreatorID to asset metadata. This is just the plumbing to support CreatorID, it doesn't modify database backends or OAR files to support storing/loading it --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index fccd07e..68764e1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1474,7 +1474,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); // Create new asset - AssetBase asset = new AssetBase(UUID.Random(), notecardName, (sbyte)AssetType.Notecard); + AssetBase asset = new AssetBase(UUID.Random(), notecardName, (sbyte)AssetType.Notecard, m_host.OwnerID); asset.Description = "Script Generated Notecard"; string notecardData = String.Empty; -- cgit v1.1 From df76e95aa2dc9f3f3a0c546761b7624adc183ed0 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Mon, 22 Feb 2010 14:18:59 -0800 Subject: Changed asset CreatorID to a string --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 68764e1..85ee29d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1474,7 +1474,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); // Create new asset - AssetBase asset = new AssetBase(UUID.Random(), notecardName, (sbyte)AssetType.Notecard, m_host.OwnerID); + AssetBase asset = new AssetBase(UUID.Random(), notecardName, (sbyte)AssetType.Notecard, m_host.OwnerID.ToString()); asset.Description = "Script Generated Notecard"; string notecardData = String.Empty; -- cgit v1.1