Wikia

Freeciv

Watchlist Recent changes

FreecivWebClient

Contents

Freeciv Web Client Edit

The Freeciv web client is a version of Freeciv which can be played online in a web browser, and can be found on http://www.freeciv.net/

Freeciv web client
AndreasRAdded by AndreasR

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 source code can be found here: http://code.google.com/p/freeciv-forever/

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


The latest version can be found here: http://code.google.com/p/freeciv-forever/source/checkout Note that some of the information in this wiki page is outdated.


Development Edit

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


Java Edit

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.


Resin Application Server Edit

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


You will also need Log4J :

http://commons.apache.org/logging/apidocs/org/apache/commons/logging/impl/Log4JLogger.html

Log4J




Get those things, copy all the .jar files into your resin/lib directory.


resin will still give an error message about server-config.wsdd Maybe you can ignore it. Maybe you can copy/paste this stuff and figure out where to put it:

http://www.cppblog.com/wform/archive/2006/04/27/6365.aspx

I put it in about 6 different places, and it still complains. But it also works fine, afaict.


And, finally, do NOT start resin ./bin/httpd.sh as 'root' user. That would imply running 'civserver' as root, which will bomb out.

Compile Freeciv web client Edit

- SVN checkout webclient branch from here: http://code.google.com/p/freeciv-forever/source/checkout

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

Then run: make && make install


Freeciv web client architecure (outdated)
AndreasRAdded by AndreasR

Install webapp Edit

The web client is now build using maven... See http://code.google.com/p/freeciv-forever/source/browse/trunk/freeciv-web/README

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

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


Running the web client from the browser Edit

- Start Resin 'bin/httpd.sh start'

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

- If that fails, try this: http://localhost:8080/webapp/intro.jsp

- 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...

Debugging: Edit

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).

External Links Edit

Pages on Freeciv

Add a Page
566pages on
this wiki

Latest Photos

Add a Photo
572photos on this wiki
See more >

Recent Wiki Activity

See more >

Around Wikia's network

Random Wiki