therewillbecode / poker-maison Goto Github PK
View Code? Open in Web Editor NEWThis project forked from consensysmesh/fae-demo
🂺 A Multiplayer Poker App Crafted with Haskell and React
This project forked from consensysmesh/fae-demo
🂺 A Multiplayer Poker App Crafted with Haskell and React
Right now there are two separate APIs the socket server for game logic and the Servant API for authentication logic.
Servant-pipes library should be used so that we can remove the socket server all together and just create a streaming endpoint in the Servant API.
An example can be seen here.
https://github.com/haskell-servant/servant/blob/master/servant-pipes/example/Main.hs
I just tried to spin this up for a few mates to play however after I place big and small blind it would just auto fold the user who took more than about 1 seconds.
I've tried looking through the code but not sure what is going on or why it is timing out so quickly.
Player state becomes undefined then just folds the user and moves on.
ERROR in ./app/components/Profile.js
Module not found: Error: Can't resolve './Counter.bs' in '/home/user/haskell-poker/client/app/components'
@ ./app/components/Profile.js 3:18-41
@ ./app/containers/ProfileContainer.js
@ ./app/components/App.js
@ ./app/containers/AppContainer.js
@ ./app/app.js
@ multi eventsource-polyfill webpack-hot-middleware/client?reload=true ./app/app.js
「wdm」: Failed to compile.
The type representing the Servant API endpoint for getting the User's Profile is here
The API Endpoint handler for fetching a user's profile is here
It would be a good idea to add some basic game stats such as Hands played, total profit/loss over career, Big Blind win rate etc. This way players can have more insight into how they are playing.
You will of course need to add new record fields to the UserProfile type.
We've talked in the past (dunno if you remember - 3 years ago maybe?).
Thanks for the great project :) Incoming wall of text, but I hope it is all to the point. I would like to migrate poker-maison to use a shared library for core poker type declarations (in src/Poker.Types) and for holdem game logic (src/Poker.Game.*). In general there is no need for each programmer to reimplement poker types and holdem (or any poker game) logic, and so if we get one solid and collaborated-upon set of libraries going, we'll have a better haskell-poker ecosystem! :)
My goal for these libraries is to be a good example of Haskell code. Nothing too fancy, but also nothing too simple, using the most common haskell features such as lens and mtl, so that an intermediate haskeller would feel comfortable and a beginner could come in without being overwhelmed.
I have already implemented the lion's share of the library, so I am here to check if you would be okay with migrating poker-maison to use my code. I have tested poker-maison with some of the migration, and it all looks good as far as I can tell.
poker-maison would use the new library for stuff like:
Some things are not yet implemented not yet support (but would be added at a later date, likely by using your logic, if that's okay with you):
Some notable differences:
data Action
= SitDown Player -- doesnt progress the game
| LeaveSeat' -- doesnt progress the game
| PostBlind Blind
| ShowHand
| MuckHand
| SitOut
| SitIn
| Timeout
| FromBetAction BetAction
I would be happy to do this migration all myself, and do so incrementally to make it more reviewable for you! I don't expect the patches to be too involved/arduous.
If you're open to the process, the only thing that I would ask from you would be whether I could make changes to the build system for poker-maison. In particular I was having trouble with having a good IDE setup, likely because of the following github issue haskell/haskell-language-server#1822. Would you be okay with a cabal based build instead of stack? The trade off would be slightly more verbose builds (you have to add each file to the .cabal file) which is definitely annoying, but as a reward we don't get an infuriating bug that means you have to persistently restart the IDE each time you edit library code while working on a test.
The process would overall look like this:
when i run using docker-compose up, application started but login/signup failed saying COSR, when login the login is going to some other ip 192.168.99.100
no clue why is it going to that ip the login request
The url with which i access is localhost:3000
Where is a way to add bots?
to XMLHttpRequest at 'http://1fd10247.ngrok.io/profile' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
How to disable CORS check?
after one gaming and exit i cannot sit to lobby, only see: Loading Game...
Have a monthly league where placing in a good position grants some kind of badge for players.
This would be a simple incentive for competitive play despite the lack of money involved.
Every time a player can act the payload for the new game state should include a list
of valid possible actions to remove the need to duplicate the action validation logic on the front end.
Status: 401 Unauthorized 0.020413627s
In everything wrote this, /register is working, but already wrote that
why on token generation write: Left KeySizeTooSmall ???
When I am making requests to create a new user or login, its trying to connect to a localhost url.. how do define the URL or or IP of the server?
Thanks!
Limit a player's max bet according to either their chip count or the next largest player in the hand's chipcount. Which ever is smaller.
This would prevent the current bug where a player can raise more than an opponents chip stack in a 1v1.
https://www.reddit.com/r/haskell/comments/qe0e4g/ann_pokerbase_a_fullydocumented_and_tested_poker/
Let me know if you want to try to migrate to use poker-base
. From what I remember of poker-maison
- the task should be pretty simple. poker-base
is basically only the core types (Rank
, Card
etc.)
Windows 10
Docker version 19.03.8, build afacb8b
Help!
PS C:\Users\DELL-XPS730x\Desktop\ten-poker-master> docker-compose up
Building server
Step 1/8 : FROM fpco/stack-build-small
---> 5aab45466769
Step 2/8 : RUN mkdir -p /app
---> Using cache
---> d464935159cc
Step 3/8 : COPY . /app
---> Using cache
---> c6b5323f889e
Step 4/8 : WORKDIR /app
---> Using cache
---> e93007258dd8
Step 5/8 : RUN apt-get update && apt-get install libpq-dev lzma-dev libpq-dev -yy
---> Using cache
---> c5fa874e24ac
Step 6/8 : RUN stack build --only-dependencies
---> Running in 7f5d4fb23662
Segmentation fault
ERROR: Service 'server' failed to build: The command '/bin/sh -c stack build --only-dependencies' returned a non-zero code: 139
PS C:\Users\DELL-XPS730x\Desktop\ten-poker-master>
The amount of tables in the game lobby should automatically adjust when the existing tables begin to fill up.
A sensible default would be to say that there should be at least two tables with free seats which can be taken.
Feel free to add this logic to the Lobby.hs file.
tuguldur@tuguldur-Inspiron-3537:~/Downloads/poker-maison-master/server$ stack run
poker-server-exe: Missing dbConnStr in env
CallStack (from HasCallStack):
error, called at src/Env.hs:46:18 in poker-server-0.1.0.0-1noFjA1fxcLE6B4gEAhgPz:Env
The game view in the UI presented to a player when sat at the table has a panel of buttons representing game actions.
Currently only two sets of buttons are shown for players depending whether they are sat in a game or not.
What we want is to only show buttons with actions which are valid for the given game state.
Here is an example. if a player has raised before you, then you will still be presented with a check button. As a check action isn't possible during a round after a previous player has raised in the game of poker. This button shouldn't be shown to the player in such a situation.
The front end has a Redux store which contains the game state as a JS object. So the task would be to add action validation functions and alter the game action panel React component so that only buttons with valid actions according to the rules of poker are shown to players.
To help you determine which actions are valid depending on certain game states then look at the ActionValidation.hs file on the back end. Essentially you would need to rewrite most of this logic in Javascript and put this validation logic in the selectors.js file on the front end.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.