chips-blockchain / pangea-poker Goto Github PK
View Code? Open in Web Editor NEWThis is the reference GUI for Pangea Poker, blackchain based decentralised game.
Home Page: https://chips.cash/
This is the reference GUI for Pangea Poker, blackchain based decentralised game.
Home Page: https://chips.cash/
If a log of each bet could be added in a text box down the bottom left corner of the display. So people can see a text log of each hand/bet played on the table. (by @NutellaLicka)
Add the log box from the original designs and display player actions in it.
If there are no prior bets, the first bet should be called bet
instead of raise
.
We should provide public URLs of the releases so players don't have to go through the cloning/installation process.
If one player goes All-In post-flop (and only post-flop) the opponent does not have time to preform any action, and the Show Down instantly begins.
See this video: https://share.getcloudapp.com/7KuygONE
And this recording from 00:20: https://share.getcloudapp.com/DOuvwWjp
It seems like that this is an issue with the backend.
Any first bet pre-flop, weather it is call or raise, results in FAILURE
on the player node that initiated the action.
Pastebin: https://pastebin.com/Qt4dq4Mv
Branches used:
master
at 0bb0701master
at sg777/bet@bcc864fAfter the opponent folds, the hole cards of the previous hand get dispalyed of the winner. This happens only when there was a previous hand that reached Show Down.
The issue might be that playerCards
does not get cleared properly.
The first hand plays just fine. During the second hand, however, DCV crashes with Bus error (core dumped)
every time when using the current test nodes.
There is an action in poker called Muck. It is essentially the same as a Folding, but it happens during the showdown and allows a player to not show their cards, therefore signaling that they have a worse hand and loose the pot.
Consider the following scenario:
River
1000
1000
Showdown
AKT23
AA
and has three of a kind (set)In this scenario, Player A has to act first and must show their cards. Player B has a worse combination of cards with two pair, therefore he can just "fold" their cards, which is called muck in this case. Note that he has the option to either muck or show, default setting usually being muck. PokerStars even has a Show/muck hand preferences option.
Had Player B had a better hand, they would have to show it in order to win the pot.
In live poker, a mucked hand is never shown, and although technichally could be requested to be shown, it is considered to be a huge briech of etiquette. In online poker, many of the poviders show mucked hand during replay or hand histroy, but not during the actual game.
How should the muck be handled?
My suggestion is to not to show mucked hands by default, but provide a hand history text file, where it will be available.
The front-end originally started naming players with 1
, as player1
. The backend however, starts counting from 0
, as player0
. This is causing some unnecessary and sometimes confusing code all around the app.
We should fix it and the frontend should begin counting form 0
to match the backend.
The backend should send a message to all the players informing the UI which player is currently active. The message should be sent at the same time the round_betting
method is being sent to the currently active player.
This will be very important to have for 2+ player tables. Also, it's currently blocking #17 and #20.
Currently, the app uses a theme.js
to handle theming. CSS variables might be a more appropriate and more dry solution.
Following the next hand after a player folds, the new holecards don't display at the GUI for some reason. The message is correctly received from the backend, just no GUI update.
For some reason, sometimes the opponent's cards don't show up during showdown.
Player 1 did not display Player's cards and vice versa.
The finalnfo
message was:
{
"method": "finalInfo",
"showInfo": {
"allHoleCardsInfo": [
[
"KS",
"8C"
],
[
"JD",
"10D"
]
],
"boardCardInfo": [
"5S",
"7C",
"JS",
"2H",
"7S"
]
},
"win_amount": 4,
"winners": [
1
]
}
In some cenarios, when one player goes All-In, the other cannot call it, because the button is not responding. Furhter investiagtion is needed.
In the above scenario, player1
went All-In before the flop and player2
called. Since there is only one player left with funds (as it is currently player_funds: [0, 200]
), it is impossible to do any more betting, therefore the showdown has to begin Pre-Flop.
finalInfo
has to be sent to the players before the flop. It is the equivalent of both players going All-In with equal stacks (eg. if it was player_funds: [0, 0]
).
If there was a third player who had chips (eg. player_funds: [0, 200, 200]
), then the betting round has to continue and we will have to create a side pot that the player1
cannot win. But that's only once we get pass heads-up.
Instead of going into the next hand straight away, is there a way to add a couple of seconds after the hand finishes, for people to digest who won the hand and with what cards.
Also, if a log of each bet could be added in a text box down the bottom left corner of the display. So people can see a text log of each hand/bet played on the table.
We will need a landing page that will display the available tables. Displaying the number of players on the table would be a nice to have, but it might entail some extra work on the back-end.
Tasks
The current README does not contain much information for either players or developers who'd like to contribute. I should spend some time to update it.
Currently the GUI expects the players to click on the player widget in order to join the table.
This is only a requirement if the game has not started yet. If it's already on and the backend returns Table is Filled
, it means that the player has already joined and the GUI should be in the appropriate state.
This raises some UX questions that need to be addressed in the future.
Once the game started, player1 goes all-in and when player2 also goes all-in, in the GUI everytime I'm getting the error as mentioned below:
Controls.tsx:88 Uncaught Error: Something is wrong with the betamount.
at handleButtonClick (Controls.tsx:88)
at onClick (Controls.tsx:177)
at HTMLUnknownElement.callCallback (react-dom.development.js:362)
at Object.invokeGuardedCallbackDev (react-dom.development.js:411)
at invokeGuardedCallback (react-dom.development.js:466)
at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:480)
at executeDispatch (react-dom.development.js:612)
at executeDispatchesInOrder (react-dom.development.js:637)
at executeDispatchesAndRelease (react-dom.development.js:743)
at executeDispatchesAndReleaseTopLevel (react-dom.development.js:752)
handleButtonClick @ Controls.tsx:88
onClick @ Controls.tsx:177
callCallback @ react-dom.development.js:362
invokeGuardedCallbackDev @ react-dom.development.js:411
invokeGuardedCallback @ react-dom.development.js:466
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:480
executeDispatch @ react-dom.development.js:612
executeDispatchesInOrder @ react-dom.development.js:637
executeDispatchesAndRelease @ react-dom.development.js:743
executeDispatchesAndReleaseTopLevel @ react-dom.development.js:752
forEachAccumulated @ react-dom.development.js:724
runEventsInBatch @ react-dom.development.js:769
runExtractedPluginEventsInBatch @ react-dom.development.js:914
handleTopLevel @ react-dom.development.js:5848
batchedEventUpdates$1 @ react-dom.development.js:24343
batchedEventUpdates @ react-dom.development.js:1463
dispatchEventForPluginEventSystem @ react-dom.development.js:5943
attemptToDispatchEvent @ react-dom.development.js:6059
dispatchEvent @ react-dom.development.js:5963
unstable_runWithPriority @ scheduler.development.js:815
runWithPriority$2 @ react-dom.development.js:12188
discreteUpdates$1 @ react-dom.development.js:24359
discreteUpdates @ react-dom.development.js:1486
dispatchDiscreteEvent @ react-dom.development.js:5926
Currently, the all-in showdown only works at the river. This should work on all other stages of the game as well.
We had some back end limitations, but it seems to have been solved.
Instead of having all 3 options (dealer/player1/player2) selectable at the start, maybe just prompt "Are you a Dealer or a Player?", then go into the next menu to add the appropriate IP data. For players, instead of selecting player 1 or 2, have the nodes connect and then select a seat, which then defines what player number they are.
Integrate Storybook for better visual testing.
Currently, the front-end is sending possibilities: [4]
even if the player goes All-In. When I fixed this and properly sent [6]
to the backend, the game stopped responding.
Scenario:
I am wondering how important it is to actually send possibilities: [6]
. Does that make any difference in the game? All-in can happen by calling or by raising or even by posting the blinds.
Therefore maybe we should just ignore this possibility and remain using raise
instead?
HTTPS is also more secure, and in order to go to production on the web, we would have to switch.
I would like to use netlify for continous deployment, but currently we are using ws
which only work on non-secure http
connections, and is not supported by Netlify.
In order to use https
, we need to use wss
.
Sometimes during the game, the active player highlighting does not update properly.
It would be great to get out from the browser and have a standalone app, in order for better window management when it comes to playing on multiple players.
2
The Raise button should show Raise to 4
, due tominRaiseTo
being 4
.
The Raise button showsRaise to 6
, due tominRaiseTo
being 6
.
Not sure why this is happening. Player1's first action to open with a bet of 2
is being interpreted by the backend as a raise (possibilities: [4]
) -- however, technically it is called a bet, because there are no prior bets in this betting round that the player can raise compared to.
I don't think we need to create a new backend message type for the possibilities
, raise should be fine, but the GUI should receive the proper number.
The game currently doesn't feature any sounds. For better UX and accessibility, we should add audio feedback to certain actions.
Some todos:
The timer functionality has been disabled. We should enable it again.
If one player folds during the River (the last boardCard
), the backend sends allHoleCardsInfo
for both of the players. This should not happen, hole cards should only be disclosed if all of the River bets get called, which is called the Show Down.
See this video from 00:54: https://i.norbert.dev/a534bf
The bet on the River does not get called, the allHoleCardsInfo
array gets filled up with the all players' cards. This should not be the behavior.
Currently, calculating the pot happens on the frontend. Recently, the pot
property has been added to the betting
messages, thus the pot should be calculated from the backend to avoid mistakes.
The player balances are currently all calculated at the front-end. Recently, the back-end began to send an array of balances, thus, we should also use this data to update the balances.
Currently, the balances get reset after each hand to 200, however, the front-end does not do this reset, which results in mismatching values.
@sg777#2257 there are two missing pieces for the Table Select feature to work:
1. The ability to check how many people are currently at the table before joining the table
This is important to know to which table the user can join to when she picks from the list. (https://share.getcloudapp.com/NQuv1qkg).
2. A way for the player node to know where the other players are sitting at the table
When the player joins the table, before sitting down to an available seat, we must update the GUI with all the other players currently sitting at the table. This way the player can know which seats are free and we can seat the player there.
A potential solution may be for both of the above is to have a method (eg. game
) that responds from the dcv
(or even from the player
) with the following info:
The Chat Box might have been properly implemented in the original Pangea Poker repo. We need to look into it and determine how it will be ported to the new GUI.
For a split second, the turn board card starts to flip. This is because we receive finalInfo
, but the allBoardCards
array is actually empty.
Currently, after a hand ends and the winner gets announced, the winner's stack does not get updated with the amount the winner won. The GUI should do the math until this has been solved via a property from the backend.
https://i.gyazo.com/65255770ee4d9ead5701b2793c81c0a0.png
The wording shows RAISE when I clicked ALL IN.
Sometimes possibilities
does not contain 4
for raise, but it should.
For example:
When the method: reset
is received for the players, the table should reset to it's initial state. There is an existing action called nextHand
that does the reset, it just needs to be linked with the new reset
method.
Each time we refresh the game when testing, the startup modal appears again an we have to do multiple clicks to start the game. Having query strings such as ?nodeType="dcv"?ip="192.168.0.1
in the URL would make the refresh a bit faster.
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.