From 6ee9078e0c3233824ceb20a38832b99ce56d3b21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20BENO=C3=8ET?= Date: Tue, 31 Dec 2024 00:25:05 +0100 Subject: [PATCH] fix: work on very basic PHP remediation --- admin/as_log.inc | 1 - admin/game_status.php | 14 ++++------ admin/ticks.php | 16 +++++------ scripts/game/admin/beta5/library.inc | 2 +- scripts/game/beta5/actions.inc | 2 +- scripts/game/beta5/alliance/library.inc | 2 +- .../beta5/alliance/library/acceptRequest.inc | 2 +- .../beta5/alliance/library/addCandidate.inc | 2 +- .../beta5/alliance/library/cancelRequest.inc | 2 +- .../beta5/alliance/library/changeRank.inc | 2 +- .../game/beta5/alliance/library/create.inc | 2 +- .../beta5/alliance/library/createForum.inc | 2 +- .../beta5/alliance/library/createRank.inc | 2 +- .../beta5/alliance/library/deleteForum.inc | 2 +- .../beta5/alliance/library/deleteRank.inc | 2 +- scripts/game/beta5/alliance/library/get.inc | 2 +- .../beta5/alliance/library/getCandidates.inc | 2 +- .../game/beta5/alliance/library/getForums.inc | 2 +- .../alliance/library/getForumsComplete.inc | 2 +- scripts/game/beta5/alliance/library/getId.inc | 2 +- .../beta5/alliance/library/getKeepers.inc | 2 +- .../beta5/alliance/library/getMembers.inc | 2 +- .../beta5/alliance/library/getMilitary.inc | 2 +- .../beta5/alliance/library/getPlanets.inc | 2 +- .../beta5/alliance/library/getPrivileges.inc | 2 +- .../alliance/library/getRankPrivileges.inc | 2 +- .../beta5/alliance/library/getRankSize.inc | 2 +- .../game/beta5/alliance/library/getRanks.inc | 2 +- scripts/game/beta5/fleet/library.inc | 2 +- scripts/game/beta5/fleet/library/getPower.inc | 2 +- scripts/game/beta5/library.inc | 2 +- scripts/game/beta5/library/getPlayerCount.inc | 2 +- .../game/beta5/library/getPlayerStatus.inc | 2 +- scripts/game/beta5/library/register.inc | 2 +- scripts/game/beta5/planet/library.inc | 2 +- .../beta5/planet/library/updateHappiness.inc | 2 +- .../planet/library/updateMaxPopulation.inc | 2 +- scripts/game/beta5/player/library/assign.inc | 2 +- .../beta5/player/library/getPlanetCount.inc | 2 +- .../game/beta5/player/library/getPower.inc | 2 +- scripts/game/beta5/rules/library.inc | 2 +- scripts/game/beta5/rules/library/get.inc | 3 +- scripts/game/beta5/ticks/universe/library.inc | 5 +++- scripts/game/main/account/library.inc | 2 +- .../main/account/library/createAccount.inc | 2 +- .../game/main/account/library/getKickList.inc | 2 +- .../game/main/account/library/getLanguage.inc | 2 +- .../main/account/library/getQuitCountdown.inc | 2 +- scripts/game/main/account/library/log.inc | 2 +- .../game/main/account/library/requestKick.inc | 2 +- .../main/account/library/setQuitCountdown.inc | 2 +- .../game/main/account/library/terminate.inc | 2 +- scripts/game/main/actions.inc | 2 +- scripts/game/main/actions/joinGame.inc | 2 +- scripts/game/main/actions/lostPassword.inc | 2 +- scripts/game/main/library.inc | 2 +- scripts/game/main/library/getTick.inc | 2 +- scripts/game/main/library/getTicks.inc | 2 +- scripts/game/main/library/isGameRunning.inc | 2 +- .../game/main/library/requestGenPlanets.inc | 2 +- scripts/game/main/library/sendMail.inc | 2 +- .../game/main/manual/library/getNavLinks.inc | 2 +- .../game/main/manual/library/getPageId.inc | 2 +- .../main/manual/library/getSectionsIn.inc | 2 +- .../game/main/manual/library/getStructure.inc | 2 +- .../game/main/manual/library/readXMLFile.inc | 2 +- scripts/game/main/manual/library/search.inc | 2 +- .../main/manual/library/updateSections.inc | 2 +- scripts/game/main/rankings/library.inc | 2 +- scripts/game/main/rankings/library/append.inc | 2 +- scripts/game/main/rankings/library/delete.inc | 2 +- scripts/game/main/rankings/library/getAll.inc | 2 +- scripts/game/main/rankings/library/update.inc | 2 +- scripts/game/main/ticks/day/library.inc | 2 +- scripts/game/main/vacation/library.inc | 2 +- scripts/game/main/vacation/library/canSet.inc | 2 +- scripts/game/main/vacation/library/leave.inc | 2 +- scripts/game/main/vacation/library/start.inc | 2 +- scripts/lib/actions.inc | 2 +- scripts/lib/ajax.inc | 2 +- scripts/lib/db_connection.inc | 4 +-- scripts/lib/game.inc | 4 +-- scripts/lib/library.inc | 6 ++-- scripts/lib/prefs.inc | 4 +-- scripts/lib/tracking.inc | 10 ++++++- scripts/site/main/layout/actual-header.en.inc | 12 ++++---- scripts/site/main/layout/lbox.en.inc | 16 +++++------ scripts/site/main/output/about.en.inc | 4 +-- scripts/site/main/output/account.en.inc | 10 +++---- scripts/site/main/output/annoy.en.inc | 2 +- scripts/site/main/output/b6pp.en.inc | 24 ++++++++-------- scripts/site/main/output/back_confirm.en.inc | 4 +-- scripts/site/main/output/confirm.en.inc | 4 +-- scripts/site/main/output/contrib.en.inc | 4 +-- scripts/site/main/output/create.en.inc | 4 +-- scripts/site/main/output/created.en.inc | 2 +- scripts/site/main/output/credits.en.inc | 4 +-- scripts/site/main/output/disclaimer.en.inc | 4 +-- scripts/site/main/output/index.en.inc | 4 +-- scripts/site/main/output/logout.en.inc | 4 +-- scripts/site/main/output/lostpass.en.inc | 6 ++-- scripts/site/main/output/manual-box.en.inc | 6 ++-- scripts/site/main/output/manual.en.inc | 28 +++++++++---------- scripts/site/main/output/menu.en.inc | 6 ++-- scripts/site/main/output/notfound.en.inc | 4 +-- scripts/site/main/output/notregistered.en.inc | 4 +-- scripts/site/main/output/play.en.inc | 4 +-- scripts/site/main/output/quit_confirm.en.inc | 4 +-- scripts/site/main/output/rankings.en.inc | 10 +++---- scripts/site/main/output/restart.en.inc | 4 +-- scripts/site/main/output/screenshots.en.inc | 8 +++--- scripts/site/main/output/settings.en.inc | 4 +-- scripts/site/main/output/side-box.en.inc | 4 +-- scripts/site/main/output/vac_cancel.en.inc | 4 +-- scripts/site/main/output/vac_leave.en.inc | 4 +-- scripts/site/main/output/vac_start.en.inc | 4 +-- scripts/ticks.php | 1 + 117 files changed, 216 insertions(+), 208 deletions(-) diff --git a/admin/as_log.inc b/admin/as_log.inc index 01c8fd6..bd35891 100644 --- a/admin/as_log.inc +++ b/admin/as_log.inc @@ -6,7 +6,6 @@ function __logAdmin($txt, $level = null) { if (!$logInit) { global $__logPrefix; - define_syslog_variables(); openlog("lwControl", LOG_PID, LOG_USER); $logInit = true; } diff --git a/admin/game_status.php b/admin/game_status.php index a1bdb17..afa556f 100644 --- a/admin/game_status.php +++ b/admin/game_status.php @@ -1,7 +1,5 @@ $game) {

Games can have the following status:

- + - + - + - + - + - +
The game is configured, but is hidden for now
The game is visible, but ticks have not started
The game is running normally
The game is still running but someone reached victory
The game is still available but is about to end.
The game is no longer running and only visible through the rankings page
diff --git a/admin/ticks.php b/admin/ticks.php index fe7a0ca..82ef87e 100644 --- a/admin/ticks.php +++ b/admin/ticks.php @@ -1,7 +1,5 @@

LWB5 > Administration > Ticks

Manager status

-

Tick manager status: Tick manager status: not running - Start manager - running, process ID # - Kill manager
- Ticks status change pending; please reload the page.
This can take up to 20 seconds, be patient. - Ticks are active - Disable ticks - Ticks are inactive - Enable ticks - -lib = $lib; $this->db = $this->lib->game->db; $this->msgs = $this->lib->game->getLib('beta5/msg'); diff --git a/scripts/game/beta5/actions.inc b/scripts/game/beta5/actions.inc index 824c036..893f5fa 100644 --- a/scripts/game/beta5/actions.inc +++ b/scripts/game/beta5/actions.inc @@ -30,7 +30,7 @@ class actions_beta5 { var $ePower = array(); - function actions_beta5($game) { + public function __construct($game) { $this->game = $game; $this->lib = $game->getLib(); $this->alliance = $game->getLib('beta5/alliance'); diff --git a/scripts/game/beta5/alliance/library.inc b/scripts/game/beta5/alliance/library.inc index 878a167..dee4f41 100644 --- a/scripts/game/beta5/alliance/library.inc +++ b/scripts/game/beta5/alliance/library.inc @@ -53,7 +53,7 @@ class beta5_alliance_library { ); - function beta5_alliance_library($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/alliance/library/acceptRequest.inc b/scripts/game/beta5/alliance/library/acceptRequest.inc index 1231c60..7ba108c 100644 --- a/scripts/game/beta5/alliance/library/acceptRequest.inc +++ b/scripts/game/beta5/alliance/library/acceptRequest.inc @@ -2,7 +2,7 @@ class beta5_alliance_acceptRequest { - function beta5_alliance_acceptRequest($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; $this->msgs = $this->lib->game->getLib('beta5/msg'); diff --git a/scripts/game/beta5/alliance/library/addCandidate.inc b/scripts/game/beta5/alliance/library/addCandidate.inc index 0861447..e807ace 100644 --- a/scripts/game/beta5/alliance/library/addCandidate.inc +++ b/scripts/game/beta5/alliance/library/addCandidate.inc @@ -2,7 +2,7 @@ class beta5_alliance_addCandidate { - function beta5_alliance_addCandidate($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/alliance/library/cancelRequest.inc b/scripts/game/beta5/alliance/library/cancelRequest.inc index 9af40d6..bd15d09 100644 --- a/scripts/game/beta5/alliance/library/cancelRequest.inc +++ b/scripts/game/beta5/alliance/library/cancelRequest.inc @@ -2,7 +2,7 @@ class beta5_alliance_cancelRequest { - function beta5_alliance_cancelRequest($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/alliance/library/changeRank.inc b/scripts/game/beta5/alliance/library/changeRank.inc index 33970d9..3406a88 100644 --- a/scripts/game/beta5/alliance/library/changeRank.inc +++ b/scripts/game/beta5/alliance/library/changeRank.inc @@ -2,7 +2,7 @@ class beta5_alliance_changeRank { - function beta5_alliance_changeRank($lib) { + public function __construct($lib) { $this->lib = $lib; $this->game = $this->lib->game; $this->db = $this->game->db; diff --git a/scripts/game/beta5/alliance/library/create.inc b/scripts/game/beta5/alliance/library/create.inc index 38b5ff3..5463fc6 100644 --- a/scripts/game/beta5/alliance/library/create.inc +++ b/scripts/game/beta5/alliance/library/create.inc @@ -2,7 +2,7 @@ class beta5_alliance_create { - function beta5_alliance_create($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/alliance/library/createForum.inc b/scripts/game/beta5/alliance/library/createForum.inc index ad64a31..cef3acc 100644 --- a/scripts/game/beta5/alliance/library/createForum.inc +++ b/scripts/game/beta5/alliance/library/createForum.inc @@ -2,7 +2,7 @@ class beta5_alliance_createForum { - function beta5_alliance_createForum($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/alliance/library/createRank.inc b/scripts/game/beta5/alliance/library/createRank.inc index a9a6a71..d6d73c8 100644 --- a/scripts/game/beta5/alliance/library/createRank.inc +++ b/scripts/game/beta5/alliance/library/createRank.inc @@ -2,7 +2,7 @@ class beta5_alliance_createRank { - function beta5_alliance_createRank($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/alliance/library/deleteForum.inc b/scripts/game/beta5/alliance/library/deleteForum.inc index 0b048bc..717a8e8 100644 --- a/scripts/game/beta5/alliance/library/deleteForum.inc +++ b/scripts/game/beta5/alliance/library/deleteForum.inc @@ -2,7 +2,7 @@ class beta5_alliance_deleteForum { - function beta5_alliance_deleteForum($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/alliance/library/deleteRank.inc b/scripts/game/beta5/alliance/library/deleteRank.inc index fe1b5e0..7b46f36 100644 --- a/scripts/game/beta5/alliance/library/deleteRank.inc +++ b/scripts/game/beta5/alliance/library/deleteRank.inc @@ -2,7 +2,7 @@ class beta5_alliance_deleteRank { - function beta5_alliance_deleteRank($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/alliance/library/get.inc b/scripts/game/beta5/alliance/library/get.inc index 6590b6b..2277147 100644 --- a/scripts/game/beta5/alliance/library/get.inc +++ b/scripts/game/beta5/alliance/library/get.inc @@ -2,7 +2,7 @@ class beta5_alliance_get { - function beta5_alliance_get($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/alliance/library/getCandidates.inc b/scripts/game/beta5/alliance/library/getCandidates.inc index 9699835..530cb53 100644 --- a/scripts/game/beta5/alliance/library/getCandidates.inc +++ b/scripts/game/beta5/alliance/library/getCandidates.inc @@ -2,7 +2,7 @@ class beta5_alliance_getCandidates { - function beta5_alliance_getCandidates($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/alliance/library/getForums.inc b/scripts/game/beta5/alliance/library/getForums.inc index a31a755..81f16a9 100644 --- a/scripts/game/beta5/alliance/library/getForums.inc +++ b/scripts/game/beta5/alliance/library/getForums.inc @@ -2,7 +2,7 @@ class beta5_alliance_getForums { - function beta5_alliance_getForums($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/alliance/library/getForumsComplete.inc b/scripts/game/beta5/alliance/library/getForumsComplete.inc index 7b6e333..c855d22 100644 --- a/scripts/game/beta5/alliance/library/getForumsComplete.inc +++ b/scripts/game/beta5/alliance/library/getForumsComplete.inc @@ -2,7 +2,7 @@ class beta5_alliance_getForumsComplete { - function beta5_alliance_getForumsComplete($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; $this->players = $this->lib->game->getLib('beta5/player'); diff --git a/scripts/game/beta5/alliance/library/getId.inc b/scripts/game/beta5/alliance/library/getId.inc index 89d4316..6582aad 100644 --- a/scripts/game/beta5/alliance/library/getId.inc +++ b/scripts/game/beta5/alliance/library/getId.inc @@ -2,7 +2,7 @@ class beta5_alliance_getId { - function beta5_alliance_getId($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/alliance/library/getKeepers.inc b/scripts/game/beta5/alliance/library/getKeepers.inc index 92ca0c3..c951e3b 100644 --- a/scripts/game/beta5/alliance/library/getKeepers.inc +++ b/scripts/game/beta5/alliance/library/getKeepers.inc @@ -2,7 +2,7 @@ class beta5_alliance_getKeepers { - function beta5_alliance_getKeepers($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/alliance/library/getMembers.inc b/scripts/game/beta5/alliance/library/getMembers.inc index 1712961..d45d211 100644 --- a/scripts/game/beta5/alliance/library/getMembers.inc +++ b/scripts/game/beta5/alliance/library/getMembers.inc @@ -2,7 +2,7 @@ class beta5_alliance_getMembers { - function beta5_alliance_getMembers($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/alliance/library/getMilitary.inc b/scripts/game/beta5/alliance/library/getMilitary.inc index d8241a8..b5e9a2b 100644 --- a/scripts/game/beta5/alliance/library/getMilitary.inc +++ b/scripts/game/beta5/alliance/library/getMilitary.inc @@ -2,7 +2,7 @@ class beta5_alliance_getMilitary { - function beta5_alliance_getMilitary($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/alliance/library/getPlanets.inc b/scripts/game/beta5/alliance/library/getPlanets.inc index 8fb2dc7..a7b0651 100644 --- a/scripts/game/beta5/alliance/library/getPlanets.inc +++ b/scripts/game/beta5/alliance/library/getPlanets.inc @@ -2,7 +2,7 @@ class beta5_alliance_getPlanets { - function beta5_alliance_getPlanets($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; $this->planets = $this->lib->game->getLib('beta5/planet'); diff --git a/scripts/game/beta5/alliance/library/getPrivileges.inc b/scripts/game/beta5/alliance/library/getPrivileges.inc index 15e6ad4..35ed3e4 100644 --- a/scripts/game/beta5/alliance/library/getPrivileges.inc +++ b/scripts/game/beta5/alliance/library/getPrivileges.inc @@ -2,7 +2,7 @@ class beta5_alliance_getPrivileges { - function beta5_alliance_getPrivileges($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; $this->players = $this->lib->game->getLib('beta5/player'); diff --git a/scripts/game/beta5/alliance/library/getRankPrivileges.inc b/scripts/game/beta5/alliance/library/getRankPrivileges.inc index e201fd1..b09259d 100644 --- a/scripts/game/beta5/alliance/library/getRankPrivileges.inc +++ b/scripts/game/beta5/alliance/library/getRankPrivileges.inc @@ -2,7 +2,7 @@ class beta5_alliance_getRankPrivileges { - function beta5_alliance_getRankPrivileges($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/alliance/library/getRankSize.inc b/scripts/game/beta5/alliance/library/getRankSize.inc index d6eb75d..bd5c00f 100644 --- a/scripts/game/beta5/alliance/library/getRankSize.inc +++ b/scripts/game/beta5/alliance/library/getRankSize.inc @@ -2,7 +2,7 @@ class beta5_alliance_getRankSize { - function beta5_alliance_getRankSize($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/alliance/library/getRanks.inc b/scripts/game/beta5/alliance/library/getRanks.inc index cdc5aa0..ec38369 100644 --- a/scripts/game/beta5/alliance/library/getRanks.inc +++ b/scripts/game/beta5/alliance/library/getRanks.inc @@ -2,7 +2,7 @@ class beta5_alliance_getRanks { - function beta5_alliance_getRanks($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/fleet/library.inc b/scripts/game/beta5/fleet/library.inc index d58e1cd..9cdc6ed 100644 --- a/scripts/game/beta5/fleet/library.inc +++ b/scripts/game/beta5/fleet/library.inc @@ -23,7 +23,7 @@ class beta5_fleet_library { ); - function beta5_fleet_library($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/fleet/library/getPower.inc b/scripts/game/beta5/fleet/library/getPower.inc index 285e826..4a84104 100644 --- a/scripts/game/beta5/fleet/library/getPower.inc +++ b/scripts/game/beta5/fleet/library/getPower.inc @@ -3,7 +3,7 @@ class beta5_fleet_getPower { var $ePower = array(); - function beta5_fleet_getPower($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; $this->rules = $this->lib->game->getLib('beta5/rules'); diff --git a/scripts/game/beta5/library.inc b/scripts/game/beta5/library.inc index c101031..f5777fa 100644 --- a/scripts/game/beta5/library.inc +++ b/scripts/game/beta5/library.inc @@ -17,7 +17,7 @@ class beta5_library { 'updateRankings' ); - function beta5_library($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/library/getPlayerCount.inc b/scripts/game/beta5/library/getPlayerCount.inc index 17d7e9c..b81b589 100644 --- a/scripts/game/beta5/library/getPlayerCount.inc +++ b/scripts/game/beta5/library/getPlayerCount.inc @@ -2,7 +2,7 @@ class beta5_getPlayerCount { - function beta5_getPlayerCount($lib) { + function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/library/getPlayerStatus.inc b/scripts/game/beta5/library/getPlayerStatus.inc index e3519a7..737f9c8 100644 --- a/scripts/game/beta5/library/getPlayerStatus.inc +++ b/scripts/game/beta5/library/getPlayerStatus.inc @@ -2,7 +2,7 @@ class beta5_getPlayerStatus { - function beta5_getPlayerStatus($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/library/register.inc b/scripts/game/beta5/library/register.inc index 2c63fa0..7b1a367 100644 --- a/scripts/game/beta5/library/register.inc +++ b/scripts/game/beta5/library/register.inc @@ -2,7 +2,7 @@ class beta5_register { - function beta5_register($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/planet/library.inc b/scripts/game/beta5/planet/library.inc index ebfa128..db6758c 100644 --- a/scripts/game/beta5/planet/library.inc +++ b/scripts/game/beta5/planet/library.inc @@ -22,7 +22,7 @@ class beta5_planet_library { ); - function beta5_planet_library($lib) { + public function __construct($lib) { $this->lib = $lib; $this->game = $this->lib->game; $this->db = $this->game->db; diff --git a/scripts/game/beta5/planet/library/updateHappiness.inc b/scripts/game/beta5/planet/library/updateHappiness.inc index d1efce8..3b795ac 100644 --- a/scripts/game/beta5/planet/library/updateHappiness.inc +++ b/scripts/game/beta5/planet/library/updateHappiness.inc @@ -3,7 +3,7 @@ class beta5_planet_updateHappiness { var $avgFPower = null; - function beta5_planet_updateHappiness($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; $this->players = $this->lib->game->getLib('beta5/player'); diff --git a/scripts/game/beta5/planet/library/updateMaxPopulation.inc b/scripts/game/beta5/planet/library/updateMaxPopulation.inc index d7c92e8..7c0328c 100644 --- a/scripts/game/beta5/planet/library/updateMaxPopulation.inc +++ b/scripts/game/beta5/planet/library/updateMaxPopulation.inc @@ -3,7 +3,7 @@ class beta5_planet_updateMaxPopulation { var $maxPops = array(); - function beta5_planet_updateMaxPopulation($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; $this->rules = $this->lib->game->getLib('beta5/rules'); diff --git a/scripts/game/beta5/player/library/assign.inc b/scripts/game/beta5/player/library/assign.inc index 6419e42..8bffdf8 100644 --- a/scripts/game/beta5/player/library/assign.inc +++ b/scripts/game/beta5/player/library/assign.inc @@ -2,7 +2,7 @@ class beta5_player_assign { - function beta5_player_assign($lib) { + public function __construct($lib) { $this->lib = $lib; $this->game = $this->lib->game; $this->db = $this->game->db; diff --git a/scripts/game/beta5/player/library/getPlanetCount.inc b/scripts/game/beta5/player/library/getPlanetCount.inc index 4fba164..029ae33 100644 --- a/scripts/game/beta5/player/library/getPlanetCount.inc +++ b/scripts/game/beta5/player/library/getPlanetCount.inc @@ -3,7 +3,7 @@ class beta5_player_getPlanetCount { var $pPlanets = array(); - function beta5_player_getPlanetCount($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/player/library/getPower.inc b/scripts/game/beta5/player/library/getPower.inc index f19dae1..bcaaa1f 100644 --- a/scripts/game/beta5/player/library/getPower.inc +++ b/scripts/game/beta5/player/library/getPower.inc @@ -3,7 +3,7 @@ class beta5_player_getPower { var $pFleets = array(); - function beta5_player_getPower($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; $this->fleets = $this->lib->game->getLib('beta5/fleet'); diff --git a/scripts/game/beta5/rules/library.inc b/scripts/game/beta5/rules/library.inc index 8b38cf1..5a54ffd 100644 --- a/scripts/game/beta5/rules/library.inc +++ b/scripts/game/beta5/rules/library.inc @@ -7,7 +7,7 @@ class beta5_rules_library { ); - function beta5_rules_library($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; $this->planets = $this->lib->game->getLib('beta5/planet'); diff --git a/scripts/game/beta5/rules/library/get.inc b/scripts/game/beta5/rules/library/get.inc index 9dc9f83..d265dca 100644 --- a/scripts/game/beta5/rules/library/get.inc +++ b/scripts/game/beta5/rules/library/get.inc @@ -1,7 +1,8 @@ lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/ticks/universe/library.inc b/scripts/game/beta5/ticks/universe/library.inc index 9afdfd2..fb77a16 100644 --- a/scripts/game/beta5/ticks/universe/library.inc +++ b/scripts/game/beta5/ticks/universe/library.inc @@ -24,6 +24,7 @@ class beta5_ticks_universe_library { // Run a special version of the tick if we are using a CTF map $map = (int) $this->game->params['usemap']; if ($map > 0) { + l::debug("handling CTF map"); $this->handleCTFMap($map); return; } @@ -40,6 +41,7 @@ class beta5_ticks_universe_library { if ($this->maxSystems) { $ns = $this->getAllSystems(); if ($ns >= $this->maxSystems) { + l::debug("max system count reached"); return; } } @@ -47,7 +49,8 @@ class beta5_ticks_universe_library { // Get the amount of free systems $this->reassignEmpty(); $ns = $this->getFreeSystems(); - if ($ns >= $this->minSystems) { + if (!is_null($this->minSystems) && $ns >= $this->minSystems) { + l::debug("$ns systems are available, exiting"); return; } diff --git a/scripts/game/main/account/library.inc b/scripts/game/main/account/library.inc index 0ba1b44..8295afd 100644 --- a/scripts/game/main/account/library.inc +++ b/scripts/game/main/account/library.inc @@ -15,7 +15,7 @@ class main_account_library { 'terminate' ); - function main_account_library($lib) { + function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/account/library/createAccount.inc b/scripts/game/main/account/library/createAccount.inc index 8d715c9..fe7fa6e 100644 --- a/scripts/game/main/account/library/createAccount.inc +++ b/scripts/game/main/account/library/createAccount.inc @@ -2,7 +2,7 @@ class main_account_createAccount { - function main_account_createAccount($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/account/library/getKickList.inc b/scripts/game/main/account/library/getKickList.inc index bcf1725..2049b1e 100644 --- a/scripts/game/main/account/library/getKickList.inc +++ b/scripts/game/main/account/library/getKickList.inc @@ -2,7 +2,7 @@ class main_account_getKickList { - function main_account_getKickList($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/account/library/getLanguage.inc b/scripts/game/main/account/library/getLanguage.inc index 1a20164..9e65168 100644 --- a/scripts/game/main/account/library/getLanguage.inc +++ b/scripts/game/main/account/library/getLanguage.inc @@ -2,7 +2,7 @@ class main_account_getLanguage { - function main_account_getLanguage($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/account/library/getQuitCountdown.inc b/scripts/game/main/account/library/getQuitCountdown.inc index a533670..e057e4f 100644 --- a/scripts/game/main/account/library/getQuitCountdown.inc +++ b/scripts/game/main/account/library/getQuitCountdown.inc @@ -2,7 +2,7 @@ class main_account_getQuitCountdown { - function main_account_getQuitCountdown($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/account/library/log.inc b/scripts/game/main/account/library/log.inc index 1baefe0..e7c0904 100644 --- a/scripts/game/main/account/library/log.inc +++ b/scripts/game/main/account/library/log.inc @@ -16,7 +16,7 @@ class main_account_log { - function main_account_log($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/account/library/requestKick.inc b/scripts/game/main/account/library/requestKick.inc index 729cf63..f771f54 100644 --- a/scripts/game/main/account/library/requestKick.inc +++ b/scripts/game/main/account/library/requestKick.inc @@ -2,7 +2,7 @@ class main_account_requestKick { - function main_account_requestKick($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/account/library/setQuitCountdown.inc b/scripts/game/main/account/library/setQuitCountdown.inc index 85eadff..b1d70cc 100644 --- a/scripts/game/main/account/library/setQuitCountdown.inc +++ b/scripts/game/main/account/library/setQuitCountdown.inc @@ -2,7 +2,7 @@ class main_account_setQuitCountdown { - function main_account_setQuitCountdown($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/account/library/terminate.inc b/scripts/game/main/account/library/terminate.inc index 68425f0..1fad8bb 100644 --- a/scripts/game/main/account/library/terminate.inc +++ b/scripts/game/main/account/library/terminate.inc @@ -2,7 +2,7 @@ class main_account_terminate { - function main_account_terminate($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/actions.inc b/scripts/game/main/actions.inc index 2c1d783..d3be747 100644 --- a/scripts/game/main/actions.inc +++ b/scripts/game/main/actions.inc @@ -11,7 +11,7 @@ class actions_main { ); - function actions_main($game) { + function __construct($game) { $this->game = $game; $this->main = $this->game->getLib('main'); $this->accounts = $this->game->getLib('main/account'); diff --git a/scripts/game/main/actions/joinGame.inc b/scripts/game/main/actions/joinGame.inc index 097a09b..e1d02aa 100644 --- a/scripts/game/main/actions/joinGame.inc +++ b/scripts/game/main/actions/joinGame.inc @@ -49,7 +49,7 @@ */ class main_joinGame { - function main_joinGame($main) { + public function __construct($main) { $this->main = $main; $this->lib = $this->main->getLib(); } diff --git a/scripts/game/main/actions/lostPassword.inc b/scripts/game/main/actions/lostPassword.inc index c7d8070..2c25340 100644 --- a/scripts/game/main/actions/lostPassword.inc +++ b/scripts/game/main/actions/lostPassword.inc @@ -10,7 +10,7 @@ */ class main_lostPassword { - function main_lostPassword($main) { + public function __construct($main) { $this->main = $main; $this->db = $this->main->db; $this->lib = $this->main->getLib(); diff --git a/scripts/game/main/library.inc b/scripts/game/main/library.inc index 9dffe28..ce2a3aa 100644 --- a/scripts/game/main/library.inc +++ b/scripts/game/main/library.inc @@ -11,7 +11,7 @@ class main_library { ); - function main_library($lib) { + function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/library/getTick.inc b/scripts/game/main/library/getTick.inc index ba1a124..d37e17a 100644 --- a/scripts/game/main/library/getTick.inc +++ b/scripts/game/main/library/getTick.inc @@ -2,7 +2,7 @@ class main_getTick { - function main_getTick($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/library/getTicks.inc b/scripts/game/main/library/getTicks.inc index ec5d3a4..4fde4f4 100644 --- a/scripts/game/main/library/getTicks.inc +++ b/scripts/game/main/library/getTicks.inc @@ -2,7 +2,7 @@ class main_getTicks { - function main_getTicks($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/library/isGameRunning.inc b/scripts/game/main/library/isGameRunning.inc index c3676db..02a7ad1 100644 --- a/scripts/game/main/library/isGameRunning.inc +++ b/scripts/game/main/library/isGameRunning.inc @@ -2,7 +2,7 @@ class main_isGameRunning { - function main_isGameRunning($lib) { + public function __construct($lib) { $this->lib = $lib; } diff --git a/scripts/game/main/library/requestGenPlanets.inc b/scripts/game/main/library/requestGenPlanets.inc index 3b689c4..94aad87 100644 --- a/scripts/game/main/library/requestGenPlanets.inc +++ b/scripts/game/main/library/requestGenPlanets.inc @@ -2,7 +2,7 @@ class main_requestGenPlanets { - function main_requestGenPlanets($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/library/sendMail.inc b/scripts/game/main/library/sendMail.inc index 8c8da9d..e69fd02 100644 --- a/scripts/game/main/library/sendMail.inc +++ b/scripts/game/main/library/sendMail.inc @@ -2,7 +2,7 @@ class main_sendMail { - function main_sendMail($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/manual/library/getNavLinks.inc b/scripts/game/main/manual/library/getNavLinks.inc index 75ce80a..414f03c 100644 --- a/scripts/game/main/manual/library/getNavLinks.inc +++ b/scripts/game/main/manual/library/getNavLinks.inc @@ -2,7 +2,7 @@ class main_manual_getNavLinks { - function main_manual_getNavLinks($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/manual/library/getPageId.inc b/scripts/game/main/manual/library/getPageId.inc index 10bc6dd..117d3ba 100644 --- a/scripts/game/main/manual/library/getPageId.inc +++ b/scripts/game/main/manual/library/getPageId.inc @@ -2,7 +2,7 @@ class main_manual_getPageId { - function main_manual_getPageId($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/manual/library/getSectionsIn.inc b/scripts/game/main/manual/library/getSectionsIn.inc index ea1ede1..b6ec085 100644 --- a/scripts/game/main/manual/library/getSectionsIn.inc +++ b/scripts/game/main/manual/library/getSectionsIn.inc @@ -2,7 +2,7 @@ class main_manual_getSectionsIn { - function main_manual_getSectionsIn($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/manual/library/getStructure.inc b/scripts/game/main/manual/library/getStructure.inc index 2ec791a..22068ea 100644 --- a/scripts/game/main/manual/library/getStructure.inc +++ b/scripts/game/main/manual/library/getStructure.inc @@ -2,7 +2,7 @@ class main_manual_getStructure { - function main_manual_getStructure($lib) { + function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; $this->version = $this->lib->mainClass->version; diff --git a/scripts/game/main/manual/library/readXMLFile.inc b/scripts/game/main/manual/library/readXMLFile.inc index 831836c..06f8460 100644 --- a/scripts/game/main/manual/library/readXMLFile.inc +++ b/scripts/game/main/manual/library/readXMLFile.inc @@ -2,7 +2,7 @@ class main_manual_readXMLFile { - function main_manual_readXMLFile($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/manual/library/search.inc b/scripts/game/main/manual/library/search.inc index 1a1050b..c531fac 100644 --- a/scripts/game/main/manual/library/search.inc +++ b/scripts/game/main/manual/library/search.inc @@ -2,7 +2,7 @@ class main_manual_search { - function main_manual_search($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/manual/library/updateSections.inc b/scripts/game/main/manual/library/updateSections.inc index e8c0177..7db2b58 100644 --- a/scripts/game/main/manual/library/updateSections.inc +++ b/scripts/game/main/manual/library/updateSections.inc @@ -2,7 +2,7 @@ class main_manual_updateSections { - function main_manual_updateSections($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/rankings/library.inc b/scripts/game/main/rankings/library.inc index 8fcb315..043dcb8 100644 --- a/scripts/game/main/rankings/library.inc +++ b/scripts/game/main/rankings/library.inc @@ -8,7 +8,7 @@ class main_rankings_library { 'update' ); - function main_rankings_library($lib) { + function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/rankings/library/append.inc b/scripts/game/main/rankings/library/append.inc index 946c260..5f9c6f0 100644 --- a/scripts/game/main/rankings/library/append.inc +++ b/scripts/game/main/rankings/library/append.inc @@ -2,7 +2,7 @@ class main_rankings_append { - function main_rankings_append($lib) { + function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/rankings/library/delete.inc b/scripts/game/main/rankings/library/delete.inc index b0136e0..a74c8f5 100644 --- a/scripts/game/main/rankings/library/delete.inc +++ b/scripts/game/main/rankings/library/delete.inc @@ -2,7 +2,7 @@ class main_rankings_delete { - function main_rankings_delete($lib) { + function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/rankings/library/getAll.inc b/scripts/game/main/rankings/library/getAll.inc index 15271dc..7f6514c 100644 --- a/scripts/game/main/rankings/library/getAll.inc +++ b/scripts/game/main/rankings/library/getAll.inc @@ -2,7 +2,7 @@ class main_rankings_getAll { - function main_rankings_getAll($lib) { + function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/rankings/library/update.inc b/scripts/game/main/rankings/library/update.inc index 2f0d315..8803785 100644 --- a/scripts/game/main/rankings/library/update.inc +++ b/scripts/game/main/rankings/library/update.inc @@ -2,7 +2,7 @@ class main_rankings_update { - function main_rankings_update($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/ticks/day/library.inc b/scripts/game/main/ticks/day/library.inc index dee0085..510cb2b 100644 --- a/scripts/game/main/ticks/day/library.inc +++ b/scripts/game/main/ticks/day/library.inc @@ -9,7 +9,7 @@ class main_ticks_day_library { - function main_ticks_day_library($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; $this->main = $this->lib->game->getLib(); diff --git a/scripts/game/main/vacation/library.inc b/scripts/game/main/vacation/library.inc index 27d2d07..e43ba63 100644 --- a/scripts/game/main/vacation/library.inc +++ b/scripts/game/main/vacation/library.inc @@ -7,7 +7,7 @@ class main_vacation_library { 'leave' ); - function main_vacation_library($lib) { + function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/vacation/library/canSet.inc b/scripts/game/main/vacation/library/canSet.inc index cc49d86..6cb5fcc 100644 --- a/scripts/game/main/vacation/library/canSet.inc +++ b/scripts/game/main/vacation/library/canSet.inc @@ -2,7 +2,7 @@ class main_vacation_canSet { - function main_vacation_canSet($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/vacation/library/leave.inc b/scripts/game/main/vacation/library/leave.inc index 8644824..8ba433e 100644 --- a/scripts/game/main/vacation/library/leave.inc +++ b/scripts/game/main/vacation/library/leave.inc @@ -2,7 +2,7 @@ class main_vacation_leave { - function main_vacation_leave($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; $this->accounts =& $this->lib->game->getLib('main/account'); diff --git a/scripts/game/main/vacation/library/start.inc b/scripts/game/main/vacation/library/start.inc index 826f1da..a0a3a6f 100644 --- a/scripts/game/main/vacation/library/start.inc +++ b/scripts/game/main/vacation/library/start.inc @@ -2,7 +2,7 @@ class main_vacation_start { - function main_vacation_start($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; $this->accounts = $this->lib->game->getLib('main/account'); diff --git a/scripts/lib/actions.inc b/scripts/lib/actions.inc index 1b4a132..0b1899b 100644 --- a/scripts/lib/actions.inc +++ b/scripts/lib/actions.inc @@ -49,7 +49,7 @@ abstract class game_action { /** The __get() overload method is useful to access the * libraries associated with this game action. */ - protected function __get($var) { + public function __get($var) { if (array_key_exists($var, $this->__libraries)) { return $this->__libraries[$var]; } diff --git a/scripts/lib/ajax.inc b/scripts/lib/ajax.inc index 15ed221..c28d6aa 100644 --- a/scripts/lib/ajax.inc +++ b/scripts/lib/ajax.inc @@ -8,7 +8,7 @@ class ajax { static $fTheme = array(); static $init = ""; - function getTheme() { + private static function getTheme() { $f = getLayoutDirectory(input::$game->version->id) . "/ajax.inc"; if (!file_exists($f)) { return array(); diff --git a/scripts/lib/db_connection.inc b/scripts/lib/db_connection.inc index 7f89f90..4cfc166 100644 --- a/scripts/lib/db_connection.inc +++ b/scripts/lib/db_connection.inc @@ -38,7 +38,7 @@ class db_deadlock_exception extends Exception { class db { static $database = null; - static $accessors = array(); + private $accessors = array(); private $isOpen = false; private $cString = ''; @@ -137,7 +137,7 @@ class db { $this->end(); @pg_close($this->conn); $this->isOpen = false; - self::$accessors = array(); + $this->accessors = array(); if ($this->queries >= 20) { l::debug("SQL: connection closed after {$this->queries} queries"); diff --git a/scripts/lib/game.inc b/scripts/lib/game.inc index 49f0c71..1ef41f0 100644 --- a/scripts/lib/game.inc +++ b/scripts/lib/game.inc @@ -128,7 +128,7 @@ class game { $lib = $this->version->id; } - if (is_null($this->libraries[$lib])) { + if (!isset($this->libraries[$lib])) { $this->libraries[$lib] = new library($lib, $this); } $this->getDBAccess(); @@ -230,7 +230,7 @@ class game { $this->initExternal(); } - function sessName() { + public static function sessName() { if (class_exists('input')) { return input::$game->name . "_data"; } diff --git a/scripts/lib/library.inc b/scripts/lib/library.inc index 5d6c696..2217112 100644 --- a/scripts/lib/library.inc +++ b/scripts/lib/library.inc @@ -6,12 +6,12 @@ class library { var $mainClass = null; var $functions = array(); - function library($name, $game) { + function __construct($name, $game) { $this->name = $name; $this->game = $game; } - function loadClass($name = null) { + private function loadClass($name = null) { // Get the path to the class to be loaded $path = config::$main['scriptdir'] . "/game/{$this->name}/library"; if (!is_null($name)) { @@ -28,7 +28,7 @@ class library { return $cn; } - function call() { + public function call() { $n = func_num_args(); if ($n == 0) { l::fatal(22, "Empty library call for library '{$this->name}' on game '{$this->game->game['site_path']}'"); diff --git a/scripts/lib/prefs.inc b/scripts/lib/prefs.inc index e769fde..0670938 100644 --- a/scripts/lib/prefs.inc +++ b/scripts/lib/prefs.inc @@ -36,7 +36,7 @@ class prefs { private static function getDefaults() { prefs::$prefs = array(); $qr = dbQuery("SELECT id,version,value FROM user_preferences WHERE account=0"); - if (!$qr || !count($qr)) { + if (!$qr || !pg_num_rows($qr)) { return; } prefs::fromBase($qr); @@ -46,7 +46,7 @@ class prefs { /** This function reads the current user's preferences from the base. */ private static function loadUser() { $qr = dbQuery("SELECT id,version,value FROM user_preferences WHERE account={$_SESSION['userid']}"); - if (!$qr || !count($qr)) { + if (!$qr || !pg_num_rows($qr)) { return; } prefs::fromBase($qr, true); diff --git a/scripts/lib/tracking.inc b/scripts/lib/tracking.inc index 64d1c14..4f70bc6 100644 --- a/scripts/lib/tracking.inc +++ b/scripts/lib/tracking.inc @@ -144,7 +144,15 @@ class tracking { } if (tracking::readData()) { - setcookie(tracking::$cName, $trackId, time() + 31536000, dirname($_SERVER['SCRIPT_NAME'])); + setcookie( + tracking::$cName, + $trackId, + [ + 'expires' => time() + 31536000, + 'path' => dirname($_SERVER['SCRIPT_NAME']), + 'samesite' => 'strict', + ] + ); } else { $trackDBId = tracking::$dbId; l::fatal(5, "Tracking data: ID='$trackId',DB ID=$trackDBId" . ($trackNew ? ",new" : "")); diff --git a/scripts/site/main/layout/actual-header.en.inc b/scripts/site/main/layout/actual-header.en.inc index 3bc84a6..f2e7e21 100644 --- a/scripts/site/main/layout/actual-header.en.inc +++ b/scripts/site/main/layout/actual-header.en.inc @@ -1,10 +1,10 @@ Legacy Worlds<?= is_null($this->title) ? "" : " - {$this->title}" ?> -cssRes) ) : ?> +cssRes) ) : ?> ?id=cssRes ?>' /> - -jsRes) ) : ?> + +jsRes) ) : ?> - + @@ -17,5 +17,5 @@ engine v - revision -

-
+
+
diff --git a/scripts/site/main/layout/lbox.en.inc b/scripts/site/main/layout/lbox.en.inc index f52bce8..042ec4d 100644 --- a/scripts/site/main/layout/lbox.en.inc +++ b/scripts/site/main/layout/lbox.en.inc @@ -1,20 +1,20 @@ - + Welcome,
- + Vacation mode activated - +
Preferences
Log out - - + +
- +
- + Username:
Password:
Forgot your password?
- + diff --git a/scripts/site/main/output/about.en.inc b/scripts/site/main/output/about.en.inc index 4a20d0a..22bc71b 100644 --- a/scripts/site/main/output/about.en.inc +++ b/scripts/site/main/output/about.en.inc @@ -1,4 +1,4 @@ -title = "About Legacy Worlds"; $this->addStylesheet('text'); @@ -39,4 +39,4 @@ $this->startContents(); GP Manager Pro is DeepClone's latest project, a game in which you play as the manager of a Grand Prix team.

-endContents(); ?> +endContents(); ?> diff --git a/scripts/site/main/output/account.en.inc b/scripts/site/main/output/account.en.inc index 7ef8ee9..7d58259 100644 --- a/scripts/site/main/output/account.en.inc +++ b/scripts/site/main/output/account.en.inc @@ -1,4 +1,4 @@ -title = "My account"; $this->addScript("account"); @@ -73,9 +73,9 @@ function displayRegistered($a) { ?>
@@ -89,7 +89,7 @@ $onVacation = ($vac['status'] == 'VAC'); if (count($args['play'])) { echo "

You are currently playing the following games:

\n"; displayRegistered($args['play']); - if (count($args['other'])) { + if (isset($args['other']) && count($args['other'])) { if ($onVacation) { echo "

Other games are available, but you must exit vacation mode to see them.

\n"; } elseif (!$_SESSION['show_unregistered']) { @@ -133,7 +133,7 @@ if ($args['leech']) { ?>
- diff --git a/scripts/site/main/output/annoy.en.inc b/scripts/site/main/output/annoy.en.inc index 282165e..791bb9c 100644 --- a/scripts/site/main/output/annoy.en.inc +++ b/scripts/site/main/output/annoy.en.inc @@ -1,4 +1,4 @@ -title = "Please contribute"; $this->addStylesheet('annoy'); $this->addScript('annoy'); diff --git a/scripts/site/main/output/b6pp.en.inc b/scripts/site/main/output/b6pp.en.inc index f346734..401678e 100644 --- a/scripts/site/main/output/b6pp.en.inc +++ b/scripts/site/main/output/b6pp.en.inc @@ -1,4 +1,4 @@ -title = 'Beta 6 planets'; $this->addStylesheet('b6pp'); @@ -30,7 +30,7 @@ $this->startContents();

Beta 6 planet pictures

Rate a picture - Top ratings - You rated out of pictures.

 

- +

There are no more pictures for you to rate

It would seem that you have rated all of the currently available pictures. @@ -38,7 +38,7 @@ $this->startContents();

Please come back later!

- + @@ -88,7 +88,7 @@ for ($i = 1; $i <= 5; $i ++) {
@@ -53,7 +53,7 @@ $this->startContents();

Environment:

Type:

Description:

- +

 

Rate this picture

@@ -66,7 +66,7 @@ $this->startContents(); for ($i = 1; $i <= 5; $i ++) { ?>     -  (best)

@@ -74,12 +74,12 @@ for ($i = 1; $i <= 5; $i ++) {

 

Each planet you rate grants you 120 '>contribution credits.

- +

Ratings

Your rating: / 5

Average rating:

Total votes:

- +
- +

Top 50 planet pictures

/ 5.00 -
- +

No planets have been rated at the moment

... which kind of explains why this page is blank.

- -endContents(); ?> + +endContents(); ?> diff --git a/scripts/site/main/output/back_confirm.en.inc b/scripts/site/main/output/back_confirm.en.inc index e3b54a8..e721aba 100644 --- a/scripts/site/main/output/back_confirm.en.inc +++ b/scripts/site/main/output/back_confirm.en.inc @@ -1,4 +1,4 @@ -title = "Cancel account deletion"; $this->addStylesheet("account"); @@ -17,4 +17,4 @@ $this->startContents();
-endContents(); ?> +endContents(); ?> diff --git a/scripts/site/main/output/confirm.en.inc b/scripts/site/main/output/confirm.en.inc index fbb5575..d97d16f 100644 --- a/scripts/site/main/output/confirm.en.inc +++ b/scripts/site/main/output/confirm.en.inc @@ -1,4 +1,4 @@ -title = "Account confirmation"; $this->startContents(); @@ -17,4 +17,4 @@ $this->startContents();

-endContents(); ?> +endContents(); ?> diff --git a/scripts/site/main/output/contrib.en.inc b/scripts/site/main/output/contrib.en.inc index 45e3f21..8c4aa56 100644 --- a/scripts/site/main/output/contrib.en.inc +++ b/scripts/site/main/output/contrib.en.inc @@ -1,4 +1,4 @@ -title = 'Contributions'; $this->addStylesheet('text'); @@ -30,4 +30,4 @@ $this->startContents(); Note: if the resources you used are higher than the estimate of your contributions, you will start getting an annoying message every time you log on to LegacyWorlds.

-endContents(); ?> +endContents(); ?> diff --git a/scripts/site/main/output/create.en.inc b/scripts/site/main/output/create.en.inc index 4b1bff2..f8d426f 100644 --- a/scripts/site/main/output/create.en.inc +++ b/scripts/site/main/output/create.en.inc @@ -102,7 +102,7 @@ if ($__err3) { - -endContents(); ?> +endContents(); ?> diff --git a/scripts/site/main/output/created.en.inc b/scripts/site/main/output/created.en.inc index 56b7e65..81a97e0 100644 --- a/scripts/site/main/output/created.en.inc +++ b/scripts/site/main/output/created.en.inc @@ -1,4 +1,4 @@ -title = "Account creation"; $this->addStylesheet('text'); diff --git a/scripts/site/main/output/credits.en.inc b/scripts/site/main/output/credits.en.inc index 73aba00..a4aec46 100644 --- a/scripts/site/main/output/credits.en.inc +++ b/scripts/site/main/output/credits.en.inc @@ -1,4 +1,4 @@ -title = "Credits"; $this->addStylesheet("credits"); @@ -37,4 +37,4 @@ $this->startContents();
Thanks to everyone who contributed to the game with various ideas or by reporting bugs...
Many bottles of beer were harmed during the making of this game.
-endContents(); ?> +endContents(); ?> diff --git a/scripts/site/main/output/disclaimer.en.inc b/scripts/site/main/output/disclaimer.en.inc index e0f1775..f61d303 100644 --- a/scripts/site/main/output/disclaimer.en.inc +++ b/scripts/site/main/output/disclaimer.en.inc @@ -1,4 +1,4 @@ -title = "Disclaimer"; $this->addStylesheet('text'); @@ -28,4 +28,4 @@ $this->startContents(); the manual.

 

Continue to account creation

":""?> -endContents(); ?> +endContents(); ?> diff --git a/scripts/site/main/output/index.en.inc b/scripts/site/main/output/index.en.inc index 5d6fff0..9a3219e 100644 --- a/scripts/site/main/output/index.en.inc +++ b/scripts/site/main/output/index.en.inc @@ -1,5 +1,5 @@ -addStylesheet('home'); ?> - +addStylesheet('home'); ?> +
Legacy Worlds is a free, massively multiplayer, browser-based strategy game.
You don't need any plugins to play it, nor do you need to download anything.
diff --git a/scripts/site/main/output/logout.en.inc b/scripts/site/main/output/logout.en.inc index 50de867..d24c806 100644 --- a/scripts/site/main/output/logout.en.inc +++ b/scripts/site/main/output/logout.en.inc @@ -1,4 +1,4 @@ -addStylesheet('text'); $this->title = "Logged out"; @@ -17,4 +17,4 @@ $this->startContents();

See you soon!

-endContents(); ?> +endContents(); ?> diff --git a/scripts/site/main/output/lostpass.en.inc b/scripts/site/main/output/lostpass.en.inc index 8900b2b..bebb3af 100644 --- a/scripts/site/main/output/lostpass.en.inc +++ b/scripts/site/main/output/lostpass.en.inc @@ -1,4 +1,4 @@ -title = "Password recovery"; $this->startContents(); @@ -40,7 +40,7 @@ if ($args === false || is_array($args) && $args['error'] < 2) {
-

Your password has been changed!

@@ -111,4 +111,4 @@ if ($args === false || is_array($args) && $args['error'] < 2) { } ?> -endContents(); ?> +endContents(); ?> diff --git a/scripts/site/main/output/manual-box.en.inc b/scripts/site/main/output/manual-box.en.inc index c87056d..6a819cd 100644 --- a/scripts/site/main/output/manual-box.en.inc +++ b/scripts/site/main/output/manual-box.en.inc @@ -1,4 +1,4 @@ -getLib('main/manual'); @@ -37,7 +37,7 @@ ob_start(); Contents - - + '>Top - + id='ac-'>> - + -> Main article - - +
- +
- - +" . displayLinks($list[$k]['contents']) . "
"; } @@ -99,7 +99,7 @@ function drawSections (&$list, $depth = 2) { } ?>
-page)) { ?>

page['title']?>

-page['subsections'])) : ?> +page['subsections'])) : ?>
Page contents @@ -122,14 +122,14 @@ if (is_null(handler::$h->page)) {
    -page['subsections']); ?> +page['subsections']); ?>
-page['subsections']); ?> - +page['subsections']); ?> +
-endContents(); ?> diff --git a/scripts/site/main/output/menu.en.inc b/scripts/site/main/output/menu.en.inc index b009d32..fd7d197 100644 --- a/scripts/site/main/output/menu.en.inc +++ b/scripts/site/main/output/menu.en.inc @@ -1,10 +1,10 @@ - + My account Contributions - + Create an account About this game - + Screenshots Manual Rankings diff --git a/scripts/site/main/output/notfound.en.inc b/scripts/site/main/output/notfound.en.inc index e3602e7..82153f0 100644 --- a/scripts/site/main/output/notfound.en.inc +++ b/scripts/site/main/output/notfound.en.inc @@ -1,4 +1,4 @@ -title = "Page not found"; $this->addStylesheet('text'); @@ -11,4 +11,4 @@ $this->startContents();

Sorry :-\

-endContents(); ?> +endContents(); ?> diff --git a/scripts/site/main/output/notregistered.en.inc b/scripts/site/main/output/notregistered.en.inc index 6fd93cb..898b110 100644 --- a/scripts/site/main/output/notregistered.en.inc +++ b/scripts/site/main/output/notregistered.en.inc @@ -1,4 +1,4 @@ -title = "Registration required"; $this->addStylesheet('text'); @@ -11,4 +11,4 @@ $this->startContents();

Before you can access the game, you have to ?g='>register.

-endContents(); ?> +endContents(); ?> diff --git a/scripts/site/main/output/play.en.inc b/scripts/site/main/output/play.en.inc index d72833c..4993c97 100644 --- a/scripts/site/main/output/play.en.inc +++ b/scripts/site/main/output/play.en.inc @@ -1,4 +1,4 @@ -title = "Registration"; $this->startContents(); @@ -117,4 +117,4 @@ if (is_null($args['registered'])) { } ?> -endContents(); ?> +endContents(); ?> diff --git a/scripts/site/main/output/quit_confirm.en.inc b/scripts/site/main/output/quit_confirm.en.inc index 4f1497c..20783a5 100644 --- a/scripts/site/main/output/quit_confirm.en.inc +++ b/scripts/site/main/output/quit_confirm.en.inc @@ -1,4 +1,4 @@ -addStylesheet("account"); $this->title = "Close account"; @@ -57,4 +57,4 @@ if ($args['ePass']) {

-endContents(); ?> +endContents(); ?> diff --git a/scripts/site/main/output/rankings.en.inc b/scripts/site/main/output/rankings.en.inc index ff4f446..355424c 100644 --- a/scripts/site/main/output/rankings.en.inc +++ b/scripts/site/main/output/rankings.en.inc @@ -1,4 +1,4 @@ -addStylesheet('rankings'); $this->title = "Rankings"; @@ -6,7 +6,7 @@ $this->startContents(); ?>
- / /
-endContents(); ?> +endContents(); ?> diff --git a/scripts/site/main/output/side-box.en.inc b/scripts/site/main/output/side-box.en.inc index da98280..bf69380 100644 --- a/scripts/site/main/output/side-box.en.inc +++ b/scripts/site/main/output/side-box.en.inc @@ -1,4 +1,4 @@ -addStylesheet("sidebox"); $this->addScript("sidebox"); ?> @@ -13,7 +13,7 @@ $this->addScript("sidebox");
  • Menu
    - +
  • diff --git a/scripts/site/main/output/vac_cancel.en.inc b/scripts/site/main/output/vac_cancel.en.inc index 401110c..5c90f2b 100644 --- a/scripts/site/main/output/vac_cancel.en.inc +++ b/scripts/site/main/output/vac_cancel.en.inc @@ -1,4 +1,4 @@ -title = "Cancel vacation mode"; $this->addStylesheet("account"); @@ -19,4 +19,4 @@ $this->startContents(); -endContents(); ?> +endContents(); ?> diff --git a/scripts/site/main/output/vac_leave.en.inc b/scripts/site/main/output/vac_leave.en.inc index 8cd4720..879edae 100644 --- a/scripts/site/main/output/vac_leave.en.inc +++ b/scripts/site/main/output/vac_leave.en.inc @@ -1,4 +1,4 @@ -title = "Leave vacation mode"; $this->addStylesheet("account"); @@ -20,4 +20,4 @@ $this->startContents(); -endContents(); ?> +endContents(); ?> diff --git a/scripts/site/main/output/vac_start.en.inc b/scripts/site/main/output/vac_start.en.inc index 33e4fdf..16ef2da 100644 --- a/scripts/site/main/output/vac_start.en.inc +++ b/scripts/site/main/output/vac_start.en.inc @@ -1,4 +1,4 @@ -title = "Enter vacation mode"; $this->addStylesheet("account"); @@ -25,4 +25,4 @@ $this->startContents(); -endContents(); ?> +endContents(); ?> diff --git a/scripts/ticks.php b/scripts/ticks.php index c66d3e2..0bdef1f 100644 --- a/scripts/ticks.php +++ b/scripts/ticks.php @@ -60,6 +60,7 @@ if ($__runFromAdmin) { } l::setFatalHandler('__adminFatalError'); + $argh = null; try { dbConnect();