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

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

Author Topic: Help!! About Auto Invites  (Read 4956 times)

0 Members and 1 Guest are viewing this topic.

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Help!! About Auto Invites
« Reply #15 on: August 20, 2006, 12:56:22 pm »
Did you drop and readd guest table?

-jj-

Offline Dabaron

  • BeBot Apprentice
  • ***
  • Posts: 163
  • Karma: +0/-0
Re: Help!! About Auto Invites
« Reply #16 on: January 21, 2007, 10:49:50 pm »
Back to autoinvite issues for me.  I hadn't updgraded my bot to each version as we have gone along due to heavily modified versions of everything but decided it was time to update the bot.php file for the extra things that have been added.  I made sure that the get_setting function was there (and it was by default in the new one) and then remodified the bot.php for my ign <-> bebot relay stuff to work.

Now comes my problem.  Some guests are getting auto-invited but most aren't (seems to be mostly random what ones are and what ones aren't.  I exported the guests table, dropped it, then re-imported and same thing.  Then I dropped guest table, just restarted bot so it re-created a blank guests table and added all the guests again via in-game guests command but also same thing.  No errors in bot window or anything, just some get invites and some don't.  All of the guests in question are set to 1 not 0 for the invite.

Any ideas?

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Help!! About Auto Invites
« Reply #17 on: January 22, 2007, 05:11:38 am »
Hmm, from what I remember the standard bot.php deletes guests from the buddylist on logon (this was something Xenixa fixed in his roster module).

Check if the following 2 code snippets in bot.php are the same.  Also, are you using the standard roster module?

-jj-


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

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

$end = "";
if (!$mem)
$end = " (not member)";
else if ($mem == 2)
$end = " (guest)";
if (!$mem)
$this -> aoc -> buddy_remove($user);

if ($this -> is_member($name) != 1)
$this -> aoc -> buddy_remove($name);

$this -> log("BUDDY", "LOG", $user . " logged [" . (($args[1] == 1) ? "on" : "off") . "]" . $end);

if (!empty($this -> commands["buddy"]))
{
$keys = array_keys($this -> commands["buddy"]);
foreach ($keys as $key)
$this -> commands["buddy"][$key] -> buddy($user, $args[1]);
}
}

Code: [Select]
/*
Check if person is a member of the bot
*/
function is_member($uname)
{
$result = $this -> db -> select("SELECT nickname FROM members WHERE id = " . $this -> aoc -> get_uid($uname));
if (!empty($result))
return 1;

if ($this -> guildbot)
{
$result = $this -> db -> select("SELECT id FROM guests WHERE id = " . $this -> aoc -> get_uid($uname));
if (!empty($result))
return 2;
}

if ($this -> admin -> in_group($uname, "superadmin"))
{
return 1;
}

if ($this -> admin -> in_group($uname, "admin"))
{
return 1;
}

return false;
}

Offline Dabaron

  • BeBot Apprentice
  • ***
  • Posts: 163
  • Karma: +0/-0
Re: Help!! About Auto Invites
« Reply #18 on: January 22, 2007, 09:12:46 am »
This is how mine looks in the bot.php.  I assume its for the "user has logged on" spam removal that is the difference.

Code: [Select]
/*
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)
$end = " (not member)";
else if ($mem == 2)
$end = " (guest)";
if (!$mem || ($mem == 2))
$this -> aoc -> buddy_remove($user);

if ($this -> is_member($name) != 1)
$this -> aoc -> buddy_remove($name);

$this -> log("BUDDY", "LOG", $user . " logged [" . (($args[1] == 1) ? "on" : "off") . "]" . $end);

if (!empty($this -> commands["buddy"]))
{
$keys = array_keys($this -> commands["buddy"]);
foreach ($keys as $key)
$this -> commands["buddy"][$key] -> buddy($user, $args[1]);
}
}

Code: [Select]
/*
Check if person is a member of the bot
*/
function is_member($uname)
{
$result = $this -> db -> select("SELECT nickname FROM members WHERE id = " . $this -> aoc -> get_uid($uname));
if (!empty($result))
return 1;

if ($this -> guildbot)
{
$result = $this -> db -> select("SELECT id FROM guests WHERE id = " . $this -> aoc -> get_uid($uname));
if (!empty($result))
return 2;
}

if ($this -> admin -> in_group($uname, "superadmin"))
{
return 1;
}

if ($this -> admin -> in_group($uname, "admin"))
{
return 1;
}

return false;
}

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Help!! About Auto Invites
« Reply #19 on: January 22, 2007, 11:01:54 am »
There's the nasty code:

      if (!$mem || ($mem == 2))
      $this -> aoc -> buddy_remove($user);

Just change it to:

      if (!$mem)
      $this -> aoc -> buddy_remove($user);

I think that should be ok, you'll probably need to re-add the guests (doing via SQL is prolly not enough as it won't add the buddies back).  There's a module of mine somewhere with this "delete / readd" included into the !guestlist for exactly this reason.

Cheers,

-jj-

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
Re: Help!! About Auto Invites
« Reply #20 on: January 22, 2007, 09:22:39 pm »
* Xenixa scratches his noggin.

Hmm.. I'm surprised the old is_member() and inc_buddy() functions are still in 0.2.10. I wrote fixes for those eons ago. The ones JJ pointed out that is.
<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky

Offline Dabaron

  • BeBot Apprentice
  • ***
  • Posts: 163
  • Karma: +0/-0
Re: Help!! About Auto Invites
« Reply #21 on: January 23, 2007, 05:34:28 am »
You two seriously ROCK!! (aka that fixed it  ;))

 

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


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


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


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 518
  • 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