lorserker / ben

a game engine for bridge
GNU General Public License v3.0
43 stars 31 forks source link

problems with getting gameserver and appserver running / need some help #141

Closed ThePokerDude closed 8 months ago

ThePokerDude commented 8 months ago

I'd like to get the game engine running to test the PIMC implementation. I know it's skill issues because I just start with Python and programmimg in general. but I'm not sure what I did wrong in the config and how to fix it.

PS D:\ben> cd src PS D:\ben\src> python gameserver.py Playing random deals or deals from the client models loaded Listening on port: 4443 2024-03-18 21:35:42 Got websocket connection connection handler failed Traceback (most recent call last): File "C:\Users\Andreas\AppData\Local\Programs\Python\Python311\Lib\site-packages\websockets\legacy\server.py", line 236, in handler await self.ws_handler(self) File "C:\Users\Andreas\AppData\Local\Programs\Python\Python311\Lib\site-packages\websockets\legacy\server.py", line 1175, in _ws_handler return await cast( ^^^^^^^^^^^ File "D:\ben\src\gameserver.py", line 167, in handler rdeal = game.random_deal(board_number) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: random_deal() takes 0 positional arguments but 1 was given

When trying to load a pbn instead PS D:\ben> cd src PS D:\ben\src> python gameserver.py python gameserver.py --boards D:\test.pbn usage: gameserver.py [-h] [--boards BOARDS] [--boardno BOARDNO] [--config CONFIG] [--verbose VERBOSE] [--port PORT] [--auto AUTO] [--playonly PLAYONLY] gameserver.py: error: unrecognized arguments: python gameserver.py PS D:\ben\src>

After clicking"play now" image

I get this

image

ChatGPT was not much of a help when trying to fix this ;)

ThorvaldAagaard commented 8 months ago

Here

 python gameserver.py python gameserver.py --boards D:\test.pbn

you repeated python gameserver.py

I will check the random deals, looks like an error I introduced yesterday

By the way i recommend using the appserver in frontend-directory, but to get that to use the same database for the result of deals you should start it like this

python appserver.py --db ..\gamedb
ThePokerDude commented 8 months ago

Thanks a lot - works :) Can I somehow display the statistics / candidates like in the demo?

ThorvaldAagaard commented 8 months ago

Yes, when you have played the board, you can save it for later review (it will be in the list the appserver shows)

gameserver should then probably be started without boards (it might work though)

ThePokerDude commented 8 months ago

Thanks a lot works perfectly fine.

ThorvaldAagaard commented 8 months ago

Great, you are welcome to update the documentation, where needed :-) I will close this issue now.