diff --git a/Programs/PrimWorkshop/frmBrowser.cs b/Programs/PrimWorkshop/frmBrowser.cs index cc703d53..54aec849 100644 --- a/Programs/PrimWorkshop/frmBrowser.cs +++ b/Programs/PrimWorkshop/frmBrowser.cs @@ -146,7 +146,6 @@ namespace PrimWorkshop Client.Settings.ALWAYS_DECODE_OBJECTS = true; Client.Settings.ALWAYS_REQUEST_OBJECTS = true; Client.Settings.SEND_AGENT_UPDATES = true; - Client.Settings.DISABLE_AGENT_UPDATE_DUPLICATE_CHECK = true; Client.Settings.USE_TEXTURE_CACHE = true; Client.Settings.TEXTURE_CACHE_DIR = Application.StartupPath + System.IO.Path.DirectorySeparatorChar + "cache"; Client.Settings.ALWAYS_REQUEST_PARCEL_ACL = false; diff --git a/Programs/examples/TestClient/Commands/Movement/BackCommand.cs b/Programs/examples/TestClient/Commands/Movement/BackCommand.cs new file mode 100644 index 00000000..081e5152 --- /dev/null +++ b/Programs/examples/TestClient/Commands/Movement/BackCommand.cs @@ -0,0 +1,53 @@ +using System; + +namespace OpenMetaverse.TestClient.Commands.Movement +{ + class BackCommand : Command + { + public BackCommand(TestClient client) + { + Name = "back"; + Description = "Sends the move back command to the server for a single packet or a given number of seconds. Usage: back [seconds]"; + Category = CommandCategory.Movement; + } + + public override string Execute(string[] args, UUID fromAgentID) + { + if (args.Length > 1) + return "Usage: back [seconds]"; + + if (args.Length == 0) + { + Client.Self.Movement.SendManualUpdate(AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG, Client.Self.Movement.Camera.Position, + Client.Self.Movement.Camera.AtAxis, Client.Self.Movement.Camera.LeftAxis, Client.Self.Movement.Camera.UpAxis, + Client.Self.Movement.BodyRotation, Client.Self.Movement.HeadRotation, Client.Self.Movement.Camera.Far, AgentManager.AgentFlags.None, + AgentManager.AgentState.None, true); + } + else + { + // Parse the number of seconds + int duration; + if (!Int32.TryParse(args[0], out duration)) + return "Usage: back [seconds]"; + // Convert to milliseconds + duration *= 1000; + + int start = Environment.TickCount; + + Client.Self.Movement.AtNeg = true; + + while (Environment.TickCount - start < duration) + { + // The movement timer will do this automatically, but we do it here as an example + // and to make sure updates are being sent out fast enough + Client.Self.Movement.SendUpdate(false); + System.Threading.Thread.Sleep(100); + } + + Client.Self.Movement.AtNeg = false; + } + + return "Moved backward"; + } + } +} diff --git a/Programs/examples/TestClient/Commands/Movement/ForwardCommand.cs b/Programs/examples/TestClient/Commands/Movement/ForwardCommand.cs new file mode 100644 index 00000000..28becdfd --- /dev/null +++ b/Programs/examples/TestClient/Commands/Movement/ForwardCommand.cs @@ -0,0 +1,53 @@ +using System; + +namespace OpenMetaverse.TestClient.Commands.Movement +{ + class ForwardCommand : Command + { + public ForwardCommand(TestClient client) + { + Name = "forward"; + Description = "Sends the move forward command to the server for a single packet or a given number of seconds. Usage: forward [seconds]"; + Category = CommandCategory.Movement; + } + + public override string Execute(string[] args, UUID fromAgentID) + { + if (args.Length > 1) + return "Usage: forward [seconds]"; + + if (args.Length == 0) + { + Client.Self.Movement.SendManualUpdate(AgentManager.ControlFlags.AGENT_CONTROL_AT_POS, Client.Self.Movement.Camera.Position, + Client.Self.Movement.Camera.AtAxis, Client.Self.Movement.Camera.LeftAxis, Client.Self.Movement.Camera.UpAxis, + Client.Self.Movement.BodyRotation, Client.Self.Movement.HeadRotation, Client.Self.Movement.Camera.Far, AgentManager.AgentFlags.None, + AgentManager.AgentState.None, true); + } + else + { + // Parse the number of seconds + int duration; + if (!Int32.TryParse(args[0], out duration)) + return "Usage: forward [seconds]"; + // Convert to milliseconds + duration *= 1000; + + int start = Environment.TickCount; + + Client.Self.Movement.AtPos = true; + + while (Environment.TickCount - start < duration) + { + // The movement timer will do this automatically, but we do it here as an example + // and to make sure updates are being sent out fast enough + Client.Self.Movement.SendUpdate(false); + System.Threading.Thread.Sleep(100); + } + + Client.Self.Movement.AtPos = false; + } + + return "Moved forward"; + } + } +} diff --git a/Programs/examples/TestClient/Commands/Movement/LeftCommand.cs b/Programs/examples/TestClient/Commands/Movement/LeftCommand.cs new file mode 100644 index 00000000..0d969e2e --- /dev/null +++ b/Programs/examples/TestClient/Commands/Movement/LeftCommand.cs @@ -0,0 +1,53 @@ +using System; + +namespace OpenMetaverse.TestClient.Commands.Movement +{ + class LeftCommand : Command + { + public LeftCommand(TestClient client) + { + Name = "left"; + Description = "Sends the move left command to the server for a single packet or a given number of seconds. Usage: left [seconds]"; + Category = CommandCategory.Movement; + } + + public override string Execute(string[] args, UUID fromAgentID) + { + if (args.Length > 1) + return "Usage: left [seconds]"; + + if (args.Length == 0) + { + Client.Self.Movement.SendManualUpdate(AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS, Client.Self.Movement.Camera.Position, + Client.Self.Movement.Camera.AtAxis, Client.Self.Movement.Camera.LeftAxis, Client.Self.Movement.Camera.UpAxis, + Client.Self.Movement.BodyRotation, Client.Self.Movement.HeadRotation, Client.Self.Movement.Camera.Far, AgentManager.AgentFlags.None, + AgentManager.AgentState.None, true); + } + else + { + // Parse the number of seconds + int duration; + if (!Int32.TryParse(args[0], out duration)) + return "Usage: left [seconds]"; + // Convert to milliseconds + duration *= 1000; + + int start = Environment.TickCount; + + Client.Self.Movement.LeftPos = true; + + while (Environment.TickCount - start < duration) + { + // The movement timer will do this automatically, but we do it here as an example + // and to make sure updates are being sent out fast enough + Client.Self.Movement.SendUpdate(false); + System.Threading.Thread.Sleep(100); + } + + Client.Self.Movement.LeftPos = false; + } + + return "Moved left"; + } + } +} diff --git a/Programs/examples/TestClient/Commands/Movement/RightCommand.cs b/Programs/examples/TestClient/Commands/Movement/RightCommand.cs new file mode 100644 index 00000000..d6c62b70 --- /dev/null +++ b/Programs/examples/TestClient/Commands/Movement/RightCommand.cs @@ -0,0 +1,53 @@ +using System; + +namespace OpenMetaverse.TestClient.Commands.Movement +{ + class RightCommand : Command + { + public RightCommand(TestClient client) + { + Name = "right"; + Description = "Sends the move right command to the server for a single packet or a given number of seconds. Usage: right [seconds]"; + Category = CommandCategory.Movement; + } + + public override string Execute(string[] args, UUID fromAgentID) + { + if (args.Length > 1) + return "Usage: right [seconds]"; + + if (args.Length == 0) + { + Client.Self.Movement.SendManualUpdate(AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG, Client.Self.Movement.Camera.Position, + Client.Self.Movement.Camera.AtAxis, Client.Self.Movement.Camera.LeftAxis, Client.Self.Movement.Camera.UpAxis, + Client.Self.Movement.BodyRotation, Client.Self.Movement.HeadRotation, Client.Self.Movement.Camera.Far, AgentManager.AgentFlags.None, + AgentManager.AgentState.None, true); + } + else + { + // Parse the number of seconds + int duration; + if (!Int32.TryParse(args[0], out duration)) + return "Usage: right [seconds]"; + // Convert to milliseconds + duration *= 1000; + + int start = Environment.TickCount; + + Client.Self.Movement.LeftNeg = true; + + while (Environment.TickCount - start < duration) + { + // The movement timer will do this automatically, but we do it here as an example + // and to make sure updates are being sent out fast enough + Client.Self.Movement.SendUpdate(false); + System.Threading.Thread.Sleep(100); + } + + Client.Self.Movement.LeftNeg = false; + } + + return "Moved right"; + } + } +} diff --git a/Programs/importprimscript/importprimscript.cs b/Programs/importprimscript/importprimscript.cs index c3c5ffb0..39e51531 100644 --- a/Programs/importprimscript/importprimscript.cs +++ b/Programs/importprimscript/importprimscript.cs @@ -71,7 +71,6 @@ namespace importprimscript Client.Self.Movement.Camera.Far = 64f; Client.Settings.MULTIPLE_SIMS = false; Client.Settings.SEND_AGENT_UPDATES = true; - Client.Settings.DISABLE_AGENT_UPDATE_DUPLICATE_CHECK = true; Settings.LOG_LEVEL = Helpers.LogLevel.None; Client.Settings.ALWAYS_REQUEST_OBJECTS = true; Client.Settings.ALWAYS_DECODE_OBJECTS = true;