BeBot - An Anarchy Online and Age Of Conan chat automaton

General => Helpful posts => Topic started by: Khalem on December 19, 2005, 12:36:17 am

Title: AOChat: not expecting login.
Post by: Khalem on December 19, 2005, 12:36:17 am
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: [Select]
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 :)
Title: Re: AOChat: not expecting login.
Post by: craized on December 26, 2005, 11: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.
Title: Re: AOChat: not expecting login.
Post by: 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':

and it goes on and on with errors.. :x
Title: Re: AOChat: not expecting login.
Post by: Khalem on December 31, 2005, 12:05:55 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':

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/
Title: Re: AOChat: not expecting login.
Post by: Heffalomp on January 18, 2006, 01:02:49 am
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: [Select]
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: [Select]
dl("aokex.so");
to the begining of the AOChat.php file and changed the $key =
Code: [Select]
/* 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
Title: Re: AOChat: not expecting login.
Post by: Ainen on January 18, 2006, 02:10:36 am
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: [Select]
if($this->state != "auth")
        die("AOChat: not expecting authentication.\n");
     
      dl("aokex.so");
      $key = aokex_login_key($this->serverseed, $username, $password);
Title: Re: AOChat: not expecting login.
Post by: Heffalomp on January 18, 2006, 03:56:07 pm
Tried that, and didn't work for me :/
Title: Re: AOChat: not expecting login.
Post by: craized on January 18, 2006, 11: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.
Title: Re: AOChat: not expecting login.
Post by: sentry on February 27, 2006, 04:32:51 am
Any word if anyone has compiled the extensions for windows yet?

Thanks
Title: Re: AOChat: not expecting login.
Post by: Mawerick on March 02, 2006, 04:07:56 am
Here's an aokex php extension that works for windows:
http://www.wrongplace.net/ao/aokex.zip (http://www.wrongplace.net/ao/aokex.zip)

Just change
Code: [Select]
dl("aokex.so") to
Code: [Select]
dl("aokex.dll")
It includes the gmp.dll that is needed to load it.
Title: Re: AOChat: not expecting login.
Post by: sentry on March 02, 2006, 01:02:27 pm
Thanks Mawerick, now up and running on windows with php5 and the latest aochat.php from auno.org
Title: Re: AOChat: not expecting login.
Post by: Khalem on March 03, 2006, 05:35:25 am
Thats awesome Mawerick :)

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? =)
Title: Re: AOChat: not expecting login.
Post by: Mawerick on March 03, 2006, 05:39:32 pm
Sorry, no. Don't have either of those installed on my windows box.
Title: Re: AOChat: not expecting login.
Post by: Khalem on March 04, 2006, 09: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.
Title: Re: AOChat: not expecting login.
Post by: Xenixa on March 17, 2006, 01:15:21 am
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*
Title: Re: AOChat: not expecting login.
Post by: Khalem on March 17, 2006, 03:01:03 am
They are, however they are still MySQL 4.0.x or lower as they do not support the MySQL 4.1 and higher authentication changes. And most people will be downloading MySQL 5.0
Title: Re: AOChat: not expecting login.
Post by: kuznechik on March 18, 2006, 09:10:39 pm
Got this error on Fbsd5.4 after upgrade of php from 4.3.7 to 4.4.2
Tried aokex workaround with both gmp and ssl implementations. Didn't helped.
P.S.: system is 32-bit
P.P.S.: It produces these lines in output all 3 ways under 4.4.2, working now fine without aokex at php4.3.7 till it will be solved.
[LOGIN] [STATUS]        Connecting
[LOGIN] [STATUS]        Authenticateing
[LOGIN] [RESULT]        Error
[LOGIN] [STATUS]        Logging in
AOChat: not expecting login.

Title: Re: AOChat: not expecting login.
Post by: Lokki on March 23, 2006, 10:46:57 am
I have the same problem. Anyone found a solution for this? Using 4.4.2 and dont want to use the older 4.3...
Title: Re: AOChat: not expecting login.
Post by: kuznechik on March 23, 2006, 11:38:44 am
Wondering if it's connected to 64-bit integer handling message I've got when making php4.4.2
Title: Re: AOChat: not expecting login.
Post by: Jasper2002 on April 10, 2006, 05:51:27 pm
Does anyone have a link for downloading the Dev version of PHP 5.0.4-10.5 or has anyone a copy of aokex.so compiled under PHP 5.0.4-10.5 that they can link so I can download it, I cannot find the dev versions on the PHP website (needed to use PHPIZE command) and Aokex has not been added to the PHP repository at http://pecl.php.net :(

This is the only bit that I am struggling with now, I think, in getting BeBot running on my dedicated server.

Help please ;D

ps, Also getting these errors

PHP Warning:  unpack(): Type H: outside of string in /home/bebot/AOChat.php on line 724
[2006-04-10 15:52:07]   [LOGIN] [STATUS]        Authenticateing
[2006-04-10 15:52:07]   [LOGIN] [RESULT]        Error
[2006-04-10 15:52:07]   [LOGIN] [STATUS]        Logging in
AOChat: not expecting login.
PHP Notice:  Undefined variable: os_windows in /home/bebot/main.php on line 67
Connected to MySQL
PHP Notice:  Undefined variable: bot_version in /home/bebot/main.php on line 148

I think the first 5 lines is what gets fixed when Aokex is running, it is the other 3 that I am not too sure about  ???

another edit
From the instructions in the install file with aokex it says
  % phpize
  % ./configure --with-aokex=shared
  % make
  % make install

Now, phpize doesn't come with standard PHP, just the dev version, but it can be installed with Pear instead, apparently. The ./configure command does nothing just says that there is no such directory. I think the ./ bit tells it to use the current directory to find configure, do I need to copy it there as it was not in the download.

As you may have guessed i am a little new to Linux, and went out and got a dedicated server running Fedora Core 3. I would really like to make this work tho, so I will keep on trying. Just very confused about the configure and phpize things as they don't seem to work for me :(
Title: Re: AOChat: not expecting login.
Post by: kuznechik on April 11, 2006, 10:06:03 am
phpize will create ./configure for you.

So far I was unsuccessful with starting bebot 2.3 under php >4.3.7 (Now have php5.1.2/mysql5.0.19)
Tried aokex with ssl and gmp variations. Also tried fix proposed at hackersquest http://hackersquest.org/boards/viewtopic.php?t=6226&highlight=aochat+expecting+login (http://hackersquest.org/boards/viewtopic.php?t=6226&highlight=aochat+expecting+login)
Same - both with bcmath and gmp used.
Tried last version of AOChat.php from Auno...
Not working :( Still not expecting login :(
Tried:
FreeBSD 6.0/php5.1.2/mysql5.0.19
FreeBSD5.4/php4.4.2/mysql4.0.20
If php version >= 4.4.0 - bebot won't work :(
Title: Re: AOChat: not expecting login.
Post by: Jasper2002 on June 14, 2006, 09:58:21 pm
Hi, downloaded and updated latest version on my server and still getting

Quote
[2006-06-14 19:38:56]   [LOGIN] [STATUS]        Connecting
[2006-06-14 19:38:56]   [LOGIN] [STATUS]        Authenticateing
PHP Warning:  unpack(): Type H: outside of string in /home/bebot/AOChat.php on line 718
PHP Warning:  unpack(): Type H: outside of string in /home/bebot/AOChat.php on line 718
PHP Warning:  unpack(): Type H: outside of string in /home/bebot/AOChat.php on line 718
PHP Warning:  unpack(): Type H: outside of string in /home/bebot/AOChat.php on line 718
PHP Warning:  unpack(): Type H: outside of string in /home/bebot/AOChat.php on line 718
PHP Warning:  unpack(): Type H: outside of string in /home/bebot/AOChat.php on line 718
PHP Warning:  unpack(): Type H: outside of string in /home/bebot/AOChat.php on line 718
PHP Warning:  unpack(): Type H: outside of string in /home/bebot/AOChat.php on line 718
PHP Warning:  unpack(): Type H: outside of string in /home/bebot/AOChat.php on line 718
[2006-06-14 19:38:56]   [LOGIN] [RESULT]        Error
[2006-06-14 19:38:56]   [LOGIN] [STATUS]        Logging in
AOChat: not expecting login.

Is there any possible way around this?

I thought that it was something that was fixed by Aokex, but obviously not as the Aokex req has been fixed in the updated download.

I am confused.

I am as always at your pleasure.....

I would like to thank Khalem for his help this evening. He saved me from hours of trail and testing and got my bot working. Many, many thanks, from me and the Cerbs :)
Title: Re: AOChat: not expecting login.
Post by: kuznechik on June 15, 2006, 08:54:37 am
Ehm, so how to fix it?
Title: Re: AOChat: not expecting login.
Post by: Khalem on June 15, 2006, 11:09:34 am
Worked with Jasper on this ingame.

The warning can be ignored, its a cosmetical error and is a confirmed bug in the 5.0 version of php he is using.
However it does appear that php 5.0 simply is incapable of producing correct login keys trough the functions the AOChat library uses, as such, the aokex php extention is still needed for these versions.
From all my testing so far however, php 4.3/4.4/5.1 should now work fine.
Title: Re: AOChat: not expecting login.
Post by: Lucid on June 29, 2006, 04:43:44 am
I've recently been trying to get BeBot working on my server from home.  I'm running a hardened gentoo box and have compiled and installed the aokex module for php.  It seems like the key generated by aokex is being rejected somehow.  I think it might have something to do with the hardening patches but I'm not sure.  The box is running PHP 5.1.4.
The login error is the same as a lot of the others.

[2006-06-29 02:15:11]   [LOGIN] [STATUS]        Connecting
[2006-06-29 02:15:11]   [LOGIN] [STATUS]        Authenticateing
[2006-06-29 02:15:11]   [LOGIN] [RESULT]        Error
[2006-06-29 02:15:11]   [LOGIN] [STATUS]        Logging in
AOChat: not expecting login.
Title: Re: AOChat: not expecting login.
Post by: Badger on June 29, 2006, 09:58:53 am
make sure you compiled gmp with the php.. I ran into the same problem on my Centos box. I needed to have the aokex as well..
   It turned out that even though alot of things claimed it was there it was not installed with php in the compile.
   --with-gmp'   as well as all of the other strings to compile it fully.
php -m  will tell you if the module is there. And making a phpinfo page to see what is loading as well wouldnt hurt.  can  see that is there that way as well.
Title: Re: AOChat: not expecting login.
Post by: Lucid on June 30, 2006, 03:16:53 am
Quote
make sure you compiled gmp with the php..
gmp is enabled in the compile, it's a gentoo box so I have control over the use flags for the compile.  I compiled aokex with the ssl extention this time round aswell.  Bcmath, mcrypt and sockets are also included in the php compile

I know the settings are fine in the conf's since the same setup runs and logs in on a windows box.
Title: Re: AOChat: not expecting login.
Post by: Khalem on June 30, 2006, 10:26:42 am
What usually happens is that aokex is simply not being loaded.

Try adding the following code at the top of main.php or AOChat.php after <?php
Code: [Select]
if (!extension_loaded("aokex"))
{
if (!dl("aokex.so"))
        {
               die("aokex failed to load");
        }
}

This way you can be sure that AOKex is actually being loaded and get a better look at the actual error.
Title: Re: AOChat: not expecting login.
Post by: Lucid on July 01, 2006, 03:54:47 am
I added the extension as a dynamic module to the php.ini file so it's being loaded just fine.  I added the check at the top of AOChat anyway but it still runs and gives the same error.  Since posting I've also checked the compiled options in the php version included for the windows version and recompiled php with a few more options added.  Since it works in windows the only differences I can think of are the extensions compiled into php or the environment used to create the aokex module.  So:

- BeBot version is 0.2.5
- aokex version is 0.1 (the only one available)
- aokex compiles fine, is intalled on the system and added to the cli php.ini
- the only issue I can see with the aokex compile is in the configure where there is a warning
Code: [Select]
checking for re2c... no
configure: warning: You will need re2c 0.9.11 or later if you want to regenerate PHP parsers.
- aokex has been compiled with both openssl and gmp to no avail
- PHP version is 5.1.4 the only module differences I can see are
Code: [Select]
calender
com_dotnet
iconv
odbc
SimpleXML
wddx
xmlreader
xmlwriter
- aokex is definitly being loaded and used; adding in an echo of the key just after
Code: [Select]
$key = aokex_login_key($this->serverseed, $username, $password);returns a key string in the output.

Not sure what else I can add in that would useful.
Title: Re: AOChat: not expecting login.
Post by: laen on July 01, 2006, 05:19:33 am
Why do we keep using that awfull aokex, if we can do without?

People keep having problems getting Bebot to run cause of Aokex, people have to recompile their PHP installation over and over..

Some time ago a fix to all this was posted, which made it possible for Bebot/AOChat to run without aokex.

I can't find that post anymore, seems removed or i was searching for the wrong thing, but the fix included an addition of some functions, and a change to some AOChat code.. and it works flawless! I'm using it on 4 active Bebot installations now.

Grab the working AOChat.php here: http://www.onedot.nl/AOChat.phps

And please.. please stop using Aokex, cause with Aokex, Bebot has just a limited future.
Title: Re: AOChat: not expecting login.
Post by: Lucid on July 01, 2006, 05:54:11 am
Instead of being lazy I turned a little proactive and added some debug statments on the in and out packets with tags around the data as such.
Code: [Select]
echo "In Packet:\n<".$data.">\n";This resulted in the following output.
Code: [Select]
[2006-07-01 03:06:44]   [LOGIN] [STATUS]        Connecting
In Packet:
< 35199d1cdb4a38d35250fd19883a6773>
[2006-07-01 03:06:45]   [LOGIN] [STATUS]        Authenticateing
Debug key:
<35199d1cdb4a38d35250fd19883a6773>
<#Acount#>
<#Password#>
Out Packet:
<
#String removed cause it's got encrypted info about my account (^_^)#>
In Packet:
<0Authentication failed: Illegal alias or password>
[2006-07-01 03:06:47]   [LOGIN] [RESULT]        Error
[2006-07-01 03:06:47]   [LOGIN] [STATUS]        Logging in
AOChat: not expecting login.
So if it's to be believe it is rejecting my alias or password though I know both are fine.  I ran the same debuging AOChat in windows and the output is pretty much similar only with funky characters in place of whitespace.
Code: [Select]
[2006-07-01 03:13:59]   [LOGIN] [STATUS]        Connecting
In Packet:
<  dd59447eca221ac62c2bbebfc5a08233>
[2006-07-01 03:14:00]   [LOGIN] [STATUS]        Authenticateing
Debug key:
<dd59447eca221ac62c2bbebfc5a08233>
<#Account#>
<#Password#>
Out Packet:
< ??ô
#ConnectionString#>
In Packet:
< ?f÷Xx #BotName# ?   ? ?    >
[2006-07-01 03:14:00]   [LOGIN] [STATUS]        Logging in
Out Packet:
< ? ?f÷Xx>
In Packet:
<>
[2006-07-01 03:14:01]   [LOGIN] [RESULT]        OK
I also have just tried the modified AOChat that Icidw posted and came up with the same error, that AOChat also works on the windows box.  The only other thing I can think of is the locales, my box is fully utf8 unicode based and php is also compiled with the unicode flag.
Title: Re: AOChat: not expecting login.
Post by: Lucid on July 01, 2006, 07:32:08 am
I recompiled php without the hardening patches and it worked fine.  This is a pitty since I'd prefer to have a hardenedphp running on the server.
Title: Re: AOChat: not expecting login.
Post by: laen on July 01, 2006, 03:25:01 pm
Damn, and i have hardware here planned to become a hardened webserver..

I guess we could use a complete rewrite of AOChat compliant to hardened php.
Title: Re: AOChat: not expecting login.
Post by: Mossi on August 22, 2006, 02:33:58 am
I have a similar problem with AOChat and aokex. I tried running it on an Ubuntu machine with following versions installed:

PHP 5.1.2 / Zend Engine v2.1.0
MySql 5.0.22

The following modules are installed:

- bcmath
- sockets
- gmp
- bz2
- mysql
... (and many more)

I activated the debug functionality in AOChat.php and found the following error message from server:

Code: [Select]
)'Authentification failed: Challenge failed
Now I have no idea where to continue with my search. The config files seems to be correct, because with the same files the Bot runs on a windows machine.

Can anyone help?
Title: Re: AOChat: not expecting login.
Post by: Khalem on August 22, 2006, 05:54:13 am
I'm going to add some debug statements to make it easier to distinguish which method is being used to generate the login hash. Check back later today.

The main problem right now is that the php methods are highly unreliable due to changes in PHP, and updates are badly needed to the hash generation code in the AOChat php library. However that requires good maths skills aswell as php knowledge, which puts it a bit out of my league :(
Title: Re: AOChat: not expecting login.
Post by: Mossi on August 22, 2006, 04:07:28 pm
I've already a debug message to see if the correct key generation is used and it uses the aokex_generate_key

So. This seems to be ok.

I've also tested if there could be a problem with my firewall, but there are no messages in the log file.

is it possible, that there are problems with the language environment? I'm not sure, but as I know, my system is configured using UTF-8. Perhaps this could cause a problem. I will check this when I'm at home (if I will find the commands to configure this  :-[)
Title: Re: AOChat: not expecting login.
Post by: Khalem on August 22, 2006, 05:15:02 pm
Hrm. I have no idea then :(
Title: Re: AOChat: not expecting login.
Post by: Malosar on August 22, 2006, 06:34:38 pm
I run Ubuntu and had a similar issue though with php4.4+. I couldn't get openssl to work but GMP worked eventually after following the instructions correctly.
Title: Re: AOChat: not expecting login.
Post by: Mossi on August 23, 2006, 08:45:08 pm
Yeahhh... I've fixed the problem

I got the tip, that on Ubuntu sometimes the libraries libgmp3c2 and libgmpxx3 are installed with unresolved dependencies. But these packages are needed for aokex to work correctly.

I've removed the packages and compiled them by myself (downloaded on http://www.swox.com/gmp/#DOWNLOAD). It's recommened to use the 'make check' command as described in the install instructions.
After installing the new library, I compiled again the aokex module against these library and now it works

Afterwards I saw, that it's possible to switch the compilation of aokex to openssl (I should learn to read the manuals more exactly). Perhaps this would also be a possible way to solve the problem.
Title: Re: AOChat: not expecting login.
Post by: kuznechik on September 25, 2006, 09:54:04 am
Hi all, I've tested it once more.
FreeBSD 6.1
php5 5.1.6
bebot 2.8 and 3.3
with and w/o Aokex, with modified AOChat that was posted here.

Still: AOChat: not expecting login.

Did I did something wrong? Or I'm missing something? WTB fix, my php 4.3.7 computer will be shutted down soon, need to transfer my bots to other computer with up-to-date php.
Title: Re: AOChat: not expecting login.
Post by: Malosar on September 25, 2006, 02:07:36 pm
A modified aochat.php never fixed the problem for me. You should use the aokex fix.
Title: Re: AOChat: not expecting login.
Post by: Khalem on September 25, 2006, 06:47:51 pm
Unfortunately it appears that even aokex generates wrong keys on some systems according some tests i have done.
Auno however is no longer active in AO and currently we have no other alternatives :(
Title: Re: AOChat: not expecting login.
Post by: paal on October 17, 2006, 04:41:36 am
tried both openssl and GMP in Ubuntu no luck :§
box runs dual xenon cpu.
Title: Re: AOChat: not expecting login.
Post by: Hurtig on November 27, 2006, 09:44:51 pm
Hi,

I have been trying to get BeBot to work on Ubuntu 6.10 (Edgy) to with the aokex solution.

So far I have compiled and installed aokex and AOChat now loads it.

However I'm getting an error when I try to run start.php.

Code: [Select]

...

[2006-11-27 20:09:37]   [LOGIN] [STATUS]        Connecting
/usr/bin/php5-cgi: symbol lookup error: /usr/lib/php5/ext/aokex.so:undefined symbol: __gmp_set_memory_functions
[2006-11-27 20:09:37]   [LOGIN] [STATUS]        Authenticating
Using AOKex for login key generation
X-Powered-By: PHP/5.1.2
Content-type: text/html

The script just restarts after this  ???
Title: Re: AOChat: not expecting login.
Post by: Khalem on November 27, 2006, 10:38:52 pm
Hurtig, this is indicating that you are missing parts of the GMP library, possibly the actual library itself.
You could also try the OpenSSL method instead of GMP.

Title: Re: AOChat: not expecting login.
Post by: Hurtig on November 28, 2006, 02:50:16 am
Ok, I got both the GMP and the OpenSSL solution to compile and run.

When I print the generated key from AOChat it looks ok, but now I get the not-expected-login error again when AOChat tried to connect:

Code: [Select]
[2006-11-28 00:02:07]   [LOGIN] [STATUS]        Connecting
[2006-11-28 00:02:08]   [LOGIN] [STATUS]        Authenticating
Using AOKex for login key generation
Generated key: 5692F15408C2B4E90CB5857606266BFA22B4579yaddayadda
2006-11-28 00:02:08]   [LOGIN] [RESULT]        Error
[2006-11-28 00:02:08]   [LOGIN] [STATUS]        Logging in
AOChat: not expecting login.

The GMP and OpenSSL keys differ when I generate them. Are the supposed to be the same?

Title: Re: AOChat: not expecting login.
Post by: Keepbrave on January 25, 2007, 04:56:19 pm
Can someone explain all this to me in lamens terms?

This is my first time using linux and i juts bought a VPS serve rot run all this on plus some websites..

It runs centos-4
I got the bot installed but get this AOChat error, i downloaded the aokex and its sitting on my pc.

Someone please explain in lamens terms what to do next?
do i upload it and ssh in and run some commands or what?

Thanks for helping me out i am not used ot linux at all so be gentle with me :)
Title: Re: AOChat: not expecting login.
Post by: Barvaz on February 16, 2007, 04:01:26 am
Quote from: Linux HOWTO
cd ~

wget http://auno.org/dev/aochat/php-aokex-0.1.tar.gz
tar zxf php-aokex-0.1.tar.gz
cd php-aokex
phpize
./configure
make
cp -p modules/aokex.so ..

check with php -m that you got all the needed modules installed.

ADD dl("aokex.so"); in the start of aochat.php


start the bot in the background:
screen -A -m -d -S redbot php start.php

view the bot console:
screen -r redbot

get bot back to background:
ctrl+a d
Title: Re: AOChat: not expecting login.
Post by: pusikas on February 16, 2007, 08:37:14 am
No more need for aokex with the 2.11 bot.
Title: Re: AOChat: not expecting login.
Post by: Galdethi on December 02, 2007, 09:35:34 pm
I've been trying to get my bot running on an ubuntu server, i've gone through all the fixes posted in this thread and I still get the not expecting login crap, any way to save my bot? I no longer have a windows based server to host it off.

Im running the latest php mysql and bot.
Title: Re: AOChat: not expecting login.
Post by: Blueeagle on December 03, 2007, 08:35:49 am
I am running the latest bot off Ubuntu 6.10 with no problem.

Please note that it should in theory run as long as you've installed php and mysql. However be sure that you install php5-cli as the command line interface is not installed with the php5 meta-package nor with libapache-mod-php5.

Are you sure you've set up the configuration correctly in the conf directory?
Title: Re: AOChat: not expecting login.
Post by: Galdethi on December 03, 2007, 01:32:07 pm
Sadly positive, I guess ill rerun all the php mysql installs again see if anything changes :-\
Title: Re: AOChat: not expecting login.
Post by: Galdethi on December 06, 2007, 12:14:36 pm
Ok ive reinstalled everything several times and I still get the unexpected login error, anyone got any clue what I can try next?

[edit]Tried going through all this again, reinstalled the lot and when I add the aokex bit I now get this error

 [LOGIN] [STATUS]        Connecting
/usr/bin/php: symbol lookup error: ./php_extension/aokex.so: undefined symbol: __gmp_set_memory_functions


I've reinstalled the gmp recompiled and messed about with it till im blue in the face :-\
Title: Re: AOChat: not expecting login.
Post by: Alreadythere on December 06, 2007, 02:03:33 pm
Which version of bebot are you trying to run?

The newest version 0.4.3 should run without any need for aokex under linux. It just needs bcmath now, which is included in all php versions of the last years per default.
Title: Re: AOChat: not expecting login.
Post by: Galdethi on December 06, 2007, 03:54:01 pm
The latest version, thats why im so damn puzzled :-\

Server is:

Dual core 3800+
4gb ram
Ubuntu 6.10
latest php
latest mysql
Title: Re: AOChat: not expecting login.
Post by: Galdethi on December 06, 2007, 04:31:52 pm
Ok after leaving the damn bot running for ten mins saying the same not expecting login error, it connected, id love to know what the hell is going on though.
Title: Re: AOChat: not expecting login.
Post by: Metaphblade on January 27, 2008, 01:56:18 am
i have tried everything i can think of.

Im trying to run my bot on a fresh install of slackware 12.0

i get the following message when trying to start it though.

AOChat class needs PHP version >= 5.2.0 to work.


any ideas?
Title: Re: AOChat: not expecting login.
Post by: Alreadythere on January 27, 2008, 11:56:36 am
Update to php 5.2 or change the version string in AOChat.php.
Title: Re: AOChat: not expecting login.
Post by: Metaphblade on January 27, 2008, 08:56:25 pm
thats whats weird about all of this.....im using 5.2.3
Title: Re: AOChat: not expecting login.
Post by: Alreadythere on January 28, 2008, 12:07:37 am
Do you have different php versions on your system and the bot is using a wrong one?

Worst case look for the line "AOChat class needs PHP version" in Sources/AOChat.php and simply comment the if ((float)phpversion() < 5.2) line out as well as the block inside {} directly afterwards.

If you got the right version there won't be any trouble - and right now the bot will run on any php version of the last few years.
Title: Re: AOChat: not expecting login.
Post by: pusikas on January 28, 2008, 02:12:06 am
Back to AO after being away for a while...
Downloaded BeBot 4.3, but can't get it to start on my linux box.

Code: [Select]
`--> php -v
#PHP 5.2.5-pl1-gentoo (cli) (built: Dec 18 2007 01:49:06)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

Code: [Select]
`--> php -m
[PHP Modules]
aokex
bcmath
bz2
calendar
ctype
date
dba
dom
filter
ftp
gd
gettext
gmp
hash
iconv
imap
libxml
mbstring
mcrypt
mysql
mysqli
ncurses
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
posix
readline
Reflection
session
SimpleXML
sockets
SPL
SQLite
standard
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
zlib

[Zend Modules]


Code: [Select]
`--> php -c ./ StartBot.php

===================================================

    _/_/_/              _/_/_/                _/

   _/    _/    _/_/    _/    _/    _/_/    _/_/_/_/

  _/_/_/    _/_/_/_/  _/_/_/    _/    _/    _/

 _/    _/  _/        _/    _/  _/    _/    _/

_/_/_/      _/_/_/  _/_/_/      _/_/        _/_/

         An Anarchy Online Chat Automaton

             v.0.4.3 - PHP 5.2.5-pl1-gentoo

===================================================

Connected to MySQL

...
<snip lots of successful module loads>
...
Vbot [2008-01-28 00:01:41]      [MOD]   [LOAD]  Target.php
Vbot [2008-01-28 00:01:41]      [LOGIN] [STATUS]        Connecting
Vbot [2008-01-28 00:01:41]      [LOGIN] [STATUS]        Authenticating
Vbot [2008-01-28 00:01:42]      [LOGIN] [RESULT]        Error
Vbot [2008-01-28 00:01:42]      [LOGIN] [STATUS]        Logging in
AOChat: not expecting login.

Sorry, anything obvious that I did wrong? Am I missing any modules? Or should I remove aokex? I thought it wouldnt interfere.
Title: Re: AOChat: not expecting login.
Post by: pusikas on January 28, 2008, 02:20:38 am
Additional info: old bot is still running. That was a 2.11 BeBot, I think, but I never got that one to work without aokex, so I am not sure if it uses the original 2.11 AOChat.php. Probably not. If I copy the aochat that is working in the old bot over to the new ones, it still wont log in. Says it is trying to log in via GMP and fails.
Title: Re: AOChat: not expecting login.
Post by: Alreadythere on January 28, 2008, 12:31:31 pm
Do you have a php version without aokex and gmp? Perhaps that is causing your troubles? I'm just making guesses here though, I don't know what your problem really is.
Title: Re: AOChat: not expecting login.
Post by: pusikas on January 28, 2008, 04:38:27 pm
Gentoo linux, so, yeh, removing those is no prob. Will give it a try this evening. Sorry for not having thought of trying something this obvious first. ^ ^

Edit: Does it matter for the bot, which AOChat.php I use? I mean, if I manage to get the bot to log in with an old version, is that inviting trouble, or doesn't it matter?
Title: Re: AOChat: not expecting login.
Post by: Alreadythere on January 28, 2008, 04:51:31 pm
You may run into trouble with the extended messages, like tower spam, org joins/leaves, and similar stuff. Otherwise all should be in there.
Title: Re: AOChat: not expecting login.
Post by: Sary on January 29, 2008, 12:09:07 am
I just downloaded BeBot 0.4.3 as well, and I'm getting the exact same problems that Pusikas is having.
I triple-checked the config, that all seems correct. I also don't have any aokex leftovers. Having gmp or not doesn't make a difference either. (I think it only uses bcmath anyway)

php -v
PHP 5.2.5-pl1-gentoo (cli) (built: Jan 28 2008 21:09:55)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

php -m
[PHP Modules]
bcmath
bz2
ctype
curl
date
dba
dom
ftp
gettext
gmp
hash
libxml
mbstring
mcrypt
mysql
ncurses
openssl
pcre
readline
session
sockets
standard
xml
zlib

[Zend Modules]


Running Gentoo Linux as well. (Hardened, but this shouldn't matter for PHP.)
Title: Re: AOChat: not expecting login.
Post by: lazarus on March 27, 2008, 11:59:58 pm
dammit... I had to reinstall my box, and now this is giving me a hard time :/

Could a friendly soul help us out?

server:/home/bebot# php5 -v
PHP 5.2.0-8+etch10 (cli) (built: Jan 18 2008 18:52:58)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies

server:/home/bebot# php5 -m
[PHP Modules]
bcmath
bz2
calendar
ctype
date
dba
dom
exif
filter
ftp
gettext
hash
iconv
json
libxml
mbstring
mime_magic
mysql
mysqli
ncurses
openssl
pcntl
pcre
PDO
pdo_mysql
posix
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
zip

I did also try with the php 4.4.x but that gave the same result :/
Title: Re: AOChat: not expecting login.
Post by: Blueeagle on March 28, 2008, 01:53:07 am
We'll need the entire output from the console to be able to debug this me thinks.

I have not seen that error in a long while and I cannot fathom why it should just appear now.
Title: Re: AOChat: not expecting login.
Post by: lazarus on March 28, 2008, 02:19:07 pm
ok I just did a test installation on my xp. with the new released 0.4.3 and the bebot php bundle 5.2.3
it give the same error.

===================================================

    _/_/_/              _/_/_/                _/   
     
   _/    _/    _/_/    _/    _/    _/_/    _/_/_/_/

  _/_/_/    _/_/_/_/  _/_/_/    _/    _/    _/     

 _/    _/  _/        _/    _/  _/    _/    _/     

_/_/_/      _/_/_/  _/_/_/      _/_/        _/_/   

         An Anarchy Online Chat Automaton         

             v.0.4.3 - PHP 5.2.3     

===================================================

Connected to MySQL

bot [2008-03-28 12:10:07]   [CORE]   [LOAD]   Security.php
bot [2008-03-28 12:10:07]   [SETTINGS]   [LOAD]   Loaded settings from database.
bot [2008-03-28 12:10:07]   [CORE]   [LOAD]   Settings.php
bot [2008-03-28 12:10:07]   [CORE]   [LOAD]   AccessControl.php
bot [2008-03-28 12:10:07]   [CORE]   [LOAD]   Alts.php
bot [2008-03-28 12:10:07]   [CORE]   [LOAD]   BotHelp.php
bot [2008-03-28 12:10:07]   [CORE]   [LOAD]   Colors.php
bot [2008-03-28 12:10:07]   [CORE]   [LOAD]   FlexibleSecurity.php
bot [2008-03-28 12:10:07]   [CORE]   [LOAD]   FunFilters.php
bot [2008-03-28 12:10:07]   [CORE]   [LOAD]   Logon_Notifies.php
bot [2008-03-28 12:10:07]   [CORE]   [LOAD]   Notify.php
bot [2008-03-28 12:10:07]   [CORE]   [LOAD]   OnlineDB.php
bot [2008-03-28 12:10:07]   [CORE]   [LOAD]   PlayerNotes.php
bot [2008-03-28 12:10:07]   [CORE]   [LOAD]   Professions.php
bot [2008-03-28 12:10:07]   [CORE]   [LOAD]   Queue.php
bot [2008-03-28 12:10:07]   [SETTINGS]   [SAVED]   schemaversion for module members set to 3 as datatype int
bot [2008-03-28 12:10:07]   [CORE]   [LOAD]   Roster.php
bot [2008-03-28 12:10:07]   [CORE]   [LOAD]   ShortCuts.php
bot [2008-03-28 12:10:07]   [CORE]   [LOAD]   StringFilter.php
bot [2008-03-28 12:10:07]   [CORE]   [LOAD]   Time.php
bot [2008-03-28 12:10:07]   [SETTINGS]   [SAVED]   schemaversion for module timer set to 3 as datatype int
bot [2008-03-28 12:10:07]   [CORE]   [LOAD]   Timer_Core.php
bot [2008-03-28 12:10:07]   [CORE]   [LOAD]   User.php
bot [2008-03-28 12:10:07]   [CORE]   [LOAD]   Whois.php
bot [2008-03-28 12:10:07]   [MOD]   [LOAD]   About.php
bot [2008-03-28 12:10:07]   [MOD]   [LOAD]   AccessControlGUI.php
bot [2008-03-28 12:10:07]   [MOD]   [LOAD]   AFK.php
bot [2008-03-28 12:10:07]   [MOD]   [LOAD]   Alts.php
bot [2008-03-28 12:10:07]   [MOD]   [LOAD]   AutoInv.php
bot [2008-03-28 12:10:07]   [MOD]   [LOAD]   BanManager.php
bot [2008-03-28 12:10:07]   [MOD]   [LOAD]   Bid.php
bot [2008-03-28 12:10:07]   [MOD]   [LOAD]   Blacklist.php
bot [2008-03-28 12:10:07]   [MOD]   [LOAD]   Calc.php
bot [2008-03-28 12:10:07]   [MOD]   [LOAD]   Callers.php
bot [2008-03-28 12:10:07]   [MOD]   [LOAD]   ColorConfig.php
bot [2008-03-28 12:10:07]   [MOD]   [LOAD]   Countdown.php
bot [2008-03-28 12:10:07]   [MOD]   [LOAD]   FlexibleSecurityGUI.php
bot [2008-03-28 12:10:07]   [MOD]   [LOAD]   Glyph_RAID.php
bot [2008-03-28 12:10:07]   [MOD]   [LOAD]   History.php
bot [2008-03-28 12:10:07]   [MOD]   [LOAD]   Identify.php
bot [2008-03-28 12:10:07]   [SETTINGS]   [SAVED]   connected for module irc set to FALSE as datatype bool
bot [2008-03-28 12:10:07]   [SETTINGS]   [UPDATE]   Set longdesc for setting [Irc][AnnounceWhat] to which events should be announced to irc? none, only  buddies logging on, only joins to the chatgroup or both?
bot [2008-03-28 12:10:07]   [SETTINGS]   [UPDATE]   Set defaultoptions for setting [Irc][AnnounceWhat] to none;buddies;joins;both
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   IRC.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   Is.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   Items.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   LandControlZones.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   LeadEcho_RAID.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   Level.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   MassMsg.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   News.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   Notify.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   Oe.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   OnlineCount.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   OnlineDisplay.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   PB.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   PlayerNotesUI.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   Points.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   PrivGroup.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   Raffle.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   Raid.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   Rally.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   Roll.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   Roster.php

bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   Say.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   Server.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   SettingsInterface.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   ShortCutsGUI.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   Shutdown.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   StringFilterInterface.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   Target.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   Teams.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   Tier2.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   TimerGUI.php
 
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   Tokens.php
bot [2008-03-28 12:10:08]   [SETTINGS]   [SAVED]   SchemaVersion for module TowerAttack set to 2 as datatype int
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   TowerAttack.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   Whois.php
bot [2008-03-28 12:10:08]   [MOD]   [LOAD]   loot.php
bot [2008-03-28 12:10:08]   [LOGIN]   [STATUS]   Connecting
bot [2008-03-28 12:10:08]   [LOGIN]   [STATUS]   Authenticating
bot [2008-03-28 12:10:10]   [LOGIN]   [RESULT]   Error
bot [2008-03-28 12:10:10]   [LOGIN]   [STATUS]   Logging in
AOChat: not expecting login.

if I can somehow get ur more info. please guide me :D
Title: Re: AOChat: not expecting login.
Post by: Blueeagle on March 28, 2008, 04:24:48 pm
bot [2008-03-28 12:10:08]   [LOGIN]   [STATUS]   Authenticating
bot [2008-03-28 12:10:10]   [LOGIN]   [RESULT]   Error

Seems to me you've mis-typed the username and/or password. The AO-server returns an error when you attemtp to authenticate.

In my opinion the bot should have thrown a fatal error on authentication failure.
Title: Re: AOChat: not expecting login.
Post by: Dracutza on March 28, 2008, 04:31:12 pm
bot [2008-03-28 12:10:08]   [LOGIN]   [STATUS]   Authenticating
bot [2008-03-28 12:10:10]   [LOGIN]   [RESULT]   Error

Seems to me you've mis-typed the username and/or password. The AO-server returns an error when you attemtp to authenticate.

In my opinion the bot should have thrown a fatal error on authentication failure.


I had this too yesterday.  I was trying to run 5 bots from the same dir.  I did diff config files for each bot.

#1 ran fine
#2 got a login error
#3 ran fine
#4 ran fine
#5 got a login error

Since it was the same dir, I assumed something was wrong in a config file.  Sure enough I had misspelled the bot name.  Made changes and tried to start the error'd bots again.

Still got login error.

deleted the config files and tables from DB

sent new config files and ran the bots... essentially "starting fresh"

something is cached somewhere, as those last two still gave me login errors.

Outside of a reboot (taking down all bots,) what can one do to recover from a failed login?
Title: Re: AOChat: not expecting login.
Post by: Blueeagle on March 29, 2008, 01:27:39 am
Have you tried logging in those players with the regular anarchy client?

FunCom have wiped characters before and that might have happened again, but such whipes are usually announced. Other than that I cannot see how you're getting an invalid login.

If you're logging in many bots simultaneously you might hit a flood barrier perhaps?

You could try annonymizing the configuration files and post them here and we can see if we can make sense of them.
Title: Re: AOChat: not expecting login.
Post by: Alreadythere on March 29, 2008, 02:06:34 am
The only time I ran into the Not expecting login error was when I had a wrong password. Maybe it's some different reason.

Try adding some debug output to Main.php after reading the config file, perhaps php gets some wrong values?

If you're logging in many bots simultaneously you might hit a flood barrier perhaps?
The limit is somewhere around 20 for RK2, doubt many reach it.
Title: Re: AOChat: not expecting login.
Post by: Alreadythere on March 29, 2008, 02:31:55 am
something is cached somewhere, as those last two still gave me login errors.

Outside of a reboot (taking down all bots,) what can one do to recover from a failed login?
There shouldn't be any cache outside of the php instance. And even in there all logon data besides the actual character name is whiped after the AOChat class is logging in.

Check for php instances using the misbehaving bots as command line argument, if some still exist just kill them. Though this problem can only really happen if you use some method to put the output of the bots into background.
Title: Re: AOChat: not expecting login.
Post by: lazarus on March 29, 2008, 05:35:44 pm
hehe my issue was a wrong username ^^
Title: Re: AOChat: not expecting login.
Post by: Blueeagle on March 29, 2008, 11:16:22 pm
hehe my issue was a wrong username ^^
Told you. :p
SimplePortal 2.3.7 © 2008-2024, SimplePortal