mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
Merge branch 'master' into careminster
This commit is contained in:
@@ -2813,7 +2813,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
m_host.CollisionFilter.Clear();
|
||||
if(id != null)
|
||||
if (id != null)
|
||||
{
|
||||
m_host.CollisionFilter.Add(accept,id);
|
||||
}
|
||||
@@ -3918,6 +3918,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
Util.Clip((float)color.z, 0.0f, 1.0f));
|
||||
m_host.SetText(text, av3, Util.Clip((float)alpha, 0.0f, 1.0f));
|
||||
m_host.ParentGroup.HasGroupChanged = true;
|
||||
m_host.ParentGroup.ScheduleGroupForFullUpdate();
|
||||
}
|
||||
|
||||
public LSL_Float llWater(LSL_Vector offset)
|
||||
@@ -4341,7 +4342,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
public void llPassCollisions(int pass)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
if(pass == 0)
|
||||
if (pass == 0)
|
||||
{
|
||||
m_host.ParentGroup.PassCollision = false;
|
||||
}
|
||||
@@ -7556,7 +7557,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
// makes it more difficult to determine a child prim's actual inworld position).
|
||||
if (part.ParentID != 0)
|
||||
v = ((v - llGetRootPosition()) * llGetRootRotation()) + llGetRootPosition();
|
||||
res.Add( v );
|
||||
res.Add(v);
|
||||
break;
|
||||
|
||||
case (int)ScriptBaseClass.PRIM_SIZE:
|
||||
|
||||
@@ -1952,7 +1952,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
|
||||
@@ -1960,19 +1960,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
/// client's Statistics Bar (Ctrl-Shift-1)
|
||||
/// </summary>
|
||||
/// <returns>List of floats</returns>
|
||||
public LSL_List osGetRegionStats()
|
||||
{
|
||||
public LSL_List osGetRegionStats()
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.Moderate, "osGetRegionStats");
|
||||
m_host.AddScriptLPS(1);
|
||||
LSL_List ret = new LSL_List();
|
||||
float[] stats = World.SimulatorStats;
|
||||
|
||||
for (int i = 0; i < 21; i++)
|
||||
{
|
||||
ret.Add(new LSL_Float( stats[i] ));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
float[] stats = World.SimulatorStats;
|
||||
|
||||
for (int i = 0; i < 21; i++)
|
||||
{
|
||||
ret.Add(new LSL_Float(stats[i]));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public int osGetSimulatorMemory()
|
||||
{
|
||||
@@ -1988,81 +1988,81 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return (int)pws;
|
||||
}
|
||||
public void osSetSpeed(string UUID, float SpeedModifier)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed");
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed");
|
||||
m_host.AddScriptLPS(1);
|
||||
ScenePresence avatar = World.GetScenePresence(new UUID(UUID));
|
||||
avatar.SpeedModifier = SpeedModifier;
|
||||
}
|
||||
ScenePresence avatar = World.GetScenePresence(new UUID(UUID));
|
||||
avatar.SpeedModifier = SpeedModifier;
|
||||
}
|
||||
public void osKickAvatar(string FirstName,string SurName,string alert)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
|
||||
if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
|
||||
if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
|
||||
{
|
||||
foreach (ScenePresence presence in World.GetAvatars())
|
||||
{
|
||||
if ((presence.Firstname == FirstName) &&
|
||||
presence.Lastname == SurName)
|
||||
{
|
||||
// kick client...
|
||||
if (alert != null)
|
||||
presence.ControllingClient.Kick(alert);
|
||||
foreach (ScenePresence presence in World.GetAvatars())
|
||||
{
|
||||
if ((presence.Firstname == FirstName) &&
|
||||
presence.Lastname == SurName)
|
||||
{
|
||||
// kick client...
|
||||
if (alert != null)
|
||||
presence.ControllingClient.Kick(alert);
|
||||
|
||||
// ...and close on our side
|
||||
presence.Scene.IncomingCloseAgent(presence.UUID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// ...and close on our side
|
||||
presence.Scene.IncomingCloseAgent(presence.UUID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void osCauseDamage(string avatar, double damage)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osCauseDamage");
|
||||
m_host.AddScriptLPS(1);
|
||||
CheckThreatLevel(ThreatLevel.High, "osCauseDamage");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
UUID avatarId = new UUID(avatar);
|
||||
Vector3 pos = m_host.GetWorldPosition();
|
||||
UUID avatarId = new UUID(avatar);
|
||||
Vector3 pos = m_host.GetWorldPosition();
|
||||
|
||||
ScenePresence presence = World.GetScenePresence(avatarId);
|
||||
if (presence != null)
|
||||
{
|
||||
LandData land = World.GetLandData((float)pos.X, (float)pos.Y);
|
||||
if ((land.Flags & (uint)ParcelFlags.AllowDamage) == (uint)ParcelFlags.AllowDamage)
|
||||
{
|
||||
float health = presence.Health;
|
||||
health -= (float)damage;
|
||||
presence.setHealthWithUpdate(health);
|
||||
if (health <= 0)
|
||||
{
|
||||
float healthliveagain = 100;
|
||||
presence.ControllingClient.SendAgentAlertMessage("You died!", true);
|
||||
presence.setHealthWithUpdate(healthliveagain);
|
||||
presence.Scene.TeleportClientHome(presence.UUID, presence.ControllingClient);
|
||||
}
|
||||
}
|
||||
}
|
||||
ScenePresence presence = World.GetScenePresence(avatarId);
|
||||
if (presence != null)
|
||||
{
|
||||
LandData land = World.GetLandData((float)pos.X, (float)pos.Y);
|
||||
if ((land.Flags & (uint)ParcelFlags.AllowDamage) == (uint)ParcelFlags.AllowDamage)
|
||||
{
|
||||
float health = presence.Health;
|
||||
health -= (float)damage;
|
||||
presence.setHealthWithUpdate(health);
|
||||
if (health <= 0)
|
||||
{
|
||||
float healthliveagain = 100;
|
||||
presence.ControllingClient.SendAgentAlertMessage("You died!", true);
|
||||
presence.setHealthWithUpdate(healthliveagain);
|
||||
presence.Scene.TeleportClientHome(presence.UUID, presence.ControllingClient);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void osCauseHealing(string avatar, double healing)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osCauseHealing");
|
||||
m_host.AddScriptLPS(1);
|
||||
CheckThreatLevel(ThreatLevel.High, "osCauseHealing");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
UUID avatarId = new UUID(avatar);
|
||||
ScenePresence presence = World.GetScenePresence(avatarId);
|
||||
Vector3 pos = m_host.GetWorldPosition();
|
||||
bool result = World.ScriptDanger(m_host.LocalId, new Vector3((float)pos.X, (float)pos.Y, (float)pos.Z));
|
||||
if (result)
|
||||
{
|
||||
if (presence != null)
|
||||
{
|
||||
float health = presence.Health;
|
||||
health += (float)healing;
|
||||
if (health >= 100)
|
||||
{
|
||||
health = 100;
|
||||
}
|
||||
presence.setHealthWithUpdate(health);
|
||||
}
|
||||
}
|
||||
UUID avatarId = new UUID(avatar);
|
||||
ScenePresence presence = World.GetScenePresence(avatarId);
|
||||
Vector3 pos = m_host.GetWorldPosition();
|
||||
bool result = World.ScriptDanger(m_host.LocalId, new Vector3((float)pos.X, (float)pos.Y, (float)pos.Z));
|
||||
if (result)
|
||||
{
|
||||
if (presence != null)
|
||||
{
|
||||
float health = presence.Health;
|
||||
health += (float)healing;
|
||||
if (health >= 100)
|
||||
{
|
||||
health = 100;
|
||||
}
|
||||
presence.setHealthWithUpdate(health);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
|
||||
key osGetMapTexture();
|
||||
key osGetRegionMapTexture(string regionName);
|
||||
LSL_List osGetRegionStats();
|
||||
LSL_List osGetRegionStats();
|
||||
|
||||
int osGetSimulatorMemory();
|
||||
void osKickAvatar(string FirstName,string SurName,string alert);
|
||||
|
||||
@@ -515,29 +515,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
public const string TEXTURE_PLYWOOD = "89556747-24cb-43ed-920b-47caed15465f";
|
||||
public const string TEXTURE_TRANSPARENT = "8dcd4a48-2d37-4909-9f78-f7a9eb4ef903";
|
||||
public const string TEXTURE_MEDIA = "8b5fec65-8d8d-9dc5-cda8-8fdf2716e361";
|
||||
|
||||
// Constants for osGetRegionStats
|
||||
public const int STATS_TIME_DILATION = 0;
|
||||
public const int STATS_SIM_FPS = 1;
|
||||
public const int STATS_PHYSICS_FPS = 2;
|
||||
public const int STATS_AGENT_UPDATES = 3;
|
||||
public const int STATS_ROOT_AGENTS = 4;
|
||||
public const int STATS_CHILD_AGENTS = 5;
|
||||
public const int STATS_TOTAL_PRIMS = 6;
|
||||
public const int STATS_ACTIVE_PRIMS = 7;
|
||||
public const int STATS_FRAME_MS = 8;
|
||||
public const int STATS_NET_MS = 9;
|
||||
public const int STATS_PHYSICS_MS = 10;
|
||||
public const int STATS_IMAGE_MS = 11;
|
||||
public const int STATS_OTHER_MS = 12;
|
||||
public const int STATS_IN_PACKETS_PER_SECOND = 13;
|
||||
public const int STATS_OUT_PACKETS_PER_SECOND = 14;
|
||||
public const int STATS_UNACKED_BYTES = 15;
|
||||
public const int STATS_AGENT_MS = 16;
|
||||
public const int STATS_PENDING_DOWNLOADS = 17;
|
||||
public const int STATS_PENDING_UPLOADS = 18;
|
||||
public const int STATS_ACTIVE_SCRIPTS = 19;
|
||||
public const int STATS_SCRIPT_LPS = 20;
|
||||
|
||||
// Constants for osGetRegionStats
|
||||
public const int STATS_TIME_DILATION = 0;
|
||||
public const int STATS_SIM_FPS = 1;
|
||||
public const int STATS_PHYSICS_FPS = 2;
|
||||
public const int STATS_AGENT_UPDATES = 3;
|
||||
public const int STATS_ROOT_AGENTS = 4;
|
||||
public const int STATS_CHILD_AGENTS = 5;
|
||||
public const int STATS_TOTAL_PRIMS = 6;
|
||||
public const int STATS_ACTIVE_PRIMS = 7;
|
||||
public const int STATS_FRAME_MS = 8;
|
||||
public const int STATS_NET_MS = 9;
|
||||
public const int STATS_PHYSICS_MS = 10;
|
||||
public const int STATS_IMAGE_MS = 11;
|
||||
public const int STATS_OTHER_MS = 12;
|
||||
public const int STATS_IN_PACKETS_PER_SECOND = 13;
|
||||
public const int STATS_OUT_PACKETS_PER_SECOND = 14;
|
||||
public const int STATS_UNACKED_BYTES = 15;
|
||||
public const int STATS_AGENT_MS = 16;
|
||||
public const int STATS_PENDING_DOWNLOADS = 17;
|
||||
public const int STATS_PENDING_UPLOADS = 18;
|
||||
public const int STATS_ACTIVE_SCRIPTS = 19;
|
||||
public const int STATS_SCRIPT_LPS = 20;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -632,11 +632,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
{
|
||||
return m_OSSL_Functions.osGetRegionMapTexture(regionName);
|
||||
}
|
||||
|
||||
public LSL_List osGetRegionStats()
|
||||
{
|
||||
return m_OSSL_Functions.osGetRegionStats();
|
||||
}
|
||||
|
||||
public LSL_List osGetRegionStats()
|
||||
{
|
||||
return m_OSSL_Functions.osGetRegionStats();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the amount of memory in use by the Simulator Daemon.
|
||||
@@ -649,7 +649,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
}
|
||||
public void osKickAvatar(string FirstName,string SurName,string alert)
|
||||
{
|
||||
m_OSSL_Functions.osKickAvatar( FirstName, SurName, alert);
|
||||
m_OSSL_Functions.osKickAvatar(FirstName, SurName, alert);
|
||||
}
|
||||
public void osSetSpeed(string UUID, float SpeedModifier)
|
||||
{
|
||||
|
||||
@@ -659,7 +659,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
|
||||
Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> linemap;
|
||||
|
||||
lock(m_ScriptErrors)
|
||||
lock (m_ScriptErrors)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user