Skip to content

Configuration

gusabary edited this page Dec 4, 2020 · 2 revisions

CMake options

If you are trying to build it from source code, when configuring CMake, you can specify some options:

  • -D BUILD_TEST=ON,enable this to build test
  • -D ENABLE_LOG=ON,enable this to build log

If you don't have to use test and log, it's recommended to disable that for short build time.

Arguments from command line

For uno executable, there are three ways to run it: -v, -l and -c

  • Specify -v to see current version of the binary.
  • Specify -l (and port) to start it as server side, under which condition you can specify -n to determine the number of players (default is 3), -f to indicate the path of configuration file and --log to indicate the path of log file (if enabled).
  • Specify -c (and IP + port) to start it as client side, under which condition you can specify -u to denote username and -f to indicate the path of configuration file.

Configuration file

Other than configuration from command line, you can also do it in a yaml file:

server:
  playerNum: 4
client:
  username: gusabary
  red: brightRed
  yellow: brightYellow
  green: brightGreen
  blue: brightCyan

Fields in server section will take effect when starting as server side while fields in client section will take effect when starting as client side.

playerNum and username fields have the same effect as -n and -u from command line. Note that configuration from command line take precedence over yaml file.

red, yellow, green and blue fields specify the color in UI. Possible values of them are listed below:

field possible values
red red, brightRed
yellow yellow, brightYellow
green green, brightGreen
blue blue, brightBlue, cyan, brightCyan

About how these colors differ and their display in different terminals, take Wikipedia for a reference.