BeBot - An Anarchy Online and Age Of Conan chat automaton

General => News => Topic started by: Khalem on November 28, 2006, 10:14:00 pm

Title: Official character lookup fix
Post by: Khalem on November 28, 2006, 10:14:00 pm
An official fix for the character lookup problem is now ready and BeBot 0.2.10 will be released in one of the coming days.

In the meantime you can grab the fix from the links below.
It is a drop in replacement, which means you only need to replace the old AOChat.php file in your bot directory (or Sources directory for newer 0.3 snapshots)

0.2.x: http://svn.shadow-realm.org/svn/BeBot/branches/0.2/AOChat.php
0.3.x: http://svn.shadow-realm.org/svn/BeBot/trunk/Sources/AOChat.php

Note, if you have applied an earlier fix offered by the community, it is advised to change your character id column back to INT (11).
Any characters added under other fixes should be deleted from the database table, in short, delete any entry with a character id larger than 2147483647
New characters with ID's higher than 2147483647 will be stored in the database with negative id's. While this might be confusing, it makes perfect sense to the bot.

If you use any custom modules or web interfaces etc and need to be able to search on the "true" character ID, you can use the following two functions to convert to and from the "true" id's and the overflowed id's stored in the database.
These will also be included in the upcoming 0.2.10 release.
Code: [Select]
<?php
/*
Used to convert an overflowed (unsigned) integer to a string with the correct positive unsigned integer value
If the passed integer is not negative, the integer is merely passed back in string form with no modifications.
*/
    
function int_to_string($int)
{
       if (
$int <= -1)
   {
           
$int += (float)"4294967296";
   }
       return (string)
$int;
}

/*
Used to convert an unsigned interger in string form to an overflowed (negative) integere
If the passed string is not an integer large enough to overflow, the string is merely passed back in integer form with no modifications. 
*/
function string_to_int($string)
{
       
$int = (float)$string;
       if (
$int > (float)2147483647)
   {
           
$int -= (float)"4294967296";
   }
       return (int)
$int;
}
?>

Title: Re: Official character lookup fix
Post by: Malosar on November 30, 2006, 03:37:41 pm
That new AOChat.php breaks my "not expecting logon" fix as it tries to use bcmath. I changed the get_uid function to your new one, is that the only change neccessary?
Title: Re: Official character lookup fix
Post by: Khalem on November 30, 2006, 09:13:37 pm
It's the only change necessary.

I would like to know the details of your fix however as it might help others and possibly also implemented in the official library.
In any case i have plans to add a toggle for authentication method in the config at one point so people can explicitly configure which authentication method to use first.
Title: Re: Official character lookup fix
Post by: Malosar on November 30, 2006, 09:57:02 pm
My fix was just the standard aokex with GMP (openssl didn't work for me) and a modified AOChat.php. With your AOChat.php it dies on login, with mine it works. I did a diff of the files and it turns out the only part that was breaking it was:

dl("aokex.so");

So it's just that it wasn't loading aokex and thus was falling back to bcmath.
Title: Re: Official character lookup fix
Post by: Khalem on November 30, 2006, 10:17:08 pm
Fixed this for 0.2.11 where the check is carried out in Main.php.
SimplePortal 2.3.7 © 2008-2024, SimplePortal