1
0
mirror of https://github.com/xPaw/PHP-Source-Query.git synced 2026-05-18 14:33:34 +02:00

Split source and goldsource RCON into different classess

This commit is contained in:
xPaw
2014-06-26 13:18:35 +03:00
parent 00fbadacec
commit f3684b4783
4 changed files with 287 additions and 261 deletions
+23 -3
View File
@@ -17,7 +17,8 @@
require __DIR__ . '/Exception.class.php';
require __DIR__ . '/Buffer.class.php';
require __DIR__ . '/Socket.class.php';
require __DIR__ . '/Rcon.class.php';
require __DIR__ . '/SourceRcon.class.php';
require __DIR__ . '/GoldSourceRcon.class.php';
class SourceQuery
{
@@ -106,7 +107,6 @@
{
$this->Buffer = new SourceQueryBuffer( );
$this->Socket = new SourceQuerySocket( $this->Buffer );
$this->Rcon = new SourceQueryRcon( $this->Buffer, $this->Socket );
}
public function __destruct( )
@@ -142,6 +142,22 @@
}
$this->Connected = true;
switch( $this->Socket->Engine )
{
case SourceQuery :: GOLDSOURCE:
{
$this->Rcon = new SourceQueryGoldSourceRcon( $this->Buffer, $this->Socket );
break;
}
case SourceQuery :: SOURCE:
{
$this->Rcon = new SourceQuerySourceRcon( $this->Buffer, $this->Socket );
break;
}
}
}
/**
@@ -152,7 +168,11 @@
$this->Connected = false;
$this->Socket->Close( );
$this->Rcon->Close( );
if( $this->Rcon )
{
$this->Rcon->Close( );
}
}
/**