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

Comparing deliantra/server/server/resurrection.C (file contents):
Revision 1.32 by root, Fri Nov 6 12:27:06 2009 UTC vs.
Revision 1.37 by root, Sat Apr 23 04:56:57 2011 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008,2009,2010,2011 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team 5 * Copyright (©) 2002 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992,2007 Frank Tore Johansen 6 * Copyright (©) 1992 Frank Tore Johansen
7 * 7 *
8 * Deliantra is free software: you can redistribute it and/or modify it under 8 * Deliantra is free software: you can redistribute it and/or modify it under
9 * the terms of the Affero GNU General Public License as published by the 9 * the terms of the Affero GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your 10 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version. 11 * option) any later version.
238 } 238 }
239 else 239 else
240 return resurrect_player (op, name_to_resurrect, spell); 240 return resurrect_player (op, name_to_resurrect, spell);
241} 241}
242 242
243void
244dead_player (object *op)
245{
246 char filename[MAX_BUF];
247 char newname[MAX_BUF];
248 char path[MAX_BUF];
249
250 /* set up our paths/strings... */
251 sprintf (path, "%s/%s/%s/%s", settings.localdir, settings.playerdir, &op->name, &op->name);
252
253 strcpy (filename, path);
254 strcat (filename, ".pl");
255 strcpy (newname, filename);
256 strcat (newname, ".dead");
257
258 if (rename (filename, newname) != 0)
259 {
260 LOG (llevError, "Cannot rename dead player's file %s into %s: %s\n", filename, newname, strerror (errno));
261 }
262}
263
264void
265dead_character (const char *name)
266{
267 char buf[MAX_BUF];
268 char buf2[MAX_BUF];
269
270 sprintf (buf, "%s/%s/%s/%s.pl", settings.localdir, settings.playerdir, name, name);
271 /* peterm: create a .dead filename.... ***.pl.dead */
272 strcpy (buf2, buf);
273 strcat (buf, ".dead");
274 if (rename (buf2, buf) == -1)
275 {
276 LOG (llevError, "Cannot rename dead player's file %s into %s: %s\n", buf2, buf, strerror (errno));
277 }
278}
279
280int
281dead_player_exists (const char *name)
282{
283 char buf[MAX_BUF];
284
285 sprintf (buf, "%s/%s/%s/%s", settings.localdir, settings.playerdir, name, name);
286 strcat (buf, ".pl.dead");
287 return !(access (buf, 0));
288}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines