vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Arcade Anti-Cheater Mod (https://vborg.vbsupport.ru/showthread.php?t=67254)

Ron1n 07-15-2004 10:00 PM

Arcade Anti-Cheater Mod
 
Board: 3.x

Purpose:
If your board is a scripting/coding board you probably have cheaters using your arcade. They are people that use memoryhacks/colorbots, and believe me, people do cheat. This hack is to clean up scores. Before, if you wanted to remove a score, you had to create your own mysql query and even though the score was removed the highscore still showed up as belonging to them. This process has been fixed by this hack.

Functionaliy:
- Remove all scores from a user
- Remove a users highscores
- Fix the titleholders/highscores

Screenshot: http://www.elitecoders.org/ftp/ronin...rcadeadmin.jpg
Code: Attatched
No Edits Required PHP script: Attatched

Instructions: Perform the following edits, OR upload the attatched PHP file in place of your own arcadeadmin.php.

#-------------------------------------------------------------------------------#
Find In arcadeadmin.php
#-------------------------------------------------------------------------------#
Code:

        print_form_header('arcadeadmin', 'pruneinvalid');
        print_table_header("Remove All Invalid Scores");
        print_description_row("This action will remove all invalid score records from the database. Invalid records are created during automated score pruning, or if a session is terminated prematurely.");
        print_submit_row("Remove All Invalid Scores", 0);

#-------------------------------------------------------------------------------#
Add Below
#-------------------------------------------------------------------------------#
Code:

// ARCADE HACK BY RONIN       
        print_form_header('arcadeadmin', 'prunebyuser');
        print_table_header("Remove User Scores");
        print_description_row("This action will remove a users scores from the database.");
        print_input_row("Enter the userid here", 'userid');
        print_yes_no_row("Remove highscores only? (as opposed to all scores)", 'high', 0);
        print_submit_row("Remove User Scores", 0);
       
        print_form_header('arcadeadmin', 'fixhighscores');
        print_table_header("Fix High Scores");
        print_description_row("This action will update the highscore listings and awards with the actual highscore information for each game");
        print_submit_row("Update Highscores", 0);
// ARCADE HACK BY RONIN

#-------------------------------------------------------------------------------#
Find in arcadeadmin.php
#-------------------------------------------------------------------------------#
Code:

// ###################### INVALID RECORD PRUNING #######################
if ($_POST['do'] == "prunenoscore") {
        if ($_POST['confirmation']=="YES") {
                $DB_site->query("DELETE FROM " . TABLE_PREFIX . "gamesessions WHERE sessiontype=1");
        }

        define('CP_REDIRECT', 'arcadeadmin.php?do=scores');
        print_stop_message('arcade_cp_settingssaved');
}

#-------------------------------------------------------------------------------#
Add Below
#-------------------------------------------------------------------------------#
Code:

// ###################### PRUNE BY USER #######################
if ($_POST['do'] == "prunebyuser") {
        $userid=$_POST['userid'];
        $high=$_POST['high'];
       
 if ($high) {
        $query = "        SELECT gamename, MAX(score) AS score
                                FROM gamesessions
                                WHERE valid=1
                                GROUP BY gamename        ";
        $myquery = $DB_site->query($query);
        while($row = $DB_site->fetch_array($myquery)) {
                $delete = "DELETE FROM gamesessions WHERE gamename = '".$row['gamename']."' && userid ='".$userid."' && score = ".$row['score'];
                $DB_site->query($delete);
        }
        define('CP_REDIRECT', 'arcadeadmin.php?do=scores');
        print_stop_message('arcade_cp_settingssaved');
 } else {
        $DB_site->query("DELETE FROM " . TABLE_PREFIX . "gamesessions WHERE userid=".$userid);
        define('CP_REDIRECT', 'arcadeadmin.php?do=scores');
        print_stop_message('arcade_cp_settingssaved');
 }
}
// ###################### FIX HIGHSCORES #######################
if ($_POST['do'] == "fixhighscores") {
        $query = "        SELECT gamename, MAX(score) AS score
                                FROM gamesessions
                                WHERE valid=1
                                GROUP BY gamename        ";
        $myquery = $DB_site->query($query);
        while($row = $DB_site->fetch_array($myquery)) {
                $user =        "SELECT userid
                                        FROM gamesessions
                                        WHERE valid=1 AND score='".$row['score']."' AND gamename='".$row['gamename']."'";
                $userquery = $DB_site->query($user);
                while($useid = $DB_site->fetch_array($userquery)) {
                        $update =        "UPDATE games
                                        SET `highscore`='".$row['score']."', `highscorerid`='".$useid['userid']."'
                                        WHERE shortname='".$row['gamename']."'";
                        $DB_site->query($update);
                }
        }
        define('CP_REDIRECT', 'arcadeadmin.php?do=scores');
        print_stop_message('arcade_cp_settingssaved');
}


Musicpill 07-16-2004 10:03 PM

Why's this in the V2 section?

Ron1n 07-16-2004 10:24 PM

good point, i must have misread the forum i clicked on

can someone move this?

Musicpill 07-16-2004 10:29 PM

No problem, its easily done aint it?

assassingod 07-16-2004 10:31 PM

I'll move it for you:)

MrZeropage 07-17-2004 01:08 PM

*installed*

THANKS !

Dean C 07-17-2004 01:30 PM

Thanks for sharing your work - this is an addon though so I've moved it into that section :)

Oblivion Knight 07-17-2004 02:38 PM

If a user has a highscore and becomes the champion of a game, does this also clear the news associated with that user being the new champion? If not, it would be a good addition.. :)

Littlebit 07-17-2004 03:11 PM

Hey, thanks for this add :)
I did run into an error with the /admincp/arcadeadmin.php?do=scores
When I used the option with an admin username and with a registered user, it gave this error: Invalid SQL: DELETE FROM gamesessions WHERE userid=fred
mysql error: Unknown column 'fred' in 'where clause'

with 3.0.3

Ron1n 07-17-2004 04:00 PM

Quote:

Originally Posted by Littlebit
Hey, thanks for this add :)
I did run into an error with the /admincp/arcadeadmin.php?do=scores
When I used the option with an admin username and with a registered user, it gave this error: Invalid SQL: DELETE FROM gamesessions WHERE userid=fred
mysql error: Unknown column 'fred' in 'where clause'

with 3.0.3

I am willing to bet $500 that "fred" is not a valid userid. When you visited fred's arcade profile it should have had all the links and then u=# at the end. The number at the end of the URL is their userID. You can also view the userid from the admin pannel via a search.


All times are GMT. The time now is 01:51 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01122 seconds
  • Memory Usage 1,752KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete