Go to the documentation of this file.
54 #include <sys/types.h>
55 #include <netinet/in.h>
56 #include <netinet/tcp.h>
71 #define VALIDCHAR_MSG "The first character must be alphanumeric and the last cannot be a space. None of these characters are allowed: :;/\\["
148 if (len <= 0 || !
buf) {
168 for (;
buf[s] &&
buf[s] !=
' '; s++)
174 while (
buf[s] ==
' ')
180 for (;
buf[s] &&
buf[s] !=
' '; s++)
184 while (s < len &&
buf[s] ==
' ')
189 if (!strcmp(cmd,
"sound2")) {
192 }
else if (!strcmp(cmd,
"spellmon")) {
195 monitor_spells = atoi(param);
196 if (monitor_spells < 0 || monitor_spells > 2) {
202 }
else if (!strcmp(cmd,
"darkness")) {
205 darkness = atoi(param);
206 if (darkness != 0 && darkness != 1) {
212 }
else if (!strcmp(cmd,
"map2cmd")) {
215 map2cmd = atoi(param);
221 }
else if (!strcmp(cmd,
"facecache")) {
224 facecache = atoi(param);
225 if (facecache != 0 && facecache != 1) {
231 }
else if (!strcmp(cmd,
"faceset")) {
237 }
else if (!strcmp(cmd,
"mapsize")) {
240 if (sscanf(param,
"%dx%d%n", &
x, &
y, &n) != 2 || n != (
int)strlen(param)) {
249 if ((
x <= 0) && (
y <= 0)) {
282 }
else if (!strcmp(cmd,
"tick")) {
286 if (tick != 0 && tick != 1) {
292 }
else if (!strcmp(cmd,
"bot")) {
295 is_bot = atoi(param);
296 if (is_bot != 0 && is_bot != 1) {
302 }
else if (!strcmp(cmd,
"want_pickup")) {
305 want_pickup = atoi(param);
306 if (want_pickup != 0 && want_pickup != 1) {
312 }
else if (!strcmp(cmd,
"num_look_objects")) {
330 }
else if (!strcmp(cmd,
"extended_stats")) {
333 extended_stats = atoi(param);
334 if (extended_stats != 0 && extended_stats != 1) {
340 }
else if (!strcmp(cmd,
"beat")) {
341 int use_beat = atoi(param);
343 if (use_beat != 0 && use_beat != 1) {
351 }
else if (!strcmp(cmd,
"loginmethod")) {
354 loginmethod = atoi(param);
357 if (loginmethod > 2) loginmethod=2;
362 }
else if (!strcmp(cmd,
"notifications")) {
365 notifications = atoi(param);
370 }
else if (!strcmp(cmd,
"newmapcmd")) {
378 }
else if (!strcmp(cmd,
"extendedTextInfos")) {
384 }
else if (!strcmp(cmd,
"itemcmd")) {
390 }
else if (!strcmp(cmd,
"exp64")) {
443 "Warning: Your client is too old to receive map data. Please update to a new client at: "
444 "https://sourceforge.net/projects/crossfire/");
460 const Face *smoothface;
479 "Could not smooth face %s. "
480 "Check that this face has a smoothing pixmap, or remove its smoothlevel.\n",
506 if (len <= 0 || !
buf) {
507 LOG(
llevDebug,
"IP '%s' sent bogus ask_smooth_cmd information\n", ns->
host);
534 LOG(
llevDebug,
"Corrupt ncom command - not long enough - discarding\n");
557 "You can not issue commands - state is not ST_PLAYING (%s)",
563 if (
pl->ob->speed_left < 0) {
564 LOG(
llevError,
"Player %s (%s) has negative time - shouldn't do command.\n",
565 pl->ob->name ?
pl->ob->name :
"(unnamed)",
pl->socket->account_name ?
pl->socket->account_name :
"(no account)");
579 if (
FABS(
pl->ob->speed) < 0.001)
591 if (len <= 0 || !
buf) {
592 LOG(
llevDebug,
"Player '%s' sent bogus reply_cmd information\n",
pl->ob->name);
600 LOG(
llevError,
"Got reply message with ST_PLAYING input state\n");
653 char *cs_str = strtok_r(
buf,
" ", &
rest);
654 char *sc_str = strtok_r(NULL,
" ", &
rest);
657 if (cs_str == NULL || sc_str == NULL) {
676 LOG(
llevInfo,
"Connection from %s (%s), CS %d, SC %d\n",
711 if (len <= 0 || !
buf) {
712 LOG(
llevDebug,
"Player '%s' sent bogus move_cmd information\n",
pl->ob->name);
721 for (i = 0; i < 2; i++) {
723 if (!(
buf = strchr(
buf,
' '))) {
755 #define AddIfInt64(Old, New, sl, Type) \
758 SockList_AddChar(sl, Type); \
759 SockList_AddInt64(sl, New); \
762 #define AddIfInt(Old, New, sl, Type) \
765 SockList_AddChar(sl, Type); \
766 SockList_AddInt(sl, New); \
769 #define AddIfShort(Old, New, sl, Type) \
772 SockList_AddChar(sl, Type); \
773 SockList_AddShort(sl, New); \
776 #define AddIfFloat(Old, New, sl, Type) \
779 SockList_AddChar(sl, Type); \
780 SockList_AddInt(sl, (long)(New*FLOAT_MULTI));\
783 #define AddIfString(Old, New, sl, Type) \
784 if (Old == NULL || strcmp(Old, New)) { \
786 Old = strdup_local(New); \
787 SockList_AddChar(sl, Type); \
788 SockList_AddLen8Data(sl, New, strlen(New)); \
797 const int16_t until =
MIN(11,
pl->ob->level);
798 for (int16_t i = 1; i < until; i++) {
799 if (
pl->levhp[i] < 9 ||
pl->levsp[i] < 6 ||
pl->levgrace[i] < 3) {
813 const char *god =
"none";
815 if (
pl->socket->notifications < 3) {
827 if (QUERY_FLAG(pl->ob, F)) { \
840 if (strcmp(
item->arch->name,
"poisoning") == 0) {
843 if (strcmp(
item->arch->name,
"blindness") == 0) {
846 if (
item->type ==
FORCE && strcmp(
item->name,
"confusion") == 0) {
876 if (
pl->ob != NULL) {
891 if (
pl->socket->extended_stats) {
892 int16_t golem_hp, golem_maxhp;
900 if (
pl->ob != NULL) {
935 if (
pl->last_skill_ob[s]) {
939 LOG(
llevDebug,
"pruning removed object from last_skill_ob\n");
940 pl->last_skill_ob[s] = NULL;
944 if (
pl->last_skill_exp[s] !=
pl->last_skill_ob[s]->stats.exp) {
951 pl->last_skill_exp[s] =
pl->last_skill_ob[s]->stats.exp;
971 if (
pl->socket->sc_version < 1025) {
983 if (
pl->socket->monitor_spells) {
1012 pl->last_weight = weight;
1055 for (i = 0; i <
anim->num_animations; i++) {
1075 memset(cell->
faces, face,
sizeof(cell->
faces));
1078 #define MAX_HEAD_POS MAX(MAX_CLIENT_X, MAX_CLIENT_Y)
1115 uint8_t nlayer, smoothlevel = 0;
1121 const Face *face =
ob->face;
1145 if (bx < ax || by < ay) {
1146 LOG(
llevError,
"map2_add_ob: bx (%d) or by (%d) is less than ax (%d) or ay (%d)\n", bx, by, ax, ay);
1153 for (
l = layer-1;
l <= layer+1;
l++) {
1156 if (
heads[by][bx][
l] == head)
1163 if (!
heads[by][bx][layer])
1164 heads[by][bx][layer] = head;
1166 heads[by][bx][layer+1] = head;
1171 uint16_t face_num = face ? face->
number : 0;
1175 face_num = (
ob->animation ?
ob->animation->num : 0)|(1<<15);
1187 uint8_t len, anim_speed = 0, i;
1199 smoothlevel =
ob->smoothlevel;
1210 anim_speed =
ob->anim_speed;
1211 else if (
FABS(
ob->speed) < 0.004)
1213 else if (
FABS(
ob->speed) >= 1.0)
1216 anim_speed = (
int)(1.0/
FABS(
ob->speed));
1264 nlayer = 0x10+layer+(2<<5);
1285 int got_one = 0, poisoned = 0, diseased = 0;
1287 int value, granularity;
1288 const object *
probe;
1310 granularity = (
probe->level - 14) / 3;
1311 if (granularity <= 0)
1313 else if (granularity > 30)
1317 if (
ob->stats.maxhp > 0) {
1318 value = (
ob->stats.hp * granularity) / (
ob->stats.maxhp);
1322 else if (
value > granularity)
1323 value = granularity;
1337 snprintf(
name,
sizeof(
name),
"hpbar%s%s%s_%d",
1338 poisoned ?
"_poisoned" :
"",
1339 diseased ?
"_diseased" :
"",
1340 (!poisoned && !diseased) ?
"_standard" :
"",
1343 if (dummy != NULL) {
1357 int len = strlen(label);
1358 if (len > 256 - 2 - 1) {
1359 LOG(
llevError,
"The label '%s' is too long to send to the client.", label);
1371 int got_one =
check_probe(ax, ay,
ob, sl, ns, has_obj, alive_layer);
1376 if (dummy != NULL) {
1387 }
else if (plyr->
party) {
1388 if (
ob->contr &&
ob->contr->party == plyr->
party) {
1414 int layer, got_one = 0, del_one = 0, oldlen, has_obj = 0;
1421 for (layer = 0; layer <
MAP_LAYERS; layer++) {
1424 head =
heads[ay][ax][layer];
1429 got_one +=
map2_add_ob(ax, ay, layer, head, sl, ns, &has_obj, 1);
1442 if (!del_one && !got_one) {
1444 }
else if (del_one && !has_obj) {
1461 int x,
y, ax, ay, darkness, min_x, max_x, min_y, max_y, oldlen, layer;
1491 for (
y = min_y;
y < max_y;
y++, ay++) {
1493 for (
x = min_x;
x < max_x;
x++, ax++) {
1543 int have_darkness = 0, has_obj = 0, got_one = 0, del_one = 0, g1, alive_layer = -1, old_got;
1579 for (layer = 0; layer <
MAP_LAYERS; layer++) {
1586 && (
pl->invisible&(
pl->invisible < 50 ? 4 : 1))
1596 if (got_one != old_got ||
ob->head == NULL)
1597 got_one +=
annotate_ob(ax, ay,
ob, &sl, plyr, &has_obj, &alive_layer);
1604 if (g1 == has_obj) {
1608 if (layer != alive_layer)
1615 if (!del_one && !got_one && !have_darkness) {
1617 }
else if (del_one && !has_obj) {
1639 if (sl.
len > startlen) {
1653 int min_x, min_y, max_x, max_y;
1656 LOG(
llevError,
"draw_client_map called with non player/non eric-server\n");
1660 if (
pl->contr->transport) {
1661 pm =
pl->contr->transport->map;
1676 min_x =
pl->x-
pl->contr->socket->mapx/2;
1677 min_y =
pl->y-
pl->contr->socket->mapy/2;
1678 max_x =
pl->x+(
pl->contr->socket->mapx+1)/2;
1679 max_y =
pl->y+(
pl->contr->socket->mapy+1)/2;
1680 for (j = min_y; j < max_y; j++) {
1681 for (i = min_x; i < max_x; i++) {
1701 if (
pl->contr->do_los) {
1703 pl->contr->do_los = 0;
1725 for (
x = 0;
x < mx;
x++) {
1726 for (
y = 0;
y < my;
y++) {
1730 }
else if (
x+dx < 0 || x+dx >= ns->
mapx ||
y+dy < 0 || y+dy >= ns->
mapy) {
1766 if (!
pl->socket || !
pl->socket->monitor_spells)
1775 if (!
pl->spell_state)
1779 if (spell->type ==
SPELL) {
1816 if (!
pl || !spell || spell->
env !=
pl->ob) {
1820 if (!
pl->socket->monitor_spells)
1839 if (!
pl->socket->want_pickup)
1882 int len, i, skill = 0;
1922 len = strlen(spell->
msg);
1929 if (
pl->socket->monitor_spells >= 2) {
1956 LOG(
llevError,
"esrv_add_spells, tried to add a spell to a NULL player\n");
1960 if (!
pl->socket->monitor_spells)
1979 size = 26+strlen(spell->
name)+(spell->
msg ? strlen(spell->
msg) : 0);
1980 if (
pl->socket->monitor_spells >= 2) {
1993 LOG(
llevError,
"Asked to send a non-spell object as a spell\n");
2080 uint16_t faceno = 0;
2091 if (acn->face[0] != 0 ) {
2158 nlen = (
unsigned char)
buf[0];
2159 if (nlen >=
MAX_BUF || nlen > *len-2) {
2165 plen = (
unsigned char)
buf[nlen+1];
2166 if (plen >=
MAX_BUF || plen > *len-2-nlen) {
2169 memcpy(password,
buf+2+nlen, plen);
2191 if (len <= 0 || !
buf) {
2192 LOG(
llevDebug,
"IP '%s' sent bogus add_player_cmd information\n", ns->
host);
2214 SockList_AddString(&sl,
"failure accountlogin No such account name exists on this server");
2290 if (len <= 0 || !
buf) {
2291 LOG(
llevDebug,
"IP '%s' sent bogus add_player_cmd information\n", ns->
host);
2329 if (strlen(password)<2) {
2337 SockList_AddString(&sl,
"failure accountnew That account already exists on this server");
2346 "failure accountnew Choose a different account name. " VALIDCHAR_MSG);
2354 "failure accountnew That account name is too long");
2363 "failure accountnew Choose a different password. " VALIDCHAR_MSG);
2371 "failure accountnew That password is too long");
2405 if (len <= 0 || !
buf) {
2406 LOG(
llevDebug,
"IP '%s' sent bogus add_player_cmd information\n", ns->
host);
2458 SockList_AddString(&sl,
"failure accountaddplayer 0 That character is already connected to this account.");
2464 SockList_AddString(&sl,
"failure accountaddplayer 1 That character is already connected to a different account.");
2476 SockList_AddString(&sl,
"failure accountaddplayer 0 That character is already connected to a different account which is currently logged in.");
2498 }
else if (
status == 2) {
2499 SockList_AddString(&sl,
"failure accountaddplayer 0 You have reached the maximum number of characters allowed per account.");
2535 if (len <= 0 || !
buf) {
2536 LOG(
llevDebug,
"IP '%s' sent bogus account_play_cmd information\n", ns->
host);
2566 for (i=0; chars[i]; i++) {
2567 if (strcmp(chars[i],
buf) == 0)
2572 "failure accountplay Character %s is not associated with account %s",
2582 "failure accountplay Character %s is already playing",
2597 if (
pl->socket == ns) {
2626 #define MAX_CHOICES 100
2636 int status, nlen, choice_num=0, i;
2642 if (len <= 0 || !
buf) {
2643 LOG(
llevDebug,
"IP '%s' sent bogus create_player_cmd information\n", ns->
host);
2674 SockList_AddString(&sl,
"failure createplayer Player name contains invalid characters");
2681 if (strlen(password)<2) {
2704 if (strlen(password)>17)
2737 if (
pl->socket == ns) {
2739 if (!strcmp(
pl->ob->name,
name)) {
2757 if (
pl->ob->contr ==
pl) {
2775 int i, j, stat_total=0;
2776 char *
key, *
value, *race=NULL, *class_name=NULL;
2781 memset(&new_stats, 0,
sizeof(
living));
2783 while (nlen < len) {
2792 if ((i == 0) || (nlen + i > len))
break;
2812 "failure createplayer Invalid starting map");
2826 "Number of choices receive exceed max value: %d>%d\n",
2829 choices[choice_num] =
value;
2837 int val = atoi(
value);
2865 "failure createplayer Stat value is out of range - %d must be between %d and %d",
2874 "failure createplayer Total allocated statistics is higher than allowed (%d>%d)",
2890 if (!race_a || race_a->clone.type !=
PLAYER || !class_a || class_a->clone.type !=
CLASS) {
2892 "failure createplayer Invalid or unknown race or class");
2903 "failure createplayer Unable to apply race or class - statistic is out of bounds");
2948 pl->name_changed = 1;
2965 if (
pl->ob->map == NULL) {
2966 LOG(
llevError,
"Couldn't put player %s on start map %s!",
pl->ob->name,
map->name);
2972 pl->bed_x =
pl->ob->x;
2973 pl->bed_y =
pl->ob->y;
2985 for (i=0; i < choice_num; i++) {
2987 const char *
value, *cp;
2991 choiceval = strchr(choices[i],
' ');
2993 LOG(
llevError,
"Choice does not specify value: %s\n", choices[i]);
3003 LOG(
llevError,
"Choice not found in archetype: %s\n", choices[i]);
3006 cp = strstr(
value, choiceval);
3008 LOG(
llevError,
"Choice value not found in archetype: %s %s\n",
3009 choices[i], choiceval);
3019 if ((cp[strlen(choiceval)] !=
' ') && (cp[strlen(choiceval)] != 0) &&
3020 (cp !=
value) && (*(cp-1) !=
' ')) {
3022 LOG(
llevError,
"Choice value matches substring but not entire word: %s substring %s\n",
3028 LOG(
llevError,
"Choice value can not find archetype %s\n", choiceval);
3037 LOG(
llevInfo,
"new character %s from %s\n",
pl->ob->name,
pl->ob->contr->socket->host);
3040 "%s has entered the game.",
pl->ob->name);
3058 if (len <= 0 || !
buf) {
3059 LOG(
llevDebug,
"IP '%s' sent bogus account_password_cmd information\n", ns->
host);
3089 if (strlen(change)<2) {
3099 "failure accountpw Choose a different password. " VALIDCHAR_MSG);
3107 "failure accountpw That password is too long");
3118 error =
"failure accountpw Illegal characters present";
3119 }
else if (
status == 2) {
3120 error =
"failure accountpw Invalid account";
3122 error =
"failure accountpw Incorrect current password";
player * find_player_socket(const socket_struct *ns)
#define ADD_PLAYER_NO_STATS_ROLL
void account_add_player_cmd(char *buf, int len, socket_struct *ns)
#define CS_STAT_RES_DEPLETE
static const short atnr_cs_stat[NROFATTACKS]
#define MAP_CLIENT_X_MINIMUM
void SockList_AddInt(SockList *sl, uint32_t data)
#define ST_CHANGE_PASSWORD_OLD
void print_ext_msg(socket_struct *ns, int color, uint8_t type, uint8_t subtype, const char *message)
int find_smooth(const Face *face, const Face **smoothed)
void SockList_AddInt64(SockList *sl, uint64_t data)
static bool CAN_PROBE(const object *ob)
#define FLAG_CLIENT_ANIM_RANDOM
void send_account_players(socket_struct *ns)
#define CS_STAT_APPLIED_WIS
static const int MAP2_COORD_MAX
#define MSG_TYPE_ADMIN_PLAYER
void LOG(LogLevel logLevel, const char *format,...)
void send_query(socket_struct *ns, uint8_t flags, const char *text)
void account_play_cmd(char *buf, int len, socket_struct *ns)
void new_player_cmd(uint8_t *buf, int len, player *pl)
#define MAP2_COORD_OFFSET
void ask_smooth_cmd(char *buf, int len, socket_struct *ns)
#define QUERY_FLAG(xyz, p)
char const * newhash(char const *password)
arch
DIALOGCHECK MINARGS 1 MAXARGS 1
linked_char * account_get_additional_chars(const char *account_name, const Account_Chars *chars, int *count)
#define CS_STAT_APPLIED_POW
int get_skill_client_code(const char *skill_name)
static int map2_delete_layer(int ax, int ay, int layer, SockList *sl, socket_struct *ns)
void update_position(mapstruct *m, int x, int y)
#define MAX_NUM_LOOK_OBJECTS
static const int MAP2_COORD_MIN
void command_execute(object *pl, char *command)
#define AddIfInt64(Old, New, sl, Type)
void SockList_AddString(SockList *sl, const char *data)
#define CS_STAT_SPELL_DENY
char ** account_get_players_for_account(const char *account_name)
void reply_cmd(char *buf, int len, player *pl)
static void append_spell(player *pl, SockList *sl, object *spell)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...) PRINTF_ARGS(6
uint8_t starting_stat_min
player * get_player(player *p)
static void send_extra_stats(SockList *sl, player *pl)
static const flag_definition flags[]
#define CS_STAT_RES_HOLYWORD
static int annotate_ob(int ax, int ay, const object *ob, SockList *sl, player *plyr, int *has_obj, int *alive_layer)
int account_link(const char *account_name, const char *player_name)
#define CS_STAT_TURN_UNDEAD
#define SP_CREATE_MISSILE
void receive_play_again(object *op, char key)
void set_player_socket(player *p, socket_struct *ns)
#define MSG_TYPE_COMMAND_ERROR
static void map_clearcell(struct map_cell_struct *cell, int face, int darkness)
static bool map2_coord_valid(int x)
void send_plugin_custom_message(object *pl, char *buf)
void SockList_Reset(SockList *sl)
#define CS_STAT_CHARACTER_FLAGS
const char * object_get_value(const object *op, const char *const key)
void set_up_cmd(char *buf, int len, socket_struct *ns)
static const object * heads[MAX_HEAD_POS][MAX_HEAD_POS][MAP_LAYERS]
void key_confirm_quit(object *op, char key)
#define CS_STAT_APPLIED_DEX
player * add_player(socket_struct *ns, int flags)
object * object_insert_in_ob(object *op, object *where)
static void map2_add_label(socket_struct *ns, SockList *sl, enum map2_label subtype, const char *label)
#define CS_STAT_GOLEM_MAXHP
@ MAP2_LABEL_PLAYER_PARTY
std::vector< Account_Char * > chars
size_t SockList_Avail(const SockList *sl)
short GetShort_String(const unsigned char *data)
const char *const short_stat_name[NUM_STATS]
#define SP_SUMMON_MONSTER
static event_registration m
#define AddIfShort(Old, New, sl, Type)
Account_Chars * account_chars
void esrv_send_animation(socket_struct *ns, const Animations *anim)
void set_title(const object *pl, char *buf, size_t len)
static int clamp(int x, int min, int max)
#define CS_STAT_SPELL_REPEL
void account_new_cmd(char *buf, int len, socket_struct *ns)
void account_login_cmd(char *buf, int len, socket_struct *ns)
int playername_ok(const char *cp)
void esrv_send_face(socket_struct *ns, const Face *face, int nocache)
#define CS_STAT_APPLIED_CHA
#define ST_CHANGE_PASSWORD_CONFIRM
int check_race_and_class(living *stats, archetype *race, archetype *opclass)
int8_t blocked_los[MAP_CLIENT_X][MAP_CLIENT_Y]
void check_login(object *op, const char *password)
const char * account_get_account_for_char(const char *charname)
uint8_t account_block_create
#define ADD_PLAYER_NO_MAP
void account_char_free(Account_Chars *chars)
static void send_smooth(socket_struct *ns, const Face *face)
static void handle_scroll(socket_struct *socket, SockList *sl)
sstring add_string(const char *str)
void draw_client_map(object *pl)
int account_remove_player(const char *account_name, const char *player_name)
void SockList_AddShort(SockList *sl, uint16_t data)
object * object_find_by_type_and_name(const object *who, int type, const char *name)
void SockList_AddChar(SockList *sl, unsigned char c)
void set_attr_value(living *stats, int attr, int8_t value)
#define CS_STAT_APPLIED_STR
void account_password(char *buf, int len, socket_struct *ns)
void esrv_map_scroll(socket_struct *ns, int dx, int dy)
#define GET_MAP_FACE_OBJ(M, X, Y, L)
#define FREE_AND_COPY(sv, nv)
static void check_space_for_heads(int ax, int ay, SockList *sl, socket_struct *ns)
#define CS_STAT_APPLIED_CON
#define MAP_LAYER_LIVING1
void esrv_update_spells(player *pl)
const char * skill_names[MAX_SKILLS]
uint16_t faces[MAP_LAYERS]
#define CS_STAT_RES_GHOSTHIT
struct linked_char * next
#define CS_STAT_SKILLINFO
int account_new(const char *account_name, const char *account_password)
#define ST_CHANGE_PASSWORD_NEW
#define CS_STAT_RES_BLIND
#define FLAG_UNAGGRESSIVE
#define MAP2_TYPE_DARKNESS
static uint16_t MAP2_COORD_ENCODE(int x, int y, int flags)
mapstruct * get_map_from_coord(mapstruct *m, int16_t *x, int16_t *y)
const Face * get_face_by_id(uint16_t id)
int16_t SP_level_spellpoint_cost(object *caster, object *spell, int flags)
int account_is_logged_in(const char *name)
void SockList_Init(SockList *sl)
static uint8_t is_perfect(const player *pl)
struct archetype * other_arch
#define CS_STAT_WEIGHT_LIM
#define CS_STAT_ITEM_POWER
#define CS_STAT_RES_POISON
void receive_player_name(object *op, const char *name)
int is_valid_faceset(int fsn)
object * object_present_in_ob(uint8_t type, const object *op)
uint32_t get_weight_limit(int stat)
void SockList_Term(SockList *sl)
#define AddIfInt(Old, New, sl, Type)
int probe(object *op, object *caster, object *spell_ob, int dir, int level)
void key_roll_stat(object *op, char key)
#define FLAG_CLIENT_ANIM_SYNC
uint8_t starting_stat_points
void create_player_cmd(char *buf, int len, socket_struct *ns)
int apply_race_and_class(object *op, archetype *race, archetype *opclass, living *stats)
#define CS_STAT_SPELL_ATTUNE
void SockList_AddData(SockList *sl, const void *data, size_t len)
void esrv_move_object(object *pl, tag_t to, tag_t tag, long nrof)
client_spell * get_client_spell_state(player *pl, object *spell)
int SP_level_dam_adjust(const object *caster, const object *spob)
object * object_find_by_arch_name(const object *who, const char *name)
#define AddIfFloat(Old, New, sl, Type)
#define ST_CONFIRM_PASSWORD
void send_tick(player *pl)
static int map2_add_ob(int ax, int ay, int layer, const object *ob, SockList *sl, socket_struct *ns, int *has_obj, int is_head)
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
static int account_block_create(const socket_struct *ns)
void enter_exit(object *op, object *exit_ob)
void map_newmap_cmd(socket_struct *ns)
void esrv_add_spells(player *pl, object *spell)
const typedef char * sstring
#define MAP_CLIENT_Y_MINIMUM
void esrv_remove_spell(player *pl, object *spell)
void SockList_AddLen8Data(SockList *sl, const void *data, size_t len)
void receive_player_password(object *op, const char *password)
void add_me_cmd(char *buf, int len, socket_struct *ns)
void esrv_draw_look(object *pl)
void version_cmd(char *buf, int len, socket_struct *ns)
struct map_cell_struct cells[MAX_CLIENT_X][MAX_CLIENT_Y]
method_ret ob_apply(object *op, object *applier, int aflags)
#define NUM_ANIMATIONS(ob)
void SockList_ResetRead(SockList *sl)
uint8_t anims_sent[MAXANIMNUM]
int account_change_password(const char *account_name, const char *current_password, const char *new_password)
#define CS_STAT_RES_DEATH
object * arch_to_object(archetype *at)
int GetInt_String(const unsigned char *data)
static void draw_client_map2(object *pl)
int strcasecmp(const char *s1, const char *s2)
struct treasurelist * randomitems
int save_player(object *op, int flag)
#define ST_GET_PARTY_PASSWORD
archetype * get_archetype_by_type_subtype(int type, int subtype)
void esrv_send_pickup(player *pl)
void object_remove(object *op)
void player_set_state(player *pl, uint8_t state)
void free_charlinks(linked_char *lc)
archetype * try_find_archetype(const char *name)
#define AddIfString(Old, New, sl, Type)
const Face * try_find_face(const char *name, const Face *error)
#define MIN_NUM_LOOK_OBJECTS
#define MAP_LAYER_LIVING2
static int check_probe(int ax, int ay, const object *ob, SockList *sl, socket_struct *ns, int *has_obj, int *alive_layer)
void move_cmd(char *buf, int len, player *pl)
Account_Chars * account_char_load(const char *account_name)
void key_change_class(object *op, char key)
void receive_party_password(object *op, const char *password)
static int spell_client_use(const object *spell)
int account_check_string(const char *str)
void esrv_update_stats(player *pl)
char * account_trusted_host
#define MSG_TYPE_ADMIN_VERSION
int8_t get_attr_value(const living *stats, int attr)
void update_los(object *op)
static void add_char_field(SockList *sl, int type, const char *data)
int account_login(const char *account_name, const char *account_password)
int verify_player(const char *name, char *password)
void esrv_new_player(player *pl, uint32_t weight)
static int decode_name_password(const char *buf, int *len, char *name, char *password)
void account_char_save(Account_Chars *chars)
#define CS_STAT_RES_DRAIN
void Send_With_Handling(socket_struct *ns, SockList *sl)
void map_reset_swap(mapstruct *m)
#define FOR_INV_PREPARE(op_, it_)
void account_char_remove(Account_Chars *chars, const char *pl_name)
#define CS_STAT_APPLIED_INT
void rangetostring(const object *pl, char *obuf, size_t len)
#define NS_FACESENT_SMOOTH
void SockList_AddPrintf(SockList *sl, const char *format,...)
const char * account_exists(const char *account_name)
uint8_t starting_stat_max