1
0
mirror of https://github.com/xPaw/PHP-Source-Query.git synced 2026-06-11 02:13:14 +02:00

Move the response array logic into classes.

This commit is contained in:
Anthony Birkett
2021-05-31 18:52:56 +01:00
parent 96a875c881
commit 5d54dc8929
14 changed files with 383 additions and 207 deletions
+10 -2
View File
@@ -4,6 +4,8 @@ declare(strict_types=1);
namespace xPaw\SourceQuery;
use xPaw\SourceQuery\Rcon\GoldSourceRcon;
use xPaw\SourceQuery\Rcon\SourceRcon;
use xPaw\SourceQuery\Socket\GoldSourceSocket;
use xPaw\SourceQuery\Socket\SourceSocket;
@@ -11,11 +13,17 @@ final class SourceQueryFactory
{
public static function createGoldSourceQuery(): SourceQuery
{
return new SourceQuery(new SourceSocket());
$socket = new SourceSocket();
$rcon = new SourceRcon($socket);
return new SourceQuery($socket, $rcon);
}
public static function createSourceQuery(): SourceQuery
{
return new SourceQuery(new GoldSourceSocket());
$socket = new GoldSourceSocket();
$rcon = new GoldSourceRcon($socket);
return new SourceQuery($socket, $rcon);
}
}