Skip to content

Commit 18423a4

Browse files
committed
Add BaseRcon
1 parent 9c1d5db commit 18423a4

File tree

4 files changed

+31
-3
lines changed

4 files changed

+31
-3
lines changed

SourceQuery/BaseRcon.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
/**
5+
* @author Pavel Djundik
6+
*
7+
* @link https://xpaw.me
8+
* @link https://github.com/xPaw/PHP-Source-Query
9+
*
10+
* @license GNU Lesser General Public License, version 2.1
11+
*
12+
* @internal
13+
*/
14+
15+
namespace xPaw\SourceQuery;
16+
17+
/**
18+
* Base RCON interface
19+
*/
20+
abstract class BaseRcon
21+
{
22+
abstract public function Close( ) : void;
23+
abstract public function Open( ) : void;
24+
abstract public function Write( int $Header, string $String = '' ) : bool;
25+
abstract public function Read( ) : Buffer;
26+
abstract public function Command( string $Command ) : string;
27+
abstract public function Authorize( string $Password ) : void;
28+
}

SourceQuery/GoldSourceRcon.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* Class GoldSourceRcon
2323
*/
24-
class GoldSourceRcon
24+
class GoldSourceRcon extends BaseRcon
2525
{
2626
/**
2727
* Points to socket class

SourceQuery/SourceQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class SourceQuery
6666
/**
6767
* Points to rcon class
6868
*/
69-
private SourceRcon|GoldSourceRcon|null $Rcon = null;
69+
private ?BaseRcon $Rcon = null;
7070

7171
/**
7272
* Points to socket class

SourceQuery/SourceRcon.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* Class SourceRcon
2323
*/
24-
class SourceRcon
24+
class SourceRcon extends BaseRcon
2525
{
2626
/**
2727
* Points to socket class

0 commit comments

Comments
 (0)