diff --git a/libsecondlife-cs/NetworkManager.cs b/libsecondlife-cs/NetworkManager.cs index 62f637fe..640c4fb6 100644 --- a/libsecondlife-cs/NetworkManager.cs +++ b/libsecondlife-cs/NetworkManager.cs @@ -54,7 +54,7 @@ namespace libsecondlife /// The maximum size of the sequence number inbox, used to /// check for resent and/or duplicate packets - public const int INBOX_SIZE = 100; + public const int INBOX_SIZE = 10000; /// The Region class that this Simulator wraps public Region Region; @@ -112,7 +112,7 @@ namespace libsecondlife // Every tick, all ACKs are sent out and the age of unACKed packets is checked private int TickLength = 500; // Number of milliseconds before a packet is assumed lost and resent - private int ResendTimeout = 2500; + private int ResendTimeout = 4000; /// /// @@ -1274,12 +1274,6 @@ namespace libsecondlife //update.AgentData.AgentID = AgentID; //update.AgentData.SessionID = SessionID; //SendPacket(update); - - // TODO: What is the purpose of this? Information is currently unused - RequestGrantedProxiesPacket proxies = new RequestGrantedProxiesPacket(); - proxies.AgentData.AgentID = AgentID; - proxies.AgentData.SessionID = SessionID; - SendPacket(proxies); } private void DisconnectTimer_Elapsed(object sender, ElapsedEventArgs ev) diff --git a/libsecondlife-cs/ObjectManager.cs b/libsecondlife-cs/ObjectManager.cs index 4319fad7..d5903a70 100644 --- a/libsecondlife-cs/ObjectManager.cs +++ b/libsecondlife-cs/ObjectManager.cs @@ -512,7 +512,9 @@ namespace libsecondlife packet.ObjectData.RayTargetID = LLUUID.Zero; packet.ObjectData.BypassRaycast = 1; - packet.ObjectData.TextureEntry = prim.Textures.GetBytes(); + // TODO: This is no longer a field in ObjectAdd. Detect if there actually is + // texture information for this prim and send an ObjectUpdate + //packet.ObjectData.TextureEntry = prim.Textures.GetBytes(); Client.Network.SendPacket(packet, simulator); } diff --git a/libsecondlife-cs/examples/TestClient/Commands/FollowCommand.cs b/libsecondlife-cs/examples/TestClient/Commands/FollowCommand.cs index 7fd65052..70ee4468 100644 --- a/libsecondlife-cs/examples/TestClient/Commands/FollowCommand.cs +++ b/libsecondlife-cs/examples/TestClient/Commands/FollowCommand.cs @@ -50,10 +50,13 @@ namespace libsecondlife.TestClient { if (vecDist(followAvatar.Position, Client.Self.Position) > DISTANCE_BUFFER) { - //move toward target - ulong x = (ulong)(followAvatar.Position.X + (followAvatar.CurrentRegion.GridRegionData.X * 256)); - ulong y = (ulong)(followAvatar.Position.Y + (followAvatar.CurrentRegion.GridRegionData.Y * 256)); - Client.Self.AutoPilotLocal(Convert.ToInt32(followAvatar.Position.X), Convert.ToInt32(followAvatar.Position.Y), followAvatar.Position.Z); + if (followAvatar.CurrentRegion.GridRegionData != null) + { + // move toward target + ulong x = (ulong)(followAvatar.Position.X + (followAvatar.CurrentRegion.GridRegionData.X * 256)); + ulong y = (ulong)(followAvatar.Position.Y + (followAvatar.CurrentRegion.GridRegionData.Y * 256)); + Client.Self.AutoPilotLocal(Convert.ToInt32(followAvatar.Position.X), Convert.ToInt32(followAvatar.Position.Y), followAvatar.Position.Z); + } } //else //{ diff --git a/libsecondlife-cs/examples/TestClient/Commands/GotoCommand.cs b/libsecondlife-cs/examples/TestClient/Commands/GotoCommand.cs index dc0a27ba..e2f931f2 100644 --- a/libsecondlife-cs/examples/TestClient/Commands/GotoCommand.cs +++ b/libsecondlife-cs/examples/TestClient/Commands/GotoCommand.cs @@ -8,33 +8,51 @@ namespace libsecondlife.TestClient { public class GotoCommand: Command { + private bool EstateLookupFinished = false; + public GotoCommand() { Name = "goto"; - Description = "Goto location. (e.g. \"goto simname/100/100/30\")"; + Description = "Teleport to a location (e.g. \"goto Hooper/100/100/30\")"; } public override string Execute(SecondLife Client, string[] args, LLUUID fromAgentID) { if (args.Length < 1) - return "Destination should be specified as: sim/x/y/z"; + return "usage: Destination should be specified as sim/x/y/z"; - char[] seps = { '/' }; - string[] destination = args[0].Split(seps); - if( destination.Length != 4 ) - return "Destination should be specified as: sim/x/y/z"; + string destination = ""; - string sim = destination[0]; + // 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(destination[1], out x); - float.TryParse(destination[2], out y); - float.TryParse(destination[3], out 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 "Teleported to " + sim + " {" + x + "," + y + "," + z + "}"; + return "Attempted to teleport to " + sim + " {" + x + "," + y + "," + z + "}"; } } } diff --git a/libsecondlife-cs/examples/TestClient/Commands/LoginCommand.cs b/libsecondlife-cs/examples/TestClient/Commands/LoginCommand.cs index 3186f498..532ce46c 100644 --- a/libsecondlife-cs/examples/TestClient/Commands/LoginCommand.cs +++ b/libsecondlife-cs/examples/TestClient/Commands/LoginCommand.cs @@ -23,7 +23,6 @@ namespace libsecondlife.TestClient account.FirstName = args[0]; account.LastName = args[1]; account.Password = args[2]; - account.Master = TestClient.Master; // Check if this client is already logged in foreach (SecondLife client in TestClient.Clients.Values) diff --git a/libsecondlife-cs/examples/TestClient/Program.cs b/libsecondlife-cs/examples/TestClient/Program.cs index 27342c8a..d5c42460 100644 --- a/libsecondlife-cs/examples/TestClient/Program.cs +++ b/libsecondlife-cs/examples/TestClient/Program.cs @@ -24,6 +24,7 @@ namespace libsecondlife.TestClient TestClient tester; List accounts = new List(); LoginDetails account; + string master = ""; if (args[0] == "--file") { @@ -47,11 +48,6 @@ namespace libsecondlife.TestClient account.LastName = tokens[1]; account.Password = tokens[2]; - if (args.Length == 4) - { - account.Master = args[2] + " " + args[3]; - } - accounts.Add(account); } else @@ -67,6 +63,11 @@ namespace libsecondlife.TestClient Console.WriteLine("Error reading from " + args[1]); return; } + + if (args.Length == 4) + { + master = args[2] + " " + args[3]; + } } else if (args.Length == 3 || args.Length == 5) { @@ -78,7 +79,7 @@ namespace libsecondlife.TestClient if (args.Length == 5) { - account.Master = args[3] + " " + args[4]; + master = args[3] + " " + args[4]; } accounts.Add(account); @@ -91,6 +92,7 @@ namespace libsecondlife.TestClient // Login the accounts and run the input loop tester = new TestClient(accounts); + tester.Master = master; tester.Run(); } } diff --git a/libsecondlife-cs/examples/TestClient/TestClient.cs b/libsecondlife-cs/examples/TestClient/TestClient.cs index 2e5e630e..fc9d8b98 100644 --- a/libsecondlife-cs/examples/TestClient/TestClient.cs +++ b/libsecondlife-cs/examples/TestClient/TestClient.cs @@ -12,7 +12,6 @@ namespace libsecondlife.TestClient public string FirstName; public string LastName; public string Password; - public string Master; } public class TestClient diff --git a/libsecondlife-cs/examples/TestClient/TestClient.csproj b/libsecondlife-cs/examples/TestClient/TestClient.csproj index 53f3502c..1218fa44 100644 --- a/libsecondlife-cs/examples/TestClient/TestClient.csproj +++ b/libsecondlife-cs/examples/TestClient/TestClient.csproj @@ -35,7 +35,6 @@ -