2007-04-28 20:54:02 +00:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using libsecondlife;
|
|
|
|
|
using libsecondlife.Packets;
|
|
|
|
|
|
|
|
|
|
namespace libsecondlife.TestClient
|
|
|
|
|
{
|
|
|
|
|
public class JumpCommand: Command
|
|
|
|
|
{
|
|
|
|
|
public JumpCommand(TestClient testClient)
|
|
|
|
|
{
|
|
|
|
|
Name = "jump";
|
2007-11-06 09:26:10 +00:00
|
|
|
Description = "Teleports to the specified height. (e.g. \"jump 10\")";
|
2007-04-28 20:54:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string Execute(string[] args, LLUUID fromAgentID)
|
|
|
|
|
{
|
|
|
|
|
if (args.Length != 1)
|
2007-11-06 09:26:10 +00:00
|
|
|
return "Usage: jump 10";
|
2007-04-28 20:54:02 +00:00
|
|
|
|
|
|
|
|
float height = 0;
|
2007-11-06 09:26:10 +00:00
|
|
|
if (!float.TryParse(args[0], out height))
|
|
|
|
|
return "Usage: jump 10";
|
2007-04-28 20:54:02 +00:00
|
|
|
|
2007-11-06 09:26:10 +00:00
|
|
|
LLVector3 dest = Client.Self.SimPosition;
|
|
|
|
|
dest.Z += height;
|
2007-04-28 20:54:02 +00:00
|
|
|
|
2007-11-06 09:26:10 +00:00
|
|
|
Client.Self.Teleport(Client.Network.CurrentSim.Name, dest);
|
|
|
|
|
|
|
|
|
|
return "Attempted to jump " + height + " meters";
|
2007-04-28 20:54:02 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|