hippich / Bitcoin-Poker-Room

Sources for Bitcoin Poker Room.
http://betco.in
Other
132 stars 90 forks source link

Proposed fix for issue #27 #118

Closed holic closed 12 years ago

holic commented 12 years ago

This is entirely untested, but the code was straightforward enough that this should fix (my understanding of) issue #27.

If I manage to claim the Bitcoin bounty for this fix, I'll be going after some of the other bounties. :)

holic commented 12 years ago

Updated with action button delays.

holic commented 12 years ago

I hate the position of that "Comment & Close" button.

betcoin commented 12 years ago

Wow. While there are few issues, very good start!

Here are issues: 1) missing ) before .show() at line 5109 2) button Fold do not work at all during pre-flop (i.e. clicking on it do not do anything) 3) button Fold shows dialog when you can check, but once you click Ok do not happens anything (probably same issues as 2) 4) We definitely need to implement edge case when action delay will cause timeout. I would say use actionDelay*2 as a cutoff line - if less then this left - do not use delayAction and send request straight to server.

My connection broke today again. Started it over again, but if it will fail again, I will upload file from office - it have much faster upload channel.

holic commented 12 years ago

Still struggling to get this virtual machine running. Bots are disappearing, sometimes it gets really slow, etc. Not sure what's up.

Were points 2 and 3 due to the lack of the parenthesis in 1 or did you fix that before testing the Fold button?

hippich commented 12 years ago

I fixed #1 (otherwise it fails to compile js) and after it it mostly work except Fold button.

After looking through your diffs, it looks like fold delayed action is missing send() function.

also it looks like it will fire confirm() after delay, not before (not sure about this).

holic commented 12 years ago

Fold does call send(). It passes 'Fold' as the action which will call send() after the delay assuming the canDelay call is truthy (the free check confirmation passed as the second argument, in this case).

It made more sense to open the confirmation window before the delay, but I can do it after the delay - that should fix the 3rd point.

hippich commented 12 years ago

Ah. You are right (regarding calling send()).. It confused me at first... not sure why it do not work then. Need to debug it.

holic commented 12 years ago

Got the fold button fixed. Any clues on where the global hand timeout is?

hippich commented 12 years ago

not really. need to play with debugger to find out. it should be somewhere available for sure, since it is used to animate time bar.

holic commented 12 years ago

All done!

hippich commented 12 years ago

Thank you for your commits! I will test these today and if everything is good, I will push it to master branch.

hippich commented 12 years ago

Sorry, but I found small glitch =)

When pressing Fold, dialog pop ups. But no matter what user click in this dialog, fold button become disabled. Should not become disabled (or change stasus abck to normal) if user click "Cancel" in confirm dialog.

And please return these temporal disable checkboxes =)

And while here - please change timeout to 750ms. 1.5s feels to long.

Hope that's all this time =)

holic commented 12 years ago

Fold confirmation issue fixed.

I actually misunderstood the checkboxes in my initial commit. They automatically uncheck themselves if/when the bet increases which negates the need to disable them too.

I decreased the action delay to 1s. It will feel faster than it was, but any less than that and it may be hard to react to. Feel free to adjust this yourself if it still doesn't feel quite right.

hippich commented 12 years ago

regarding checkboxes.... i though more about it. originally, what player reported - he click to check checkbox and in the same time it gets updated. so he wanted it to be disabled for a moment, so he could not check it right after update. And you code looked right (although, i did not test it).

holic commented 12 years ago

Well you have the code from my first commit, so feel free to patch :)