From 6e2ffb372540d0237e77f5b81f69db7a88d8cdf2 Mon Sep 17 00:00:00 2001 From: Thorvald Aagaard Date: Sun, 5 Nov 2023 18:18:16 +0100 Subject: [PATCH] Moved BBA so it is not being called on Mac --- README.md | 2 ++ src/appserver.py | 6 +++++- src/game.py | 6 +++--- src/gameserver.py | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fc1d6bfe..99a9a876 100644 --- a/README.md +++ b/README.md @@ -150,3 +150,5 @@ Below is a list of features which aren't implemented in this engine yet, but you howpublished = {\url{https://github.com/lorserker/ben}}, } ``` + +On Mac i use python3 and pip3 \ No newline at end of file diff --git a/src/appserver.py b/src/appserver.py index 358d74ee..a153b3d4 100644 --- a/src/appserver.py +++ b/src/appserver.py @@ -23,6 +23,7 @@ script_dir = os.path.dirname(os.path.abspath(__file__)) +@app.route('/') @app.route('/home') def home(): html = '

Play Now

\n' @@ -66,5 +67,8 @@ def delete_deal(deal_id): db.close() redirect('/home') +print(f'http://localhost:{port}/home') + +run(app, host='localhost', port=port, server='gevent', log=None) + -run(app, host='0.0.0.0', port=port, server='gevent') diff --git a/src/game.py b/src/game.py index 536cd321..fdbf8e6b 100644 --- a/src/game.py +++ b/src/game.py @@ -25,7 +25,6 @@ import human import bots import conf -from bba.BBA import BBABotBid from sample import Sample from bidding import bidding @@ -455,6 +454,7 @@ async def bidding(self): players = [] for i, level in enumerate(self.human): if level == 99: + from bba.BBA import BBABotBid players.append(BBABotBid(1,1,i,hands_str[i],vuln, self.dealer_i)) elif level == 1: players.append(self.factory.create_human_bidder(vuln, hands_str[i])) @@ -565,8 +565,8 @@ async def main(): # Default to version 1. of Tensorflow from nn.models import Models - - models = Models.from_conf(configuration, base_path.replace("\src","")) + print(base_path) + models = Models.from_conf(configuration, base_path.replace("/src","")) driver = Driver(models, human.ConsoleFactory(), Sample.from_conf(configuration, verbose), verbose) diff --git a/src/gameserver.py b/src/gameserver.py index 1908fb88..0a5f5225 100644 --- a/src/gameserver.py +++ b/src/gameserver.py @@ -108,7 +108,7 @@ def get_execution_path(): # Default to version 1. of Tensorflow from nn.models import Models -models = Models.from_conf(configuration, base_path.replace("\src","")) +models = Models.from_conf(configuration, base_path.replace("/src","")) print('models loaded')