diff --git a/hwe/j_select_npc.php b/hwe/j_select_npc.php index 13005ce4..84fdb15e 100644 --- a/hwe/j_select_npc.php +++ b/hwe/j_select_npc.php @@ -37,7 +37,14 @@ if(!$member){ $userNick = $member['name']; $memberPenalty = Json::decode($member['penalty'] ?? '{}'); -$penalty = array_merge($memberPenalty['any'] ?? [], $memberPenalty[DB::prefix()] ?? []); +$penaltyInfo = array_merge($memberPenalty['any'] ?? [], $memberPenalty[DB::prefix()] ?? []); + +$penalty = []; +foreach($penaltyInfo as $penaltyKey => $penaltyValue){ + if($penaltyValue['expire'] ?? 0 > TimeUtil::now()){ + $penalty[$penaltyKey] = $penaltyValue['value']; + } +} $pickResult = $db->queryFirstField('SELECT pick_result FROM select_npc_token WHERE `owner`=%i AND `valid_until`>=%s', $userID, $now); if(!$pickResult){ diff --git a/hwe/sammo/API/General/Join.php b/hwe/sammo/API/General/Join.php index 26571cff..82714f46 100644 --- a/hwe/sammo/API/General/Join.php +++ b/hwe/sammo/API/General/Join.php @@ -153,7 +153,14 @@ class Join extends \sammo\BaseAPI } $memberPenalty = Json::decode($member['penalty'] ?? "{}"); - $penalty = array_merge($memberPenalty['any'] ?? [], $memberPenalty[DB::prefix()] ?? []); + $penaltyInfo = array_merge($memberPenalty['any'] ?? [], $memberPenalty[DB::prefix()] ?? []); + + $penalty = []; + foreach($penaltyInfo as $penaltyKey => $penaltyValue){ + if($penaltyValue['expire'] ?? 0 > TimeUtil::now()){ + $penalty[$penaltyKey] = $penaltyValue['value']; + } + } $db = DB::db(); $gameStor = KVStorage::getStorage($db, 'game_env');