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: 32bit character int fix for aochat.  (Read 15187 times)

0 Members and 3 Guests are viewing this topic.

Offline Dabaron

  • BeBot Apprentice
  • ***
  • Posts: 163
  • Karma: +0/-0
Re: 32bit character int fix for aochat.
« Reply #30 on: November 25, 2006, 07:18:14 pm »
I'm using the AOChat.php that you have on AODevs and changed the id column in the members table to varchar(11) "Out of range value adjusted for column 'level' at row 1" and I'm not sure why.  The table has level listed that it can be null and the insert into statement is trying to leave it a null value but it errors.  Any ideas?

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: 32bit character int fix for aochat.
« Reply #31 on: November 25, 2006, 09:03:03 pm »
Gridfan has published another approach to fixing the 2^31 problem, and basically evolves around the fact that as long as we are inside the bot, it doesn't matter if the id overflows into the negative. It also does not matter if the negative id is saved in MySQL as once it's read again it's treated the same way as before it was saved by the bot.

This way we only have to worry about converting the id to a string whenever we want to do anything externally with the id, ie xml lookups.

There is one issue with this however.
Anyone having used the convert to string fixes put forth so far will have new characters saved with an ID which will be incompatible with the new fix and will need to have the column converted back to int, and then either delete entries for the high id's or convert them.

See http://aodevs.com/index.php/topic,66.0.html
BeBot Founder and Fixer Kingpin

Offline porter

  • BeBot User
  • **
  • Posts: 28
  • Karma: +0/-0
Re: 32bit character int fix for aochat.
« Reply #32 on: November 25, 2006, 10:17:09 pm »
My GMP version of Nesi's BCmath fix is here: http://firstlight.inevitablethursday.net/code/AOChat.tar.gz

NOTE: it absolutely requires GMP. Bcmath is not included as an alternative.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: 32bit character int fix for aochat.
« Reply #33 on: November 25, 2006, 10:36:41 pm »
Official BeBot fixes:

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

I'm going with Gridfan's fix as it will be easier for end users, and only requires a little more care from Developers.
BeBot Founder and Fixer Kingpin

Offline Nova

  • BeBot Rookie
  • *
  • Posts: 9
  • Karma: +0/-0
Re: 32bit character int fix for aochat.
« Reply #34 on: November 26, 2006, 07:47:08 pm »
Imagine I know NOTHING about .php...
How would I add this fix to my Bot?

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: 32bit character int fix for aochat.
« Reply #35 on: November 26, 2006, 08:44:24 pm »
Download the appropriate file for your version, i.e. if your running BeBot 0.2.x, download the 0.2 version, if your running a development version, download the 0.3 version. Simply replace the existing AOChat.php with the one you downloaded and restart the bot.
BeBot Founder and Fixer Kingpin

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: 32bit character int fix for aochat.
« Reply #36 on: November 26, 2006, 09:36:20 pm »
Khalem,

Does the towerattack module need to be modified at all btw?  I know 1.19 has different output to the older Bebot one.

-jj-

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: 32bit character int fix for aochat.
« Reply #37 on: November 26, 2006, 10:01:29 pm »
Depends on which of the several modules floating around you use.

The current development version has been using the "new" format for some time now, but i cannot remember offhand when it was actually added.
The simplest thing to do to find out is to check the regexp in your tower attack module against that in SVN trunk.

On a side note, this is exactly why im annoyed at Auno for choosing to hard code the strings in AOChat.php, and even more annoyed that he choose to alter the strings from the default.

When the command hooking and parsing changes are added sometime after 0.4 release i will be changing the way modules register commands and how data is passed to the modules so that they may choose to use only the arguments passed and not rely on the text at all.
In addition i will when i find time rip the hard coded strings out and use the stock AO Client's mdb database for lookups or a trimmed down version of it that contains only messages that the bot could possibly see.
BeBot Founder and Fixer Kingpin

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: 32bit character int fix for aochat.
« Reply #38 on: November 27, 2006, 10:20:35 am »
Sounds good, thank you =)

-jj-

Offline Nesi

  • BeBot User
  • **
  • Posts: 55
  • Karma: +0/-0
Re: 32bit character int fix for aochat.
« Reply #39 on: November 30, 2006, 12:46:18 am »
Ahh, glad im off the hock. Been really busy lately.

Odd tho, when thinking of a solution for this problem i though about doing this, but php complained about the array keys being negative.
Musta done something wrong heh.

 

* 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: 102
  • 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