collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Buddylist cache to prevent logoff spam  (Read 2860 times)

0 Members and 1 Guest are viewing this topic.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Buddylist cache to prevent logoff spam
« on: October 16, 2006, 09:10:39 pm »
I'm still testing this as it was just thrown together in a few minutes to combat todays massive chatserver instability and the following massive spamming.
Use at your own risk etc, but it works for me.

Bot.php, function inc_buddy
Find
Code: [Select]
<?php
/*
Buddy logging on/off
*/
function inc_buddy($args)
{
$user $this -> aoc -> get_uname($args[0]);

$mem $this -> is_member($user);

$end "";
if (!$mem)
{
?>


Change to:
Code: [Select]
<?php
/*
Buddy logging on/off
*/
function inc_buddy($args)
{
$user $this -> aoc -> get_uname($args[0]);

$mem $this -> is_member($user);

// Make sure we only cache members and guests to prevent any issues with !is and anything else that might do buddy actions on non members.
if ($mem)
{
// Buddy logging on
if ($args[1] == 1)
{
// Do we have a logon for a user already logged on?
if (isset($this -> glob["online"][$user]))
{
$this -> log("BUDDY""ERROR"$user " logged on despite of already being marked as logged on!!");
return;
}
else
{
// Enter the user into the online buddy list
$this -> glob["online"][$user] = $user;
}
}
else
{
// Do we have a logoff without a prior login?
if (!isset($this -> glob["online"][$user]))
{
$this -> log("BUDDY""ERROR"$user " logged off with no prior logon!!");
return;
}
else
{
unset($this -> glob["online"][$user]);
}
}
}

$end "";
if (!$mem)
{
?>


Depending on what version of the bot you run, find the actual bot function near the top with all the variable declarations.
Make sure the following line appears:
Code: [Select]
$this -> glob = array();
BeBot Founder and Fixer Kingpin

Offline porter

  • BeBot User
  • **
  • Posts: 28
  • Karma: +0/-0
Re: Buddylist cache to prevent logoff spam
« Reply #1 on: October 17, 2006, 11:52:59 pm »
Oh looks good! Rare as it is (after all) people understandably dislike the logoff spam very much and poor bot gets called names even though it is not his fault ;)

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 300
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal