version 1.40 | | version 1.41 |
---|
| | |
/* | | /* |
* static char *rcsid_init_c = | | * static char *rcsid_init_c = |
* "$Id: request.c,v 1.40 2002/07/01 23:04:10 mwedel Exp $"; | | * "$Id: request.c,v 1.41 2002/07/15 04:57:13 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
CS_STAT_RES_DEPLETE, CS_STAT_RES_DEATH, | | CS_STAT_RES_DEPLETE, CS_STAT_RES_DEATH, |
-1 /* Chaos */, -1 /* Counterspell */, | | -1 /* Chaos */, -1 /* Counterspell */, |
-1 /* Godpower */, CS_STAT_RES_HOLYWORD, | | -1 /* Godpower */, CS_STAT_RES_HOLYWORD, |
CS_STAT_RES_BLIND, -1 /* Blind */ | | CS_STAT_RES_BLIND, |
| | -1 /* Internal */, -1 /* life stealing */ |
}; | | }; |
| | |
/* This is the Setup cmd - easy first implementation */ | | /* This is the Setup cmd - easy first implementation */ |
| | |
*/ | | */ |
if (atoi(buf) || buf[0]=='0') { | | if (atoi(buf) || buf[0]=='0') { |
pl->count=atoi((char*)buf); | | pl->count=atoi((char*)buf); |
pl->count_left=0; | | |
buf=strchr(buf,' '); /* advance beyond the numbers */ | | buf=strchr(buf,' '); /* advance beyond the numbers */ |
if (!buf) { | | if (!buf) { |
#ifdef ESRV_DEBUG | | #ifdef ESRV_DEBUG |
| | |
} | | } |
buf++; | | buf++; |
} | | } |
pl->idle=0; | | |
/* This should not happen anymore. */ | | /* This should not happen anymore. */ |
if (pl->ob->speed_left<-1.0) { | | if (pl->ob->speed_left<-1.0) { |
LOG(llevError,"Player has negative time - shouldn't do command.\n"); | | LOG(llevError,"Player has negative time - shouldn't do command.\n"); |
| | |
* commands. | | * commands. |
*/ | | */ |
| | |
pl->count_left=0; | | |
pl->count=0; | | pl->count=0; |
| | |
} | | } |
| | |
/* -1 is special - no repeat, but don't update */ | | /* -1 is special - no repeat, but don't update */ |
if (repeat!=-1) { | | if (repeat!=-1) { |
pl->count=repeat; | | pl->count=repeat; |
pl->count_left=0; | | |
} | | } |
if ((len-4) >= MAX_BUF) len=MAX_BUF-5; | | if ((len-4) >= MAX_BUF) len=MAX_BUF-5; |
| | |
| | |
return; | | return; |
} | | } |
| | |
pl->idle=0; | | |
| | |
/* This should not happen anymore. */ | | /* This should not happen anymore. */ |
if (pl->ob->speed_left<-1.0) { | | if (pl->ob->speed_left<-1.0) { |
LOG(llevError,"Player has negative time - shouldn't do command.\n"); | | LOG(llevError,"Player has negative time - shouldn't do command.\n"); |
| | |
* for the command that issued the count should be done before any other | | * for the command that issued the count should be done before any other |
* commands. | | * commands. |
*/ | | */ |
pl->count_left=0; | | |
pl->count=0; | | pl->count=0; |
| | |
/* Send confirmation of command execution now */ | | /* Send confirmation of command execution now */ |
| | |
if(pl->last_stats.exp != pl->ob->stats.exp && pl->socket.skillexp) | | if(pl->last_stats.exp != pl->ob->stats.exp && pl->socket.skillexp) |
{ | | { |
int s; | | int s; |
for(s=0;s<pl->last_skill_index;s++) | | for(s=0;s<pl->last_skill_index;s++) { |
{ | | |
AddIfInt(pl->last_skill_exp[s],pl->last_skill_ob[s]->stats.exp , pl->last_skill_id[s]); | | AddIfInt(pl->last_skill_exp[s],pl->last_skill_ob[s]->stats.exp , pl->last_skill_id[s]); |
AddIfShort(pl->last_skill_level[s],pl->last_skill_ob[s]->level , pl->last_skill_id[s]+1); | | AddIfShort(pl->last_skill_level[s],pl->last_skill_ob[s]->level , pl->last_skill_id[s]+1); |
} | | } |
| | |
} | | } |
} | | } |
| | |
/* 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 */ | | 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) { |