From c81a9dc7a6d6e250e06b311a1ebcca738625fc07 Mon Sep 17 00:00:00 2001 From: kotyaralih <62548070+kotyaralih@users.noreply.github.com> Date: Sun, 5 Dec 2021 08:39:53 -0800 Subject: [PATCH] Increased UDP buffer size --- src/network/UDPSocket.php | 4 ++-- src/world/Entity.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/network/UDPSocket.php b/src/network/UDPSocket.php index 71b8b687..e21d4a99 100644 --- a/src/network/UDPSocket.php +++ b/src/network/UDPSocket.php @@ -34,8 +34,8 @@ class UDPSocket{ }else{ if(socket_bind($this->sock, $serverip, $port) === true){ socket_set_option($this->sock, SOL_SOCKET, SO_REUSEADDR, 0); - socket_set_option($this->sock, SOL_SOCKET, SO_SNDBUF, 65535); - socket_set_option($this->sock, SOL_SOCKET, SO_RCVBUF, 65535); + socket_set_option($this->sock, SOL_SOCKET, SO_SNDBUF, 1024 * 1024 * 8); //8MB + socket_set_option($this->sock, SOL_SOCKET, SO_RCVBUF, 1024 * 1024); //1MB $this->unblock(); $this->connected = true; }else{ diff --git a/src/world/Entity.php b/src/world/Entity.php index 04a8eb25..971c0839 100644 --- a/src/world/Entity.php +++ b/src/world/Entity.php @@ -826,7 +826,7 @@ class Entity extends Position{ $this->server->preparedSQL->entity->setLevel->reset(); $this->server->preparedSQL->entity->setLevel->clear(); $this->server->preparedSQL->entity->setLevel->bindValue(":level", $this->level->getName(), SQLITE3_TEXT); - $this->server->preparedSQL->entity->setLevel->bindValue(":eid", $this->eid, SQLITE3_TEXT); + $this->server->preparedSQL->entity->setLevel->bindValue(":eid", $this->eid, SQLITE3_INTEGER); $this->server->preparedSQL->entity->setLevel->execute(); } $this->x = $pos->x; @@ -845,7 +845,7 @@ class Entity extends Position{ $this->server->preparedSQL->entity->setPosition->bindValue(":z", $this->z, SQLITE3_TEXT); $this->server->preparedSQL->entity->setPosition->bindValue(":pitch", $this->pitch, SQLITE3_TEXT); $this->server->preparedSQL->entity->setPosition->bindValue(":yaw", $this->yaw, SQLITE3_TEXT); - $this->server->preparedSQL->entity->setPosition->bindValue(":eid", $this->eid, SQLITE3_TEXT); + $this->server->preparedSQL->entity->setPosition->bindValue(":eid", $this->eid, SQLITE3_INTEGER); $this->server->preparedSQL->entity->setPosition->execute(); }