-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In gameapi.py when player becomes dummy a bad request occurs #149
Comments
When I search for that message I could not find that line. Not sure what is going on there. The 3 lines of code that I changed seems to work and does make it easier to continue after bidding without having to switch the hands around. Here is the diff
|
It is line 820 in https://github.com/lorserker/ben/blob/main/src/gameapi.py You are welcome to try on my server: http://ben.aalborgdata.dk:8080/api |
I like you update and will apply it as it seems to do the same (So it does not fix any errors, just more compact and more correct code) I just checked it does the same but switch the value of idx1 and idx2
|
Not sure why but I had old code. I did a full update and stashed the changes so I should be running from the main branch. start "TF2 Api internal :8085 (API)" python gameapi.py --config config\default_tf2_Short_imp_or_mp.conf --host 0.0.0.0 No samples after opening lead |
S7 is incorrect the card has to come out of the dummies hand not the declarer. When you switch seat you also have to swap the hand and dummy/declarer which is why I tried to create patch that would allow me to stay seated in South. |
You need to provide the full deal then. Ask BEN should not be able to play a card for dummy if you select dummy seat. Enter your seat and your hand - Bidding decides opening lead, and then the cards plyed decide who to play next. Ask BEN is primarily to test the API, and the API is used both at a playing site and I use it for about 60-100 boards a day at BBO |
Not sure I get the logic. Once our side is declarer BEN acts for both the declarer and dummy. The position just determines which hand is dummy and it is messy switching around when starting the card play. I do not think it will cause any issues just allowing the player to remain in his seat. For me the ask ben is the part I am using most. I might spend some time to improve the UI to make it easier to enter the cards and bids. I am still not getting past the sample after opening lead. Not sure why it is even checking as the opponents |
I think what you shuold look at is changing the logic for whos on play. But swithing that around and using number of cards played together with contract could be another way of doing it. All this should be done in gameapi, and not on the lower levels. You should be aware that when defending dummy can be either RHO or LHO, |
We have a Discord server if you are interested: https://discord.gg/uy8PWTtP I created this https://github.com/ThorvaldAagaard/bridge-with-ben some time ago, where it call NN to get the play and bid. It could be a fine template for creating a GUI, that calls the API instead. |
Thanks I have joined the discord. I will be continue to track down the 'No samples after opening lead' issue as I an now getting the error at other times. |
Try to describe the entire process, and I might be able to give you a hint of what to change. JBridge is using the API on thier own server, and you can play for free: https://play.google.com/store/apps/details?id=net.jbridge.gg&hl=da |
Code is updated, but still logically the same. The code is for finding the 2 hidden hands, so it is possible to create stats for these hands. These stats are sent to PIMC as constraints. |
Given this request
INFO Request: GET http://localhost:8085/play?user=Trevor&dealer=N&seat=S&vul=&ctx=--1SDb--2H------&hand=JT3.KJ9.K643.AKJ&tournament=mp&explain=true&dummy=74.AT84.Q9872.84&played=SK
INFO Response body: 400 BAD REQUEST b'{"error":"An error occurred: 'NoneType' object has no attribute 'set_hcp_constraints'"}\n'
Once that issue is resolved another bad request occurs
Request: GET http://localhost:8085/play?user=Trevor&dealer=N&seat=S&vul=&ctx=--1SDb--2H------&hand=JT3.KJ9.K643.AKJ&tournament=mp&explain=true&dummy=74.AT84.Q9872.84&played=SKS3S5
INFO Response body: 400 BAD REQUEST b'{"error":"An error occurred: Cardplay order is not correct ['SK', 'S3', 'S5'] 3 1"}\n'
I have a pull request I can post once the defect is reproduced.
I also plan to test under the following conditions
dealer is E and seat is W
dealer is S and seat is N
dealer is W and seat is E
The text was updated successfully, but these errors were encountered: