Crossfire Client, Branches  R11627
commands.c File Reference
#include <client.h>
#include <external.h>
#include <assert.h>
#include "mapdata.h"
+ Include dependency graph for commands.c:

Go to the source code of this file.

Macros

#define NUM_LAYERS   (MAP1_LAYERS-1)
 

Functions

void AddMeFail (char *data, int len)
 
void AddMeSuccess (char *data, int len)
 
void AddspellCmd (unsigned char *data, int len)
 
void AnimCmd (unsigned char *data, int len)
 
static void common_item_command (uint8 *data, int len)
 
void DeleteInventory (unsigned char *data, int len)
 
void DeleteItem (unsigned char *data, int len)
 
void DeleteSpell (unsigned char *data, int len)
 
void DrawExtInfoCmd (char *data, int len)
 
void DrawInfoCmd (char *data, int len)
 
void ExtendedInfoSetCmd (char *data, int len)
 
int ExtSmooth (unsigned char *data, int len, int x, int y, int layer)
 
static void get_exp_info (const unsigned char *data, int len)
 
static void get_skill_info (char *data, int len)
 
static ExtTextManager getTextManager (int type)
 
void GoodbyeCmd (char *data, int len)
 
void handle_query (char *data, int len)
 
void Item2Cmd (unsigned char *data, int len)
 
void item_actions (item *op)
 
void MagicMapCmd (unsigned char *data, int len)
 
void Map2Cmd (unsigned char *data, int len)
 
void map_scrollCmd (char *data, int len)
 
void MapExtendedCmd (unsigned char *data, int len)
 
void NewmapCmd (unsigned char *data, int len)
 
void PickupCmd (uint8 *data, int len)
 
void PlayerCmd (unsigned char *data, int len)
 
void ReplyInfoCmd (uint8 *buf, int len)
 
void send_reply (const char *text)
 
void setTextManager (int type, ExtTextManager callback)
 
void SetupCmd (char *buf, int len)
 
void SinkCmd (unsigned char *data, int len)
 
void SmoothCmd (unsigned char *data, int len)
 
void StatsCmd (unsigned char *data, int len)
 
void TickCmd (uint8 *data, int len)
 
void UpdateItemCmd (unsigned char *data, int len)
 
void UpdspellCmd (unsigned char *data, int len)
 
void use_skill (int skill_id)
 

Variables

Animations animations [MAXANIM]
 
TextManagerfirstTextManager = NULL
 
int mapupdatesent = 0
 
const char *const rcsid_common_commands_c
 

Macro Definition Documentation

#define NUM_LAYERS   (MAP1_LAYERS-1)

Definition at line 1114 of file commands.c.

Referenced by MapExtendedCmd().

Function Documentation

void AddMeFail ( char *  data,
int  len 
)

Definition at line 387 of file commands.c.

References LOG(), and LOG_INFO.

+ Here is the call graph for this function:

void AddMeSuccess ( char *  data,
int  len 
)

Definition at line 398 of file commands.c.

References LOG(), and LOG_INFO.

+ Here is the call graph for this function:

void AnimCmd ( unsigned char *  data,
int  len 
)
static void common_item_command ( uint8 data,
int  len 
)
static

Definition at line 819 of file commands.c.

References GetInt_String(), GetShort_String(), item_actions(), locate_item(), LOG(), LOG_WARNING, MAX_BUF, name, and update_item().

Referenced by Item2Cmd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void DeleteInventory ( unsigned char *  data,
int  len 
)

Definition at line 960 of file commands.c.

References locate_item(), LOG(), LOG_WARNING, and remove_item_inventory().

+ Here is the call graph for this function:

void DeleteItem ( unsigned char *  data,
int  len 
)

Definition at line 941 of file commands.c.

References GetInt_String(), locate_item(), LOG(), LOG_WARNING, and remove_item().

+ Here is the call graph for this function:

void DeleteSpell ( unsigned char *  data,
int  len 
)

Definition at line 1051 of file commands.c.

References cpl, GetInt_String(), LOG(), LOG_WARNING, Spell_struct::next, Player_Struct::spelldata, Player_Struct::spells_updated, and Spell_struct::tag.

+ Here is the call graph for this function:

void DrawExtInfoCmd ( char *  data,
int  len 
)

Definition at line 526 of file commands.c.

References getTextManager(), LOG(), and LOG_WARNING.

+ Here is the call graph for this function:

void DrawInfoCmd ( char *  data,
int  len 
)

Definition at line 475 of file commands.c.

References draw_color_info(), draw_info(), LOG(), LOG_WARNING, and NDI_BLACK.

+ Here is the call graph for this function:

void ExtendedInfoSetCmd ( char *  data,
int  len 
)

Definition at line 370 of file commands.c.

int ExtSmooth ( unsigned char *  data,
int  len,
int  x,
int  y,
int  layer 
)

Definition at line 1244 of file commands.c.

References Map::cells, GetChar_String(), MapCell::need_resmooth, pl_pos, MapCell::smooth, the_map, Map::x, PlayerPosition::x, Map::y, and PlayerPosition::y.

Referenced by MapExtendedCmd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void get_exp_info ( const unsigned char *  data,
int  len 
)
static

Definition at line 75 of file commands.c.

References exp_table, exp_table_max, GetInt64_String(), GetShort_String(), LOG(), and LOG_ERROR.

Referenced by ReplyInfoCmd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void get_skill_info ( char *  data,
int  len 
)
static

Definition at line 96 of file commands.c.

References CS_NUM_SKILLS, CS_STAT_SKILLINFO, LOG(), LOG_WARNING, skill_names, and strdup_local().

Referenced by ReplyInfoCmd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ExtTextManager getTextManager ( int  type)
static

Definition at line 514 of file commands.c.

References TextManager::callback, firstTextManager, TextManager::next, and TextManager::type.

Referenced by DrawExtInfoCmd().

+ Here is the caller graph for this function:

void GoodbyeCmd ( char *  data,
int  len 
)

Definition at line 406 of file commands.c.

References LOG(), and LOG_WARNING.

+ Here is the call graph for this function:

void handle_query ( char *  data,
int  len 
)
void Item2Cmd ( unsigned char *  data,
int  len 
)

Definition at line 857 of file commands.c.

References common_item_command().

+ Here is the call graph for this function:

void item_actions ( item op)

Definition at line 801 of file commands.c.

References close_container(), Player_Struct::container, cpl, item_struct::open, open_container(), and item_struct::was_open.

Referenced by common_item_command(), and UpdateItemCmd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void MagicMapCmd ( unsigned char *  data,
int  len 
)
void map_scrollCmd ( char *  data,
int  len 
)

Definition at line 1221 of file commands.c.

References display_map_doneupdate(), display_map_startupdate(), FALSE, LOG(), LOG_WARNING, mapdata_scroll(), and TRUE.

+ Here is the call graph for this function:

void MapExtendedCmd ( unsigned char *  data,
int  len 
)
void NewmapCmd ( unsigned char *  data,
int  len 
)

Definition at line 1093 of file commands.c.

References mapdata_newmap().

+ Here is the call graph for this function:

void PickupCmd ( uint8 data,
int  len 
)

Server gives us current player's pickup.

Parameters
databuffer sent by server.
lenlength of data.

Definition at line 1399 of file commands.c.

References client_pickup(), and GetInt_String().

+ Here is the call graph for this function:

void PlayerCmd ( unsigned char *  data,
int  len 
)

Definition at line 782 of file commands.c.

References GetInt_String(), LOG(), LOG_WARNING, MAX_BUF, name, new_player(), and reset_player_data().

+ Here is the call graph for this function:

void ReplyInfoCmd ( uint8 buf,
int  len 
)

Definition at line 131 of file commands.c.

References get_exp_info(), get_image_info(), get_image_sums(), get_skill_info(), LOG(), and LOG_DEBUG.

+ Here is the call graph for this function:

void send_reply ( const char *  text)

Definition at line 769 of file commands.c.

References cpl, cs_print_string(), csocket, ClientSocket::fd, Player_Struct::no_echo, and x_set_echo().

Referenced by confirmUserPass(), dialog_callback(), do_key_press(), enter_callback(), keyfunc(), on_entry_commands_activate(), sendPassword(), sendstr(), and setUserPass().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void setTextManager ( int  type,
ExtTextManager  callback 
)

Definition at line 497 of file commands.c.

References TextManager::callback, firstTextManager, TextManager::next, and TextManager::type.

Referenced by info_init(), and init_text_callbacks().

