示例#1
0
        public override CmdResult ExecuteRequest(CmdRequest args)
        {
            if (args.Length < 1)
            {
                return(ShowUsage()); // " goto sim/x/y/z";
            }
            int         argsUsed;
            SimPosition position = WorldSystem.GetVector(args, out argsUsed);

            if (position == null)
            {
                return(Failure("Teleport - Cannot resolve to a location: " + args.str));
            }
            SimPathStore ps     = position.PathStore;
            ulong        handle = SimRegion.GetRegionHandle(ps);

            TheSimAvatar.StopMoving();
            if (Client.Self.Teleport(handle, position.SimPosition))
            {
                return(Success("Teleported to " + Client.Network.CurrentSim));
            }
            else
            {
                return(Failure("Teleport failed: " + Client.Self.TeleportMessage));
            }
        }