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

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

Author Topic: Error with AOChat Line 156  (Read 1847 times)

0 Members and 1 Guest are viewing this topic.

Offline Enian

  • BeBot Rookie
  • *
  • Posts: 7
  • Karma: +0/-0
Error with AOChat Line 156
« on: October 17, 2005, 05:45:18 pm »
Hi

I have an error Line 156 with AOchat when i try to launch the bot.

It says :

Warning: socket_create() expects parameter 3 to be long, string given in D:\bebo
t\AOChat.php on line 156
Could not create socket.


Can someone know what i have to do ?

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
Error with AOChat Line 156
« Reply #1 on: October 17, 2005, 06:29:57 pm »
That would be the start of Function Connect()

Does it look like this??:
Code: [Select]
   function connect($server = "chat2.d1.funcom.com", $port = 7012)
    {
      if($this->state !== "connect")
        die("AOChat: not expecting connect.\n");

      $s = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
      if(!is_resource($s)) /* this is fatal */
        die("Could not create socket.\n");

      $this->socket = $s;
      $this->state = "auth";

      if(@socket_connect($s, $server, $port) === false)
      {
        trigger_error("Could not connect to the AO Chat server ($server:$port): ".
          socket_strerror(socket_last_error($s)), E_USER_WARNING);
        $this->disconnect();
        return false;
      }

      $packet = $this->get_packet();
      if(!is_object($packet) || $packet->type != AOCP_LOGIN_SEED)
      {
        trigger_error("Received invalid greeting packet from AO Chat server.", E_USER_WARNING);
        $this->disconnect();
        return false;
      }

      $this->tellqueue = new AOChatQueue(&$this, 'dispatch_tell', AOC_FLOOD_LIMIT, AOC_FLOOD_INC);

      return $s;
    }


Compare that to what you have. That should work unless you have bad login info in the .conf file. Check user name and password, they are case sensitive.
<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky

Offline Enian

  • BeBot Rookie
  • *
  • Posts: 7
  • Karma: +0/-0
Error with AOChat Line 156
« Reply #2 on: October 17, 2005, 07:00:12 pm »
the code is exactly the same as what you posted. I checked again usernam and password but i do'nt think its that because the bot can't even connect, saying socket can't be created.

I don't understand that error  :(

Do i miss a lib or something ?

Offline Enian

  • BeBot Rookie
  • *
  • Posts: 7
  • Karma: +0/-0
Error with AOChat Line 156
« Reply #3 on: October 17, 2005, 07:09:21 pm »
Ok nevermind, i found the problem.
It was about connexion protocol.

with the line $s = socket_create(AF_INET, SOCK_STREAM, 0); its working

thank you for answering anyway :D

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
Error with AOChat Line 156
« Reply #4 on: October 17, 2005, 07:16:25 pm »
No problem :)
<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky

 

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


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


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


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 521
  • 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