summaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
Diffstat (limited to 'src/server')
-rw-r--r--src/server/heightScore.h13
-rw-r--r--src/server/highScore.c (renamed from src/server/heightScore.c)16
-rw-r--r--src/server/highScore.h13
-rw-r--r--src/server/publicServer.c8
4 files changed, 25 insertions, 25 deletions
diff --git a/src/server/heightScore.h b/src/server/heightScore.h
deleted file mode 100644
index 4748264..0000000
--- a/src/server/heightScore.h
+++ /dev/null
@@ -1,13 +0,0 @@
-
-#ifndef HEIGHT_SCORE_H
-
-#define HEIGHT_SCORE_H
-
-#define HEIGHTSCORE_MAX_PLAYERS 100
-
-extern void initHeightScore(char *file);
-extern int addPlayerInHighScore(char *name, int score);
-extern char *getTableItem(int index);
-extern void quitHeightScore();
-
-#endif
diff --git a/src/server/heightScore.c b/src/server/highScore.c
index 7689d3f..1ae7001 100644
--- a/src/server/heightScore.c
+++ b/src/server/highScore.c
@@ -7,19 +7,19 @@
#include "main.h"
#include "list.h"
#include "textFile.h"
-#include "heightScore.h"
+#include "highScore.h"
static textFile_t *textFile;
void
-initHeightScore(char *file)
+initHighScore(char *file)
{
int i;
textFile = loadTextFile(file);
if (textFile == NULL) {
- fprintf(stderr, _("I am unable to load: \"%s\" !\n"), file);
+ fprintf(stderr, _("I am unable to load: \"%s\"!\n"), file);
fprintf(stderr, _("Creating: \"%s\"\n"), file);
textFile = newTextFile(file);
}
@@ -31,11 +31,11 @@ initHeightScore(char *file)
}
if (textFile == NULL) {
- fprintf(stderr, _("I was unable to create: \"%s\" !\n"), file);
+ fprintf(stderr, _("I was unable to create: \"%s\"!\n"), file);
return;
}
- for (i = 0; i < HEIGHTSCORE_MAX_PLAYERS; i++) {
+ for (i = 0; i < HIGHSCORE_MAX_PLAYERS; i++) {
addList(textFile->text, strdup("no_name 0"));
}
@@ -51,7 +51,7 @@ addPlayerInHighScore(char *name, int score)
return -1; // Ha ha ha
}
- for (i = 0; i < HEIGHTSCORE_MAX_PLAYERS; i++) {
+ for (i = 0; i < HIGHSCORE_MAX_PLAYERS; i++) {
char *line;
char thisName[STR_NAME_SIZE];
int thisCore;
@@ -64,7 +64,7 @@ addPlayerInHighScore(char *name, int score)
sprintf(new, "%s %d", name, score);
insList(textFile->text, i, strdup(new));
- delListItem(textFile->text, HEIGHTSCORE_MAX_PLAYERS, free);
+ delListItem(textFile->text, HIGHSCORE_MAX_PLAYERS, free);
//printTextFile(textFile);
saveTextFile(textFile);
@@ -86,7 +86,7 @@ getTableItem(int index)
}
void
-quitHeightScore()
+quitHighScore()
{
if (textFile != NULL) {
saveTextFile(textFile);
diff --git a/src/server/highScore.h b/src/server/highScore.h
new file mode 100644
index 0000000..56850f2
--- /dev/null
+++ b/src/server/highScore.h
@@ -0,0 +1,13 @@
+
+#ifndef HIGH_SCORE_H
+
+#define HIGH_SCORE_H
+
+#define HIGHSCORE_MAX_PLAYERS 100
+
+extern void initHighScore(char *file);
+extern int addPlayerInHighScore(char *name, int score);
+extern char *getTableItem(int index);
+extern void quitHighScore();
+
+#endif
diff --git a/src/server/publicServer.c b/src/server/publicServer.c
index 2f25568..4944115 100644
--- a/src/server/publicServer.c
+++ b/src/server/publicServer.c
@@ -34,7 +34,7 @@
#include "publicServer.h"
#include "serverConfigFile.h"
-#include "heightScore.h"
+#include "highScore.h"
#include "log.h"
#include "dns.h"
@@ -260,8 +260,8 @@ initPublicServer()
return -1;
}
- initHeightScore(getSetting
- ("SCORE_FILE", "--score-file", "/tmp/heightscore"));
+ initHighScore(getSetting
+ ("SCORE_FILE", "--score-file", "/tmp/highscore"));
loadArena();
@@ -349,7 +349,7 @@ quitPublicServer()
quitServerConfigFile();
quitModule();
quitListID();
- quitHeightScore();
+ quitHighScore();
quitLog();
exit(0);