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?
November 22, 2008, 01:48:33 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Support > Helpful posts > Topic: AOChat: not expecting login.
Pages: [1] 2 3 ... 6   Go Down
« previous next »
Print
Author Topic: AOChat: not expecting login.  (Read 8625 times)
0 Members and 1 Guest are viewing this topic.
Khalem
BeBot Founder
Administrator
Grandmaster
********
Offline Offline

Gender: Male
Posts: 670



WWW
AOChat: not expecting login.
« on: December 18, 2005, 06:36:17 PM »

And everything was going so well until this error cropped up...

So what is causing this?
It would seem that later versions of php (5.0.x and later in particular) have had changes done which breaks backwards compactibilities. In addition 64bit CPU systems also display this behaviour.
Basically, the key generated by PHP for the login is invalid. Auno currently have no plans on fixing AOChat.php, but have provided a workaround using a C based PHP Extention.

Unfortunately, no one has yet compiled this extention for Windows, so unless you run *nix your still sol.

Start by grabbing the aokex extention from http://auno.org/dev/aochat/php-aokex-0.1.tar.gz or from the bottom of this post for a local mirror.
Please note that you will need the phpize program which is by default not installed on most Linux distros. The package that provides this for RPM based distros is php-devel.
Fedora and CentOS uses can simply issue as root:
yum install php-devel

Follow the instructions included in the archive for compiling aokex. Once compiled, you can normally do:
make install
This will install aokex to the system wide extention location.

The important step is to add the following line to the top of your AOChat.php:
Code:
dl("aokex.so");

Save and fire up your bot. Provided the aokex extention resides where php can find it, that should do the trick and your bot should now work Smiley
« Last Edit: June 15, 2006, 04:12:09 AM by Khalem » Logged

BeBot Founder and Fixer Kingpin
Madman coder and destroyer of good code
craized
BeBot Contributor
Experienced
*******
Offline Offline

Gender: Male
Posts: 165



WWW
Re: AOChat: not expecting login.
« Reply #1 on: December 26, 2005, 05:41:01 PM »

I'm not at home, so I'm not running 64bit, but if this works for me you're my hero! 64bit runs BeBot so quick, broke my heart that it didn't work.
Logged

Trailin [213/14][ADVENTURER][RK2]
Bigburtha [216/17][NT][RK2][FROZEN]
Abeham [199/7][TRADER][RK2][FROZEN]

Plac3bo
Rookie
**
Offline Offline

Gender: Male
Posts: 50



Re: AOChat: not expecting login.
« Reply #2 on: December 29, 2005, 08:37:39 AM »

ok.. edited my post.. got a bit further now..
phpize goes good, so does configure.. then im at the make part

Quote
/root/php-aokex/aokex-gmp.c:37:17: error: gmp.h: No such file or directory
/root/php-aokex/aokex-gmp.c:44: error: syntax error before 'gmp_randstate_t'
/root/php-aokex/aokex-gmp.c:44: warning: no semicolon at end of struct or union
/root/php-aokex/aokex-gmp.c:45: warning: data definition has no type or storage class
/root/php-aokex/aokex-gmp.c:46: error: syntax error before 'dh_g'
/root/php-aokex/aokex-gmp.c:46: warning: data definition has no type or storage class
/root/php-aokex/aokex-gmp.c:47: error: syntax error before '}' token
/root/php-aokex/aokex-gmp.c: In function 'aokex_math_init':

and it goes on and on with errors.. :x
« Last Edit: December 29, 2005, 08:56:01 AM by Plac3bo » Logged
Khalem
BeBot Founder
Administrator
Grandmaster
********
Offline Offline

Gender: Male
Posts: 670



WWW
Re: AOChat: not expecting login.
« Reply #3 on: December 31, 2005, 06:05:55 AM »

Quote from: Plac3bo on December 29, 2005, 08:37:39 AM
ok.. edited my post.. got a bit further now..
phpize goes good, so does configure.. then im at the make part

