Add --disable-autohost argument to MultiMystery.py
- If present, MultiMystery will not automatically host the generated game
This commit is contained in:
		
							parent
							
								
									356ff91cfd
								
							
						
					
					
						commit
						a11bc58e7f
					
				| 
						 | 
					@ -17,6 +17,7 @@ import subprocess
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
import threading
 | 
					import threading
 | 
				
			||||||
import concurrent.futures
 | 
					import concurrent.futures
 | 
				
			||||||
 | 
					import argparse
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def feedback(text: str):
 | 
					def feedback(text: str):
 | 
				
			||||||
| 
						 | 
					@ -31,6 +32,9 @@ if __name__ == "__main__":
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ModuleUpdate.update()
 | 
					        ModuleUpdate.update()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        parser = argparse.ArgumentParser(add_help=False)
 | 
				
			||||||
 | 
					        parser.add_argument('--disable_autohost', action='store_true')
 | 
				
			||||||
 | 
					        args = parser.parse_args()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        from Utils import get_public_ipv4, get_options
 | 
					        from Utils import get_public_ipv4, get_options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -189,16 +193,17 @@ if __name__ == "__main__":
 | 
				
			||||||
                    for future in futures:
 | 
					                    for future in futures:
 | 
				
			||||||
                        future.result()  # make sure we close the zip AFTER any packing is done
 | 
					                        future.result()  # make sure we close the zip AFTER any packing is done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if os.path.exists(os.path.join(output_path, multidataname)):
 | 
					        if not args.disable_autohost:
 | 
				
			||||||
            if os.path.exists("BerserkerMultiServer.exe"):
 | 
					            if os.path.exists(os.path.join(output_path, multidataname)):
 | 
				
			||||||
                baseservercommand = "BerserkerMultiServer.exe"  # compiled windows
 | 
					                if os.path.exists("BerserkerMultiServer.exe"):
 | 
				
			||||||
            elif os.path.exists("BerserkerMultiServer"):
 | 
					                    baseservercommand = "BerserkerMultiServer.exe"  # compiled windows
 | 
				
			||||||
                baseservercommand = "BerserkerMultiServer"  # compiled linux
 | 
					                elif os.path.exists("BerserkerMultiServer"):
 | 
				
			||||||
            else:
 | 
					                    baseservercommand = "BerserkerMultiServer"  # compiled linux
 | 
				
			||||||
                baseservercommand = f"py -{py_version} MultiServer.py"  # source
 | 
					                else:
 | 
				
			||||||
            #don't have a mac to test that. If you try to run compiled on mac, good luck.
 | 
					                    baseservercommand = f"py -{py_version} MultiServer.py"  # source
 | 
				
			||||||
 | 
					                #don't have a mac to test that. If you try to run compiled on mac, good luck.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            subprocess.call(f"{baseservercommand} --multidata {os.path.join(output_path, multidataname)}")
 | 
					                subprocess.call(f"{baseservercommand} --multidata {os.path.join(output_path, multidataname)}")
 | 
				
			||||||
    except:
 | 
					    except:
 | 
				
			||||||
        import traceback
 | 
					        import traceback
 | 
				
			||||||
        traceback.print_exc()
 | 
					        traceback.print_exc()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue