Skip to content

Commit

Permalink
Flatten the namespace, removing "Bad" as a namespace. Files still hav…
Browse files Browse the repository at this point in the history
…e their documentation inline noting how they are still terrible.
  • Loading branch information
thekabal committed Jun 12, 2016
1 parent 5233ac5 commit 83b2ee1
Show file tree
Hide file tree
Showing 22 changed files with 82 additions and 82 deletions.
2 changes: 1 addition & 1 deletion attack.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
{
echo $langvars['l_att_noturn'] . '<br><br>';
}
elseif (Bad\Team::sameTeam($playerinfo['team'], $targetinfo['team']))
elseif (Tki\Team::sameTeam($playerinfo['team'], $targetinfo['team']))
{
echo "<div style='color:#ff0;'>" . $langvars['l_team_noattack_members'] . "</div>\n";
}
Expand Down
2 changes: 1 addition & 1 deletion classes/Ibank.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// behaviors. But in the interest of saying goodbye to the includes directory, and raw functions, this
// will at least allow us to auto-load and use classes instead. Plenty to do in the future, though!

namespace Bad;
namespace Tki;

class Ibank
{
Expand Down
2 changes: 1 addition & 1 deletion classes/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// behaviors. But in the interest of saying goodbye to the includes directory, and raw functions, this
// will at least allow us to auto-load and use classes instead. Plenty to do in the future, though!

namespace Bad;
namespace Tki;

class Log
{
Expand Down
2 changes: 1 addition & 1 deletion classes/Planet.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// behaviors. But in the interest of saying goodbye to the includes directory, and raw functions, this
// will at least allow us to auto-load and use classes instead. Plenty to do in the future, though!

namespace Bad;
namespace Tki;

class Planet
{
Expand Down
2 changes: 1 addition & 1 deletion classes/PlanetReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// behaviors. But in the interest of saying goodbye to the includes directory, and raw functions, this
// will at least allow us to auto-load and use classes instead. Plenty to do in the future, though!

namespace Bad;
namespace Tki;

class PlanetReport
{
Expand Down
2 changes: 1 addition & 1 deletion classes/PlanetReportCE.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// behaviors. But in the interest of saying goodbye to the includes directory, and raw functions, this
// will at least allow us to auto-load and use classes instead. Plenty to do in the future, though!

namespace Bad;
namespace Tki;

class PlanetReportCE
{
Expand Down
2 changes: 1 addition & 1 deletion classes/Team.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//
// File: classes/Team.php

namespace Bad;
namespace Tki;

class Team
{
Expand Down
2 changes: 1 addition & 1 deletion classes/Traderoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// FUTURE: These are horribly bad. But in the interest of saying goodbye to the includes directory, and raw functions, this
// will at least allow us to auto-load and use classes instead. Plenty to do in the future, though!

namespace Bad;
namespace Tki;

class Traderoute
{
Expand Down
2 changes: 1 addition & 1 deletion classes/Xenobe.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// FUTURE: These are horribly bad. But in the interest of saying goodbye to the includes directory, and raw functions, this
// will at least allow us to auto-load and use classes instead. Plenty to do in the future, though!

namespace Bad;
namespace Tki;

class Xenobe
{
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"adodb/adodb-php": "v5.20.4"
},
"autoload": {
"psr-4": { "Tki\\": ["classes/", "config/"], "Bad\\": "classes/"}
"psr-4": { "Tki\\": ["classes/", "config/"], "Tki\\": "classes/"}
},
"scripts": {
"post-update-cmd": [
Expand Down
30 changes: 15 additions & 15 deletions ibank.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

if (!$tkireg->allow_ibank)
{
Bad\Ibank::ibankError($pdo_db, $langvars, $langvars['l_ibank_malfunction'], "main.php", $lang, $tkireg, $template);
Tki\Ibank::ibankError($pdo_db, $langvars, $langvars['l_ibank_malfunction'], "main.php", $lang, $tkireg, $template);
}

// Detect if this variable exists, and filter it. Returns false if anything wasn't right.
Expand All @@ -73,59 +73,59 @@

if ($command == 'login') // Main menu
{
Bad\Ibank::ibankLogin($langvars, $playerinfo, $account);
Tki\Ibank::ibankLogin($langvars, $playerinfo, $account);
}
elseif ($command == 'withdraw') // Withdraw menu
{
Bad\Ibank::ibankWithdraw($langvars, $account);
Tki\Ibank::ibankWithdraw($langvars, $account);
}
elseif ($command == 'withdraw2') // Withdraw operation
{
Bad\Ibank::ibankWithdraw2($pdo_db, $lang, $langvars, $playerinfo, $amount, $account, $tkireg, $template);
Tki\Ibank::ibankWithdraw2($pdo_db, $lang, $langvars, $playerinfo, $amount, $account, $tkireg, $template);
}
elseif ($command == 'deposit') // Deposit menu
{
Bad\Ibank::ibankDeposit($pdo_db, $lang, $account, $playerinfo);
Tki\Ibank::ibankDeposit($pdo_db, $lang, $account, $playerinfo);
}
elseif ($command == 'deposit2') // Deposit operation
{
Bad\Ibank::ibankDeposit2($pdo_db, $lang, $langvars, $playerinfo, $amount, $account, $tkireg, $template);
Tki\Ibank::ibankDeposit2($pdo_db, $lang, $langvars, $playerinfo, $amount, $account, $tkireg, $template);
}
elseif ($command == 'transfer') // Main transfer menu
{
Bad\Ibank::ibankTransfer($pdo_db, $langvars, $playerinfo, $tkireg);
Tki\Ibank::ibankTransfer($pdo_db, $langvars, $playerinfo, $tkireg);
}
elseif ($command == 'transfer2') // Specific transfer menu (ship or planet)
{
Bad\Ibank::ibankTransfer2($db, $pdo_db, $lang, $langvars, $tkireg, $playerinfo, $account, $ship_id, $splanet_id, $dplanet_id, $template);
Tki\Ibank::ibankTransfer2($db, $pdo_db, $lang, $langvars, $tkireg, $playerinfo, $account, $ship_id, $splanet_id, $dplanet_id, $template);
}
elseif ($command == 'transfer3') // Transfer operation
{
Bad\Ibank::ibankTransfer3($db, $pdo_db, $lang, $langvars, $playerinfo, $account, $ship_id, $splanet_id, $dplanet_id, $amount, $tkireg, $template);
Tki\Ibank::ibankTransfer3($db, $pdo_db, $lang, $langvars, $playerinfo, $account, $ship_id, $splanet_id, $dplanet_id, $amount, $tkireg, $template);
}
elseif ($command == 'loans') // Loans menu
{
Bad\Ibank::ibankLoans($pdo_db, $langvars, $tkireg, $playerinfo, $account);
Tki\Ibank::ibankLoans($pdo_db, $langvars, $tkireg, $playerinfo, $account);
}
elseif ($command == 'borrow') // Borrow operation
{
Bad\Ibank::ibankBorrow($pdo_db, $lang, $langvars, $tkireg, $playerinfo, $active_template, $account, $amount, $template);
Tki\Ibank::ibankBorrow($pdo_db, $lang, $langvars, $tkireg, $playerinfo, $active_template, $account, $amount, $template);
}
elseif ($command == 'repay') // Repay operation
{
Bad\Ibank::ibankRepay($pdo_db, $lang, $langvars, $playerinfo, $account, $amount, $active_template, $tkireg, $template);
Tki\Ibank::ibankRepay($pdo_db, $lang, $langvars, $playerinfo, $account, $amount, $active_template, $tkireg, $template);
}
elseif ($command == 'consolidate') // Consolidate menu
{
Bad\Ibank::ibankConsolidate($langvars, $tkireg, $dplanet_id);
Tki\Ibank::ibankConsolidate($langvars, $tkireg, $dplanet_id);
}
elseif ($command == 'consolidate2') // Consolidate compute
{
Bad\Ibank::ibankConsolidate2($db, $pdo_db, $lang, $langvars, $playerinfo, $tkireg, $dplanet_id, $minimum, $maximum, $template);
Tki\Ibank::ibankConsolidate2($db, $pdo_db, $lang, $langvars, $playerinfo, $tkireg, $dplanet_id, $minimum, $maximum, $template);
}
elseif ($command == 'consolidate3') // Consolidate operation
{
Bad\Ibank::ibankConsolidate3($db, $pdo_db, $langvars, $playerinfo, $tkireg, $dplanet_id, $minimum, $maximum, $template);
Tki\Ibank::ibankConsolidate3($db, $pdo_db, $langvars, $playerinfo, $tkireg, $dplanet_id, $minimum, $maximum, $template);
}
else
{
Expand Down
6 changes: 3 additions & 3 deletions planet.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@

$retOwnerInfo = null;

$owner_found = Bad\Planet::getOwner($pdo_db, $db, $planetinfo['planet_id'], $retOwnerInfo);
$owner_found = Tki\Planet::getOwner($pdo_db, $db, $planetinfo['planet_id'], $retOwnerInfo);
if ($owner_found === true && !is_null($retOwnerInfo))
{
if ($retOwnerInfo['team'] == $playerinfo['team'] && ($playerinfo['team'] != 0 || $retOwnerInfo['team'] != 0))
Expand Down Expand Up @@ -553,7 +553,7 @@
}

$retOwnerInfo = null;
$owner_found = Bad\Planet::getOwner($pdo_db, $db, $planetinfo['planet_id'], $retOwnerInfo);
$owner_found = Tki\Planet::getOwner($pdo_db, $db, $planetinfo['planet_id'], $retOwnerInfo);
if ($owner_found === true && !is_null($retOwnerInfo))
{
if ($retOwnerInfo['team'] == $playerinfo['team'] && ($playerinfo['team'] != 0 || $retOwnerInfo['team'] != 0))
Expand Down Expand Up @@ -589,7 +589,7 @@
unset($_SESSION['planet_selected']);

$retOwnerInfo = null;
$owner_found = Bad\Planet::getOwner($pdo_db, $db, $planetinfo['planet_id'], $retOwnerInfo);
$owner_found = Tki\Planet::getOwner($pdo_db, $db, $planetinfo['planet_id'], $retOwnerInfo);
if ($owner_found === true && !is_null($retOwnerInfo))
{
if ($retOwnerInfo['team'] == $playerinfo['team'] && ($playerinfo['team'] != 0 || $retOwnerInfo['team'] != 0))
Expand Down
8 changes: 4 additions & 4 deletions planet_report.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,25 @@
{
$title = $title . ": Status";
echo "<h1>" . $title . "</h1>\n";
Bad\PlanetReport::standardReport($pdo_db, $db, $langvars, $playerinfo, $sort, $tkireg);
Tki\PlanetReport::standardReport($pdo_db, $db, $langvars, $playerinfo, $sort, $tkireg);
}
elseif ($preptype == 2) // Display the production values of your planets and allow changing
{
$title = $title . ": Production";
echo "<h1>" . $title . "</h1>\n";
Bad\PlanetReport::planetProductionChange($pdo_db, $db, $langvars, $playerinfo, $sort, $tkireg);
Tki\PlanetReport::planetProductionChange($pdo_db, $db, $langvars, $playerinfo, $sort, $tkireg);
}
elseif ($preptype == 0) // For typing in manually to get a report menu
{
$title = $title . ": Menu";
echo "<h1>" . $title . "</h1>\n";
Bad\PlanetReport::planetReportMenu($playerinfo, $langvars);
Tki\PlanetReport::planetReportMenu($playerinfo, $langvars);
}
else // Display the menu if no valid options are passed in
{
$title = $title . ": Status";
echo "<h1>" . $title . "</h1>\n";
Bad\PlanetReport::planetReportMenu($playerinfo, $langvars);
Tki\PlanetReport::planetReportMenu($playerinfo, $langvars);
}

echo "<br><br>";
Expand Down
6 changes: 3 additions & 3 deletions planet_report_ce.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@

if ($tpcreds !== null && $tpcreds !== false)
{
Bad\PlanetReportCE::collectCredits($pdo_db, $db, $langvars, $tpcreds, $tkireg);
Tki\PlanetReportCE::collectCredits($pdo_db, $db, $langvars, $tpcreds, $tkireg);
}
elseif ($buildp !== null && $builds !== null)
{
Bad\PlanetReportCE::buildBase($pdo_db, $db, $langvars, $buildp, $builds, $tkireg);
Tki\PlanetReportCE::buildBase($pdo_db, $db, $langvars, $buildp, $builds, $tkireg);
}
else
{
Bad\PlanetReportCE::changePlanetProduction($pdo_db, $db, $langvars, $_POST, $tkireg);
Tki\PlanetReportCE::changePlanetProduction($pdo_db, $db, $langvars, $_POST, $tkireg);
}

echo '<br><br>';
Expand Down
2 changes: 1 addition & 1 deletion port.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
// Kami Multi-browser window upgrade fix
$_SESSION['port_shopping'] = true;

if (Bad\Ibank::isLoanPending($pdo_db, $playerinfo['ship_id'], $tkireg))
if (Tki\Ibank::isLoanPending($pdo_db, $playerinfo['ship_id'], $tkireg))
{
echo $langvars['l_port_loannotrade'] . "<p>";
echo "<a href=ibank.php>" . $langvars['l_ibank_term'] . "</a><p>";
Expand Down
2 changes: 1 addition & 1 deletion port2.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function php_change_delta($desired_value, $current_value, $upgrade_cost)
}
unset ($_SESSION['port_shopping']);

if (Bad\Ibank::isLoanPending($pdo_db, $playerinfo['ship_id'], $tkireg))
if (Tki\Ibank::isLoanPending($pdo_db, $playerinfo['ship_id'], $tkireg))
{
echo $langvars['l_port_loannotrade'] . "<p>";
echo "<a href=ibank.php>" . $langvars['l_ibank_term'] . "</a><p>";
Expand Down
Loading

0 comments on commit 83b2ee1

Please sign in to comment.