 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
32 "physical ",
"magic ",
"fire ",
"electricity ",
"cold ",
"confusion ",
"acid ",
33 "drain ",
"weaponmagic ",
"ghosthit ",
"poison ",
"slow ",
"paralyze ",
34 "turn_undead ",
"fear ",
"cancellation ",
"deplete ",
"death ",
"chaos ",
35 "counterspell ",
"godpower ",
"holyword ",
"blind ",
"internal ",
"life_stealing ",
41 "physical",
"magic",
"fire",
"electricity",
"cold",
"confusion",
"acid",
42 "drain",
"weapon magic",
"ghost hit",
"poison",
"slow",
"paralyze",
43 "turn undead",
"fear",
"cancellation",
"deplete",
"death",
"chaos",
44 "counterspell",
"god power",
"holy word",
"blind",
"internal",
"life stealing",
50 "armour",
"resist magic",
"resist fire",
"resist electricity",
"resist cold",
51 "resist confusion",
"resist acid",
"resist drain",
52 "resist weaponmagic",
"resist ghosthit",
"resist poison",
"resist slow",
53 "resist paralyzation",
"resist turn undead",
"resist fear",
54 "resist cancellation",
"resist depletion",
"resist death",
"resist chaos",
55 "resist counterspell",
"resist god power",
"resist holy word",
56 "resist blindness",
"resist internal",
"resist life stealing",
62 "#FF15CD",
"#930C76",
"red",
"blue",
"#2CFFFF", NULL, NULL, NULL, NULL, NULL,
"green", NULL, NULL,
63 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
71 "physical",
"magic",
"fire",
"electricity",
"cold",
"confusion",
"acid",
72 "draining",
"weapon magic",
"ghosts",
"poison",
"slow",
"paralyze",
73 "turn undead",
"fear",
"cancellation",
"depletion",
"death attacks",
"chaos",
74 "counterspell",
"god power",
"holy word",
"blinding attacks",
"internal",
75 "life stealing",
"disease"
143 .log_callback =
nullptr,
148 .localdir = LOCALDIR,
176 .who_wiz_format = { 0 },
181 .meta_server = { 0 },
184 .meta_comment = { 0 },
189 .worldmaptilesizex = 0,
190 .worldmaptilesizey = 0,
192 .emergency_mapname =
nullptr,
196 .item_power_factor = 1.0,
203 .no_player_stealing = 1,
204 .create_home_portals = 0,
205 .personalized_blessings = 1,
206 .pk_max_experience = 5000000,
207 .pk_max_experience_percent = 10,
208 .allow_denied_spells_writing = 0,
209 .allow_broken_converters = 0,
211 .log_timestamp_format =
nullptr,
212 .starting_stat_min = 3,
213 .starting_stat_max = 18,
214 .starting_stat_points = 85,
215 .roll_stat_points = 115,
217 .special_break_map = 1,
218 .disabled_plugins = { },
219 .ignore_plugin_compatibility = 0,
220 .account_block_create = 0,
221 .account_trusted_host =
nullptr,
224 .collector_hooks = {},
225 .ignore_assets_errors = 0,
226 .assets_tracker =
nullptr,
227 .fatal_hook =
nullptr,
228 .stat_file =
nullptr,
282 fp = fopen(filename,
"r");
284 while (fgets(tmpbuf,
MAX_BUF-1, fp)) {
285 if (tmpbuf[0] ==
'#')
289 tmpbuf[strlen(tmpbuf)-1] = 0;
292 }
else if (online == 1) {
294 }
else if (online == 2) {
303 LOG(
llevError,
"Online read partial data from %s\n", filename);
350 LOG(
llevError,
"Assets errors, please fix and restart.\n");
365 cp = getenv(
"CROSSFIRE_LIBDIR");
368 cp = getenv(
"CROSSFIRE_LOCALDIR");
371 cp = getenv(
"CROSSFIRE_PLAYERDIR");
374 cp = getenv(
"CROSSFIRE_MAPDIR");
377 cp = getenv(
"CROSSFIRE_UNIQUEDIR");
380 cp = getenv(
"CROSSFIRE_TEMPLATEDIR");
383 cp = getenv(
"CROSSFIRE_TMPDIR");
406 setvbuf(
logfile, NULL, _IOLBF, 0);
497 LOG(
llevError,
"Unable to continue without initial map.\n");
502 LOG(
llevError,
"Legacy map must have a 'slaying' field!\n");
507 LOG(
llevError,
"Can not find object of type MAP subtype MAP_TYPE_DEFAULT.\n");
508 LOG(
llevError,
"Are the archetype files up to date? Can not continue.\n");
537 static int has_been_done = 0;
545 fp = fopen(filename,
"r");
553 if (fscanf(fp,
"%lu", &
todtick) == 1) {
557 LOG(
llevError,
"Couldn't parse todtick, using default value 0\n");
573 int mess = -1,
level;
574 int mode = 0, total = 0;
578 if (*
buf ==
'#' || *
buf ==
'\0')
587 cp =
buf + strspn(
buf,
" \t");
589 if (strncmp(cp,
"TYPE:", 5) == 0) {
590 p = strtok(
buf,
":");
591 p = strtok(NULL,
":");
607 p = strtok(
buf,
"=");
609 p = strtok(NULL,
"=");
617 }
else if (mode == 2) {
618 p = strtok(
buf,
"=");
620 p = strtok(NULL,
"=");
628 }
else if (mode == 3) {
629 p = strtok(
buf,
"=");
631 p = strtok(NULL,
"=");
643 LOG(
llevDebug,
"attackmsg %s: %d messages in %d categories\n", filename, total, mess+1);
void init_globals(void)
Initialises all global variables.
void init_objects(void)
Sets up and initialises the linked list of free and used objects.
static void init_dynamic(void)
Initializes first_map_path from the archetype collection, and check that some required archetype actu...
const char * mapdir
Where the map files are.
#define DEATH_PENALTY_LEVEL
#define SPELL_ENCUMBRANCE
long nrofartifacts
Only used in malloc_info().
player * first_player
First player.
struct Settings settings
Server settings.
uint16_t emergency_y
Coordinates to use on that map.
struct Statistics statistics
Merged spell statistics.
@ llevError
Error, serious thing.
static void init_emergency_mappath(void)
This loads the emergency map information from a .emergency file in the map directory.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
int of_close(OutputFile *of)
Closes an output file.
FILE * of_open(OutputFile *of, const char *fname)
Opens an output file.
mapstruct * ready_map_name(const char *name, int flags)
Makes sure the given map is loaded and swapped in.
char first_map_path[MAX_BUF]
The start-level.
const char *const spellpathnames[NRSPELLPATHS]
Perhaps not the best place for this, but needs to be in some file in the common area so that standalo...
char first_map_ext_path[MAX_BUF]
Path used for per-race start maps.
const char * datadir
Read only data files.
unsigned long todtick
Game world time, in in-game hours.
void init_attackmess(BufferReader *reader, const char *filename)
Initializes the attack messages.
#define MAPDIR
These defines tells where, relative to LIBDIR, the maps, the map-index, highscore files and directori...
#define MOTD
Defining MEMORY_DEBUG disables Crossfire's object allocator, which allocates OBJ_EXPAND objects at a ...
#define UNIQUE_DIR
Directory to use for unique items.
static void init_clocks(void)
Initializes the gametime and TOD counters Called by init_library().
char * name
Shortend name of the region as maps refer to it.
void clear_friendly_list(void)
Totally clear the friendly list.
void assets_free()
Free all assets-related memory.
This is used for various performance tracking statistics, or just how often certain events are done.
std::vector< materialtype_t * > materials
int ignore_assets_errors
If set then go on running even if there are errors in assets.
AssetsManager * getManager()
void init_stats()
This loads statistic bonus/penalties from the stat_bonus file.
void i18n_init(void)
Initializes the i18n subsystem.
char * longname
Official title of the region, this might be defined to be the same as name.
#define DEATH_PENALTY_RATIO
void write_todclock(void)
Write out the current time to the file so time does not reset every time the server reboots.
long nrofallowedstr
Only used in malloc_info().
void init_block(void)
initialises the array used by the LOS routines.
#define ARMOR_SPEED_IMPROVEMENT
static void init_environ(void)
Initializes values from the environmental variables.
#define SPELLPOINT_LEVEL_DEPEND
object clone
An object from which to do object_copy()
const char * logfilename
Logfile to use.
sstring add_string(const char *str)
This will add 'str' to the hash table.
mapstruct * first_map
First map.
char * msg
The description of the region.
long trying_emergency_save
True when emergency_save() is reached.
char * jailmap
Where a player that is arrested in this region should be imprisoned.
const char *const change_resist_msg[NROFATTACKS]
These are the descriptions of the resistances displayed when a player puts on/takes off an item.
long nroferrors
If it exceeds MAX_ERRORS, call fatal()
#define ARMOR_SPEED_LINEAR
#define ARMOR_WEIGHT_REDUCTION
#define ARMOR_MAX_ENCHANT
#define MAP_TYPE_LEGACY
These are map subtypes.
This represents all archetypes for one particular object type.
const char *const resist_save[NROFATTACKS]
Attack types.
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
FILE * logfile
Used by server/daemon.c.
void delete_map(mapstruct *m)
Frees the map, including the mapstruct.
#define TMPDIR
Your tmp-directory should be large enough to hold the uncompressed map-files for all who are playing.
Chaos_Attacks ATTACKS[22]
Some local definitions for shuffle_attack().
void fatal(enum fatal_error err)
fatal() is meant to be called whenever a fatal signal is intercepted.
const char *const resist_plus[NROFATTACKS]
Attack types to show to the player.
#define MAX_BUF
Used for all kinds of things.
size_t strlcpy(char *dst, const char *src, size_t size)
Portable implementation of strlcpy(3).
const char * playerdir
Where the player files are.
#define FREE_AND_CLEAR_STR(xyz)
Release the shared string, and set it to NULL.
attackmess_t attack_mess[NROFATTACKMESS][MAXATTACKMESS]
#define ARMOR_WEIGHT_LINEAR
#define STAT_LOSS_ON_DEATH
char * emergency_mapname
Map to return players to in emergency.
std::vector< region * > all_regions
#define SET_FRIENDLY_FIRE
void init_library(void)
It is vital that init_library() is called by any functions using this library.
const char *const attacktype_desc[NROFATTACKS]
Short description of names of the attacktypes.
#define FREE_AND_CLEAR(xyz)
Free the pointer and then set it to NULL.
void init_hash_table(void)
Initialises the hash-table used by the shared string library.
const typedef char * sstring
void free_experience(void)
Frees experience-related memory.
void init_experience(void)
This loads the experience table from the exp_table file.
#define RESET_LOCATION_TIME
By selecting the following, whenever a player does a backup save (with the 'save' command),...
void free_globals(void)
Cleans all memory allocated for global variables.
#define SPELL_FAILURE_EFFECTS
static void init_defaults(void)
Initialises global variables which can be changed by options.
#define BALANCED_STAT_LOSS
const char *const resist_color[NROFATTACKS]
Colors to add to the resistances for media tags.
#define PERMANENT_EXPERIENCE_RATIO
artifactlist * first_artifactlist
First artifact.
#define MAP_TYPE_DEFAULT
If no map is specified, where character starts.
archetype * get_archetype_by_type_subtype(int type, int subtype)
Retrieves an archetype by type and subtype.
const char * templatedir
Directory for the template map.
#define PLAYERDIR
If you want the players to be able to save their characters between games, define SAVE_PLAYER and set...
archetype * empty_archetype
Nice to have fast access to it.
void assets_collect(const char *datadir, int what)
Collect all assets from the specified directory and all its subdirectories.
sstring blocks_prayer
For update_position() mostly.
const char * tmpdir
Directory to use for temporary files.
#define EMERGENCY_MAPPATH
These define the players starting map and location on that map, and where emergency saves are defined...
#define CSPORT
CSPORT is the port used for the new client/server code.
void assets_init()
Init assets-related variables.
int exiting
True if the game is about to exit.
Attack messages structure.
@ llevDebug
Only for debugging purposes.
#define NRSPELLPATHS
Number of spell paths.
void assets_end_load()
Called after collect is complete, to check various things.
const char * uniquedir
Directory for the unique items.
char * bufferreader_next_line(BufferReader *br)
Return the next line in the buffer, as separated by a newline.
const char * localdir
Read/write data files.