collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Official character lookup fix  (Read 7628 times)

0 Members and 4 Guests are viewing this topic.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Official character lookup fix
« 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;
}
?>

BeBot Founder and Fixer Kingpin

Offline Malosar

  • BeBot Expert
  • ****
  • Posts: 259
  • Karma: +0/-0
    • http://www.lowerdimension.com
Re: Official character lookup fix
« Reply #1 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?
Eternalist
General of The Syndicate

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Official character lookup fix
« Reply #2 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.
BeBot Founder and Fixer Kingpin

Offline Malosar

  • BeBot Expert
  • ****
  • Posts: 259
  • Karma: +0/-0
    • http://www.lowerdimension.com
Re: Official character lookup fix
« Reply #3 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.
Eternalist
General of The Syndicate

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: Official character lookup fix
« Reply #4 on: November 30, 2006, 10:17:08 pm »
Fixed this for 0.2.11 where the check is carried out in Main.php.
BeBot Founder and Fixer Kingpin

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 232
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal