-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RCONNoAuthException when trying to use changelevel #270
Comments
Your first change would effectively make this check obsolete, because the The second one seems to be more appropriate, although I’m not entirely sure about all implications of that change. |
Have you ever seen a case where responsePacket was null though? Maybe that should just be removed from the condition and exit the loop when it's the case. |
There’s at least the one case where restarting a server leads to the same effect as There where quite a few issue reports about the various edge cases of restarting a server or changing a map. I’ll have to check them again to see if there’s still potential to improve the logic. |
The "Multi-packet response" workaround doesn't seem to be needed, at least HLSW doesn't use it from what I can see (tried with just "status"), and it's still able to print "cvarlist" correctly. |
To be honest, I never revisited the decision to implement a workaround once it worked for most use cases. It should be possible with TCP streams, but I think there have been problems in the past with that. |
Sometimes it also throws a "Connection reset by peer" exception, which is supposed to be "ConnectionResetException" according to your code, but it's really a "SteamCondenserException" because you check against the message string, which doesn't work in my language as the error message is in French. |
@anakin1 About HLSW: Did you mean that the result of calling |
Yes, that might have been wrong, although it did receive the full cvarlist without the workaround. |
I just had a look at the available options here. The original implementation just waits for a timeout. That works, but might lead to incorrect results on unstable connections (or low timeout settings). Additionally it has to wait for the timeout to every RCON request, even on single packet replies. Other variants like using non-blocking sockets, peeking into the stream and other variants did not really improve the situation here. The current implementation is stable and fast. Downsides are added packet overhead and more or less undefined behavior during server restarts, map changes etc. At the moment, I’ll think about sticking with the current one. Your suggested patch (i.e. checking for already read packets) seems valid, but may introduce other edge case bugs. |
Apparently there is a bug in steam-condenser-java when sending the changelevel command on a source server through rcon.
The rcon auth works fine, but it will always return an exception when sending the command:
From my understanding and debugging, what happens is:
this.rconSocket.getReply() calls receivePacket(4) which calls read(this.buffer). read returns -1, which makes receivePacket(4) return 0, and getReply return NULL.
It enters the condition:
And then return an exception, although the changelevel worked and it did get the response correctly.
That can most likely be fixed by modifying the condition to:
OR
Although it will still need to exit the loop with a break somewhere since responsePacket is null, otherwise it'll crash.
The text was updated successfully, but these errors were encountered: