version 1.26 | | version 1.27 |
---|
| | |
/* | | /* |
* static char *rcsid_init_c = | | * static char *rcsid_init_c = |
* "$Id: request.c,v 1.26 2001/11/11 09:39:54 gros Exp $"; | | * "$Id: request.c,v 1.27 2001/11/17 21:25:21 michtoen Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
ns->sound = atoi(param); | | ns->sound = atoi(param); |
strcat(cmdback, param); | | strcat(cmdback, param); |
} | | } |
| | else if (!strcmp(cmd,"ext2")) { |
| | ns->ext2 = atoi(param); |
| | strcat(cmdback, param); |
| | } |
else if (!strcmp(cmd,"sexp")) { | | else if (!strcmp(cmd,"sexp")) { |
ns->skillexp = atoi(param); | | ns->skillexp = atoi(param); |
strcat(cmdback, param); | | strcat(cmdback, param); |
| | |
/* This is a reply to a previous query. */ | | /* This is a reply to a previous query. */ |
void ReplyCmd(char *buf, int len, player *pl) | | void ReplyCmd(char *buf, int len, player *pl) |
{ | | { |
| | |
/* This is to synthesize how the data would be stored if it | | /* This is to synthesize how the data would be stored if it |
* was normally entered. A bit of a hack, and should be cleaned up | | * was normally entered. A bit of a hack, and should be cleaned up |
* once all the X11 code is removed from the server. | | * once all the X11 code is removed from the server. |
| | |
*/ | | */ |
sprintf(pl->write_buf,":%s", (char*)buf); | | sprintf(pl->write_buf,":%s", (char*)buf); |
| | |
| | pl->socket.ext_title_flag = 2; /* funny hack: we want the class info in old title function */ |
| | |
| | /* this avoids any hacking here */ |
| | |
switch (pl->state) { | | switch (pl->state) { |
case ST_PLAYING: | | case ST_PLAYING: |
LOG(llevError,"Got reply message with ST_PLAYING input state\n"); | | LOG(llevError,"Got reply message with ST_PLAYING input state\n"); |
| | |
break; | | break; |
| | |
case ST_CHANGE_CLASS: | | case ST_CHANGE_CLASS: |
| | |
key_change_class(pl->ob, buf[0]); | | key_change_class(pl->ob, buf[0]); |
break; | | break; |
| | |
| | |
} | | } |
} | | } |
| | |
rangetostring(pl->ob, buf); | | /* the user set title is nothing we don't use in new client. |
| | * If so, pack it behind name |
| | */ |
| | if(pl->socket.ext2) /* for the ext2 client, we send complex title and no range info*/ |
| | { |
| | if(pl->socket.ext_title_flag) |
| | { |
| | generate_ext_title(pl); |
| | AddIfString(pl->socket.stats.ext_title , pl->ext_title, CS_STAT_EXT_TITLE); |
| | |
| | /* ugly little sucker, but so we got the arch name in class select of the |
| | * client and we don't must change above anything */ |
| | if(pl->socket.ext_title_flag==2) |
| | { |
| | set_title(pl->ob, buf); |
| | AddIfString(pl->socket.stats.title, buf, CS_STAT_TITLE); |
| | } |
| | pl->socket.ext_title_flag = 0; |
| | } |
| | } |
| | else /* for old clients, the normal range & title cmd */ |
| | { |
| | rangetostring(pl->ob, buf); /* we want use the new fire & run system in new client */ |
AddIfString(pl->socket.stats.range, buf, CS_STAT_RANGE); | | AddIfString(pl->socket.stats.range, buf, CS_STAT_RANGE); |
set_title(pl->ob, buf); | | set_title(pl->ob, buf); |
AddIfString(pl->socket.stats.title, buf, CS_STAT_TITLE); | | AddIfString(pl->socket.stats.title, buf, CS_STAT_TITLE); |
| | } |
| | |
/* Only send it away if we have some actual data */ | | /* Only send it away if we have some actual data */ |
if (sl.len>6) { | | if (sl.len>6) { |
| | |
SockList_AddInt(&sl, pl->ob->count); | | SockList_AddInt(&sl, pl->ob->count); |
SockList_AddInt(&sl, weight); | | SockList_AddInt(&sl, weight); |
SockList_AddInt(&sl, pl->ob->face->number); | | SockList_AddInt(&sl, pl->ob->face->number); |
| | |
SockList_AddChar(&sl, strlen(pl->ob->name)); | | SockList_AddChar(&sl, strlen(pl->ob->name)); |
strcpy((char*)sl.buf+sl.len, pl->ob->name); | | strcpy((char*)sl.buf+sl.len, pl->ob->name); |
sl.len += strlen(pl->ob->name); | | sl.len += strlen(pl->ob->name); |
| | |
Send_With_Handling(&pl->socket, &sl); | | Send_With_Handling(&pl->socket, &sl); |
free(sl.buf); | | free(sl.buf); |
SET_FLAG(pl->ob, FLAG_CLIENT_SENT); | | SET_FLAG(pl->ob, FLAG_CLIENT_SENT); |
| | |
mask |= 0x4; /* floor bit */ | | mask |= 0x4; /* floor bit */ |
pl->contr->socket.lastmap.cells[ax][ay].faces[0] = face_num1; | | pl->contr->socket.lastmap.cells[ax][ay].faces[0] = face_num1; |
pl->contr->socket.lastmap.cells[ax][ay].quick_pos[0] = quick_pos_1; | | pl->contr->socket.lastmap.cells[ax][ay].quick_pos[0] = quick_pos_1; |
if(quick_pos_1) // if a multi arch | | if(quick_pos_1) /* if a multi arch */ |
{ | | { |
mask |= 0x10; /* mark ext flag as valid */ | | mask |= 0x10; /* mark ext flag as valid */ |
ext_flag |= 0x4; /* mark multi arch */ | | ext_flag |= 0x4; /* mark multi arch */ |
| | |
mask |= 0x2; /* middle bit */ | | mask |= 0x2; /* middle bit */ |
pl->contr->socket.lastmap.cells[ax][ay].faces[1] = face_num2; | | pl->contr->socket.lastmap.cells[ax][ay].faces[1] = face_num2; |
pl->contr->socket.lastmap.cells[ax][ay].quick_pos[1] = quick_pos_2; | | pl->contr->socket.lastmap.cells[ax][ay].quick_pos[1] = quick_pos_2; |
if(quick_pos_2) // if a multi arch | | if(quick_pos_2) /* if a multi arch */ |
{ | | { |
mask |= 0x10; /* mark ext flag as valid */ | | mask |= 0x10; /* mark ext flag as valid */ |
ext_flag |= 0x2; | | ext_flag |= 0x2; |
| | |
if (pl->contr->socket.lastmap.cells[ax][ay].faces[2] != face_num3 || | | if (pl->contr->socket.lastmap.cells[ax][ay].faces[2] != face_num3 || |
pl->contr->socket.lastmap.cells[ax][ay].quick_pos[2] != quick_pos_3) { | | pl->contr->socket.lastmap.cells[ax][ay].quick_pos[2] != quick_pos_3) { |
mask |= 0x1; /* top bit */ | | mask |= 0x1; /* top bit */ |
if(quick_pos_3) // if a multi arch | | if(quick_pos_3) /* if a multi arch */ |
{ | | { |
mask |= 0x10; /* mark ext flag as valid */ | | mask |= 0x10; /* mark ext flag as valid */ |
ext_flag |= 0x1; | | ext_flag |= 0x1; |