Quote:
Originally Posted by nosoop
|
Thanks.
I've compiled the
rcon tool, but I'm not sure if I'm using it correctly.
In this example, the rcon password is just a made up password.
Code:
root@testsvrchi:~# ./rcon --help
Usage: <programname> --rcon="<ip> <port> <rconpw> <cmd>"
Example: --rcon="127.0.0.1 27960 myrconpw devmap oasis"
root@testsvrchi:~# ./rcon --rcon="74.91.124.177 27015 rconpassword101 status"
Sending:
¦¦¦¦rcon rconpassword101 status
Could not receive.
Not sure if there's a more specific rcon command to query "players - humans" count, or if it's something that would have to be parsed from the status command.
Code:
] rcon status
hostname: Left 4 Dead 2
version : 2.1.5.2 7149 secure (unknown)
udp/ip : 74.91.124.177:27015 [ public same ]
os : Linux Dedicated
map : c2m1_highway
players : 1 humans, 0 bots (4 max) (not hibernating) (reserved 186000000a383ab)
Edit:
Haven't worked with c++ / c before, but it looks like the error is stemming from this returning -1:
Code:
n = recvfrom(sockfd, srline, MAX_SR_LINE, 0, NULL, NULL);
if(n < 0) {
close(sockfd);
return RC_RECV;
}
http://pubs.opengroup.org/onlinepubs.../recvfrom.html
Edit#2
Forgot to mention I tried the local IP as well
Code:
./rcon --rcon="127.0.0.1 27015 rconpassword101 status"