mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 09:45:47 +08:00
Merge branch 'master' into careminster-presence-refactor
This commit is contained in:
@@ -345,6 +345,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
}
|
||||
|
||||
internal void OSSLDeprecated(string function, string replacement)
|
||||
{
|
||||
OSSLShoutError(string.Format("Use of function {0} is deprecated. Use {1} instead.", function, replacement));
|
||||
}
|
||||
|
||||
protected void ScriptSleep(int delay)
|
||||
{
|
||||
delay = (int)((float)delay * m_ScriptDelayFactor);
|
||||
@@ -356,13 +361,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
//
|
||||
// OpenSim functions
|
||||
//
|
||||
public LSL_Integer osSetTerrainHeight(int x, int y, double val)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osSetTerrainHeight");
|
||||
return SetTerrainHeight(x, y, val);
|
||||
}
|
||||
public LSL_Integer osTerrainSetHeight(int x, int y, double val)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osTerrainSetHeight");
|
||||
|
||||
OSSLDeprecated("osTerrainSetHeight", "osSetTerrainHeight");
|
||||
return SetTerrainHeight(x, y, val);
|
||||
}
|
||||
private LSL_Integer SetTerrainHeight(int x, int y, double val)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0)
|
||||
OSSLError("osTerrainSetHeight: Coordinate out of bounds");
|
||||
OSSLError("osSetTerrainHeight: Coordinate out of bounds");
|
||||
|
||||
if (World.Permissions.CanTerraformLand(m_host.OwnerID, new Vector3(x, y, 0)))
|
||||
{
|
||||
@@ -375,13 +389,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
}
|
||||
|
||||
public LSL_Float osGetTerrainHeight(int x, int y)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.None, "osGetTerrainHeight");
|
||||
return GetTerrainHeight(x, y);
|
||||
}
|
||||
public LSL_Float osTerrainGetHeight(int x, int y)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.None, "osTerrainGetHeight");
|
||||
|
||||
OSSLDeprecated("osTerrainGetHeight", "osGetTerrainHeight");
|
||||
return GetTerrainHeight(x, y);
|
||||
}
|
||||
private LSL_Float GetTerrainHeight(int x, int y)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0)
|
||||
OSSLError("osTerrainGetHeight: Coordinate out of bounds");
|
||||
OSSLError("osGetTerrainHeight: Coordinate out of bounds");
|
||||
|
||||
return World.Heightmap[x, y];
|
||||
}
|
||||
@@ -1008,9 +1031,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return drawList;
|
||||
}
|
||||
|
||||
public string osSetPenColor(string drawList, string color)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.None, "osSetPenColor");
|
||||
|
||||
m_host.AddScriptLPS(1);
|
||||
drawList += "PenColor " + color + "; ";
|
||||
return drawList;
|
||||
}
|
||||
// Deprecated
|
||||
public string osSetPenColour(string drawList, string colour)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.None, "osSetPenColour");
|
||||
OSSLDeprecated("osSetPenColour", "osSetPenColor");
|
||||
|
||||
m_host.AddScriptLPS(1);
|
||||
drawList += "PenColour " + colour + "; ";
|
||||
@@ -1019,7 +1052,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
public string osSetPenCap(string drawList, string direction, string type)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.None, "osSetPenColour");
|
||||
CheckThreatLevel(ThreatLevel.None, "osSetPenCap");
|
||||
|
||||
m_host.AddScriptLPS(1);
|
||||
drawList += "PenCap " + direction + "," + type + "; ";
|
||||
@@ -1164,6 +1197,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
public double osSunGetParam(string param)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.None, "osSunGetParam");
|
||||
OSSLDeprecated("osSunGetParam", "osGetSunParam");
|
||||
return GetSunParam(param);
|
||||
}
|
||||
public double osGetSunParam(string param)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.None, "osGetSunParam");
|
||||
return GetSunParam(param);
|
||||
}
|
||||
private double GetSunParam(string param)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
double value = 0.0;
|
||||
@@ -1180,6 +1223,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
public void osSunSetParam(string param, double value)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.None, "osSunSetParam");
|
||||
OSSLDeprecated("osSunSetParam", "osSetSunParam");
|
||||
SetSunParam(param, value);
|
||||
}
|
||||
public void osSetSunParam(string param, double value)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.None, "osSetSunParam");
|
||||
SetSunParam(param, value);
|
||||
}
|
||||
private void SetSunParam(string param, double value)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
ISunModule module = World.RequestModuleInterface<ISunModule>();
|
||||
@@ -1205,9 +1258,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public void osWindParamSet(string plugin, string param, float value)
|
||||
public void osSetWindParam(string plugin, string param, float value)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.VeryLow, "osWindParamSet");
|
||||
CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
IWindModule module = World.RequestModuleInterface<IWindModule>();
|
||||
@@ -1221,9 +1274,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
}
|
||||
|
||||
public float osWindParamGet(string plugin, string param)
|
||||
public float osGetWindParam(string plugin, string param)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.VeryLow, "osWindParamGet");
|
||||
CheckThreatLevel(ThreatLevel.VeryLow, "osGetWindParam");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
IWindModule module = World.RequestModuleInterface<IWindModule>();
|
||||
|
||||
Reference in New Issue
Block a user