本文整理匯總了Python中pelita.simplesetup.SimpleServer.exit_teams方法的典型用法代碼示例。如果您正苦於以下問題:Python SimpleServer.exit_teams方法的具體用法?Python SimpleServer.exit_teams怎麽用?Python SimpleServer.exit_teams使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pelita.simplesetup.SimpleServer
的用法示例。
在下文中一共展示了SimpleServer.exit_teams方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: SimpleServer
# 需要導入模塊: from pelita.simplesetup import SimpleServer [as 別名]
# 或者: from pelita.simplesetup.SimpleServer import exit_teams [as 別名]
FORMAT = '[%(asctime)s,%(msecs)03d][%(name)s][%(levelname)s][%(funcName)s]' + MAGENTA + ' %(message)s' + RESET
logging.basicConfig(format=FORMAT, datefmt="%H:%M:%S", level=logging.INFO)
layout = (
""" ##################
#0#. . 2# . 3 #
# ##### ##### #
# . # . .#1#
################## """)
server = SimpleServer(layout_string=layout, rounds=200, bind_addrs=("tcp://*:50007", "tcp://*:50008"))
publisher = SimplePublisher("tcp://*:50012")
server.game_master.register_viewer(publisher)
subscribe_sock = server
tk_open = "TkViewer(%r, %r).run()" % ("tcp://localhost:50012", "tcp://localhost:50013")
tkprocess = subprocess.Popen([get_python_process(),
"-c",
"from pelita.ui.tk_viewer import TkViewer\n" + tk_open])
try:
print(server.bind_addresses)
server.register_teams()
controller = SimpleController(server.game_master, "tcp://*:50013")
controller.run()
server.exit_teams()
except KeyboardInterrupt:
tkprocess.kill()