diff --git a/AutismBotIngame/python/ingamefollowct.py b/AutismBotIngame/python/ingamefollowct.py index 98374763..ce6b4bbf 100644 --- a/AutismBotIngame/python/ingamefollowct.py +++ b/AutismBotIngame/python/ingamefollowct.py @@ -105,7 +105,7 @@ def kill_css_process(): time.sleep(15) print('preparing to launch game....') os.chdir(f"""/home/{who_am_i}/.steam/debian-installation/""") - subprocess.check_call("./steam.sh %s" % ("-applaunch 240 -textmode -textmessagedebug -novid -nosound -noipx -nojoy -noshaderapi -port 29072"), shell=True) + subprocess.check_call("./steam.sh %s" % ("-applaunch 240 -textmode -textmessagedebug -novid -nosound -noipx -nojoy -noshaderapi -port 29073"), shell=True) print('finished starting game') def bot_connect_ze(): @@ -128,8 +128,9 @@ def pairwise(it): if __name__ == '__main__': atexit.register(exit_handler) - local_ip = "127.0.0.1" - local_port = 48477 + hetzner_ip = "144.76.218.19" + local_ip = "127.0.0.1" + local_port = 48479 udp_external_ip = "164.132.201.173" buffer_size = 4096 #potentially not large enough? connection_issue_counter = 0; @@ -149,9 +150,7 @@ if __name__ == '__main__': #print(data) if not data: continue - if ip not in [local_ip, udp_external_ip]: - continue - if ip == udp_external_ip: + if ip == udp_external_ip or ip == local_ip: if messager_name in data: messager_name = "" response_msg = f"""say {messager_name} {data}""" @@ -160,6 +159,8 @@ if __name__ == '__main__': #needs mini delay to have time to write input to console time.sleep(0.1) writeCfgInput("") + if ip != hetzner_ip: + continue if data == "autismo connected": print('Bot connected!') connection_issue_counter = 0 diff --git a/AutismBotIngame/scripting/autism_bot_info.sp b/AutismBotIngame/scripting/autism_bot_info.sp index 23c86741..1154d6a0 100644 --- a/AutismBotIngame/scripting/autism_bot_info.sp +++ b/AutismBotIngame/scripting/autism_bot_info.sp @@ -215,14 +215,18 @@ public void OnMapStart() public void send_socket_msg(char[] query_msg, int len) { + char server_ip[generic_length]; + Format(server_ip, sizeof(server_ip), "164.132.201.173"); if (global_socket != INVALID_HANDLE && SocketIsConnected(global_socket)) - SocketSendTo(global_socket, query_msg, len, "127.0.0.1", 48477); //udp + SocketSendTo(global_socket, query_msg, len, server_ip, 48479); //udp } public void send_socket_msg1(char[] query_msg, int len) { + char server_ip[generic_length]; + Format(server_ip, sizeof(server_ip), "164.132.201.173"); if (global_socket != INVALID_HANDLE && SocketIsConnected(global_socket)) - SocketSendTo(global_socket, query_msg, len, "127.0.0.1", 48478); //udp + SocketSendTo(global_socket, query_msg, len, server_ip, 48480); //udp }