|
@ -165,7 +165,7 @@ void sortScoreboard() |
|
|
{ |
|
|
{ |
|
|
char* playertmp = strtok(line, " "); |
|
|
char* playertmp = strtok(line, " "); |
|
|
strcpy(playerlist[j].Name, playertmp); |
|
|
strcpy(playerlist[j].Name, playertmp); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
playertmp = strtok(NULL, " "); |
|
|
playertmp = strtok(NULL, " "); |
|
|
int playerPoints = atoi(playertmp); |
|
|
int playerPoints = atoi(playertmp); |
|
|
|
|
|
|
|
@ -173,6 +173,18 @@ void sortScoreboard() |
|
|
|
|
|
|
|
|
numberOfLines = j; |
|
|
numberOfLines = j; |
|
|
sleep(100); |
|
|
sleep(100); |
|
|
|
|
|
} |
|
|
|
|
|
struct Player temp; |
|
|
|
|
|
for (int i = 0; i <= numberOfLines; i++) |
|
|
|
|
|
{ |
|
|
|
|
|
if (playerlist[i].Points < playerlist[i + 1].Points) |
|
|
|
|
|
{ |
|
|
|
|
|
temp = playerlist[i]; |
|
|
|
|
|
playerlist[i] = playerlist[i + 1]; |
|
|
|
|
|
playerlist[i + 1] = temp; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
fclose(fp); |
|
|
fclose(fp); |
|
|
} |
|
|
} |