BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => BeBot 0.2 support => Topic started by: buff on March 28, 2006, 09:52:46 am

Title: An existing connection was forcily closed by the remote host.
Post by: buff on March 28, 2006, 09:52:46 am
Anyone ever had this error msg?
My bot was running just fine till last night after i modified some codes in memberlist.php
then bot will not run command in guild chat
when i send pm to bot, it will reply but my toon won't receive it
though if u look at bot log it will show bot did reply w/ result etc
then i will receive this error about connection thing..

really need some help here tysm :)
Title: Re: An existing connection was forcily closed by the remote host.
Post by: Xenixa on March 28, 2006, 01:05:43 pm
Process of elimination. If the last thing you modified was a module, rename the module by placing a underscore infront of its name so it don't get loaded. Do this with one module at a time and restart.

If the problem goes away on one of those renamed you know which module is the cause of the AOchat server closing the bots connection.

Tip however: Increase the time (in milliseconds) between tells that the bot is allowed. I.E. in Bot.conf increase $tell_delay =

Mines set to 2300 btw. Also check $max_blobsize. I forget what the stock setting is but I moved mine up to 14000 with no problems for the last 6 months. Reason I note that is if a blob is small and you have a module returning alot of info to be output the server may see it as spam with a low tell delay. Increasing both delay and blob size will keep the chat server from freaking out and booting the bot.
Title: Re: An existing connection was forcily closed by the remote host.
Post by: Naturalistic on March 28, 2006, 06:36:34 pm
It could also mean that you had another instance of the bot running, hence the existing connections.

I would believe that you were trying to open a new connection, while you had one already open. Try closing off all the bots, then start it up, and see if that fixes it.

If you need further help, please post the code you added/changed, then we would have a better idea as to what might be wrong.
Title: Re: An existing connection was forcily closed by the remote host.
Post by: buff on March 28, 2006, 11:16:58 pm
well I tried to restart my pc where the bot is running and still not fixed so i don't think there is another bot running at same time but who knows.  ???

also, I tried to empty mysql server database and restore it then reboot my pc. it seems to fix my problem if i do that and i tried three times and worked 3 times so i have no idea what is wrong.

i will try replace the _ in front of each module 1 at a time and change the setting in conf folder hopefully it will help.

i will report w/ the result in couple days and let you guys know what is wrong w/ it  :-X

note: I also noticed that now if i change any code in any module, it will break my bot and i will have to empty mysql db then restore and reboot my pc to make it work.  :-\ (even after i change the codes back to what it was b4 i changed in module, bot will still not working)
Title: Re: An existing connection was forcily closed by the remote host.
Post by: buff on March 29, 2006, 04:58:21 am
changed stuff as Xenixa recommend but still not working
upgrade from php4 to php5 w/ latest version and played w/ mysql server abit but nothing works

abit frustrated here :/

got screenie here if u guys can help
-----------------------------------------------------

Title: Re: An existing connection was forcily closed by the remote host.
Post by: Naturalistic on March 29, 2006, 06:06:51 am
If you're sending that to tells:

$this -> bot -> send_tell($who_you_are_sending_to, $msg);

And for org chat,

$this -> bot -> send_gc($msg);

I have a feeling you're missing a key argument in the commands :) That is, if you didn't do anything to the code in bot.php.
Title: Re: An existing connection was forcily closed by the remote host.
Post by: buff on March 29, 2006, 09:12:12 pm
 ???
a lil bit confused what you mean by missing argument in commands.
where should i check for the tells and org chats??
in each module?
Title: Re: An existing connection was forcily closed by the remote host.
Post by: Naturalistic on March 30, 2006, 01:21:01 am
Can you post the bit of code you added/changed?

could tell you exactly where something might have gone wrong :)
Title: Re: An existing connection was forcily closed by the remote host.
Post by: buff on March 30, 2006, 06:04:36 am
didn't modify any codes after the bot had problem.
I changed the codes i modified in memberlist.php back to original codes after bot wouldn't respond.

I did notice another thing thou
my bot won't work everytime i restart bot and if i go to mysql db and delete someone from members table and boot my bot, it will update and add the member that got deleted
then i have to restart bot again, bot will then work
tried it many times and works

I hope this will ring some bell for any of u to help me out what is wrong w/ bot

Code: [Select]
<?
  /*
   * Something written by wolfbiter
   */
   
  $ml = new memberList($bot);

  $commands["tell"]["memberlist"] = &$ml;

  class memberlist {
    var $bot;
    var $online;
    function memberlist (&$bot) {$this -> bot = &$bot;}
    function tell($name,$msg) {$this -> bot -> send_tell($name,$this->list_members($name,$msg));}
    function list_members($name,$msg) {
        unset($admins,$leaders,$members);
        $text = explode(" ",$msg);
        if ($text[1] == "prof" || $text[1] == "profession") { $sql="select nickname,profession,level from members order by 'profession','nickname','level' asc";}
        elseif ($text[1] == "level") {$sql="select nickname,profession,level from members order by 'level','profession','nickname' ASC";}
        else {$sql="select nickname,profession,level from members order by 'nickname','profession','level' asc";}
        $rawlist = $this->bot->db->select($sql);
        $memberstot = count($rawlist);
        foreach ($rawlist as $member) {
            $name = $member[0];
            $namelist[$name]['level'] = $member[2];
            $namelist[$name]['prof'] = $member[1];
            $admin = $this -> bot -> admin -> in_group($name, "admin");
            $leader = $this -> bot->admin -> in_group($name, "raidleader");
            if ($admin) {$admins[] = $name;}
            elseif ($leader) {$leaders[] = $name;}
            else {$members[] = $name;}
        }
$output= "<font color=#FFFF66>Order by [ <a href='chatcmd:///tell <botname> !memberlist'>Name</a> ] [ <a href='chatcmd:///tell <botname> !memberlist level'>Level</a> ] [ <a href='chatcmd:///tell <botname> !memberlist prof'>Profession</a> ]<br><br>";
    if (count($admins) > 0) {
        $output.='<font color=#99CCCC>[<u>Admins</u>]';
    foreach($admins as $cur) {$output.='<br><font color=#FFFFFF> '.$cur." - <font color=#009900>".$namelist[$cur]['level']." <font color=#CC0000>".$namelist[$cur]['prof']."<font color=#66CCCC>";}
}
if (count($leaders) > 0) {
        $output.='<br><br><font color=#99CCCC>[<u>Leaders</u>]';
    foreach($leaders as $cur) {$output.='<br><font color=#FFFFFF> '.$cur." - <font color=#009900>".$namelist[$cur]['level']." <font color=#CC0000>".$namelist[$cur]['prof']."<font color=#66CCCC>";}
}
if (count($members) > 0) {
        $output.='<br><br><font color=#99CCCC>[<u>Members</u>]';
    foreach($members as $cur) {$output.='<br><font color=#FFFFFF> '.$cur." - <font color=#009900>".$namelist[$cur]['level']." <font color=#CC0000>".$namelist[$cur]['prof']."<font color=#66CCCC>";}
}
$return = $this->bot->make_blob($memberstot." Members",$output);
return $return;
    }
  }
?>
Title: Re: An existing connection was forcily closed by the remote host.
Post by: Naturalistic on March 30, 2006, 05:30:06 pm
Fix this line:
$ml = new memberList($bot);
to:
$ml = new memberlist($bot);

It's also set to only tells. It won't do anything with org commands unless you set it to.

Should add:
$commands["gc"]["memberlist"] = &$ml;

And add the function gc ($name, $msg)
Title: Re: An existing connection was forcily closed by the remote host.
Post by: buff on March 31, 2006, 03:42:09 am
changed $ml = new memberlist($bot);

also added the following:
$commands["gc"]["memberlist"] = &$ml;
in class:
function gc ($name, $msg) {$this -> bot -> send_gc($this->list_members($name,$msg));}
Title: Re: An existing connection was forcily closed by the remote host.
Post by: Naturalistic on March 31, 2006, 06:38:50 am
Did that work?

Errors?

Title: Re: An existing connection was forcily closed by the remote host.
Post by: buff on March 31, 2006, 10:48:13 am
tested out
it works in guildchat
no error

but my bot still has same issue :P
everytime i reboot my bot
i will have to remove 1 member in my memberlist
and wait for bot to add the member
then reboot bot again in order for bot to function
it's weird cuz it started doing this few days ago and now it stays like that :/
i'm thinking if it has something to do w/ members table in mysql that is causing this problem :/
Title: Re: An existing connection was forcily closed by the remote host.
Post by: Xenixa on March 31, 2006, 01:36:23 pm
Drop the members table completely so a members table doesn't exsist on your mysql server. When you start up the bot it should setup/create a new members table and get all the members. After that there shouldn't be a problem when restarting. If you do have a problem on a restart then I have no clue what's going on other than a bad SQL config.
Title: Re: An existing connection was forcily closed by the remote host.
Post by: Naturalistic on March 31, 2006, 06:28:44 pm
Possible that your "bot" is inside the members table, don't make the bot a member ;)
Title: Re: An existing connection was forcily closed by the remote host.
Post by: buff on April 03, 2006, 08:23:24 pm
after removed whole memebers table
and restart bot let bot updated members from FC db
bot will have problem again when i restart
same error as b4
Title: Re: An existing connection was forcily closed by the remote host.
Post by: Xenixa on April 04, 2006, 02:46:03 am
Which version of AOChat.php and Bot.php are you using?

I see above you listed PHP5, are you also using MySQL server v5?
Title: Re: An existing connection was forcily closed by the remote host.
Post by: buff on April 04, 2006, 04:47:58 am
using latest bebot 0.3.2, php5 and mysql v5
SimplePortal 2.3.7 © 2008-2025, SimplePortal