ogame.class.php<?php
class oGame {
private $sServerIp = '';
private $sSessionId = null;
private $sReferer = null;
public function __construct( $sServerIp ) {
$this->sServerIp = $sServerIp;
}
public function getSid()
{
return( $this -> sSessionId );
}
public function isLogin() {
return !is_null( $this->sSessionId ); }
public function sPage
( $strPage, $arrParams = array(), $arrPost = array() ) {
$url = 'http://'.$this->sServerIp.'/game/'. $strPage;
$r = new httpRequest( $url );
'session' => $this -> getSid(),
'PHPSESSID' => $this -> getSid()
);
$r -> get( $arrGet );
$r -> post( $arrPost );
$re = new httpResponse( $r -> send() );
return $re;
}
public function page()
{
$url = 'http://'.$this->sServerIp.'/game/index.php';
$r = new httpRequest( $url );
'session' => $this -> getSid()
));
$re = new httpResponse( $r -> send() );
return $re;
}
public function login( $sLogin, $sPass ) {
try {
$url = 'http://'.$this->sServerIp.'/game/reg/login2.php';
//$url = 'http://www.php.pl/';
$r = new httpRequest( $url );
//$r->proxy( '10.1.1.1', 80 );
'v' => 2,
'Uni' => $this->sServerIp,
'login' => $sLogin,
'pass' => $sPass,
'x' => 0,
'y' => 0,
)
);
$re = new httpResponse( $r->send() );
$strDoc = $re->getDocument();
preg_match( '#index\.php\?session=(.*?)"#si', $strDoc, $arrOut ); $this -> sSessionId = $arrOut[1];
}
catch ( Exception $e ) {
throw $e;
}
}
}
?>
start.php<?php
include( './ogame.class.php' );
include( './httpRequest.class.php' );
include( './httpResponse.class.php' );
include( './Socket.class.php' );
$ogame = new Ogame( 'ogame185.de' );
$ogame -> login( 'user', 'pass' );
if( $ogame->isLogin() )
{
function loadPage
( ogame
$objOgame, $strPage = 'overview.php', $arrParams = array(), $arrPost = array() ) {
$page = $objOgame -> sPage( $strPage, $arrParams, $arrPost );
$strDoc = $page -> getDocument();
$strDoc = str_replace( '<script language=JavaScript> if (parent.frames.length == 0) { top.location.href = "http://www.ogame.de/"; } </script>', '', $strDoc ); return $strDoc;
}
}
if( is_callable( 'loadPage' ) )
{
$strOverview = loadPage
( $ogame, 'overview.php', array( 'mode' => '', 'cp' => 33701844, 'messageziel' => '', 're' => '' ) ); ///dalsza obróbka
}
}
?>
Na prośbe hwao

Edit: Zgodnie z pierwszym postem -> darowizny chętnie przyjmę na
50102055581111146337800021