You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix score file format, use of whoami and fruit buffers
Corrected use of the global `whoami[]` and `fruit[]` buffers.
Fixed how user id's are converted into usernames
when processing the rogue score file.
Fixed critical bugs in how the score file is formatted.
In some cases a `SCORE` value was improperly initialized.
Now, the function `init_score_value(SCORE *scp)` will
properly initialize a `SCORE` value.
If the rogue score file is missing, or zero length,
then the `open_score()` functional will initialize it.
Fixed cases where the code assumed that the score file was exactly
10 entries. Now the `NUMSCORES` value (which defaults to 10), as set in
`config.h`, is used to determine the number of top scores. The global
`numscores` value is initialized to `NUMSCORES`. If someone defines
`NUMSCORES` to a value other than 10, the code will work.
Changed the array name `top_ten` to `top_scores` to reflect
the fact that someone can compile `NUMSCORES` value isn't 10.
The `MAXNAME` value is now `MAX_USERNAME`.
Added `MAX_OTHER_SCORE` to indicate the maximum length the score line
apart from the username.
The `MAXSCORELINE` value is now the sum of MAX_USERNAME` and `MAX_OTHER_SCORE`.
Removed use of `NUMNAME` and instead print the number of top scores.
This is because of someone defines the `NUMSCORES` value in `define.h`
to a value other than 10, we don't have to try an convert the
`NUMSCORES` value into a string that is the English name of that value.
IMPORTANT NOTE: Due to serious flaws how the score file was formatted
in older rogue versions, you make have to remove your
existing score file and let the code re-initialize it.
NOTE: The rogue score file is NOT portable across machines.
For one thing, the user id and username stored in the
score file is host dependent. For another thing, the
values in the rogue score file are machine and OS dependent.
NOTE: If you change the value of the `NUMSCORES` value, you
will need to remove your existing rogue score file
and set the rogue program re-initialize it.
NOTE: If you really want to restore your rogue scores after the
removal and re-initialization, the use the `scedit` tool to
to restore your score scores.
If the `rd_score()` function fails to properly parse the rogue score file,
then code will print a ERROR indicating that rogue score file format is too
old and/or has been corrupted, and suggest that you should remove the rogue
score file which will allow the rogue program to properly initialize it.
To determine if you need to re-initialize your rogue score file,
run the command:
> ./rogue -s
If the above command issues the above mentioned ERROR/WARNING,
and exits non-zero, then you need to remove the rogue score file
and let the rogue program to re-initialize your rogue score file.
0 commit comments