pushrax / node-rcon

A generic RCON protocol client for node.js
MIT License
134 stars 31 forks source link

Trouble with reconnections #41

Closed MrDrummer closed 2 years ago

MrDrummer commented 2 years ago

I'm running a Minecraft server with a RCON connection.

My goal is to allow for the MC server to restart and the program running RCON can reconnect happily without a process restart. I'm using a simple interval timer running every minute that will attempt a reconnection if it needs to.

My issue is that when I reconnect to RCON after a restart, the auth event isn't ran. And the Thread RCON Client /127.0.0.1 started response isn't outputted as an event either, meaning I have no way to detect if the reconnectionn worked correctly.

In testing, I also noticed that the hasAuthed flag isn't always accurate either. It doesn't seem to get set to false when losing connection.

Any help would be great!

MrDrummer commented 2 years ago

Got it - I used the connect event (which needs to be added to the docs :) )