Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't submit draw first games #11

Closed
DarkDaskin opened this issue Dec 2, 2014 · 3 comments
Closed

Can't submit draw first games #11

DarkDaskin opened this issue Dec 2, 2014 · 3 comments

Comments

@DarkDaskin
Copy link
Contributor

When I try to submit a draw first game using the new canvas, the server responds with HTTP 500. The problem is that the gameid is parsed as "([^" while the page source actually contains the value as it should and your regex matches it correctly when executing it manually.

I tried to create a game 3 times without success (wasting my precious coins) until I figured out that this is the script issue. At the same time I can participate in other games and post drawings without problems.

Also parsing HTML with regex is generally a bad idea.

@grompe
Copy link
Owner

grompe commented Dec 2, 2014

I am sorry for the lost coins.

Firefox reorders HTML when getting it with document.body.innerHTML, and I didn't catch every case.

I'm aware parsing HTML with regular expressions is bad idea, but not all browsers have Javascript-exposed HTML parsing =(

@grompe grompe closed this as completed Dec 2, 2014
@DarkDaskin
Copy link
Contributor Author

Almost every browser which supports canvas also supports document.querySelector. The only exceptions are Firefox 3 and Opera 9, which do not support typed arrays, so the script would fail on replays anyway.

@grompe
Copy link
Owner

grompe commented Dec 2, 2014

Can't use that when getting HTML as plain text with AJAX.

Unless the response is temporarily embedded in the current document, which is messy - need to filter out scripts and styles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants