BAPSicle/launch_standalone.py
2020-11-01 00:31:58 +00:00

24 lines
No EOL
536 B
Python

import multiprocessing
import time
from server import BAPSicleServer
def startServer():
# On Windows calling this function is necessary.
# Causes all kinds of loops if not present.
multiprocessing.freeze_support()
server = multiprocessing.Process(target=BAPSicleServer)
server.start()
while True:
time.sleep(2)
if server and server.is_alive():
pass
else:
print("Server dead. Exiting.")
sys.exit(0)
if __name__ == '__main__':
startServer()