• REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Fixed Max Wager Amount ignored when pressing Enter to submit

Status
Not open for further replies.

yeroulfella

New Member
Sportsbook
We've been fighting with the Max Wager Amount for some time, with mixed success, but one member in particular always managed to get past the limit even when set as a User Permission. The cause finally struck me today, almost by chance and it comes down to keyboard use.

Using the +/- buttons on the Place Wager form has always restricted the wager amount correctly but a member can type in whatever value they like. This is fair enough because nobody will want to click the buttons to wager 1000 credits when it goes up in steps of 5. The problem occurs when they submit their wager.

Everything works perfectly if you click the "Place Wager" button to submit your amount. The number in the textbox changes to the relevant limit as stated on the overlay and that is the number that is accepted.

However, if you just use your keyboard and press enter to submit your amount, it allows you to bet unlimited! The number in the textbox changes but has no effect, the number typed is still the one accepted.

Example:
An outcome is limited to a Maximum Wager Amount of 10 credits.

Scenario 1:
Member types 100 into the textbox and clicks 'Place Wager'
The number in the textbox changes to 10 and the overlay disappears
When the page refreshes, the "Total Staked" for that outcome has increased by 10, the member's wager is listed as 10 and their 10 credits have been taken from their account

Scenario 2:
Member types 100 into the textbox and hits Enter on his keyboard
The number in the textbox changes to 10 and the overlay disappears
When the page refreshes, the "Total Staked" for that outcome has increased by 100, the member's wager is listed as 100 and their 100 credits have been taken from their account

Scenario 3:
Member types 100 into the textbox and hits Tab on his keyboard
The number in the textbox changes to 10
Member hits Enter on his keyboard and the overlay disappears
When the page refreshes, the "Total Staked" for that outcome has increased by 10, the member's wager is listed as 10 and their 10 credits have been taken from their account

Pressing Tab evaluates the amount entered without submitting the form, but I doubt anyone would do that where only one field is required. Personally, I use the numberpad to type my numbers then Enter to submit so it was a long time before I realised that the limits actually worked when clicking the "Place Wager" button.

I suspect the only solution is an extra validation step once the form is submitted :suspicious:
 
I THINK I've already added some additional code that would prevent this (not released yet) based on another request/suggestion for penalizing cheaters. I'll take a more detailed look this weekend.
 
Just a quick update on this..... as you can see in the first image, there is Outcome Wager Limit and that limit is a Maximum Wager amount of $10,000.00.

Selection_438.png

In this second image, you can see that I manually typed in a LARGE amount that exceeds the Maximum of $10,000.00. If I hit the Place Wager button, the HTML will automatically change the large amount to the MAX amount and submit a wager for $10,000.00. HOWEVER, if you just hit ENTER, it will submit the LARGER NUMBER.

Selection_439.png

I've added validation to the post submit process to now prevent the wager from being processed if it exceeds the Max Wager Amount.

Selection_440.png
 
just to note, the same thing applies with the MINIMUM Wager amount limitation...

As you can see, this outcome has 2 Wager Limits (Min and Max). The MIN wager amount is $100.00 for this. If you manually change the amount and hit enter (bypassing the HTML Spin Box limitations), it will now throw an error (see below).

Selection_441.png


This is the error that will be thrown when trying to cheat the system by bypassing the Spinbox limitations.

Selection_442.png
 
Status
Not open for further replies.
Back
Top