Go to the documentation of this file.
38 static void help(
void);
58 { NULL, NULL,
false, NULL, NULL }
66 for (
int module = 0;
modules[module].
name != NULL; module++) {
82 for (
int module = 0;
modules[module].
name != NULL; module++) {
96 for (
int module = 0;
modules[module].
name != NULL; module++) {
278 int port = atoi(val);
279 if (port <= 0 || port > 65535) {
280 LOG(
llevError,
"%d is an invalid csport number, must be between 1 and 65535.\n", port);
302 for (
int module = 0;
modules[module].
name; module++) {
451 while (on_arg < argc) {
480 fprintf(stderr,
"Unknown option: %s\n", argv[on_arg]);
481 fprintf(stderr,
"Type '%s -h' for usage.\n", argv[0]);
531 if (!strncmp(cp,
"name", 4)) {
536 }
else if (!strncmp(cp,
"description", 11)) {
538 }
else if (sscanf(cp,
"material %d", &
value)) {
540 }
else if (!strncmp(cp,
"saves", 5)) {
541 cp = strchr(cp,
' ')+1;
547 if ((
next = strchr(cp,
',')) != NULL)
549 sscanf(cp,
"%d", &
value);
553 }
else if (!strncmp(cp,
"mods", 4)) {
554 cp = strchr(cp,
' ')+1;
560 if ((
next = strchr(cp,
',')) != NULL)
562 sscanf(cp,
"%d", &
value);
599 if ((fp = fopen(
buf,
"r")) == NULL) {
607 if ((cp = strrchr(
buf,
'\n')) != NULL)
617 if ((cp = strchr(
buf,
' ')) != NULL) {
632 LOG(
llevError,
"load_settings: Unknown value for metaserver_notification: %s\n", cp);
638 LOG(
llevError,
"load_settings: metaserver_server must have a value.\n");
644 LOG(
llevError,
"load_settings: motd must have a value.\n");
649 LOG(
llevError,
"load_settings: metaserver_host must have a value.\n");
655 if (port < 1 || port > 65535)
656 LOG(
llevError,
"load_settings: metaserver_port must be between 1 and 65535, %d is invalid\n", port);
665 LOG(
llevError,
"load_settings: worldmapstartx must be at least 0, %d is invalid\n", size);
672 LOG(
llevError,
"load_settings: worldmapstarty must be at least 0, %d is invalid\n", size);
679 LOG(
llevError,
"load_settings: worldmaptilesx must be greater than 1, %d is invalid\n", size);
686 LOG(
llevError,
"load_settings: worldmaptilesy must be greater than 1, %d is invalid\n", size);
693 LOG(
llevError,
"load_settings: worldmaptilesizex must be greater than 1, %d is invalid\n", size);
700 LOG(
llevError,
"load_settings: worldmaptilesizey must be greater than 1, %d is invalid\n", size);
707 LOG(
llevError,
"load_settings: fastclock must be at least 0, %d is invalid\n", lev);
716 LOG(
llevError,
"load_settings: Unknown value for not_permadeth: %s\n", cp);
724 LOG(
llevError,
"load_settings: Unknown value for resurrection: %s\n", cp);
732 LOG(
llevError,
"load_settings: Unknown value for set_title: %s\n", cp);
740 LOG(
llevError,
"load_settings: Unknown value for search_items: %s\n", cp);
748 LOG(
llevError,
"load_settings: Unknown value for spell_encumbrance: %s\n", cp);
756 LOG(
llevError,
"load_settings: Unknown value for spell_failure_effects: %s\n", cp);
764 LOG(
llevError,
"load_settings: Unknown value for casting_time: %s\n", cp);
772 LOG(
llevError,
"load_settings: Unknown value for real_wiz: %s\n", cp);
780 LOG(
llevError,
"load_settings: Unknown value for recycle_tmp_maps: %s\n", cp);
790 LOG(
llevError,
"load_settings: Unknown value for always_show_hp: %s\n", cp);
807 LOG(
llevError,
"load_settings: Unknown value for spellpoint_level_depend: %s\n", cp);
815 LOG(
llevError,
"load_settings: Unknown value for stat_loss_on_death: %s\n", cp);
818 LOG(
llevError,
"use_permanent_experience is deprecated, usepermenent_experience_percentage instead\n");
819 }
else if (!
strcasecmp(
buf,
"permanent_experience_percentage")) {
821 if (val < 0 || val > 100)
822 LOG(
llevError,
"load_settings: permenent_experience_percentage must be between 0 and 100, %d is invalid\n", val);
827 if (val < 0 || val > 100)
828 LOG(
llevError,
"load_settings: death_penalty_percentage must be between 0 and 100, %d is invalid\n", val);
833 if (val < 0 || val > 255)
834 LOG(
llevError,
"load_settings: death_penalty_levels can not be negative, %d is invalid\n", val);
843 LOG(
llevError,
"load_settings: Unknown value for balanced_stat_loss: %s\n", cp);
851 LOG(
llevError,
"load_settings: Unknown value for simple_exp: %s\n", cp);
854 float tmp = atof(cp);
856 LOG(
llevError,
"load_settings: item_power_factor must be a positive number (%f < 0)\n",
tmp);
860 int16_t val = atoi(cp);
862 if (val < -100 || val > 100)
863 LOG(
llevError,
"load_settings: pk_luck_penalty must be between -100 and 100, %d is invalid\n", val);
869 if (val < 1 || val > 100)
870 LOG(
llevError,
"load_settings: set_friendly_fire must be between 1 an 100, %d is invalid\n", val);
874 int max_e = atoi(cp);
876 LOG(
llevError,
"load_settings: armor_max_enchant is %d\n", max_e);
882 LOG(
llevError,
"load_settings: armor_weight_reduction is %d\n", wr);
891 LOG(
llevError,
"load_settings: unknown value for armor_weight_linear: %s\n", cp);
896 LOG(
llevError,
"load_settings: armor_speed_improvement is %d\n", wr);
905 LOG(
llevError,
"load_settings: unknown value for armor_speed_linear: %s\n", cp);
913 LOG(
llevError,
"load_settings: unknown value for no_player_stealing: %s\n", cp);
921 LOG(
llevError,
"load_settings: unknown value for create_home_portals: %s\n", cp);
929 LOG(
llevError,
"load_settings: unknown value for personalized_blessings: %s\n", cp);
932 int64_t pkme = atoll(cp);
937 int pkmep = atoi(cp);
939 LOG(
llevError,
"load_settings: pk_max_experience_percent should be positive or zero (was \"%s\")\n", cp);
942 }
else if (!
strcasecmp(
buf,
"allow_denied_spells_writing")) {
948 LOG(
llevError,
"load_settings: unknown value for allow_denied_spells_writing: %s\n", cp);
956 LOG(
llevError,
"load_settings: unknown value for allow_broken_converters: %s\n", cp);
964 LOG(
llevError,
"load_settings: unknown value for log_timestamp: %s\n", cp);
973 LOG(
llevError,
"load_settings: starting_stat_min (%d) need to be within %d-%d (%d)\n",
981 LOG(
llevError,
"load_settings: starting_stat_max (%d) need to be within %d-%d (%d)\n",
990 LOG(
llevError,
"load_settings: starting_stat_points (%d) need to be within %d-%d\n",
1002 if (val < NUM_STATS * 3 || val >
NUM_STATS * 18)
1003 LOG(
llevError,
"load_settings: roll_stat_points need to be within %d-%d\n",
1013 LOG(
llevError,
"load_settings: unknown value for special_break_map: %s\n", cp);
1015 }
else if (!
strcasecmp(
buf,
"ignore_plugin_compatibility")) {
1021 LOG(
llevError,
"load_settings: unknown value for ignore_plugin_compatibility: %s\n", cp);
1029 LOG(
llevError,
"load_settings: unknown value for account_block_create: %s\n", cp);
1036 if (val != 0 && val != 1) {
1037 LOG(
llevError,
"load_settings: crypt_mode must be 0 or 1\n");
1045 LOG(
llevError,
"load_settings: min_name (%d) need to be within %d-%d\n",
1133 printf(
"Usage: crossfire-server [options]\n\n");
1135 printf(
"Options:\n");
1136 printf(
" -conf Set the directory to find configuration files.\n");
1137 printf(
" -d Turn on extra debugging messages.\n");
1138 printf(
" -data Set the data (share/) directory (archetypes, treasures, etc).\n");
1139 printf(
" -disable-module\n"
1140 " Disable specified module, by its name\n"
1141 " Can be specified multiple times. 'All' disables all modules.\n");
1142 printf(
" -enable-module\n"
1143 " Enable specified module, by its name\n"
1144 " Can be specified multiple times. 'All' enables all modules.\n");
1145 printf(
" -disable-plugin\n"
1146 " Disables specified plugin. Use the name without the extension.\n"
1147 " Can be specified multiple times. 'All' disables all plugins.\n");
1148 printf(
" -dump-anims Dump animations.\n");
1149 printf(
" -h Print this help message.\n");
1150 printf(
" -ignore-assets-errors\n");
1151 printf(
" Allow going on even if there are errors in assets.\n");
1152 printf(
" Warning: this may lead to strange behaviour.\n");
1153 printf(
" -list-modules\n"
1154 " List built-in modules and exit.\n");
1155 printf(
" -local Set the local data (var/) directory.\n");
1156 printf(
" -log <file> Write logging information to the given file.\n");
1157 printf(
" -m List suggested experience for all monsters.\n");
1158 printf(
" -m2 Dump monster abilities.\n");
1159 printf(
" -m3 Dump artifact information.\n");
1160 printf(
" -m4 Dump spell information.\n");
1161 printf(
" -m5 Dump skill information.\n");
1162 printf(
" -m6 Dump race information.\n");
1163 printf(
" -m7 Dump alchemy information.\n");
1164 printf(
" -m8 Dump gods information.\n");
1165 printf(
" -m9 Dump more alchemy information (formula checking).\n");
1166 printf(
" -maps Set the map directory.\n");
1167 printf(
" -mexp Dump the experience table.\n");
1168 printf(
" -mon Turn on monster debugging.\n");
1169 printf(
" -mq Dump the quest list.\n");
1170 printf(
" -mt <name> Dump a list of treasures for a monster.\n");
1171 printf(
" -n Turn off debugging messages if on by default.\n");
1172 printf(
" -p <port> Specifies the port to listen on for incoming connections.\n");
1173 printf(
" -pack-assets <type> <filename>\n");
1174 printf(
" Packs specified assets type to the specified filename.\n");
1175 printf(
" Valid assets type are: archs, treasures, faces, messages, facesets, artifacts, formulae, images, quests.\n");
1176 printf(
" The file format will be tar ('images') or text (everything else).\n");
1177 printf(
" It is possible to combine multiple assets by using '+', for instance 'faces+messages+artifacts'.\n");
1178 printf(
" In this case the file will be in tar format.\n");
1179 printf(
" -playerdir Set the player files directory.\n");
1180 printf(
" -regions Set the region file.\n");
1181 printf(
" -templatedir Set the template map directory.\n");
1182 printf(
" -tmpdir Set the directory for temporary files (mostly maps.)\n");
1183 printf(
" -uniquedir Set the unique items/maps directory.\n");
1184 printf(
" -v Print version information.\n");
1247 #ifdef SHUTDOWN_FILE
1252 if ((fp = fopen(
buf,
"r")) != NULL) {
1270 (
void) signum_unused;
1300 struct sigaction sa;
1302 sa.sa_sigaction = NULL;
1303 sigemptyset(&sa.sa_mask);
1306 sigaction(SIGHUP, &sa, NULL);
1308 signal(SIGPIPE, SIG_IGN);
uint8_t death_penalty_ratio
static struct Command_Line_Options options[]
char * log_timestamp_format
void init(int argc, char **argv)
char * account_trusted_host
static void init_beforeplay(void)
void LOG(LogLevel logLevel, const char *format,...)
void random_house_generator_init(Settings *settings)
void dump_alchemy_costs(void)
static void set_datadir(const char *path)
static void load_materials(BufferReader *reader, const char *filename)
int armor_weight_reduction
static void set_mapdir(const char *path)
static void set_dumpmon7(void)
static void rec_sighup(int i)
static void list_modules()
non standard information is not specified or uptime this means how long since the executable has been started A particular host may have been running a server for quite a long time
uint8_t starting_stat_max
static materialtype_t * get_empty_mat(void)
static void set_dumpmont(const char *name)
void init_ob_methods(void)
uint32_t worldmaptilesizex
uint8_t spell_failure_effects
static void set_dumpmon6(void)
uint8_t spell_encumbrance
#define FREE_AND_COPY_IF(sv, nv)
uint8_t ignore_plugin_compatibility
static void set_mondebug(void)
static void server_dump_animations(void)
static void set_playerdir(const char *path)
std::vector< materialtype_t * > materials
void load_races(BufferReader *reader, const char *filename)
static void set_dumpmon2(void)
static void set_dumpmon4(void)
Plugin animator file specs[Config] name
int allow_denied_spells_writing
static void server_dump_faces(void)
static void parse_args(int argc, char *argv[], int pass)
uint8_t special_break_map
void dump_experience(void)
uint16_t set_friendly_fire
static module_information modules[]
static void load_settings(void)
void init_archetype_pointers(void)
sstring add_refcount(sstring str)
void citylife_init(Settings *settings)
static void set_dumpmon3(void)
void random_house_generator_close()
sstring add_string(const char *str)
char meta_comment[MAX_BUF]
static void set_enable_module(const char *name)
static void set_dumpmon1(void)
int metaserver2_init(void)
int armor_speed_improvement
spell prayer lvl t sp speed range duration short description
void add_hook(const char *name, collectorHook hook)
static void signal_shutdown(int signum_unused)
static void set_logfile(char *val)
void service_unregister()
void assets_finish_archetypes_for_play()
int allow_broken_converters
uint32_t worldmaptilesizey
uint8_t account_block_create
static void set_tmpdir(const char *path)
uint8_t armor_weight_linear
void dump_abilities(void)
static void set_uniquedir(const char *path)
void cfcitybell_init(Settings *settings)
static void set_dumpmon9(void)
static void set_confdir(const char *path)
uint8_t personalized_blessings
pluglist shows those as well as a short text describing each the list will simply appear empty The keyword for the Python plugin is Python plugout< keyword > Unloads a given identified by its _keyword_ So if you want to unload the Python you need to do plugout Python plugin< libname > Loads a given whose _filename_ is libname So in the case of you d have to do a plugin cfpython so Note that all filenames are relative to the default plugin path(SHARE/plugins). Console messages. ----------------- When Crossfire starts
void(* cmdlinefunc_args2)(const char *arg1, const char *arg2)
static void set_dumpmon8(void)
std::vector< char * > disabled_plugins
void fatal(enum fatal_error err)
static void set_regions(const char *path)
uint8_t armor_speed_linear
uint8_t starting_stat_min
uint8_t create_home_portals
void(* cmdlinefunc_args1)(const char *arg1)
static void free_materials(void)
void print_monsters(void)
static void unset_debug(void)
uint8_t stat_loss_on_death
uint8_t spellpoint_level_depend
void(* cmdlinefunc_args0)(void)
static void set_debug(void)
Install Bug reporting Credits but rather whatever guild name you are using *With the current map and server there are three they and GreenGoblin *Whatever name you give the folder should but it will still use GUILD_TEMPLATE *You can change what guild it uses by editing the map files Modify Map or objects if you want to use the optional Python based Guild Storage hall The first three are on the main the next two are in the guild_hq and the final one is in hallofjoining Withe the Storage three objects are found on the main floor and the last two are in the basement It s not that but you will need a map editor You find the object that has the click edit and change the line script options(which currently is "GUILD_TEMPALTE") to the guild you wish to use. And make sure you use the same one for all of them or it won 't work. Here 's a quick HOWTO for using the map editor to make these changes edit the mainfloor map exit(x15, y29 - set to/Edit/This/Exit/Path in the template) back to the world map as well. If you are using the Storage Hall map(storage_hall)
static void set_ignore_assets_errors()
void dump_monster_treasure(const char *name)
void dump_animations(void)
void add_server_collect_hooks()
static void set_dumpmon5(void)
int strcasecmp(const char *s1, const char *s2)
char meta_server[MAX_BUF]
static void call_version(void)
static void set_csport(const char *val)
uint8_t balanced_stat_loss
int pk_max_experience_percent
static void init_startup(void)
static void set_disable_plugin(const char *name)
static void set_localdir(const char *path)
void assets_pack(const char *what, const char *filename)
static void set_disable_module(const char *name)
uint8_t no_player_stealing
int64_t pk_max_experience
uint8_t permanent_exp_ratio
void dump_artifacts(void)
static void set_templatedir(const char *path)
uint8_t death_penalty_level
char who_wiz_format[MAX_BUF]
uint8_t starting_stat_points
static void server_pack_assets(const char *assets, const char *filename)
volatile sig_atomic_t shutdown_flag
static void do_module(const char *name, bool enabled)
char * bufferreader_next_line(BufferReader *br)