edopro
edopro copied to clipboard
Add command line parameters
I added the following commands to the CLI. I also made it so the replay starts paused, it felt like it made more sense. When a new game is created there will be a log line with the game ID logged.
-q quit after the duel/replay ends
-n <nickname> set nickname used
-d <deck name> set the default deck
-replay <path> start the client with the replay screen open
-host <config> host a game with the specified config
-join <config> join a game with the specified config
-deckbuilder <config> open the deck editor with the default deck
Config definitions:
interface HostConfig {
host: string; // default: ""; ignored if online
port: number; // default: 7911; ignored if online
password: string; // default: ""
startHand: number; // default: 5
startLP: number; // default: 8000
drawCount: number; // default: 1
timeLimit: number; // default: 0
lfList: number; // default: 0; hash, 0 for the null list
duelParam: string; // bit field of params, 64
noCheckDeckSize: boolean; // default: false
noCheckDeckContent: boolean; // default: false
noShuffleDeck: boolean; // default: false
forbiddenTypes: number; // default: 0; bit field, 32
extraRules: number; // default: 0; bit field, 16
serverIndex: number; // default: -1; host online
}
interface JoinConfig {
host: string; // default: ""; ignored if online
port: number; // default: 7911; ignored if online
password: string; // default: ""
serverIndex: number; // default: -1; join online
gameId: number; // default: 0; only if online
}
interface DeckbuilderConfig {
testHand?: {
noOpponent?: boolean; // default: false;
dontShuffleDeck?: boolean; // default: false;
startingHand?: number; // default: 5;
duelParam?: number; // default: DUEL_MODE_MR5;
saveReplay?: boolean; // default: false;
}; // default: null; if present, open the test hand mode
}
I would have loved to use some std::variant but I've seen the project is currently on C++14, so I just kept it simple.