From 6fb32214335499074e0dfe0f93368273f2b8e6e6 Mon Sep 17 00:00:00 2001 From: CrystSw Date: Thu, 4 Jun 2020 23:57:01 +0900 Subject: [PATCH] =?UTF-8?q?=E9=A1=9E=E4=BC=BC=E5=BA=A6=E8=A8=88=E7=AE=97?= =?UTF-8?q?=E3=81=AE=E4=B8=8D=E5=82=99+=CE=B1=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/corefiles/OlinvasCore.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/corefiles/OlinvasCore.php b/src/corefiles/OlinvasCore.php index f64997c..f1b3834 100644 --- a/src/corefiles/OlinvasCore.php +++ b/src/corefiles/OlinvasCore.php @@ -377,6 +377,9 @@ public function onMessage(ConnectionInterface $from, $message){ //ログ出力 $GLOBALS['logger']->printLog(LOG_WARNING, "JoinRoom-Reject: Request from '{$from->remoteAddress}'."); + + //無効パケット検出処理(意図せず起こり得るので配慮) + $this->detectIllegalPacket($from, 5); break; } if( @@ -392,7 +395,7 @@ public function onMessage(ConnectionInterface $from, $message){ $GLOBALS['logger']->printLog(LOG_WARNING, "JoinRoom-Reject: Request from '{$from->remoteAddress}'."); //無効パケット検出処理(意図せず起こり得るので配慮) - $this->detectIllegalPacket($from, (1.0-levenshtein($this->roomInfo[$roomId]->getPassword(), $roomPassword)/max(strlen($this->roomInfo[$roomId]->getPassword()), strlen($roomPassword)))*20); + $this->detectIllegalPacket($from, (levenshtein($this->roomInfo[$roomId]->getPassword(), $roomPassword)/max(strlen($this->roomInfo[$roomId]->getPassword()), strlen($roomPassword)))*20); break; } //================================== @@ -503,7 +506,7 @@ public function onMessage(ConnectionInterface $from, $message){ $GLOBALS['logger']->printLog(LOG_WARNING, "FriendAuth-Reject: Request from '{$from->remoteAddress}'."); //無効パケット検出処理(意図せず起こり得るので配慮) - $this->detectIllegalPacket($from, (1.0-levenshtein($this->roomInfo[$roomId]->getFriendKey(), $roomFriendKey)/max(strlen($this->roomInfo[$roomId]->getFriendKey()), strlen($roomFriendKey)))*12); + $this->detectIllegalPacket($from, (levenshtein($this->roomInfo[$roomId]->getFriendKey(), $roomFriendKey)/max(strlen($this->roomInfo[$roomId]->getFriendKey()), strlen($roomFriendKey)))*12); break; } //==================================