lgsl icon indicating copy to clipboard operation
lgsl copied to clipboard

Create separate PHP library from the lgsl_protocol

Open Pasqualle opened this issue 2 years ago • 6 comments

https://github.com/tltneon/lgsl/blob/master/lgsl_files/lgsl_protocol.php This file needs a serious restructuring. It should even be a separate PHP library. The rest of the codebase should be a PHP application.

For example I would expect a server query code something like this

use LGSL\Game\Quake3;
use LGSL\Client;

$client = new Client([
  'name' => 'LGSL/10.1',
  'timeout' => 10,
  'server' => [
    'game' => Quake3,
    'ip' => '127.0.0.1',
    'port' => '27960',
  ],
]);

/** @var \LGSL\Game\Quake3\Server $server */
$server = $client->connect();

///
print $server;

print $server->getMapName();
print $server->getGameTypeLabel();
print $server->getPlayerCount();
print_r($server->getPlayerNames());

Pasqualle avatar Nov 10 '22 23:11 Pasqualle