Register    Login    Forum    Search    FAQ

Board index » AoC>TV » AAMon




Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Failed authentication
 Post Posted: Sat Jun 22, 2013 6:30 pm 
Offline

Joined: Fri Oct 21, 2011 12:32 pm
Posts: 5
Hi,

I have problems with the module giving me this error:
*Botname* [AAMon] [ERROR] Bot failed authentication, make sure you set the right botkey in settings. If you have lost your botkey, contact Kentarii @ AoC>TV Forums.

To make sure I did ask Kentarii for the correct botkeys, which I got and updates in !settings aamon but still same error after several restarts.

What happend was that the server where I host two Bebots on got PHP updated to 5.4 (from 5.2 I think but really not sure). I haven't updated the Bebot core files since I did set up the bots (a few years ago) and the bots wouldn't start because of "Fatal errors". Found a solution http://bebot.shadow-realm.org/coding-an ... n-php-5-4/ and updated the bot core files and now I got further in starting the bots except that the custom modules started to give me "Fatal errors". I found a solution for this that said that I should change all &$bot to $bot in the modules and it will work with PHP 5.4. I did and everything works except for this error on the AAMon module. Not sure this coding change is connected to the problem though.

I also remember know that I had to replace my bot.conf because the bots complained I did have an old one and refused to start. So just used the template and put in the same information as the old one and renamed.

Anyone got an idea how to fix?


Top 
 Profile  
 
 Post subject: Re: Failed authentication
 Post Posted: Sat Jun 22, 2013 7:23 pm 
Offline
Site Admin
User avatar

Joined: Mon Dec 06, 2010 10:38 am
Posts: 87
Location: Oslo, Norway
So in the end.. did you change anything to the the AAMon.php module?

_________________
AoC>TV


Top 
 Profile  
 
 Post subject: Re: Failed authentication
 Post Posted: Sat Jun 22, 2013 7:29 pm 
Offline

Joined: Fri Oct 21, 2011 12:32 pm
Posts: 5
Yes, I did replace all &$bot to $bot.


Top 
 Profile  
 
 Post subject: Re: Failed authentication
 Post Posted: Sat Jun 22, 2013 7:38 pm 
Offline
Site Admin
User avatar

Joined: Mon Dec 06, 2010 10:38 am
Posts: 87
Location: Oslo, Norway
Have you set dimension in your bot.conf? It shows up empty in my logs, so the error is not with botkey, but missing dimension.

You could try setting the dimension directly in AAMon.php (around line 69 in the __construct method)
Code:
        $this -> bot -> core('settings') -> create('AAMon', 'apiurl', 'http://aoc.is-better-than.tv/api.php', "URL to AoC>TV API.");
        $this -> bot -> core('settings') -> create('AAMon', 'botkey', '', "AoC>TV API Key.");
        $this -> bot -> dimension = 'Crom'; // Hardcoded dimension

_________________
AoC>TV


Top 
 Profile  
 
 Post subject: Re: Failed authentication
 Post Posted: Sat Jun 22, 2013 7:43 pm 
Offline

Joined: Fri Oct 21, 2011 12:32 pm
Posts: 5
Thank you for the answer Kentarii. I tried it but still same error.

Edit:
Saw your new post now. Trying it out!


Top 
 Profile  
 
 Post subject: Re: Failed authentication
 Post Posted: Sat Jun 22, 2013 7:45 pm 
Offline
Site Admin
User avatar

Joined: Mon Dec 06, 2010 10:38 am
Posts: 87
Location: Oslo, Norway
Try the dimension fix above.. (I should stop editing my posts..)

_________________
AoC>TV


Top 
 Profile  
 
 Post subject: Re: Failed authentication
 Post Posted: Sat Jun 22, 2013 7:50 pm 
Offline

Joined: Fri Oct 21, 2011 12:32 pm
Posts: 5
Tried hardcode dimension as well. Still same error.

I do have dimension in my bot.config file as well btw.


Top 
 Profile  
 
 Post subject: Re: Failed authentication
 Post Posted: Sat Jun 22, 2013 7:57 pm 
Offline
Site Admin
User avatar

Joined: Mon Dec 06, 2010 10:38 am
Posts: 87
Location: Oslo, Norway
Still not receiving any dimension on my side :(

Try changing this function then and set dimension here.
Code:
    /**
     * Fetch data from the AoC>TV API
     * @param string $op
     * @param array $params
     * @return array
     */
    function fetch_api_data($op, $params = array()) {
        $url = sprintf("%s?op=%s&dimension=%s&botname=%s&botkey=%s&agent=%s&version=%s",
            $this -> bot -> core('settings') -> get('AAMon', 'apiurl'),
            $op,
            urlencode("Crom"), // Hardcoded dimension
            urlencode($this -> bot -> botname),
            urlencode($this -> bot -> core('settings') -> get('AAMon', 'botkey')),
            urlencode($this -> agent),
            urlencode($this -> version)
        );
        if (count($params) > 0) {
            foreach ($params as $k => $v) {
                $url .= '&'. $k .'='. urlencode($v);
            }
        }
        return $this -> bot -> core('tools') -> get_site($url, 1);
    }

_________________
AoC>TV


Top 
 Profile  
 
 Post subject: Re: Failed authentication
 Post Posted: Sat Jun 22, 2013 8:07 pm 
Offline

Joined: Fri Oct 21, 2011 12:32 pm
Posts: 5
WORKS!!! \o/
Actually the first dimension fix might have fixed it. I'm an idiot and accidently uploaded the modified file to the conf folder since I was looking at the bot.conf file. *facepalm*

Thank you a lot Kentarii! Really really appreciate the help.

Edit:
Yes first dimension fix was enough. Tried it on the other bot. Really sorry for noobing out there.


Top 
 Profile  
 
 Post subject: Re: Failed authentication
 Post Posted: Sat Jun 22, 2013 8:21 pm 
Offline
Site Admin
User avatar

Joined: Mon Dec 06, 2010 10:38 am
Posts: 87
Location: Oslo, Norway
Glad we got that sorted out. Might be a bug or change in new version of Bebot.

_________________
AoC>TV


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next

Board index » AoC>TV » AAMon


Who is online

Users browsing this forum: No registered users and 0 guests

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron