Go to the documentation of this file.
54 #include <sys/types.h>
55 #include <netinet/in.h>
56 #include <netinet/tcp.h>
100 if (len <= 0 || !
buf) {
120 for (;
buf[s] &&
buf[s] !=
' '; s++)
126 while (
buf[s] ==
' ')
132 for (;
buf[s] &&
buf[s] !=
' '; s++)
136 while (s < len &&
buf[s] ==
' ')
141 if (!strcmp(cmd,
"sound2")) {
144 }
else if (!strcmp(cmd,
"spellmon")) {
147 monitor_spells = atoi(param);
148 if (monitor_spells < 0 || monitor_spells > 2) {
154 }
else if (!strcmp(cmd,
"darkness")) {
157 darkness = atoi(param);
158 if (darkness != 0 && darkness != 1) {
164 }
else if (!strcmp(cmd,
"map2cmd")) {
167 map2cmd = atoi(param);
173 }
else if (!strcmp(cmd,
"facecache")) {
176 facecache = atoi(param);
177 if (facecache != 0 && facecache != 1) {
183 }
else if (!strcmp(cmd,
"faceset")) {
189 }
else if (!strcmp(cmd,
"mapsize")) {
192 if (sscanf(param,
"%dx%d%n", &
x, &
y, &n) != 2 || n != (
int)strlen(param)) {
216 }
else if (!strcmp(cmd,
"tick")) {
220 if (tick != 0 && tick != 1) {
226 }
else if (!strcmp(cmd,
"bot")) {
229 is_bot = atoi(param);
230 if (is_bot != 0 && is_bot != 1) {
236 }
else if (!strcmp(cmd,
"want_pickup")) {
239 want_pickup = atoi(param);
240 if (want_pickup != 0 && want_pickup != 1) {
246 }
else if (!strcmp(cmd,
"num_look_objects")) {
264 }
else if (!strcmp(cmd,
"extended_stats")) {
267 extended_stats = atoi(param);
268 if (extended_stats != 0 && extended_stats != 1) {
274 }
else if (!strcmp(cmd,
"beat")) {
275 int use_beat = atoi(param);
277 if (use_beat != 0 && use_beat != 1) {
285 }
else if (!strcmp(cmd,
"loginmethod")) {
288 loginmethod = atoi(param);
291 if (loginmethod > 2) loginmethod=2;
296 }
else if (!strcmp(cmd,
"notifications")) {
299 notifications = atoi(param);
304 }
else if (!strcmp(cmd,
"newmapcmd")) {
312 }
else if (!strcmp(cmd,
"extendedTextInfos")) {
318 }
else if (!strcmp(cmd,
"itemcmd")) {
324 }
else if (!strcmp(cmd,
"exp64")) {
377 "Warning: Your client is too old to receive map data. Please update to a new client at: "
378 "https://sourceforge.net/projects/crossfire/");
394 const Face *smoothface;
413 "Could not smooth face %s. "
414 "Check that this face has a smoothing pixmap, or remove its smoothlevel.\n",
440 if (len <= 0 || !
buf) {
441 LOG(
llevDebug,
"IP '%s' sent bogus ask_smooth_cmd information\n", ns->
host);
468 LOG(
llevDebug,
"Corrupt ncom command - not long enough - discarding\n");
491 "You can not issue commands - state is not ST_PLAYING (%s)",
497 if (
pl->ob->speed_left < 0) {
498 LOG(
llevError,
"Player %s (%s) has negative time - shouldn't do command.\n",
499 pl->ob->name ?
pl->ob->name :
"(unnamed)",
pl->socket->account_name ?
pl->socket->account_name :
"(no account)");
513 if (
FABS(
pl->ob->speed) < 0.001)
525 if (len <= 0 || !
buf) {
526 LOG(
llevDebug,
"Player '%s' sent bogus reply_cmd information\n",
pl->ob->name);
534 LOG(
llevError,
"Got reply message with ST_PLAYING input state\n");
587 char *cs_str = strtok_r(
buf,
" ", &
rest);
588 char *sc_str = strtok_r(NULL,
" ", &
rest);
591 if (cs_str == NULL || sc_str == NULL) {
610 LOG(
llevInfo,
"Connection from %s (%s), CS %d, SC %d\n",
645 if (len <= 0 || !
buf) {
646 LOG(
llevDebug,
"Player '%s' sent bogus move_cmd information\n",
pl->ob->name);
655 for (i = 0; i < 2; i++) {
657 if (!(
buf = strchr(
buf,
' '))) {
689 #define AddIfInt64(Old, New, sl, Type) \
692 SockList_AddChar(sl, Type); \
693 SockList_AddInt64(sl, New); \
696 #define AddIfInt(Old, New, sl, Type) \
699 SockList_AddChar(sl, Type); \
700 SockList_AddInt(sl, New); \
703 #define AddIfShort(Old, New, sl, Type) \
706 SockList_AddChar(sl, Type); \
707 SockList_AddShort(sl, New); \
710 #define AddIfFloat(Old, New, sl, Type) \
713 SockList_AddChar(sl, Type); \
714 SockList_AddInt(sl, (long)(New*FLOAT_MULTI));\
717 #define AddIfString(Old, New, sl, Type) \
718 if (Old == NULL || strcmp(Old, New)) { \
720 Old = strdup_local(New); \
721 SockList_AddChar(sl, Type); \
722 SockList_AddLen8Data(sl, New, strlen(New)); \
731 const int16_t until =
MIN(11,
pl->ob->level);
732 for (int16_t i = 1; i < until; i++) {
733 if (
pl->levhp[i] < 9 ||
pl->levsp[i] < 6 ||
pl->levgrace[i] < 3) {
747 const char *god =
"none";
749 if (
pl->socket->notifications < 3) {
761 if (QUERY_FLAG(pl->ob, F)) { \
774 if (strcmp(
item->arch->name,
"poisoning") == 0) {
777 if (strcmp(
item->arch->name,
"blindness") == 0) {
780 if (
item->type ==
FORCE && strcmp(
item->name,
"confusion") == 0) {
810 if (
pl->ob != NULL) {
825 if (
pl->socket->extended_stats) {
826 int16_t golem_hp, golem_maxhp;
834 if (
pl->ob != NULL) {
869 if (
pl->last_skill_ob[s]) {
873 LOG(
llevDebug,
"pruning removed object from last_skill_ob\n");
874 pl->last_skill_ob[s] = NULL;
878 if (
pl->last_skill_exp[s] !=
pl->last_skill_ob[s]->stats.exp) {
885 pl->last_skill_exp[s] =
pl->last_skill_ob[s]->stats.exp;
905 if (
pl->socket->sc_version < 1025) {
917 if (
pl->socket->monitor_spells) {
946 pl->last_weight = weight;
989 for (i = 0; i <
anim->num_animations; i++) {
1009 memset(cell->
faces, face,
sizeof(cell->
faces));
1012 #define MAX_HEAD_POS MAX(MAX_CLIENT_X, MAX_CLIENT_Y)
1049 uint8_t nlayer, smoothlevel = 0;
1055 const Face *face =
ob->face;
1079 if (bx < ax || by < ay) {
1080 LOG(
llevError,
"map2_add_ob: bx (%d) or by (%d) is less than ax (%d) or ay (%d)\n", bx, by, ax, ay);
1087 for (
l = layer-1;
l <= layer+1;
l++) {
1090 if (
heads[by][bx][
l] == head)
1097 if (!
heads[by][bx][layer])
1098 heads[by][bx][layer] = head;
1100 heads[by][bx][layer+1] = head;
1105 uint16_t face_num = face ? face->
number : 0;
1109 face_num = (
ob->animation ?
ob->animation->num : 0)|(1<<15);
1121 uint8_t len, anim_speed = 0, i;
1133 smoothlevel =
ob->smoothlevel;
1144 anim_speed =
ob->anim_speed;
1145 else if (
FABS(
ob->speed) < 0.004)
1147 else if (
FABS(
ob->speed) >= 1.0)
1150 anim_speed = (
int)(1.0/
FABS(
ob->speed));
1198 nlayer = 0x10+layer+(2<<5);
1219 int got_one = 0, poisoned = 0, diseased = 0;
1221 int value, granularity;
1222 const object *
probe;
1244 granularity = (
probe->level - 14) / 3;
1245 if (granularity <= 0)
1247 else if (granularity > 30)
1251 if (
ob->stats.maxhp > 0) {
1252 value = (
ob->stats.hp * granularity) / (
ob->stats.maxhp);
1256 else if (
value > granularity)
1257 value = granularity;
1271 snprintf(
name,
sizeof(
name),
"hpbar%s%s%s_%d",
1272 poisoned ?
"_poisoned" :
"",
1273 diseased ?
"_diseased" :
"",
1274 (!poisoned && !diseased) ?
"_standard" :
"",
1277 if (dummy != NULL) {
1287 int got_one =
check_probe(ax, ay,
ob, sl, ns, has_obj, alive_layer);
1291 if (dummy != NULL) {
1316 int layer, got_one = 0, del_one = 0, oldlen, has_obj = 0;
1323 for (layer = 0; layer <
MAP_LAYERS; layer++) {
1326 head =
heads[ay][ax][layer];
1331 got_one +=
map2_add_ob(ax, ay, layer, head, sl, ns, &has_obj, 1);
1344 if (!del_one && !got_one) {
1346 }
else if (del_one && !has_obj) {
1363 int x,
y, ax, ay, d, min_x, max_x, min_y, max_y, oldlen, layer;
1399 for (
y = min_y;
y < max_y;
y++, ay++) {
1401 for (
x = min_x;
x < max_x;
x++, ax++) {
1451 int have_darkness = 0, has_obj = 0, got_one = 0, del_one = 0, g1, alive_layer = -1, old_got;
1481 for (layer = 0; layer <
MAP_LAYERS; layer++) {
1488 && (
pl->invisible&(
pl->invisible < 50 ? 4 : 1))
1498 if (got_one != old_got || (
ob->head == NULL &&
ob->more))
1506 if (g1 == has_obj) {
1508 }
else if (
ob->head == NULL) {
1513 if (layer != alive_layer)
1520 if (!del_one && !got_one && !have_darkness) {
1522 }
else if (del_one && !has_obj) {
1544 if (sl.
len > startlen) {
1558 int min_x, min_y, max_x, max_y;
1561 LOG(
llevError,
"draw_client_map called with non player/non eric-server\n");
1565 if (
pl->contr->transport) {
1566 pm =
pl->contr->transport->map;
1581 min_x =
pl->x-
pl->contr->socket->mapx/2;
1582 min_y =
pl->y-
pl->contr->socket->mapy/2;
1583 max_x =
pl->x+(
pl->contr->socket->mapx+1)/2;
1584 max_y =
pl->y+(
pl->contr->socket->mapy+1)/2;
1585 for (j = min_y; j < max_y; j++) {
1586 for (i = min_x; i < max_x; i++) {
1606 if (
pl->contr->do_los) {
1608 pl->contr->do_los = 0;
1630 for (
x = 0;
x < mx;
x++) {
1631 for (
y = 0;
y < my;
y++) {
1635 }
else if (
x+dx < 0 || x+dx >= ns->
mapx ||
y+dy < 0 || y+dy >= ns->
mapy) {
1671 if (!
pl->socket || !
pl->socket->monitor_spells)
1680 if (!
pl->spell_state)
1684 if (spell->type ==
SPELL) {
1721 if (!
pl || !spell || spell->
env !=
pl->ob) {
1725 if (!
pl->socket->monitor_spells)
1744 if (!
pl->socket->want_pickup)
1762 switch (spell->
type)
1787 int len, i, skill = 0;
1827 len = strlen(spell->
msg);
1834 if (
pl->socket->monitor_spells >= 2) {
1861 LOG(
llevError,
"esrv_add_spells, tried to add a spell to a NULL player\n");
1865 if (!
pl->socket->monitor_spells)
1884 size = 26+strlen(spell->
name)+(spell->
msg ? strlen(spell->
msg) : 0);
1885 if (
pl->socket->monitor_spells >= 2) {
1898 LOG(
llevError,
"Asked to send a non-spell object as a spell\n");
1926 if (setsockopt(
pl->socket->fd, IPPROTO_TCP, TCP_NODELAY, &
tmp,
sizeof(
tmp)))
1927 LOG(
llevError,
"send_tick: Unable to turn on TCP_NODELAY\n");
1931 if (setsockopt(
pl->socket->fd, IPPROTO_TCP, TCP_NODELAY, &
tmp,
sizeof(
tmp)))
1932 LOG(
llevError,
"send_tick: Unable to turn off TCP_NODELAY\n");
2003 uint16_t faceno = 0;
2014 if (acn->face[0] != 0 ) {
2081 nlen = (
unsigned char)
buf[0];
2082 if (nlen >=
MAX_BUF || nlen > *len-2) {
2088 plen = (
unsigned char)
buf[nlen+1];
2089 if (plen >=
MAX_BUF || plen > *len-2-nlen) {
2092 memcpy(password,
buf+2+nlen, plen);
2114 if (len <= 0 || !
buf) {
2115 LOG(
llevDebug,
"IP '%s' sent bogus add_player_cmd information\n", ns->
host);
2137 SockList_AddString(&sl,
"failure accountlogin No such account name exists on this server");
2213 if (len <= 0 || !
buf) {
2214 LOG(
llevDebug,
"IP '%s' sent bogus add_player_cmd information\n", ns->
host);
2252 if (strlen(password)<2) {
2260 SockList_AddString(&sl,
"failure accountnew That account already exists on this server");
2269 "failure accountnew That account name contains invalid characters.");
2277 "failure accountnew That account name is too long");
2286 "failure accountnew That password contains invalid characters.");
2294 "failure accountnew That password is too long");
2328 if (len <= 0 || !
buf) {
2329 LOG(
llevDebug,
"IP '%s' sent bogus add_player_cmd information\n", ns->
host);
2381 SockList_AddString(&sl,
"failure accountaddplayer 0 That character is already connected to this account.");
2387 SockList_AddString(&sl,
"failure accountaddplayer 1 That character is already connected to a different account.");
2399 SockList_AddString(&sl,
"failure accountaddplayer 0 That character is already connected to a different account which is currently logged in.");
2421 }
else if (
status == 2) {
2422 SockList_AddString(&sl,
"failure accountaddplayer 0 You have reached the maximum number of characters allowed per account.");
2458 if (len <= 0 || !
buf) {
2459 LOG(
llevDebug,
"IP '%s' sent bogus account_play_cmd information\n", ns->
host);
2489 for (i=0; chars[i]; i++) {
2490 if (strcmp(chars[i],
buf) == 0)
2495 "failure accountplay Character %s is not associated with account %s",
2505 "failure accountplay Character %s is already playing",
2520 if (
pl->socket == ns) {
2549 #define MAX_CHOICES 100
2559 int status, nlen, choice_num=0, i;
2565 if (len <= 0 || !
buf) {
2566 LOG(
llevDebug,
"IP '%s' sent bogus create_player_cmd information\n", ns->
host);
2597 SockList_AddString(&sl,
"failure createplayer Player name contains invalid characters");
2604 if (strlen(password)<2) {
2627 if (strlen(password)>17)
2636 SockList_AddString(&sl,
"failure createplayer The name contains illegal characters");
2660 if (
pl->socket == ns) {
2662 if (!strcmp(
pl->ob->name,
name)) {
2680 if (
pl->ob->contr ==
pl) {
2698 int i, j, stat_total=0;
2699 char *
key, *
value, *race=NULL, *class_name=NULL;
2704 memset(&new_stats, 0,
sizeof(
living));
2706 while (nlen < len) {
2715 if ((i == 0) || (nlen + i > len))
break;
2735 "failure createplayer Invalid starting map");
2749 "Number of choices receive exceed max value: %d>%d\n",
2752 choices[choice_num] =
value;
2760 int val = atoi(
value);
2788 "failure createplayer Stat value is out of range - %d must be between %d and %d",
2797 "failure createplayer Total allocated statistics is higher than allowed (%d>%d)",
2813 if (!race_a || race_a->clone.type !=
PLAYER || !class_a || class_a->clone.type !=
CLASS) {
2815 "failure createplayer Invalid or unknown race or class");
2826 "failure createplayer Unable to apply race or class - statistic is out of bounds");
2871 pl->name_changed = 1;
2888 if (
pl->ob->map == NULL) {
2889 LOG(
llevError,
"Couldn't put player %s on start map %s!",
pl->ob->name,
map->name);
2895 pl->bed_x =
pl->ob->x;
2896 pl->bed_y =
pl->ob->y;
2908 for (i=0; i < choice_num; i++) {
2910 const char *
value, *cp;
2914 choiceval = strchr(choices[i],
' ');
2916 LOG(
llevError,
"Choice does not specify value: %s\n", choices[i]);
2926 LOG(
llevError,
"Choice not found in archetype: %s\n", choices[i]);
2929 cp = strstr(
value, choiceval);
2931 LOG(
llevError,
"Choice value not found in archetype: %s %s\n",
2932 choices[i], choiceval);
2942 if ((cp[strlen(choiceval)] !=
' ') && (cp[strlen(choiceval)] != 0) &&
2943 (cp !=
value) && (*(cp-1) !=
' ')) {
2945 LOG(
llevError,
"Choice value matches substring but not entire word: %s substring %s\n",
2951 LOG(
llevError,
"Choice value can not find archetype %s\n", choiceval);
2960 LOG(
llevInfo,
"new character %s from %s\n",
pl->ob->name,
pl->ob->contr->socket->host);
2963 "%s has entered the game.",
pl->ob->name);
2981 if (len <= 0 || !
buf) {
2982 LOG(
llevDebug,
"IP '%s' sent bogus account_password_cmd information\n", ns->
host);
3012 if (strlen(change)<2) {
3022 "failure accountpw That password contains invalid characters.");
3030 "failure accountpw That password is too long");
3041 error =
"failure accountpw Illegal characters present";
3042 }
else if (
status == 2) {
3043 error =
"failure accountpw Invalid account";
3045 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]
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)
static int annotate_ob(int ax, int ay, const object *ob, SockList *sl, socket_struct *ns, int *has_obj, int *alive_layer)
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
#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)
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
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
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
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)
#define CS_STAT_GOLEM_MAXHP
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)
#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)
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
const typedef char * sstring
#define FLAG_UNAGGRESSIVE
#define MAP2_TYPE_DARKNESS
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
#define MAP2_COORD_ENCODE(x, y, flags)
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)
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)
static void map_clearcell(struct map_cell_struct *cell, int face, int count)
#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)
#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