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: Notify, am I doing it right ?  (Read 9636 times)

0 Members and 3 Guests are viewing this topic.

Offline Stelai

  • BeBot Rookie
  • *
  • Posts: 7
  • Karma: +0/-0
Notify, am I doing it right ?
« on: June 28, 2007, 09:58:42 am »
Hey there. I'm on the roll of trying the latest dev release of Bebot, which so far works like a charm. Still, I've been working on a simple module, but some stuff wasn't going the way I hoped, so I had to "hack" a bit into the roster file, and I wonder if there's a "clean" way to do it.

So there it goes, basicly i give members of my (raid)bot the possibility to add players to a list, and receive notifies by tell when theses players log in and out.

I went through all the db and commands stuff. But when I add a buddy that isn't in the users table, it gets buddyremoved cause the said toon is not tagged as "notify" in the #___users table. So instead of buddying them in my module, I came to use $this->bot->user->add to add the toon in the user table with an "ANONYMOUS" access level. So far all goes okay.

But when the roster updates, it removes the buddy of the buddylist (on a criteria I don't really understand).

So that little hack I did that when my module adds an anonymous user, I set the source field as the name of my module, and in the roster update, I added a check source=="mymodulename" to the check that avoids the botadmin to get buddy removed. (By the way is there anything checking the source of a member at any point in the bot's execution? This all might cause a bug)

It works all like a charm, but i'm pretty sure I'm doing something wrong here, cause hacking the roster this way sure isn't intended. On the other hand, I'm not that keen on adding the said toons as users of the bot, cause they shouldn't be able to use commands, or to even know their log in/out are notified.

Is there an "intended" way to do such a thing with only tinkering inside my module ? I'm also curious on what do I have to do to have the "lastseen" field of the user table updated for theses ANONYMOUS guys.

Thanks by advance,
Stel.

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Notify, am I doing it right ?
« Reply #1 on: June 28, 2007, 12:09:23 pm »
i had a problem with buddies and my bot too
http://bebot.link/index.php/topic,807.15.html
I downloaded the SVN version of Roster.php and everything is workin fine now
« Last Edit: June 28, 2007, 12:12:13 pm by Chris96 »

Offline Stelai

  • BeBot Rookie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: Notify, am I doing it right ?
« Reply #2 on: June 28, 2007, 12:59:42 pm »
I'll have a look into SVN's roster. Thanks for the hint :)

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Notify, am I doing it right ?
« Reply #3 on: June 28, 2007, 04:58:51 pm »
You can just use the !notify command to add those users, or copy the code out of the add_notify() function in the notify module.

The correct (as in only supported) way to add users to notify is to add them as anonymous users to the bot and then set the notify flag to 1.

Offline Stelai

  • BeBot Rookie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: Notify, am I doing it right ?
« Reply #4 on: June 28, 2007, 05:15:55 pm »
You can just use the !notify command to add those users, or copy the code out of the add_notify() function in the notify module.

The correct (as in only supported) way to add users to notify is to add them as anonymous users to the bot and then set the notify flag to 1.

Aye that's what I did, cause for some reason I couldn't access to notify->add_notify() from outside the notify module. The issue was about roster wiping out the anonymous buddies when updating. I guess the SVN roster will fixitall.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Notify, am I doing it right ?
« Reply #5 on: June 28, 2007, 06:31:39 pm »
The issue was about roster wiping out the anonymous buddies when updating. I guess the SVN roster will fixitall.
Yes, the SVN version syncs buddy list and characters on notify.

Offline Ebag333

  • Contributor
  • *******
  • Posts: 134
  • Karma: +0/-0
Re: Notify, am I doing it right ?
« Reply #6 on: June 29, 2007, 05:56:57 pm »
The issue was about roster wiping out the anonymous buddies when updating. I guess the SVN roster will fixitall.
Yes, the SVN version syncs buddy list and characters on notify.

I'm not so sure about that, Alreadythere.  Not to air our dirty laundry, but I have two "members only" bots that are using the raid part of the roster module, and both are wiping the member list periodically.

Seems to be random too, no rhyme or reason (will go a few days, then all of a sudden...pffft!).

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Notify, am I doing it right ?
« Reply #7 on: June 29, 2007, 06:04:14 pm »
Could you check your logs please? Is it happening during the roster update or the buddy list cleanup?

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Notify, am I doing it right ?
« Reply #8 on: June 29, 2007, 06:41:09 pm »
i got the roster thing when i was having a prob
now it works fine
some of you might know my bot
battle150

 

* 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: 394
  • 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