47 #define MAXITEMLEN 300
61 unsigned int flags = 0;
127 int flags, len, anim_speed;
148 len = strlen(item_n);
153 len = strlen(item_n);
156 strncpy(item_n+len+1, item_p, 127);
158 item_n[len+1+127] = 0;
159 len += strlen(item_n+1+len)+1;
173 anim_speed = (int)(1.0/
FABS(head->
speed));
175 if (anim_speed > 255)
193 int got_one = 0, start_look = 0, end_look = 0, objects_sent = 0;
198 LOG(
llevDebug,
"esrv_draw_look called when update_look was not set\n");
235 snprintf(buf,
sizeof(buf),
"Click here to see previous group of items");
251 for (last = NULL; tmp != last; tmp = tmp->
below) {
273 snprintf(buf,
sizeof(buf),
"Click here to see next group of items");
320 for (tmp = op->
inv; tmp; tmp = tmp->
below) {
423 len = strlen(item_n);
428 len = strlen(item_n);
433 strncpy(item_n+len+1, item_p, 127);
435 len += strlen(item_n+1+len)+1;
455 if (anim_speed > 255)
532 if (pl->
count == count)
535 for (op = pl->
inv; op; op = op->
below)
536 if (op->
count == count)
539 for (tmp = op->
inv; tmp; tmp = tmp->
below)
540 if (tmp->
count == count)
546 else if (op->
count == count)
549 for (tmp = op->
inv; tmp; tmp = tmp->
below)
550 if (tmp->
count == count)
555 if (tmp->
count == count)
566 if (len <= 0 || !buf) {
574 LOG(
llevDebug,
"Player '%s' tried to examine the unknown object (%ld)\n", pl->
ob->
name, tag);
585 if (!buf || len <= 0) {
601 if (tag&0x80000000) {
608 LOG(
llevDebug,
"Player '%s' tried to apply the unknown object (%d)\n", pl->
ob->
name, tag);
630 "Could not find object to lock/unlock", NULL);
669 "Could not find object to mark", NULL);
707 for (; tmp != NULL; tmp = tmp->
below) {
714 "There you see:", NULL);
746 "You see nothing there.", NULL);
749 "You see nothing.", NULL);
759 if (!(cp = strchr(buf,
' '))) {
778 LOG(
llevDebug,
"Player '%s' tried to move an unknown object (%lu)\n", pl->
name, (
unsigned long)tag);
788 if (op->
map && !op->
env) {
796 object *current, *next;
798 for (current = op->
inv; current != NULL; current = next) {
799 next = current->
below;
807 }
else if (to == pl->
count) {
825 LOG(
llevDebug,
"Player '%s' tried to move object to the unknown location (%d)\n", pl->
name, to);
842 object *scroll, *spell, *marked, *inscription, *currentspell;
843 tag_t tscroll, tspell, tmarked;
869 LOG(
llevDebug,
"Player %s sent an invalid scroll for inscribe command.\n", pl->
ob->
name);
875 LOG(
llevDebug,
"Player %s sent an invalid spell for inscribe command.\n", pl->
ob->
name);
#define FLAG_KNOWN_BLESSED
void inscribe_scroll_cmd(char *buf, int len, player *pl)
void SockList_AddPrintf(SockList *sl, const char *format,...)
void look_at(object *op, int dx, int dy)
void SockList_Reset(SockList *sl)
void SockList_Init(SockList *sl)
void esrv_draw_look(object *pl)
int GetInt_String(const unsigned char *data)
void esrv_send_item(object *pl, object *op)
void esrv_send_animation(socket_struct *ns, short anim_num)
static unsigned int query_flags(const object *op)
void apply_cmd(char *buf, int len, player *pl)
void SockList_AddShort(SockList *sl, uint16 data)
#define MSG_TYPE_SKILL_FAILURE
void pick_up(object *op, object *alt)
#define MSG_TYPE_COMMAND_SUCCESS
void query_base_name(const object *op, int plural, char *buf, size_t size)
void mark_item_cmd(uint8 *data, int len, player *pl)
void lock_item_cmd(uint8 *data, int len, player *pl)
object * merge_ob(object *op, object *top)
void draw_ext_info(int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *message, const char *oldmessage)
void esrv_move_object(object *pl, tag_t to, tag_t tag, long nrof)
object * ranges[range_size]
void look_at_cmd(char *buf, int len, player *pl)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *new_format, const char *old_format,...)
#define FLAG_KNOWN_MAGICAL
void SockList_Term(SockList *sl)
void esrv_del_item(player *pl, int tag)
object * drop_object(object *op, object *tmp, uint32 nrof)
void SockList_AddString(SockList *sl, const char *data)
mapstruct * get_map_from_coord(mapstruct *m, sint16 *x, sint16 *y)
void examine(object *op, object *tmp)
int can_pick(const object *who, const object *item)
static void add_object_to_socklist(socket_struct *ns, SockList *sl, object *head)
size_t SockList_Avail(const SockList *sl)
int sack_can_hold(const object *pl, const object *sack, const object *op, uint32 nrof)
#define QUERY_FLAG(xyz, p)
#define CLEAR_FLAG(xyz, p)
void examine_cmd(char *buf, int len, player *pl)
void SockList_AddChar(SockList *sl, char c)
static const flag_definition flags[]
void inventory(object *op, object *inv)
#define FLAG_KNOWN_CURSED
int snprintf(char *dest, int max, const char *format,...)
void esrv_update_item(int flags, object *pl, object *op)
void esrv_send_face(socket_struct *ns, short face_num, int nocache)
void SockList_AddLen8Data(SockList *sl, const void *data, size_t len)
static object * esrv_get_ob_from_count(object *pl, tag_t count)
int transport_can_hold(const object *transport, const object *op, int nrof)
int out_of_map(mapstruct *m, int x, int y)
void put_object_in_sack(object *op, object *sack, object *tmp, uint32 nrof)
#define GET_MAP_OB(M, X, Y)
void LOG(LogLevel logLevel, const char *format,...)
int player_apply(object *pl, object *op, int aflag, int quiet)
uint8 anims_sent[MAXANIMNUM]
void query_name(const object *op, char *buf, size_t size)
#define MSG_TYPE_COMMAND_EXAMINE
int write_on_item(object *pl, const char *params, object *skill)
void SockList_AddInt(SockList *sl, uint32 data)
#define MSG_TYPE_COMMAND_ERROR
object * find_skill_by_name(object *who, const char *name)
void esrv_send_inventory(object *pl, object *op)
sint8 blocked_los[MAP_CLIENT_X][MAP_CLIENT_Y]
void Send_With_Handling(socket_struct *ns, SockList *sl)