CoreRCON icon indicating copy to clipboard operation
CoreRCON copied to clipboard

Connection from same machine

Open brikibsw opened this issue 8 years ago • 6 comments

I have same problem as described in issue #10 from @tgardner851

I can connect from remote machine and all work's good, but when I deploy to server where game is running connection never finish, it does'n throw exception but stalls. I have B3Bot running on the same machine as the game and it is working, B3Bot uses rcon as well to communicate with the game.

Game is COD4, and I say again everything works when game is accessed from another machine.

brikibsw avatar Jan 18 '18 11:01 brikibsw

I see now I neglected to post the solution to the problem. I suggest, instead of using your server's IP to connect, if you're on the same server use the local IP

IPHostEntry localhost = Dns.GetHostEntryAsync("127.0.0.1").Result;

p0457 avatar Jan 18 '18 23:01 p0457

Wow, thank you for following up @tgardner851!

Does this work for you, @brikibsw?

ScottKaye avatar Jan 18 '18 23:01 ScottKaye

It's not working when I provide "127.0.0.1" because server is running on public ip address, it just says "Connection refused 127.0.0.1:28974"

brikibsw avatar Jan 19 '18 11:01 brikibsw

Try other local IPs, maybe your internal network address (192.168.*.*)? That was generally my issue, the machine would query it's own public IP and then for whatever reason wouldn't connect. Using the local IP, your machine can target itself properly. I never really figured out why the public IP didn't work.

If you're running Windows Server, make sure your Firewall has exceptions for the port(s) you need.

p0457 avatar Jan 19 '18 14:01 p0457

I am running linux and on "eth0" is public ip and "lo" is 127.0.0.1, and firewall is down.

I have tried php code to connect to the game with same args (ip port pass) and it is working.

brikibsw avatar Jan 19 '18 15:01 brikibsw

For some reason on ConnectAsync() method, which is called from constructor, packet received type (RCON.cs#L160) is PacketType.Response and not PacketType.AuthResponse and for that reason it hangs indefinitely.

So maybe it is not that it's running on same machine but on linux?

brikibsw avatar Jan 22 '18 08:01 brikibsw