+ Here is the caller graph for this function:

void SinkCmd ( unsigned char *  data,
int  len 
)

Definition at line 1376 of file commands.c.

void SmoothCmd ( unsigned char *  data,
int  len 
)

Definition at line 461 of file commands.c.

References addsmooth(), and GetShort_String().

+ Here is the call graph for this function:

void StatsCmd ( unsigned char *  data,
int  len 
)

Definition at line 596 of file commands.c.

References Stat_struct::ac, Stat_struct::attuned, Stat_struct::Cha, Stat_struct::Con, cpl, CS_NUM_SKILLS, CS_STAT_AC, CS_STAT_ARMOUR, CS_STAT_CHA, CS_STAT_CON, CS_STAT_DAM, CS_STAT_DEX, CS_STAT_EXP, CS_STAT_EXP64, CS_STAT_FLAGS, CS_STAT_FOOD, CS_STAT_GRACE, CS_STAT_HP, CS_STAT_INT, CS_STAT_LEVEL, CS_STAT_MAXGRACE, CS_STAT_MAXHP, CS_STAT_MAXSP, CS_STAT_POW, CS_STAT_RANGE, CS_STAT_RESIST_END, CS_STAT_RESIST_START, CS_STAT_SKILLEXP_AGILITY, CS_STAT_SKILLEXP_AGLEVEL, CS_STAT_SKILLEXP_MAGIC, CS_STAT_SKILLEXP_MALEVEL, CS_STAT_SKILLEXP_MELEVEL, CS_STAT_SKILLEXP_MENTAL, CS_STAT_SKILLEXP_PELEVEL, CS_STAT_SKILLEXP_PERSONAL, CS_STAT_SKILLEXP_PHLEVEL, CS_STAT_SKILLEXP_PHYSIQUE, CS_STAT_SKILLEXP_START, CS_STAT_SKILLEXP_WILEVEL, CS_STAT_SKILLEXP_WISDOM, CS_STAT_SKILLINFO, CS_STAT_SP, CS_STAT_SPEED, CS_STAT_SPELL_ATTUNE, CS_STAT_SPELL_DENY, CS_STAT_SPELL_REPEL, CS_STAT_STR, CS_STAT_TITLE, CS_STAT_WC, CS_STAT_WEAP_SP, CS_STAT_WEIGHT_LIM, CS_STAT_WIS, Stat_struct::dam, Stat_struct::denied, Stat_struct::Dex, draw_message_window(), draw_stats(), Stat_struct::exp, Stat_struct::flags, Stat_struct::food, GetInt64_String(), GetInt_String(), GetShort_String(), Stat_struct::grace, Stat_struct::hp, Stat_struct::Int, Stat_struct::level, LOG(), LOG_WARNING, Stat_struct::maxgrace, Stat_struct::maxhp, Stat_struct::maxsp, Stat_struct::Pow, Player_Struct::range, Stat_struct::repelled, Stat_struct::resist_change, Stat_struct::resists, script_lua_stats(), set_weight_limit(), Stat_struct::skill_exp, Stat_struct::skill_level, Stat_struct::sp, Stat_struct::speed, Player_Struct::spells_updated, Player_Struct::stats, Stat_struct::Str, Player_Struct::title, use_skill(), Stat_struct::wc, Stat_struct::weapon_sp, Stat_struct::weight_limit, and Stat_struct::Wis.

+ Here is the call graph for this function:

void TickCmd ( uint8 data,
int  len 
)

Definition at line 1383 of file commands.c.

References client_tick(), GetInt_String(), and tick.

+ Here is the call graph for this function:

void UpdspellCmd ( unsigned char *  data,
int  len 
)
void use_skill ( int  skill_id)

Definition at line 573 of file commands.c.

References last_used_skills.

Referenced by StatsCmd().

+ Here is the caller graph for this function:

Variable Documentation

TextManager* firstTextManager = NULL

Definition at line 495 of file commands.c.

Referenced by getTextManager(), setTextManager(), and SetupCmd().

int mapupdatesent = 0

Definition at line 66 of file commands.c.

Referenced by Map2Cmd(), and MapExtendedCmd().

const char* const rcsid_common_commands_c
Initial value:
=
"$Id: commands.c 9719 2008-08-04 18:57:47Z ryo_saeba $"

Definition at line 1 of file commands.c.