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: !announce on .2 raidbot crashs bot  (Read 17066 times)

0 Members and 1 Guest are viewing this topic.

Offline Nytridr

  • BeBot Expert
  • ****
  • Posts: 262
  • Karma: +0/-0
    • Rising Sun
!announce on .2 raidbot crashs bot
« on: February 07, 2007, 06:12:14 pm »
I have 1732 people on this raid bot I run.. when ever I do an !announce it will crash the bot.. the errors go by so fast I can not see the beginning of the errors.. but..I am able to see this..

Code: [Select]
Warning: socket_read(): unable to read from socket [0]: An established connectio
n was aborted by the software in your host machine.
 in C:\aobots\rsbot\aofbot\AOChat.php on line 222
Read error: An established connection was aborted by the software in your host m
achine.


Warning: socket_write(): unable to write to socket [0]: An established connectio
n was aborted by the software in your host machine.
 in C:\aobots\rsbot\aofbot\AOChat.php on line 310

I turned all logging on after I wrote this and basically I got close to 100 pages of the above before the bot restarted..

I am going to try the .3 aochat.php and see if that will work.. I thought I already did that with this raid bot but dont remember..

Nytridr
Co-Prez of Rising Sun RK1 (1st & only org I will ever belong to)

Offline Nytridr

  • BeBot Expert
  • ****
  • Posts: 262
  • Karma: +0/-0
    • Rising Sun
Re: !announce on .2 raidbot crashs bot
« Reply #1 on: February 07, 2007, 06:18:39 pm »
nope using the most recent aochat.php didnt work either.. now I got this one..

Code: [Select]
[07-Feb-2007 11:14:54] PHP Warning:  socket_write(): unable to write to socket [0]: An established connection was aborted by the software in your host machine.
 in C:\aobots\rsbot\aofbot\AOChat.php on line 340
[07-Feb-2007 11:14:54] PHP Warning:  socket_read(): unable to read from socket [0]: An established connection was aborted by the software in your host machine.
 in C:\aobots\rsbot\aofbot\AOChat.php on line 239

I am using the 1k files and have _ the normal ones .. I am also using the multiple org update module to keep multiple orgs updated.

any ideas?

Nytridr
Co-Prez of Rising Sun RK1 (1st & only org I will ever belong to)

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: !announce on .2 raidbot crashs bot
« Reply #2 on: February 07, 2007, 10:04:57 pm »
I think you are possibly running into the same issue that i did, but never got time to look into properly.

The bot i started having issues with after an AO patch had 3000 members or so. I'm guessing that Funcom changed something and that the bot is flooding itself off somehow.
Unfortunately i'm no longer even in a position where i can reproduce this :(

I'm pondering on a complete rewrite of the announce/invite modules at any rate since they are a royal mess.

Here's the modified one which was the last one i used. Note however that it assumes that you have an empty buddylist as it adds each member to check if they are online.
ymmw!
BeBot Founder and Fixer Kingpin

Offline Nytridr

  • BeBot Expert
  • ****
  • Posts: 262
  • Karma: +0/-0
    • Rising Sun
Re: !announce on .2 raidbot crashs bot
« Reply #3 on: February 08, 2007, 12:17:06 am »
okay this one starts to work.. I think it is erroring out adding the buddys.. can you do me a favor and just make it where it will send a msg to everyone single person no matter if they are online or not.. at least this would work for what we have going on with our raid bot.. since most of the time when an announce is used it is to get peoples attention that an event is going on.. and if they happen to log on during then they can still join..

I could care less if they are online at the time or not.. This would make it more simple for me to get this working I think..

just need to read from database and send message then wait a certain amount of time and send another message..and so on..

Nytridr
Co-Prez of Rising Sun RK1 (1st & only org I will ever belong to)

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: !announce on .2 raidbot crashs bot
« Reply #4 on: February 08, 2007, 05:52:49 am »
I can do that, however keep this in mind.

The chatsocket enforces a 2 second delay between tells. With 1732 members it will take the bot around one hour to send the messages.
BeBot Founder and Fixer Kingpin

Offline Nytridr

  • BeBot Expert
  • ****
  • Posts: 262
  • Karma: +0/-0
    • Rising Sun
Re: !announce on .2 raidbot crashs bot
« Reply #5 on: February 08, 2007, 06:32:56 am »
umm that is correct.. I wounder if there is a way to maybe fix this problem.. dont really care about the massinv just the announce working would be good.. in my limited knollege of things (which I hope is growing)  could it be posible that it is trying to add rem buddies to fast.. maybe have some kind of a timer or something to slow it down.. it does  partly work with checking for online.. I am able to get through about 20 people in the database before the bot crashs..

IDK just kind of thinking outloud here..

Nytridr

I just verified it.. it is sending out "Some" messages to people.. it is just crashing in the process of doing it..

