diff --git a/libsecondlife-cs/examples/TestClient/Commands/Communication/EchoMasterCommand.cs b/libsecondlife-cs/examples/TestClient/Commands/Communication/EchoMasterCommand.cs deleted file mode 100644 index 721b5c98..00000000 --- a/libsecondlife-cs/examples/TestClient/Commands/Communication/EchoMasterCommand.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using libsecondlife.Packets; - -namespace libsecondlife.TestClient -{ - public class EchoMasterCommand: Command - { - public EchoMasterCommand(TestClient testClient) - { - Name = "echoMaster"; - Description = "Repeat everything that master says."; - } - - public override string Execute(string[] args, LLUUID fromAgentID) - { - if (!Active) - { - Active = true; - Client.Self.OnChat += new MainAvatar.ChatCallback(Self_OnChat); - return "Echoing is now on."; - } - else - { - Active = false; - Client.Self.OnChat -= new MainAvatar.ChatCallback(Self_OnChat); - return "Echoing is now off."; - } - } - - void Self_OnChat(string message, byte audible, byte type, byte sourcetype, string fromName, LLUUID id, LLUUID ownerid, LLVector3 position) - { - if (message.Length > 0 && Client.Master == fromName) - { - Client.Self.Chat(message, 0, MainAvatar.ChatType.Normal); - } - } - } -} diff --git a/libsecondlife-cs/examples/TestClient/Commands/Communication/IMCommand.cs b/libsecondlife-cs/examples/TestClient/Commands/Communication/IMCommand.cs deleted file mode 100644 index d847291d..00000000 --- a/libsecondlife-cs/examples/TestClient/Commands/Communication/IMCommand.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using libsecondlife; -using libsecondlife.Packets; - -namespace libsecondlife.TestClient -{ - public class ImCommand : Command - { - string ToAvatarName = String.Empty; - ManualResetEvent NameSearchEvent = new ManualResetEvent(false); - Dictionary Name2Key = new Dictionary(); - - public ImCommand(TestClient testClient) - { - testClient.Avatars.OnAvatarNameSearch += new AvatarManager.AvatarNameSearchCallback(Avatars_OnAvatarNameSearch); - - Name = "im"; - Description = "Instant message someone. Usage: im [firstname] [lastname] [message]"; - } - - public override string Execute(string[] args, LLUUID fromAgentID) - { - if (args.Length < 3) - return "Usage: im [firstname] [lastname] [message]"; - - ToAvatarName = args[0] + " " + args[1]; - - // Build the message - string message = String.Empty; - for (int ct = 2; ct < args.Length; ct++) - message += args[ct] + " "; - message = message.TrimEnd(); - if (message.Length > 1023) message = message.Remove(1023); - - if (!Name2Key.ContainsKey(ToAvatarName.ToLower())) - { - // Send the Query - Client.Avatars.RequestAvatarNameSearch(ToAvatarName, LLUUID.Random()); - - NameSearchEvent.WaitOne(6000, false); - } - - if (Name2Key.ContainsKey(ToAvatarName.ToLower())) - { - LLUUID id = Name2Key[ToAvatarName.ToLower()]; - - Client.Self.InstantMessage(id, message, id); - return "Instant Messaged " + id.ToStringHyphenated() + " with message: " + message; - } - else - { - return "Name lookup for " + ToAvatarName + " failed"; - } - } - - void Avatars_OnAvatarNameSearch(LLUUID queryID, Dictionary avatars) - { - foreach (KeyValuePair kvp in avatars) - { - if (kvp.Value.ToLower() == ToAvatarName.ToLower()) - { - Name2Key[ToAvatarName.ToLower()] = kvp.Key; - NameSearchEvent.Set(); - return; - } - } - } - } -} diff --git a/libsecondlife-cs/examples/TestClient/Commands/Communication/SayCommand.cs b/libsecondlife-cs/examples/TestClient/Commands/Communication/SayCommand.cs deleted file mode 100644 index 679c29cd..00000000 --- a/libsecondlife-cs/examples/TestClient/Commands/Communication/SayCommand.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using libsecondlife.Packets; - -namespace libsecondlife.TestClient -{ - public class SayCommand: Command - { - public SayCommand(TestClient testClient) - { - Name = "say"; - Description = "Say something. (usage: say (optional channel) whatever)"; - } - - public override string Execute(string[] args, LLUUID fromAgentID) - { - int channel = 0; - int startIndex = 0; - string message = String.Empty; - if (args.Length < 1) - { - return "usage: say (optional channel) whatever"; - } - else if (args.Length > 1) - { - if (Int32.TryParse(args[0], out channel)) - startIndex = 1; - } - - for (int i = startIndex; i < args.Length; i++) { - message += args[i] + " "; - } - - Client.Self.Chat(message, channel, MainAvatar.ChatType.Normal); - - return "Said " + message; - } - } -} diff --git a/libsecondlife-cs/examples/TestClient/Commands/Communication/ShoutCommand.cs b/libsecondlife-cs/examples/TestClient/Commands/Communication/ShoutCommand.cs deleted file mode 100644 index 3533e3d4..00000000 --- a/libsecondlife-cs/examples/TestClient/Commands/Communication/ShoutCommand.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using libsecondlife.Packets; - -namespace libsecondlife.TestClient -{ - public class ShoutCommand : Command - { - public ShoutCommand(TestClient testClient) - { - Name = "shout"; - Description = "Shout something."; - } - - public override string Execute(string[] args, LLUUID fromAgentID) - { - int channel = 0; - int startIndex = 0; - string message = String.Empty; - if (args.Length < 1) - { - return "usage: shout (optional channel) whatever"; - } - else if (args.Length > 1) - { - try - { - channel = Convert.ToInt32(args[0]); - startIndex = 1; - } - catch (FormatException) - { - channel = 0; - } - } - - for (int i = startIndex; i < args.Length; i++) - { - message += args[i] + " "; - } - - Client.Self.Chat(message, channel, MainAvatar.ChatType.Shout); - - return "Shouted " + message; - } - } -} diff --git a/libsecondlife-cs/examples/TestClient/Commands/Communication/TtsCommand.cs b/libsecondlife-cs/examples/TestClient/Commands/Communication/TtsCommand.cs deleted file mode 100644 index 52b7a39a..00000000 --- a/libsecondlife-cs/examples/TestClient/Commands/Communication/TtsCommand.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Speech.Synthesis; -using libsecondlife; -using libsecondlife.Packets; -using libsecondlife.AssetSystem; - - -// Since this requires .Net 3.0 I've left it out of the project by default. -// To use this: include it in the project and add a reference to the System.Speech.dll - -namespace libsecondlife.TestClient -{ - public class TtsCommand : Command - { - SpeechSynthesizer _speechSynthesizer; - - public TtsCommand(TestClient testClient) - { - Name = "tts"; - Description = "Text To Speech. When activated, client will echo all recieved chat messages out thru the computer's speakers."; - } - - public override string Execute(string[] args, LLUUID fromAgentID) - { - if (!Active) - { - if (_speechSynthesizer == null) - _speechSynthesizer = new SpeechSynthesizer(); - Active = true; - Client.Self.OnChat += new MainAvatar.ChatCallback(Self_OnChat); - return "TTS is now on."; - } - else - { - Active = false; - Client.Self.OnChat -= new MainAvatar.ChatCallback(Self_OnChat); - return "TTS is now off."; - } - } - - void Self_OnChat(string message, byte audible, byte type, byte sourcetype, string fromName, LLUUID id, LLUUID ownerid, LLVector3 position) - { - if (message.Length > 0) - { - _speechSynthesizer.SpeakAsync(message); - } - } - } -} \ No newline at end of file diff --git a/libsecondlife-cs/examples/TestClient/Commands/Communication/WhisperCommand.cs b/libsecondlife-cs/examples/TestClient/Commands/Communication/WhisperCommand.cs deleted file mode 100644 index 4bfda330..00000000 --- a/libsecondlife-cs/examples/TestClient/Commands/Communication/WhisperCommand.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using libsecondlife.Packets; - -namespace libsecondlife.TestClient -{ - public class WhisperCommand : Command - { - public WhisperCommand(TestClient testClient) - { - Name = "whisper"; - Description = "Whisper something."; - } - - public override string Execute(string[] args, LLUUID fromAgentID) - { - int channel = 0; - int startIndex = 0; - string message = String.Empty; - if (args.Length < 1) - { - return "usage: whisper (optional channel) whatever"; - } - else if (args.Length > 1) - { - try - { - channel = Convert.ToInt32(args[0]); - startIndex = 1; - } - catch (FormatException) - { - channel = 0; - } - } - - for (int i = startIndex; i < args.Length; i++) - { - message += args[i] + " "; - } - - Client.Self.Chat(message, channel, MainAvatar.ChatType.Whisper); - - return "Whispered " + message; - } - } -} diff --git a/libsecondlife-cs/examples/TestClient/Commands/Movement/FollowCommand.cs b/libsecondlife-cs/examples/TestClient/Commands/Movement/FollowCommand.cs deleted file mode 100644 index a4d3c35a..00000000 --- a/libsecondlife-cs/examples/TestClient/Commands/Movement/FollowCommand.cs +++ /dev/null @@ -1,78 +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) - target = Client.Master; - - 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 - { - return "No target specified and no master is set. usage: follow [FirstName LastName])"; - } - } - - const float DISTANCE_BUFFER = 3.0f; - string followName; - Avatar followAvatar; - - bool Follow(string name) - { - foreach (Avatar av in Client.AvatarList.Values) - { - if (av.Name == name) - { - followName = name; - 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/libsecondlife-cs/examples/TestClient/Commands/Movement/GotoCommand.cs b/libsecondlife-cs/examples/TestClient/Commands/Movement/GotoCommand.cs deleted file mode 100644 index 20460729..00000000 --- a/libsecondlife-cs/examples/TestClient/Commands/Movement/GotoCommand.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using libsecondlife.Packets; - -namespace libsecondlife.TestClient -{ - public class GotoCommand: Command - { - private bool EstateLookupFinished = false; - - 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 = ""; - - // 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 (!EstateLookupFinished) - { - Client.Grid.AddEstateSims(); - System.Threading.Thread.Sleep(3000); - - EstateLookupFinished = true; - } - - Client.Self.Teleport(sim, new LLVector3(x, y, z)); - - return "Attempted to teleport to " + sim + " {" + x + "," + y + "," + z + "}"; - } - } -} diff --git a/libsecondlife-cs/examples/TestClient/Commands/Movement/JumpCommand.cs b/libsecondlife-cs/examples/TestClient/Commands/Movement/JumpCommand.cs deleted file mode 100644 index c56dd1ce..00000000 --- a/libsecondlife-cs/examples/TestClient/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.Region.Name, - new LLVector3(Client.Self.Position.X, Client.Self.Position.Y, Client.Self.Position.Z + height) - ); - - return "Jumped " + height; - } - } -} diff --git a/libsecondlife-cs/examples/TestClient/Commands/Movement/LocationCommand.cs b/libsecondlife-cs/examples/TestClient/Commands/Movement/LocationCommand.cs deleted file mode 100644 index ac7d24f1..00000000 --- a/libsecondlife-cs/examples/TestClient/Commands/Movement/LocationCommand.cs +++ /dev/null @@ -1,22 +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.Region.Name + "' Position: " + Client.Self.Position.ToString(); - } - } -} diff --git a/libsecondlife-cs/examples/TestClient/Commands/Movement/SitCommand.cs b/libsecondlife-cs/examples/TestClient/Commands/Movement/SitCommand.cs deleted file mode 100644 index 2024fe54..00000000 --- a/libsecondlife-cs/examples/TestClient/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) - { - PrimObject closest = null; - double closestDistance = Double.MaxValue; - - lock (Client.SimPrims) - { - if (Client.SimPrims.ContainsKey(Client.Network.CurrentSim)) - { - foreach (PrimObject 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"; - } - } - } -}