mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
Merge branch 'master' into careminster-presence-refactor
This commit is contained in:
@@ -648,6 +648,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
//
|
||||
CheckThreatLevel(ThreatLevel.High, "osTeleportAgent");
|
||||
|
||||
TeleportAgent(agent, regionName, position, lookat);
|
||||
}
|
||||
|
||||
private void TeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
UUID agentId = new UUID();
|
||||
if (UUID.TryParse(agent, out agentId))
|
||||
@@ -660,7 +665,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
== World.LandChannel.GetLandObject(
|
||||
presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
|
||||
{
|
||||
|
||||
// Check for hostname , attempt to make a hglink
|
||||
// and convert the regionName to the target region
|
||||
if (regionName.Contains(".") && regionName.Contains(":"))
|
||||
@@ -670,7 +674,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (regions != null && regions.Count > 0)
|
||||
{
|
||||
GridRegion regInfo = regions[0];
|
||||
regionName = regInfo.RegionName;
|
||||
string[] parts = regInfo.RegionName.Split(new char[] { ':' });
|
||||
if (parts.Length > 2)
|
||||
regionName = parts[2];
|
||||
else
|
||||
regionName = parts[0];
|
||||
}
|
||||
}
|
||||
World.RequestTeleportLocation(presence.ControllingClient, regionName,
|
||||
@@ -683,13 +691,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
}
|
||||
|
||||
// Teleport functions
|
||||
public void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
|
||||
{
|
||||
// High because there is no security check. High griefer potential
|
||||
//
|
||||
CheckThreatLevel(ThreatLevel.High, "osTeleportAgent");
|
||||
|
||||
TeleportAgent(agent, regionX, regionY, position, lookat);
|
||||
}
|
||||
|
||||
private void TeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
|
||||
{
|
||||
ulong regionHandle = Util.UIntsToLong(((uint)regionX * (uint)Constants.RegionSize), ((uint)regionY * (uint)Constants.RegionSize));
|
||||
|
||||
m_host.AddScriptLPS(1);
|
||||
@@ -718,6 +730,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
osTeleportAgent(agent, World.RegionInfo.RegionName, position, lookat);
|
||||
}
|
||||
|
||||
public void osTeleportOwner(string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
|
||||
{
|
||||
// Threat level None because this is what can already be done with the World Map in the viewer
|
||||
CheckThreatLevel(ThreatLevel.None, "osTeleportOwner");
|
||||
|
||||
TeleportAgent(m_host.OwnerID.ToString(), regionName, position, lookat);
|
||||
}
|
||||
|
||||
public void osTeleportOwner(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
|
||||
{
|
||||
osTeleportOwner(World.RegionInfo.RegionName, position, lookat);
|
||||
}
|
||||
|
||||
public void osTeleportOwner(int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.None, "osTeleportOwner");
|
||||
|
||||
TeleportAgent(m_host.OwnerID.ToString(), regionX, regionY, position, lookat);
|
||||
}
|
||||
|
||||
// Functions that get information from the agent itself.
|
||||
//
|
||||
// osGetAgentIP - this is used to determine the IP address of
|
||||
|
||||
Reference in New Issue
Block a user