Hello,
I’m a complete novice when it comes to serverside stuff, so would love some help improving my scoreboard, which would mainly just be only posting the score if it’s better than the 100th score for example, or whatever the limit is.
I already have a working score, and it works fine, returns an ordered list like so.
mysql_query( "SELECT * FROM $this->tableName ORDER BY score DESC LIMIT $this->limit ");
And I enter scores like this.
mysql_query( "INSERT INTO $this->tableName SET `name` = '{$cleanName}' , `score` = '{$cleanScore}' ");
Only problem is, it currently adds scores even if they rank 5000th, which is unnecessary as I’m only displaying the top 100.
So I really need a solution as the DB keeps getting too full, and I keep having manually delete excess entries.
In AS it would be something like this.
if (scoresArray.length < 100) {
postScore();
} else {
scoresArray.sortOn("score", Array.NUMERIC | Array.DESCENDING);
if (userScore > scoresArray[99].score) {
postScore();
}
}
Which would be fine to use now, I could just retrieve the scores, see if they crack the top 100, and only post a score if they do.
The reason I need a serverside solution is because my first game is already online, so I can’t replace it
Plus it would just be a better solution surely.
Cheers,
RumbleSushi