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?
October 14, 2008, 10:30:54 AM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Information > News > Topic: Official character lookup fix
Pages: [1]   Go Down
« previous next »
Print
Author Topic: Official character lookup fix  (Read 1096 times)
0 Members and 1 Guest are viewing this topic.
Khalem
BeBot Founder
Administrator
Grandmaster
********
Offline Offline

Gender: Male
Posts: 670



WWW
Official character lookup fix
« on: November 28, 2006, 04: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:
<?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;
}
?>

Logged

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

Posts: 259


WWW
Re: Official character lookup fix
« Reply #1 on: November 30, 2006, 09:37:41 AM »

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?
Logged

Eternalist
General of The Syndicate
Khalem
BeBot Founder
Administrator
Grandmaster
********
Offline Offline

Gender: Male
Posts: 670



WWW
Re: Official character lookup fix
« Reply #2 on: November 30, 2006, 03: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.
Logged

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

Posts: 259


WWW
Re: Official character lookup fix
« Reply #3 on: November 30, 2006, 03: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.
Logged

Eternalist
General of The Syndicate
Khalem
BeBot Founder
Administrator
Grandmaster
********
Offline Offline

Gender: Male
Posts: 670



WWW
Re: Official character lookup fix
« Reply #4 on: November 30, 2006, 04:17:08 PM »

Fixed this for 0.2.11 where the check is carried out in Main.php.
Logged

BeBot Founder and Fixer Kingpin
Madman coder and destroyer of good code
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Information > News > Topic: Official character lookup fix
« previous next »
 
Jump to:  

Recent
Buddylist for guildbot
by Zacix
[Today at 09:43:40 AM]

Link 2 Guilds via 2 Bots?
by Temar
[Today at 08:42:11 AM]

OnlineOrg
by Karsta
[October 13, 2008, 06:54:20 AM]

!security Levels
by Nytridr
[October 12, 2008, 11:36:45 PM]

Bossloot for 5.2
by Brac
[October 12, 2008, 04:45:17 PM]

Ported Modules
by Jiheld
[October 12, 2008, 09:00:13 AM]

raid/point system suggest...
by Temar
[October 11, 2008, 11:45:40 PM]

!timers suggestions: alts...
by Alreadythere
[October 11, 2008, 03:19:46 PM]

!server does not work
by Alreadythere
[October 11, 2008, 06:54:38 AM]

TWC
by clashbot
[October 10, 2008, 08:52:57 AM]
Stats
Members
Total Members: 989
Latest: Syphae
Stats
Total Posts: 10814
Total Topics: 1459
Online Today: 14
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 1
Guests: 14
Total: 15
Zacix

Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.358 seconds with 29 queries. (Pretty URLs adds 0.027s, 4q)
Loading...