From 64a98c736848de6099254f23483058668273c1a5 Mon Sep 17 00:00:00 2001 From: gareth Date: Mon, 14 May 2007 03:13:47 +0000 Subject: Finished off adding the new management API to gridserver Updated VersionInfo.cs finally Updated prebuild and rebuilt nant build files Completed Management agent basics --- ExportBot/Commands/Movement/FollowCommand.cs | 90 -------------------------- ExportBot/Commands/Movement/GotoCommand.cs | 53 --------------- ExportBot/Commands/Movement/JumpCommand.cs | 34 ---------- ExportBot/Commands/Movement/LocationCommand.cs | 23 ------- ExportBot/Commands/Movement/MoveToCommand.cs | 24 ------- ExportBot/Commands/Movement/SitCommand.cs | 52 --------------- ExportBot/Commands/Movement/SitOnCommand.cs | 54 ---------------- ExportBot/Commands/Movement/StandCommand.cs | 47 -------------- 8 files changed, 377 deletions(-) delete mode 100644 ExportBot/Commands/Movement/FollowCommand.cs delete mode 100644 ExportBot/Commands/Movement/GotoCommand.cs delete mode 100644 ExportBot/Commands/Movement/JumpCommand.cs delete mode 100644 ExportBot/Commands/Movement/LocationCommand.cs delete mode 100644 ExportBot/Commands/Movement/MoveToCommand.cs delete mode 100644 ExportBot/Commands/Movement/SitCommand.cs delete mode 100644 ExportBot/Commands/Movement/SitOnCommand.cs delete mode 100644 ExportBot/Commands/Movement/StandCommand.cs (limited to 'ExportBot/Commands/Movement') diff --git a/ExportBot/Commands/Movement/FollowCommand.cs b/ExportBot/Commands/Movement/FollowCommand.cs deleted file mode 100644 index f5074a3..0000000 --- a/ExportBot/Commands/Movement/FollowCommand.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using libsecondlife.Packets; - -namespace libsecondlife.TestClient -{ - public class FollowCommand: Command - { - public FollowCommand(TestClient testClient) - { - Name = "follow"; - Description = "Follow another avatar. (usage: follow [FirstName LastName]) If no target is set then will follow master."; - } - - public override string Execute(string[] args, LLUUID fromAgentID) - { - string target = String.Empty; - for (int ct = 0; ct < args.Length; ct++) - target = target + args[ct] + " "; - target = target.TrimEnd(); - - if (target.Length > 0) - { - if (Follow(target)) - return "Following " + target; - else - return "Unable to follow " + target + ". Client may not be able to see that avatar."; - } - else - { - if (Follow(Client.MasterKey)) - return "Following " + Client.MasterKey; - else - return "No target specified and no master not found. usage: follow [FirstName LastName])"; - } - } - - const float DISTANCE_BUFFER = 3.0f; - Avatar followAvatar; - - bool Follow(string name) - { - foreach (Avatar av in Client.AvatarList.Values) - { - if (av.Name == name) - { - followAvatar = av; - Active = true; - return true; - } - } - return false; - } - - bool Follow(LLUUID id) - { - foreach (Avatar av in Client.AvatarList.Values) - { - if (av.ID == id) - { - followAvatar = av; - Active = true; - return true; - } - } - return false; - } - - public override void Think() - { - if (Helpers.VecDist(followAvatar.Position, Client.Self.Position) > DISTANCE_BUFFER) - { - //move toward target - LLVector3 avPos = followAvatar.Position; - Client.Self.AutoPilot((ulong)avPos.X + (ulong)Client.regionX, (ulong)avPos.Y + (ulong)Client.regionY, avPos.Z); - } - //else - //{ - // //stop at current position - // LLVector3 myPos = client.Self.Position; - // client.Self.AutoPilot((ulong)myPos.x, (ulong)myPos.y, myPos.Z); - //} - - base.Think(); - } - - } -} diff --git a/ExportBot/Commands/Movement/GotoCommand.cs b/ExportBot/Commands/Movement/GotoCommand.cs deleted file mode 100644 index df2b8a7..0000000 --- a/ExportBot/Commands/Movement/GotoCommand.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using libsecondlife.Packets; - -namespace libsecondlife.TestClient -{ - public class GotoCommand: Command - { - public GotoCommand(TestClient testClient) - { - Name = "goto"; - Description = "Teleport to a location (e.g. \"goto Hooper/100/100/30\")"; - } - - public override string Execute(string[] args, LLUUID fromAgentID) - { - if (args.Length < 1) - return "usage: Destination should be specified as sim/x/y/z"; - - string destination = String.Empty; - - // Handle multi-word sim names by combining the arguments - foreach (string arg in args) - { - destination += arg + " "; - } - destination = destination.Trim(); - - string[] tokens = destination.Split(new char[] { '/' }); - if (tokens.Length != 4) - return "usage: Destination should be specified as sim/x/y/z"; - - string sim = tokens[0]; - float x = Client.Self.Position.X; - float y = Client.Self.Position.Y; - float z = Client.Self.Position.Z; - float.TryParse(tokens[1], out x); - float.TryParse(tokens[2], out y); - float.TryParse(tokens[3], out z); - - if (Client.Self.Teleport(sim, new LLVector3(x, y, z))) - { - return "Teleported to " + Client.Network.CurrentSim; - } - else - { - return "Teleport failed: " + Client.Self.TeleportMessage; - } - } - } -} diff --git a/ExportBot/Commands/Movement/JumpCommand.cs b/ExportBot/Commands/Movement/JumpCommand.cs deleted file mode 100644 index 29b11a0..0000000 --- a/ExportBot/Commands/Movement/JumpCommand.cs +++ /dev/null @@ -1,34 +0,0 @@ -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"; - Description = "Teleports to the specified height. (e.g. \"jump 1000\")"; - } - - public override string Execute(string[] args, LLUUID fromAgentID) - { - if (args.Length != 1) - return "usage: jump 1000"; - - float height = 0; - float.TryParse(args[0], out height); - - Client.Self.Teleport - ( - Client.Network.CurrentSim.Name, - new LLVector3(Client.Self.Position.X, Client.Self.Position.Y, Client.Self.Position.Z + height) - ); - - return "Jumped " + height; - } - } -} diff --git a/ExportBot/Commands/Movement/LocationCommand.cs b/ExportBot/Commands/Movement/LocationCommand.cs deleted file mode 100644 index 2fd62bb..0000000 --- a/ExportBot/Commands/Movement/LocationCommand.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using libsecondlife.Packets; - -namespace libsecondlife.TestClient -{ - public class LocationCommand: Command - { - public LocationCommand(TestClient testClient) - { - Name = "location"; - Description = "Show the location."; - } - - public override string Execute(string[] args, LLUUID fromAgentID) - { - return "CurrentSim: '" + Client.Network.CurrentSim.ToString() + "' Position: " + - Client.Self.Position.ToString(); - } - } -} diff --git a/ExportBot/Commands/Movement/MoveToCommand.cs b/ExportBot/Commands/Movement/MoveToCommand.cs deleted file mode 100644 index 6d0a225..0000000 --- a/ExportBot/Commands/Movement/MoveToCommand.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace libsecondlife.TestClient.Commands.Movement { - class MovetoCommand : Command { - public MovetoCommand(TestClient client) { - Name = "moveto"; - Description = "Moves the avatar to the specified global position using simulator autopilot."; - } - public override string Execute(string[] args, LLUUID fromAgentID) { - if (args.Length != 3) - return "usage: moveto x y z"; - float x = Client.Self.Position.X + Client.regionX; - float y = Client.Self.Position.Y + Client.regionY; - float z = Client.Self.Position.Z; - float.TryParse(args[0], out x); - float.TryParse(args[1], out y); - float.TryParse(args[2], out z); - Client.Self.AutoPilot((ulong)x, (ulong)y, z); - return "Attempting to move to <" + x + ", " + y + ", " + z + ">"; - } - } -} diff --git a/ExportBot/Commands/Movement/SitCommand.cs b/ExportBot/Commands/Movement/SitCommand.cs deleted file mode 100644 index b9ef6be..0000000 --- a/ExportBot/Commands/Movement/SitCommand.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using libsecondlife.Packets; - -namespace libsecondlife.TestClient -{ - public class SitCommand: Command - { - public SitCommand(TestClient testClient) - { - Name = "sit"; - Description = "Attempt to sit on the closest prim"; - } - - public override string Execute(string[] args, LLUUID fromAgentID) - { - Primitive closest = null; - double closestDistance = Double.MaxValue; - - lock (Client.SimPrims) - { - if (Client.SimPrims.ContainsKey(Client.Network.CurrentSim)) - { - foreach (Primitive p in Client.SimPrims[Client.Network.CurrentSim].Values) - { - float distance = Helpers.VecDist(Client.Self.Position, p.Position); - - if (closest == null || distance < closestDistance) - { - closest = p; - closestDistance = distance; - } - } - } - } - - if (closest != null) - { - Client.Self.RequestSit(closest.ID, LLVector3.Zero); - Client.Self.Sit(); - - return "Sat on " + closest.ID + ". Distance: " + closestDistance; - } - else - { - return "Couldn't find a nearby prim to sit on"; - } - } - } -} diff --git a/ExportBot/Commands/Movement/SitOnCommand.cs b/ExportBot/Commands/Movement/SitOnCommand.cs deleted file mode 100644 index ec9d201..0000000 --- a/ExportBot/Commands/Movement/SitOnCommand.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using libsecondlife.Packets; - -namespace libsecondlife.TestClient -{ - public class SitOnCommand: Command - { - public SitOnCommand(TestClient testClient) - { - Name = "siton"; - Description = "Attempt to sit on a particular prim, with specified UUID"; - } - - public override string Execute(string[] args, LLUUID fromAgentID) - { - LLObject targetSeat = null; - - lock (Client.SimPrims) - { - if (Client.SimPrims.ContainsKey(Client.Network.CurrentSim)) - { - foreach (LLObject p in Client.SimPrims[Client.Network.CurrentSim].Values) - { - try - { - if (p.ID == args[0]) - targetSeat = p; - } - catch - { - // handle exception - return "Sorry, I don't think " + args[0] + " is a valid UUID. I'm unable to sit there."; - } - } - } - } - - if (targetSeat != null) - { - Client.Self.RequestSit(targetSeat.ID, LLVector3.Zero); - Client.Self.Sit(); - - return "Sat on prim " + targetSeat.ID + "."; - } - else - { - return "Couldn't find specified prim to sit on"; - } - } - } -} \ No newline at end of file diff --git a/ExportBot/Commands/Movement/StandCommand.cs b/ExportBot/Commands/Movement/StandCommand.cs deleted file mode 100644 index 8a00552..0000000 --- a/ExportBot/Commands/Movement/StandCommand.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using libsecondlife.Packets; - -namespace libsecondlife.TestClient -{ - public class StandCommand: Command - { - public StandCommand(TestClient testClient) - { - Name = "stand"; - Description = "Stand"; - } - - public override string Execute(string[] args, LLUUID fromAgentID) - { - Client.Self.Status.StandUp = true; - stand(Client); - return "Standing up."; - } - - void stand(SecondLife client) - { - SendAgentUpdate(client, (uint)MainAvatar.ControlFlags.AGENT_CONTROL_STAND_UP); - } - - const float DRAW_DISTANCE = 96.0f; - void SendAgentUpdate(SecondLife client, uint ControlID) - { - AgentUpdatePacket p = new AgentUpdatePacket(); - p.AgentData.Far = DRAW_DISTANCE; - //LLVector3 myPos = client.Self.Position; - p.AgentData.CameraCenter = new LLVector3(0, 0, 0); - p.AgentData.CameraAtAxis = new LLVector3(0, 0, 0); - p.AgentData.CameraLeftAxis = new LLVector3(0, 0, 0); - p.AgentData.CameraUpAxis = new LLVector3(0, 0, 0); - p.AgentData.HeadRotation = new LLQuaternion(0, 0, 0, 1); ; - p.AgentData.BodyRotation = new LLQuaternion(0, 0, 0, 1); ; - p.AgentData.AgentID = client.Network.AgentID; - p.AgentData.SessionID = client.Network.SessionID; - p.AgentData.ControlFlags = ControlID; - client.Network.SendPacket(p); - } - } -} -- cgit v1.1