Recent changes Random page
GAMING
Gaming
 
WoWWiki
Halopedia
FFXIclopedia
Age of Conan
Warhammer Online
Grand Theft Wiki
See more...

FreecivWebClient

From Freeciv

Jump to: navigation, search

Contents

[edit] Freeciv Web Client

Freeciv web client
Freeciv web client

It uses a webservice which allows a browser to communicate with a civclient process on the server. The mapview is rendered using the HTML canvas element which is drawn upon using Javascript.

The latest release of the Freeciv Web Client can be tested here: http://www.freeciv-forever.com

(note that a lot of the technical details are out-dated in this article...)


[edit] Development

Contact: Andreas R. - <andrearo AT pvv.ntnu.no>


[edit] Java

Install Java JDK 6 http://java.sun.com/javase/downloads/index.jsp Make sure that java and javac are installed correctly, and that the classpath is setup correctly for Java and Resin.


[edit] Resin Application Server

resin-3.1.2 - http://www.caucho.com/download/ Use the example resin.conf as a starting point. http://svn.gna.org/viewcvs/*checkout*/freeciv/branches/freeciv-web/client/gui-web/doc/resin.conf




[edit] Compile Freeciv web client

- SVN checkout webclient branch like this: svn co svn://svn.gna.org/svn/freeciv/branches/freeciv-web/ freeciv

- Compile Freeciv client: First run: ./autogen.sh --enable-client=web

Then run: make && make install


Freeciv web client architecure
Freeciv web client architecure


[edit] Install webapp

1. Copy /client/gui-web/www-docs to /home/projects/freecivweb

2. Copy the main Freeciv source (everything!) to /home/projects/freecivweb/freeciv


[edit] Running the web client from the browser

- Start Resin 'bin/httpd.sh start'

- Point your web browser to http://localhost:8080

- Press 'Start new game'. Wait until you see that the civclient and civserver have been started (logging to message box at bottom of screen).

- Enter the '/start' command in the textfield at the bottom of the screen. Then the game will start. Wait...


[edit] Debugging:

If something goes wrong, see the Javascript console in Firefox.

- Testing the civclient: gdb --args civclient -a --debug=3 -- -NHTTPport 2000 -autostartserver

- WSDL for the Freeciv webservice: http://localhost:8080/axis/FreecivWebService.jws?wsdl

- Testing a Freeciv webservice (Java) method: http://localhost:8080/axis/FreecivWebService.jws?method=getFreecivState

- Testing the civclient C webservice:

http://localhost:2000/civwebserver

(If civclient is run with -NHTTPport 2000 parameter)

Always returns: "Sorry! I only speak with 'POST' method". Meaning that at least there is a server socket listening at port 2000.

-Logging: See resin/log/jvm-default.log (The civclient and civserver will log std.err and std.out here).

[edit] External Links

Rate this article:
Share this article: