| | |
| | | pResult = pResult.read()
|
| | | if "PID" in pResult or "pid" in pResult:
|
| | | return " =======服务器已经开启,请再次确认服务器情况, EventServer.exe运行中"
|
| | | #os.system(r"call D:\ProjectServer\LaunchServerManager\正常开服.bat")
|
| | | #os.system(r"call C:\ProjectServer\LaunchServerManager\正常开服.bat")
|
| | | # system call会导致子进程占用父进程的文件描述符导致端口无法释放, 影响重启使用
|
| | | # 如果需要保持子进程持续长期运行的应该调用 subprocess.Popen(cmd, close_fds=True)
|
| | | cmd = r"D:\ProjectServer\LaunchServerManager\正常开服.bat"
|
| | | cmd = r"C:\ProjectServer\LaunchServerManager\正常开服.bat"
|
| | | subprocess.Popen(cmd, close_fds=True)
|
| | | return "open success"
|
| | | elif result == "close":
|
| | | # 记得关服后或者重启机器需自动启动服务器控制台
|
| | | os.system(r"call D:\ProjectServer\LaunchServerManager\正常关服.bat")
|
| | | os.system(r"call C:\ProjectServer\LaunchServerManager\正常关服.bat")
|
| | | return "close success"
|
| | |
|
| | | return
|