L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 02, 2008, 01:16:42 AM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Support > Support for older versions > BeBot 0.3 support > Topic: Notify, am I doing it right ?
Pages: [1]   Go Down
« previous next »
Print
Author Topic: Notify, am I doing it right ?  (Read 434 times)
0 Members and 1 Guest are viewing this topic.
Stelai
Freshman
*
Offline Offline

Gender: Male
Posts: 7


Notify, am I doing it right ?
« on: June 28, 2007, 02: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.
Logged
Temar
BeBot Developer
Grandmaster
********
Offline Offline

Gender: Male
Posts: 877



WWW
Re: Notify, am I doing it right ?
« Reply #1 on: June 28, 2007, 05:09:23 AM »

i had a problem with buddies and my bot too
http://bebot.shadow-realm.org/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, 05:12:13 AM by Chris96 » Logged

MSN messenger: chris_smith96 at hotmain dot com
Xfire: chriss96
Stelai
Freshman
*
Offline Offline

Gender: Male
Posts: 7


Re: Notify, am I doing it right ?
« Reply #2 on: June 28, 2007, 05:59:42 AM »

I'll have a look into SVN's roster. Thanks for the hint Smiley
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1085


Re: Notify, am I doing it right ?
« Reply #3 on: June 28, 2007, 09:58:51 AM »

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.
Logged
Stelai
Freshman
*
Offline Offline

Gender: Male
Posts: 7


Re: Notify, am I doing it right ?
« Reply #4 on: June 28, 2007, 10:15:55 AM »

Quote from: Alreadythere on June 28, 2007, 09:58:51 AM
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.
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1085


Re: Notify, am I doing it right ?
« Reply #5 on: June 28, 2007, 11:31:39 AM »

Quote from: Stelai on June 28, 2007, 10:15:55 AM
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.
Logged
Ebag333
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 132


Re: Notify, am I doing it right ?
« Reply #6 on: June 29, 2007, 10:56:57 AM »

Quote from: Alreadythere on June 28, 2007, 11:31:39 AM
Quote from: Stelai on June 28, 2007, 10:15:55 AM
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!).
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1085


Re: Notify, am I doing it right ?
« Reply #7 on: June 29, 2007, 11:04:14 AM »

Could you check your logs please? Is it happening during the roster update or the buddy list cleanup?
Logged
Temar
BeBot Developer
Grandmaster
********
Offline Offline

Gender: Male
Posts: 877



WWW
Re: Notify, am I doing it right ?
« Reply #8 on: June 29, 2007, 11:41:09 AM »

i got the roster thing when i was having a prob
now it works fine
some of you might know my bot
battle150
Logged

MSN messenger: chris_smith96 at hotmain dot com
Xfire: chriss96
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Support > Support for older versions > BeBot 0.3 support > Topic: Notify, am I doing it right ?
« previous next »
 
Jump to:  

Recent
[request] Raid timers
by Elesar1
[December 01, 2008, 04:41:09 PM]

Shared DB online list
by Temar
[December 01, 2008, 01:55:47 AM]

relay colors
by Temar
[December 01, 2008, 01:54:56 AM]

BeBot v0.6.0 released
by Alreadythere
[November 30, 2008, 05:32:00 PM]

Change to Bid.php
by Temar
[November 30, 2008, 11:41:44 AM]

OnlineOrg
by Jiheld
[November 29, 2008, 12:44:27 PM]

Silly Newbie Question.
by Temar
[November 29, 2008, 12:00:02 PM]

massive_pvp_time_table 1
by gerborg
[November 29, 2008, 06:55:35 AM]

Bot not see Guild Chat
by Delvar
[November 28, 2008, 08:30:34 AM]

Starting Bot
by Allisande
[November 28, 2008, 07:08:21 AM]
Stats
Members
Total Members: 1243
Latest: Whackoeng
Stats
Total Posts: 11144
Total Topics: 1505
Online Today: 8
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 1
Guests: 12
Total: 13
Whackoeng

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.279 seconds with 29 queries. (Pretty URLs adds 0.029s, 4q)
Loading...