User Tools

Site Tools


server:running_the_server:positional_parameters

Running The Server : Startup Parameters

When the server is started, it recognizes the following parameters;
most of them have corresponding environment variables .

_say_server_help(){
cat >&1 <<EoI
The server does not recognize --long options.
$CMDNAME -help
Flags:
 -csport <port> Specifies the port to use for the new client/server code.
 -d          Turns on some debugging.
 +d          Turns off debugging (useful if server compiled with debugging
             as default).
 -detach     The server will go in the background, closing all
             connections to the tty.
 -h          Display this information.
 -log <file> Specifies which file to send output to.
             Only has meaning if -detach is specified.
 -mon        Turns on monster debugging.
 -o          Prints out info on what was defined at compile time.
 -s          Display the high-score list.
 -score <name or class> Displays all high scores with matching name/class.
 -v          Print version and contributors.
 -conf       Sets the configuration dir (settings, motd, etc.)
 -data       Sets the lib dir (archetypes, treasures, etc.)
 -local      Read/write local data (hiscore, unique items, etc.)
 -maps       Sets the directory for maps.
 -arch       Sets the archetype file to use.
 -regions    Sets the regions file to use.
 -playerdir  Sets the directory for the player files.
 -templatedir Sets the directory for template generate maps.
 -treasures  Sets the treasures file to use.
 -uniquedir  Sets the unique items/maps directory.
 -tmpdir     Sets the directory for temporary files (mostly maps.)
 -m          Lists out suggested experience for all monsters.
 -m2         Dumps out abilities.
 -m3         Dumps out artifact information.
 -m4         Dumps out spell information.
 -m5         Dumps out skill information.
 -m6         Dumps out race information.
 -m7         Dumps out alchemy information.
 -m8         Dumps out gods information.
 -m9         Dumps out more alchemy information (formula checking).
 -mt <name>  Dumps out list of treasures for a monster.
EoI
exit
}

Running the server

-csport

Syntax : -csport <portnumber>

The default port-number for the crossfire server is 13327 .
If you want to run it for another port, or even want to host multiple instances of the server, then it needs to assign a different port number for each instance that runs.

-detach

-d / +d

-mon

Configuration Files and Directories for the server

-arch

-conf

-data

-local

-log

-maps

-playerdir

-regions

-templatedir

-tmpdir

-treasures

-uniquedir

Requesting information from the server binary

-h

-o

-s

-score

-v

Should print out the version of the server binary.
That worked until at least v1.12.0 somewhat, but later servers would not print anything into the terminal, since some code changes in regards to the message stream between the server and the client had been changed, that made the usage of older clients on newer v1.50 servers and beyond partly unusable and the other way too.
The problem is the void version(object *op) in server/server/server.c , that is called by static void call_version(void) in server/server/init.c with the NULL parameter.
The function version is also used by the player command version and since v1.50 uses a draw_ext_info_format that apparently fails to check for the direction of the output. The older servers used the new_draw_info_format function. These *_draw_*_info_* functions are to be found in server/socket/info.c .

Example output :

  • This is Crossfire v1.11.0
  • This is Crossfire v1.12-beta
    • [NULL]

-m

  • -m Lists out suggested experience for all monsters. Output goes to stdout.
    • print_monsters()
    • common/info.c printf(“%-16s|%6” FMT64
  • -m2 Dumps out abilities. Output goes to stdout.
    • dump_abilities()
    • common/info.c printf(“%4d”, op→resist[i]);
  • -m3 Dumps out artifact information. Output is printed to logfile .
    • dump_artifacts()
    • common/treasure.c printf(logfile,“Artifact %-30s Dif
  • -m4 Dumps out spell information. Output is printed to stderr.
    • dump_spells()
    • server/spell_util.c fprintf(stderr, ”%s:%s:%s
  • -m5 Dumps out skill information. No Output Possible.
  • :!: NOT functional ! Code hooks are there, but no dump_skills() function.
  • Older servers just exit(0); , newer servers cleanup() with exit(0) .
  • -m6 Dumps out race information. Output goes to stderr.
  • dump_races()
  • server/init.c fprintf(stderr,“\nRACE
  • -m7 Dumps out alchemy information. Output goes to the logfile .
  • dump_alchemy()
  • common/recipe.c fprintf(logfile, “\n Formulae
  • -m8 Dumps out gods information. Output goes to stderr.
  • dump_gods()
  • common/holy.c fprintf(stderr,”GOD: %s\n”,god→name);
  • -m9 Dumps out more alchemy information (formula checking). Output is printed to the logfile .
  • dump_alchemy_costs()
  • common/recipe.c fprintf(logfile, “\n Formulae with %d ingredient%s
  • -mt <name> Dumps out list of treasures for a monster. Output is printed to the logfile .
  • server/init.c, calls dumpvalues = 10
  • init_beforeplay()
  • dump_monster_treasure(settings.dumparg)
  • common/treasure.c fprintf (logfile, “treasures for %s (arch:
server/running_the_server/positional_parameters.txt · Last modified: 2018/03/06 14:40 by karl