Open GoogleCodeExporter opened 8 years ago
[deleted comment]
I managed to do this with a custom php script that runs daily. You won't get
instant gratification but it will ban the leavers within a day. Copy and paste
the
folowing into notepad or better yet a php parser like this free one.
http://devphp.sourceforge.net You of course need a webserver that can run php
code
as well as access to the sql database that your ghost++ bot reports to. This
particular code bans players that have played more than 5 games and have spent
less
that 50% of the time in game.
<html>
<body>
<Table class='outline'><TR><TD class='standard'>Rank</TD><TD
class='standard'>Games
Played</TD><TD class='standard'>Player's Name</TD><TD
class='standard'>Realm</TD><TD
class='standard'>Total Time in Game</TD><TD class='standard'>Total Game
Time</TD><TD
class='standard'>In Game Percent</TD><TD class='standard'>Last IP</TD></TR>
<?PHP
$gamesplayed = 5;
$query = "select count(name),gameplayers.name,gameplayers.spoofedrealm,sum
(gameplayers.left),sum(games.duration),sum(gameplayers.left)/sum(games.duration)
,ip
from gameplayers,games where gameplayers.gameid = games.id and
gameplayers.leftreason = 'has left the game voluntarily' group by
name,spoofedrealm
order by sum(gameplayers.left)/sum(games.duration)";
$result = mysql_query($query) or die('Q1 failed: ' . mysql_error());
$i=1;
while ($row = mysql_fetch_row($result))
{
if ($row[0] >= $gamesplayed) {
if ($row[5] <= .500)
{
echo "<TD class='standard'>$i</TD><TD class='standard'>$row[0]</TD><TD
class='standard'><a
href='leavers.php?PlayerName=$row[1]&PlayerRealm=$row[2]'>$row[1]
</a></TD><TD class='standard'>$row[2]</TD><TD class='standard'>$row[3]</TD><TD
class='standard'>$row[4]</TD><TD class='standard'>" . $row[5]*100 . "</TD><TD
class='standard'>" . $row[6] . "</TD></TR>";
$i++;
$query2 = "select name from bans where name='" . $row[1] . "' and server='" .
$row[2] . "'";
$result2 = mysql_query($query2) or die ('Q2 failed: ' . mysql_error());
if (mysql_num_rows($result2) == 0)
{
echo "New Entry " . $row[5] . "= insert " . $row[1] . $row[2];
$query3 = "insert into bans (botid,server,name,ip,date,gamename,admin,reason)
values ('0','$row[2]','$row[1]','$row[6]',now(),'Average of 5
games','Anna','Leaver
percentage below 50%')";
$result3 = mysql_query($query3) or die ('Q3 failed: ' . mysql_error());
}
}
}
?>
</table>
</body>
Original comment by ico...@gmail.com
on 4 Feb 2010 at 5:04
Original issue reported on code.google.com by
lord...@gmail.com
on 11 Jan 2010 at 10:39