How to setup a Stendhal webclient development environment

From Arianne
Revision as of 18:09, 30 November 2014 by imported>Balaur (Import projects from git: the wizard steps)
Jump to navigation Jump to search
This article describes an experimental Websocket Environment. You are most likely looking for one of the articles linked from Configure a development environment (IDE) or Host a Stendhal Server instead.


The websocket support in Stendhal is still very basic, hardly enough for a client used by people dealing with /support. You cannot play with it.


This is a quick guide assuming you are using Eclipse:

  • Check out Marauroa, Branch perception_json into a new project
    • In Eclipse: (read-only checkout)
      • File -> Import
Step Configuration
Select Git / Projects from Git
Select Repository Source Clone URI
Source Git Repository URI: git://arianne.git.sourceforge.net/gitroot/arianne/marauroa
Branch Selection perception_json
Local Destination Directory: (local path on your computer)
Select a wizard to use for importing projects Import existing projects
Import projects
  • Configure your Stendhal project
  • Define a project dependency from Stendhal to Marauroa
    • Right-click on the stendhal project -> Properties
    • Project References
    • Check the marauroa project
  • Add all libraries *except* marauroa.jar to the classpath
    • Right-click on the stendhal project -> Properties
    • Java Build Path
    • remove marauroa.jar
  • Create a Run Configuration, *under the stendhal project*, that launches games.stendhal.server.StendhalServer
  • Make sure to use at least Java 7.
  • Add the project root folders of both Marauroa and Stendhal to the classpath
    • In the Run (or Debug) Configuration:
    • Select Classpath tab
    • Click on User Entries line
    • Click Advanced
    • Pick Add Folders, and click OK
    • Select both the marauroa and stendhal folders, and click OK
  • Create server.ini file if you don't already have one
    • under stendhal project, run games.stendhal.server.core.engine.GenerateINIT
  • Right click on the project root folder and select "Refresh" to update the file list
  • 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 StendhalServer run configuration
  • Visit http://localhost:8080/stendhal-text.html or http://localhost:8080/stendhal.html
    • Best to do this using firefox, with firebug extension installed or Chrome
    • You can add #charname to the end of the above urls. Note those characters must belong to the account name configured.
  • You can try the chat commands if near an NPC. Movement does not work right now, but you can /teleport the user