Author |
Message |
Redfoam
|
Post subject: Failed authentication Posted: Sat Jun 22, 2013 6:30 pm |
|
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?
|
|
|
|
|
Kentarii
|
Post subject: Re: Failed authentication Posted: Sat Jun 22, 2013 7:23 pm |
|
|
Site Admin |
|
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?
|
|
|
|
|
Redfoam
|
Post subject: Re: Failed authentication Posted: Sat Jun 22, 2013 7:29 pm |
|
Joined: Fri Oct 21, 2011 12:32 pm Posts: 5
|
Yes, I did replace all &$bot to $bot.
|
|
|
|
|
Kentarii
|
Post subject: Re: Failed authentication Posted: Sat Jun 22, 2013 7:38 pm |
|
|
Site Admin |
|
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
|
|
|
|
|
Redfoam
|
Post subject: Re: Failed authentication Posted: Sat Jun 22, 2013 7:43 pm |
|
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!
|
|
|
|
|
Kentarii
|
Post subject: Re: Failed authentication Posted: Sat Jun 22, 2013 7:45 pm |
|
|
Site Admin |
|
Joined: Mon Dec 06, 2010 10:38 am Posts: 87 Location: Oslo, Norway
|
Try the dimension fix above.. (I should stop editing my posts..)
|
|
|
|
|
Redfoam
|
Post subject: Re: Failed authentication Posted: Sat Jun 22, 2013 7:50 pm |
|
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.
|
|
|
|
|
Kentarii
|
Post subject: Re: Failed authentication Posted: Sat Jun 22, 2013 7:57 pm |
|
|
Site Admin |
|
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); }
|
|
|
|
|
Redfoam
|
Post subject: Re: Failed authentication Posted: Sat Jun 22, 2013 8:07 pm |
|
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.
|
|
|
|
|
Kentarii
|
Post subject: Re: Failed authentication Posted: Sat Jun 22, 2013 8:21 pm |
|
|
Site Admin |
|
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.
|
|
|
|
|
|