radj307 / ARRCON

Lightweight Source RCON client that works on Windows, macOS, & Linux.
GNU General Public License v3.0
190 stars 10 forks source link

[BUG] Connection lost #25

Open GlitchApotamus opened 9 months ago

GlitchApotamus commented 9 months ago

# System Information

OS: Windows Version: 3.3.7 Shell: Command Prompt withing Windows Terminal (Windows 11)

# Bug Description

I can connect to my server and run a command, then when I run a command again, I get disconnected with process exit code 1.

command:  save
error: [FATAL]   Socket Error:  Connection Lost!
          Function Name:         net::recv_packet()
          Socket Error Code:     0
          Socket Error Message:  The operation completed successfully.

[process exited with code 1 (0x00000001)]

# Reproduction Steps

Connect to server. Send command. Wait 10 seconds. Run command that fails out with error above.

radj307 commented 9 months ago

This is definitely a bug; I'm not sure what could be the cause, however.

v4 will include a log (#18) that should help in diagnosing this issue.

radj307 commented 9 months ago

Please try v4.0.0-pr1 and let me know if the problem is resolved.

GlitchApotamus commented 9 months ago

Please try v4.0.0-pr1 and let me know if the problem is resolved.

I will check this in due time. It'll be about a day for me to run some tests.

GlitchApotamus commented 9 months ago

@radj307 I've ran some test with pr1 and got a error log for you. Hopefully it helps.

Authentication Successful.
Use <Ctrl + C> or type "exit" to quit.
RCON@server> save
[no response]
RCON@server> save
[FATAL]   Failed to read packet header due to error: "End of file [asio.misc:2]"! Flushing the buffer.
radj307 commented 9 months ago

The End of file error occurs when the socket connection has been closed.

What game is this? Some games (Palworld is one recent example) implement RCON servers with fairly short inactivity timeouts that may cause something like this.
Does the save command usually show a response? [no response] is a misnomer; it's shown when the server's response is blank (which is another thing that should be fixed).

GlitchApotamus commented 9 months ago

You guessed it. Palworld. And Save is indeed supposed to respond with Save Complete.

EpicLPer commented 8 months ago

Yeah I was wondering the same with Palworld. You can only idle for roughly 10 seconds (at least it feels so) before the connection gets closed.
Maybe instead of just hard-cutting the connection ARRCON should have a setting that it tries to reconnect automatically when a command is issued and print that to the console. Or, if that would potentially break scripts, make it a command line flag (something like "ARRCON /autoreconnect").