Building JCloisterZone from source
Don't hesitate to ask if there are any problems with the explanations below!
- Java SE 8 (JDK 1.8) as your
$JAVA_HOME
. - Maven in your
$PATH
. - gettext in your
$PATH
. - (optional) Eclipse
cd your-development-folder # Your own preference.
# Get farin's fork of WebSockets.
git clone https://github.com/farin/Java-WebSocket.git
cd Java-WebSocket
mvn install # Install the WebSockets fork version.
cd - >/dev/null
# Get JCloisterZone.
git clone https://github.com/farin/JCloisterZone.git
cd JCloisterZone
mvn package # Create the main and plugin jar files.
open build/JCloisterZone.jar # Execute the game.
- Clone the code from https://github.com/farin/JCloisterZone.git
- "Import..." the "JCloisterZone" project as an "Existing Maven project" from disk.
- Right click the project and select "Update project..." from the Maven menu.
- Run the project as a java application; select
JCloisterZone
(com.jcloisterzone.ui.JCloisterZone
) as the main class.
Maybe $JAVA_HOME
was not set correctly. Try running export JAVA_HOME="`/usr/libexec/java_home -v 1.7`"
before running mvn
in the same terminal window.
Maybe gettext wasn't in your $PATH
. Try installing/finding it on your harddrive, then add it to your path variable.
Helpers for more pleasant development and application debugging.
JCloisterZone supports various system properties to help development
config=foo.yaml
- use custom yaml configuration fileerrorLog=false
- don't save error log to filecloseGameConfirm=false
- close game withiu showing confirmation dialognick=Bob
- force default nickname for play onlineforceChat=true
- enable chat window for local gamesallowAiOnlyOnlineGame=true
- allows online game without human players (must be allowed also by server)allowHotSeatOnlineGame=true
- allows online game with multiple human players from one clientorg.slf4j.simpleLogger.defaultLogLevel=info
- set log leveltransparentScreenshots=true
- don't fill screenshot backgroundwindowSize=L
- overrides config valus (eg 1024x768, or special values L or R)
Command line example:
java -jar JCloisterZone.jar -Dconfig=debug.yaml -DerrorLog=false -Dorg.slf4j.simpleLogger.defaultLogLevel=info -DforceChat=true -DcloseGameConfirm=false -ea
Tweaked config.yaml
Use unpacked plugins from source.
plugins:
- plugins/classic
- plugins/rgg_siege
For immediately AI play comment delay option.
# ai_place_tile_delay: 250
Use debug options for quick and repeatable game setup with following possible options
debug:
# use some keys described below ...
Autosave before each AI play.
autosave: saves/_prerank.jcz
Skip game config dialog, player is name or AI class. You can comment just preset key to disable whole autostart.
autostart:
preset: default
players:
- Alice
- Bob
- com.jcloisterzone.ai.legacyplayer.LegacyAiPlayer
- com.jcloisterzone.ai.DummyAiPlayer
Developing expansion, don't bother with basic tiles. Override any expansion with own set definition.
tile_definitions:
BASIC: tile-definitions/basic-1card.xml
Force drawn tiles.
game_annotation:
tilePack:
className: "com.jcloisterzone.debug.ForcedDrawTilePack"
params:
drawOrder: ["BA.C", "BA.C", "BA.C"]
Final scoring can be forced by #END
at end of the params list.
draw:
# ... some tiles ...
- .
Experimental options
off_capabilities: [ Dragon, Fairy ]
area_highlight: figure
xgettext -k_tr -o po/keys.pot --from-code=utf-8 $(find . -name "*.java")
msgmerge -N -U po/ca.po po/keys.pot
msgmerge -N -U po/cs.po po/keys.pot
msgmerge -N -U po/de.po po/keys.pot
msgmerge -N -U po/el.po po/keys.pot
msgmerge -N -U po/en.po po/keys.pot
msgmerge -N -U po/es.po po/keys.pot
msgmerge -N -U po/fi.po po/keys.pot
msgmerge -N -U po/fr.po po/keys.pot
msgmerge -N -U po/hu.po po/keys.pot
msgmerge -N -U po/nl.po po/keys.pot
msgmerge -N -U po/it.po po/keys.pot
msgmerge -N -U po/ja.po po/keys.pot
msgmerge -N -U po/pl.po po/keys.pot
msgmerge -N -U po/ro.po po/keys.pot
msgmerge -N -U po/ru.po po/keys.pot
msgmerge -N -U po/sk.po po/keys.pot
rm po/*~
rm po/keys.pot
mvn package
cd build
chmod a+x JCloisterZone.jar
mkdir JCloisterZone
mv JCloisterZone.jar plugins JCloisterZone
JCZVER=3.4.3
tar cvzf JCloisterZone-$JCZVER.tgz JCloisterZone
7z a JCloisterZone-$JCZVER.7z JCloisterZone
zip -r -9 JCloisterZone-$JCZVER.zip JCloisterZone