Crossfire Client, Trunk
R20330
|
Functions for initializing the client. More...
Go to the source code of this file.
Macros | |
#define | FREE_AND_CLEAR(xyz) { free(xyz); xyz=NULL; } |
Functions | |
void | client_init () |
Called ONCE during client startup to initialize configuration and other variables to reasonable defaults. More... | |
void | client_reset () |
Clear client variables between connections to different servers. More... | |
static void | init_config () |
Initialize client settings with built-in defaults. More... | |
static void | init_paths () |
void | reset_player_data () |
Reset player experience data. More... | |
static void | reset_vars_common () |
Initialize or reset client variables. More... | |
void | SendAddMe (ClientSocket csock) |
void | SendVersion (ClientSocket csock) |
void | VersionCmd (char *data, int len) |
Variables | |
const char *const | config_names [CONFIG_NUMS] |
See common/init.c - number mapping used when loading/saving the values. More... | |
gint16 | use_config [CONFIG_NUMS] |
gint16 | want_config [CONFIG_NUMS] |
Functions for initializing the client.
Definition in file init.c.
#define FREE_AND_CLEAR | ( | xyz | ) | { free(xyz); xyz=NULL; } |
Definition at line 42 of file init.c.
Referenced by client_reset().
void client_init | ( | void | ) |
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 184 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 | ( | void | ) |
Clear client variables between connections to different servers.
This MUST be called AFTER client_init() because that performs some allocations.
Definition at line 239 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 140 of file init.c.
References CFG_DM_PIXMAP, CFG_LT_TILE, COMMAND_WINDOW, CONFIG_APPLY_CONTAINER, CONFIG_CACHE, CONFIG_CWINDOW, CONFIG_DARKNESS, CONFIG_DISPLAYMODE, CONFIG_DOWNLOAD, CONFIG_ECHO, CONFIG_FASTTCP, CONFIG_FOGWAR, CONFIG_FOODBEEP, CONFIG_GRAD_COLOR, CONFIG_ICONSCALE, 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 79 of file init.c.
References cache_dir, and config_dir.
Referenced by client_init().
void reset_player_data | ( | void | ) |
Reset player experience data.
Definition at line 226 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 96 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_init(), 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 75 of file init.c.
References cs_print_string(), and ClientSocket::fd.
Referenced by client_negotiate().
void SendVersion | ( | ClientSocket | csock | ) |
Definition at line 70 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 44 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 40 of file init.c.
Referenced by client_connect(), client_mapsize(), client_negotiate(), command_foodbeep(), config_check(), config_load(), create_and_rescale_image_from_data(), create_map_image(), display_mapscroll(), display_newpng(), draw_map(), draw_message_window(), Face2Cmd(), focusoutfunc(), free_pixmap(), gtk_map_redraw(), init_config(), init_image_cache_data(), keyfunc(), main(), map_button_event(), map_draw_layer(), map_init(), mapcell_draw_darkness(), MusicCmd(), on_entry_commands_activate(), parse_key(), parse_key_release(), play_sound_effect(), read_config_dialog(), script_process_cmd(), send_command(), set_command_window(), set_darkness(), SetupCmd(), and update_stat().
gint16 want_config[CONFIG_NUMS] |
Definition at line 40 of file init.c.
Referenced by add_marked_text_to_pane(), client_negotiate(), command_foodbeep(), config_check(), config_load(), config_load_legacy(), draw_ext_info(), init_common_cache_data(), init_config(), init_sounds(), map_check_resize(), mapdata_scroll(), read_config_dialog(), reset_image_cache_data(), reset_image_data(), save_defaults(), set_command_window(), and setup_config_dialog().