User Tools

Site Tools


server:running_the_server:etc_crossfire_configuration_files

/etc/crossfire Configuration Files Directory

List of files found in the {prefix}/etc/crossfire configuration directory, alphabetically ordered; except for the settings file, which is to be found at the bottom due to it's many entries.
FIXME: These config files ought to have some .CFG or .CONF file_name.extension on day … :?:

ban_file

List of client IPs and user names to ban. Probably only useful if the user owns and deploys a dedicated IP.

Read also about the DM command banish .

dm_file

List of NAMES : PASSWORDS : HOSTS for Dungeon Masters.
Each field accepts the wildcard (*) as single char.
*:*:* should allow everyone from everywhere to gain DM status using any password.
The HOST field seems to be a full IPv4 address like 127.0.0.1 .

Entries that do not work :

  • *:*:127* to allow anyone from IPv4 address 127.* ( localhost )
  • *:*:127.*
  • *:*:127.0.0.*
  • *:*:127.*.*.*
  • *:*:local*
  • *:*:localhost
  • *:*A:* to allow anyone from anywhere with a password that matches 'A' at the end
  • *:A*:* to allow anyone from anywhere with a password that matches 'A' at the start
  • *:A*A:* to allow anyone from anywhere with a password that matches 'A' at the start and at the end
  • A*:*:* to allow every user whose player name starts with an 'A' with any passwort from everywhere
  • *A:*:* to allow every user whose player name ends with an 'A' with any passwort from everywhere
  • A*A:*:* to allow every user whose player name ends with an 'A' with any passwort from everywhere

:!: Not sure, when it comes to IPv6 addresses, which are not separated by a dot but by a colon …

exp_table

Large comma separated list of numbers to reach levels. The default ends at level 115. Just add some more numbers, and there will be higher levels :?: or delete some zeros at the end of thy numbers, and become a hero very fast.
:!: The sever has no possibility to be started with some -easy, -medium, -hard, -extreme parameters.

forbid

:!: This is a very misleading file. It says:

# This file lets you limit playing time. Example:
Mon 8-12
msg
Playing is forbidden during working hours.

Which would suggest, that players are getting a forced log out and new connections or login requests are denied with a message msg .
But instead the server will refuse to start if started in times of these entries. Exitcode would be -1 .

In static void init_startup(void) in server/server/init.c :