actually I think it is crashing on sending the messages out.. I see only 5 messages sent out before it crashs if that helps at all..
« Last Edit: February 08, 2007, 06:58:41 am by Nytridr »
Co-Prez of Rising Sun RK1 (1st & only org I will ever belong to)

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: !announce on .2 raidbot crashs bot
« Reply #6 on: February 13, 2007, 10:27:34 pm »
Ok. I was unable to reproduce this issue. However i did make one modification which might help.
Using the MassMsg file i gave you and making the following change to Bot.php.

Find the following in inc_buddy
Code: [Select]
$end = "";
if (!$mem)
{
$end = " (not member)";
$this -> aoc -> buddy_remove($user);
}
else if ($mem == 1)
{
$end = " (guest)";
}
else if ($mem == 2)
{
$end = " (member)";
}
else if ($mem == 3)
{
$end = " (admin)";
}

Change it to:
Code: [Select]
$end = "";
if (!$mem)
{
$end = " (not member)";
}
else if ($mem == 1)
{
$end = " (guest)";
}
else if ($mem == 2)
{
$end = " (member)";
}
else if ($mem == 3)
{
$end = " (admin)";
}
$this -> aoc -> buddy_remove($user);

This will ensure that the bot never has anyone on the buddylist which is exactly what we want for this specific purpose.

For 0.2 the code looks like this:
Code: [Select]
if (!$mem || ($mem == 2))
$this -> aoc -> buddy_remove($user);

if ($this -> is_member($name) != 1)
$this -> aoc -> buddy_remove($name);

Change to:
Code: [Select]
$this -> aoc -> buddy_remove($user);
BeBot Founder and Fixer Kingpin

Offline Nytridr

  • BeBot Expert
  • ****
  • Posts: 262
  • Karma: +0/-0
    • Rising Sun
Re: !announce on .2 raidbot crashs bot
« Reply #7 on: February 14, 2007, 12:46:38 am »
okay with these changes it actually made it all the way through the people to check to see who was online.. but crashed right after that..


Code: [Select]
[2007-02-13 23:40:34] [TELL] [INC] Nytridra: !announce ... This is only a test.. if this was a real announcement you would be told what we were doing.. but this is only a test
[2007-02-13 23:40:34] [TELL] [OUT] -> Nytridra: Mass message beeing sent. Please stand by...
[2007-02-13 23:40:38] [PGRP] [MSG] [Aofbot] Aofbot: Mass message beeing sent from Nytridra: ... This is only a test.. if this was a real announcement you would be told what we were doing.. but this is only a test
[2007-02-13 23:40:38] [TELL] [OUT] -> Ender2006: Message from Nytridra: ... This is only a test.. if this was a real announcement you would be told what we were doing.. but this is only a test
[2007-02-13 23:40:38] [TELL] [OUT] -> Jlife: Message from Nytridra: ... This is only a test.. if this was a real announcement you would be told what we were doing.. but this is only a test
[2007-02-13 23:40:38] [TELL] [OUT] -> Soldzxxx: Message from Nytridra: ... This is only a test.. if this was a real announcement you would be told what we were doing.. but this is only a test
[2007-02-13 23:40:39] [TELL] [OUT] -> Vabot1: Message from Nytridra: ... This is only a test.. if this was a real announcement you would be told what we were doing.. but this is only a test
[2007-02-13 23:40:41] [TELL] [OUT] -> Drcherry: Message from Nytridra: ... This is only a test.. if this was a real announcement you would be told what we were doing.. but this is only a test
[2007-02-13 23:40:54] [TELL] [OUT] -> Mighterus: Message from Nytridra: ... This is only a test.. if this was a real announcement you would be told what we were doing.. but this is only a test
[2007-02-13 23:40:54] [TELL] [OUT] -> Mrfli: Message from Nytridra: ... This is only a test.. if this was a real announcement you would be told what we were doing.. but this is only a test

Code: [Select]
[13-Feb-2007 17:41:14] PHP Warning:  socket_read(): unable to read from socket [0]: An existing connection was forcibly closed by the remote host.
 in C:\aobots\rsbot\aofbot\AOChat.php on line 239

as you can see some messages are being sent out.. SO.. whats next?  we are getting closer it seems..


I did something wierd.. really just testing some things out..

I used the .3 svn aochat.php file and put it on this .2 raid bot.. and guess what.. it got through all the user names.. but reached teh end and came up with an error..


when it got to the end of the user list it shot out..

Code: [Select]
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF
Read error: EOF

now the EOF error is no where in the log files at all.....  so not sure where or what should be done.. what would be easier to fix the EOF or the old error?
« Last Edit: February 14, 2007, 01:51:44 am by Nytridr »
Co-Prez of Rising Sun RK1 (1st & only org I will ever belong to)

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: !announce on .2 raidbot crashs bot
« Reply #8 on: February 14, 2007, 05:39:34 pm »
0.2 and 0.3 libraries are more or less identical except for ext message handling.

Please try using the MassMsg i posted, and also try commenting back in the debug line that states which buddy is being added. That way it should give you a better idea just when it crashes, and if it does it on the same person.

The errors are pretty much the same thing, both indicate that the bot is being booted from the chatserver.
BeBot Founder and Fixer Kingpin

Offline Nytridr

  • BeBot Expert
  • ****
  • Posts: 262
  • Karma: +0/-0
    • Rising Sun
Re: !announce on .2 raidbot crashs bot
« Reply #9 on: February 15, 2007, 03:03:11 am »
Okay still crashed with even with your modified version.. I am finding out some things.. I think it is windows related.. man I hate windows.. and if I could get *inx installed on the server I would.. but for some reason it will not and I have little time at home.. since I drive semi.. I do all of my work and game play out on the road.. But here is something I found


http://bugs.php.net/bug.php?id=21197&edit=3

and another place to look
http://www.php.net/manual/en/function.socket-read.php

I am thinking it is php releated.. is there any way to work around this bug.. *looks around carefully for someone pointing a gun at me*

Nytridr

aochat.php
following starts on line 218
Code: [Select]
    function read_data($len)
    {
      $data = "";
      $rlen = $len;
      while($rlen > 0)
      {
        if(($tmp = socket_read($this->socket, $rlen)) === false)
        {
          printf("Read error: %s\n", socket_strerror(socket_last_error($this->socket)));
          return "";
        }
        if($tmp == "")
        {
          echo("Read error: EOF\n");
          return "";
        }
        $data .= $tmp;
        $rlen -= strlen($tmp);
      }
      return $data;
    }


« Last Edit: February 15, 2007, 04:56:44 am by Nytridr »
Co-Prez of Rising Sun RK1 (1st & only org I will ever belong to)

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: !announce on .2 raidbot crashs bot
« Reply #10 on: February 16, 2007, 11:51:17 pm »
I still cant reproduce this on Windows or Linux :\

Out of curiosity, what php version are you using?
BeBot Founder and Fixer Kingpin

Offline Nytridr

  • BeBot Expert
  • ****
  • Posts: 262
  • Karma: +0/-0
    • Rising Sun
Re: !announce on .2 raidbot crashs bot
« Reply #11 on: February 17, 2007, 12:44:23 am »
Code: [Select]
PHP 5.1.5 (cli) (built: Aug 15 2006 23:54:56)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
Co-Prez of Rising Sun RK1 (1st & only org I will ever belong to)

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: !announce on .2 raidbot crashs bot
« Reply #12 on: February 17, 2007, 04:07:01 pm »
Just for the sake of it, could you try using the php 5.2 1 bundle to see if it makes any difference?
BeBot Founder and Fixer Kingpin

Offline Nytridr

  • BeBot Expert
  • ****
  • Posts: 262
  • Karma: +0/-0
    • Rising Sun
Re: !announce on .2 raidbot crashs bot
« Reply #13 on: February 17, 2007, 04:30:53 pm »
Code: [Select]
Warning: dl(): aokex: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=1
PHP    compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
 in C:\aobots\rsbot\aofbot\main.php on line 85
Connected to MySQL

still loads up and connects

Code: [Select]
AOKex not availible, key generation might fail
Using bcmath for login key generation


then on an !announce I get the follow about a few hundred pages of the following

Code: [Select]
[14-Feb-2007 14:45:39] PHP Warning:  socket_read(): unable to read from socket [0]: An existing connection was forcibly closed by the remote host.
 in C:\aobots\rsbot\aofbot\AOChat.php on line 239
[14-Feb-2007 14:45:39] PHP Warning:  socket_read(): unable to read from socket [0]: An existing connection was forcibly closed by the remote host.

I honestly dont have no idea what it could be.. maybe a setting in my mysql.ini file or something IDK.. I am at a total loss..

Code: [Select]
PHP 5.2.1 (cli) (built: Feb  7 2007 23:11:26)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
Co-Prez of Rising Sun RK1 (1st & only org I will ever belong to)

Offline Vhab

  • Contributor
  • *******
  • Posts: 180
  • Karma: +0/-0
    • VhaBot Forum
Re: !announce on .2 raidbot crashs bot
« Reply #14 on: February 17, 2007, 07:02:09 pm »
Throwing out some ideas
Correct me if I'm wrong since I'm assuming alot here without knowing how the thing really works, but here it goes:
The aunnounce module adds people to the friendslist to get their status, to do so it uses user id's directly from the database. one of these user id's is incorrect (probebly of a deleted character), when the bot tries to add it, fc's chat server gets angry and disconnects you.

 

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