You've already forked Epicnabbo-Catalogus-Updated-Daily
🆙 More fixes 🆙
This commit is contained in:
@@ -12,7 +12,7 @@ class RconService
|
||||
{
|
||||
protected ?Socket $socket = null;
|
||||
|
||||
public bool $isConnected = false;
|
||||
public private(set) bool $isConnected = false;
|
||||
|
||||
protected array $config = [];
|
||||
|
||||
@@ -28,7 +28,7 @@ class RconService
|
||||
|
||||
private function initialize(): void
|
||||
{
|
||||
$this->socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
|
||||
$this->socket = @socket_create(domain: AF_INET, type: SOCK_STREAM, protocol: SOL_TCP);
|
||||
|
||||
if (! $this->socket) {
|
||||
$error = socket_strerror(socket_last_error());
|
||||
@@ -39,8 +39,18 @@ class RconService
|
||||
return;
|
||||
}
|
||||
|
||||
socket_set_option($this->socket, SOL_SOCKET, SO_RCVTIMEO, ['sec' => 5, 'usec' => 0]);
|
||||
socket_set_option($this->socket, SOL_SOCKET, SO_SNDTIMEO, ['sec' => 5, 'usec' => 0]);
|
||||
socket_set_option(
|
||||
socket: $this->socket,
|
||||
level: SOL_SOCKET,
|
||||
option: SO_RCVTIMEO,
|
||||
value: ['sec' => 5, 'usec' => 0]
|
||||
);
|
||||
socket_set_option(
|
||||
socket: $this->socket,
|
||||
level: SOL_SOCKET,
|
||||
option: SO_SNDTIMEO,
|
||||
value: ['sec' => 5, 'usec' => 0]
|
||||
);
|
||||
|
||||
if (! @socket_connect($this->socket, $this->config['ip'], $this->config['port'])) {
|
||||
$error = socket_strerror(socket_last_error());
|
||||
|
||||
Reference in New Issue
Block a user