Marauroa Chat Tutorial/HTML5 Client: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>Hendrik Brummermann
imported>Hendrik Brummermann
 
(13 intermediate revisions by the same user not shown)
Line 135: Line 135:
For this really simple chat client, we are only interested in chat objects. Therefore we skip this step for now and work directly on the perception event for new objects:
For this really simple chat client, we are only interested in chat objects. Therefore we skip this step for now and work directly on the perception event for new objects:


<source lang="javascript">
marauroa.perceptionListener.onAdded = function(object) {
marauroa.perceptionListener.onAdded = function(object) {
if (object.has("text")) {
if (object.has("text")) {
Line 161: Line 162:
}
}
}
}
</source>

Note: When putting all together, you need to merge the "ui" package from the previous section with the one defined here.


== Deployment ==
== Deployment ==


'''Sorry, this part is still a bit messy. We promise to make it as easy as the traditional Marauroa version in the future.'''
{{TODO|Explain the short cut version of deploying the webclient. At the moment there is only the documentation for the [[How to setup an experimental Stendhal HTML5 Environment?|Experimental HTML 5 Stendhal client]].}}

Instead of the official download version of marauroa, you need to download the current development version directly from git.

Check out Marauroa, Branch ''perception_json'' into a new project:
* File -> Import
* Git -> Projects from Git
* Clone URI: git://arianne.git.sourceforge.net/gitroot/arianne/marauroa
* Make sure that both "src" and "srcexternal" are marked as source code folders.

Follow the instructions from the previous pages to setup your Marauroa server, with these little changes:
* Add all the additional libraries to the classpath.
* Create a Run Configuration, that launches ''marauroa.server.net.web.WebSocketServer''

Create or reuse your server.ini
* Edit server.ini to add these lines, replacing "accountname" with the name of your account for testing:
<source lang="ini">
http_port=8080
debug_fake_web_username=accountname
</source>


* Launch the WebSocketServer run configuration
* Visit <nowiki>http://localhost:8080/chat.html</nowiki>
* Best to do this using firefox, with firebug extension installed (if you will be developing or studying the client)


== Next Steps ==
== Next Steps ==