Continued network mode implementation
This commit is contained in:
parent
4f5227cd82
commit
f4680cc631
4 changed files with 126 additions and 38 deletions
|
@ -11,12 +11,12 @@ import threading
|
|||
|
||||
class NetworkThread(threading.Thread):
|
||||
dispatcher = {
|
||||
'quit': None,
|
||||
'boardsize': None,
|
||||
'clear_board': None,
|
||||
'komi': None,
|
||||
'play': None,
|
||||
'genmove': None
|
||||
'quit': do_quit,
|
||||
'boardsize': do_boardsize,
|
||||
'clear_board': do_clear_board,
|
||||
'komi': do_komi,
|
||||
'play': do_play,
|
||||
'genmove': do_genmove
|
||||
}
|
||||
|
||||
|
||||
|
@ -26,8 +26,33 @@ class NetworkThread(threading.Thread):
|
|||
self.socket = GTPSocket(socket)
|
||||
self.send_lock = threading.Lock()
|
||||
|
||||
GTPSocket.known_cmds.extend(dispatcher.keys())
|
||||
GTPSocket.known_cmds = GTPSocket.known_cmds & set(dispatcher.keys())
|
||||
|
||||
|
||||
def run(self):
|
||||
pass
|
||||
|
||||
|
||||
def do_quit(self, gtp):
|
||||
pass
|
||||
|
||||
|
||||
def do_boardsize(self, gtp):
|
||||
pass
|
||||
|
||||
|
||||
def do_clear_board(self, gtp):
|
||||
pass
|
||||
|
||||
|
||||
def do_komi(self, gtp):
|
||||
pass
|
||||
|
||||
|
||||
def do_play(self, gtp):
|
||||
pass
|
||||
|
||||
|
||||
def do_genmove(self, gtp):
|
||||
pass
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue