General > Helpful posts

AOChat: not expecting login.

(1/16) > >>

Khalem:
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");

--- End code ---

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 :)

craized:
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.

Plac3bo:
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':

--- End quote ---

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

Khalem:

--- Quote from: Plac3bo on December 29, 2005, 02:37:39 pm ---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':

--- End quote ---

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


--- End quote ---

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

Heffalomp:
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

--- End code ---
anny modules I am forgetting?
also added the
 
--- Code: ---dl("aokex.so");
--- End code ---

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;
      }

--- End code ---

Running Ubuntu 5.10 with PHP 4.4.2

Navigation

[0] Message Index

[#] Next page

Go to full version