diff options
author | UbitUmarov | 2017-01-06 01:09:42 +0000 |
---|---|---|
committer | UbitUmarov | 2017-01-06 01:09:42 +0000 |
commit | 6172446e2afa53960b4e118e0b2ae199f6e17b3f (patch) | |
tree | 835b484189907c74259d70e1841c151ea3bb8e3f /OpenSim/Region/ScriptEngine | |
parent | fix merge (diff) | |
parent | UserLevel must have a trusted source (diff) | |
download | opensim-SC-6172446e2afa53960b4e118e0b2ae199f6e17b3f.zip opensim-SC-6172446e2afa53960b4e118e0b2ae199f6e17b3f.tar.gz opensim-SC-6172446e2afa53960b4e118e0b2ae199f6e17b3f.tar.bz2 opensim-SC-6172446e2afa53960b4e118e0b2ae199f6e17b3f.tar.xz |
Merge branch 'master' into httptests
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
3 files changed, 8 insertions, 93 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 8f9ff03..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 | |||
4977 | if (presence != null && presence.PresenceType != PresenceType.Npc) | 4977 | if (presence != null && presence.PresenceType != PresenceType.Npc) |
4978 | { | 4978 | { |
4979 | // agent must not be a god | 4979 | // agent must not be a god |
4980 | if (presence.UserLevel >= 200) return; | 4980 | if (presence.GodController.UserLevel >= 200) return; |
4981 | 4981 | ||
4982 | // agent must be over the owners land | 4982 | // agent must be over the owners land |
4983 | if (m_host.OwnerID == World.LandChannel.GetLandObject(presence.AbsolutePosition).LandData.OwnerID) | 4983 | if (m_host.OwnerID == World.LandChannel.GetLandObject(presence.AbsolutePosition).LandData.OwnerID) |
@@ -5029,7 +5029,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5029 | else | 5029 | else |
5030 | { | 5030 | { |
5031 | // agent must not be a god | 5031 | // agent must not be a god |
5032 | if (presence.GodLevel >= 200) return; | 5032 | if (presence.GodController.GodLevel >= 200) return; |
5033 | 5033 | ||
5034 | // agent must be over the owners land | 5034 | // agent must be over the owners land |
5035 | ILandObject agentLand = World.LandChannel.GetLandObject(presence.AbsolutePosition); | 5035 | ILandObject agentLand = World.LandChannel.GetLandObject(presence.AbsolutePosition); |
@@ -5256,7 +5256,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5256 | return; | 5256 | return; |
5257 | 5257 | ||
5258 | // Pushee is in GodMode this pushing object isn't owned by them | 5258 | // Pushee is in GodMode this pushing object isn't owned by them |
5259 | if (avatar.GodLevel > 0 && m_host.OwnerID != targetID) | 5259 | if (avatar.GodController.GodLevel > 0 && m_host.OwnerID != targetID) |
5260 | return; | 5260 | return; |
5261 | 5261 | ||
5262 | pusheeav = avatar; | 5262 | pusheeav = avatar; |
@@ -6687,7 +6687,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6687 | delegate (ScenePresence ssp) | 6687 | delegate (ScenePresence ssp) |
6688 | { | 6688 | { |
6689 | // Gods are not listed in SL | 6689 | // Gods are not listed in SL |
6690 | if (!ssp.IsDeleted && ssp.GodLevel == 0.0 && !ssp.IsChildAgent) | 6690 | if (!ssp.IsDeleted && ssp.GodController.GodLevel == 0.0 && !ssp.IsChildAgent) |
6691 | { | 6691 | { |
6692 | if (!regionWide) | 6692 | if (!regionWide) |
6693 | { | 6693 | { |
@@ -14484,91 +14484,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
14484 | return contacts.ToArray(); | 14484 | return contacts.ToArray(); |
14485 | } | 14485 | } |
14486 | 14486 | ||
14487 | private ContactResult? GroundIntersection2(Vector3 rayStart, Vector3 rayEnd) | ||
14488 | { | ||
14489 | // get work copies | ||
14490 | float sx = rayStart.X; | ||
14491 | float ex = rayEnd.X; | ||
14492 | float sy = rayStart.Y; | ||
14493 | float ey = rayEnd.Y; | ||
14494 | |||
14495 | float dx = ex - sx; | ||
14496 | float dy = ey - sy; | ||
14497 | |||
14498 | // region size info | ||
14499 | float rsx = World.RegionInfo.RegionSizeX; | ||
14500 | |||
14501 | float tmp; | ||
14502 | |||
14503 | // region bounds | ||
14504 | if(sx < 0) | ||
14505 | { | ||
14506 | if(ex < 0) // totally outside | ||
14507 | return null; | ||
14508 | if(dx <= 0) // out and going away | ||
14509 | return null; | ||
14510 | else if(ex >= rsx) | ||
14511 | ex = rsx - 0.001f; | ||
14512 | tmp = -sx / dx; | ||
14513 | sy += dy * dx; | ||
14514 | sx = 0; | ||
14515 | } | ||
14516 | else if(sx >= rsx) | ||
14517 | { | ||
14518 | if(ex >= rsx) // totally outside | ||
14519 | return null; | ||
14520 | if(dx >= 0) // out and going away | ||
14521 | return null; | ||
14522 | else if(ex < 0) | ||
14523 | ex = 0; | ||
14524 | tmp = (rsx - sx) / dx; | ||
14525 | sy += dy * dx; | ||
14526 | sx = rsx - 0.001f; | ||
14527 | } | ||
14528 | |||
14529 | float rsy = World.RegionInfo.RegionSizeY; | ||
14530 | if(sy < 0) | ||
14531 | { | ||
14532 | if(dy <= 0) // out and going away | ||
14533 | return null; | ||
14534 | else if(ey >= rsy) | ||
14535 | ey = rsy - 0.001f; | ||
14536 | tmp = -sy / dy; | ||
14537 | sx += dy * dx; | ||
14538 | sy = 0; | ||
14539 | } | ||
14540 | else if(sy >= rsy) | ||
14541 | { | ||
14542 | if(dy >= 0) // out and going away | ||
14543 | return null; | ||
14544 | else if(ey < 0) | ||
14545 | ey = 0; | ||
14546 | tmp = (rsy - sy) / dy; | ||
14547 | sx += dy * dx; | ||
14548 | sy = rsy - 0.001f; | ||
14549 | } | ||
14550 | |||
14551 | if(sx < 0 || sx >= rsx) | ||
14552 | return null; | ||
14553 | |||
14554 | float sz = rayStart.Z; | ||
14555 | float ez = rayEnd.Z; | ||
14556 | float dz = ez - sz; | ||
14557 | |||
14558 | float dist = dx * dx + dy * dy + dz * dz; | ||
14559 | if(dist < 0.001) | ||
14560 | return null; | ||
14561 | dist = (float)Math.Sqrt(dist); | ||
14562 | tmp = 1.0f / dist; | ||
14563 | Vector3 rayn = new Vector3(dx * tmp, dy * tmp, dz * tmp); | ||
14564 | |||
14565 | ContactResult? result = null; | ||
14566 | |||
14567 | |||
14568 | |||
14569 | return result; | ||
14570 | } | ||
14571 | |||
14572 | private ContactResult? GroundIntersection(Vector3 rayStart, Vector3 rayEnd) | 14487 | private ContactResult? GroundIntersection(Vector3 rayStart, Vector3 rayEnd) |
14573 | { | 14488 | { |
14574 | double[,] heightfield = World.Heightmap.GetDoubles(); | 14489 | double[,] heightfield = World.Heightmap.GetDoubles(); |
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 | |||
721 | { | 721 | { |
722 | ScenePresence sp = World.GetScenePresence(m_host.OwnerID); | 722 | ScenePresence sp = World.GetScenePresence(m_host.OwnerID); |
723 | 723 | ||
724 | if (sp == null || sp.GodLevel < 200) | 724 | if (sp == null || sp.GodController.GodLevel < 200) |
725 | { | 725 | { |
726 | LSShoutError("lsSetWindlightScene can only be used by estate managers or owners."); | 726 | LSShoutError("lsSetWindlightScene can only be used by estate managers or owners."); |
727 | return 0; | 727 | return 0; |
@@ -768,7 +768,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
768 | { | 768 | { |
769 | ScenePresence sp = World.GetScenePresence(m_host.OwnerID); | 769 | ScenePresence sp = World.GetScenePresence(m_host.OwnerID); |
770 | 770 | ||
771 | if (sp == null || sp.GodLevel < 200) | 771 | if (sp == null || sp.GodController.GodLevel < 200) |
772 | { | 772 | { |
773 | LSShoutError("lsSetWindlightScene can only be used by estate managers or owners."); | 773 | LSShoutError("lsSetWindlightScene can only be used by estate managers or owners."); |
774 | return; | 774 | return; |
@@ -799,7 +799,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
799 | { | 799 | { |
800 | ScenePresence sp = World.GetScenePresence(m_host.OwnerID); | 800 | ScenePresence sp = World.GetScenePresence(m_host.OwnerID); |
801 | 801 | ||
802 | if (sp == null || sp.GodLevel < 200) | 802 | if (sp == null || sp.GodController.GodLevel < 200) |
803 | { | 803 | { |
804 | LSShoutError("lsSetWindlightSceneTargeted can only be used by estate managers or owners."); | 804 | LSShoutError("lsSetWindlightSceneTargeted can only be used by estate managers or owners."); |
805 | return 0; | 805 | 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 | |||
540 | } | 540 | } |
541 | } | 541 | } |
542 | 542 | ||
543 | if (presence.IsDeleted || presence.IsChildAgent || presence.GodLevel > 0.0) | 543 | if (presence.IsDeleted || presence.IsChildAgent || presence.GodController.GodLevel > 0.0) |
544 | return; | 544 | return; |
545 | 545 | ||
546 | // if the object the script is in is attached and the avatar is the owner | 546 | // if the object the script is in is attached and the avatar is the owner |