Quote
/root/php-aokex/aokex-gmp.c:37:17: error: gmp.h: No such file or directory
/root/php-aokex/aokex-gmp.c:44: error: syntax error before 'gmp_randstate_t'
/root/php-aokex/aokex-gmp.c:44: warning: no semicolon at end of struct or union
/root/php-aokex/aokex-gmp.c:45: warning: data definition has no type or storage class
/root/php-aokex/aokex-gmp.c:46: error: syntax error before 'dh_g'
/root/php-aokex/aokex-gmp.c:46: warning: data definition has no type or storage class
/root/php-aokex/aokex-gmp.c:47: error: syntax error before '}' token
/root/php-aokex/aokex-gmp.c: In function 'aokex_math_init':

and it goes on and on with errors.. :x


You need the GMP library headers installed as per the AOkex documentation.
See http://www.swox.com/gmp/
Logged

BeBot Founder and Fixer Kingpin
Madman coder and destroyer of good code
johskar
Rookie
**
Offline Offline

Posts: 50


Re: AOChat: not expecting login.
« Reply #4 on: January 17, 2006, 07:02:49 PM »

I've done this with no errors during compiling but when i load the bot it still gives the:
    AOChat: not expecting login.

php.ini
Code:
memory_limit = 20M
extension_dir = ./php_extension/

extension = sockets.so
extension = bz2.so
extension = gmp.so
anny modules I am forgetting?
also added the
 
Code:
dl("aokex.so");

to the begining of the AOChat.php file and changed the $key =
Code:
/* Login functions */
    function authenticate($username, $password)
    {
      if($this->state != "auth")
        die("AOChat: not expecting authentication.\n");
     
      $key = aokex_login_key($this->serverseed, $username, $password);
      /*
      $key = $this->generate_login_key($this->serverseed, $username, $password);
      */
      $pak = new AOChatPacket("out", AOCP_LOGIN_REQUEST, array(0, $username, $key));
      $this->send_packet($pak);
      $packet = $this->get_packet();
      if($packet->type != AOCP_LOGIN_CHARLIST)
      {
        return false;
      }

Running Ubuntu 5.10 with PHP 4.4.2
« Last Edit: January 17, 2006, 07:27:50 PM by johskar » Logged
Ainen
Rookie
**
Offline Offline

Posts: 22



Re: AOChat: not expecting login.
« Reply #5 on: January 17, 2006, 08:10:36 PM »

I couldn't get it to work until I moved the dl() statement down into the authenticate function. The extension was compiled properly and loading because I made little test PHP files just to check for aokex_login_key and they were successful, but until I made the move, I got errors about aokex_login_key not existing as a function. Go figure.

Code:
if($this->state != "auth")
        die("AOChat: not expecting authentication.\n");
     
      dl("aokex.so");
      $key = aokex_login_key($this->serverseed, $username, $password);
Logged

BeBot 0.3.4 svn 91 // PHP 4.3.9 // MySQL 4.1.12
johskar
Rookie
**
Offline Offline

Posts: 50


Re: AOChat: not expecting login.
« Reply #6 on: January 18, 2006, 09:56:07 AM »

Tried that, and didn't work for me :/
Logged
craized
BeBot Contributor
Experienced
*******
Offline Offline

Gender: Male
Posts: 165



WWW
Re: AOChat: not expecting login.
« Reply #7 on: January 18, 2006, 05:04:56 PM »

I know this doesn't help anyone, but I just wanted to say that I got this working just fine on a 64bit gentoo install from just Khalem's original steps.

GL to the rest of you.
Logged

Trailin [213/14][ADVENTURER][RK2]
Bigburtha [216/17][NT][RK2][FROZEN]
Abeham [199/7][TRADER][RK2][FROZEN]

sentry
Freshman
*
Offline Offline

Posts: 9


Re: AOChat: not expecting login.
« Reply #8 on: February 26, 2006, 10:32:51 PM »

Any word if anyone has compiled the extensions for windows yet?

Thanks
« Last Edit: February 27, 2006, 07:17:54 PM by sentry » Logged
Mawerick
Freshman
*
Offline Offline

Posts: 5


Re: AOChat: not expecting login.
« Reply #9 on: March 01, 2006, 10:07:56 PM »

Here's an aokex php extension that works for windows:
http://www.wrongplace.net/ao/aokex.zip

Just change
Code:
dl("aokex.so")
to
Code:
dl("aokex.dll")

It includes the gmp.dll that is needed to load it.
« Last Edit: March 01, 2006, 10:16:10 PM by Mawerick » Logged
sentry
Freshman
*
Offline Offline

Posts: 9


Re: AOChat: not expecting login.
« Reply #10 on: March 02, 2006, 07:02:27 AM »

Thanks Mawerick, now up and running on windows with php5 and the latest aochat.php from auno.org
Logged
Khalem
BeBot Founder
Administrator
Grandmaster
********
Offline Offline

Gender: Male
Posts: 670



WWW
Re: AOChat: not expecting login.
« Reply #11 on: March 02, 2006, 11:35:25 PM »

Thats awesome Mawerick Smiley

Next version will work out of the box on windows now aside from the MySQL setup.
I dont suppose you have a MySQL connector compiled for php 4.4.2 and MySQL 4.1/5.0? =)
Logged

