From 57c4def254b85997f5b8a4cd4e7d1db550947290 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 25 Nov 2010 03:16:52 +0000 Subject: Change all restarting to use the restart module. Remove hardcoded behavior --- .../Shared/Api/Implementation/OSSL_Api.cs | 25 +++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') 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 // CheckThreatLevel(ThreatLevel.High, "osRegionRestart"); + IRestartModule restartModule = World.RequestModuleInterface(); m_host.AddScriptLPS(1); - if (World.Permissions.CanIssueEstateCommand(m_host.OwnerID, false)) + if (World.Permissions.CanIssueEstateCommand(m_host.OwnerID, false) && (restartModule != null)) { - World.Restart((float)seconds); + if (seconds < 15) + { + restartModule.AbortRestart("Restart aborted"); + return 1; + } + + List times = new List(); + while (seconds > 0) + { + times.Add((int)seconds); + if (seconds > 300) + seconds -= 120; + else if (seconds > 30) + seconds -= 30; + else + seconds -= 15; + } + + restartModule.ScheduleRestart(UUID.Zero, "Region will restart in {0}", times.ToArray(), true); return 1; } else @@ -2315,4 +2334,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return date.ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ"); } } -} \ No newline at end of file +} -- cgit v1.1 From d71d4f96e32a674c86eb4b20af7c10d382443ce4 Mon Sep 17 00:00:00 2001 From: Marck Date: Sat, 27 Nov 2010 10:59:14 +0100 Subject: Amend GetLinkPrimitiveParams with implementations for PRIM_TEXGEN, PRIM_BUMP_SHINY, PRIM_FULLBRIGHT, and PRIM_GLOW --- .../Shared/Api/Implementation/LSL_Api.cs | 86 +++++++++++++++++++--- 1 file changed, 76 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') 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 break; case (int)ScriptBaseClass.PRIM_BUMP_SHINY: - // TODO-------------- if (remain < 1) return res; face=(int)rules.GetLSLIntegerItem(idx++); - res.Add(new LSL_Integer(0)); - res.Add(new LSL_Integer(0)); + tex = part.Shape.Textures; + if (face == ScriptBaseClass.ALL_SIDES) + { + for (face = 0; face < GetNumberOfSides(part); face++) + { + Primitive.TextureEntryFace texface = tex.GetFace((uint)face); + // Convert Shininess to PRIM_SHINY_* + res.Add(new LSL_Integer((uint)texface.Shiny >> 6)); + // PRIM_BUMP_* + res.Add(new LSL_Integer((int)texface.Bump)); + } + } + else + { + if (face >= 0 && face < GetNumberOfSides(part)) + { + Primitive.TextureEntryFace texface = tex.GetFace((uint)face); + // Convert Shininess to PRIM_SHINY_* + res.Add(new LSL_Integer((uint)texface.Shiny >> 6)); + // PRIM_BUMP_* + res.Add(new LSL_Integer((int)texface.Bump)); + } + } break; case (int)ScriptBaseClass.PRIM_FULLBRIGHT: - // TODO-------------- if (remain < 1) return res; face=(int)rules.GetLSLIntegerItem(idx++); - res.Add(new LSL_Integer(0)); + tex = part.Shape.Textures; + if (face == ScriptBaseClass.ALL_SIDES) + { + for (face = 0; face < GetNumberOfSides(part); face++) + { + Primitive.TextureEntryFace texface = tex.GetFace((uint)face); + res.Add(new LSL_Integer(texface.Fullbright ? 1 : 0)); + } + } + else + { + if (face >= 0 && face < GetNumberOfSides(part)) + { + Primitive.TextureEntryFace texface = tex.GetFace((uint)face); + res.Add(new LSL_Integer(texface.Fullbright ? 1 : 0)); + } + } break; case (int)ScriptBaseClass.PRIM_FLEXIBLE: @@ -7797,14 +7832,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api break; case (int)ScriptBaseClass.PRIM_TEXGEN: - // TODO-------------- - // (PRIM_TEXGEN_DEFAULT, PRIM_TEXGEN_PLANAR) if (remain < 1) return res; face=(int)rules.GetLSLIntegerItem(idx++); - res.Add(new LSL_Integer(0)); + tex = part.Shape.Textures; + if (face == ScriptBaseClass.ALL_SIDES) + { + for (face = 0; face < GetNumberOfSides(part); face++) + { + MappingType texgen = tex.GetFace((uint)face).TexMapType; + // Convert MappingType to PRIM_TEXGEN_DEFAULT, PRIM_TEXGEN_PLANAR etc. + res.Add(new LSL_Integer((uint)texgen >> 1)); + } + } + else + { + if (face >= 0 && face < GetNumberOfSides(part)) + { + MappingType texgen = tex.GetFace((uint)face).TexMapType; + res.Add(new LSL_Integer((uint)texgen >> 1)); + } + } break; case (int)ScriptBaseClass.PRIM_POINT_LIGHT: @@ -7823,14 +7873,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api break; case (int)ScriptBaseClass.PRIM_GLOW: - // TODO-------------- if (remain < 1) return res; face=(int)rules.GetLSLIntegerItem(idx++); - res.Add(new LSL_Float(0)); + tex = part.Shape.Textures; + if (face == ScriptBaseClass.ALL_SIDES) + { + for (face = 0; face < GetNumberOfSides(part); face++) + { + Primitive.TextureEntryFace texface = tex.GetFace((uint)face); + res.Add(new LSL_Float(texface.Glow)); + } + } + else + { + if (face >= 0 && face < GetNumberOfSides(part)) + { + Primitive.TextureEntryFace texface = tex.GetFace((uint)face); + res.Add(new LSL_Float(texface.Glow)); + } + } break; + case (int)ScriptBaseClass.PRIM_TEXT: Color4 textColor = part.GetTextColor(); res.Add(part.Text); -- cgit v1.1