Jump to content

[SOLVED] I can telnet but not via fsockopen


Yesideez

Recommended Posts

Hi, trying to write a remote admin suite for my Battlefield 2 clan admin so they can issue commands when on a PC that doesn't have BF2 installed and although we can connect to the game server via telnet my PHP code always times out.

 

The original code I've been using was given away by the coder and many have used it no problems but I can't - fsockopen times out where telnet connects immediately.

 

Here's my most basic code:

<?php
  ob_start();
  if ($tmp=fsockopen('8.6.**.**',****,$errno,$errstr,5)) {
    while (!feof($tmp)) {
      $txt=fread($tmp);
      str_replace("\n",'*N',$txt);
      str_replace("\r",'*R',$txt);
      str_replace("\t",'*T',$txt);
      echo $txt.'<br />';
    }
    fclose($tmp);
  } else {
    echo 'No connection';
  }
?>

I've replaced part of the server IP and the port number with stars.

 

All I get on the screen is "No connection" when I should be getting something like this:

### Battlefield 2 ModManager Rcon v3.5.

 

Anyone have any idea where my problem could be?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.