From 03cce06564d53ec6b264606637416f9e314719a3 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 16 May 2024 19:30:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=09=E5=88=87=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/models/DynData.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/webapp/models/DynData.php b/webapp/models/DynData.php index 6284f532..1a8df110 100644 --- a/webapp/models/DynData.php +++ b/webapp/models/DynData.php @@ -237,6 +237,7 @@ class DynData extends BaseModel { private static function internalGetV($x, $y, $defVal = 0) { + self::checkLastUser(); $key = self::calcKey($x, $y); if (!is_null(self::$dynData)) { if (isset(self::$dynData[$key])) { @@ -270,7 +271,19 @@ class DynData extends BaseModel { } } - private static $dynData = null; + private static function checkLastUser() + { + if (!empty(self::$lastAccountId)) { + if (self::$lastAccountId != myself()->_getAccountId()) { + self::$lastAccountId = myself()->_getAccountId(); + self::$dynData = null; + self::$hitCount = 0; + } + } + } + + private static $lastAccountId = ''; + private static $dynData = nulla; private static $hitCount = 0; } From 2738bb74a381012b608d6610c56b885e2aee669d Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 16 May 2024 19:32:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=09=E5=88=87=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/models/DynData.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/models/DynData.php b/webapp/models/DynData.php index 1a8df110..4ffbf986 100644 --- a/webapp/models/DynData.php +++ b/webapp/models/DynData.php @@ -283,7 +283,7 @@ class DynData extends BaseModel { } private static $lastAccountId = ''; - private static $dynData = nulla; + private static $dynData = null; private static $hitCount = 0; }