Forum in READ ONLY mode! All questions and discussions on Discord official server, invite link: https://discord.gg/VxsGzJ7

newMoveXY causing connection lost

Post Reply
sibble
Neophyte
Neophyte
Posts: 48
Joined: 21.03.2015 18:12

newMoveXY causing connection lost

Post by sibble »

Code: Select all

                    foreach (Item _item in Containers)
                    {
                        workerSearch.ReportProgress(0, "moving to next container...");
                        _moverWatch.Restart();

                        while (_item.Distance > 1)
                        {
                            if (_moverWatch.Elapsed.Seconds > 15)
                                break;

                            workerSearch.ReportProgress(0, "trying to move...");
                            var _movingHelper = MovingHelper.GetMovingHelper();
                            _movingHelper.newMoveXY((ushort)_item.Location.X, (ushort)_item.Location.Y, true, 1, false);

                            Thread.Sleep(250);
                        }

                        SearchContainer(_item);
                        FindContainers();
                    }
This code works successfully for a couple of minutes, at random time UO client window will get "Connection Lost", look in Stealth and the account has disconnected from the server. Can confirm this happens in two of my solutions. (IDOCer, LootFinder)

This is the other code that this happens on:

Code: Select all

                    foreach (Location _location in _rail.Path.Skip(StartLocation))
                    {
                        
                        lock (thisLock)
                        {
                            _n++;

                            Point2D _position = new Point2D(_location.X, _location.Y);

                            workerSearch.ReportProgress(0, "Moving to location " + _n.ToString() + _position.ToString());

                            Stealth.Client.newMoveXY((ushort)_location.X, (ushort)_location.Y, true, 10,
                                StealthSearch ? false : true);

                            while (!Geometry.InRange(Self.Location, _position, 16))
                            {

                                while (PauseSearch) Thread.Sleep(1000);

                                if (workerSearch.CancellationPending)
                                {
                                    e.Cancel = true;
                                    break;
                                }

                                workerSearch.ReportProgress(0, "trying to move  to: " + _position.ToString());

                                Self.Movement.Step(Convert.ToByte(Geometry.GetDirectionTo(Self.Location, _position)), true);

                                Stealth.Client.newMoveXY((ushort)_location.X, (ushort)_location.Y, true, 10,
                                StealthSearch ? false : true);
                            }

                            if (workerSearch.CancellationPending)
                            {
                                e.Cancel = true;
                                break;
                            }

                        }
                    } //end foreach location
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Re: newMoveXY causing connection lost

Post by Vizit0r »

UO OFF(oficial) server?
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
sibble
Neophyte
Neophyte
Posts: 48
Joined: 21.03.2015 18:12

Re: newMoveXY causing connection lost

Post by sibble »

yes official server
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Re: newMoveXY causing connection lost

Post by Vizit0r »

i know this probem, trying to solve it.
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Post Reply