From 0cf1f0fb4601b8a4191f24d490adb2a4d9eda7c7 Mon Sep 17 00:00:00 2001 From: Znote Date: Thu, 16 Dec 2021 19:50:47 +0100 Subject: [PATCH] Fix #497 Protocol 12 freePremium having an account as free, make lots of weirds widgets to appear in game and even some client features unavailable. This unlocks protocol 12 client features for servers who use freePremium in config.lua --- config.php | 2 ++ login.php | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config.php b/config.php index 4450510..6527e30 100644 --- a/config.php +++ b/config.php @@ -657,6 +657,8 @@ 'port' => 7172, 'name' => 'Forgotten' // Must be identical to config.lua (OT config file) server name. ); + // Unlock all protocol 12 client features? Free premium in config.lua? Then set this to true. + $config['freePremium'] = true; // How often do you want highscores (cache) to update? $config['cache'] = array( diff --git a/login.php b/login.php index 40d7382..290c086 100644 --- a/login.php +++ b/login.php @@ -216,6 +216,7 @@ if($_SERVER['HTTP_USER_AGENT'] == "Mozilla/5.0" && $config['ServerEngine'] === ' $sessionKey .= (isset($account['secret']) && strlen($account['secret']) > 5) ? "\n".$token : "\n"; $sessionKey .= "\n".floor(time() / 30); + $freePremium = (isset($config['freePremium'])) ? $config['freePremium'] : true; $response = array( 'session' => array( 'fpstracking' => false, @@ -227,7 +228,7 @@ if($_SERVER['HTTP_USER_AGENT'] == "Mozilla/5.0" && $config['ServerEngine'] === ' 'emailcoderequest' => false, 'sessionkey' => $sessionKey, 'lastlogintime' => 0, - 'ispremium' => ($account['premium_ends_at'] > time()) ? true : false, + 'ispremium' => ($account['premium_ends_at'] > time() || $freePremium) ? true : false, 'premiumuntil' => $account['premium_ends_at'], 'status' => 'active' ),