Latest revision |
Your text |
Line 34: |
Line 34: |
| | | |
| That's it! You're up and running. Now you can play around with the website, crack open the code, and figure out how it all works. | | That's it! You're up and running. Now you can play around with the website, crack open the code, and figure out how it all works. |
− |
| |
− | == Using Test Mode ==
| |
− |
| |
− | If you look in api.py, there’s a line that says TestMode = False. By changing this to True, you’ll enable test mode which allows you to test your app offline using fake data.
| |
− |
| |
− | In test mode, the app won’t hit warzone.com APIs at all, and instead when the code tries to call an API, it will return fake data. This is useful while building your app since you can easily simulate players signing up and see how games get created with them. You can do things like simulate 500 players signing up to your tournament, which would be very time consuming to do by hand.
| |
− |
| |
− | There's also a page, at '''/test''' that helps invoke your code. This page is only accessible while TestMode is True. To access it, just visit /test/<lotid>. The easiest way to get there is to visit a lot in your browser, and change your browser's url from '''/lot/1234567''' to '''/test/1234567'''.
| |
− |
| |
− | When you’ve got everything working perfectly, all you have to do is set TestMode back to False and release!
| |
− |
| |
− | == Setting up Authentication ==
| |
− |
| |
− | The CLOT framework uses the [[CLOT Authentication]] system to ensure that players are who they say they are. By using this system, it ensures that players can only join or leave the CLOT themselves and can't, say, remove other people from a ladder.
| |
− |
| |
− | To set this up, it requires two additional configuration changes.
| |
− |
| |
− | # While logged into your main Warzone account, visit https://www.warzone.com/CLOT/Config. In the CLOT Redirect URL field, insert a path to your CLOT's '''login''' page. For example, http://clot-test.appspot.com/login
| |
− | # At the bottom of this same page, the site will tell you your CLOT Authentication URL. At the end of this URL is a number (the "p" parameter) that identifies your invite token. You need to insert this number into your python code in two places: join.py and leave.py.
| |
| | | |
| == Understanding the Code == | | == Understanding the Code == |
Line 75: |
Line 56: |
| * In the Google App Engine Launcher, there's a button named Logs. Click this to open up a window that shows information about what the app is doing. You can write to this log in the app by calling logging.info() | | * In the Google App Engine Launcher, there's a button named Logs. Click this to open up a window that shows information about what the app is doing. You can write to this log in the app by calling logging.info() |
| * test.py gives you a blank function that you can test code out in. You can activate it by hitting the "/test" page in your browser. | | * test.py gives you a blank function that you can test code out in. You can activate it by hitting the "/test" page in your browser. |
− |
| |
− | [[Category:CLOT]]
| |