Whenever I run this script I get the following warning (though other than that the script works fine):
Unexpected message <RCONMessage 0 AUTH_RESPONSE 0B>
I use a shell script to launch this python script - which tells the shell script whether or not it's safe to shut down the game server:
#!/usr/bin/python3importsysimportrefromvalve.rconimportRCONiflen(sys.argv) !=4:
print("Usage: ./program.py <ip> <port> <rcon password>")
sys.exit(1)
ip=sys.argv[1]
port=int(sys.argv[2])
password=sys.argv[3]
SERVER_ADDRESS= (ip, port)
PASSWORD=passwordtry:
withRCON(SERVER_ADDRESS, PASSWORD) asrcon:
response=rcon.execute("status")
response_text=response.body.decode('ascii', 'ignore')
forlineinresponse_text.splitlines():
if"players :"inline:
forwordsin ['0 humans']:
ifre.search(r'\b'+words+r'\b', line):
print("The server is empty")
else:
print("The server has players")
exceptModuleNotFoundErrorase:
print("ModuleNotFoundError: "+str(e))
exceptExceptionase:
print("exception: "+str(e))- Python-valve Version: (0.2.1)
- Python Version: 3.6.8
- Operating System(s)/Platform(s): Ubuntu 18.04
- Game Server(s) and Version(s): Left 4 Dead 2
Whenever I run this script I get the following warning (though other than that the script works fine):
Unexpected message <RCONMessage 0 AUTH_RESPONSE 0B>I use a shell script to launch this python script - which tells the shell script whether or not it's safe to shut down the game server: