Example #1
0
bool_t read_player_data(player_db_data_t *db_data)
{
  if (!read_db_file(&db_data->key_data, get_db_file(DB_FILE_KEYS)))
    return FALSE;
  if (!read_db_file(&db_data->att_data, get_db_file(DB_FILE_ATTRIBUTES)))
    return FALSE;
  if (!read_db_file(&db_data->career_data, get_db_file(DB_FILE_CAREER)))
    return FALSE;
  if (!read_db_file(&db_data->season_data, get_db_file(DB_FILE_SEASON)))
    return FALSE;
  return TRUE;
}
Example #2
0
int
db_load(void)
{
    dbpriv_set_dbio_input(input_db);

    str_intern_open(0);

    oklog("LOADING: %s\n", input_db_name);
    if (!read_db_file()) {
	errlog("DB_LOAD: Cannot load database!\n");
	return 0;
    }
    oklog("LOADING: %s done, will dump new database on %s\n",
	  input_db_name, dump_db_name);

    str_intern_close();

    fclose(input_db);
    return 1;
}