--- deliantra/server/socket/item.C 2006/12/14 04:30:33 1.19 +++ deliantra/server/socket/item.C 2006/12/15 19:59:20 1.23 @@ -35,8 +35,6 @@ #include #include /* LOOK_OBJ */ -#include -#include #include /** This is the maximum number of bytes we expect any one item to take up */ @@ -116,7 +114,7 @@ * animation of face to the client. */ static void -add_object_to_socklist (client_socket &ns, packet &sl, object *head) +add_object_to_socklist (client &ns, packet &sl, object *head) { int flags, len, anim_speed; char item_n[MAX_BUF]; @@ -231,14 +229,15 @@ if (pl->contr->socket->look_position) { + char buf[80]; + snprintf (buf, 80, "Apply this to see %d previous items", NUM_LOOK_OBJECTS); + sl << uint32 (0x80000000 | (pl->contr->socket->look_position - NUM_LOOK_OBJECTS)) << uint32 (0) << sint32 (-1) - << uint32 (empty_face->number); - - sl.printf ("Click here to see %d previous items", NUM_LOOK_OBJECTS); - - sl << uint16 (0) + << uint32 (empty_face->number) + << data8 (buf) + << uint16 (0) << uint8 (0) << uint32 (0); @@ -272,11 +271,9 @@ sl << uint32 (0x80000000 | (pl->contr->socket->look_position + NUM_LOOK_OBJECTS)) << uint32 (0) << uint32 ((uint32) - 1) - << uint32 (empty_face->number); - - sl.printf ("Click here to see next group of items"); - - sl << uint16 (0) + << uint32 (empty_face->number) + << data8 ("Apply this to see next group of items") + << uint16 (0) << uint8 (0) << uint32 (0); @@ -296,7 +293,7 @@ if (sl.length () >= (MAXSOCKBUF - MAXITEMLEN)) { - Send_With_Handling (pl->contr->socket, &sl); + pl->contr->socket->send_packet (sl); sl.reset (); sl.printf ("item%d ", pl->contr->socket->itemcmd); @@ -307,7 +304,7 @@ } if (got_one) - Send_With_Handling (pl->contr->socket, &sl); + pl->contr->socket->send_packet (sl); } @@ -323,7 +320,7 @@ packet sl; sl.printf ("delinv %d", op->count); - Send_With_Handling (pl->contr->socket, &sl); + pl->contr->socket->send_packet (sl); sl.reset (); sl.printf ("item%d ", pl->contr->socket->itemcmd); @@ -351,7 +348,7 @@ */ if (sl.length () >= (MAXSOCKBUF - MAXITEMLEN)) { - Send_With_Handling (pl->contr->socket, &sl); + pl->contr->socket->send_packet (sl); sl.reset (); sl.printf ("item%d ", pl->contr->socket->itemcmd); @@ -362,7 +359,7 @@ } if (got_one) - Send_With_Handling (pl->contr->socket, &sl); + pl->contr->socket->send_packet (sl); } @@ -490,7 +487,7 @@ if (flags & UPD_NROF) sl << uint32 (op->nrof); - Send_With_Handling (pl->contr->socket, &sl); + pl->contr->socket->send_packet (sl); } /** @@ -526,7 +523,7 @@ add_object_to_socklist (*pl->contr->socket, sl, op); - Send_With_Handling (pl->contr->socket, &sl); + pl->contr->socket->send_packet (sl); SET_FLAG (op, FLAG_CLIENT_SENT); } @@ -544,7 +541,7 @@ sl << "delitem " << uint32 (tag); - Send_With_Handling (pl->socket, &sl); + pl->socket->send_packet (sl); } @@ -643,10 +640,10 @@ /** Client wants to apply some object. Lets do so. */ void -LockItem (uint8 *data, int len, player *pl) +LockItem (char *data, int len, player *pl) { int flag = data[0]; - tag_t tag = net_uint32 (data + 1); + tag_t tag = net_uint32 ((uint8 *)data + 1); object *op = esrv_get_ob_from_count (pl->ob, tag); if (!op) @@ -665,9 +662,9 @@ /** Client wants to apply some object. Lets do so. */ void -MarkItem (uint8 * data, int len, player *pl) +MarkItem (char *data, int len, player *pl) { - tag_t tag = net_uint32 (data); + tag_t tag = net_uint32 ((uint8 *)data); object *op = esrv_get_ob_from_count (pl->ob, tag); if (!op)