mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
Mantis #2317
Thank you, fusspawn, for an implementation of osGetSimulatorVersion. This patch removes the llRequestSimulatorData(..., 128) hack and implements the functionality as an osFunction.
This commit is contained in:
@@ -7227,9 +7227,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
else
|
||||
reply = "UNKNOWN";
|
||||
break;
|
||||
case 128: // SIM_RELEASE (not LSL conform, valid for OpenSim only)
|
||||
reply = m_ScriptEngine.World.GetSimulatorVersion();
|
||||
break;
|
||||
default:
|
||||
// ScriptSleep(1000);
|
||||
return UUID.Zero.ToString(); // Raise no event
|
||||
|
||||
@@ -30,6 +30,7 @@ using System.Collections.Generic;
|
||||
using System.Runtime.Remoting.Lifetime;
|
||||
using OpenMetaverse;
|
||||
using Nini.Config;
|
||||
using OpenSim;
|
||||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Region.Environment.Interfaces;
|
||||
using OpenSim.Region.Environment.Scenes;
|
||||
@@ -40,6 +41,7 @@ using OpenSim.Region.ScriptEngine.Interfaces;
|
||||
using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces;
|
||||
using TPFlags = OpenSim.Framework.Constants.TeleportFlags;
|
||||
|
||||
|
||||
namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
//////////////////////////////////////////////////////////////
|
||||
@@ -720,6 +722,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return String.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user