toddw123 / RotMG_Clientless

Compatible with version X16.0.0
MIT License
11 stars 4 forks source link

Reconnect no longer working? #23

Closed Zeroeh closed 7 years ago

Zeroeh commented 7 years ago

Having issues with getting reconnect to work again. It used to when the bot only went to bazaar but I readded all the code for that and reconnect nno longer seems to work for the cloth bazaar. Whenever I send useportal near the bazaar portal the bot will dc and I get "error: the op completely successfully"

Any ideas?

toddw123 commented 7 years ago

What about it isn't working for you? Did you say you tried to redo the code for it? If you are using the code from the master branch, are you sending the useportal packet? You can also check out the modified reconnect I have in the lootbot branch I've been messing around with.

On Feb 23, 2017 8:55 PM, "Zeroeh" notifications@github.com wrote:

Having issues with getting reconnect to work again. It used to when the bot only went to bazaar but I readded all the code for that and reconnect nno longer seems to work for the cloth bazaar

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/toddw123/RotMG_Clientless/issues/23, or mute the thread https://github.com/notifications/unsubscribe-auth/AFEa2Q1h3l6XjYEbd7cD_RxqsnEZz1sCks5rflTFgaJpZM4MKzLS .

Zeroeh commented 7 years ago

Yeah, I'm sending the useportal packet when the bots are next to the bazaar portal. Maybe the server just doesn't want to send a reconnect packet... I'll look into the loot bot stuff and try connecting to a realm portal or something.

EDIT: Looked through the loot bot reconnect and looks like the bottom portion of the reconnect handler was commented out, no other changes? I'll try it when I'm off school.

toddw123 commented 7 years ago

I just tried to have the bot go in the bazaar portal as well and it returned a failure packet saying protocol error. Ill see what i can find out about this, seems strange.

The only real difference between the lootbot branch and master branch's reconnect is i moved it to a function and the bot will now try to reconnect if they get dc'd for some reason. As well as a little more error handling around that. But yeah looks like something about it isnt working.

toddw123 commented 7 years ago

LOL! I know whats happening. I had my debug output off because ive been running a bunch of clients, so all i was seeing on my screen when testing just now was the bot going to the bazaar portal, attempting to reconnect, then a few seconds later id get a failure packet.

Well, its because of the currentTarget. The currentTarget variable wasnt being reset when the bot entered a portal, so if you had your bot going to the bazaar portal at location 114,140...when it connected to the bazaar it would try to go to 114,140 again, but the bazaar is smaller and theres in your way depending on where you start at, so the bot would dc when it would run through a wall basically.

So as far as i can tell, nothing wrong with the reconnect :)

Zeroeh commented 7 years ago

It's the small things that always turn out to be the biggest troubles xD

toddw123 commented 7 years ago

Yup lol. So just add something like "this->currentTarget = { 0.0f,0.0f };" to the reconnect part of the code and youll be good!