This is a recreation of the original aoe2cm by pip with additional features such as snipe turns and user generated presets.
Age of Empires © Microsoft Corporation. Captains Mode for Age of Empires was created under Microsoft's "Game Content Usage Rules" using assets from Age of Empires II, Age of Empires III, and Age of Empires IV, and it is not endorsed by or affiliated with Microsoft.
cp presets.json.template presets.json
cp alerts.json.template alerts.json
npm install
npm run build
node build/server.js
Visit localhost:3000
then.
npm test
A preset defines the order and modes in which host and guest pick and ban civilisations.
A preset is simply a list of turns that is being processed turn by turn. The preset also has a name and defines the set of civilisations that can be picked, like AoC only or everything up to RotR.
A turn consists of an acting player (host, guest, or none for technical turns such as revealing hidden picks/bans) and an action.
The following actions are available:
These actions are usually executed by the users (Host & Guest).
select one of the civilisations for play
prevent the opponent or both players (depending on modifiers) from picking the selected civilisation in a future turn
Ban one of the opponent's picks
There are three values for Exclusivity: NONEXCLUSIVE
, EXCLUSIVE
, and GOBAL
.
A GLOBAL
ban means that neither player may pick the civilisation in the future,
an EXCLUSIVE
ban means that the player cannot ban the civilisation again in the future,
a NONEXCLUSIVE
ban means that the player can ban the civilisation again in the future,
but that makes no sense honestly, so don't use that.
A GLOBAL
pick means that neither player may pick the civilisation again in the future,
an EXCLUSIVE
pick means that the player cannot pick the civilisation again in the future,
a NONEXCLUSIVE
pick means that the player can pick the civilisation again in the future.
Hidden
A hidden pick or ban is not shown to the opponent or spectators until it is revealed by an admin REVEAL
action.
During a parallel turn, both players execute their respective action at the same time. The turn is over once both players have completed their respective action or have run out of time. To configure a parallel turn, create two turns and mark the first one as parallel.
These actions can only be executed by the server.
show all hidden picks to all players and spectators
show all hidden bans to all players and spectators; should be done after hidden bans before the next picks
show all hidden snipes to all players and spectators
reveal picks, bans, and snipes
Each action gets validated by the server before it is broadcasted. If one or more validations fail, an error is returned to the player and the action is not broadcasted.
VLD_000
: Draft is currently expecting actionsVLD_001
: Acting user is supposed to act according to presetVLD_002
: Action is expected according to preset
VLD_010
: Action is not permissible with that civilisation
If you would like to see this app in one of the languages in which it isn't translated yet, you are welcome to submit the translations – provided you are willing to volunteer to keep it up to date in the future as well 😁
You can make a copy of this file, translate it and
submit the new file with translations via a
PR (example here).
Or, share the file with hszemi
or jester_5115
on Discord.
de_DE
: hszemien_GB
: hszemies_ES
: walls_and_bridgesfr_FR
: phare_maciept_BR
: marciocolombiapl_PL
: nerfoxingaroundzh_CN
: heavenlychoruszh_TW
: ZeroCores#2180
Locally:
npm run build-client
rsync -avzP build/* aoe2cm:~/aoe2cm2/build
# or rsync -avzP build/* aoe2se:~/aoe2cm2/build for the staging environment
On the server:
git pull --rebase
./deploy.sh
To move all drafts older than X days to another folder, execute the following in data/current
:
for f in `find . -ctime +X`; do mv $f ../another-folder/; done
Generate a new password salted and hashed with bcrypt, e. g. using htpasswd:
$ htpasswd -nbB user password
user:$2y$05$Kqxufpc5Vawgbhmv8xf/..SrY2LvuPSerYcn/4HgkC5hjsOWXmp2e
Create or edit users.json
and add the username and hash as key-value pair.
The bcrypt implementation does not like the 2y format, simply replace the 2y at the beginning with 2b.
{
"user": "$2b$05$Kqxufpc5Vawgbhmv8xf/..SrY2LvuPSerYcn/4HgkC5hjsOWXmp2e"
}