Skip to content

Conversation

@n1xx1
Copy link

@n1xx1 n1xx1 commented Jun 13, 2024

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.

@n1xx1 n1xx1 marked this pull request as ready for review June 18, 2024 13:41
@n1xx1 n1xx1 changed the title Add command line parameters (WIP) Add command line parameters Jun 18, 2024
@n1xx1
Copy link
Author

n1xx1 commented Jun 21, 2024

I've added all the cli args I wanted to add and rebased to the latest commit.

@n1xx1
Copy link
Author

n1xx1 commented Dec 2, 2024

Any updates on this? Anything I might need to change?

@edo9300 edo9300 force-pushed the master branch 2 times, most recently from 96c64ac to 1ac735e Compare December 3, 2024 20:25
@edo9300 edo9300 force-pushed the master branch 2 times, most recently from 0bc55af to 0013228 Compare February 22, 2025 17:39
@arqalite
Copy link

Merged master into this branch on a local copy - minor conflicts but after resolving them it works perfectly.

Would love to have this in a future release, I currently need a way to start EDOPro in replay mode from the command-line. This will suffice in the meantime and I can update my copy as needed but having it in the official releases would be awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants