1 | /* |
1 | /* |
2 | * static char *rcsid_resurrection_c = |
2 | * static char *rcsid_resurrection_c = |
3 | * "$Id: resurrection.C,v 1.2 2006/08/29 08:01:38 root Exp $"; |
3 | * "$Id: resurrection.C,v 1.3 2006/08/30 16:30:37 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
259 | strcat(filename,".pl"); |
259 | strcat(filename,".pl"); |
260 | strcpy(newname,filename); |
260 | strcpy(newname,filename); |
261 | strcat(newname,".dead"); |
261 | strcat(newname,".dead"); |
262 | |
262 | |
263 | if(rename(filename,newname) != 0) { |
263 | if(rename(filename,newname) != 0) { |
264 | LOG(llevError, "Cannot rename dead player's file %s into %s: %s\n", filename, newname, strerror_local(errno)); |
264 | LOG(llevError, "Cannot rename dead player's file %s into %s: %s\n", filename, newname, strerror(errno)); |
265 | } |
265 | } |
266 | } |
266 | } |
267 | |
267 | |
268 | |
268 | |
269 | |
269 | |
… | |
… | |
274 | sprintf(buf,"%s/%s/%s/%s.pl",settings.localdir,settings.playerdir,name, name); |
274 | sprintf(buf,"%s/%s/%s/%s.pl",settings.localdir,settings.playerdir,name, name); |
275 | /* peterm: create a .dead filename.... ***.pl.dead */ |
275 | /* peterm: create a .dead filename.... ***.pl.dead */ |
276 | strcpy(buf2,buf); |
276 | strcpy(buf2,buf); |
277 | strcat(buf,".dead"); |
277 | strcat(buf,".dead"); |
278 | if(rename(buf2,buf)== -1){ |
278 | if(rename(buf2,buf)== -1){ |
279 | LOG(llevError, "Cannot rename dead player's file %s into %s: %s\n", buf2, buf, strerror_local(errno)); |
279 | LOG(llevError, "Cannot rename dead player's file %s into %s: %s\n", buf2, buf, strerror(errno)); |
280 | } |
280 | } |
281 | } |
281 | } |
282 | |
282 | |
283 | |
283 | |
284 | int dead_player_exists(const char *name) { |
284 | int dead_player_exists(const char *name) { |