-
Notifications
You must be signed in to change notification settings - Fork 57
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
Added restart button and fixed some bugs #18
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome. Thanks! I'll review tomorrow.
Didn't test enough. Fixed the gui_ants.py so the hooks get added every time a game starts. Also standardised |
Are you getting an AttributeError after
|
I saw that, but it was a heisenbug. The only reliable way I had to replicate it was to start |
It is happening straight away when starting gui.py |
Do you have multiple Ants Web Viewer windows open? |
Nope, only one window. I can do some debugging later today too. |
…ead to prevent uninitialized state
Might be a timing thing. I reordered it so that the GUI calls |
What browser/OS are you on. I am running a fresh copy of your fork of the GUI and the project and not able to make any state calls. You have everything pushed right? NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://localhost:8000/ajax/fetch/state'. |
That's very odd. I git clone'd my repo, then copied in ants/*.py except gui.py and state.py, and it works fine. I'm on Ubuntu, tested against Chrome/Firefox. Do you need me to upload the rest of the .py s? |
Can you shoot me an archive of your proj directory with the updated GUI to cschoen [at] berkeley.edu. I'll see if I can find any oddities. |
Done. I tar'd up a working copy with the project files and updated gui.py and assets/app.js. |
Hmm I think I managed to replicate the error. It seems to be a small timing bug where the player clicks 'Start game', and a POST request is made to the server to start and to get the state, but the server isn't ready yet and causes the request to fail. I added an initialised flag so that it keeps trying to get the state when it is unitialised and only throws an error when there's a network error despite it having been previously initialised. |
Can't find variable async line 111. |
Excellent work! Thank you. |
Hi Colin. I'm in your 61A discussion. I noticed that you made this and had Restart button as an active issue so I added the functionality. Also fixed a bug with
clearInterval(gui.interval)
, needed to bindthis
to the function call otherwisethis
would be the global window.