mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
Massive tab and trailing space cleanup
This commit is contained in:
@@ -142,7 +142,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
internal float m_ScriptDelayFactor = 1.0f;
|
||||
internal float m_ScriptDistanceFactor = 1.0f;
|
||||
internal bool m_debuggerSafe = false;
|
||||
internal Dictionary<string, FunctionPerms > m_FunctionPerms = new Dictionary<string, FunctionPerms >();
|
||||
internal Dictionary<string, FunctionPerms > m_FunctionPerms = new Dictionary<string, FunctionPerms >();
|
||||
protected IUrlModule m_UrlModule = null;
|
||||
|
||||
public void Initialize(
|
||||
@@ -418,7 +418,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
//Only gods may use the function
|
||||
if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("GOD"))
|
||||
{
|
||||
if (World.Permissions.IsGod(ownerID))
|
||||
if (World.Permissions.IsGod(ownerID))
|
||||
{
|
||||
return String.Empty;
|
||||
}
|
||||
@@ -427,7 +427,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
//Only grid gods may use the function
|
||||
if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("GRID_GOD"))
|
||||
{
|
||||
if (World.Permissions.IsGridGod(ownerID))
|
||||
if (World.Permissions.IsGridGod(ownerID))
|
||||
{
|
||||
return String.Empty;
|
||||
}
|
||||
@@ -856,11 +856,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
// {
|
||||
|
||||
// We will launch the teleport on a new thread so that when the script threads are terminated
|
||||
// before teleport in ScriptInstance.GetXMLState(), we don't end up aborting the one doing the teleporting.
|
||||
// before teleport in ScriptInstance.GetXMLState(), we don't end up aborting the one doing the teleporting.
|
||||
Util.FireAndForget(
|
||||
o => World.RequestTeleportLocation(
|
||||
presence.ControllingClient, regionName, position,
|
||||
lookat, (uint)TPFlags.ViaLocation),
|
||||
lookat, (uint)TPFlags.ViaLocation),
|
||||
null, "OSSL_Api.TeleportAgentByRegionCoords");
|
||||
|
||||
ScriptSleep(5000);
|
||||
@@ -906,8 +906,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
// before teleport in ScriptInstance.GetXMLState(), we don't end up aborting the one doing the teleporting.
|
||||
Util.FireAndForget(
|
||||
o => World.RequestTeleportLocation(
|
||||
presence.ControllingClient, regionHandle,
|
||||
position, lookat, (uint)TPFlags.ViaLocation),
|
||||
presence.ControllingClient, regionHandle,
|
||||
position, lookat, (uint)TPFlags.ViaLocation),
|
||||
null, "OSSL_Api.TeleportAgentByRegionName");
|
||||
|
||||
ScriptSleep(5000);
|
||||
@@ -972,13 +972,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
UUID targetID = new UUID(target);
|
||||
|
||||
ForceSit(avatar, targetID);
|
||||
|
||||
ForceSit(avatar, targetID);
|
||||
}
|
||||
|
||||
public void ForceSit(string avatar, UUID targetID)
|
||||
{
|
||||
UUID agentID;
|
||||
UUID agentID;
|
||||
|
||||
if (!UUID.TryParse(avatar, out agentID))
|
||||
return;
|
||||
@@ -1015,7 +1015,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
ScenePresence target = (ScenePresence)World.Entities[avatarID];
|
||||
return target.ControllingClient.RemoteEndPoint.Address.ToString();
|
||||
}
|
||||
|
||||
|
||||
// fall through case, just return nothing
|
||||
return "";
|
||||
}
|
||||
@@ -1058,7 +1058,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
ScenePresence target = null;
|
||||
if ((World.Entities[avatarID] is ScenePresence))
|
||||
target = (ScenePresence)World.Entities[avatarID];
|
||||
|
||||
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
@@ -1115,8 +1115,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
else
|
||||
animID = UUID.Zero;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (animID == UUID.Zero)
|
||||
target.Animator.RemoveAnimation(animation);
|
||||
else
|
||||
@@ -1257,7 +1257,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
public string osSetPenColor(string drawList, string color)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.None, "osSetPenColor");
|
||||
|
||||
|
||||
m_host.AddScriptLPS(1);
|
||||
drawList += "PenColor " + color + "; ";
|
||||
return drawList;
|
||||
@@ -1780,7 +1780,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private ArrayList osdToArray(OSDArray list)
|
||||
{
|
||||
ArrayList result = new ArrayList();
|
||||
@@ -1834,7 +1834,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
Object decoded = osParseJSONNew(JSON);
|
||||
|
||||
|
||||
if ( decoded is Hashtable ) {
|
||||
return (Hashtable) decoded;
|
||||
} else if ( decoded is ArrayList ) {
|
||||
@@ -1902,7 +1902,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
// CheckThreatLevel(ThreatLevel.VeryHigh, "osDie");
|
||||
// if this is restricted to objects rezzed by this host level can be reduced
|
||||
|
||||
|
||||
CheckThreatLevel(ThreatLevel.Low, "osDie");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
@@ -1931,7 +1931,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
if (sceneOG.OwnerID != m_host.OwnerID)
|
||||
return;
|
||||
|
||||
|
||||
// harakiri check
|
||||
if(sceneOG.UUID == m_host.ParentGroup.UUID)
|
||||
throw new SelfDeleteException();
|
||||
@@ -2042,16 +2042,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (assetID != UUID.Zero)
|
||||
{
|
||||
StringBuilder notecardData = new StringBuilder();
|
||||
|
||||
|
||||
for (int count = 0; count < NotecardCache.GetLines(assetID); count++)
|
||||
{
|
||||
string line = NotecardCache.GetLine(assetID, count) + "\n";
|
||||
|
||||
|
||||
// m_log.DebugFormat("[OSSL]: From notecard {0} loading line {1}", notecardNameOrUuid, line);
|
||||
|
||||
|
||||
notecardData.Append(line);
|
||||
}
|
||||
|
||||
|
||||
return notecardData.ToString();
|
||||
}
|
||||
|
||||
@@ -2086,7 +2086,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
if (a == null)
|
||||
{
|
||||
// Whoops, it's still possible here that the notecard name was properly
|
||||
// Whoops, it's still possible here that the notecard name was properly
|
||||
// formatted like a UUID but isn't an asset UUID so lets look it up by name after all
|
||||
assetID = SearchTaskInventoryForAssetId(notecardNameOrUuid);
|
||||
if (assetID == UUID.Zero)
|
||||
@@ -2291,7 +2291,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -2429,7 +2429,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
IConfigSource config = m_ScriptEngine.ConfigSource;
|
||||
string HomeURI = Util.GetConfigVarFromSections<string>(config, "HomeURI",
|
||||
string HomeURI = Util.GetConfigVarFromSections<string>(config, "HomeURI",
|
||||
new string[] { "Startup", "Hypergrid" }, String.Empty);
|
||||
|
||||
if (!string.IsNullOrEmpty(HomeURI))
|
||||
@@ -2705,12 +2705,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osNpcCreate");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
|
||||
// have to get the npc module also here to set the default Not Owned
|
||||
INPCModule module = World.RequestModuleInterface<INPCModule>();
|
||||
if(module == null)
|
||||
return new LSL_Key(UUID.Zero.ToString());
|
||||
|
||||
|
||||
bool owned = (module.NPCOptionFlags & NPCOptionsFlags.AllowNotOwned) == 0;
|
||||
|
||||
return NpcCreate(firstname, lastname, position, notecard, owned, false, false);
|
||||
@@ -2795,7 +2795,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
groupTitle = "- NPC -";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if((createFlags & NPCOptionsFlags.AllowCloneOtherAvatars) != 0)
|
||||
{
|
||||
UUID id;
|
||||
@@ -2973,7 +2973,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
if (!module.CheckPermissions(npcId, m_host.OwnerID))
|
||||
return;
|
||||
|
||||
|
||||
module.MoveToTarget(npcId, World, pos, false, true, false);
|
||||
}
|
||||
}
|
||||
@@ -3202,7 +3202,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (!module.CheckPermissions(npcId, m_host.OwnerID))
|
||||
return;
|
||||
|
||||
module.DeleteNPC(npcId, World);
|
||||
module.DeleteNPC(npcId, World);
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
@@ -3259,7 +3259,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osNpcTouch");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
|
||||
INPCModule module = World.RequestModuleInterface<INPCModule>();
|
||||
int linkNum = link_num.value;
|
||||
if (module != null || (linkNum < 0 && linkNum != ScriptBaseClass.LINK_THIS))
|
||||
@@ -3400,7 +3400,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
bool isMale = vpShapeMale > 0.5f;
|
||||
return new LSL_String(isMale ? "male" : "female");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get current region's map texture UUID
|
||||
/// </summary>
|
||||
@@ -3441,7 +3441,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
return key.ToString();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Return information regarding various simulator statistics (sim fps, physics fps, time
|
||||
/// dilation, total number of prims, total number of active scripts, script lps, various
|
||||
@@ -3455,7 +3455,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
m_host.AddScriptLPS(1);
|
||||
LSL_List ret = new LSL_List();
|
||||
float[] stats = World.StatsReporter.LastReportedSimStats;
|
||||
|
||||
|
||||
for (int i = 0; i < 21; i++)
|
||||
{
|
||||
ret.Add(new LSL_Float(stats[i]));
|
||||
@@ -3488,7 +3488,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
return (int)pws;
|
||||
}
|
||||
|
||||
|
||||
public void osSetSpeed(string UUID, LSL_Float SpeedModifier)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed");
|
||||
@@ -3498,7 +3498,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (avatar != null)
|
||||
avatar.SpeedModifier = (float)SpeedModifier;
|
||||
}
|
||||
|
||||
|
||||
public void osKickAvatar(string FirstName, string SurName, string alert)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
|
||||
@@ -3528,7 +3528,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (presence != null) health = presence.Health;
|
||||
return health;
|
||||
}
|
||||
|
||||
|
||||
public void osCauseDamage(string avatar, double damage)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osCauseDamage");
|
||||
@@ -3537,7 +3537,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
UUID avatarId = new UUID(avatar);
|
||||
Vector3 pos = m_host.GetWorldPosition();
|
||||
|
||||
ScenePresence presence = World.GetScenePresence(avatarId);
|
||||
ScenePresence presence = World.GetScenePresence(avatarId);
|
||||
if (presence != null)
|
||||
{
|
||||
LandData land = World.GetLandData(pos);
|
||||
@@ -3556,7 +3556,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void osCauseHealing(string avatar, double healing)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osCauseHealing");
|
||||
@@ -3625,7 +3625,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams");
|
||||
m_host.AddScriptLPS(1);
|
||||
InitLSL();
|
||||
|
||||
|
||||
return m_LSL_Api.GetPrimitiveParamsEx(prim, rules);
|
||||
}
|
||||
|
||||
@@ -3634,12 +3634,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
CheckThreatLevel(ThreatLevel.High, "osSetPrimitiveParams");
|
||||
m_host.AddScriptLPS(1);
|
||||
InitLSL();
|
||||
|
||||
|
||||
m_LSL_Api.SetPrimitiveParamsEx(prim, rules, "osSetPrimitiveParams");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Set parameters for light projection in host prim
|
||||
/// Set parameters for light projection in host prim
|
||||
/// </summary>
|
||||
public void osSetProjectionParams(bool projection, LSL_Key texture, double fov, double focus, double amb)
|
||||
{
|
||||
@@ -3723,7 +3723,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
/// Get the description from an inventory item
|
||||
/// </summary>
|
||||
/// <param name="inventoryName"></param>
|
||||
/// <returns>Item description</returns>
|
||||
/// <returns>Item description</returns>
|
||||
public LSL_String osGetInventoryDesc(string item)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
@@ -3921,7 +3921,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (item.InvType != (int)InventoryType.Object)
|
||||
{
|
||||
// FIXME: Temporary null check for regression tests since they dont' have the infrastructure to set
|
||||
// up the api reference.
|
||||
// up the api reference.
|
||||
if (m_LSL_Api != null)
|
||||
((LSL_Api)m_LSL_Api).llSay(0, string.Format("Unable to attach, item '{0}' is not an object.", itemName));
|
||||
|
||||
@@ -4002,10 +4002,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
UUID targetUUID;
|
||||
if(!UUID.TryParse(avatar.ToString(), out targetUUID))
|
||||
return;
|
||||
|
||||
|
||||
if(targetUUID == UUID.Zero)
|
||||
return;
|
||||
|
||||
|
||||
ScenePresence target;
|
||||
if(!World.TryGetScenePresence(targetUUID, out target))
|
||||
return;
|
||||
@@ -4068,7 +4068,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return;
|
||||
}
|
||||
|
||||
bool optionObjCreator = (options &
|
||||
bool optionObjCreator = (options &
|
||||
ScriptBaseClass.OS_ATTACH_MSG_OBJECT_CREATOR) != 0;
|
||||
bool optionScriptCreator = (options &
|
||||
ScriptBaseClass.OS_ATTACH_MSG_SCRIPT_CREATOR) != 0;
|
||||
@@ -4316,7 +4316,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.Moderate, "osRequestSecureURL");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
|
||||
Hashtable opts = new Hashtable();
|
||||
for (int i = 0 ; i < options.Length ; i++)
|
||||
{
|
||||
@@ -4334,7 +4334,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.Moderate, "osRequestSecureURL");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
|
||||
Hashtable opts = new Hashtable();
|
||||
for (int i = 0 ; i < options.Length ; i++)
|
||||
{
|
||||
@@ -4362,7 +4362,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
m_host.CollisionSoundType = 0; // full return to default sounds
|
||||
else
|
||||
m_host.CollisionSoundType = 2; // default sounds with volume
|
||||
m_host.aggregateScriptEvents();
|
||||
m_host.aggregateScriptEvents();
|
||||
return;
|
||||
}
|
||||
// TODO: Parameter check logic required.
|
||||
@@ -4376,7 +4376,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
else
|
||||
m_host.CollisionSoundType = -1;
|
||||
|
||||
m_host.aggregateScriptEvents();
|
||||
m_host.aggregateScriptEvents();
|
||||
}
|
||||
|
||||
// still not very usefull, detector is lost on rez, restarts, etc
|
||||
|
||||
Reference in New Issue
Block a user