@@ -843,10 +843,24 @@ def register_launch():
843843 mac_addr_unhashed = ':' .join (['{:02x}' .format ((uuid .getnode () >> ele ) & 0xff )
844844 for ele in range (0 , 8 * 6 , 8 )][::- 1 ])
845845 mac_addr_hashed = hashlib .sha512 (str (mac_addr_unhashed ).encode ("utf-8" )).hexdigest ()
846- try :
847- r = requests .post ("https://launchtracker.raventeam.repl.co/pyoverlay" , json = {"hashedMacAddr" : mac_addr_hashed , "version" : VERSION })
848- except Exception as error :
849- logging .error (error )
846+ while True :
847+ try :
848+ paths_request = requests .get ("https://launchtracker.raventeam.repl.co/paths" )
849+ if paths_request .status_code != 200 :
850+ continue
851+
852+ target_to_post = ""
853+
854+ for line in paths_request .text .split ("\n " ):
855+ if line .startswith ("PyOverlay" ):
856+ target_to_post = line .split (" ~ " )[- 1 ]
857+
858+ r = requests .post ("https://launchtracker.raventeam.repl.co" + target_to_post ,
859+ json = {"hashedMacAddr" : mac_addr_hashed , "version" : VERSION })
860+ if r .status_code == 200 :
861+ break
862+ except Exception as error :
863+ logging .error (error )
850864
851865
852866if __name__ == "__main__" :
@@ -915,5 +929,5 @@ def register_launch():
915929 else :
916930 print (f"The log file { mc_log_path } was not found!" )
917931
918- launch_register_thread .join ()
919932 model = Model (mc_log_path , client )
933+ launch_register_thread .join ()
0 commit comments