Skip to content

Commit

Permalink
Merge pull request 747929791#13 from Masaiki/master
Browse files Browse the repository at this point in the history
handle endgame
  • Loading branch information
747929791 committed Feb 10, 2021
2 parents 633d351 + 09aefba commit adba219
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ def MainLoop(isRemoteMode=False, remoteIP: str = None, level=None):
# create AI
if isRemoteMode == False:
print('create AI subprocess locally')
AI = Popen('python gui_main.py --fake', cwd='JianYangAI',
AI = Popen('python main.py --fake', cwd='JianYangAI',
creationflags=CREATE_NEW_CONSOLE)
# create server
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
Expand Down Expand Up @@ -723,10 +723,12 @@ def MainLoop(isRemoteMode=False, remoteIP: str = None, level=None):
break
aiWrapper.recvFromMajsoul()
if aiWrapper.isEnd:
results = [rv for r in zip(aiWrapper.finalScore, [-1]*4) for rv in r]
aiWrapper.send('owari="{},{},{},{},{},{},{},{}"\x00<PROF\x00'.format(*results))
aiWrapper.isEnd = False
connection.close()
if isRemoteMode == False:
AI.kill()
AI.wait()
aiWrapper.actionReturnToMenu()
break

Expand Down

0 comments on commit adba219

Please sign in to comment.