Crossfire Server, Branch 1.12
R12190
|
00001 /* 00002 * static char *rcsid_newclient_h = 00003 * "$Id: newclient.h 11578 2009-02-23 22:02:27Z lalo $"; 00004 */ 00005 00006 /* 00007 CrossFire, A Multiplayer game for X-windows 00008 00009 Copyright (C) 2002,2006 Mark Wedel & Crossfire Development Team 00010 Copyright (C) 1992 Frank Tore Johansen 00011 00012 This program is free software; you can redistribute it and/or modify 00013 it under the terms of the GNU General Public License as published by 00014 the Free Software Foundation; either version 2 of the License, or 00015 (at your option) any later version. 00016 00017 This program is distributed in the hope that it will be useful, 00018 but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 GNU General Public License for more details. 00021 00022 You should have received a copy of the GNU General Public License 00023 along with this program; if not, write to the Free Software 00024 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00025 00026 The authors can be reached via e-mail at crossfire-devel@real-time.com 00027 */ 00028 00053 #ifndef NEWCLIENT_H 00054 #define NEWCLIENT_H 00055 00056 #include <stddef.h> 00057 00063 #define MAP2_COORD_OFFSET 15 00064 00074 #define MAP2_COORD_ENCODE(x, y, flags) ((((x)+MAP2_COORD_OFFSET)&0x3f)<<10|(((y)+MAP2_COORD_OFFSET)&0x3f)<<4|(flags&0x0f)) 00075 00076 #define CS_QUERY_YESNO 0x1 00077 #define CS_QUERY_SINGLECHAR 0x2 00078 #define CS_QUERY_HIDEINPUT 0x4 00080 #define CS_SAY_NORMAL 0x1 00081 #define CS_SAY_SHOUT 0x2 00082 #define CS_SAY_GSAY 0x4 00089 #define FLOAT_MULTI 100000 00090 #define FLOAT_MULTF 100000.0 00091 00092 /* ID's for the various stats that get sent across. */ 00093 00094 #define CS_STAT_HP 1 00095 #define CS_STAT_MAXHP 2 00096 #define CS_STAT_SP 3 00097 #define CS_STAT_MAXSP 4 00098 #define CS_STAT_STR 5 00099 #define CS_STAT_INT 6 00100 #define CS_STAT_WIS 7 00101 #define CS_STAT_DEX 8 00102 #define CS_STAT_CON 9 00103 #define CS_STAT_CHA 10 00104 #define CS_STAT_EXP 11 00105 #define CS_STAT_LEVEL 12 00106 #define CS_STAT_WC 13 00107 #define CS_STAT_AC 14 00108 #define CS_STAT_DAM 15 00109 #define CS_STAT_ARMOUR 16 00110 #define CS_STAT_SPEED 17 00111 #define CS_STAT_FOOD 18 00112 #define CS_STAT_WEAP_SP 19 00113 #define CS_STAT_RANGE 20 00114 #define CS_STAT_TITLE 21 00115 #define CS_STAT_POW 22 00116 #define CS_STAT_GRACE 23 00117 #define CS_STAT_MAXGRACE 24 00118 #define CS_STAT_FLAGS 25 00119 #define CS_STAT_WEIGHT_LIM 26 00120 #define CS_STAT_EXP64 28 00121 #define CS_STAT_SPELL_ATTUNE 29 00122 #define CS_STAT_SPELL_REPEL 30 00123 #define CS_STAT_SPELL_DENY 31 00124 00125 /* Start & end of resistances, inclusive. */ 00126 #define CS_STAT_RESIST_START 100 00127 #define CS_STAT_RESIST_END 117 00128 #define CS_STAT_RES_PHYS 100 00129 #define CS_STAT_RES_MAG 101 00130 #define CS_STAT_RES_FIRE 102 00131 #define CS_STAT_RES_ELEC 103 00132 #define CS_STAT_RES_COLD 104 00133 #define CS_STAT_RES_CONF 105 00134 #define CS_STAT_RES_ACID 106 00135 #define CS_STAT_RES_DRAIN 107 00136 #define CS_STAT_RES_GHOSTHIT 108 00137 #define CS_STAT_RES_POISON 109 00138 #define CS_STAT_RES_SLOW 110 00139 #define CS_STAT_RES_PARA 111 00140 #define CS_STAT_TURN_UNDEAD 112 00141 #define CS_STAT_RES_FEAR 113 00142 #define CS_STAT_RES_DEPLETE 114 00143 #define CS_STAT_RES_DEATH 115 00144 #define CS_STAT_RES_HOLYWORD 116 00145 #define CS_STAT_RES_BLIND 117 00146 00147 /* Start & end of skill experience + skill level, inclusive. */ 00148 #define CS_STAT_SKILLEXP_START 118 00149 #define CS_STAT_SKILLEXP_END 129 00150 #define CS_STAT_SKILLEXP_AGILITY 118 00151 #define CS_STAT_SKILLEXP_AGLEVEL 119 00152 #define CS_STAT_SKILLEXP_PERSONAL 120 00153 #define CS_STAT_SKILLEXP_PELEVEL 121 00154 #define CS_STAT_SKILLEXP_MENTAL 122 00155 #define CS_STAT_SKILLEXP_MELEVEL 123 00156 #define CS_STAT_SKILLEXP_PHYSIQUE 124 00157 #define CS_STAT_SKILLEXP_PHLEVEL 125 00158 #define CS_STAT_SKILLEXP_MAGIC 126 00159 #define CS_STAT_SKILLEXP_MALEVEL 127 00160 #define CS_STAT_SKILLEXP_WISDOM 128 00161 #define CS_STAT_SKILLEXP_WILEVEL 129 00162 00170 #define CS_STAT_SKILLINFO 140 00171 #define CS_NUM_SKILLS 50 00172 00177 #define SF_FIREON 0x01 00178 #define SF_RUNON 0x02 00179 00195 #define NDI_BLACK 0 00196 #define NDI_WHITE 1 00197 #define NDI_NAVY 2 00198 #define NDI_RED 3 00199 #define NDI_ORANGE 4 00200 #define NDI_BLUE 5 00201 #define NDI_DK_ORANGE 6 00202 #define NDI_GREEN 7 00203 #define NDI_LT_GREEN 8 00205 #define NDI_GREY 9 00206 #define NDI_BROWN 10 00207 #define NDI_GOLD 11 00208 #define NDI_TAN 12 00210 #define NDI_MAX_COLOR 12 00211 #define NDI_COLOR_MASK 0xff 00216 #define NDI_UNIQUE 0x100 00217 #define NDI_ALL 0x200 00218 #define NDI_ALL_DMS 0x400 00220 00221 00222 enum {a_none, a_readied, a_wielded, a_worn, a_active, a_applied}; 00223 #define F_APPLIED 0x000F 00224 #define F_LOCATION 0x00F0 00225 #define F_UNPAID 0x0200 00226 #define F_MAGIC 0x0400 00227 #define F_CURSED 0x0800 00228 #define F_DAMNED 0x1000 00229 #define F_OPEN 0x2000 00230 #define F_NOPICK 0x4000 00231 #define F_LOCKED 0x8000 00232 #define F_BLESSED 0x0100 00233 00234 #define CF_FACE_NONE 0 00235 #define CF_FACE_BITMAP 1 00236 #define CF_FACE_XPM 2 00237 #define CF_FACE_PNG 3 00238 #define CF_FACE_CACHE 0x10 00239 00245 #define FACE_FLOOR 0x80 00246 #define FACE_WALL 0x40 /* Or'd into the color value by the server 00247 * right before sending. 00248 */ 00249 #define FACE_COLOR_MASK 0xf 00250 00251 #define UPD_LOCATION 0x01 00252 #define UPD_FLAGS 0x02 00253 #define UPD_WEIGHT 0x04 00254 #define UPD_FACE 0x08 00255 #define UPD_NAME 0x10 00256 #define UPD_ANIM 0x20 00257 #define UPD_ANIMSPEED 0x40 00258 #define UPD_NROF 0x80 00259 #define UPD_ALL 0xFF 00260 00261 /* The flag values sent by the updspell command */ 00262 #define UPD_SP_MANA 0x01 00263 #define UPD_SP_GRACE 0x02 00264 #define UPD_SP_DAMAGE 0x04 00265 00266 #define SOUND_NORMAL 0 00267 #define SOUND_SPELL 1 00268 00269 #define FACE_IS_ANIM 1<<15 00270 #define ANIM_RANDOM 1<<13 00271 #define ANIM_SYNC 2<<13 00272 00273 /* ANIM_FLAGS_MASK and ANIM_MASK are only used by the client */ 00274 #define ANIM_FLAGS_MASK 0x6000 00275 00276 /* AND'ing this with data from server gets us just the animation id */ 00277 #define ANIM_MASK 0x1fff 00278 00279 00280 /* Constants in the form EMI_ is for extended map infos. 00281 * Even if the client select the additionnal infos it wants 00282 * on the map, there may exist cases where this whole info 00283 * is not given in one buch but in separate bunches. This 00284 * is done performance reasons (imagine some info related to 00285 * a visible object and another info related to a 4 square 00286 * width and height area). At the begin of an extended info packet 00287 * is a bit field. A bit is activated for each extended info 00288 * present in the data 00289 */ 00290 /* Meanings: 00291 * EMI_NOREDRAW Take extended infos into account but don't redraw, 00292 * some additionnal datas will follow in a new packet 00293 * EMI_SMOOTH Datas about smoothing 00294 */ 00295 #define EMI_NOREDRAW 0x01 00296 #define EMI_SMOOTH 0x02 00297 00298 /* this last one says the bitfield continue un next byte 00299 * There may be several on contiguous bytes. So there is 7 00300 * actual bits used per byte, and the number of bytes 00301 * is not fixed in protocol 00302 */ 00303 #define EMI_HASMOREBITS 0x80 00304 00305 00306 /* 00307 * Note! 00308 * If you add message types here, don't forget 00309 * to keep the client up to date too! 00310 */ 00311 00312 00313 /* message types */ 00314 #define MSG_TYPE_BOOK 1 00315 #define MSG_TYPE_CARD 2 00316 #define MSG_TYPE_PAPER 3 00317 #define MSG_TYPE_SIGN 4 00318 #define MSG_TYPE_MONUMENT 5 00319 #define MSG_TYPE_DIALOG 6 00320 #define MSG_TYPE_MOTD 7 00321 #define MSG_TYPE_ADMIN 8 00322 #define MSG_TYPE_SHOP 9 00323 #define MSG_TYPE_COMMAND 10 /* Responses to commands, eg, who */ 00324 #define MSG_TYPE_ATTRIBUTE 11 /* Changes to attributes (stats, */ 00325 /* resistances, etc) */ 00326 #define MSG_TYPE_SKILL 12 /* Messages related to using skills */ 00327 #define MSG_TYPE_APPLY 13 /* Applying objects */ 00328 #define MSG_TYPE_ATTACK 14 /* Attack related messages */ 00329 #define MSG_TYPE_COMMUNICATION 15 /* Communication between players */ 00330 #define MSG_TYPE_SPELL 16 /* Spell related info */ 00331 #define MSG_TYPE_ITEM 17 /* Item related information */ 00332 #define MSG_TYPE_MISC 18 /* Messages that don't go anyplace else */ 00333 #define MSG_TYPE_VICTIM 19 /* Something bad is happening to the player */ 00334 #define MSG_TYPE_LAST 20 00335 00336 #define MSG_SUBTYPE_NONE 0 00337 00338 /* book messages subtypes */ 00339 #define MSG_TYPE_BOOK_CLASP_1 1 00340 #define MSG_TYPE_BOOK_CLASP_2 2 00341 #define MSG_TYPE_BOOK_ELEGANT_1 3 00342 #define MSG_TYPE_BOOK_ELEGANT_2 4 00343 #define MSG_TYPE_BOOK_QUARTO_1 5 00344 #define MSG_TYPE_BOOK_QUARTO_2 6 00345 #define MSG_TYPE_BOOK_SPELL_EVOKER 7 00346 #define MSG_TYPE_BOOK_SPELL_PRAYER 8 00347 #define MSG_TYPE_BOOK_SPELL_PYRO 9 00348 #define MSG_TYPE_BOOK_SPELL_SORCERER 10 00349 #define MSG_TYPE_BOOK_SPELL_SUMMONER 11 00350 00351 /* card messages subtypes*/ 00352 #define MSG_TYPE_CARD_SIMPLE_1 1 00353 #define MSG_TYPE_CARD_SIMPLE_2 2 00354 #define MSG_TYPE_CARD_SIMPLE_3 3 00355 #define MSG_TYPE_CARD_ELEGANT_1 4 00356 #define MSG_TYPE_CARD_ELEGANT_2 5 00357 #define MSG_TYPE_CARD_ELEGANT_3 6 00358 #define MSG_TYPE_CARD_STRANGE_1 7 00359 #define MSG_TYPE_CARD_STRANGE_2 8 00360 #define MSG_TYPE_CARD_STRANGE_3 9 00361 #define MSG_TYPE_CARD_MONEY_1 10 00362 #define MSG_TYPE_CARD_MONEY_2 11 00363 #define MSG_TYPE_CARD_MONEY_3 12 00364 00365 /* Paper messages subtypes */ 00366 #define MSG_TYPE_PAPER_NOTE_1 1 00367 #define MSG_TYPE_PAPER_NOTE_2 2 00368 #define MSG_TYPE_PAPER_NOTE_3 3 00369 #define MSG_TYPE_PAPER_LETTER_OLD_1 4 00370 #define MSG_TYPE_PAPER_LETTER_OLD_2 5 00371 #define MSG_TYPE_PAPER_LETTER_NEW_1 6 00372 #define MSG_TYPE_PAPER_LETTER_NEW_2 7 00373 #define MSG_TYPE_PAPER_ENVELOPE_1 8 00374 #define MSG_TYPE_PAPER_ENVELOPE_2 9 00375 #define MSG_TYPE_PAPER_SCROLL_OLD_1 10 00376 #define MSG_TYPE_PAPER_SCROLL_OLD_2 11 00377 #define MSG_TYPE_PAPER_SCROLL_NEW_1 12 00378 #define MSG_TYPE_PAPER_SCROLL_NEW_2 13 00379 #define MSG_TYPE_PAPER_SCROLL_MAGIC 14 00380 00381 /* road signs messages subtypes */ 00382 #define MSG_TYPE_SIGN_BASIC 1 00383 #define MSG_TYPE_SIGN_DIR_LEFT 2 00384 #define MSG_TYPE_SIGN_DIR_RIGHT 3 00385 #define MSG_TYPE_SIGN_DIR_BOTH 4 00386 00387 /* stones and monument messages */ 00388 #define MSG_TYPE_MONUMENT_STONE_1 1 00389 #define MSG_TYPE_MONUMENT_STONE_2 2 00390 #define MSG_TYPE_MONUMENT_STONE_3 3 00391 #define MSG_TYPE_MONUMENT_STATUE_1 4 00392 #define MSG_TYPE_MONUMENT_STATUE_2 5 00393 #define MSG_TYPE_MONUMENT_STATUE_3 6 00394 #define MSG_TYPE_MONUMENT_GRAVESTONE_1 7 00395 #define MSG_TYPE_MONUMENT_GRAVESTONE_2 8 00396 #define MSG_TYPE_MONUMENT_GRAVESTONE_3 9 00397 #define MSG_TYPE_MONUMENT_WALL_1 10 00398 #define MSG_TYPE_MONUMENT_WALL_2 11 00399 #define MSG_TYPE_MONUMENT_WALL_3 12 00400 00401 /* dialog messsage */ 00402 #define MSG_TYPE_DIALOG_NPC 1 /* A message from the npc */ 00403 #define MSG_TYPE_DIALOG_ALTAR 2 /* A message from an altar */ 00404 #define MSG_TYPE_DIALOG_MAGIC_MOUTH 3 /* Magic Mouth/Magic Ear */ 00405 00406 /* MOTD doesn't have any subtypes */ 00407 00408 /* admin/global messages */ 00409 #define MSG_TYPE_ADMIN_RULES 1 00410 #define MSG_TYPE_ADMIN_NEWS 2 00411 #define MSG_TYPE_ADMIN_PLAYER 3 /* Player coming/going/death */ 00412 #define MSG_TYPE_ADMIN_DM 4 /* DM related admin actions */ 00413 #define MSG_TYPE_ADMIN_HISCORE 5 /* Hiscore list */ 00414 #define MSG_TYPE_ADMIN_LOADSAVE 6 /* load/save operations */ 00415 #define MSG_TYPE_ADMIN_LOGIN 7 /* login messages/errors */ 00416 #define MSG_TYPE_ADMIN_VERSION 8 /* version info */ 00417 00418 00419 /* I'm not actually expecting anything to make much use of the MSG_TYPE_SHOP 00420 * values However, to use the media tags, need to use draw_ext_info, and need 00421 * to have a type/subtype, so figured might as well put in real values here. 00422 */ 00423 #define MSG_TYPE_SHOP_LISTING 1 /* Shop listings - inventory, */ 00424 /* what it deals in */ 00425 #define MSG_TYPE_SHOP_PAYMENT 2 /* Messages about payment, lack */ 00426 /* of funds */ 00427 #define MSG_TYPE_SHOP_SELL 3 /* Messages about selling items */ 00428 #define MSG_TYPE_SHOP_MISC 4 /* Random messages */ 00429 00430 /* Basically, 1 subtype/command. Like shops, not expecting much 00431 * to be done, but by having different subtypes, it makes it easier for 00432 * client to store way information (eg, who output) 00433 */ 00434 #define MSG_TYPE_COMMAND_WHO 1 00435 #define MSG_TYPE_COMMAND_MAPS 2 00436 #define MSG_TYPE_COMMAND_BODY 3 00437 #define MSG_TYPE_COMMAND_MALLOC 4 00438 #define MSG_TYPE_COMMAND_WEATHER 5 00439 #define MSG_TYPE_COMMAND_STATISTICS 6 00440 #define MSG_TYPE_COMMAND_CONFIG 7 /* bowmode, petmode, applymode */ 00441 #define MSG_TYPE_COMMAND_INFO 8 /* Generic info - resistances, etc */ 00442 #define MSG_TYPE_COMMAND_QUESTS 9 /* Quest info */ 00443 #define MSG_TYPE_COMMAND_DEBUG 10 /* Various debug type commands */ 00444 #define MSG_TYPE_COMMAND_ERROR 11 /* Bad syntax/can't use command */ 00445 #define MSG_TYPE_COMMAND_SUCCESS 12 /* Successful result from command */ 00446 #define MSG_TYPE_COMMAND_FAILURE 13 /* Failed result from command */ 00447 #define MSG_TYPE_COMMAND_EXAMINE 14 /* Player examining something */ 00448 #define MSG_TYPE_COMMAND_INVENTORY 15 /* Inventory listing */ 00449 #define MSG_TYPE_COMMAND_HELP 16 /* Help related information */ 00450 #define MSG_TYPE_COMMAND_DM 17 /* DM related commands */ 00451 #define MSG_TYPE_COMMAND_NEWPLAYER 18 /* Create a new character - not */ 00452 /* really a command, but is responding */ 00453 /* to player input */ 00454 00455 /* This is somewhat verbose. If the client ends up being able to 00456 * choose various attributes based on message type, I think it is important 00457 * for the client to know if this is a benefit or detriment to the player. 00458 * In the case of losing a bonus, this typically indicates a spell has 00459 * ended, which is probably more important (and should be displayed more 00460 * prominently) than when you cast the spell 00461 */ 00462 00463 #define MSG_TYPE_ATTRIBUTE_ATTACKTYPE_GAIN 1 /* Atacktypes here refer to */ 00464 #define MSG_TYPE_ATTRIBUTE_ATTACKTYPE_LOSS 2 /* the player gaining or */ 00465 /* losing these attacktypes */ 00466 /* not being a victim of an */ 00467 /* attacktype. */ 00468 #define MSG_TYPE_ATTRIBUTE_PROTECTION_GAIN 3 /* Protections in this */ 00469 #define MSG_TYPE_ATTRIBUTE_PROTECTION_LOSS 4 /* context are pretty */ 00470 /* generic - things like */ 00471 /* reflection or lifesave */ 00472 /* are also under the */ 00473 /* protection category. */ 00474 #define MSG_TYPE_ATTRIBUTE_MOVE 5 /* A change in the movement */ 00475 /* type of the player */ 00476 #define MSG_TYPE_ATTRIBUTE_RACE 6 /* Racial related changes */ 00477 #define MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START 7 /* The start/end of bad */ 00478 #define MSG_TYPE_ATTRIBUTE_BAD_EFFECT_END 8 /* effects to the player */ 00479 #define MSG_TYPE_ATTRIBUTE_STAT_GAIN 9 /* Start/end of stat changes */ 00480 #define MSG_TYPE_ATTRIBUTE_STAT_LOSS 10 00481 #define MSG_TYPE_ATTRIBUTE_LEVEL_GAIN 11 /* Gaining/losing of levels */ 00482 #define MSG_TYPE_ATTRIBUTE_LEVEL_LOSS 12 00483 #define MSG_TYPE_ATTRIBUTE_GOOD_EFFECT_START 13 /* Like bad effects, but for */ 00484 #define MSG_TYPE_ATTRIBUTE_GOOD_EFFECT_END 14 /* good effects to the player */ 00485 #define MSG_TYPE_ATTRIBUTE_GOD 15 /* changing god info */ 00486 00487 00488 /* I think one type/skill is overkill, so instead, use broader categories 00489 * for these messages. 00490 * The difference in ERROR vs FAILURE is basically this: ERROR indicates 00491 * something wasn't right to even attempt to use the skill (don't have 00492 * needed object, or haven't marked objects, etc). 00493 * FAILURE indicates that player attempted to use the skill, but it 00494 * didn't work. 00495 * PRAY is listed out because praying over altars can generate some 00496 * messages not really related to the skill itself. 00497 */ 00498 #define MSG_TYPE_SKILL_MISSING 1 /* Don't have the skill */ 00499 #define MSG_TYPE_SKILL_ERROR 2 /* Doing something wrong */ 00500 #define MSG_TYPE_SKILL_SUCCESS 3 /* Successfully used skill */ 00501 #define MSG_TYPE_SKILL_FAILURE 4 /* Failure in using skill */ 00502 #define MSG_TYPE_SKILL_PRAY 5 /* Praying related messages */ 00503 #define MSG_TYPE_SKILL_LIST 6 /* List of skills */ 00504 00505 00506 /* Messages related to applying objects. Note that applying many 00507 * objects may generate MSG_TYPE_ATTRIBUTE messages - the APPLY here 00508 * more directly related to the direct messages related to applying 00509 * them (you put on your armor, you apply scroll, etc). 00510 * The ERROR is like that for SKILLS - something prevent even trying 00511 * to apply the object. FAILURE indicates result wasn't successful. 00512 */ 00513 #define MSG_TYPE_APPLY_ERROR 1 00514 #define MSG_TYPE_APPLY_UNAPPLY 2 /* Unapply an object */ 00515 #define MSG_TYPE_APPLY_SUCCESS 3 /* Was able to apply object */ 00516 #define MSG_TYPE_APPLY_FAILURE 4 /* Apply OK, but no/bad result */ 00517 #define MSG_TYPE_APPLY_CURSED 5 /* Applied a cursed object (BAD) */ 00518 #define MSG_TYPE_APPLY_TRAP 6 /* Have activated a trap */ 00519 #define MSG_TYPE_APPLY_BADBODY 7 /* Don't have body to use object */ 00520 #define MSG_TYPE_APPLY_PROHIBITION 8 /* Class/god prohibiiton on obj */ 00521 #define MSG_TYPE_APPLY_BUILD 9 /* Build related actions */ 00522 00523 /* attack related messages */ 00524 #define MSG_TYPE_ATTACK_DID_HIT 1 /* Player hit something else */ 00525 #define MSG_TYPE_ATTACK_PET_HIT 2 /* Players pet hit something else */ 00526 #define MSG_TYPE_ATTACK_FUMBLE 3 /* Player fumbled attack */ 00527 #define MSG_TYPE_ATTACK_DID_KILL 4 /* Player killed something */ 00528 #define MSG_TYPE_ATTACK_PET_DIED 5 /* Pet was killed */ 00529 #define MSG_TYPE_ATTACK_NOKEY 6 /* Keys are like attacks, so... */ 00530 #define MSG_TYPE_ATTACK_NOATTACK 7 /* You avoid attacking */ 00531 #define MSG_TYPE_ATTACK_PUSHED 8 /* Pushed a friendly player */ 00532 #define MSG_TYPE_ATTACK_MISS 9 /* attack didn't hit */ 00533 00534 #define MSG_TYPE_COMMUNICATION_RANDOM 1 /* Random event (coin toss) */ 00535 #define MSG_TYPE_COMMUNICATION_SAY 2 /* Player says something */ 00536 #define MSG_TYPE_COMMUNICATION_ME 3 /* Player me's a message */ 00537 #define MSG_TYPE_COMMUNICATION_TELL 4 /* Player tells something */ 00538 #define MSG_TYPE_COMMUNICATION_EMOTE 5 /* Player emotes */ 00539 #define MSG_TYPE_COMMUNICATION_PARTY 6 /* Party message */ 00540 #define MSG_TYPE_COMMUNICATION_SHOUT 7 /* Party message */ 00541 #define MSG_TYPE_COMMUNICATION_CHAT 8 /* Party message */ 00542 00543 #define MSG_TYPE_SPELL_HEAL 1 /* Healing related spells */ 00544 #define MSG_TYPE_SPELL_PET 2 /* Pet related messages */ 00545 #define MSG_TYPE_SPELL_FAILURE 3 /* Spell failure messages */ 00546 #define MSG_TYPE_SPELL_END 4 /* A spell ends */ 00547 #define MSG_TYPE_SPELL_SUCCESS 5 /* Spell succeeded messages */ 00548 #define MSG_TYPE_SPELL_ERROR 6 /* Spell failure messages */ 00549 #define MSG_TYPE_SPELL_PERCEIVE_SELF 7 /* Perceive self messages */ 00550 #define MSG_TYPE_SPELL_TARGET 8 /* Target of non attack spell */ 00551 #define MSG_TYPE_SPELL_INFO 9 /* random info about spell, not */ 00552 /* related to failure/success */ 00553 00554 #define MSG_TYPE_ITEM_REMOVE 1 /* Item removed from inv */ 00555 #define MSG_TYPE_ITEM_ADD 2 /* Item added to inv */ 00556 #define MSG_TYPE_ITEM_CHANGE 3 /* Item has changed in some way */ 00557 #define MSG_TYPE_ITEM_INFO 3 /* Information related to an item */ 00558 00559 /* MSG_TYPE_MISC, by its very nature, doesn't really have subtypes. It is 00560 * used for messages that really don't belong anyplace else 00561 */ 00562 00563 #define MSG_TYPE_VICTIM_SWAMP 1 /* Player is sinking in a swamp */ 00564 #define MSG_TYPE_VICTIM_WAS_HIT 2 /* Player was hit by something */ 00565 #define MSG_TYPE_VICTIM_STEAL 3 /* Someone tried to steal from the player */ 00566 #define MSG_TYPE_VICTIM_SPELL 4 /* Someone cast a bad spell on the player */ 00567 #define MSG_TYPE_VICTIM_DIED 5 /* Player died! */ 00568 #define MSG_TYPE_VICTIM_WAS_PUSHED 6 /* Player was pushed or attempted pushed */ 00569 00571 typedef struct SockList { 00572 size_t len; 00573 unsigned char buf[2+65536UL+1]; /* 2=length, 65536=content, 1=trailing NUL */ 00574 } SockList; 00575 00577 typedef struct CS_Stats { 00578 int ibytes; 00579 int obytes; 00580 short max_conn; 00581 time_t time_start; 00582 } CS_Stats; 00583 00584 extern CS_Stats cst_tot, cst_lst; 00585 00586 #endif /* NEWCLIENT_H */