if (forbid_play()) { /* Maybe showing highscore should be allowed? */
      LOG(llevError, "CrossFire: Playing not allowed.\n");
      exit(-1);

The function forbid_play is to be found in server/server/server.c :

int forbid_play(void)
#if !defined(_IBMR2) && !defined(___IBMR2) && defined(PERM_FILE)
 
        if (!strncmp (buf, "msg", 3)) {
	    if (forbit)
		while (fgets (buf, MAX_BUF, fp))  /* print message */
		    fputs (buf, logfile);
	    break;
 
	} else if (sscanf (buf, "%s %d%*c%d\n", day, &start, &stop) != 3) {
	    LOG(llevDebug, "Warning: Incomplete line in permission file ignored.\n");
	    continue;
	}
 
        for (i=0; i< 7; i++) {
	    if (!strncmp (buf, days[i], 3) && (tm->tm_wday == i) && 
		(tm->tm_hour >= start) && (tm->tm_hour < stop))
		forbit = 1;
return forbit;
#else
 return 0;
#endif

This forbid file is defined in server/include/config.h : #define PERM_FILE “forbid” .
In opposite to the arch and maps files, it does not need an endmsg entry.

This forbid file would make “slightly sense” , when playing on a local machine by a script, that launches the server and afterwards the client to auto-connect to each other (with metaserver-support disabled at compile time) . In that way, parents could hinder their children at least to start-up the server at certain times. It does not interrupt a running server.
FIXME: The server should re-read the forbid file each hour like it does for the help files or the dm_file when help or the dm commands are invoked.

shutdown

Similar as for the forbid file : When the server at it's initial start finds that file in it's config folder, then it exits with an exitcode 1 , printing the content of that file .

The code for processing the shutdown file is also found in init_startup in server/server/init.c :

#ifdef SHUTDOWN_FILE
  sprintf(buf,"%s/%s",settings.confdir,SHUTDOWN_FILE);
  if ((fp = open_and_uncompress(buf, 0, &comp)) != NULL) {
    while (fgets(buf, MAX_BUF-1, fp) != NULL)
      printf("%s", buf);
    close_and_delete(fp, comp);
    exit(1);
  }
#endif

The SHUTDOWN_FILE variable is by default defined in server/include/config.h : #ifndef SHUTDOWN_FILE #define SHUTDOWN_FILE “shutdown” .
It could probably make sense to manually disable the SHUTDOWN_FILE definition before server compiling .

Example “shutdown” file message :

Shutdown File for Crossfire 1.10.0
Farewell, and have a nice time.
Bye Bye …

:!: Here is some kind of abuse possible, by people on a shared machine might just create such a shutdown file, to confuse, anger or trouble other users, who are playing Crossfire regularly on that machine.

Informational Files

Send to the client, when the client connects to the server.
Might print a lot of messages. They are easier to read, when the gtk+-1 client works in “split Windows” and-or “Splash Window” and-or “Popup Windows” modes that pop up an extra login-window.

motd

Motto Of The Day - simple text file.

news

Simple text file send to players when they connect. Headline functionality.

rules

Simple text file, that accepts some kind of html-formatting like [B]BIG[/B] .
Printed in the message window of the client, when it connects, and before the user logs on.

settings

Large file with around 40 possible entries; now has it it's own page here on the wiki : settings .

Known setting variable names, listed in alphabetical order . True and False entries are case insensitive read by strcasecmp
and may be replaced by their counterparts On and Off .
Function that processes those : load_settings in server/server/init.c .
if (!strcasecmp(cp,“off”) || !strcasecmp(cp,“false”))
if (!strcasecmp(cp,“on”) || !strcasecmp(cp,“true”))

  1. balanced_stat_loss TRUE | FALSE
  2. casting_time TRUE | FALSE
  3. create_home_portals TRUE | FALSE
  4. death_penalty_levels Integer 0 - 255
  5. death_penalty_percentage Integer 0 - 100
  6. dm_mail monster@monstermail.master
  7. dynamiclevel Integer 0 | >= 1 ( old : 0 | lesser equal 5 , see weather )
  8. explore_mode TRUE | FALSE
  9. fastclock Zero (0) or positive integer (1)
  10. item_power_factor FLOAT >= 0
  11. log_timestamp TRUE | FALSE
  12. log_timestamp_format Default: %y/%m/%d %H:%M:%S Year/Month/Day Hour:Minute:Second
  13. metaserver_comment Your comment, ex Test server port 11111
  14. metaserver_host Your.Hostname.Where or your IP
  15. metaserver_port Integer 1 - 65535, default 13326
  16. metaserver_server crossfire.real-time.com
  17. motd FILENAME, relative path, of the Motto-of-the-Day file
  18. no_player_stealing TRUE | FALSE
  19. pk_luck_penalty sint16 -100 - 100
  20. port Your Port Number, Integer 1 - 65535, since incl. v1.11.0, until at least v1.12 1 - 32765, with a check if user root and below 1024
  21. real_wiz TRUE | FALSE
  22. recycle_tmp_maps TRUE | FALSE
  23. resurrection TRUE | FALSE
  24. search_items TRUE | FALSE
  25. set_friendly_fire Integer 1 - 100
  26. set_title True | FALSE
  27. spell_encumbrance TRUE | FALSE
  28. spell_failure_effects TRUE | FALSE
  29. stat_loss_on_death TRUE | FALSE
  30. who_format String to print for the player command who , ex. %N %T%t%n Level %l Flags %h%d%a%b%n <%M>
  31. who_wiz_format String to print for the DM command who %N %T%t%h%d%b%nLevel %l <%m>(@%i)(%c)
  32. worldmapstartx Integer >= 0
  33. worldmapstarty Integer >= 0
  34. worldmaptilesizex Integer >= 1
  35. worldmaptilesizey Integer >= 1
  36. worldmaptilesx Integer >= 1
  37. worldmaptilesy Integer >= 1
server/running_the_server/etc_crossfire_configuration_files.txt · Last modified: 2018/03/05 14:36 by karl