Crossfire Client, Trunk
|
Go to the source code of this file.
Macros | |
#define | FREE_AND_CLEAR(xyz) { free(xyz); xyz=NULL; } |
Functions | |
void | client_init () |
void | client_reset () |
static void | init_config () |
static void | init_paths () |
void | reset_player_data () |
static void | reset_vars_common () |
void | SendAddMe (ClientSocket csock) |
void | SendVersion (ClientSocket csock) |
void | VersionCmd (char *data, int len) |
Variables | |
const char *const | config_names [CONFIG_NUMS] |
gint16 | use_config [CONFIG_NUMS] |
gint16 | want_config [CONFIG_NUMS] |
Functions for initializing the client.
Definition in file init.c.
void client_init | ( | ) |
Called ONCE during client startup to initialize configuration and other variables to reasonable defaults. Future resets (i.e. after a connection) should use client_reset() instead.
Definition at line 187 of file init.c.
References Player_Struct::below, FaceSets_struct::comment, cpl, exp_table, exp_table_max, FaceSets_struct::extension, face_info, Face_Information_struct::facesets, FaceSets_struct::fallback, FaceSets_struct::fullname, init_commands(), init_config(), init_paths(), last_used_skills, map_item(), MAX_FACE_SETS, MAX_SKILL, ms_init(), Player_Struct::ob, Face_Information_struct::old_bmaps_checksum, player_item(), FaceSets_struct::prefix, reset_vars_common(), FaceSets_struct::size, skill_names, and Face_Information_struct::want_faceset.
Referenced by main().
void client_reset | ( | ) |
Clear client variables between connections to different servers. This MUST be called AFTER client_init() because that performs some allocations.
Definition at line 242 of file init.c.
References Face_Information_struct::bmaps_checksum, classes, FaceSets_struct::comment, FaceSets_struct::extension, face_info, Face_Information_struct::facesets, FaceSets_struct::fallback, free_all_race_class_info(), FREE_AND_CLEAR, FaceSets_struct::fullname, MAX_FACE_SETS, MAX_SKILL, motd, news, num_classes, num_races, Face_Information_struct::old_bmaps_checksum, FaceSets_struct::prefix, races, reset_vars_common(), rules, serverloginmethod, FaceSets_struct::size, skill_names, used_classes, and used_races.
Referenced by main().
|
static |
Initialize client settings with built-in defaults.
Definition at line 141 of file init.c.
References CFG_DM_PIXMAP, CFG_LT_PIXEL, COMMAND_WINDOW, CONFIG_APPLY_CONTAINER, CONFIG_AUTO_AFK, CONFIG_CACHE, CONFIG_CWINDOW, CONFIG_DARKNESS, CONFIG_DISPLAYMODE, CONFIG_DOWNLOAD, CONFIG_ECHO, CONFIG_FASTTCP, CONFIG_FOGWAR, CONFIG_FOODBEEP, CONFIG_GRAD_COLOR, CONFIG_ICONSCALE, CONFIG_INV_MENU, CONFIG_LIGHTING, CONFIG_MAPHEIGHT, CONFIG_MAPSCALE, CONFIG_MAPSCROLL, CONFIG_MAPWIDTH, CONFIG_NUMS, CONFIG_POPUPS, CONFIG_PORT, CONFIG_RESISTS, CONFIG_SHOWGRID, CONFIG_SHOWICON, CONFIG_SIGNPOPUP, CONFIG_SMOOTH, CONFIG_SOUND, CONFIG_SPLASH, CONFIG_SPLITINFO, CONFIG_SPLITWIN, CONFIG_TIMESTAMP, CONFIG_TOOLTIPS, CONFIG_TRIMINFO, EPORT, use_config, and want_config.
Referenced by client_init().
|
static |
Definition at line 80 of file init.c.
References cache_dir, and config_dir.
Referenced by client_init().
void reset_player_data | ( | ) |
Reset player experience data.
Definition at line 229 of file init.c.
References cpl, MAX_SKILL, Stat_struct::skill_exp, Stat_struct::skill_level, and Player_Struct::stats.
Referenced by PlayerCmd(), and reset_vars_common().
|
static |
Initialize or reset client variables. This function is called by client_init() and client_reset().
Definition at line 97 of file init.c.
References Face_Information_struct::bmaps_checksum, Face_Information_struct::cache_hits, Face_Information_struct::cache_misses, ClientSocket::command_received, ClientSocket::command_sent, ClientSocket::command_time, Player_Struct::container, Player_Struct::count_left, cpl, csocket, face_info, Face_Information_struct::faceset, Face_Information_struct::have_faceset_info, Player_Struct::input_text, Player_Struct::last_command, Player_Struct::magicmap, mapdata_free(), Stat_struct::maxgrace, Stat_struct::maxhp, Stat_struct::maxsp, Face_Information_struct::num_images, Player_Struct::range, range_size, Player_Struct::ranges, reset_player_data(), Player_Struct::showmagic, Stat_struct::speed, stat_maximum, stat_min, stat_points, Player_Struct::stats, and Player_Struct::title.
Referenced by client_init(), and client_reset().
void SendAddMe | ( | ClientSocket | csock | ) |
Definition at line 76 of file init.c.
References cs_print_string(), and ClientSocket::fd.
Referenced by client_negotiate().
void SendVersion | ( | ClientSocket | csock | ) |
Definition at line 71 of file init.c.
References cs_print_string(), ClientSocket::fd, VERSION_CS, VERSION_INFO, and VERSION_SC.
Referenced by client_negotiate().
void VersionCmd | ( | char * | data, |
int | len | ||
) |
Definition at line 45 of file init.c.
References ClientSocket::cs_version, csocket, LOG(), LOG_DEBUG, LOG_WARNING, ClientSocket::sc_version, VERSION_CS, and VERSION_SC.
const char* const config_names[CONFIG_NUMS] |
See common/init.c - number mapping used when loading/saving the values.
Definition at line 30 of file init.c.
Referenced by config_load(), config_load_legacy(), and save_defaults().
gint16 use_config[CONFIG_NUMS] |
Definition at line 41 of file init.c.
Referenced by init_config().
gint16 want_config[CONFIG_NUMS] |
Definition at line 41 of file init.c.
Referenced by client_negotiate(), command_foodbeep(), config_check(), config_load(), config_load_legacy(), do_set_mapscale(), draw_ext_info(), init_common_cache_data(), init_config(), IS_DIFFERENT(), main(), map_check_resize(), mapdata_scroll(), on_auto_afk_response(), read_config_dialog(), reset_image_cache_data(), reset_image_data(), save_defaults(), set_command_window(), setup_config_dialog(), and SetupCmd().