koraktor / steam-condenser

A multi-language library for querying the Steam Community, Source, GoldSrc servers and Steam master servers
https://koraktor.de/steam-condenser
Other
359 stars 65 forks source link

TFC RCON Cannot Connect #328

Closed daparker closed 4 years ago

daparker commented 4 years ago

Trying to use steam-condenser-java to connect to RCON on a vanilla TFC server. When using a GoldSrcServer instance, the client sends the challenge rcon packet but gets no response and throws a TimeoutException:

[main] INFO com.github.koraktor.steamcondenser.servers.sockets.QuerySocket - Sending data packet of type "RCONGoldSrcRequestPacket" java.util.concurrent.TimeoutException at com.github.koraktor.steamcondenser.servers.sockets.SteamSocket.receivePacket(SteamSocket.java:112) at com.github.koraktor.steamcondenser.servers.sockets.GoldSrcSocket.getReply(GoldSrcSocket.java:85) at com.github.koraktor.steamcondenser.servers.sockets.GoldSrcSocket.rconGetChallenge(GoldSrcSocket.java:194) at com.github.koraktor.steamcondenser.servers.sockets.GoldSrcSocket.rconExec(GoldSrcSocket.java:146) at com.github.koraktor.steamcondenser.servers.GoldSrcServer.rconExec(GoldSrcServer.java:181) at com.github.koraktor.steamcondenser.servers.GoldSrcServer.rconAuth(GoldSrcServer.java:156) at RconTest.main(RconTest.java:23)

When using a SourceServer instance, the client sends one packet and gets one packet back, and then throws a Connection Refused exception:

com.github.koraktor.steamcondenser.exceptions.SteamCondenserException: Connection refused at com.github.koraktor.steamcondenser.servers.sockets.RCONSocket.send(RCONSocket.java:80) at com.github.koraktor.steamcondenser.servers.SourceServer.rconAuth(SourceServer.java:147) at RconTest.main(RconTest.java:33) Caused by: java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:714) at sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:122) at com.github.koraktor.steamcondenser.servers.sockets.RCONSocket.send(RCONSocket.java:73) ... 2 more

The TFC server is listening on UDP ports 27015 and 123, no TCP ports. I tried both ports in the GoldSrcServer with the same result. A packet capture on the server shows the client traffic, so it's not blocked.

I can provide the test program's code and the packet captures is it's helpful. Thanks!

daparker commented 4 years ago

I was mistaken about port 123, that was actually ntpd listening on the same IP as HLDS. So the only port this TFC server is listening on is UDP 27015.

I also have a CS 1.6 server which I have been running for a long time, and I just confirmed that I also see this error when attempting an RCON connection to CS 1.6 as well. I swear that RCON on the CS server used to work via Steam Consenser, although I haven't had a reason to use it in several years.

daparker commented 4 years ago

This turned out to be an issue with the campus firewall in front of my servers. The admins had enabled application-based rules which mangled the traffic as it passed through. They reverted to simple port-based rules and RCON works as expected. Sorry for the false alarm.

koraktor commented 4 years ago

Sorry for not replying in time. But thanks for posting your solution which might help others.