Crossfire Client, Branches
R11627
|
#include <client.h>
#include <external.h>
#include <errno.h>
#include <script.h>
#include <ctype.h>
#include "mapdata.h"
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
Go to the source code of this file.
Data Structures | |
struct | CmdMapping |
Macros | |
#define | NCOMMANDS ((int)(sizeof(commands)/sizeof(struct CmdMapping))) |
Typedefs | |
typedef void(* | CmdProc )(unsigned char *, int len) |
Functions | |
void | DoClient (ClientSocket *csocket) |
int | init_connection (char *host, int port) |
void | negotiate_connection (int sound) |
Variables | |
char * | client_libdir =NULL |
int | command_inscribe = 0 |
struct CmdMapping | commands [] |
Client_Player | cpl |
ClientSocket | csocket |
uint64 * | exp_table =NULL |
uint16 | exp_table_max =0 |
int | last_used_skills [MAX_SKILL+1] |
int | maxfd |
int | meta_port =META_PORT |
char * | meta_server =META_SERVER |
int | metaserver2_on =METASERVER2 |
int | metaserver_on =METASERVER |
const char *const | rcsid_common_client_c |
int | replyinfo_last_face =0 |
int | replyinfo_status =0 |
int | requestinfo_sent =0 |
const char *const | resists_name [NUM_RESISTS] |
char * | server =NULL |
char * | skill_names [MAX_SKILL] |
char * | sound_server ="cfsndserv" |
uint32 | tick =0 |
char | VERSION_INFO [256] |
int | want_skill_exp =0 |
#define NCOMMANDS ((int)(sizeof(commands)/sizeof(struct CmdMapping))) |
Definition at line 147 of file client.c.
Referenced by DoClient().
void DoClient | ( | ClientSocket * | csocket | ) |
Definition at line 149 of file client.c.
References SockList::buf, CmdMapping::cmdformat, CmdMapping::cmdname, CmdMapping::cmdproc, ClientSocket::fd, ClientSocket::inbuf, SockList::len, MAXSOCKBUF, NCOMMANDS, script_watch(), and SockList_ReadPacket().
Referenced by do_network(), event_loop(), and negotiate_connection().
int init_connection | ( | char * | host, |
int | port | ||
) |
Definition at line 205 of file client.c.
References CONFIG_FASTTCP, LOG(), LOG_ERROR, LOG_WARNING, ClientSocket::servername, SOL_TCP, and use_config.
Referenced by main(), metaserver_connect_to(), metaserver_select(), and on_metaserver_select_clicked().
void negotiate_connection | ( | int | sound | ) |
Definition at line 338 of file client.c.
References Face_Information_struct::cache_hits, Face_Information_struct::cache_misses, CONFIG_CACHE, CONFIG_DOWNLOAD, CONFIG_LIGHTING, CONFIG_MAPHEIGHT, CONFIG_MAPWIDTH, CONFIG_SMOOTH, cs_print_string(), ClientSocket::cs_version, DoClient(), draw_info(), face_info, Face_Information_struct::faceset, ClientSocket::fd, image_update_download_status(), LOG(), LOG_WARNING, mapdata_set_size(), MAX_BUF, NDI_GOLD, Face_Information_struct::num_images, replyinfo_last_face, replyinfo_status, requestinfo_sent, RI_IMAGE_INFO, RI_IMAGE_SUMS, ClientSocket::sc_version, SendAddMe(), SendVersion(), use_config, want_config, Face_Information_struct::want_faceset, and want_skill_exp.
Referenced by main().
char* client_libdir =NULL |
Definition at line 61 of file client.c.
Referenced by init_client_vars(), init_keys(), and keys_init().
int command_inscribe = 0 |
Definition at line 75 of file client.c.
Referenced by inscribe_magical_scroll(), menu_spells(), and SetupCmd().
struct CmdMapping commands[] |
Client_Player cpl |
Definition at line 77 of file client.c.
Referenced by AddspellCmd(), animate_objects(), bind_key(), buttonpress_in_list(), cancelConnection(), check_x_events(), close_container(), close_container_callback(), command_take(), configure_keys(), confirmUserPass(), count_callback(), delete_ch(), DeleteSpell(), dialog_callback(), display_map_doneupdate(), do_inv(), do_key_press(), do_magicmap(), do_timeout(), draw_info(), draw_inv(), draw_inv_list(), draw_inv_table(), draw_lists(), draw_look_list(), draw_magic_map(), draw_map(), draw_message_window(), draw_prompt(), draw_stats(), enter_callback(), extended_command(), fire_dir(), get_inv_display(), get_inv_widget(), get_item_env(), get_look_display(), get_look_widget(), get_metaserver(), gtk_command_history(), handle_query(), init_client_vars(), init_keys(), item_actions(), keyfunc(), keys_init(), list_button_event(), list_item_action(), load_theme(), locate_item(), magic_map_flash_pos(), MagicMapCmd(), main(), metaserver_connect_to(), new_player(), on_entry_commands_activate(), on_metaserver_select_clicked(), on_notebook_switch_page(), parse_key(), parse_key_release(), remove_item(), reset_client_vars(), reset_image_data(), reset_player_data(), save_keys(), script_process_cmd(), send_command(), send_reply(), sendPassword(), sendstr(), setUserPass(), spellinventory_redraw(), StatsCmd(), stop_fire(), update_spell_information(), update_spell_list(), UpdspellCmd(), write_ch(), and x_set_echo().
ClientSocket csocket |
Definition at line 78 of file client.c.
Referenced by applyconfig(), client_send_apply(), client_send_examine(), client_send_move(), command_take(), CompleteCmd(), disconnect(), do_disconnect(), do_network(), draw_stats(), event_loop(), get_image_info(), init_client_vars(), inscribe_magical_scroll(), keyfunc(), look_at(), main(), metaserver_connect_to(), metaserver_select(), on_disconnect_activate(), on_drawingarea_map_configure_event(), on_metaserver_select_clicked(), read_config_window(), requestface(), reset_client_vars(), script_process_cmd(), send_command(), send_mark_obj(), send_reply(), set_item_values(), SetupCmd(), setUserPass(), toggle_locked(), and VersionCmd().
uint64* exp_table =NULL |
Definition at line 73 of file client.c.
Referenced by draw_message_window(), get_exp_info(), and init_client_vars().
uint16 exp_table_max =0 |
Definition at line 72 of file client.c.
Referenced by draw_message_window(), get_exp_info(), and init_client_vars().
int last_used_skills[MAX_SKILL+1] |
Definition at line 65 of file client.c.
Referenced by draw_stats(), init_client_vars(), and use_skill().
int maxfd |
Definition at line 68 of file client.c.
Referenced by do_network(), event_loop(), and main().
int meta_port =META_PORT |
Definition at line 67 of file client.c.
Referenced by do_metaserver(), main(), and metaserver1_thread().
char * meta_server =META_SERVER |
Definition at line 61 of file client.c.
Referenced by do_metaserver(), main(), metaserver1_thread(), and metaserver_select().
int metaserver2_on =METASERVER2 |
Definition at line 69 of file client.c.
Referenced by metaserver2_get_info().
int metaserver_on =METASERVER |
Definition at line 69 of file client.c.
Referenced by metaserver1_get_info(), and metaserver_get_info().
const char* const rcsid_common_client_c |
int replyinfo_last_face =0 |
Definition at line 68 of file client.c.
Referenced by get_image_sums(), and negotiate_connection().
int replyinfo_status =0 |
Definition at line 68 of file client.c.
Referenced by get_image_info(), and negotiate_connection().
int requestinfo_sent =0 |
Definition at line 68 of file client.c.
Referenced by negotiate_connection().
const char* const resists_name[NUM_RESISTS] |
Definition at line 80 of file client.c.
Referenced by draw_message_window(), and update_stat_mapping().
char* server =NULL |
Definition at line 56 of file client.c.
Referenced by get_metaserver(), init_windows(), load_defaults(), main(), metaserver_save_cache(), metaserver_select(), metaserver_show(), parse_args(), and save_defaults().
char* skill_names[MAX_SKILL] |
Definition at line 63 of file client.c.
Referenced by AddspellCmd(), draw_stats(), get_skill_info(), init_client_vars(), reset_client_vars(), script_process_cmd(), and update_stat_mapping().
char* sound_server ="cfsndserv" |
Definition at line 62 of file client.c.
Referenced by init_sounds(), init_windows(), load_defaults(), parse_args(), and save_defaults().
uint32 tick =0 |
Definition at line 70 of file client.c.
Referenced by animate_inventory(), animate_look(), do_timeout(), and TickCmd().
char VERSION_INFO[256] |
Definition at line 59 of file client.c.
Referenced by aboutdialog(), bugdialog(), error_dialog(), init_windows(), menu_about(), parse_args(), and SendVersion().
int want_skill_exp =0 |
Definition at line 67 of file client.c.
Referenced by init_windows(), negotiate_connection(), and parse_args().