From afb63da1374aadd4a5feccff020e65b616d9b84a Mon Sep 17 00:00:00 2001 From: xHire Date: Tue, 19 May 2009 12:17:10 +0200 Subject: Rewritten messages/comments in code of server Rectified the coding style in code of server Changed the empty score line "no_name" -> "---" Fixed __WIN32 to __WIN32__ --- src/server/highScore.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/server/highScore.c') diff --git a/src/server/highScore.c b/src/server/highScore.c index 50e6a13..cbab164 100644 --- a/src/server/highScore.c +++ b/src/server/highScore.c @@ -1,4 +1,3 @@ - #include #include #include @@ -18,22 +17,21 @@ void high_score_init(char *file) textFile = text_file_load(file); if (textFile == NULL) { - fprintf(stderr, _("I am unable to load: \"%s\"!\n"), file); - fprintf(stderr, _("Creating: \"%s\"\n"), file); + fprintf(stderr, _("[Error] Unable to load high score [%s]\n"), file); + fprintf(stderr, _("[Debug] Creating high score file [%s]\n"), file); textFile = text_file_new(file); } else { - - DEBUG_MSG(_("Scorefile: \"%s\"\n"), file); + DEBUG_MSG(_("[Debug] Loading high score file [%s]\n"), file); return; } if (textFile == NULL) { - fprintf(stderr, _("I was unable to create: \"%s\"!\n"), file); + fprintf(stderr, _("[Error] Unable to create high score file [%s]\n"), file); return; } for (i = 0; i < HIGHSCORE_MAX_PLAYERS; i++) { - list_add(textFile->text, strdup("no_name 0")); + list_add(textFile->text, strdup("--- 0")); } text_file_save(textFile); @@ -44,7 +42,7 @@ int table_add(char *name, int score) int i; if (score <= 0) { - return -1; // Ha ha ha + return -1; /* Ha ha ha */ } for (i = 0; i < HIGHSCORE_MAX_PLAYERS; i++) { @@ -61,7 +59,7 @@ int table_add(char *name, int score) sprintf(new, "%s %d", name, score); list_ins(textFile->text, i, strdup(new)); list_del_item(textFile->text, HIGHSCORE_MAX_PLAYERS, free); - //text_file_print(textFile); + /*text_file_print(textFile);*/ text_file_save(textFile); return 0; -- cgit v1.2.3