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 |
Tick manager status: +
Tick manager status:
not running - Start manager
-
+ running, process ID #=$mRunning?> - 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 @@
":""?> - $this->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 @@ - $this->addStylesheet('home'); ?> - include('menu.en.inc'); ?> +addStylesheet('home'); ?> +
See you soon!
- $this->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) {Sorry :-\
- $this->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==$args['id']?>'>register.
- $this->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'])) { } ?> - $this->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']) { - $this->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(); ?>