BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => 0.5.x Custom/Unofficial Modules => Topic started by: Nytridr on October 07, 2008, 05:35:55 pm

Title: !security Levels
Post by: Nytridr on October 07, 2008, 05:35:55 pm
Seems like we are still having security level problems.  The bot is not retaining what the security levels were and resetting them.

Code: [Select]
Security: Access Levels

[Security: Main Menu] [Security: Security Groups]

Org Ranks and Security Groups with Access Level SUPERADMIN

Org Ranks and Security Groups with Access Level ADMIN

Org Ranks and Security Groups with Access Level LEADER

Org Ranks and Security Groups with Access Level MEMBER
+ Org Rank President:
   Change President Access Level To: [SUPERADMIN] [ADMIN] [LEADER] [GUEST] [ANONYMOUS]
+ Org Rank Advisor:
   Change Advisor Access Level To: [SUPERADMIN] [ADMIN] [LEADER] [GUEST] [ANONYMOUS]
+ Org Rank Veteran:
   Change Veteran Access Level To: [SUPERADMIN] [ADMIN] [LEADER] [GUEST] [ANONYMOUS]
+ Org Rank Member:
   Change Member Access Level To: [SUPERADMIN] [ADMIN] [LEADER] [GUEST] [ANONYMOUS]
+ Org Rank Applicant:
   Change Applicant Access Level To: [SUPERADMIN] [ADMIN] [LEADER] [GUEST] [ANONYMOUS]

Org Ranks and Security Groups with Access Level GUEST

Org Ranks and Security Groups with Access Level ANONYMOUS


[Security: Main Menu] [Security: Security Groups]

There are times when no one is on in org and if the bot restarts for some reason durinng that time it will not retain what the security levels are.

Nyt
Title: Re: !security Levels
Post by: Glarawyn on October 07, 2008, 11:33:56 pm
Bot version?
How many members in your org?
Are you using flexible security groups?
Are you using custom security groups?
Are you using the external script for updating your whois cache on a regular basis?
Do you have alts security on or off?
Title: Re: !security Levels
Post by: Temar on October 08, 2008, 03:03:05 am
Reply for Nyt ----------
he got SVN
he got alot of members like 500+
duno
duno
duno
on

-----------

i also have same problem and im pretty sure i know what does it i just dont know why
Title: Re: !security Levels
Post by: Glarawyn on October 08, 2008, 05:19:49 pm
For org rank detection to work...

Bot must be a member of the org.
Org roster must be loaded and be in whois cache.
Whois cache must be enabled (is this even an option?)

Line 1716 of Security.php
Code: [Select]
guild = $this -> bot -> db -> select("SELECT org_name FROM #___whois WHERE nickname = '".$this -> bot -> botname."'");
This should probably be redone with a whois call.

The only way I can see the bot forgetting is if the org gov in settings is not the same as the detected org gov. This could happen when the settings module refreshes the settings cache from the database. Try disabling this refresh in the settings module maybe? If a change is detected, Security does reset all the access levels to member automatically. This is expected behavior when you change org governing forms!.

That's my best guess for now. Try commenting line 118 of Settings.php:
Code: [Select]
$this -> register_event("cron", "1hour");

If that solves the problem I'm a good guesser. :D
Title: Re: !security Levels
Post by: Alreadythere on October 08, 2008, 06:04:33 pm
Whois cache must be enabled (is this even an option?)
Nope, whois cache is too integrated in the bot.

Line 1716 of Security.php
Code: [Select]
guild = $this -> bot -> db -> select("SELECT org_name FROM #___whois WHERE nickname = '".$this -> bot -> botname."'");
This should probably be redone with a whois call.
Yes, unless doing a join with some other table you never should access the whois table directly. Too much side-line intelligence in the whois core.

The only way I can see the bot forgetting is if the org gov in settings is not the same as the detected org gov. This could happen when the settings module refreshes the settings cache from the database. Try disabling this refresh in the settings module maybe? If a change is detected, Security does reset all the access levels to member automatically. This is expected behavior when you change org governing forms!.
You should have implemented some kind of hooking for settings changes!

Well, maybe I should add it now, adding a flag and a register function for callbacks isn't that much work.

Would allow me to remove some ugly checks in flexible security...
Title: Re: !security Levels
Post by: Glarawyn on October 08, 2008, 09:14:00 pm
You should have implemented some kind of hooking for settings changes!

Yeah I know.  ;D
Title: Re: !security Levels
Post by: Temar on October 08, 2008, 09:56:41 pm
after a long chat about this issue on IRC me Glara and Alreadythere came up with a solution that should fix this problem
and is Fixed in SVN :D
Title: Re: !security Levels
Post by: Alreadythere on October 08, 2008, 10:42:16 pm
You should have implemented some kind of hooking for settings changes!

Yeah I know.  ;D
Never too late :P

Implemented, but not yet tested.
Title: Re: !security Levels
Post by: Nytridr on October 09, 2008, 06:47:06 am
I will update to svn tomarrow.  as I am pretty weak today after a procedure I went through.  it should not take all to long if this has fixed it or not since I run many org bots. 

Just a side note.  No org I ran a bot for has changed their org government. 

Nyt
Title: Re: !security Levels
Post by: Nytridr on October 12, 2008, 09:00:16 pm
Ok I updated the latest svn today.  To many things were going on last week to even think about do anything with the bots I run.  I will keep an eye on it and see how things work out.  So far it seems to be working.. the orgs that have no one in it at this time of day is finding the org name correctly.

I had to go through and set all the security levels today.. so everything is set and hopefully stays now.
Title: Re: !security Levels
Post by: Nytridr on October 13, 2008, 06:36:45 am
I think you all hit it on the head there.  all the little irritating problems I was having has gone away.  Thank you.
SimplePortal 2.3.7 © 2008-2024, SimplePortal