nakedmud-mod/
nakedmud-mod/html/tutorials/
nakedmud-mod/html/tutorials/building_extras/
nakedmud-mod/html/tutorials/c/
nakedmud-mod/html/tutorials/reference/
nakedmud-mod/html/tutorials/scripting/
nakedmud-mod/html/tutorials/scripting_extras/
nakedmud-mod/lib/
nakedmud-mod/lib/help/A/
nakedmud-mod/lib/help/B/
nakedmud-mod/lib/help/C/
nakedmud-mod/lib/help/D/
nakedmud-mod/lib/help/G/
nakedmud-mod/lib/help/H/
nakedmud-mod/lib/help/J/
nakedmud-mod/lib/help/L/
nakedmud-mod/lib/help/M/
nakedmud-mod/lib/help/O/
nakedmud-mod/lib/help/P/
nakedmud-mod/lib/help/R/
nakedmud-mod/lib/help/S/
nakedmud-mod/lib/help/W/
nakedmud-mod/lib/logs/
nakedmud-mod/lib/misc/
nakedmud-mod/lib/players/
nakedmud-mod/lib/pymodules/polc/
nakedmud-mod/lib/txt/
nakedmud-mod/lib/world/
nakedmud-mod/lib/world/zones/examples/
nakedmud-mod/lib/world/zones/examples/mproto/
nakedmud-mod/lib/world/zones/examples/oproto/
nakedmud-mod/lib/world/zones/examples/reset/
nakedmud-mod/lib/world/zones/examples/rproto/
nakedmud-mod/lib/world/zones/examples/trigger/
nakedmud-mod/lib/world/zones/limbo/
nakedmud-mod/lib/world/zones/limbo/room/
nakedmud-mod/lib/world/zones/limbo/rproto/
nakedmud-mod/src/alias/
nakedmud-mod/src/dyn_vars/
nakedmud-mod/src/editor/
nakedmud-mod/src/example_module/
nakedmud-mod/src/help2/
nakedmud-mod/src/set_val/
nakedmud-mod/src/socials/
nakedmud-mod/src/time/
#ifndef __SAVE_H
#define __SAVE_H
//*****************************************************************************
//
// save.h
//
// functions having to do with saving and loading accounts and player (and 
// their objects).
//
//*****************************************************************************

//
// ACCOUNT_DATA *load_account(const char   *account);
// CHAR_DATA    *load_player (const char   *player);
//
// Use of these functions has been deprecated. They are dangerous and can be the
// source of bugs if people try loading accounts/players already loaded. 
// Instead, I've opted for a less bug-prone system. Now, accounts and players
// have "get" functions. Whenever an account or player is got, a reference 
// counter for it is increased. When work with the account/player is finished, 
// it must be "unreferenced". When a player/account's references reach zero, it
// is freed from memory. Players and accounts ARE NOT automatically saved to
// disk before they are freed to memory (they should be, but because of how
// extract_mobile is designed, it's not really feasible to do this).
// Consequently, save now needs an init function and accounts/players must 
// be registered when they are first created.

// called at mud boot-up
void init_save(void);

ACCOUNT_DATA *get_account(const char *account);
CHAR_DATA     *get_player(const char *player);

void  unreference_account(ACCOUNT_DATA *account);
void   unreference_player(CHAR_DATA    *ch);
void    reference_account(ACCOUNT_DATA *account);
void     reference_player(CHAR_DATA    *ch);

void     register_account(ACCOUNT_DATA *account);
void      register_player(CHAR_DATA    *ch);

void         save_account(ACCOUNT_DATA *account);
void          save_player(CHAR_DATA    *ch);

bool       account_exists(const char *name);
bool        player_exists(const char *name);

bool     account_creating(const char *name);
bool      player_creating(const char *name);

#endif // __SAVE_H