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: need help with fsockopen  (Read 3367 times)

0 Members and 1 Guest are viewing this topic.

Offline Pharexys

  • BeBot Apprentice
  • ***
  • Posts: 117
  • Karma: +0/-0
need help with fsockopen
« on: October 03, 2007, 03:23:38 pm »
Code: [Select]
// Retrieves guild information from fc webserver
function guild_bio()
{
global $login_dimension,$guild_id;

$handle = fsockopen("216.74.158.92", 80, $errno, $errstr, 3);

if($handle)
{
fputs($handle,"GET /org/stats/d/$login_dimension/name/$guild_id/basicstats.xml HTTP/1.1\r\nConnection: Close\r\n\r\n");

while(!feof($handle))
{
$info .= fgets($handle,4096);
}

fclose($handle);

$guild[name] = guild_data($info,"<nickname>","</nickname>");
$guild[rank_id] = guild_data($info,"<rank>","</rank>");
$guild[rank_name] = guild_data($info,"<rank_name>","</rank_name>");
$guild[level] = guild_data($info,"<level>","</level>");
$guild[profession] = guild_data($info,"<profession>","</profession>");
$guild[gender] = guild_data($info,"<gender>","</gender>");
$guild[breed] = guild_data($info,"<breed>","</breed>");
}
else
{
$guild = false;
}

return $guild;
}


The code aint from bebot, well is the first platform bebot had too i think, anyway, since FC changed theyr sites, i couldnt get this to work anymore. I dont really understand how this fsockopen works, well i tryd load and loads of ways to make it work, but it only either wipes whole db or saying cant connect. Even If i put full name, or ip. Maybe someone has a better way of handling this.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: need help with fsockopen
« Reply #1 on: October 03, 2007, 04:50:36 pm »
My quick guess is that the following line takes the server name, so
Code: [Select]
$handle = fsockopen("216.74.158.92", 80, $errno, $errstr, 3); should be changed to
Code: [Select]
$handle = fsockopen("people.anarchy-online.com", 80, $errno, $errstr, 3);.

Untested though.

Offline Pharexys

  • BeBot Apprentice
  • ***
  • Posts: 117
  • Karma: +0/-0
Re: need help with fsockopen
« Reply #2 on: October 03, 2007, 06:41:54 pm »
says it worked, but if i restart bot, it clears whole database, in other words didnt worked at all. i've try'd this way too, even with people... ip, doesnt work at all.

 

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