Jump to content
MakeWebGames

[mccodes] Training and crime logs.


Ragnar

Recommended Posts

Version 2, but shouldn't be hard to convert.

Don't like those annoying hard to see verification images or think some one might still be using an auto-refreasher and geting around it? Use logs.

mySQL....

CREATE TABLE `trainlogs` (

`tlogID` int(11) NOT NULL auto_increment,

`tlogTRAINERID` int(11) NOT NULL default '0',

`tlogSTATS` varchar(255) NOT NULL default '0',

`tlogAMOUNT` int(11) NOT NULL default '0',

`tlogTIME` int(20) NOT NULL default '0',

PRIMARY KEY (`tlogID`)

) TYPE=MyISAM AUTO_INCREMENT=1 ;

--

-- Dumping data for table `trainlogs`

--

 

CREATE TABLE `crimelogs` (

`crimID` int(11) NOT NULL auto_increment,

`crimPLAYERID` int(11) NOT NULL default '0',

`crimTIME` int(20) NOT NULL default '0',

PRIMARY KEY (`crimID`)

) TYPE=MyISAM AUTO_INCREMENT=1 ;

--

-- Dumping data for table `crimelogs`

--

 

In docrime.php replace

$_GET['c']=abs((int) $_GET['c']);

with

$_GET['c']=abs((int) $_GET['c']);

$db->query("INSERT INTO crimelogs VALUES('',$userid,unix_timestamp());",$c);

 

In gym.php replace

if($ir['jail']) { $gain/=2; }

with

if($ir['jail']) { $gain/=2; }

$db->query("INSERT INTO trainlogs VALUES('',$userid,'$stat',$gain,unix_timestamp());",$c);

 

In staff_logs.php add

 

case 'traininglogs': view_training_logs(); break;

case 'crimelogs': view_crime_logs(); break;

then at the end of the file right before

$h->endpage();

?>

add

function view_training_logs()

{

global $ir,$c,$h,$userid;

print "<h3>Train Logs</h3>

<table width=75% border=1> <tr> <th>ID</th> <th>Time</th><th>Trainer</th> <th>Amount</th> <th>Stats</th></tr>";

$q=mysql_query("SELECT * FROM trainlogs ORDER BY tlogID ASC",$c);

while($r=mysql_fetch_array($q))

{

print"<tr><td>{$r['tlogID']}</td> <td>".date('F j, Y, g:i:s a',$r['tlogTIME'])."</td><td>{$r['tlogTRAINERID']}</td><td>{$r['tlogAMOUNT']}</td><td>{$r['tlogSTATS']}</a></td>

</tr>";

}

}

function view_crime_logs()

{

global $ir,$c,$h,$userid;

print "<h3>Crime Logs</h3>

<table width=75% border=1> <tr> <th>ID</th> <th>Time</th><th>Player</th></tr>";

$q=mysql_query("SELECT * FROM crimelogs ORDER BY crimID ASC",$c);

while($r=mysql_fetch_array($q))

{

print"<tr><td>{$r['crimID']}</td> <td>".date('F j, Y, g:i:s a',$r['crimTIME'])."</td><td>{$r['crimPLAYERID']}</td>

</tr>";

}

}

 

In smenu.php add the links to the logs section.

> Training Logs

> Crime Logs

";

If you get....

Parse error: syntax error, unexpected '&' in /public_html/smenu.php on line 58

Make sure only the last link has the "; at the end.

 

Now, since people use crime and training a *LOT*, the logs will get big *FAST*!! In cron_day.php, add

$db->query("DELETE FROM trainlogs WHERE tlogTIME < (unix_timestamp() -864000)",$c);

$db->query("DELETE FROM crimelogs WHERE crimTIME < (unix_timestamp() -864000)",$c);

Logs older than 10 days will be deleted. For 20 days and older, use 1728000. For 30 days and older, use 2592000.

Link to comment
Share on other sites

Re: [mccodes] Training and crime logs.

Really thats not a good way to tell if a refresher is being used. All you are doing is storing the time that the code was ran. Someone could simply set up a refresher to run every 10 seconds making it less obvious. Likewise a player can easily appear to be using a refresher when there not simply by training quickly. Basing your judgment on time alone is not an effective way to prevent refreshers.

Link to comment
Share on other sites

Guest Anonymous

Re: [mccodes] Training and crime logs.

It can be done however, I ran a test script that had a pretty high confidence level of auto-refresh detection (~95%) however, I discovered the obvious flaw -- random time interval refresh.

Best bet is something that forces the user to take a different path - perhaps the occasional random event...

Link to comment
Share on other sites

Re: [mccodes] Training and crime logs.

Hmm... Please tell me if I am wrong but however, you think of how many people will train in a day and how many people will do crimes and the more data in being imported and exported out of the Database increaes the Data Transfer on your site don't it and may cause the site to lag?

Link to comment
Share on other sites

Re: [mccodes] Training and crime logs.

 

Hmm... Please tell me if I am wrong but however, you think of how many people will train in a day and how many people will do crimes and the more data in being imported and exported out of the Database increases the Data Transfer on your site don't it and may cause the site to lag?

True, but this is a good way to catch gym hackers, nice mod

Link to comment
Share on other sites

Re: [mccodes] Training and crime logs.

I would just look through the forums personally and use the log user script if u wanna find out...

Anyone that u see running 5/10/15minute refreshers will be reloading the same page or 2 automatically...

Simple solution to a simple problem.

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...