 |
Crossfire Client, Trunk
|
Go to the documentation of this file.
13 #define CLIENT_TYPES_H
22 #include <sys/types.h>
29 # include <winsock2.h>
37 #define SOL_TCP IPPROTO_TCP
45 typedef void (*
ExtTextManager)(
int flag,
int type,
int subtype,
char* message);
59 #define MAX_TIME 100000
65 #define DEFPORT "13327"
67 #define VERSION_CS 1023
68 #define VERSION_SC 1030
76 #define COMMAND_WINDOW 10
78 #define STRINGCOMMAND 0
84 #define MAX_SKILL CS_NUM_SKILLS
115 #define COMMAND_MAX 255
124 GSocketConnection*
fd;
183 #define CONFIG_DOWNLOAD 1
184 #define CONFIG_ECHO 2
185 #define CONFIG_FASTTCP 3
186 #define CONFIG_CWINDOW 4
187 #define CONFIG_CACHE 5
188 #define CONFIG_FOGWAR 6
189 #define CONFIG_ICONSCALE 7
190 #define CONFIG_MAPSCALE 8
191 #define CONFIG_POPUPS 9
192 #define CONFIG_DISPLAYMODE 10
193 #define CONFIG_SHOWICON 11
194 #define CONFIG_TOOLTIPS 12
195 #define CONFIG_SOUND 13
196 #define CONFIG_SPLITINFO 14
197 #define CONFIG_SPLITWIN 15
198 #define CONFIG_SHOWGRID 16
199 #define CONFIG_LIGHTING 17
200 #define CONFIG_TRIMINFO 18
201 #define CONFIG_MAPWIDTH 19
202 #define CONFIG_MAPHEIGHT 20
203 #define CONFIG_FOODBEEP 21
204 #define CONFIG_DARKNESS 22
205 #define CONFIG_PORT 23
206 #define CONFIG_GRAD_COLOR 24
207 #define CONFIG_RESISTS 25
208 #define CONFIG_SMOOTH 26
209 #define CONFIG_SPLASH 27
210 #define CONFIG_APPLY_CONTAINER 28
211 #define CONFIG_MAPSCROLL 29
213 #define CONFIG_SIGNPOPUP 30
214 #define CONFIG_TIMESTAMP 31
215 #define CONFIG_AUTO_AFK 32
216 #define CONFIG_INV_MENU 33
217 #define CONFIG_MUSIC_VOL 34
218 #define CONFIG_SERVER_TICKS 35 //< Send "setup tick 1" for the server to send ticks, else generate our own
219 #define CONFIG_NUMS 36
228 #define CFG_LT_NONE 0
229 #define CFG_LT_TILE 1
230 #define CFG_LT_PIXEL 2
231 #define CFG_LT_PIXEL_BEST 3
239 #define CFG_DM_PIXMAP 0
241 #define CFG_DM_OPENGL 2
383 #define MAX_FACE_SETS 20
384 #define MAX_IMAGE_SIZE 320
445 #define NUM_RESISTS 18
468 #define MAP_MAX_SIZE 25
477 #define MIN_ALLOCATED_MAP_SIZE MAP_MAX_SIZE * 2
484 #define MAX_MAP_OFFSET 8
492 #define MAXPIXMAPNUM 10000
520 #define RI_IMAGE_INFO 0x1
521 #define RI_IMAGE_SUMS 0x2
562 #define NUM_NEW_CHAR_STATS 7
617 #define MIN(X__,Y__) ( (X__)<(Y__)?(X__):(Y__) )
631 #define CLIENT_ERROR client_error_quark()
634 return g_quark_from_static_string(
"client-error-quark");
gint16 skill_level[MAX_SKILL]
Level of known skills.
@ LOG_INFO
Minor, non-harmful issues.
#define NUM_RESISTS
Translation of the STAT_RES names into printable names, in matching order.
char message[10000]
This is huge, the packets can't be much bigger than this anyway.
@ LOG_WARNING
Warning that something might not work.
const char * widget_suffix
void(* ExtTextManager)(int flag, int type, int subtype, char *message)
struct Animations Animations
The usage of the stat_mapping is to simplify the code and make it easier to expand.
guint32 tag
Unique ID number for a spell so updspell etc can operate on it.
Holds the names that correspond to skill and resistance numbers.
gint64 skill_exp[MAX_SKILL]
Experience points for skills.
char title[MAX_BUF]
Title of character.
const char * style_name
Name of this message in the configfile.
guint32 fire_on
True if fire key is pressed.
void client_mapsize(int width, int height)
Ask the server for the given map size.
For classes & races, the server can present some number of choices, eg, the character gets to choose ...
int subtype
Subtype of message.
Input_State input_state
What the input state is.
Used mostly in the cache.c file, however, it can be returned to the graphic side of things so that th...
guint32 run_on
True if run key is on.
#define COMMAND_MAX
Largest ncom command number to send before wrapping.
const char *const resists_name[NUM_RESISTS]
gint16 food
Quantity food in stomach.
guint16 mapyres
Resolution to draw on the magic map.
char spells[255][40]
List of all the spells the.
guint32 meta_on
True if fire key is pressed.
struct Face_Information_struct Face_Information
One struct that holds most of the image related data to reduce danger of namespace collision.
NameMapping resist_mapping[NUM_RESISTS]
gint32 weapon_sp
Weapon speed (displayed in client as a float)
guint8 num_animations
Number of animations.
int command_time
Time (in ms) players commands currently take to execute.
Face_Information face_info
gint16 maxgrace
Maximum spell points.
void client_disconnect(void)
Closes the connection to the server.
void client_run(void)
Read available packets from the server and handle commands until there are no more,...
guint8 skill_number
The index in the skill arrays, plus CS_STAT_SKILLINFO.
char requirements[256]
Spellmon 2 data.
guint16 count_left
count for commands
bool client_is_connected(void)
char input_text[MAX_BUF]
keys typed (for long commands)
int sc_version
Server versions of these.
const char *const config_names[CONFIG_NUMS]
See common/init.c - number mapping used when loading/saving the values.
gint16 resists[30]
Resistant values.
struct TextManager * next
guint16 flags
Contains fire on/run on flags.
struct Cache_Entry Cache_Entry
Used mostly in the cache.c file, however, it can be returned to the graphic side of things so that th...
gint16 grace
Spell points for using prayers.
guint32 resist_change
Resistant value change flag.
@ LOG_CRITICAL
Fatal crash-worthy error.
char * printable(void *data, int len)
Replace the non-printable characters in 'data' with a dot ('.
struct Spell_struct * next
Starting_Map_Info * starting_map_info
#define NUM_NEW_CHAR_STATS
NameMapping skill_mapping[MAX_SKILL]
gint16 sp
Spell points for casting spells.
gint32 face
A face ID that may be used to show a graphic representation of the spell.
#define CONFIG_NUMS
This should always be the last value in the CONFIG_xxx list.
item * container
open container
void client_connect(const char *hostname)
Open a socket to the given hostname and store connection information.
gint32 speed
Speed (is displayed as a float)
struct FaceSets_struct FaceSets
gint8 level
Experience level.
gint16 maxhp
Maximum hit points.
char last_command[MAX_BUF]
Last command entered.
struct RC_Choice * rc_choice
item * ranges[range_size]
Object that is used for that.
char name[256]
One length byte plus data
GSource * client_get_source(void)
Return a source triggered when input from the server is available.
char range[MAX_BUF]
Range attack chosen.
gint16 maxsp
Maximum spell points.
char * skill
Pointer to the skill name, derived from the skill number.
#define MAX_SKILL
How many skill types server supports/client will get sent to it.
struct Spell_struct Spell
guint32 alt_on
True if fire key is pressed.
gint16 want_config[CONFIG_NUMS]
gint8 stat_adj[NUM_NEW_CHAR_STATS]
struct Race_Class_Info Race_Class_Info
guint8 * magicmap
Magic map data.
guint32 no_echo
If TRUE, don't echo keystrokes.
guint32 path
The bitmask of paths this spell belongs to.
char * skill_names[MAX_SKILL]
char * name
Name of PC, set and freed in account.c play_character() (using data returned from server to AccountPl...
struct Stat_Mapping stat_mapping[NUM_NEW_CHAR_STATS]
gint16 dam
How much damage this object does for each hit.
TextManager * firstTextManager
guint8 usage
Spellmon 2 data.
GQuark client_error_quark()
Basic support for socket communications, including the file descriptor, input buffer,...
guint8 showmagic
If 0, show the normal map, otherwise show the magic map.
int last_used_skills[MAX_SKILL+1]
maps position to skill id with trailing zero as stop mark.
Client_Player cpl
Player object.
guint16 pmapy
Where the player is on the magic map.
@ LOG_ERROR
Warning that something definitely didn't work.
item * below
Items below the player (pl.below->inv)
guint16 sp
Mana per cast; may be zero.
struct Starting_Map_Info Starting_Map_Info
guint32 repelled
Spell paths to which the player is repelled.
guint16 dam
Damage done by spell though the meaning is spell dependent and actual damage may depend on how the sp...
struct TextManager TextManager
guint16 level
The casting level of the spell.
guint32 weight_limit
Carrying weight limit.
guint32 count
Repeat count on command.
PlayerPosition pl_pos
Position of the player on the internal map.
struct Msg_Type_Names Msg_Type_Names
gint16 use_config[CONFIG_NUMS]
guint8 ready_spell
Index to spell that is readied.
guint32 denied
Spell paths denied to the player.
guint16 mmapy
size of magic map
guint16 time
Casting time in server ticks.
guint16 grace
Grace per cast; may be zero.
Animations animations[MAXANIM]
guint32 attuned
Spell paths to which the player is attuned.
Spell * spelldata
List of spells known.
guint32 spells_updated
Whether or not spells updated.
@ LOG_DEBUG
Useful debugging information.
struct PlayerPosition PlayerPosition
void client_negotiate(int sound)
This function negotiates the characteriistics of a connection to the server.
bool client_write(const void *buf, int len)
Write the given data to the server.
struct Player_Struct Client_Player
struct Cache_Entry * next
Race_Class_Info * classes