Thank you, fusspawn, for an implementation of osGetSimulatorVersion.
This patch removes the llRequestSimulatorData(..., 128) hack and
implements the functionality as an osFunction.
0.6.0-stable
Melanie Thielker 2008-10-03 01:30:22 +00:00
parent 4e3a3417c7
commit e30856a32f
4 changed files with 20 additions and 3 deletions

View File

@ -7227,9 +7227,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
else else
reply = "UNKNOWN"; reply = "UNKNOWN";
break; break;
case 128: // SIM_RELEASE (not LSL conform, valid for OpenSim only)
reply = m_ScriptEngine.World.GetSimulatorVersion();
break;
default: default:
// ScriptSleep(1000); // ScriptSleep(1000);
return UUID.Zero.ToString(); // Raise no event return UUID.Zero.ToString(); // Raise no event

View File

@ -30,6 +30,7 @@ using System.Collections.Generic;
using System.Runtime.Remoting.Lifetime; using System.Runtime.Remoting.Lifetime;
using OpenMetaverse; using OpenMetaverse;
using Nini.Config; using Nini.Config;
using OpenSim;
using OpenSim.Framework.Console; using OpenSim.Framework.Console;
using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Environment.Scenes;
@ -40,6 +41,7 @@ using OpenSim.Region.ScriptEngine.Interfaces;
using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces;
using TPFlags = OpenSim.Framework.Constants.TeleportFlags; using TPFlags = OpenSim.Framework.Constants.TeleportFlags;
namespace OpenSim.Region.ScriptEngine.Shared.Api namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
@ -721,6 +723,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
} }
public string osGetSimulatorVersion()
{
// High because it can be used to target attacks to known weaknesses
// This would allow a new class of griefer scripts that don't even
// require their user to know what they are doing (see script
// kiddie)
//
CheckThreatLevel(ThreatLevel.High,"osGetSimulatorVersion");
m_host.AddScriptLPS(1);
return m_ScriptEngine.World.GetSimulatorVersion();
}
//for testing purposes only //for testing purposes only
public void osSetParcelMediaTime(double time) public void osSetParcelMediaTime(double time)

View File

@ -71,6 +71,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void osSetRegionWaterHeight(double height); void osSetRegionWaterHeight(double height);
string osGetScriptEngineName(); string osGetScriptEngineName();
string osGetSimulatorVersion();
void osSetParcelMediaTime(double time); void osSetParcelMediaTime(double time);
Hashtable osParseJSON(string JSON); Hashtable osParseJSON(string JSON);

View File

@ -215,6 +215,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osGetScriptEngineName(); return m_OSSL_Functions.osGetScriptEngineName();
} }
public string osGetSimulatorVersion()
{
return m_OSSL_Functions.osGetSimulatorVersion();
}
//for testing purposes only //for testing purposes only
public void osSetParcelMediaTime(double time) public void osSetParcelMediaTime(double time)