From 641ae05f333e396ed47bcb95fb0850a1f3d32ec8 Mon Sep 17 00:00:00 2001 From: Lkeme <19500576+lkeme@users.noreply.github.com> Date: Sat, 7 Aug 2021 15:47:03 +0800 Subject: [PATCH] [fix] AloneTcpClient --- src/plugin/AloneTcpClient.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/plugin/AloneTcpClient.php b/src/plugin/AloneTcpClient.php index 0c921b8..33f4d25 100644 --- a/src/plugin/AloneTcpClient.php +++ b/src/plugin/AloneTcpClient.php @@ -79,7 +79,7 @@ class AloneTcpClient */ private static function unPackMsg($value, string $fmt = "N") { - return unpack($fmt, $value); + return unpack($fmt, $value)[1]; } /** @@ -126,12 +126,6 @@ class AloneTcpClient throw new Exception("Connection failure"); } if ($length == 4) $data = self::unPackMsg($data); - // 防止解包异常 - if (!$data) { - throw new Exception("Connection failure"); - } else { - $data = $data[1]; - } break; } } catch (Exception $exception) {