Merge branch 'master' into careminster-presence-refactor

This commit is contained in:
root
2011-06-30 00:26:03 +01:00
27 changed files with 558 additions and 172 deletions

View File

@@ -977,7 +977,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public string osDrawPolygon(string drawList, LSL_List x, LSL_List y)
{
CheckThreatLevel(ThreatLevel.None, "osDrawFilledPolygon");
CheckThreatLevel(ThreatLevel.None, "osDrawPolygon");
m_host.AddScriptLPS(1);
@@ -1248,7 +1248,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return String.Empty;
}
public void osSetWindParam(string plugin, string param, float value)
public void osSetWindParam(string plugin, string param, LSL_Float value)
{
CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam");
m_host.AddScriptLPS(1);
@@ -1258,13 +1258,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
try
{
module.WindParamSet(plugin, param, value);
module.WindParamSet(plugin, param, (float)value);
}
catch (Exception) { }
}
}
public float osGetWindParam(string plugin, string param)
public LSL_Float osGetWindParam(string plugin, string param)
{
CheckThreatLevel(ThreatLevel.VeryLow, "osGetWindParam");
m_host.AddScriptLPS(1);
@@ -1416,7 +1416,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
// What actually is the difference to the LL function?
//
CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelMediaURL");
CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelSIPAddress");
m_host.AddScriptLPS(1);
@@ -2222,12 +2222,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return (int)pws;
}
public void osSetSpeed(string UUID, float SpeedModifier)
public void osSetSpeed(string UUID, LSL_Float SpeedModifier)
{
CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed");
m_host.AddScriptLPS(1);
ScenePresence avatar = World.GetScenePresence(new UUID(UUID));
avatar.SpeedModifier = SpeedModifier;
avatar.SpeedModifier = (float)SpeedModifier;
}
public void osKickAvatar(string FirstName,string SurName,string alert)
@@ -2308,14 +2308,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams");
m_host.AddScriptLPS(1);
InitLSL();
return m_LSL_Api.GetLinkPrimitiveParamsEx(prim, rules);
}
public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules)
{
CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams");
CheckThreatLevel(ThreatLevel.High, "osSetPrimitiveParams");
m_host.AddScriptLPS(1);
InitLSL();
m_LSL_Api.SetPrimitiveParamsEx(prim, rules);
}

View File

@@ -129,8 +129,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
// Wind Module Functions
string osWindActiveModelPluginName();
void osSetWindParam(string plugin, string param, float value);
float osGetWindParam(string plugin, string param);
void osSetWindParam(string plugin, string param, LSL_Float value);
LSL_Float osGetWindParam(string plugin, string param);
// Parcel commands
void osParcelJoin(vector pos1, vector pos2);
@@ -180,7 +180,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
int osGetSimulatorMemory();
void osKickAvatar(string FirstName,string SurName,string alert);
void osSetSpeed(string UUID, float SpeedModifier);
void osSetSpeed(string UUID, LSL_Float SpeedModifier);
void osCauseHealing(string avatar, double healing);
void osCauseDamage(string avatar, double damage);
LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules);

View File

@@ -106,16 +106,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osWindActiveModelPluginName();
}
// Not yet plugged in as available OSSL functions, so commented out
// void osSetWindParam(string plugin, string param, float value)
// {
// m_OSSL_Functions.osSetWindParam(plugin, param, value);
// }
//
// float osGetWindParam(string plugin, string param)
// {
// return m_OSSL_Functions.osGetWindParam(plugin, param);
// }
public void osSetWindParam(string plugin, string param, LSL_Float value)
{
m_OSSL_Functions.osSetWindParam(plugin, param, value);
}
public LSL_Float osGetWindParam(string plugin, string param)
{
return m_OSSL_Functions.osGetWindParam(plugin, param);
}
public void osParcelJoin(vector pos1, vector pos2)
{
@@ -714,7 +713,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osKickAvatar(FirstName, SurName, alert);
}
public void osSetSpeed(string UUID, float SpeedModifier)
public void osSetSpeed(string UUID, LSL_Float SpeedModifier)
{
m_OSSL_Functions.osSetSpeed(UUID, SpeedModifier);
}

View File

@@ -106,6 +106,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
// Get some config
WriteScriptSourceToDebugFile = m_scriptEngine.Config.GetBoolean("WriteScriptSourceToDebugFile", false);
CompileWithDebugInformation = m_scriptEngine.Config.GetBoolean("CompileWithDebugInformation", true);
bool DeleteScriptsOnStartup = m_scriptEngine.Config.GetBoolean("DeleteScriptsOnStartup", true);
// Get file prefix from scriptengine name and make it file system safe:
FilePrefix = "CommonCompiler";
@@ -114,11 +115,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
FilePrefix = FilePrefix.Replace(c, '_');
}
// First time we start? Delete old files
if (in_startup)
{
in_startup = false;
DeleteOldFiles();
CreateScriptsDirectory();
// First time we start? Delete old files
if (DeleteScriptsOnStartup)
DeleteOldFiles();
}
// Map name and enum type of our supported languages
@@ -187,11 +191,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
}
/// <summary>
/// Delete old script files
/// Create the directory where compiled scripts are stored.
/// </summary>
private void DeleteOldFiles()
private void CreateScriptsDirectory()
{
// CREATE FOLDER IF IT DOESNT EXIST
if (!Directory.Exists(ScriptEnginesPath))
{
try
@@ -218,7 +221,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
m_scriptEngine.World.RegionInfo.RegionID.ToString()) + "\": " + ex.ToString());
}
}
}
/// <summary>
/// Delete old script files
/// </summary>
private void DeleteOldFiles()
{
foreach (string file in Directory.GetFiles(Path.Combine(ScriptEnginesPath,
m_scriptEngine.World.RegionInfo.RegionID.ToString()), FilePrefix + "_compiled*"))
{