ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/item.C
(Generate patch)

Comparing deliantra/server/socket/item.C (file contents):
Revision 1.20 by root, Thu Dec 14 20:39:54 2006 UTC vs.
Revision 1.22 by root, Fri Dec 15 03:53:44 2006 UTC

229 if (!(pl->contr->socket->faces_sent[empty_face->number] & NS_FACESENT_FACE)) 229 if (!(pl->contr->socket->faces_sent[empty_face->number] & NS_FACESENT_FACE))
230 esrv_send_face (pl->contr->socket, empty_face->number, 0); 230 esrv_send_face (pl->contr->socket, empty_face->number, 0);
231 231
232 if (pl->contr->socket->look_position) 232 if (pl->contr->socket->look_position)
233 { 233 {
234 char buf[80];
235 snprintf (buf, 80, "Apply this to see %d previous items", NUM_LOOK_OBJECTS);
236
234 sl << uint32 (0x80000000 | (pl->contr->socket->look_position - NUM_LOOK_OBJECTS)) 237 sl << uint32 (0x80000000 | (pl->contr->socket->look_position - NUM_LOOK_OBJECTS))
235 << uint32 (0) 238 << uint32 (0)
236 << sint32 (-1) 239 << sint32 (-1)
237 << uint32 (empty_face->number); 240 << uint32 (empty_face->number)
238 241 << data8 (buf)
239 sl.printf ("Click here to see %d previous items", NUM_LOOK_OBJECTS);
240
241 sl << uint16 (0) 242 << uint16 (0)
242 << uint8 (0) 243 << uint8 (0)
243 << uint32 (0); 244 << uint32 (0);
244 245
245 if (pl->contr->socket->itemcmd == 2) 246 if (pl->contr->socket->itemcmd == 2)
246 sl << uint16 (0); 247 sl << uint16 (0);
270 * we notice the special tag the object has, and act accordingly. 271 * we notice the special tag the object has, and act accordingly.
271 */ 272 */
272 sl << uint32 (0x80000000 | (pl->contr->socket->look_position + NUM_LOOK_OBJECTS)) 273 sl << uint32 (0x80000000 | (pl->contr->socket->look_position + NUM_LOOK_OBJECTS))
273 << uint32 (0) 274 << uint32 (0)
274 << uint32 ((uint32) - 1) 275 << uint32 ((uint32) - 1)
275 << uint32 (empty_face->number); 276 << uint32 (empty_face->number)
276 277 << data8 ("Apply this to see next group of items")
277 sl.printf ("Click here to see next group of items");
278
279 sl << uint16 (0) 278 << uint16 (0)
280 << uint8 (0) 279 << uint8 (0)
281 << uint32 (0); 280 << uint32 (0);
282 281
283 if (pl->contr->socket->itemcmd == 2) 282 if (pl->contr->socket->itemcmd == 2)
284 sl << uint16 (0); 283 sl << uint16 (0);
641 player_apply (pl->ob, op, 0, 0); 640 player_apply (pl->ob, op, 0, 0);
642} 641}
643 642
644/** Client wants to apply some object. Lets do so. */ 643/** Client wants to apply some object. Lets do so. */
645void 644void
646LockItem (uint8 *data, int len, player *pl) 645LockItem (char *data, int len, player *pl)
647{ 646{
648 int flag = data[0]; 647 int flag = data[0];
649 tag_t tag = net_uint32 (data + 1); 648 tag_t tag = net_uint32 ((uint8 *)data + 1);
650 object *op = esrv_get_ob_from_count (pl->ob, tag); 649 object *op = esrv_get_ob_from_count (pl->ob, tag);
651 650
652 if (!op) 651 if (!op)
653 { 652 {
654 new_draw_info (NDI_UNIQUE, 0, pl->ob, "Could not find object to lock/unlock"); 653 new_draw_info (NDI_UNIQUE, 0, pl->ob, "Could not find object to lock/unlock");
663 esrv_update_item (UPD_FLAGS, pl->ob, op); 662 esrv_update_item (UPD_FLAGS, pl->ob, op);
664} 663}
665 664
666/** Client wants to apply some object. Lets do so. */ 665/** Client wants to apply some object. Lets do so. */
667void 666void
668MarkItem (uint8 * data, int len, player *pl) 667MarkItem (char *data, int len, player *pl)
669{ 668{
670 tag_t tag = net_uint32 (data); 669 tag_t tag = net_uint32 ((uint8 *)data);
671 object *op = esrv_get_ob_from_count (pl->ob, tag); 670 object *op = esrv_get_ob_from_count (pl->ob, tag);
672 671
673 if (!op) 672 if (!op)
674 { 673 {
675 new_draw_info (NDI_UNIQUE, 0, pl->ob, "Could not find object to mark"); 674 new_draw_info (NDI_UNIQUE, 0, pl->ob, "Could not find object to mark");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines