mirror of
https://github.com/YGGverse/hl-php.git
synced 2026-03-31 17:15:39 +00:00
add __destruct method
This commit is contained in:
parent
726463e94e
commit
27fbf92c6b
1 changed files with 7 additions and 13 deletions
|
|
@ -40,6 +40,13 @@ class Master
|
|||
}
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
fclose(
|
||||
$this->_socket
|
||||
);
|
||||
}
|
||||
|
||||
public function getServersIPv6(
|
||||
int $limit = 100,
|
||||
string $region = "\xFF",
|
||||
|
|
@ -59,10 +66,6 @@ class Master
|
|||
// Filter query
|
||||
if (false === fwrite($this->_socket, "1{$region}{$host}:{$port}\0\gamedir\t{$gamedir}\0"))
|
||||
{
|
||||
fclose(
|
||||
$this->_socket
|
||||
);
|
||||
|
||||
$this->_errors[] = _('Could not send socket query');
|
||||
|
||||
return null;
|
||||
|
|
@ -71,10 +74,6 @@ class Master
|
|||
// Skip header
|
||||
if (false === fread($this->_socket, 6))
|
||||
{
|
||||
fclose(
|
||||
$this->_socket
|
||||
);
|
||||
|
||||
$this->_errors[] = _('Could not init packet header');
|
||||
|
||||
return null;
|
||||
|
|
@ -141,11 +140,6 @@ class Master
|
|||
];
|
||||
}
|
||||
|
||||
// Close connection
|
||||
fclose(
|
||||
$this->_socket
|
||||
);
|
||||
|
||||
return $servers;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue