Crossfire Client, Trunk
external.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void account_add_character_failure (char *message)
 
void account_change_password_failure (char *message)
 
void account_creation_failure (char *message)
 
void account_login_failure (char *message)
 
void addsmooth (guint16 face, guint16 smooth_face)
 
int associate_cache_entry (Cache_Entry *ce, int pixnum)
 
void bind_key (const char *params)
 
void choose_character_init (void)
 
void client_pickup (guint32 pickup)
 
void client_tick (guint32 tick)
 
void close_container (item *op)
 
void command_show (const char *params)
 
int create_and_rescale_image_from_data (Cache_Entry *ce, int pixmap_num, guint8 *rgba_data, int width, int height)
 
void create_new_character_failure (char *message)
 
void display_map_addbelow (long x, long y, long face)
 
void display_map_doneupdate (int redraw, int notice)
 
int display_mapscroll (int dx, int dy)
 
int display_willcache (void)
 
void draw_ext_info (int orig_color, int type, int subtype, const char *message)
 
void draw_magic_map (void)
 
void draw_message_window (int redraw)
 
void draw_prompt (const char *str)
 
void draw_stats (int redraw)
 
int get_info_width (void)
 
void get_map_image_size (int face, guint8 *w, guint8 *h)
 
void hide_all_login_windows (void)
 
void image_update_download_status (int start, int end, int total)
 
void keybindings_init (const char *character_name)
 
void menu_clear (void)
 
void MusicCmd (const char *data, int len)
 
void new_char_window_update_info ()
 
void open_container (item *op)
 
guint8 * png_to_data (guint8 *data, int len, guint32 *width, guint32 *height)
 
void resize_map_window (int x, int y)
 
void save_defaults (void)
 
void save_winpos (void)
 
void set_weight_limit (guint32 wlim)
 
void show_main_client (void)
 
void Sound2Cmd (unsigned char *data, int len)
 
void SoundCmd (unsigned char *data, int len)
 
void start_login (int method)
 
void starting_map_update_info ()
 
void unbind_key (const char *params)
 
void update_character_choose (const char *name, const char *class, const char *race, const char *face, const char *party, const char *map, int level, int faceno)
 
void update_login_info (int type)
 
void x_set_echo (void)
 

Detailed Description

Contains external calls that the common area makes callbacks to. This was really a quick hack done to allow some separation. Really, these should be set via callbacks that the client can make to the library. Many of these probably should never really be callbacks in any case, or be more general.

Definition in file external.h.

Function Documentation

◆ account_add_character_failure()

void account_add_character_failure ( char *  message)

Handles a failure from the server - pretty basic - just throw up the message and let the user try again. This is a response to the 'failure accountaddplayer' command. Calling this account_add_character_failure may be a little bit of a misnomer, but all the other routines in this area refer to character, not player.

Parameters
messageMessage to display. Unlike other messages, the first word of this message should be an integer, which denotes if using the 'force' option would allow the user to override this.

Definition at line 282 of file account.c.

Referenced by FailureCmd().

+ Here is the caller graph for this function:

◆ account_change_password_failure()

void account_change_password_failure ( char *  message)

Definition at line 1123 of file account.c.

References label_account_password_status.

Referenced by FailureCmd().

+ Here is the caller graph for this function:

◆ account_creation_failure()

void account_creation_failure ( char *  message)

Handles a failure from the server - pretty basic - just throw up the message and let the user try again.

Parameters
message

Definition at line 692 of file account.c.

Referenced by FailureCmd().

+ Here is the caller graph for this function:

◆ account_login_failure()

void account_login_failure ( char *  message)

Handles a failure from the server - pretty basic - just throw up the message and let the user try again.

Parameters
message

Definition at line 868 of file account.c.

Referenced by FailureCmd().

+ Here is the caller graph for this function:

◆ addsmooth()

void addsmooth ( guint16  face,
guint16  smooth_face 
)

Referenced from common/commands.c

Parameters
face
smooth_face

Definition at line 251 of file image.c.

Referenced by SmoothCmd().

+ Here is the caller graph for this function:

◆ associate_cache_entry()

int associate_cache_entry ( Cache_Entry ce,
int  pixnum 
)

This functions associates image_data in the cache entry with the specific pixmap number. Currently, there is no failure condition, but there is the potential that in the future, we want to more closely look at the data and if it isn't valid, return the failure code.

Returns
0 on success, -1 on failure.

Definition at line 264 of file image.c.

◆ bind_key()

void bind_key ( const char *  params)

◆ choose_character_init()

void choose_character_init ( )

Called when we get the accountplayers command from the server (indirectly via AccountPlayersCmd). This tells us to wipe any data from the treeview, but also hide any other windows and make the choose_character_window visible.

Definition at line 421 of file account.c.

Referenced by AccountPlayersCmd().

+ Here is the caller graph for this function:

◆ client_pickup()

void client_pickup ( guint32  pickup)

We get pickup information from server, update our status.

Definition at line 630 of file pickup.c.

Referenced by PickupCmd().

+ Here is the caller graph for this function:

◆ client_tick()

void client_tick ( guint32  tick)

Called whenever the server sends a tick command.

Definition at line 186 of file main.c.

Referenced by TickCmd().

+ Here is the caller graph for this function:

◆ close_container()

void close_container ( item op)

Open and close_container are now no-ops - since these are now drawn inline as treestores, we don't need to update what we are drawing were. and since the activation of a container will cause the list to be redrawn, don't need to worry about making an explicit call here.

Parameters
op

Definition at line 647 of file inventory.c.

Referenced by item_actions().

+ Here is the caller graph for this function:

◆ command_show()

void command_show ( const char *  params)
Parameters
params

Definition at line 661 of file inventory.c.

◆ create_and_rescale_image_from_data()

int create_and_rescale_image_from_data ( Cache_Entry ce,
int  pixmap_num,
guint8 *  rgba_data,
int  width,
int  height 
)

Takes the pixmap to put the data into, as well as the rgba data (ie, already loaded with png_to_data). Scales and stores the relevant data into the pixmap structure.

Parameters
cecan be NULL
pixmap_num
rgba_data
width
height
Returns
1 on failure.

Definition at line 142 of file image.c.

◆ create_new_character_failure()

void create_new_character_failure ( char *  message)

Pop up a dialog window with the error from the server. Since both v1 and v2 character creation are supported, either the new_character_window or the create_character_window may be up, so we can not easily display an in window message - a pop up is probably better, but it will also work no matter what window is up.

Parameters
messagemessage - this comes from the server.

Definition at line 142 of file account.c.

Referenced by FailureCmd().

+ Here is the caller graph for this function:

◆ display_map_addbelow()

void display_map_addbelow ( long  x,
long  y,
long  face 
)

◆ display_map_doneupdate()

void display_map_doneupdate ( int  redraw,
int  notice 
)

This is called after the map has been all digested. this should perhaps be removed, and left to being done from from the main event loop.

Parameters
redrawIf set, force redraw of all tiles.
noticeIf set, another call will follow soon.

Definition at line 622 of file map.c.

Referenced by Map2Cmd(), map_scrollCmd(), and MapExtendedCmd().

+ Here is the caller graph for this function:

◆ display_mapscroll()

int display_mapscroll ( int  dx,
int  dy 
)

Definition at line 156 of file map.c.

Referenced by mapdata_scroll().

+ Here is the caller graph for this function:

◆ display_willcache()

int display_willcache ( void  )

◆ draw_ext_info()

void draw_ext_info ( int  orig_color,
int  type,
int  subtype,
const char *  message 
)

A message processor that accepts messages along with meta information color and type. The message type and subtype are analyzed to select font and other text attributes. All gtk-v2 client messages pass through this processor before being output. Before addition of the output buffering feature, this was the message callback function. It is a separate function so that it can be called both by the callback, and but buffer maintenance functions.

Client-sourced messages generally should be passed directly to this handler instead of to the callback. This will save some overhead as the callback implements a system that coalesces duplicate messages - a feature that is not really applicable to most messages that do not come from the server.

Parameters
orig_colorSuggested text color that type/subtype can over-ride.
typeMessage type. See MSG_TYPE definitions in newclient.h.
subtypeMessage subtype. See MSG_TYPE_*_* values in newclient.h.
messageThe message text to display.

< When 0, the type is valid and may be used to pick the panel routing, otherwise the message can only go to the main message pane.

Definition at line 915 of file info.c.

Referenced by bind_key(), client_negotiate(), command_foodbeep(), command_show(), command_take(), complete_command(), configure_keys(), do_set_mapscale(), draw_prompt(), DrawInfoCmd(), get_image_info(), handle_local_command(), handle_query(), init_common_cache_data(), keybinding_get_data(), list_item_drop(), new_menu_pickup(), parse_key(), print_inventory(), save_defaults(), save_keys(), save_winpos(), script_init(), script_kill(), script_killall(), script_list(), script_process_cmd(), script_tell(), send_command(), set_command_window(), SetupCmd(), show_keys(), toggle_keybind_scope(), unbind_key(), and unbind_usage().

+ Here is the caller graph for this function:

◆ draw_magic_map()

void draw_magic_map ( void  )

Definition at line 24 of file magicmap.c.

Referenced by do_magicmap(), and MagicMapCmd().

+ Here is the caller graph for this function:

◆ draw_message_window()

void draw_message_window ( int  redraw)

Updates the stats pane - hp, sp, etc labels

Parameters
redraw

Definition at line 459 of file stats.c.

Referenced by configure_keys(), load_theme(), and StatsCmd().

+ Here is the caller graph for this function:

◆ draw_stats()

void draw_stats ( int  redraw)

Draws the stats window. If redraw is true, it means we need to redraw the entire thing, and not just do an updated

Definition at line 554 of file stats.c.

Referenced by load_theme(), read_config_dialog(), and StatsCmd().

+ Here is the caller graph for this function:

◆ get_info_width()

int get_info_width ( void  )

Referenced by print_inventory().

+ Here is the caller graph for this function:

◆ get_map_image_size()

void get_map_image_size ( int  face,
guint8 *  w,
guint8 *  h 
)
Parameters
face
w
h

Definition at line 341 of file image.c.

Referenced by mapdata_get_image_size().

+ Here is the caller graph for this function:

◆ hide_all_login_windows()

void hide_all_login_windows ( )

Hides all the login related windows. This is needed in case the client loses the connection to the server (either through player going to client/disconnect or network failure). get_metaserver() calls this, as well as AddMeSuccess

Definition at line 96 of file account.c.

Referenced by AddMeSuccess(), and show_main_client().

+ Here is the caller graph for this function:

◆ image_update_download_status()

void image_update_download_status ( int  start,
int  end,
int  total 
)

Draws a status bar showing where we our in terms of downloading all the image data. A few hacks: If start is 1, this is the first batch, so it means we need to create the appropriate status window. If start = end = total, it means were finished, so destroy the gui element.

Parameters
startThe start value just sent to the server.
end
totalThe total number of images.

Definition at line 309 of file image.c.

Referenced by client_negotiate().

+ Here is the caller graph for this function:

◆ menu_clear()

void menu_clear ( void  )

Clears all the message panels. It is not clear why someone would use it, but is called from the common area, and so is supported here.

Definition at line 1326 of file info.c.

Referenced by do_clearinfo().

+ Here is the caller graph for this function:

◆ MusicCmd()

void MusicCmd ( const char *  data,
int  len 
)

Parse the data contained by a music command coming from the server and pass the name along to cfsndserv as a quoted string.

Parameters
dataData provided following the music command from the server that hints what kind of music should play. NONE is an indication that music should stop playing.
lenLength of the string describing the music to play.

Format of the music command received in data:

music {string}

Definition at line 113 of file sound.c.

◆ new_char_window_update_info()

void new_char_window_update_info ( )

We have gotten some new information from the server, so we need to update the information - race/class choices or stat points/min stat/max stat information.

Definition at line 633 of file create_char.c.

References classes, combobox_cs, combobox_rs, create_character_set_sensitive(), label_cc_status_update, label_cc_unspent, num_classes, NUM_NEW_CHAR_STATS, num_races, on_combobox_rcs_changed(), races, spinbutton_cc, stat_maximum, stat_min, stat_points, used_classes, and used_races.

Referenced by get_class_info(), get_new_char_info(), and get_race_info().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ open_container()

void open_container ( item op)
Parameters
op

Definition at line 654 of file inventory.c.

Referenced by item_actions().

+ Here is the caller graph for this function:

◆ png_to_data()

guint8* png_to_data ( guint8 *  data,
int  len,
guint32 *  width,
guint32 *  height 
)

Definition at line 49 of file png.c.

Referenced by display_newpng(), and finish_face_cmd().

+ Here is the caller graph for this function:

◆ resize_map_window()

void resize_map_window ( int  x,
int  y 
)

Resize_map_window is a NOOP for the time being - not sure if it will in fact need to do something, since there are scrollbars for the map window now. Note - this is note a window resize request, but rather process the size (in spaces) of the map - is received from server.

Definition at line 463 of file map.c.

Referenced by SetupCmd().

+ Here is the caller graph for this function:

◆ save_defaults()

void save_defaults ( )

This function saves user settings chosen using the configuration popup dialog.

Definition at line 513 of file config.c.

Referenced by do_savedefaults(), metaserver_connect_to(), and on_auto_afk_response().

+ Here is the caller graph for this function:

◆ save_winpos()

void save_winpos ( )

Save client window positions to a file unique to each layout.

Definition at line 793 of file config.c.

Referenced by do_savewinpos().

+ Here is the caller graph for this function:

◆ set_weight_limit()

void set_weight_limit ( guint32  wlim)

No reason to divide by 1000 everytime we do the display, so do it once and store it here.

Parameters
wlim

Definition at line 693 of file inventory.c.

Referenced by StatsCmd().

+ Here is the caller graph for this function:

◆ show_main_client()

void show_main_client ( )

Show main client window. Called after connect if server does not support new loginmethod, or after character is selected.

Definition at line 466 of file main.c.

Referenced by AddMeSuccess(), on_button_cc_done(), and on_button_play_character_clicked().

+ Here is the caller graph for this function:

◆ Sound2Cmd()

void Sound2Cmd ( unsigned char *  data,
int  len 
)

Parse the data contained by a sound2 command coming from the server and handle playing the specified sound. See server doc/Developers/sound for details.

Parameters
dataData provided following the sound2 command from the server.
lenLength of the sound2 command data.

Format of the sound2 command recieved in data:

sound2 {x}{y}{dir}{volume}{type}{len_sound}{sound}{len_source}{source}
        b  b  b    b       b     b          str    b           str

Definition at line 38 of file sound.c.

◆ SoundCmd()

void SoundCmd ( unsigned char *  data,
int  len 
)

◆ start_login()

void start_login ( int  method)

Starts the login process. If not already done, gets widgets, sets up callboacks, etc. This is at the end of the file so all the callbacks are defined before this function - in that way, we do not need forward declarations. This is called from SetupCmd in common/commands.c

Parameters
methodLogin method that the server suppots.

Definition at line 1263 of file account.c.

Referenced by SetupCmd().

+ Here is the caller graph for this function:

◆ starting_map_update_info()

void starting_map_update_info ( )

We have gotten starting map information from the server - now update the combo boxes.

Definition at line 753 of file create_char.c.

References button_choose_starting_map, combobox_starting_map, on_combobox_starting_map_changed(), starting_map_info, and starting_map_number.

Referenced by get_starting_map_info().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update_character_choose()

void update_character_choose ( const char *  name,
const char *  class,
const char *  race,
const char *  face,
const char *  party,
const char *  map,
int  level,
int  faceno 
)

This gets data and adds it to the list store. This is called from AccountPlayersCmd and data is from the accountplayers protocol command. The parameters are data to add to the list store.

Parameters
name
class
race
face
party
map
level
faceno

Definition at line 547 of file account.c.

Referenced by AccountPlayersCmd().

+ Here is the caller graph for this function:

◆ update_login_info()

void update_login_info ( int  type)

This is called from ReplyInfoCmd when it gets a response from news/motd/rules. It is very possible that the window will get displayed before we got a reply response, so this tells the client to update it.

Parameters
typeWhat data just got updated - text string of motd/news/rules

Definition at line 1174 of file account.c.

Referenced by ReplyInfoCmd().

+ Here is the caller graph for this function: