| 1 | /** |
| 2 | * @file |
| 3 | * Characters associated with an account.n |
| 4 | */ |
| 5 | |
| 6 | #ifndef ACCOUNT_CHAR_H |
| 7 | #define ACCOUNT_CHAR_H |
| 8 | |
| 9 | /** |
| 10 | * The maximum characters per account is really driven by the size of |
| 11 | * the buffer we use to read in the data. Take 150 characters off for |
| 12 | * the account name, password, overhead, and other wiggle room and |
| 13 | * find a maximum. From my quick calculations, this amounts to |
| 14 | * 18 characters/account. I think that is sufficient - moving to a |
| 15 | * HUGE_BUF would allow 82. |
| 16 | * The code could be more clever and look at the length of each |
| 17 | * character name and total it up, but having the same limit for everyone |
| 18 | * is better IMO. |
| 19 | */ |
| 20 | #define MAX_CHARACTERS_PER_ACCOUNT (VERY_BIG_BUF - 150) / (MAX_NAME+1) |
| 21 | |
| 22 | |
| 23 | /** |
| 24 | * One character account. |
| 25 | */ |
| 26 | typedef struct account_char_struct { |
| 27 | const char *name; /**< Name of this character/player */ |
| 28 | const char *character_class; /**< Class of this character */ |
| 29 | const char *race; /**< Race of this character */ |
| 30 | uint8_t level; /**< Level of this character */ |
| 31 | const char *face; /**< Face of this character */ |
| 32 | const char *party; /**< Character this party belonged to */ |
| 33 | const char *map; /**< Last map this character was on */ |
| 34 | uint8_t isDead; /**< Should stay at zero if alive, anything else if dead (hopefully 1, but doesn't have to be) */ |
| 35 | struct account_char_struct *next; |
| 36 | } Account_Char; |
| 37 | |
| 38 | Account_Char *account_char_remove(Account_Char *chars, const char *pl_name); |
| 39 | int make_perma_dead(object *op); |
| 40 | int unmake_perma_dead(char *account, char *player); |
| 41 | |
| 42 | #endif |