Go to the documentation of this file.
60 #define NUM_ACCOUNT_CHAR_FIELDS 8
69 #define ACCOUNT_DIR "account"
85 fp = fopen(fname,
"r");
90 LOG(
llevInfo,
"Warning: Unable to open %s: %s\n", fname, strerror(errno));
97 if (
buf[0] ==
'#')
continue;
100 cp = strchr(
buf,
'\n');
116 ac->level = strtoul(
tmp[3], (
char**) NULL, 10);
120 ac->isDead = strtoul(
tmp[7], (
char**) NULL, 10);
149 if (strcmp(
chars_loaded[loaded]->account_name, account_name) == 0) {
191 if (chars->
chars == NULL) {
200 fprintf(fp,
"# IMPORTANT: Do not edit this file while the server is running. This file is\n"
201 "# only read when the server starts, and any changes will be overwritten when\n"
202 "# the server exits.\n");
204 fprintf(fp,
"%s:%s:%s:%d:%s:%s:%s:%d\n",
205 ac->name,
ac->character_class,
ac->race,
ac->level,
206 ac->face,
ac->party,
ac->map,
ac->isDead);
229 for (ap = chars->
chars; ap; ap = ap->
next) {
331 for (ap = chars->
chars; ap; ap = ap->
next) {
332 if (!strcmp(ap->
name, pl_name))
break;
424 if (strcmp(
ac->name,
op->name) == 0)
sstring add_string(const char *str)
Account_Chars * account_char_load(const char *account_name)
player * get_player(player *p)
void free_string(sstring str)
static Account_Chars ** chars_loaded
void account_char_save(Account_Chars *chars)
int of_close(OutputFile *of)
void fatal(enum fatal_error err)
static size_t chars_loaded_allocated
#define NUM_ACCOUNT_CHAR_FIELDS
int unmake_perma_dead(char *account, char *player)
struct account_char_struct * next
size_t split_string(char *str, char *array[], size_t array_size, char sep)
void account_char_add(Account_Chars *chars, player *pl)
void LOG(LogLevel logLevel, const char *format,...)
FILE * of_open(OutputFile *of, const char *fname)
void account_char_free(Account_Chars *chars)
static void account_char_load_from_file(Account_Chars *chars)
int make_perma_dead(object *op)
void account_char_remove(Account_Chars *chars, const char *pl_name)
static size_t chars_loaded_count