Cheated Highscores

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AetherGoth
    FFR Player
    • Jul 2003
    • 12

    #1

    Cheated Highscores

    How about adding a field for each song whose value is the maximum score possible. Then you can just make a little PHP script that is scheduled to run every hour or so with the following:


    $songres = mysql_query("SELECT maxscore, songname FROM songs");

    while (($songrow = mysql_fetch_assoc($songres) !== false)
    {
    $songname = $songrow['songname'];
    $maxscore = $songrow['maxscore'];
    mysql_query("DELETE FROM scores WHERE songname = '$songname' AND score > '$maxscore'");
    }

    mysql_free_result($songres);


    That'll at least stop the *obvious* cheaters.
    I sang of leaves, of leaves of gold, and leaves of gold there grew.
    Of wind I sang, a wind there came, and in the branches blew.
    Beyond the sun, beyond the moon, the foam was on the sea,
    And by the strand of Ilmarin there grew a golden tree.
    - Tolkien
  • Synthlight
    Administrator
    FFR Simfile Author
    FFR Administrator
    • Nov 2002
    • 3059

    #2
    Skilled eh?

    pm me if you are interested in helping with some PHP code dealing with MySQL

    Cheers,

    Synthlight

    Comment

    Working...