Skip to content

Latest commit

 

History

History
155 lines (106 loc) · 4.93 KB

ADVANCED.md

File metadata and controls

155 lines (106 loc) · 4.93 KB

About this file

This file contains various advanced hints and documentation for developers. A section may assume that its readers already has some familiarity with its subject. Don't expect to be able to understand everything here even after reading the friendlier documentation.

Freeciv-web and Freeciv

Freeciv-web uses a patched version of Freeciv's master branch. This makes it easier to get Freeciv-web related changes into Freeciv. It also makes it easier for Freeciv-web to take advantage of the newest Freeciv features.

Graphics, static help texts, rulesets and scenarios are extracted from Freeciv. Parts of The Freeciv-web client's Freeciv protocol support is auto generated from Freeciv's common/networking/packets.def.

The Freeciv server is responsible for running the game. It makes sure that the rules are followed. It handles the player's orders. It "rolls the dice" when randomness is involved. It keeps track of the game state and what the player is allowed to see.

The Freeciv server has other responsibilities too. It creates, starts and manages the AI players. It is responsible for the beginning of saving and the end of loading a game.

The AI

Freeciv-web uses the Freeciv AI. Most of it lives in the ai folder of Freeciv. More information about the Freeciv AI can be found at the Freeciv wiki. Freeciv has AI related introduction tasks.

Freeciv-web LongTurn

Activation of LongTurn games is handled by adding the server commands files: publite2/pubscript_longturn_*.serv

Rules

A collection of rules for Freeciv is called a ruleset. Freeciv-web doesn't support all the rules regular Freeciv can support. Rulesets with unsupported rules don't work properly with Freeciv-web.

The rulesets Freeciv-web currently uses comes bundled with Freeciv.

Upgrading Freeciv-web's Freeciv version

Freeciv-web's Freeciv version is set in freeciv/version.txt. The variable FCREV is set to the Git revision it should use. The latest version of Freeciv's master branch can be found in the Freeciv Git repository.

Freeciv version upgrade checklist

It is easy to break Freeciv-web by changing its Freeciv version. The difference between the two versions should therefore be carefully checked.

Summary

The new Freeciv version could have new bugs.

Freeciv-web patches may have been accepted.

Be careful when Freeciv changes bootstrap/freeciv.project configure.ac m4/ data/ common/networking/dataio_json.* common/networking/packets.def fc_version server/save*

Check: Freeciv commit log messages

Was a patch accepted into the new Freeciv version? Remove the patch file. Update apply_patches.sh.

Was (known) bugs introduced? Have a look at fixed bugs too if you upgrade to a version that isn't the most recent.

Check: bootstrap/freeciv.project

Does the project definition need an update?

Check: configure.ac m4/

Should the arguments prepare_freeciv.sh uses when it calls autogen.sh be updated?

Check: data/helpdata.txt

Did helpdata_gen.py successfully extract the new version?

Check: data/scenarios/

Has the bundled scenarios changed? Does the change conflict with Freeciv-web's modifications?

Check: data/civ2civ3

Was the ruleset format changed? Did the civciv3 rules change? Is Freeciv-web able to handle the modifications? Be aware that the client may have hard coded the old rule. (The classic ruleset and the webperimental ruleset are supposed to be web-compatible)

Check: data/

Was the tileset format changed? Does img-extract.py need an update?

Check: data/

Was any tag removed from a tileset? Does Freeciv-web use it?

Check: server/save*

Has there been changes to save game handling? Is there development version save game compatibility for format changes?

Check: common/networking/packets.def

Did a packet change? Does Freeciv-web send it? Should the sender change?

Does the server send it? Is it handled in packhand.js? Who uses the packet after it is handled?

Check: common/dataio_json.*

Does this change a field in a packet Freeciv-web sends or receives? Find its Freeciv-web users.

Check: fc_version

Has an enum gained or lost a value? Update the corresponding variables in Freeciv-web if they exist.

Is there a change to the meaning of a packet? Find its Freeciv-web users.