Skip to content

Commit 0f4c67d

Browse files
committed
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
1 parent 52956f8 commit 0f4c67d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Diff for: config.php

+2
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,8 @@ function getClock($time = false, $format = false, $adjust = true) {
658658
'port' => 7172,
659659
'name' => 'Forgotten' // Must be identical to config.lua (OT config file) server name.
660660
);
661+
// Unlock all protocol 12 client features? Free premium in config.lua? Then set this to true.
662+
$config['freePremium'] = true;
661663

662664
// How often do you want highscores (cache) to update?
663665
$config['cache'] = array(

Diff for: login.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ function parseEvent($table1, $date, $table2) {
216216
$sessionKey .= (isset($account['secret']) && strlen($account['secret']) > 5) ? "\n".$token : "\n";
217217
$sessionKey .= "\n".floor(time() / 30);
218218

219+
$freePremium = (isset($config['freePremium'])) ? $config['freePremium'] : true;
219220
$response = array(
220221
'session' => array(
221222
'fpstracking' => false,
@@ -227,7 +228,7 @@ function parseEvent($table1, $date, $table2) {
227228
'emailcoderequest' => false,
228229
'sessionkey' => $sessionKey,
229230
'lastlogintime' => 0,
230-
'ispremium' => ($account['premium_ends_at'] > time()) ? true : false,
231+
'ispremium' => ($account['premium_ends_at'] > time() || $freePremium) ? true : false,
231232
'premiumuntil' => $account['premium_ends_at'],
232233
'status' => 'active'
233234
),

0 commit comments

Comments
 (0)