Skip to content

Commit

Permalink
Showing error for TS3 server
Browse files Browse the repository at this point in the history
  • Loading branch information
tltneon committed Jun 1, 2024
1 parent effcb5d commit 4ab79e8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/lgsl_protocol.php
Original file line number Diff line number Diff line change
Expand Up @@ -2248,12 +2248,15 @@ public function process() {
];
if ($ver) { $this->fetch(); }
$buffer = $this->fetch("{$param[$ver][0]}{$this->_server->get_c_port()}\n"); // select virtualserver
if (!$buffer) return $this::WITH_ERROR;
if (!$buffer) return $this::WITH_ERROR;
if (strtoupper($buffer->get(-4, -2)) != 'OK') { return $this::WITH_ERROR; }

$getPackets = function($message) {
$buffer = $this->fetch($message);
if (!$buffer || $buffer->get(0, 5) === 'error') { return $this::WITH_ERROR; }
if (!$buffer || $buffer->get(0, 5) === 'error') {
$this->_data['e']['error'] = $buffer->getAll();
return $this::WITH_ERROR;
}
while (strtoupper($buffer->get(-4, -2)) != 'OK') {
$part = $this->read();
if ($part && $part->get(0, 5) != 'error') { $buffer->add($part); } else { break; }
Expand All @@ -2262,6 +2265,7 @@ public function process() {
};

$buffer = $getPackets("{$param[$ver][1]}\n"); // request serverinfo
if ($buffer === $this::WITH_ERROR) { return $this::WITH_ERROR; }
while ($val = $buffer->cutString(7 + 7 * $ver, $param[$ver][2])) {
$key = Helper::lgslCutString($val, 0, '='); $items[$key] = $val;
}
Expand Down

0 comments on commit 4ab79e8

Please sign in to comment.