jweigelt/swbf2admin

Failed to connect to RCON Server

RaTix opened this issue · 4 comments

RaTix commented

I can't seem to get the rcon setup at all. When I launch the server I get the following error.

Failed to connect to rcon server at '192.168.1.210:5509' (System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 192.168.1.210:5509
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at System.Net.Sockets.TcpClient.Connect(IPEndPoint remoteEP)
at SWBF2Admin.Runtime.Rcon.RconClient.Start())

The game runs and I can connect and all that, but none of the dashboard stuff shows up, like players, chat, server info, etc..

  • If you are running the gog version: make sure rcon- & gameport are set to the same value
  • Make sure the rcon port is accessible and not blocked by any firewall (you can whitelist 192.168.1.210 to prevent external connections)
  • Check if the gameserver is listening (tcp) on the selected rcon port (for example using "netstat -ab")

If the port is bound properly and it still fails to connect, increase RuntimeStartDelay in core.xml to something like 3000 (this also only applies for the gog version).

RaTix commented

Same port and the delay got it further along. Now I'm getting "Server refused login" errors.

[8/29/2019 10:47:54 AM] INFO | Launching server with args '/win /norender /nosound /autonet dedicated /resolution 640 480'
[8/29/2019 10:47:54 AM] DEBUG | Starting runtime management...
[8/29/2019 10:47:55 AM] DEBUG | [WEB] Got request 'http://192.168.1.210:5500/'
[8/29/2019 10:47:56 AM] DEBUG | [WEB] Got request 'http://192.168.1.210:5500/live/dashboard'
[8/29/2019 10:47:57 AM] INFO | Connected to rcon server at '192.168.1.210:5510'. Sending login...
[8/29/2019 10:47:57 AM] ERROR | Server refused login.
[8/29/2019 10:47:57 AM] ERROR | Failed to start runtime management (Exception of type 'SWBF2Admin.Runtime.Rcon.RconNotAuthorizedException' was thrown.)
[8/29/2019 10:47:58 AM] WARN | Server has crashed.
[8/29/2019 10:47:58 AM] DEBUG | Stopping runtime management...
[8/29/2019 10:47:58 AM] INFO | Automatic restart is enabled. Restarting server...
[8/29/2019 10:47:58 AM] INFO | Launching server with args '/win /norender /nosound /autonet dedicated /resolution 640 480'
[8/29/2019 10:47:58 AM] DEBUG | Starting runtime management...
[8/29/2019 10:47:58 AM] DEBUG | [WEB] Got request 'http://192.168.1.210:5500/'
[8/29/2019 10:47:59 AM] DEBUG | [WEB] Got request 'http://192.168.1.210:5500/live/dashboard'
[8/29/2019 10:48:01 AM] INFO | Connected to rcon server at '192.168.1.210:5510'. Sending login...
[8/29/2019 10:48:01 AM] ERROR | Server refused login.
[8/29/2019 10:48:01 AM] ERROR | Failed to start runtime management (Exception of type 'SWBF2Admin.Runtime.Rcon.RconNotAuthorizedException' was thrown.)
[8/29/2019 10:48:01 AM] DEBUG | [WEB] Got request 'http://192.168.1.210:5500/'
[8/29/2019 10:48:01 AM] WARN | Server has crashed.
[8/29/2019 10:48:01 AM] DEBUG | Stopping runtime management...

Make sure that an admin password is set and that it does not contain non-ASCII characters.

Please also check ./server/settings/ServerSettings.cfg and post the contents.
Are you running the GOG Galaxy BattlefrontII.exe?

RaTix commented

That pointed me in the right direction, Thanks. I got it working.

The password I had set in the ServerSettings.cfg was 25 chars long. Once I shortened it to 8, it worked no problem. Not sure what the limit is, but definitely shorter than 25, lol.

And yes, using GOG version.