Ejemplo n.º 1
0
        private void OnTeleportHandler(Simulator currentSim, string message, MainAvatar.TeleportStatus status)
        {
            switch (status)
            {
            case MainAvatar.TeleportStatus.None:
                break;

            case MainAvatar.TeleportStatus.Start:
                break;

            case MainAvatar.TeleportStatus.Progress:
                break;

            case MainAvatar.TeleportStatus.Failed:
                DoneTeleporting = true;
                break;

            case MainAvatar.TeleportStatus.Finished:
                DoneTeleporting = true;
                break;
            }

            tpMessage = message;
            tpStatus  = status;
        }
Ejemplo n.º 2
0
        void Self_OnTeleport(Simulator currentSim, string message, MainAvatar.TeleportStatus status)
        {
            Console.WriteLine(message);

            if (status == MainAvatar.TeleportStatus.Finished || status == MainAvatar.TeleportStatus.Failed)
            {
                DoneTeleporting = true;
            }
        }
        private void OnTeleportHandler(Simulator currentSim, string message, MainAvatar.TeleportStatus status)
        {
            switch (status)
            {
                case MainAvatar.TeleportStatus.None:
                    break;
                case MainAvatar.TeleportStatus.Start:
                    break;
                case MainAvatar.TeleportStatus.Progress:
                    break;
                case MainAvatar.TeleportStatus.Failed:
                    DoneTeleporting = true;
                    break;
                case MainAvatar.TeleportStatus.Finished:
                    DoneTeleporting = true;
                    break;
            }

            tpMessage = message;
            tpStatus = status;
        }
        public void Teleport()
        {
            DoneTeleporting = false;
            tpStatus = MainAvatar.TeleportStatus.None;

            Client.Self.Teleport(MorrisRegionHandle, new LLVector3(128, 128, 32));

            int start = Environment.TickCount;

            while (!DoneTeleporting)
            {
                System.Threading.Thread.Sleep(100);

                if (Environment.TickCount - start > 10000)
                {
                    Assert.Fail("Timeout waiting for the first teleport to finish");
                    return;
                }
            }

            Assert.IsTrue(tpStatus == MainAvatar.TeleportStatus.Finished,
                "Teleport status is " + tpStatus.ToString() + ", message=" + tpMessage);

            // Wait for the region information to come in
            start = Environment.TickCount;
            while (Client.Network.CurrentSim.Region.Name == "")
            {
                if (Environment.TickCount - start > 5000)
                {
                    Assert.Fail("Timeout waiting for a RegionHandshake packet");
                }
            }

            // Assert that we really did make it to our scheduled destination
            Assert.AreEqual("morris", Client.Network.CurrentSim.Region.Name.ToLower(),
                "Expected to teleport to Morris, ended up in " + Client.Network.CurrentSim.Region.Name +
                ". Possibly region full or offline?");

            ///////////////////////////////////////////////////////////////////

            // TODO: Add a local region teleport

            ///////////////////////////////////////////////////////////////////

            DoneTeleporting = false;
            tpStatus = MainAvatar.TeleportStatus.None;

            Client.Self.Teleport(AhernRegionHandle, new LLVector3(128, 128, 32));

            start = Environment.TickCount;

            while (!DoneTeleporting)
            {
                System.Threading.Thread.Sleep(100);

                if (Environment.TickCount - start > 10000)
                {
                    Assert.Fail("Timeout waiting for the second teleport to finish");
                    return;
                }
            }

            Assert.IsTrue(tpStatus == MainAvatar.TeleportStatus.Finished, "Teleport status is " +
                tpStatus.ToString() + ", message=" + tpMessage);

            // Wait for the region information to come in
            start = Environment.TickCount;
            while (Client.Network.CurrentSim.Region.Name == "")
            {
                if (Environment.TickCount - start > 5000)
                {
                    Assert.Fail("Timeout waiting for a RegionHandshake packet");
                }
            }

            // Assert that we really did make it to our scheduled destination
            Assert.AreEqual("ahern", Client.Network.CurrentSim.Region.Name.ToLower(),
                "Expected to teleport to Ahern, ended up in " + Client.Network.CurrentSim.Region.Name +
                ". Possibly region full or offline?");
        }
Ejemplo n.º 5
0
        public void Teleport()
        {
            DoneTeleporting = false;
            tpStatus        = MainAvatar.TeleportStatus.None;

            Client.Self.Teleport(MorrisRegionHandle, new LLVector3(128, 128, 32));

            int start = Environment.TickCount;

            while (!DoneTeleporting)
            {
                System.Threading.Thread.Sleep(100);

                if (Environment.TickCount - start > 10000)
                {
                    Assert.Fail("Timeout waiting for the first teleport to finish");
                    return;
                }
            }

            Assert.IsTrue(tpStatus == MainAvatar.TeleportStatus.Finished,
                          "Teleport status is " + tpStatus.ToString() + ", message=" + tpMessage);

            // Wait for the region information to come in
            start = Environment.TickCount;
            while (Client.Network.CurrentSim.Region.Name == "")
            {
                if (Environment.TickCount - start > 5000)
                {
                    Assert.Fail("Timeout waiting for a RegionHandshake packet");
                }
            }

            // Assert that we really did make it to our scheduled destination
            Assert.AreEqual("morris", Client.Network.CurrentSim.Region.Name.ToLower(),
                            "Expected to teleport to Morris, ended up in " + Client.Network.CurrentSim.Region.Name +
                            ". Possibly region full or offline?");

            ///////////////////////////////////////////////////////////////////

            // TODO: Add a local region teleport

            ///////////////////////////////////////////////////////////////////

            DoneTeleporting = false;
            tpStatus        = MainAvatar.TeleportStatus.None;

            Client.Self.Teleport(AhernRegionHandle, new LLVector3(128, 128, 32));

            start = Environment.TickCount;

            while (!DoneTeleporting)
            {
                System.Threading.Thread.Sleep(100);

                if (Environment.TickCount - start > 10000)
                {
                    Assert.Fail("Timeout waiting for the second teleport to finish");
                    return;
                }
            }

            Assert.IsTrue(tpStatus == MainAvatar.TeleportStatus.Finished, "Teleport status is " +
                          tpStatus.ToString() + ", message=" + tpMessage);

            // Wait for the region information to come in
            start = Environment.TickCount;
            while (Client.Network.CurrentSim.Region.Name == "")
            {
                if (Environment.TickCount - start > 5000)
                {
                    Assert.Fail("Timeout waiting for a RegionHandshake packet");
                }
            }

            // Assert that we really did make it to our scheduled destination
            Assert.AreEqual("ahern", Client.Network.CurrentSim.Region.Name.ToLower(),
                            "Expected to teleport to Ahern, ended up in " + Client.Network.CurrentSim.Region.Name +
                            ". Possibly region full or offline?");
        }