version 1.39 | | version 1.40 |
---|
| | |
| | |
/* | | /* |
* static char *rcsid_item_c = | | * static char *rcsid_item_c = |
* "$Id: item.c,v 1.39 2006/05/05 09:41:15 ryo_saeba Exp $"; | | * "$Id: item.c,v 1.40 2006/05/21 10:35:11 akirschbaum Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
else | | else |
for (tmp=get_map_ob(pl->map,pl->x,pl->y); tmp && tmp->above;tmp=tmp->above) ; | | for (tmp=get_map_ob(pl->map,pl->x,pl->y); tmp && tmp->above;tmp=tmp->above) ; |
| | |
sl.buf=malloc(MAXSOCKBUF); | | sl.buf=malloc(MAXSOCKSENDBUF); |
| | |
Write_String_To_Socket(&pl->contr->socket, "delinv 0", strlen("delinv 0")); | | Write_String_To_Socket(&pl->contr->socket, "delinv 0", strlen("delinv 0")); |
sprintf((char*)sl.buf,"item%d ", pl->contr->socket.itemcmd); | | sprintf((char*)sl.buf,"item%d ", pl->contr->socket.itemcmd); |
| | |
add_object_to_socklist(&pl->contr->socket, &sl, head); | | add_object_to_socklist(&pl->contr->socket, &sl, head); |
got_one++; | | got_one++; |
| | |
if (sl.len > (MAXSOCKBUF-MAXITEMLEN)) { | | if (sl.len > (MAXSOCKSENDBUF-MAXITEMLEN)) { |
Send_With_Handling(&pl->contr->socket, &sl); | | Send_With_Handling(&pl->contr->socket, &sl); |
sprintf((char*)sl.buf,"item%d ", pl->contr->socket.itemcmd); | | sprintf((char*)sl.buf,"item%d ", pl->contr->socket.itemcmd); |
sl.len=strlen((char*)sl.buf); | | sl.len=strlen((char*)sl.buf); |
| | |
int got_one=0; | | int got_one=0; |
SockList sl; | | SockList sl; |
| | |
sl.buf=malloc(MAXSOCKBUF); | | sl.buf=malloc(MAXSOCKSENDBUF); |
| | |
sprintf((char*)sl.buf,"delinv %d", op->count); | | sprintf((char*)sl.buf,"delinv %d", op->count); |
sl.len=strlen((char*)sl.buf); | | sl.len=strlen((char*)sl.buf); |
| | |
* items (especially with some of the bags out there) to | | * items (especially with some of the bags out there) to |
* overflow the buffer. IF so, send multiple item commands. | | * overflow the buffer. IF so, send multiple item commands. |
*/ | | */ |
if (sl.len > (MAXSOCKBUF-MAXITEMLEN)) { | | if (sl.len > (MAXSOCKSENDBUF-MAXITEMLEN)) { |
Send_With_Handling(&pl->contr->socket, &sl); | | Send_With_Handling(&pl->contr->socket, &sl); |
sprintf((char*)sl.buf,"item%d ", pl->contr->socket.itemcmd); | | sprintf((char*)sl.buf,"item%d ", pl->contr->socket.itemcmd); |
sl.len=strlen((char*)sl.buf); | | sl.len=strlen((char*)sl.buf); |
| | |
*/ | | */ |
LOG(llevDebug,"We have not sent item %s (%d)\n", op->name, op->count); | | LOG(llevDebug,"We have not sent item %s (%d)\n", op->name, op->count); |
} | | } |
sl.buf=malloc(MAXSOCKBUF); | | sl.buf=malloc(MAXSOCKSENDBUF); |
| | |
strcpy((char*)sl.buf,"upditem "); | | strcpy((char*)sl.buf,"upditem "); |
sl.len=strlen((char*)sl.buf); | | sl.len=strlen((char*)sl.buf); |
| | |
} | | } |
} | | } |
| | |
sl.buf=malloc(MAXSOCKBUF); | | sl.buf=malloc(MAXSOCKSENDBUF); |
| | |
sprintf((char*)sl.buf,"item%d ", pl->contr->socket.itemcmd); | | sprintf((char*)sl.buf,"item%d ", pl->contr->socket.itemcmd); |
sl.len=strlen((char*)sl.buf); | | sl.len=strlen((char*)sl.buf); |
| | |
{ | | { |
SockList sl; | | SockList sl; |
| | |
sl.buf=malloc(MAXSOCKBUF); | | sl.buf=malloc(MAXSOCKSENDBUF); |
| | |
strcpy((char*)sl.buf,"delitem "); | | strcpy((char*)sl.buf,"delitem "); |
sl.len=strlen((char*)sl.buf); | | sl.len=strlen((char*)sl.buf); |