Highscore handling for Angband. More...
|static long||total_points (void)|
|Calculates the total number of points earned (wow - NRM) |
|size_t||highscore_read (high_score scores, size_t sz)|
|Read in a highscore file. |
|size_t||highscore_where (const high_score *entry, const high_score scores, size_t sz)|
|Just determine where a new score would be placed Return the location (0 is best) or -1 on failure. |
|size_t||highscore_add (const high_score *entry, high_score scores, size_t sz)|
|static size_t||highscore_count (const high_score scores, size_t sz)|
|static void||highscore_write (const high_score scores, size_t sz)|
|Actually place an entry into the high score file Return the location (0 is best) or -1 on "failure". |
|void||build_score (high_score *entry, const char *died_from, time_t *death_time)|
|void||enter_score (time_t *death_time)|
|Enters a players name on a hi-score table, if "legal". |
Highscore handling for Angband.
Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
This work is free software; you can redistribute it and/or modify it under the terms of either:
a) the GNU General Public License as published by the Free Software Foundation, version 2, or
b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.
References player::au, buildid, player_class::cidx, player::class, high_score::cur_dun, high_score::cur_lev, high_score::day, player::depth, player_other::full_name, high_score::gold, high_score::how, player::lev, player::max_depth, high_score::max_dun, high_score::max_lev, player::max_lev, my_strcpy(), op_ptr, high_score::p_c, high_score::p_r, player_uid, high_score::pts, player::race, player_race::ridx, strnfmt(), total_points(), turn, high_score::turns, high_score::uid, high_score::what, and high_score::who.
|void enter_score||(||time_t *||death_time||)|
Enters a players name on a hi-score table, if "legal".
Assumes "signals_ignore_tstp()" has been called.
References build_score(), player::died_from, EVENT_MESSAGE_FLUSH, event_signal(), highscore_add(), highscore_read(), highscore_write(), MAX_HISCORES, msg, N_ELEMENTS, player::noscore, NOSCORE_DEBUG, NOSCORE_WIZARD, op_ptr, OP_SCORE, player_other::opt, option_type(), streq, and player::total_winner.
Referenced by death_knowledge().
Actually place an entry into the high score file Return the location (0 is best) or -1 on "failure".
References ANGBAND_DIR_APEX, file_close(), file_delete(), file_exists(), file_lock(), file_move(), file_open(), file_write(), FTYPE_RAW, highscore_count(), MODE_WRITE, msg, path_build(), safe_setuid_drop(), and safe_setuid_grab().
Referenced by enter_score().