Remove these advertisements by upgrading your account for only $5/month
extjspoker
on Wed 11 Mar, 2009 22:23:35 +0000
Hey again everyone,
The blog and the forums will hopefully be a hit, and this is where I’m hoping to get some help from all of you. Here is the current dilemma:
As you know when a hand has reached the river and the betting round has completed, there is a showdown of the players that are still involved in the hand. It is at this point that those player’s cards are flipped over to reveal their hand and the best hand takes down the pot.
What I am attempting to accomplish is to “delay” the start of the next hand to allow the players to view the results of the previous hand. Therein lies the problem...
When a player posts an action (CHECK, CALL, RAISE, etc...) the server response is the next action and is done immediately. There is almost no delay (other than ping times...but we will get into that in the future...). My question to all of you is this:
How do I program this “delay”?
Here are a couple of ideas that popped into my head:
1. Throw in a PHP sleep command after posting the final user’s action. I’m not sure this will work as I think it would delay the response for posting the user action for that particular user...
2. This is the way I think I want to go, just am not sure how I’d program it yet... Once the user posts the final action of the hand, the server sends the final hand results to each client while also starting a new hand behind the scenes. Once the final results have been shown to each client for x amount of time, the screen is “refreshed” with the next hand’s data.
What are your thoughts?
extjspoker
Thu 12 Mar, 2009
I so wasn’t thinking about that :)
Great idea!!
lynxus
Thu 12 Mar, 2009
Cool, hopefully it will work :)
Id try not to give too much control to the clientside javascript where its not needed though as something like firebug could possibly bypass some stuff.
Then again, thats something that can be fixed at a later date if it was to proove an issue.
I will check back fairly often and try and help where i can.
One other thing i was thinking may be an issue ( im sure you probably have resolved this anyway. )
When i tried to make the same type of thing you have done here with extjs is i needed a way to stop other clients from querying the database etc for card details. One way i thought of fixing this was to program the server side script to only hand out card details to the IP that is sitting in that seat.
Then again, Im sure you have probably thought of this already.
-G
Starbuckje
Sat 14 Mar, 2009
I am mostly programming PHP and MySql. What I would do is to add a field to the player table named for instance ‘delay’ and fill it with time() when the played hand is shown.
You can let the software then read out that field and show the new hand for instance 5 seconds later. (whatever time lapse is suitable)
Just an idea :P
Cazzper
Sun 10 May, 2009
Do it client side with Javascript. That would be the sollution that takes the least resources.
How is the project going by the way?
You do not have sufficient permissions to comment
Remove these advertisements by upgrading your account for only $5/month
Thu 12 Mar, 2009
Edit:
I was thinking a sleep would do it ok also.
Have you tried putting the sleep in the clientside javascript?
..