BeBot Founder and Fixer Kingpin
Madman coder and destroyer of good code
Mawerick
Freshman
*
Offline Offline

Posts: 5


Re: AOChat: not expecting login.
« Reply #12 on: March 03, 2006, 11:39:32 AM »

Sorry, no. Don't have either of those installed on my windows box.
Logged
Khalem
BeBot Founder
Administrator
Grandmaster
********
Offline Offline

Gender: Male
Posts: 670



WWW
Re: AOChat: not expecting login.
« Reply #13 on: March 04, 2006, 03:37:50 AM »

No biggie. I decided on upgrading the bundled php to 5.1 to make life easier on everyone. Since we have aokex for windows now thats no longer an issue with php 5, and php5 ships with MySQL connetor that supports the new authentication of MySQL 4.1 and newer.
Logged

BeBot Founder and Fixer Kingpin
Madman coder and destroyer of good code
Xenixa
BeBot Contributor
Expert
*******
Offline Offline

Posts: 307



Re: AOChat: not expecting login.
« Reply #14 on: March 16, 2006, 07:15:21 PM »

I believe the MySQL extention (since PHP4.4 and greater) for Win32 is compiled in the PHP.exe CLI.

That is I don't have any mysql.dll's defined in my php.ini and it connects. *shrug*
Logged

<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky
Pages: [1] 2 3 ... 6   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Support > Helpful posts > Topic: AOChat: not expecting login.
« previous next »
 
Jump to:  

Recent
Change text in remember "...
by gerborg
[November 21, 2008, 05:14:57 PM]

Log playtime from buddys ...
by Temar
[November 20, 2008, 10:33:57 AM]

Vote Core module and Simp...
by Temar
[November 19, 2008, 09:26:52 AM]

Restrict access for one m...
by Organizer
[November 19, 2008, 03:21:19 AM]

Custom / Revised Modules ...
by Elesar1
[November 17, 2008, 03:51:46 PM]

TWC
by Temar
[November 16, 2008, 11:39:12 AM]

Are there any FUN modules...
by Elesar1
[November 15, 2008, 07:39:15 PM]

Call to a member function...
by exxie
[November 15, 2008, 09:29:31 AM]

Ported Modules
by Alreadythere
[November 14, 2008, 06:10:07 PM]

cURL and other non-defaul...
by Temar
[November 14, 2008, 04:11:44 PM]
Stats
Members
Total Members: 1235
Latest: DDDepressionnn
Stats
Total Posts: 11037
Total Topics: 1496
Online Today: 18
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 0
Guests: 25
Total: 25

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.214 seconds with 29 queries. (Pretty URLs adds 0.032s, 4q)
Loading...