Developing TicToe HTML5/Preparing the Server: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>Hendrik Brummermann |
imported>Hendrik Brummermann No edit summary |
||
| (8 intermediate revisions by the same user not shown) | |||
| Line 59: | Line 59: | ||
** <code> connected</code> |
** <code> connected</code> |
||
While it is possible to execute more methods here, this is not useful because we have not implemented any server code, yet. |
|||
Now we are going to create an account for testing. Please note: The password will be visible since it is just a method parameter. In the finished program there will be an user dialog for the password, with a hidden input field. |
|||
* '''<code> marauroa.clientFramework.createAccount("testuser", "password", "test@example.com");</code>''' |
|||
** <code> Account "testuser" created successfully.</code> |
|||
After logging into that account, the server will send us some information, including a list of all character belonging to our account. The default implementation of marauroa.clientFramework.onAvailableCharacterDetails() is quite smart: It will automatically create a character, if there is none. Furthermore it will automatically pick the first one. This behaviour suites out test just fine, we may redefine it at a later stage, through. |
|||
* '''<code> marauroa.clientFramework.login("testuser", "password");</code>''' |
|||
** <code> Previous Logins []</code> |
|||
** <code> ServerInfo ["tictoe", "TicToe"]</code> |
|||
** <code> onAvailableCharacterDetails: Object {}</code> |
|||
** <code> Character "testuser" created successfully.</code> |
|||
** <code> onAvailableCharacterDetails: Object { testuser={...}}</code> |
|||
** <code> Entering world</code> |
|||
If all goes well, the last message will be "Entering world". The world is obviously empty at this stage. The next chapter will go into details on how to define the content of the world on the server. |
|||