diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 86 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 25 |
2 files changed, 98 insertions, 13 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index d06b134..3c5f2d0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -7759,24 +7759,59 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7759 | break; | 7759 | break; |
7760 | 7760 | ||
7761 | case (int)ScriptBaseClass.PRIM_BUMP_SHINY: | 7761 | case (int)ScriptBaseClass.PRIM_BUMP_SHINY: |
7762 | // TODO-------------- | ||
7763 | if (remain < 1) | 7762 | if (remain < 1) |
7764 | return res; | 7763 | return res; |
7765 | 7764 | ||
7766 | face=(int)rules.GetLSLIntegerItem(idx++); | 7765 | face=(int)rules.GetLSLIntegerItem(idx++); |
7767 | 7766 | ||
7768 | res.Add(new LSL_Integer(0)); | 7767 | tex = part.Shape.Textures; |
7769 | res.Add(new LSL_Integer(0)); | 7768 | if (face == ScriptBaseClass.ALL_SIDES) |
7769 | { | ||
7770 | for (face = 0; face < GetNumberOfSides(part); face++) | ||
7771 | { | ||
7772 | Primitive.TextureEntryFace texface = tex.GetFace((uint)face); | ||
7773 | // Convert Shininess to PRIM_SHINY_* | ||
7774 | res.Add(new LSL_Integer((uint)texface.Shiny >> 6)); | ||
7775 | // PRIM_BUMP_* | ||
7776 | res.Add(new LSL_Integer((int)texface.Bump)); | ||
7777 | } | ||
7778 | } | ||
7779 | else | ||
7780 | { | ||
7781 | if (face >= 0 && face < GetNumberOfSides(part)) | ||
7782 | { | ||
7783 | Primitive.TextureEntryFace texface = tex.GetFace((uint)face); | ||
7784 | // Convert Shininess to PRIM_SHINY_* | ||
7785 | res.Add(new LSL_Integer((uint)texface.Shiny >> 6)); | ||
7786 | // PRIM_BUMP_* | ||
7787 | res.Add(new LSL_Integer((int)texface.Bump)); | ||
7788 | } | ||
7789 | } | ||
7770 | break; | 7790 | break; |
7771 | 7791 | ||
7772 | case (int)ScriptBaseClass.PRIM_FULLBRIGHT: | 7792 | case (int)ScriptBaseClass.PRIM_FULLBRIGHT: |
7773 | // TODO-------------- | ||
7774 | if (remain < 1) | 7793 | if (remain < 1) |
7775 | return res; | 7794 | return res; |
7776 | 7795 | ||
7777 | face=(int)rules.GetLSLIntegerItem(idx++); | 7796 | face=(int)rules.GetLSLIntegerItem(idx++); |
7778 | 7797 | ||
7779 | res.Add(new LSL_Integer(0)); | 7798 | tex = part.Shape.Textures; |
7799 | if (face == ScriptBaseClass.ALL_SIDES) | ||
7800 | { | ||
7801 | for (face = 0; face < GetNumberOfSides(part); face++) | ||
7802 | { | ||
7803 | Primitive.TextureEntryFace texface = tex.GetFace((uint)face); | ||
7804 | res.Add(new LSL_Integer(texface.Fullbright ? 1 : 0)); | ||
7805 | } | ||
7806 | } | ||
7807 | else | ||
7808 | { | ||
7809 | if (face >= 0 && face < GetNumberOfSides(part)) | ||
7810 | { | ||
7811 | Primitive.TextureEntryFace texface = tex.GetFace((uint)face); | ||
7812 | res.Add(new LSL_Integer(texface.Fullbright ? 1 : 0)); | ||
7813 | } | ||
7814 | } | ||
7780 | break; | 7815 | break; |
7781 | 7816 | ||
7782 | case (int)ScriptBaseClass.PRIM_FLEXIBLE: | 7817 | case (int)ScriptBaseClass.PRIM_FLEXIBLE: |
@@ -7797,14 +7832,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7797 | break; | 7832 | break; |
7798 | 7833 | ||
7799 | case (int)ScriptBaseClass.PRIM_TEXGEN: | 7834 | case (int)ScriptBaseClass.PRIM_TEXGEN: |
7800 | // TODO-------------- | ||
7801 | // (PRIM_TEXGEN_DEFAULT, PRIM_TEXGEN_PLANAR) | ||
7802 | if (remain < 1) | 7835 | if (remain < 1) |
7803 | return res; | 7836 | return res; |
7804 | 7837 | ||
7805 | face=(int)rules.GetLSLIntegerItem(idx++); | 7838 | face=(int)rules.GetLSLIntegerItem(idx++); |
7806 | 7839 | ||
7807 | res.Add(new LSL_Integer(0)); | 7840 | tex = part.Shape.Textures; |
7841 | if (face == ScriptBaseClass.ALL_SIDES) | ||
7842 | { | ||
7843 | for (face = 0; face < GetNumberOfSides(part); face++) | ||
7844 | { | ||
7845 | MappingType texgen = tex.GetFace((uint)face).TexMapType; | ||
7846 | // Convert MappingType to PRIM_TEXGEN_DEFAULT, PRIM_TEXGEN_PLANAR etc. | ||
7847 | res.Add(new LSL_Integer((uint)texgen >> 1)); | ||
7848 | } | ||
7849 | } | ||
7850 | else | ||
7851 | { | ||
7852 | if (face >= 0 && face < GetNumberOfSides(part)) | ||
7853 | { | ||
7854 | MappingType texgen = tex.GetFace((uint)face).TexMapType; | ||
7855 | res.Add(new LSL_Integer((uint)texgen >> 1)); | ||
7856 | } | ||
7857 | } | ||
7808 | break; | 7858 | break; |
7809 | 7859 | ||
7810 | case (int)ScriptBaseClass.PRIM_POINT_LIGHT: | 7860 | case (int)ScriptBaseClass.PRIM_POINT_LIGHT: |
@@ -7823,14 +7873,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7823 | break; | 7873 | break; |
7824 | 7874 | ||
7825 | case (int)ScriptBaseClass.PRIM_GLOW: | 7875 | case (int)ScriptBaseClass.PRIM_GLOW: |
7826 | // TODO-------------- | ||
7827 | if (remain < 1) | 7876 | if (remain < 1) |
7828 | return res; | 7877 | return res; |
7829 | 7878 | ||
7830 | face=(int)rules.GetLSLIntegerItem(idx++); | 7879 | face=(int)rules.GetLSLIntegerItem(idx++); |
7831 | 7880 | ||
7832 | res.Add(new LSL_Float(0)); | 7881 | tex = part.Shape.Textures; |
7882 | if (face == ScriptBaseClass.ALL_SIDES) | ||
7883 | { | ||
7884 | for (face = 0; face < GetNumberOfSides(part); face++) | ||
7885 | { | ||
7886 | Primitive.TextureEntryFace texface = tex.GetFace((uint)face); | ||
7887 | res.Add(new LSL_Float(texface.Glow)); | ||
7888 | } | ||
7889 | } | ||
7890 | else | ||
7891 | { | ||
7892 | if (face >= 0 && face < GetNumberOfSides(part)) | ||
7893 | { | ||
7894 | Primitive.TextureEntryFace texface = tex.GetFace((uint)face); | ||
7895 | res.Add(new LSL_Float(texface.Glow)); | ||
7896 | } | ||
7897 | } | ||
7833 | break; | 7898 | break; |
7899 | |||
7834 | case (int)ScriptBaseClass.PRIM_TEXT: | 7900 | case (int)ScriptBaseClass.PRIM_TEXT: |
7835 | Color4 textColor = part.GetTextColor(); | 7901 | Color4 textColor = part.GetTextColor(); |
7836 | res.Add(part.Text); | 7902 | res.Add(part.Text); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index fc92f23..827626f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -395,10 +395,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
395 | // | 395 | // |
396 | CheckThreatLevel(ThreatLevel.High, "osRegionRestart"); | 396 | CheckThreatLevel(ThreatLevel.High, "osRegionRestart"); |
397 | 397 | ||
398 | IRestartModule restartModule = World.RequestModuleInterface<IRestartModule>(); | ||
398 | m_host.AddScriptLPS(1); | 399 | m_host.AddScriptLPS(1); |
399 | if (World.Permissions.CanIssueEstateCommand(m_host.OwnerID, false)) | 400 | if (World.Permissions.CanIssueEstateCommand(m_host.OwnerID, false) && (restartModule != null)) |
400 | { | 401 | { |
401 | World.Restart((float)seconds); | 402 | if (seconds < 15) |
403 | { | ||
404 | restartModule.AbortRestart("Restart aborted"); | ||
405 | return 1; | ||
406 | } | ||
407 | |||
408 | List<int> times = new List<int>(); | ||
409 | while (seconds > 0) | ||
410 | { | ||
411 | times.Add((int)seconds); | ||
412 | if (seconds > 300) | ||
413 | seconds -= 120; | ||
414 | else if (seconds > 30) | ||
415 | seconds -= 30; | ||
416 | else | ||
417 | seconds -= 15; | ||
418 | } | ||
419 | |||
420 | restartModule.ScheduleRestart(UUID.Zero, "Region will restart in {0}", times.ToArray(), true); | ||
402 | return 1; | 421 | return 1; |
403 | } | 422 | } |
404 | else | 423 | else |
@@ -2315,4 +2334,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2315 | return date.ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ"); | 2334 | return date.ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ"); |
2316 | } | 2335 | } |
2317 | } | 2336 | } |
2318 | } \ No newline at end of file | 2337 | } |