From 1a35af229c8a15b74c13de15cdce8949b3689db3 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 5 Jan 2017 19:58:56 +0000 Subject: remove code i started but didn't finish --- .../Shared/Api/Implementation/LSL_Api.cs | 85 ---------------------- 1 file changed, 85 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 8f9ff03..9cb3cad 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -14484,91 +14484,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return contacts.ToArray(); } - private ContactResult? GroundIntersection2(Vector3 rayStart, Vector3 rayEnd) - { - // get work copies - float sx = rayStart.X; - float ex = rayEnd.X; - float sy = rayStart.Y; - float ey = rayEnd.Y; - - float dx = ex - sx; - float dy = ey - sy; - - // region size info - float rsx = World.RegionInfo.RegionSizeX; - - float tmp; - - // region bounds - if(sx < 0) - { - if(ex < 0) // totally outside - return null; - if(dx <= 0) // out and going away - return null; - else if(ex >= rsx) - ex = rsx - 0.001f; - tmp = -sx / dx; - sy += dy * dx; - sx = 0; - } - else if(sx >= rsx) - { - if(ex >= rsx) // totally outside - return null; - if(dx >= 0) // out and going away - return null; - else if(ex < 0) - ex = 0; - tmp = (rsx - sx) / dx; - sy += dy * dx; - sx = rsx - 0.001f; - } - - float rsy = World.RegionInfo.RegionSizeY; - if(sy < 0) - { - if(dy <= 0) // out and going away - return null; - else if(ey >= rsy) - ey = rsy - 0.001f; - tmp = -sy / dy; - sx += dy * dx; - sy = 0; - } - else if(sy >= rsy) - { - if(dy >= 0) // out and going away - return null; - else if(ey < 0) - ey = 0; - tmp = (rsy - sy) / dy; - sx += dy * dx; - sy = rsy - 0.001f; - } - - if(sx < 0 || sx >= rsx) - return null; - - float sz = rayStart.Z; - float ez = rayEnd.Z; - float dz = ez - sz; - - float dist = dx * dx + dy * dy + dz * dz; - if(dist < 0.001) - return null; - dist = (float)Math.Sqrt(dist); - tmp = 1.0f / dist; - Vector3 rayn = new Vector3(dx * tmp, dy * tmp, dz * tmp); - - ContactResult? result = null; - - - - return result; - } - private ContactResult? GroundIntersection(Vector3 rayStart, Vector3 rayEnd) { double[,] heightfield = World.Heightmap.GetDoubles(); -- cgit v1.1 From ad8915f154d2ce6ba1b3a021b1725a0b0a671635 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 6 Jan 2017 00:55:14 +0000 Subject: Restructure god level and permissions Create a class GodController which controls all aspects of god level, viewer modes and user levels at ScenePresence level. --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 8 ++++---- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs | 6 +++--- .../Shared/Api/Implementation/Plugins/SensorRepeat.cs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9cb3cad..92d6808 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4977,7 +4977,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (presence != null && presence.PresenceType != PresenceType.Npc) { // agent must not be a god - if (presence.UserLevel >= 200) return; + if (presence.GodController.UserLevel >= 200) return; // agent must be over the owners land if (m_host.OwnerID == World.LandChannel.GetLandObject(presence.AbsolutePosition).LandData.OwnerID) @@ -5029,7 +5029,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api else { // agent must not be a god - if (presence.GodLevel >= 200) return; + if (presence.GodController.GodLevel >= 200) return; // agent must be over the owners land ILandObject agentLand = World.LandChannel.GetLandObject(presence.AbsolutePosition); @@ -5256,7 +5256,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; // Pushee is in GodMode this pushing object isn't owned by them - if (avatar.GodLevel > 0 && m_host.OwnerID != targetID) + if (avatar.GodController.GodLevel > 0 && m_host.OwnerID != targetID) return; pusheeav = avatar; @@ -6687,7 +6687,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api delegate (ScenePresence ssp) { // Gods are not listed in SL - if (!ssp.IsDeleted && ssp.GodLevel == 0.0 && !ssp.IsChildAgent) + if (!ssp.IsDeleted && ssp.GodController.GodLevel == 0.0 && !ssp.IsChildAgent) { if (!regionWide) { diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs index cec595d..49e70bc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs @@ -721,7 +721,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { ScenePresence sp = World.GetScenePresence(m_host.OwnerID); - if (sp == null || sp.GodLevel < 200) + if (sp == null || sp.GodController.GodLevel < 200) { LSShoutError("lsSetWindlightScene can only be used by estate managers or owners."); return 0; @@ -768,7 +768,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { ScenePresence sp = World.GetScenePresence(m_host.OwnerID); - if (sp == null || sp.GodLevel < 200) + if (sp == null || sp.GodController.GodLevel < 200) { LSShoutError("lsSetWindlightScene can only be used by estate managers or owners."); return; @@ -799,7 +799,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { ScenePresence sp = World.GetScenePresence(m_host.OwnerID); - if (sp == null || sp.GodLevel < 200) + if (sp == null || sp.GodController.GodLevel < 200) { LSShoutError("lsSetWindlightSceneTargeted can only be used by estate managers or owners."); return 0; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index d401ed8..c7e7f89 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs @@ -540,7 +540,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins } } - if (presence.IsDeleted || presence.IsChildAgent || presence.GodLevel > 0.0) + if (presence.IsDeleted || presence.IsChildAgent || presence.GodController.GodLevel > 0.0) return; // if the object the script is in is attached and the avatar is the owner -- cgit v1.1