Skip to content

Commit

Permalink
Add BaseRcon
Browse files Browse the repository at this point in the history
  • Loading branch information
xPaw committed Sep 24, 2024
1 parent 9c1d5db commit 18423a4
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
28 changes: 28 additions & 0 deletions SourceQuery/BaseRcon.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
declare(strict_types=1);

/**
* @author Pavel Djundik
*
* @link https://xpaw.me
* @link https://github.com/xPaw/PHP-Source-Query
*
* @license GNU Lesser General Public License, version 2.1
*
* @internal
*/

namespace xPaw\SourceQuery;

/**
* Base RCON interface
*/
abstract class BaseRcon
{
abstract public function Close( ) : void;
abstract public function Open( ) : void;
abstract public function Write( int $Header, string $String = '' ) : bool;
abstract public function Read( ) : Buffer;
abstract public function Command( string $Command ) : string;
abstract public function Authorize( string $Password ) : void;
}
2 changes: 1 addition & 1 deletion SourceQuery/GoldSourceRcon.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/**
* Class GoldSourceRcon
*/
class GoldSourceRcon
class GoldSourceRcon extends BaseRcon
{
/**
* Points to socket class
Expand Down
2 changes: 1 addition & 1 deletion SourceQuery/SourceQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class SourceQuery
/**
* Points to rcon class
*/
private SourceRcon|GoldSourceRcon|null $Rcon = null;
private ?BaseRcon $Rcon = null;

/**
* Points to socket class
Expand Down
2 changes: 1 addition & 1 deletion SourceQuery/SourceRcon.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/**
* Class SourceRcon
*/
class SourceRcon
class SourceRcon extends BaseRcon
{
/**
* Points to socket class
Expand Down

0 comments on commit 18423a4

Please sign in to comment.