mirror of
https://github.com/GoodStartLabs/AI_Diplomacy.git
synced 2026-04-29 17:35:18 +00:00
WIP: All bots connect and run
Signed-off-by: Tyler Marques <me@tylermarques.com>
This commit is contained in:
parent
298c5df74a
commit
69aa40be31
2 changed files with 31 additions and 67 deletions
|
|
@ -49,6 +49,7 @@ async def main():
|
|||
"""Main entry point with comprehensive error handling."""
|
||||
bots = {}
|
||||
args = parse_arguments()
|
||||
bot_tasks = set()
|
||||
|
||||
if not args.game_id:
|
||||
# No game id, lets create a new game.
|
||||
|
|
@ -67,11 +68,10 @@ async def main():
|
|||
)
|
||||
|
||||
for power, bot in bots.items():
|
||||
try:
|
||||
await bot.run()
|
||||
logger.info(f"Bot {bot.power} started")
|
||||
finally:
|
||||
await bot.cleanup()
|
||||
task = asyncio.create_task(bot.run())
|
||||
bot_tasks.add(task)
|
||||
logger.info(f"Bot_{bot.power_name} started")
|
||||
await asyncio.gather(*bot_tasks)
|
||||
|
||||
else:
|
||||
bot = SingleBotPlayer(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue