L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 01, 2008, 01:52:11 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: need help with fsockopen
Pages: [1]   Go Down
« previous next »
Print
Author Topic: need help with fsockopen  (Read 284 times)
0 Members and 1 Guest are viewing this topic.
Pharexys
Apprentice
***
Offline Offline

Posts: 94


need help with fsockopen
« on: October 03, 2007, 08:23:38 AM »

Code:
// 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.
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1085


Re: need help with fsockopen
« Reply #1 on: October 03, 2007, 09:50:36 AM »

My quick guess is that the following line takes the server name, so
Code:
$handle = fsockopen("216.74.158.92", 80, $errno, $errstr, 3);
should be changed to
Code:
$handle = fsockopen("people.anarchy-online.com", 80, $errno, $errstr, 3);
.

Untested though.
Logged
Pharexys
Apprentice
***
Offline Offline

Posts: 94


Re: need help with fsockopen
« Reply #2 on: October 03, 2007, 11:41:54 AM »

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.
Logged
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: need help with fsockopen
« previous next »
 
Jump to:  

Recent
[request] Raid timers
by Alreadythere
[Today at 11:42:32 AM]

Shared DB online list
by Temar
[Today at 01:55:47 AM]

relay colors
by Temar
[Today at 01:54:56 AM]

BeBot v0.6.0 released
by Alreadythere
[November 30, 2008, 05:32:00 PM]

Change to Bid.php
by Temar
[November 30, 2008, 11:41:44 AM]

OnlineOrg
by Jiheld
[November 29, 2008, 12:44:27 PM]

Silly Newbie Question.
by Temar
[November 29, 2008, 12:00:02 PM]

massive_pvp_time_table 1
by gerborg
[November 29, 2008, 06:55:35 AM]

Bot not see Guild Chat
by Delvar
[November 28, 2008, 08:30:34 AM]

Starting Bot
by Allisande
[November 28, 2008, 07:08:21 AM]
Stats
Members
Total Members: 1243
Latest: Whackoeng
Stats
Total Posts: 11143
Total Topics: 1505
Online Today: 21
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 1
Guests: 12
Total: 13

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.439 seconds with 28 queries. (Pretty URLs adds 0.024s, 4q)
Loading...