srogue: open the score and log files when the program starts.

Super-Rogue can now use the same privilege-dropping scheme as the other
games.
This commit is contained in:
John "Elwin" Edwards 2015-08-01 15:12:11 -04:00
parent 2d3d25c5e9
commit bc5b26fece
3 changed files with 28 additions and 7 deletions

View file

@ -54,6 +54,7 @@ int group = NEWGROUP; /* Current group number */
int hungry_state = F_OKAY; /* How hungry is he */
int foodlev = 1; /* how fast he eats food */
int ringfood = 0; /* rings affect on food consumption */
int scorefd = -1; /* Scoreboard file descriptor */
char take; /* Thing the rogue is taking */
char runch; /* Direction player is running */
char curpurch[15]; /* name of item ready to buy */
@ -101,6 +102,8 @@ char illegal[] = { "Illegal command '%s'." };
char callit[] = { "Call it: " };
char starlist[] = { " (* for a list)" };
FILE *logfile = NULL;
struct coord oldpos; /* Pos before last look() call */
struct coord delta; /* Change indicated to get_dir() */
struct coord stairs; /* where the stairs are put */