OpenSim.Region.ScriptEngine.Shared.Api.OSSL_Api.TeleportAgent C# (CSharp) Method

TeleportAgent() private method

private TeleportAgent ( string agent, int regionGridX, int regionGridY, OpenSim.Region.ScriptEngine.Shared.LSL_Types position, OpenSim.Region.ScriptEngine.Shared.LSL_Types lookat, bool relaxRestrictions ) : void
agent string
regionGridX int
regionGridY int
position OpenSim.Region.ScriptEngine.Shared.LSL_Types
lookat OpenSim.Region.ScriptEngine.Shared.LSL_Types
relaxRestrictions bool
return void
        private void TeleportAgent(string agent, int regionGridX, int regionGridY,
            LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool relaxRestrictions)
        {
            ulong regionHandle = Util.RegionGridLocToHandle((uint)regionGridX, (uint)regionGridY);

            m_host.AddScriptLPS(1);
            UUID agentId = new UUID();
            if (UUID.TryParse(agent, out agentId))
            {
                ScenePresence presence = World.GetScenePresence(agentId);
                if (presence != null)
                {
                    // For osTeleportAgent, agent must be over owners land to avoid abuse
                    // For osTeleportOwner, this restriction isn't necessary

                    // commented out because its redundant and uneeded please remove eventually.
                    // if (relaxRestrictions ||
                    //    m_host.OwnerID
                    //    == World.LandChannel.GetLandObject(
                    //        presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
                    // {

                        // 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.
                        Util.FireAndForget(
                            o => World.RequestTeleportLocation(
                                presence.ControllingClient, regionHandle, 
                                position, lookat, (uint)TPFlags.ViaLocation), 
                            null, "OSSL_Api.TeleportAgentByRegionName");

                        ScriptSleep(5000);

                   //  }

                }
            }
        }

Same methods

OSSL_Api::TeleportAgent ( string agent, string regionName, OpenSim.Region.ScriptEngine.Shared.LSL_Types position, OpenSim.Region.ScriptEngine.Shared.LSL_Types lookat, bool relaxRestrictions ) : void
OSSL_Api