Go to the documentation of this file.
36 #define MAXITEMLEN 300
50 unsigned int flags = 0;
123 int flags, len, anim_speed;
149 len = strlen(item_n);
154 len = strlen(item_n);
157 strncpy(item_n+len+1, item_p, 127);
159 item_n[len+1+127] = 0;
160 len += strlen(item_n+1+len)+1;
176 if (anim_speed > 255)
194 int got_one = 0, start_look = 0, end_look = 0, objects_sent = 0;
199 LOG(
llevDebug,
"esrv_draw_look called when update_look was not set\n");
236 snprintf(
buf,
sizeof(
buf),
"Click here to see previous group of items");
282 snprintf(
buf,
sizeof(
buf),
"Click here to see next group of items");
316 int got_one = 0, start_look = 0, end_look = 0, objects_sent = 0;
335 snprintf(
buf,
sizeof(
buf),
"Click here to see previous group of items");
363 snprintf(
buf,
sizeof(
buf),
"Click here to see next group of items");
461 op->contr->last_weight = weight;
475 if (!
op->custom_name) {
479 strlcpy(item_n,
op->custom_name,
sizeof(item_n)-1);
480 strlcpy(item_p,
op->custom_name,
sizeof(item_p));
483 len = strlen(item_n)+1;
484 snprintf(item_n+len,
sizeof(item_n)-len,
"%s", item_p);
485 len += strlen(item_n+len);
496 anim_speed =
op->anim_speed;
498 if (
FABS(
op->speed) < 0.001)
500 else if (
FABS(
op->speed) >= 1.0)
505 if (anim_speed > 255)
551 if (
pl->contr != NULL &&
pl->container != NULL &&
op->env ==
pl->container)
645 if (len <= 0 || !
buf) {
667 if (!
buf || len <= 0) {
683 if (
tag&0x80000000) {
719 "Could not find object to lock/unlock");
725 "Can't lock/unlock an item on the ground");
730 "Can't lock/unlock an item not directly in your inventory");
738 "Unlocked %s.",
name);
776 "Could not find object to mark");
850 "You see nothing there.");
862 if (len <= 0 || !
buf) {
868 if (!(cp = strchr(
buf,
' '))) {
875 "You can't see there from where you're standing.");
881 "You can't see there from where you're standing.");
893 LOG(
llevDebug,
"Player '%s' tried to move an unknown object (%lu)\n",
pl->name, (
unsigned long)
tag);
903 if (
op->map && !
op->env) {
937 LOG(
llevDebug,
"Player '%s' tried to move object to the unknown location (%d)\n",
pl->name, to);
954 object *scroll, *spell, *
marked, *inscription, *currentspell;
955 tag_t tscroll, tspell, tmarked;
#define GET_MAP_OB(M, X, Y)
void SockList_AddInt(SockList *sl, uint32_t data)
#define MSG_TYPE_COMMAND_SUCCESS
static unsigned int query_flags(const object *op)
void esrv_send_item(object *pl, object *op)
void inscribe_scroll_cmd(char *buf, int len, player *pl)
uint16_t container_position
#define QUERY_FLAG(xyz, p)
int out_of_map(mapstruct *m, int x, int y)
void lock_item_cmd(uint8_t *data, int len, player *pl)
void SockList_AddString(SockList *sl, const char *data)
int8_t blocked_los[MAP_CLIENT_X][MAP_CLIENT_Y]
void do_dump(object *who, object *what)
void esrv_draw_look(object *pl)
int write_on_item(object *pl, const char *params, object *skill)
uint32_t update_inventory
#define MSG_TYPE_COMMAND_EXAMINE
void esrv_del_item(player *pl, object *ob)
void apply_cmd(char *buf, int len, player *pl)
static const flag_definition flags[]
#define MSG_TYPE_COMMAND_ERROR
void SockList_Reset(SockList *sl)
size_t SockList_Avail(const SockList *sl)
object * object_merge(object *op, object *top)
void look_at_cmd(char *buf, int len, player *pl)
bool player_can_find(object *op, object *ob)
void mark_item_cmd(uint8_t *data, int len, player *pl)
static event_registration m
void esrv_move_object(object *pl, tag_t to, tag_t tag, long nrof)
void esrv_send_face(socket_struct *ns, const Face *face, int nocache)
void query_name(const object *op, char *buf, size_t size)
#define FLAG_KNOWN_BLESSED
#define FLAG_KNOWN_CURSED
#define FOR_OB_AND_BELOW_FINISH()
void SockList_AddShort(SockList *sl, uint16_t data)
int transport_can_hold(const object *transport, const object *op, int nrof)
int object_can_pick(const object *who, const object *item)
void SockList_AddChar(SockList *sl, unsigned char c)
void query_short_name(const object *op, char *buf, size_t size)
static void add_object_to_socklist(socket_struct *ns, SockList *sl, object *head)
#define FOR_OB_AND_BELOW_PREPARE(op_)
const Animations * animation
void SockList_Init(SockList *sl)
object * find_skill_by_name(object *who, const char *name)
size_t strlcpy(char *dst, const char *src, size_t size)
static std::shared_ptr< inja::Environment > env
object * drop_object(object *op, object *tmp, uint32_t nrof)
void SockList_Term(SockList *sl)
#define MSG_TYPE_COMMAND_FAILURE
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
#define FLAG_KNOWN_MAGICAL
void esrv_send_animation(socket_struct *ns, const Animations *anim)
#define MSG_TYPE_SKILL_FAILURE
void LOG(LogLevel logLevel, const char *format,...)
void SockList_AddLen8Data(SockList *sl, const void *data, size_t len)
int apply_by_living(object *pl, object *op, int aflag, int quiet)
void query_base_name(const object *op, int plural, char *buf, size_t size)
#define CLEAR_FLAG(xyz, p)
void esrv_send_inventory(object *pl, object *op)
uint8_t anims_sent[MAXANIMNUM]
object * ranges[range_size]
int GetInt_String(const unsigned char *data)
static object * ob_if_can_find(object *op, object *ob)
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
void examine_cmd(char *buf, int len, player *pl)
void inventory(object *op, object *inv)
static object * esrv_get_ob_from_count(object *pl, tag_t count)
void esrv_update_item(int flags, object *pl, object *op)
#define FLAG_NO_SKILL_IDENT
void pick_up(object *op, object *alt)
void examine(object *op, object *tmp)
int sack_can_hold(const object *pl, const object *sack, const object *op, uint32_t nrof)
void Send_With_Handling(socket_struct *ns, SockList *sl)
mapstruct * get_map_from_coord(mapstruct *m, int16_t *x, int16_t *y)
#define FOR_INV_PREPARE(op_, it_)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...)
void look_at(object *op, int dx, int dy)
void SockList_AddPrintf(SockList *sl, const char *format,...)
void put_object_in_sack(object *op, object *sack, object *tmp, uint32_t nrof)
int is_identified(const object *op)