 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
19 #if defined(WIN32) || defined(_WIN32) || defined(WIN64)
26 #include <sys/socket.h>
29 #ifdef HAVE_LIBDMALLOC
46 #define PRINTF_ARGS(x, y) __attribute__ ((format (printf, x, y)))
154 #define SPELL_MAPPINGS 206
162 #define ROTATE_RIGHT(c) if ((c)&01) (c) = ((c)>>1)+0x80000000; else (c) >>= 1;
164 #define SET_ANIMATION(ob, newanim) { ob->face = (ob->temp_animation ? ob->temp_animation : ob->animation)->faces[newanim]; }
165 #define GET_ANIMATION(ob, anim) ((ob->temp_animation ? ob->temp_animation : ob->animation)->faces[anim])
166 #define GET_ANIM(ob) (ob->temp_animation ? ob->temp_animation : ob->animation)
167 #define GET_ANIM_ID(ob) (ob->temp_animation ? ob->temp_animation->num : (ob->animation ? ob->animation->num : 0))
173 #define NUM_ANIMATIONS(ob) ((ob->temp_animation ? ob->temp_animation : ob->animation)->num_animations)
174 #define NUM_FACINGS(ob) ((ob->temp_animation ? ob->temp_animation : ob->animation)->facings)
195 #define FREE_AND_CLEAR(xyz) { free(xyz); xyz = NULL; }
200 #define FREE_AND_CLEAR_STR(xyz) { free_string(xyz); xyz = NULL; }
202 #define FREE_AND_CLEAR_STR_IF(xyz) { if (xyz) { free_string(xyz); xyz = NULL; } }
206 #define FREE_AND_COPY(sv, nv) { if (sv) free_string(sv); sv = add_string(nv); }
208 #define FREE_AND_COPY_IF(sv, nv) { if (sv) free_string(sv); sv = nv ? add_string(nv) : NULL; }
213 # define NAMLEN(dirent) strlen((dirent)->d_name)
215 # define dirent direct
216 # define NAMLEN(dirent) (dirent)->d_namlen
218 # include <sys/ndir.h>
221 # include <sys/dir.h>
232 #define PERM_EXP(exptotal) (exptotal * settings.permanent_exp_ratio / 100 )
233 #define MAX_TOTAL_EXPERIENCE (settings.permanent_exp_ratio ? (MAX_EXPERIENCE * 100 / settings.permanent_exp_ratio) : 0)
371 #define PROFILE_BEGIN(expr) { \
372 struct timespec _begin, _end; \
373 clock_gettime(CLOCK_MONOTONIC, &_begin); \
376 #define PROFILE_END(var, expr) \
377 clock_gettime(CLOCK_MONOTONIC, &_end); \
378 long var = timespec_diff(&_end, &_begin); \
386 #define SCRIPT_FIX_ACTIVATOR 2
387 #define SCRIPT_FIX_ALL 1
388 #define SCRIPT_FIX_NOTHING 0
uint8_t casting_time
It takes awhile to cast a spell.
New face structure - this enforces the notion that data is face by face only - you can not change the...
uint8_t special_break_map
If set, then submaps in random maps can break the walls.
char meta_comment[MAX_BUF]
Comment we send to the metaserver.
EXTERN long nrofallowedstr
Only used in malloc_info().
EXTERN archetype * empty_archetype
Nice to have fast access to it.
const char * mapdir
Where the map files are.
char meta_server[MAX_BUF]
Hostname/ip addr of the metaserver.
uint8_t simple_exp
If true, use the simple experience system.
int16_t max_level
This is read out of exp_table.
uint8_t recycle_tmp_maps
Re-use tmp maps.
uint16_t emergency_y
Coordinates to use on that map.
const char * regions
Name of the regions file - libdir is prepended.
int allow_broken_converters
If set, converters will work even if price of generated item is higher than the price of converted it...
socket_struct * init_sockets
Established connections for clients not yet playing.
char * log_timestamp_format
Format for timestap, if log_timestamp is set.
void * language_t
Strings that should be manipulated through add_string() and free_string().
uint8_t armor_speed_linear
If 1, speed improvement is linear, else exponantiel.
Settings settings
Server settings.
uint8_t resurrection
Ressurection possible w/ permadeth on.
uint64_t spell_merges
Number of spell merges done.
uint8_t set_title
Players can set thier title.
uint8_t ignore_plugin_compatibility
If set, don't check plugin version.
Socket structure, represents a client-server connection.
uint8_t not_permadeth
If true, death is non-permament.
uint8_t permanent_exp_ratio
How much exp should be 'permenant' and unable to be lost.
uint8_t crypt_mode
0 for legacy behavior, 1 for always Traditional
uint8_t dumpvalues
Set to dump various values/tables.
const char * datadir
Read only data files.
uint32_t worldmaptilesy
Number of tiles high the worldmap is.
uint8_t min_name
Minimum characters for an account or player name.
uint32_t worldmapstartx
Starting x tile for the worldmap.
EXTERN artifactlist * first_artifactlist
First artifact.
uint8_t starting_stat_min
Minimum value of a starting stat.
class AssetsTracker * assets_tracker
If not NULL, called each time an asset is defined.
uint8_t roll_stat_points
How many stat points legacy (rolled) chars start with.
int16_t pk_luck_penalty
Amount by which player luck is reduced if they PK.
EXTERN char first_map_path[MAX_BUF]
The start-level.
EXTERN mapstruct * first_map
First map.
uint16_t csport
Port for new client/server.
This is used for various performance tracking statistics, or just how often certain events are done.
uint64_t spell_hash_full
Number of times spell hash was full.
int ignore_assets_errors
If set then go on running even if there are errors in assets.
fatalHook fatal_hook
If not NULL then called when fatal() is called.
EXTERN std::vector< region * > all_regions
All regions.
int maxfree[SIZEOFFREE]
Number of spots around a location, including that location (except for 0)
char meta_host[MAX_BUF]
Hostname of this host.
Plugin animator file specs[Config] name
uint32_t worldmaptilesx
Number of tiles wide the worldmap is.
int64_t pk_max_experience
Maximum experience one can get for PKing.
const EXTERN char * undead_name
logHook log_callback
Log hook, to intercept log messages.
uint8_t spell_encumbrance
Encumbrance effects spells.
void add_hook(const char *name, collectorHook hook)
uint16_t meta_port
Port number to use for updates.
uint8_t balanced_stat_loss
If true, Death stat depletion based on level etc.
LogLevel debug
Default debugging level.
Base class to be informed of where an asset is defined.
int pk_max_experience_percent
Percentage of experience of victim the killer gets.
const Face * blank_face
Following can just as easily be pointers, but it is easier to keep them like this.
uint8_t death_penalty_ratio
Hhow much exp should be lost at death.
Statistics statistics
Merged spell statistics.
uint16_t set_friendly_fire
Percent of damage done by peaceful player vs player damage.
uint8_t account_block_create
const char * motd
Name of the motd file.
const char * logfilename
Logfile to use.
uint32_t worldmapstarty
Starting y tile for the worldmap.
const char * rules
Name of rules file.
int armor_weight_reduction
Weight reduction per enchantment.
const char * news
Name of news file.
EXTERN player * first_player
First player.
uint8_t stat_loss_on_death
If true, chars lose a random stat when they die.
std::vector< char * > disabled_plugins
List of disabled plugins, 'All' means all.
struct linked_char * next
This represents all archetypes for one particular object type.
float item_power_factor
See note in setings file.
short freearr_y[SIZEOFFREE]
const char * dumparg
Additional argument for some dump functions.
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
const char * confdir
Configuration files.
EXTERN long nroferrors
If it exceeds MAX_ERRORS, call fatal()
EXTERN FILE * logfile
Used by server/daemon.c.
EXTERN sstring blocks_prayer
For update_position() mostly.
uint8_t death_penalty_level
How many levels worth of exp may be lost on one death.
std::function< void(BufferReader *, const char *)> collectorHook
int reset_loc_time
Number of seconds to put player back at home.
#define MAX_BUF
Used for all kinds of things.
uint64_t spell_suppressions
Number of times ok_to_put_more() returned FALSE.
const char *const spell_mapping[SPELL_MAPPINGS]
This table is only necessary to convert objects that existed before the spell object conversion to th...
const char * playerdir
Where the player files are.
uint8_t spell_failure_effects
Nasty backlash to spell failures.
uint8_t starting_stat_points
How many stat points character starts with.
short freearr_x[SIZEOFFREE]
X offset when searching around a spot.
unsigned int meta_on
True if we should send updates.
int allow_denied_spells_writing
If set, players can write spells they can't cast.
char * emergency_mapname
Map to return players to in emergency.
char who_wiz_format[MAX_BUF]
The format that the who command should use when called by a dm.
#define EXTERN
Define external variables.
uint8_t spellpoint_level_depend
Spell costs go up with level.
uint8_t fastclock
If true, clock goes warp 9.
const typedef char * sstring
uint8_t personalized_blessings
If 1, blessed weapons get an owner and a willpower value.
uint8_t max_stat
Maximum stat value - 255 should be sufficient.
int armor_max_enchant
Maximum number of times an armor can be enchanted.
uint8_t armor_weight_linear
If 1, weight reduction is linear, else exponantiel.
uint32_t worldmaptilesizex
Number of squares wide in a wm tile.
std::function< void(enum fatal_error err)> fatalHook
uint8_t real_wiz
Use mud-like wizards.
EXTERN char first_map_ext_path[MAX_BUF]
Path used for per-race start maps.
const char * templatedir
Directory for the template map.
EXTERN long trying_emergency_save
True when emergency_save() is reached.
uint32_t worldmaptilesizey
Number of squares high in a wm tile.
fatal_error
Fatal variables; used as arguments to fatal().
std::function< void(LogLevel, const char *, va_list)> logHook
EXTERN long nrofartifacts
Only used in malloc_info().
EXTERN int exiting
True if the game is about to exit.
uint32_t pticks
Used by various function to determine how often to save the character.
uint8_t no_player_stealing
If 1, can not steal from other players.
char * account_trusted_host
Block account creation for untrusted hosts.
uint8_t search_items
Search_items command.
LogLevel
Log levels for the LOG() function.
const char * tmpdir
Directory to use for temporary files.
uint32_t tick_duration
Gloabal variables:
uint8_t always_show_hp
'probe' spell HP bars for all living things (0, 1, or 2)
std::vector< std::pair< std::string, collectorHook > > collector_hooks
Collect hooks, as (filename, function) pairs.
uint8_t create_home_portals
If 1, can create portals in unique maps (apartments)
int armor_speed_improvement
Speed improvement.
int log_timestamp
If set, log will comport a timestamp.
char who_format[MAX_BUF]
The format that the who command should use.
uint8_t starting_stat_max
Maximum value of a starting stat.
const char * uniquedir
Directory for the unique items.
const char * localdir
Read/write data files.