From 8c985484b1e91bf2f09589f262434cc13ec1d74d Mon Sep 17 00:00:00 2001 From: thekabal Date: Mon, 24 Jul 2017 17:26:01 -0600 Subject: [PATCH] Wrong case for LogDbErrors - should have been logDbErrors --- admin/bans_editor.php | 22 +++++----- admin/log_viewer.php | 2 +- admin/planet_editor.php | 6 +-- admin/sector_editor.php | 6 +-- admin/universe_editor.php | 8 ++-- admin/user_editor.php | 4 +- admin/zone_editor.php | 4 +- attack.php | 32 +++++++------- bounty.php | 20 ++++----- check_fighters.php | 22 +++++----- check_mines.php | 12 +++--- create_universe/80.php | 2 +- defence_report.php | 2 +- genesis.php | 18 ++++---- kabal_control.php | 30 ++++++------- login2.php | 10 ++--- lrscan.php | 36 ++++++++-------- mail.php | 4 +- mailto.php | 14 +++--- main.php | 28 ++++++------ mines.php | 12 +++--- move.php | 6 +-- navcomp.php | 2 +- new2.php | 8 ++-- planet.php | 34 +++++++-------- port.php | 32 +++++++------- port2.php | 8 ++-- pwreset.php | 4 +- pwreset2.php | 6 +-- readmail.php | 8 ++-- rsmove.php | 10 ++--- scan.php | 8 ++-- scheduler.php | 10 ++--- scheduler/sched_apocalypse.php | 6 +-- scheduler/sched_degrade.php | 16 +++---- scheduler/sched_ibank.php | 2 +- scheduler/sched_kabal.php | 10 ++--- scheduler/sched_news.php | 50 +++++++++++----------- scheduler/sched_planets.php | 10 ++--- scheduler/sched_ports.php | 32 +++++++------- scheduler/sched_ranking.php | 2 +- scheduler/sched_thegovernor.php | 38 ++++++++--------- scheduler/sched_tow.php | 4 +- scheduler/sched_turns.php | 2 +- sector_fighters.php | 4 +- team.php | 8 ++-- team_planets.php | 4 +- teams.php | 76 ++++++++++++++++----------------- traderoute.php | 14 +++--- 49 files changed, 354 insertions(+), 354 deletions(-) diff --git a/admin/bans_editor.php b/admin/bans_editor.php index 6c754314f..5bd560bc7 100644 --- a/admin/bans_editor.php +++ b/admin/bans_editor.php @@ -28,7 +28,7 @@ echo ""; $res = $db->Execute("SELECT ban_mask FROM {$db->prefix}ip_bans"); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); while (!$res->EOF) { $bans[] = $res->fields['ban_mask']; @@ -72,7 +72,7 @@ ""; $res = $db->Execute("SELECT character_name, ship_id, email FROM {$db->prefix}ships WHERE ip_address LIKE ?;", array($ban)); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); unset($players); while (!$res->EOF) { @@ -122,7 +122,7 @@ elseif ($command == 'showips') { $res = $db->Execute("SELECT DISTINCT ip_address FROM {$db->prefix}ships"); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); while (!$res->EOF) { $ips[] = $res->fields['ip_address']; @@ -159,7 +159,7 @@ ""; $res = $db->Execute("SELECT character_name, ship_id, email FROM {$db->prefix}ships WHERE ip_address = ?;", array($ip)); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); unset($players); while (!$res->EOF) { @@ -259,9 +259,9 @@ echo "" . $langvars['l_admin_ban_success'] . " " . $printban . ".

"; $resx = $db->Execute("INSERT INTO {$db->prefix}ip_bans values (NULL, ?);", array($banmask)); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); $res = $db->Execute("SELECT DISTINCT character_name FROM {$db->prefix}ships, {$db->prefix}ip_bans WHERE ip_address LIKE ban_mask"); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); echo $langvars['l_admin_affected_players'] . " :

"; while (!$res->EOF) { @@ -281,12 +281,12 @@ if ($ban !== null) { $res = $db->Execute("SELECT * FROM {$db->prefix}ip_bans WHERE ban_mask = ?;", array($ban)); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); } else { $res = $db->Execute("SELECT * FROM {$db->prefix}ip_bans WHERE ? LIKE ban_mask;", array($ip)); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); } $nbbans = $res->RecordCount(); @@ -300,12 +300,12 @@ if ($ban !== null) { $resx = $db->Execute("DELETE FROM {$db->prefix}ip_bans WHERE ban_mask = ?;", array($ban)); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); } else { $resx = $db->Execute("DELETE FROM {$db->prefix}ip_bans WHERE ? LIKE ban_mask;", array($ip)); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); } $query_string = "ip_address LIKE '" . $bans[0]['ban_mask'] . "'"; @@ -315,7 +315,7 @@ } $res = $db->Execute("SELECT DISTINCT character_name FROM {$db->prefix}ships WHERE ?;", array($query_string)); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); $nbplayers = $res->RecordCount(); while (!$res->EOF) { diff --git a/admin/log_viewer.php b/admin/log_viewer.php index ae4ff3e0c..bab4b8362 100644 --- a/admin/log_viewer.php +++ b/admin/log_viewer.php @@ -18,7 +18,7 @@ // File: admin/log_viewer.php $res = $db->Execute("SELECT ship_id, character_name FROM {$db->prefix}ships ORDER BY character_name ASC"); -Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); while (!$res->EOF) { $players[] = $res->fields; diff --git a/admin/planet_editor.php b/admin/planet_editor.php index e6357bfff..d83af279d 100644 --- a/admin/planet_editor.php +++ b/admin/planet_editor.php @@ -23,7 +23,7 @@ { echo ""; $ressuba = $db->Execute("SELECT ship_id,character_name FROM {$db->prefix}ships ORDER BY character_name"); - Tki\Db::LogDbErrors($pdo_db, $ressuba, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $ressuba, __LINE__, __FILE__); echo ""; while (!$ressuba->EOF) { @@ -114,7 +114,7 @@ $_base = empty($base) ? "N" : "Y"; $_sells = empty($sells) ? "N" : "Y"; $planupdate = $db->Execute("UPDATE {$db->prefix}planets SET sector_id = ?, defeated = ?, name = ?, base = ?, sells = ?, owner = ?, organics = ?, ore = ?, goods = ?, energy = ?, team = ?, colonists = ?,credits = ? ,fighters = ?, torps = ?, prod_organics= ? , prod_ore = ?, prod_goods = ?, prod_energy = ?, prod_fighters = ?, prod_torp = ? WHERE planet_id = ?", array($sector_id, $_defeated, $name, $_base, $_sells, $owner, $organics, $ore, $goods, $energy, $team, $colonists, $credits, $fighters, $torps, $prod_organics, $prod_ore, $prod_goods, $prod_energy, $prod_fighters, $prod_torp, $planet)); - Tki\Db::LogDbErrors($pdo_db, $planupdate, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $planupdate, __LINE__, __FILE__); if (!$planupdate) { echo $langvars['l_admin_changes_failed'] . "

"; diff --git a/admin/sector_editor.php b/admin/sector_editor.php index fa567e663..bab5e4fde 100644 --- a/admin/sector_editor.php +++ b/admin/sector_editor.php @@ -33,7 +33,7 @@ if ($_POST['sector'] === null) { $res = $db->Execute("SELECT sector_id FROM {$db->prefix}universe ORDER BY sector_id"); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); while (!$res->EOF) { $sectors[] = $res->fields; @@ -56,7 +56,7 @@ $variables['sector_name'] = $row['sector_name']; $ressubb = $db->Execute("SELECT zone_id,zone_name FROM {$db->prefix}zones ORDER BY zone_name"); - Tki\Db::LogDbErrors($pdo_db, $ressubb, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $ressubb, __LINE__, __FILE__); while (!$ressubb->EOF) { $rowsubb = $ressubb->fields; @@ -98,7 +98,7 @@ { // Update database $secupdate = $db->Execute("UPDATE {$db->prefix}universe SET sector_name=?, zone_id=?, beacon=?, port_type=?, port_organics=?, port_ore=?, port_goods=?, port_energy=?, distance=?, angle1=?, angle2=? WHERE sector_id=?;", array($_POST['sector_name'], $_POST['zone_id'], $_POST['beacon'], $_POST['port_type'], $_POST['port_organics'], $_POST['port_ore'], $_POST['port_goods'], $_POST['port_energy'], $_POST['distance'], $_POST['angle1'], $_POST['angle2'], $_POST['sector'])); - Tki\Db::LogDbErrors($pdo_db, $secupdate, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $secupdate, __LINE__, __FILE__); if (!$secupdate) { diff --git a/admin/universe_editor.php b/admin/universe_editor.php index b6325ee5a..e2894d37d 100644 --- a/admin/universe_editor.php +++ b/admin/universe_editor.php @@ -25,12 +25,12 @@ if ($action == "doexpand") { $result = $db->Execute("SELECT sector_id FROM {$db->prefix}universe ORDER BY sector_id ASC"); - Tki\Db::LogDbErrors($pdo_db, $result, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result, __LINE__, __FILE__); if (!$result->EOF) { $resa = $db->StartTrans(); // We enclose the updates in a transaction as it is faster - Tki\Db::LogDbErrors($pdo_db, $resa, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resa, __LINE__, __FILE__); // Begin transaction while (!$result->EOF) @@ -38,7 +38,7 @@ $row = $result->fields; $distance = random_int(1, (int) $radius); $resx = $db->Execute("UPDATE {$db->prefix}universe SET distance = ? WHERE sector_id = ?", array($distance, $row['sector_id'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); $changed_sectors[$i] = str_replace("[sector]", $row['sector_id'], $langvars['l_admin_updated_distance']); $changed_sectors[$i] = str_replace("[distance]", $distance, $changed_sectors[$i]); @@ -48,7 +48,7 @@ // End transaction $trans_status = $db->CompleteTrans(); // Complete the transaction - Tki\Db::LogDbErrors($pdo_db, $trans_status, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $trans_status, __LINE__, __FILE__); } } diff --git a/admin/user_editor.php b/admin/user_editor.php index 34d220399..b8f7d709f 100644 --- a/admin/user_editor.php +++ b/admin/user_editor.php @@ -27,7 +27,7 @@ if (empty($_POST['user'])) { $res = $db->Execute("SELECT ship_id, character_name FROM {$db->prefix}ships ORDER BY character_name"); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); while (!$res->EOF) { $players[] = $res->fields; @@ -107,7 +107,7 @@ $_dev_fuelscoop = empty($_POST['dev_fuelscoop']) ? "N" : "Y"; $variables['debug'] = $_dev_escapepod; $resx = $db->Execute("UPDATE {$db->prefix}ships SET character_name=?, password=?, email=?, ship_name=?, ship_destroyed=?, hull=?, engines=?, power=?, computer=?, sensors=?, armor=?, shields=?, beams=?, torp_launchers=?, cloak=?, credits=?, turns=?, dev_warpedit=?, dev_genesis=?, dev_beacon=?, dev_emerwarp=?, dev_escapepod=?, dev_fuelscoop=?, dev_minedeflector=?, sector=?, ship_ore=?, ship_organics=?, ship_goods=?, ship_energy=?, ship_colonists=?, ship_fighters=?, torps=?, armor_pts=? WHERE ship_id=?", array($_POST['character_name'], $_POST['password2'], $_POST['email'], $_POST['ship_name'], $_ship_destroyed, $_POST['hull'], $_POST['engines'], $_POST['power'], $_POST['computer'], $_POST['sensors'], $_POST['armor'], $_POST['shields'], $_POST['beams'], $_POST['torp_launchers'], $_POST['cloak'], $_POST['credits'], $_POST['turns'], $_POST['dev_warpedit'], $_POST['dev_genesis'], $_POST['dev_beacon'], $_POST['dev_emerwarp'], $_dev_escapepod, $_dev_fuelscoop, $_POST['dev_minedeflector'], $_POST['sector'], $_POST['ship_ore'], $_POST['ship_organics'], $_POST['ship_goods'], $_POST['ship_energy'], $_POST['ship_colonists'], $_POST['ship_fighters'], $_POST['torps'], $_POST['armor_pts'], $_POST['user'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); $button_main = false; $variables['user'] = $_POST['user']; } diff --git a/admin/zone_editor.php b/admin/zone_editor.php index 3f1af5a3c..43b4c51c4 100644 --- a/admin/zone_editor.php +++ b/admin/zone_editor.php @@ -29,7 +29,7 @@ if ($_POST['zone'] === null) { $res = $db->Execute("SELECT zone_id, zone_name FROM {$db->prefix}zones ORDER BY zone_name"); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); while (!$res->EOF) { $zones[] = $res->fields; @@ -93,7 +93,7 @@ $_zone_warpedit = empty($zone_warpedit) ? "N" : "Y"; $_zone_planet = empty($zone_planet) ? "N" : "Y"; $resx = $db->Execute("UPDATE {$db->prefix}zones SET zone_name = ?, allow_beacon = ? , allow_attack= ? , allow_warpedit = ? , allow_planet = ?, max_hull = ? WHERE zone_id = ?;", array($zone_name, $_zone_beacon, $_zone_attack, $_zone_warpedit, $_zone_planet, $zone_hull, $_POST['zone'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); $button_main = false; } } diff --git a/attack.php b/attack.php index 131e3d4a9..fc005241e 100644 --- a/attack.php +++ b/attack.php @@ -116,7 +116,7 @@ "{$db->prefix}universe.zone_id;", array($targetinfo['sector']) ); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); $zoneinfo = $res->fields; if ($zoneinfo['allow_attack'] == 'N') @@ -131,7 +131,7 @@ "ship_id = ?;", array($playerinfo['ship_id']) ); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); Tki\PlayerLog::WriteLog($pdo_db, $targetinfo['ship_id'], \Tki\LogEnums::ATTACK_OUTMAN, "$playerinfo[character_name]"); } elseif ($roll > $success) @@ -143,7 +143,7 @@ "ship_id = ?;", array($playerinfo['ship_id']) ); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); Tki\PlayerLog::WriteLog($pdo_db, $targetinfo['ship_id'], \Tki\LogEnums::ATTACK_OUTSCAN, "$playerinfo[character_name]"); } else @@ -173,7 +173,7 @@ "WHERE ship_id = ?;", array($rating_change, $playerinfo['ship_id']) ); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); Tki\PlayerLog::WriteLog($pdo_db, $targetinfo['ship_id'], \Tki\LogEnums::ATTACK_EWD, "$playerinfo[character_name]"); $result_warp = $db->Execute( "UPDATE {$db->prefix}ships SET sector = $dest_sector, " . @@ -181,7 +181,7 @@ "WHERE ship_id = ?;", array($targetinfo['ship_id']) ); - Tki\Db::LogDbErrors($pdo_db, $result_warp, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result_warp, __LINE__, __FILE__); Tki\LogMove::writeLog($pdo_db, $targetinfo['ship_id'], $dest_sector); echo $langvars['l_att_ewd'] . "

"; } @@ -203,7 +203,7 @@ "bounty_on = ? AND placed_by = 0;", array($targetinfo['ship_id']) ); - Tki\Db::LogDbErrors($pdo_db, $hasbounty, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $hasbounty, __LINE__, __FILE__); if ($hasbounty) { $resx = $hasbounty->fields; @@ -218,7 +218,7 @@ "(?,?,?);", array($playerinfo['ship_id'], 0 ,$bounty) ); - Tki\Db::LogDbErrors($pdo_db, $insert, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $insert, __LINE__, __FILE__); Tki\PlayerLog::WriteLog($pdo_db, $playerinfo['ship_id'], \Tki\LogEnums::BOUNTY_FEDBOUNTY, "$bounty"); echo "

" . $langvars['l_by_fedbounty2'] . "
\n"; echo "
\n"; @@ -624,7 +624,7 @@ array(100, $rating, $targetinfo['ship_id']) ); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); Tki\PlayerLog::WriteLog($pdo_db, $targetinfo['ship_id'], \Tki\LogEnums::ATTACK_LOSE, "$playerinfo[character_name]|Y"); Tki\Bounty::collect($pdo_db, $langvars, $playerinfo['ship_id'], $targetinfo['ship_id']); $admin_log = new Tki\AdminLog; @@ -652,7 +652,7 @@ if (preg_match("/(\@kabal)$/", $targetinfo['email']) !== 0) { $resx = $db->Execute("UPDATE {$db->prefix}kabal SET active= N WHERE kabal_id = ?;", array($targetinfo['email'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); $admin_log = new Tki\AdminLog; $admin_log->writeLog($pdo_db, \Tki\LogEnums::ATTACK_DEBUG, "*|{$playerinfo['ship_id']}|{$targetinfo['ship_id']}|Detected as AI."); @@ -735,7 +735,7 @@ "credits = credits + ? WHERE ship_id = ?;", array($salv_ore, $salv_organics, $salv_goods, $ship_salvage, $playerinfo['ship_id']) ); - Tki\Db::LogDbErrors($pdo_db, $update3, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $update3, __LINE__, __FILE__); $armor_lost = $playerinfo['armor_pts'] - $playerarmor; $fighters_lost = $playerinfo['ship_fighters'] - $playerfighters; $energy = $playerinfo['ship_energy']; @@ -745,7 +745,7 @@ "WHERE ship_id = ?;", array($energy, $fighters_lost, $armor_lost, $playertorpnum, $rating_change, $playerinfo['ship_id']) ); - Tki\Db::LogDbErrors($pdo_db, $update3b, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $update3b, __LINE__, __FILE__); echo $langvars['l_att_ylost'] . " " . $armor_lost . " " . $langvars['l_armorpts'], $fighters_lost . " " . $langvars['l_fighters'], $langvars['l_att_andused'] . " " . $playertorpnum . " " . $langvars['l_torps'] . ".
"; } } @@ -765,7 +765,7 @@ "torps = torps - ? WHERE ship_id = ?;", array($energy, $fighters_lost, $armor_lost, $targettorpnum, $targetinfo['ship_id']) ); - Tki\Db::LogDbErrors($pdo_db, $update4, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $update4, __LINE__, __FILE__); $armor_lost = $playerinfo['armor_pts'] - $playerarmor; $fighters_lost = $playerinfo['ship_fighters'] - $playerfighters; @@ -777,7 +777,7 @@ "WHERE ship_id = ?;", array($energy, $fighters_lost, $armor_lost, $playertorpnum, $rating_change, $playerinfo['ship_id']) ); - Tki\Db::LogDbErrors($pdo_db, $update4b, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $update4b, __LINE__, __FILE__); echo $langvars['l_att_ylost'] . " " . $armor_lost . " " . $langvars['l_armorpts'], $fighters_lost . " " . $langvars['l_fighters'], $langvars['l_att_andused'] . " " . $playertorpnum . " " . $langvars['l_torps'] . ".

"; } @@ -796,7 +796,7 @@ "WHERE ship_id = ?", array(100, $rating, $playerinfo['ship_id']) ); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); Tki\Bounty::collect($pdo_db, $langvars, $targetinfo['ship_id'], $playerinfo['ship_id']); } else @@ -877,7 +877,7 @@ "ship_goods = ship_goods + ? WHERE ship_id = ?;", array($ship_salvage, $salv_ore, $salv_organics, $salv_goods, $targetinfo['ship_id']) ); - Tki\Db::LogDbErrors($pdo_db, $update6, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $update6, __LINE__, __FILE__); $armor_lost = $targetinfo['armor_pts'] - $targetarmor; $fighters_lost = $targetinfo['ship_fighters'] - $targetfighters; $energy = $targetinfo['ship_energy']; @@ -887,7 +887,7 @@ "torps = torps - ? WHERE ship_id = ?;", array($energy, $fighters_lost, $armor_lost, $targettorpnum, $targetinfo['ship_id']) ); - Tki\Db::LogDbErrors($pdo_db, $update6b, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $update6b, __LINE__, __FILE__); } } diff --git a/bounty.php b/bounty.php index ca48fa10b..b697bd659 100644 --- a/bounty.php +++ b/bounty.php @@ -83,7 +83,7 @@ case 'display': echo "

" . $title . "

\n"; $res5 = $db->Execute("SELECT * FROM {$db->prefix}ships, {$db->prefix}bounty WHERE bounty_on = ship_id AND bounty_on = ?;", array($bounty_on)); - Tki\Db::LogDbErrors($pdo_db, $res5, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res5, __LINE__, __FILE__); $j = 0; if ($res5) { @@ -166,7 +166,7 @@ } $res = $db->Execute("SELECT * FROM {$db->prefix}bounty WHERE bounty_id = ?;", array($bid)); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); if (!$res || $res->RowCount() == 0) { echo $langvars['l_by_nobounty'] . "

"; @@ -189,7 +189,7 @@ } $del = $db->Execute("DELETE FROM {$db->prefix}bounty WHERE bounty_id = ?;", array($bid)); - Tki\Db::LogDbErrors($pdo_db, $del, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $del, __LINE__, __FILE__); $stamp = date("Y-m-d H:i:s"); $refund = $bty['amount']; @@ -199,14 +199,14 @@ $stmt->bindParam(':refund', $refund, \PDO::PARAM_INT); $stmt->bindParam(':ship_id', $playerinfo['ship_id'], \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); echo $langvars['l_by_canceled'] . "
"; Tki\Text::gotoMain($pdo_db, $lang); die(); case 'place': echo "

" . $title . "

\n"; $ex = $db->Execute("SELECT * FROM {$db->prefix}ships WHERE ship_id = ?;", array($bounty_on)); - Tki\Db::LogDbErrors($pdo_db, $ex, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $ex, __LINE__, __FILE__); if (!$ex) { echo $langvars['l_by_notexists'] . "

"; @@ -276,7 +276,7 @@ $maxtrans = $score * $score * $tkireg->max_bountyvalue; $previous_bounty = 0; $pb = $db->Execute("SELECT SUM(amount) AS totalbounty FROM {$db->prefix}bounty WHERE bounty_on = ? AND placed_by = ?;", array($bounty_on, $playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $pb, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $pb, __LINE__, __FILE__); if ($pb) { $prev = $pb->fields; @@ -296,7 +296,7 @@ } $insert = $db->Execute("INSERT INTO {$db->prefix}bounty (bounty_on, placed_by, amount) values (?, ?, ?);", array($bounty_on, $playerinfo['ship_id'], $amount)); - Tki\Db::LogDbErrors($pdo_db, $insert, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $insert, __LINE__, __FILE__); $stamp = date("Y-m-d H:i:s"); $sql = "UPDATE ::prefix::ships SET last_login=:stamp, turns=turns-1, turns_used=turns_used+1, credits=credits-:amount WHERE ship_id=:ship_id"; @@ -305,14 +305,14 @@ $stmt->bindParam(':amount', $amount, \PDO::PARAM_INT); $stmt->bindParam(':ship_id', $playerinfo['ship_id'], \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); echo $langvars['l_by_placed'] . "
"; Tki\Text::gotoMain($pdo_db, $lang); die(); default: echo "

" . $title . "

\n"; $res = $db->Execute("SELECT * FROM {$db->prefix}ships WHERE ship_destroyed = 'N' AND ship_id <> ? ORDER BY character_name ASC;", array($playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); echo "
"; echo ""; echo "
" . $langvars['l_by_bountyon'] . ""; $res = $db->Execute("SELECT email, character_name, ship_destroyed, active, sector FROM {$db->prefix}ships JOIN {$db->prefix}kabal WHERE email = kabal_id ORDER BY sector;"); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); while (!$res->EOF) { $row = $res->fields; @@ -187,7 +187,7 @@ if (empty($operation)) { $res = $db->Execute("SELECT * FROM {$db->prefix}ships JOIN {$db->prefix}kabal WHERE email=kabal_id AND email = ?;", array($user)); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); $row = $res->fields; echo ""; echo ""; @@ -301,7 +301,7 @@ echo "Log Data For This kabal
"; $logres = $db->Execute("SELECT * FROM {$db->prefix}logs WHERE ship_id = ? ORDER BY time DESC, type DESC;", array($row['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $logres, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $logres, __LINE__, __FILE__); while (!$logres->EOF) { $logrow = $logres->fields; @@ -333,7 +333,7 @@ $_dev_fuelscoop = empty($dev_fuelscoop) ? "N" : "Y"; $_active = empty($active) ? "N" : "Y"; $result = $db->Execute("UPDATE {$db->prefix}ships SET character_name = ?, ship_name = ?, ship_destroyed = ?, hull = ?, engines = ?, power = ?, computer = ?, sensors = ?, armor = ?, shields = ?, beams = ?, torp_launchers = ?, cloak = ?, credits = ?, turns = ?, dev_warpedit = ?, dev_genesis = ?, dev_beacon = ?, dev_emerwarp = ?, dev_escapepod = ?, dev_fuelscoop = ?, dev_minedeflector = ?, sector = ?, ship_ore = ?, ship_organics = ?, ship_goods = ?, ship_energy = ?, ship_colonists = ?, ship_fighters = ?, torps = ?, armor_pts = ? WHERE email = ?;", array($character_name, $ship_name, $_ship_destroyed, $hull, $engines, $power, $computer, $sensors, $armor, $shields, $beams, $torp_launchers, $cloak, $credits, $turns, $dev_warpedit, $dev_genesis, $dev_beacon, $dev_emerwarp, $_dev_escapepod, $_dev_fuelscoop, $dev_minedeflector, $sector, $ship_ore, $ship_organics, $ship_goods, $ship_energy, $ship_colonists, $ship_fighters, $torps, $armor_pts, $user)); - Tki\Db::LogDbErrors($pdo_db, $result, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result, __LINE__, __FILE__); if (!$result) { echo "Changes to kabal ship record have FAILED Due to the following Error:

"; @@ -343,7 +343,7 @@ { echo "Changes to kabal ship record have been saved.

"; $result2 = $db->Execute("UPDATE {$db->prefix}kabal SET active = ?, orders = ?, aggression = ? WHERE kabal_id = ?;", array($_active, $orders, $aggression, $user)); - Tki\Db::LogDbErrors($pdo_db, $result2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result2, __LINE__, __FILE__); if (!$result2) { echo "Changes to kabal activity record have FAILED Due to the following Error:

"; @@ -385,12 +385,12 @@ // Delete all kabal in the ships table echo "Deleting kabal records in the ships table...
"; $resx = $db->Execute("DELETE FROM {$db->prefix}ships WHERE email LIKE '%@kabal'"); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); echo "deleted.
"; // Drop kabal table echo "Dropping kabal table...
"; $resy = $db->Execute("DROP TABLE IF EXISTS {$db->prefix}kabal"); - Tki\Db::LogDbErrors($pdo_db, $resy, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resy, __LINE__, __FILE__); echo "dropped.
"; // Create kabal table echo "Re-Creating table: kabal...
"; @@ -402,7 +402,7 @@ "PRIMARY KEY (kabal_id)," . "KEY kabal_id (kabal_id)" . ")"); - Tki\Db::LogDbErrors($pdo_db, $resz, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resz, __LINE__, __FILE__); echo "created.
"; } else @@ -429,12 +429,12 @@ elseif ($operation == "clearkaballog") { $res = $db->Execute("SELECT email,ship_id FROM {$db->prefix}ships WHERE email LIKE '%@kabal'"); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); while (!$res->EOF) { $row = $res->fields; $resx = $db->Execute("DELETE FROM {$db->prefix}logs WHERE ship_id = ?;", array($row['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); echo "Log for ship_id $row[ship_id] cleared.
"; $res->MoveNext(); } @@ -465,7 +465,7 @@ $character = $Sylable1[$sy1roll] . $Sylable2[$sy2roll] . $Sylable3[$sy3roll]; $ADODB_FETCH_MODE = ADODB_FETCH_NUM; $resultnm = $db->Execute("SELECT character_name FROM {$db->prefix}ships WHERE character_name = ?;", array($character)); - Tki\Db::LogDbErrors($pdo_db, $resultnm, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resultnm, __LINE__, __FILE__); $namecheck = $resultnm->fields; $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; $nametry = 1; @@ -478,7 +478,7 @@ $character = $Sylable1[$sy1roll] . $Sylable2[$sy2roll] . $Sylable3[$sy3roll]; $ADODB_FETCH_MODE = ADODB_FETCH_NUM; $resultnm = $db->Execute("SELECT character_name FROM {$db->prefix}ships WHERE character_name = ?;", array($character)); - Tki\Db::LogDbErrors($pdo_db, $resultnm, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resultnm, __LINE__, __FILE__); $namecheck = $resultnm->fields; $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; $nametry++; @@ -533,7 +533,7 @@ $emailname = str_replace(" ", "_", $character) . "@kabal"; // $ADODB_FETCH_MODE = ADODB_FETCH_NUM; // $result = $db->Execute("SELECT email, character_name, ship_name FROM {$db->prefix}ships WHERE email = ? OR character_name = ? OR ship_name = ?;", array($emailname, $character, $shipname)); - // Tki\Db::LogDbErrors($pdo_db, $result, __LINE__, __FILE__); + // Tki\Db::logDbErrors($pdo_db, $result, __LINE__, __FILE__); $sql = "SELECT email, character_name, ship_name FROM ::prefix::ships WHERE email=:email OR character_name=:character_name OR ship_name=:ship_name"; $stmt = $pdo_db->prepare($sql); $stmt->bindParam(':email', $emailname, PDO::PARAM_STR); @@ -599,7 +599,7 @@ $thesql = "INSERT INTO {$db->prefix}ships ( `ship_id` , `ship_name` , `ship_destroyed` , `character_name` , `password` , `email` , `hull` , `engines` , `power` , `computer` , `sensors` , `beams` , `torp_launchers` , `torps` , `shields` , `armor` , `armor_pts` , `cloak` , `credits` , `sector` , `ship_ore` , `ship_organics` , `ship_goods` , `ship_energy` , `ship_colonists` , `ship_fighters` , `ship_damage` , `turns` , `on_planet` , `dev_warpedit` , `dev_genesis` , `dev_beacon` , `dev_emerwarp` , `dev_escapepod` , `dev_fuelscoop` , `dev_minedeflector` , `turns_used` , `last_login` , `rating` , `score` , `team` , `team_invite` , `interface` , `ip_address` , `planet_id` , `trade_colonists` , `trade_fighters` , `trade_torps` , `trade_energy` , `cleared_defenses` , `lang` , `dev_lssd` ) VALUES (NULL,'$shipname','N','$character','$makepass','$emailname',$kaballevel,$kaballevel,$kaballevel,$kaballevel,$kaballevel,$kaballevel,$kaballevel,$maxtorps,$kaballevel,$kaballevel,$maxarmor,$kaballevel,1000,$sector,0,0,0,$maxenergy,0,$maxfighters,0,1200,'N',0,0,0,0,'N','N',0,0, '$stamp',0,0,0,0,'N','127.0.0.1',0,'Y','N','N','Y',NULL,'$default_lang','Y')"; $result2 = $db->Execute($thesql); - Tki\Db::LogDbErrors($pdo_db, $result2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result2, __LINE__, __FILE__); if (!$result2) { echo $db->ErrorMsg() . "
"; @@ -612,7 +612,7 @@ } $result3 = $db->Execute("INSERT INTO {$db->prefix}kabal (kabal_id, active, aggression, orders) values(?,?,?,?)", array($emailname, $_active, $aggression, $orders)); - Tki\Db::LogDbErrors($pdo_db, $result3, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result3, __LINE__, __FILE__); if (!$result3) { echo $db->ErrorMsg() . "
"; diff --git a/login2.php b/login2.php index 0cc7adc80..a1d429aaa 100644 --- a/login2.php +++ b/login2.php @@ -105,7 +105,7 @@ if ($playerinfo !== null && $playerfound !== false) { $res = $db->Execute("SELECT * FROM {$db->prefix}ip_bans WHERE ? LIKE ban_mask OR ? LIKE ban_mask;", array($request->server->get('REMOTE_ADDR'), $playerinfo['ip_address'])); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); if ($res->RecordCount() != 0) { $banned = 1; @@ -135,7 +135,7 @@ $stmt->bindParam(':ip_address', $request->server->get('REMOTE_ADDR'), \PDO::PARAM_INT); $stmt->bindParam(':ship_id', $playerinfo['ship_id'], \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); $_SESSION['logged_in'] = true; $_SESSION['password'] = $filtered_post_password; @@ -166,7 +166,7 @@ $stmt = $pdo_db->prepare($sql); $stmt->bindParam(':ship_id', $playerinfo['ship_id'], \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); $langvars['l_login_died'] = str_replace("[here]", "" . $langvars['l_here'] . "", $langvars['l_login_died']); echo $langvars['l_login_died']; } @@ -178,7 +178,7 @@ if ($tkireg->newbie_nice) { $newbie_info = $db->Execute("SELECT hull, engines, power, computer, sensors, armor, shields, beams, torp_launchers, cloak FROM {$db->prefix}ships WHERE ship_id = ? AND hull <= ? AND engines <= ? AND power <= ? AND computer <= ? AND sensors <= ? AND armor <= ? AND shields <= ? AND beams <= ? AND torp_launchers <= ? AND cloak <= ?;", array($playerinfo['ship_id'], $tkireg->newbie_hull, $tkireg->newbie_engines, $tkireg->newbie_power, $tkireg->newbie_computer, $tkireg->newbie_sensors, $tkireg->newbie_armor, $tkireg->newbie_shields, $tkireg->newbie_beams, $tkireg->newbie_torp_launchers, $tkireg->newbie_cloak)); - Tki\Db::LogDbErrors($pdo_db, $newbie_info, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $newbie_info, __LINE__, __FILE__); $num_rows = $newbie_info->RecordCount(); if ($num_rows) @@ -200,7 +200,7 @@ $stmt = $pdo_db->prepare($sql); $stmt->bindParam(':ship_id', $playerinfo['ship_id'], \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); $langvars['l_login_newlife'] = str_replace("[here]", "" . $langvars['l_here'] . "", $langvars['l_login_newlife']); echo $langvars['l_login_newlife']; diff --git a/lrscan.php b/lrscan.php index f1da7161a..5f794df57 100644 --- a/lrscan.php +++ b/lrscan.php @@ -85,7 +85,7 @@ $stmt->bindParam(':turns_used', $tkireg->fullscan_cost, \PDO::PARAM_INT); $stmt->bindParam(':ship_id', $playerinfo['ship_id'], \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); // User requested a full long range scan $langvars['l_lrs_reach'] = str_replace("[sector]", $playerinfo['sector'], $langvars['l_lrs_reach']); @@ -93,7 +93,7 @@ // Get sectors which can be reached from the player's current sector $result = $db->Execute("SELECT * FROM {$db->prefix}links WHERE link_start = ? ORDER BY link_dest;", array($playerinfo['sector'])); - Tki\Db::LogDbErrors($pdo_db, $result, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result, __LINE__, __FILE__); echo "
kabal name
"; echo " color_header\">\n"; echo " \n"; @@ -117,13 +117,13 @@ $row = $result->fields; // Get number of sectors which can be reached from scanned sector $result2 = $db->Execute("SELECT COUNT(*) AS count FROM {$db->prefix}links WHERE link_start = ?;", array($row['link_dest'])); - Tki\Db::LogDbErrors($pdo_db, $result2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result2, __LINE__, __FILE__); $row2 = $result2->fields; $num_links = $row2['count']; // Get number of ships in scanned sector $result2 = $db->Execute("SELECT COUNT(*) AS count FROM {$db->prefix}ships WHERE sector = ? AND on_planet = 'N' and ship_destroyed = 'N';", array($row['link_dest'])); - Tki\Db::LogDbErrors($pdo_db, $result2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result2, __LINE__, __FILE__); $row2 = $result2->fields; $num_ships = $row2['count']; @@ -136,11 +136,11 @@ // Get port type and discover the presence of a planet in scanned sector $result3 = $db->Execute("SELECT planet_id FROM {$db->prefix}planets WHERE sector_id = ?;", array($row['link_dest'])); - Tki\Db::LogDbErrors($pdo_db, $result3, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result3, __LINE__, __FILE__); $resultSDa = $db->Execute("SELECT SUM(quantity) as mines from {$db->prefix}sector_defense WHERE sector_id = ? and defense_type = 'M';", array($row['link_dest'])); - Tki\Db::LogDbErrors($pdo_db, $resultSDa, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resultSDa, __LINE__, __FILE__); $resultSDb = $db->Execute("SELECT SUM(quantity) as fighters from {$db->prefix}sector_defense WHERE sector_id = ? and defense_type = 'F';", array($row['link_dest'])); - Tki\Db::LogDbErrors($pdo_db, $resultSDb, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resultSDb, __LINE__, __FILE__); $defM = $resultSDa->fields; if ($defM['mines'] === null) @@ -174,7 +174,7 @@ if ($playerinfo['dev_lssd'] == 'Y') { $resx = $db->SelectLimit("SELECT * from {$db->prefix}movement_log WHERE ship_id <> ? AND sector_id = ? ORDER BY time DESC", 1, -1, array('ship_id' => $playerinfo['ship_id'], 'sector_id' => $row['link_dest'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); if (!$resx) { echo ""; @@ -183,7 +183,7 @@ { $myrow = $resx->fields; $res = $db->Execute("SELECT character_name FROM {$db->prefix}ships WHERE ship_id = ?;", array($myrow['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); if ($res) { $row = $res->fields; @@ -235,7 +235,7 @@ // Get sectors which can be reached through scanned sector $result3 = $db->Execute("SELECT link_dest FROM {$db->prefix}links WHERE link_start = ? ORDER BY link_dest ASC;", array($sector)); - Tki\Db::LogDbErrors($pdo_db, $result3, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result3, __LINE__, __FILE__); $i = 0; while (!$result3->EOF) @@ -249,7 +249,7 @@ // Get sectors which can be reached from the player's current sector $result3a = $db->Execute("SELECT link_dest FROM {$db->prefix}links WHERE link_start = ?;", array($playerinfo['sector'])); - Tki\Db::LogDbErrors($pdo_db, $result3a, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result3a, __LINE__, __FILE__); $i = 0; $flag = 0; @@ -307,7 +307,7 @@ { // Get ships located in the scanned sector $result4 = $db->Execute("SELECT ship_id, ship_name, character_name, cloak FROM {$db->prefix}ships WHERE sector = ? AND on_planet = 'N';", array($sector)); - Tki\Db::LogDbErrors($pdo_db, $result4, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result4, __LINE__, __FILE__); if ($result4->EOF) { echo $langvars['l_none']; @@ -375,7 +375,7 @@ echo "color_line2\">"; echo "color_line2\">"; echo "
" . $langvars['l_sector'] . "None
" . $langvars['l_planets'] . "
"; $query = $db->Execute("SELECT name, owner FROM {$db->prefix}planets WHERE sector_id = ?;", array($sectorinfo['sector_id'])); - Tki\Db::LogDbErrors($pdo_db, $query, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $query, __LINE__, __FILE__); if ($query->EOF) { @@ -401,7 +401,7 @@ else { $result5 = $db->Execute("SELECT character_name FROM {$db->prefix}ships WHERE ship_id = ?;", array($planet['owner'])); - Tki\Db::LogDbErrors($pdo_db, $result5, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result5, __LINE__, __FILE__); $planet_owner_name = $result5->fields; echo " ($planet_owner_name[character_name])"; } @@ -410,9 +410,9 @@ } $resultSDa = $db->Execute("SELECT SUM(quantity) as mines from {$db->prefix}sector_defense WHERE sector_id = ? and defense_type = 'M';", array($sector)); - Tki\Db::LogDbErrors($pdo_db, $resultSDa, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resultSDa, __LINE__, __FILE__); $resultSDb = $db->Execute("SELECT SUM(quantity) as fighters from {$db->prefix}sector_defense WHERE sector_id = ? and defense_type = 'F';", array($sector)); - Tki\Db::LogDbErrors($pdo_db, $resultSDb, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resultSDb, __LINE__, __FILE__); $defM = $resultSDa->fields; if ($defM['mines'] === null) @@ -440,7 +440,7 @@ echo "
" . $langvars['l_lss'] . "
"; $resx = $db->SelectLimit("SELECT * FROM {$db->prefix}movement_log WHERE ship_id <> ? AND sector_id = ? ORDER BY time DESC", 1, -1, array('ship_id' => $playerinfo['ship_id'], 'sector_id' => $sector)); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); if (!$resx) { echo "None"; @@ -449,7 +449,7 @@ { $myrow = $resx->fields; $res = $db->Execute("SELECT character_name FROM {$db->prefix}ships WHERE ship_id = ?;", array($myrow['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); if ($res) { $row = $res->fields; diff --git a/mail.php b/mail.php index b6d241691..ccc942434 100644 --- a/mail.php +++ b/mail.php @@ -31,7 +31,7 @@ $mail = filter_input(INPUT_GET, 'mail', FILTER_SANITIZE_EMAIL); $result = $db->SelectLimit("SELECT character_name, email, password, ship_id FROM {$db->prefix}ships WHERE email = ?", 1, -1, array('email' => $mail)); -Tki\Db::LogDbErrors($pdo_db, $result, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $result, __LINE__, __FILE__); if (!$result->EOF) { @@ -74,7 +74,7 @@ $stmt->bindParam(':time', time(), \PDO::PARAM_INT); $stmt->bindParam(':ship_id', $playerinfo['ship_id'], \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); mail($playerinfo['email'], $langvars['l_mail_topic'], $langvars['l_mail_message'] . "\r\n\r\n" . htmlentities($link_to_reset, ENT_QUOTES | ENT_HTML5, 'UTF-8') . "\r\n", "From: {$tkireg->admin_mail}\r\nReply-To: {$tkireg->admin_mail}\r\nX-Mailer: PHP/" . phpversion()); echo "
" . $langvars['l_mail_sent'] . " {$mail}
\n"; diff --git a/mailto.php b/mailto.php index 818a30b37..04c99d6c2 100644 --- a/mailto.php +++ b/mailto.php @@ -94,9 +94,9 @@ if (empty($content)) { $res = $db->Execute("SELECT character_name FROM {$db->prefix}ships WHERE email NOT LIKE '%@Kabal' AND ship_id <> ? ORDER BY character_name ASC;", array($playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); $res2 = $db->Execute("SELECT team_name FROM {$db->prefix}teams WHERE admin ='N' ORDER BY team_name ASC;"); - Tki\Db::LogDbErrors($pdo_db, $res2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res2, __LINE__, __FILE__); echo "\n"; echo " \n"; echo " \n"; @@ -159,10 +159,10 @@ { $timestamp = date("Y\-m\-d H\:i\:s"); $res = $db->Execute("SELECT ship_id FROM {$db->prefix}ships WHERE character_name = ?;", array($to)); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); $target_info = $res->fields; $resx = $db->Execute("INSERT INTO {$db->prefix}messages (sender_id, recp_id, sent, subject, message) VALUES (?, ?, ?, ?, ?);", array($playerinfo['ship_id'], $target_info['ship_id'], $timestamp, $subject, $content)); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); if ($db->ErrorNo() != 0) { echo "Message failed to send: " . $db->ErrorMsg() . "
\n"; @@ -179,17 +179,17 @@ $to = trim($to); $to = addslashes($to); $res = $db->Execute("SELECT id FROM {$db->prefix}teams WHERE team_name = ?;", array($to)); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); $row = $res->fields; $res2 = $db->Execute("SELECT ship_id FROM {$db->prefix}ships WHERE team = ?;", array($row['id'])); - Tki\Db::LogDbErrors($pdo_db, $res2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res2, __LINE__, __FILE__); while (!$res2->EOF) { $row2 = $res2->fields; $resx = $db->Execute("INSERT INTO {$db->prefix}messages (sender_id, recp_id, sent, subject, message) VALUES (?, ?, ?, ?, ?);", array($playerinfo['ship_id'], $row2['ship_id'], $timestamp, $subject, $content)); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); $res2->MoveNext(); } } diff --git a/main.php b/main.php index ec97eb6c4..c4e508a31 100644 --- a/main.php +++ b/main.php @@ -34,7 +34,7 @@ // Get playerinfo from database $sql = "SELECT * FROM ::prefix::ships WHERE email=:email LIMIT 1"; $stmt = $pdo_db->prepare($sql); -$sql_test = Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); +$sql_test = Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); if ($sql_test === true) { $stmt->bindParam(':email', $_SESSION['username'], PDO::PARAM_STR); @@ -70,7 +70,7 @@ if ($playerinfo['on_planet'] == "Y") { $res2 = $db->Execute("SELECT planet_id, owner FROM {$db->prefix}planets WHERE planet_id = ?;", array($playerinfo['planet_id'])); - Tki\Db::LogDbErrors($pdo_db, $res2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res2, __LINE__, __FILE__); if ($res2->RecordCount() != 0) { echo "" . $langvars['l_clickme'] . " " . $langvars['l_toplanetmenu'] . "
"; @@ -83,7 +83,7 @@ $stmt = $pdo_db->prepare($sql); $stmt->bindParam(':ship_id', $playerinfo['ship_id'], \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); echo "
" . $langvars['l_nonexistant_pl'] . "

"; } } @@ -164,7 +164,7 @@ $num_messages = 0; $sql = "SELECT COUNT(*) FROM ::prefix::messages WHERE recp_id=:recp_id AND notified='N'"; $stmt = $pdo_db->prepare($sql); -$sql_test = Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); +$sql_test = Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); if ($sql_test === true) { @@ -187,7 +187,7 @@ $stmt = $pdo_db->prepare($sql); $stmt->bindParam(':sectors', $playerinfo['ship_id'], \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); } $ply_turns = number_format($playerinfo['turns'], 0, $langvars['local_number_dec_point'], $langvars['local_number_thousands_sep']); @@ -336,7 +336,7 @@ // Traderoute query $tr_result = $db->Execute("SELECT * FROM {$db->prefix}traderoutes WHERE source_type = ? AND source_id = ? AND owner = ? ORDER BY dest_id ASC;", array("P", $playerinfo['sector'], $playerinfo['ship_id'])); -Tki\Db::LogDbErrors($pdo_db, $tr_result, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $tr_result, __LINE__, __FILE__); while (!$tr_result->EOF) { $traderoutes[$i] = $tr_result->fields; @@ -347,7 +347,7 @@ // Sector defense trade route query - this is still under developement $sd_tr_result = $db->Execute("SELECT * FROM {$db->prefix}traderoutes WHERE source_type='D' AND source_id = ? AND owner = ? ORDER BY dest_id ASC;", array($playerinfo['sector'], $playerinfo['ship_id'])); -Tki\Db::LogDbErrors($pdo_db, $sd_tr_result, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $sd_tr_result, __LINE__, __FILE__); while (!$sd_tr_result->EOF) { $traderoutes[$i] = $sd_tr_result->fields; @@ -358,7 +358,7 @@ // Personal planet traderoute type query $ppl_tr_result = $db->Execute("SELECT * FROM {$db->prefix}planets, {$db->prefix}traderoutes WHERE source_type = 'L' AND source_id = {$db->prefix}planets.planet_id AND {$db->prefix}planets.sector_id = ? AND {$db->prefix}traderoutes.owner = ?;", array($playerinfo['sector'], $playerinfo['ship_id'])); -Tki\Db::LogDbErrors($pdo_db, $ppl_tr_result, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $ppl_tr_result, __LINE__, __FILE__); while (!$ppl_tr_result->EOF) { $traderoutes[$i] = $ppl_tr_result->fields; @@ -369,7 +369,7 @@ // Team planet traderoute type query $tmpl_tr_result = $db->Execute("SELECT * FROM {$db->prefix}planets, {$db->prefix}traderoutes WHERE source_type = 'C' AND source_id = {$db->prefix}planets.planet_id AND {$db->prefix}planets.sector_id = ? AND {$db->prefix}traderoutes.owner = ?;", array($playerinfo['sector'], $playerinfo['ship_id'])); -Tki\Db::LogDbErrors($pdo_db, $tmpl_tr_result, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $tmpl_tr_result, __LINE__, __FILE__); while (!$tmpl_tr_result->EOF) { $traderoutes[$i] = $tmpl_tr_result->fields; @@ -402,7 +402,7 @@ else { $pl_result = $db->Execute("SELECT name FROM {$db->prefix}planets WHERE planet_id = ?;", array($traderoutes[$i]['source_id'])); - Tki\Db::LogDbErrors($pdo_db, $pl_result, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $pl_result, __LINE__, __FILE__); if (!$pl_result || $pl_result->RecordCount() == 0) { echo $langvars['l_unknown']; @@ -441,7 +441,7 @@ else { $pl_dest_result = $db->Execute("SELECT name FROM {$db->prefix}planets WHERE planet_id = ?;", array($traderoutes[$i]['dest_id'])); - Tki\Db::LogDbErrors($pdo_db, $pl_dest_result, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $pl_dest_result, __LINE__, __FILE__); if (!$pl_dest_result || $pl_dest_result->RecordCount() == 0) { @@ -609,7 +609,7 @@ $sql .= "ORDER BY :rand"; $stmt = $pdo_db->prepare($sql); - $sql_test = Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + $sql_test = Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); if ($sql_test === true) { $stmt->bindParam(':ship_id', $playerinfo['ship_id'], PDO::PARAM_INT); @@ -619,7 +619,7 @@ $result4 = $stmt->fetchAll(PDO::FETCH_ASSOC); } - Tki\Db::LogDbErrors($pdo_db, $result4, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result4, __LINE__, __FILE__); if ($result4 !== false) { @@ -851,7 +851,7 @@ // Pull the presets for the player from the db. $i = 0; $debug_query = $db->Execute("SELECT * FROM {$db->prefix}presets WHERE ship_id = ?;", array($playerinfo['ship_id'])); -Tki\Db::LogDbErrors($pdo_db, $debug_query, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $debug_query, __LINE__, __FILE__); while (!$debug_query->EOF) { $presetinfo[$i] = $debug_query->fields; diff --git a/mines.php b/mines.php index 860efc3f0..6f63f5c0a 100644 --- a/mines.php +++ b/mines.php @@ -137,7 +137,7 @@ } $res = $db->Execute("SELECT allow_defenses, {$db->prefix}universe.zone_id, owner FROM {$db->prefix}zones, {$db->prefix}universe WHERE sector_id = ? AND {$db->prefix}zones.zone_id = {$db->prefix}universe.zone_id", array($playerinfo['sector'])); -Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); $zoneinfo = $res->fields; if ($zoneinfo['allow_defenses'] == 'N') @@ -268,12 +268,12 @@ $stmt->bindParam(':mode', $mode, \PDO::PARAM_INT); $stmt->bindParam(':fighter_id', $fighter_id, \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); } else { $update = $db->Execute("INSERT INTO {$db->prefix}sector_defense (ship_id, sector_id, defense_type, quantity, fm_setting) values (?, ?, ?, ?, ?);", array($playerinfo['ship_id'], $playerinfo['sector'], 'F', $numfighters, $mode)); - Tki\Db::LogDbErrors($pdo_db, $update, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $update, __LINE__, __FILE__); echo $db->ErrorMsg(); } } @@ -288,12 +288,12 @@ $stmt->bindParam(':mode', $mode, \PDO::PARAM_INT); $stmt->bindParam(':defense_id', $mine_id, \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); } else { $update = $db->Execute("INSERT INTO {$db->prefix}sector_defense (ship_id, sector_id, defense_type, quantity, fm_setting) values (?, ?, ?, ?, ?);", array($playerinfo['ship_id'], $playerinfo['sector'], 'M', $nummines, $mode)); - Tki\Db::LogDbErrors($pdo_db, $update, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $update, __LINE__, __FILE__); } } @@ -305,7 +305,7 @@ $stmt->bindParam(':nummines', $nummines, \PDO::PARAM_INT); $stmt->bindParam(':ship_id', $playerinfo['ship_id'], \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); } } diff --git a/move.php b/move.php index d36f9e07c..e0e5c59c5 100644 --- a/move.php +++ b/move.php @@ -59,7 +59,7 @@ // Retrive all the warp links out of the current sector $result3 = $db->Execute("SELECT * FROM {$db->prefix}links WHERE link_start = ?;", array($playerinfo['sector'])); -Tki\Db::LogDbErrors($pdo_db, $result3, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $result3, __LINE__, __FILE__); $i = 0; $flag = 0; @@ -89,7 +89,7 @@ $move_result = $db->Execute("UPDATE {$db->prefix}ships SET last_login = ?," . "turns = turns - 1, turns_used = turns_used + 1," . "sector = ? WHERE ship_id = ?;", array($stamp, $sector, $playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $move_result, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $move_result, __LINE__, __FILE__); if (!$move_result) { // is this really STILL needed? @@ -116,7 +116,7 @@ echo $langvars['l_move_failed'] . '

'; $resx = $db->Execute("UPDATE {$db->prefix}ships SET cleared_defenses=' ' " . "WHERE ship_id = ?;", array($playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); Tki\Text::gotoMain($pdo_db, $lang); } diff --git a/navcomp.php b/navcomp.php index 03c9936d7..c59e963b7 100644 --- a/navcomp.php +++ b/navcomp.php @@ -166,7 +166,7 @@ } else { - Tki\Db::LogDbErrors($pdo_db, $search_result, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $search_result, __LINE__, __FILE__); $found = $search_result->RecordCount(); if ($found > 0) { diff --git a/new2.php b/new2.php index 3f5a2c640..f56cd548b 100644 --- a/new2.php +++ b/new2.php @@ -144,7 +144,7 @@ $result2 = $db->Execute("INSERT INTO {$db->prefix}ships (ship_name, ship_destroyed, character_name, password, email, armor_pts, credits, ship_energy, ship_fighters, turns, on_planet, dev_warpedit, dev_genesis, dev_beacon, dev_emerwarp, dev_escapepod, dev_fuelscoop, dev_minedeflector, last_login, ip_address, trade_colonists, trade_fighters, trade_torps, trade_energy, cleared_defenses, lang, dev_lssd) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);", array($shipname, 'N', $character, $hashed_pass, $username, 10, 1000, 100, 10, $mturns, 'N', 0, 0, 0, 0, 'N', 'N', 0, $stamp, $request->server->get('REMOTE_ADDR'), 'Y', 'N', 'N', 'Y', null, $lang, 'N')); - Tki\Db::LogDbErrors($pdo_db, $result2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result2, __LINE__, __FILE__); if (!$result2) { @@ -153,7 +153,7 @@ else { $result2 = $db->Execute("SELECT ship_id FROM {$db->prefix}ships WHERE email = ?;", array($username)); - Tki\Db::LogDbErrors($pdo_db, $result2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result2, __LINE__, __FILE__); $shipid = $result2->fields; $shipid['ship_id'] = (int) $shipid['ship_id']; @@ -175,10 +175,10 @@ Tki\LogMove::writeLog($pdo_db, $shipid['ship_id'], 1); // A new player is placed into sector 1. Make sure his movement log shows it, so they see it on the galaxy map. $resx = $db->Execute("INSERT INTO {$db->prefix}zones VALUES (NULL, ?, ?, 'N', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 0);", array($character . "\'s Territory", $shipid['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); $resx = $db->Execute("INSERT INTO {$db->prefix}ibank_accounts (ship_id,balance,loan) VALUES (?,0,0);", array($shipid['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); // Add presets for new player for ($zz = 0; $zz < $tkireg->max_presets; $zz++) diff --git a/planet.php b/planet.php index edf796323..1957a36b6 100644 --- a/planet.php +++ b/planet.php @@ -104,7 +104,7 @@ if ($playerinfo['on_planet'] == 'Y') { $resx = $db->Execute("UPDATE {$db->prefix}ships SET on_planet='N' WHERE ship_id = ?;", array($playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); } echo $langvars['l_planet_none'] . "

"; @@ -172,11 +172,11 @@ if ($playerinfo['dev_genesis'] > 0) { $update = $db->Execute("DELETE FROM {$db->prefix}planets WHERE planet_id = ?;", array($planet_id)); - Tki\Db::LogDbErrors($pdo_db, $update, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $update, __LINE__, __FILE__); $update2 = $db->Execute("UPDATE {$db->prefix}ships SET turns_used = turns_used + 1, turns = turns - 1, dev_genesis = dev_genesis - 1 WHERE ship_id = ?", array($playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $update2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $update2, __LINE__, __FILE__); $update3 = $db->Execute("UPDATE {$db->prefix}ships SET on_planet='N' WHERE planet_id = ?;", array($planet_id)); - Tki\Db::LogDbErrors($pdo_db, $update3, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $update3, __LINE__, __FILE__); Tki\Ownership::calc($pdo_db, $playerinfo['sector'], $tkireg->min_bases_to_own, $langvars); header("Location: main.php"); } @@ -352,13 +352,13 @@ // Set planet to not sell echo $langvars['l_planet_nownosell'] . "
"; $result4 = $db->Execute("UPDATE {$db->prefix}planets SET sells='N' WHERE planet_id = ?;", array($planet_id)); - Tki\Db::LogDbErrors($pdo_db, $result4, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result4, __LINE__, __FILE__); } else { echo $langvars['l_planet_nowsell'] . "
"; $result4b = $db->Execute("UPDATE {$db->prefix}planets SET sells='Y' WHERE planet_id = ?;", array($planet_id)); - Tki\Db::LogDbErrors($pdo_db, $result4b, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result4b, __LINE__, __FILE__); } } elseif ($command == "name") @@ -375,7 +375,7 @@ // Name2 menu $new_name = trim(htmlentities($_POST['new_name'], ENT_HTML5, 'UTF-8')); $result5 = $db->Execute("UPDATE {$db->prefix}planets SET name = ? WHERE planet_id = ?;", array($new_name, $planet_id)); - Tki\Db::LogDbErrors($pdo_db, $result5, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result5, __LINE__, __FILE__); echo $langvars['l_planet_cname'] . " " . $new_name . "."; } elseif ($command == "land") @@ -383,14 +383,14 @@ // Land menu echo $langvars['l_planet_landed'] . "

"; $update = $db->Execute("UPDATE {$db->prefix}ships SET on_planet='Y', planet_id = ? WHERE ship_id = ?;", array($planet_id, $playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $update, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $update, __LINE__, __FILE__); } elseif ($command == "leave") { // Leave menu echo $langvars['l_planet_left'] . "

"; $update = $db->Execute("UPDATE {$db->prefix}ships SET on_planet='N' WHERE ship_id = ?;", array($playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $update, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $update, __LINE__, __FILE__); } elseif ($command == "transfer") { @@ -447,11 +447,11 @@ { // Create The Base $update1 = $db->Execute("UPDATE {$db->prefix}planets SET base='Y', ore = ? - ?, organics = ? - ?, goods = ? - ?, credits = ? - ? WHERE planet_id = ?;", array($planetinfo['ore'], $tkireg->base_ore, $planetinfo['organics'], $tkireg->base_organics, $planetinfo['goods'], $tkireg->base_goods, $planetinfo['credits'], $tkireg->base_credits, $planet_id)); - Tki\Db::LogDbErrors($pdo_db, $update1, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $update1, __LINE__, __FILE__); // Update User Turns $update1b = $db->Execute("UPDATE {$db->prefix}ships SET turns = turns - 1, turns_used = turns_used + 1 WHERE ship_id = ?;", array($playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $update1b, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $update1b, __LINE__, __FILE__); // Refresh Planet Info $sql = "SELECT * FROM ::prefix::planets WHERE planet_id=:planet_id LIMIT 1"; @@ -501,7 +501,7 @@ else { $resx = $db->Execute("UPDATE {$db->prefix}planets SET prod_ore= ? , prod_organics = ?, prod_goods = ?, prod_energy = ?, prod_fighters = ?, prod_torp = ? WHERE planet_id = ?;", array($pore, $porganics, $pgoods, $penergy, $pfighters, $ptorp, $planet_id)); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); echo $langvars['l_planet_p_changed'] . "

"; } } @@ -517,7 +517,7 @@ // Leave menu echo $langvars['l_planet_left'] . "

"; $update = $db->Execute("UPDATE {$db->prefix}ships SET on_planet = 'N', planet_id = 0 WHERE ship_id = ?;", array($playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $update, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $update, __LINE__, __FILE__); $langvars['l_global_mmenu'] = str_replace("[here]", "" . $langvars['l_here'] . "", $langvars['l_global_mmenu']); echo $langvars['l_global_mmenu'] . "
\n"; header("Location: main.php"); @@ -875,7 +875,7 @@ // } $res = $db->Execute("SELECT * FROM {$db->prefix}ships WHERE on_planet = 'Y' and planet_id = ?;", array($planet_id)); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); while (!$res->EOF) { @@ -903,13 +903,13 @@ } $update = $db->Execute("UPDATE {$db->prefix}ships SET turns = turns - 1, turns_used = turns_used + 1 WHERE ship_id = ?;", array($playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $update, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $update, __LINE__, __FILE__); } elseif ($command == "capture" && $planetinfo['owner'] == 0) { echo $langvars['l_planet_captured'] . "
"; $update = $db->Execute("UPDATE {$db->prefix}planets SET team = 0, owner = ?, base = 'N', defeated = 'N' WHERE planet_id = ?;", array($playerinfo['ship_id'], $planet_id)); - Tki\Db::LogDbErrors($pdo_db, $update, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $update, __LINE__, __FILE__); $ownership = Tki\Ownership::calc($pdo_db, $playerinfo['sector'], $tkireg, $langvars); if ($ownership !== null) @@ -941,7 +941,7 @@ { echo $langvars['l_planet_notdef'] . "
"; $resx = $db->Execute("UPDATE {$db->prefix}planets SET defeated='N' WHERE planet_id = ?;", array($planetinfo['planet_id'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); } else { diff --git a/port.php b/port.php index 0e28fffe7..1469d8cea 100644 --- a/port.php +++ b/port.php @@ -43,28 +43,28 @@ if ($playerinfo['ship_ore'] < 0) { $fixres = $db->Execute("UPDATE {$db->prefix}ships SET ship_ore = 0 WHERE email = ?;", array($_SESSION['username'])); - Tki\Db::LogDbErrors($pdo_db, $fixres, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $fixres, __LINE__, __FILE__); $playerinfo['ship_ore'] = 0; } if ($playerinfo['ship_organics'] < 0) { $fixres = $db->Execute("UPDATE {$db->prefix}ships SET ship_organics = 0 WHERE email = ?;", array($_SESSION['username'])); - Tki\Db::LogDbErrors($pdo_db, $fixres, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $fixres, __LINE__, __FILE__); $playerinfo['ship_organics'] = 0; } if ($playerinfo['ship_energy'] < 0) { $fixres = $db->Execute("UPDATE {$db->prefix}ships SET ship_energy = 0 WHERE email = ?;", array($_SESSION['username'])); - Tki\Db::LogDbErrors($pdo_db, $fixres, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $fixres, __LINE__, __FILE__); $playerinfo['ship_energy'] = 0; } if ($playerinfo['ship_goods'] < 0) { $fixres = $db->Execute("UPDATE {$db->prefix}ships SET ship_goods = 0 WHERE email = ?;", array($_SESSION['username'])); - Tki\Db::LogDbErrors($pdo_db, $fixres, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $fixres, __LINE__, __FILE__); $playerinfo['ship_goods'] = 0; } @@ -78,28 +78,28 @@ if ($sectorinfo['port_ore'] < 0) { $fixres = $db->Execute("UPDATE {$db->prefix}universe SET port_ore = 0 WHERE sector_id = ?;", array($playerinfo['sector'])); - Tki\Db::LogDbErrors($pdo_db, $fixres, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $fixres, __LINE__, __FILE__); $sectorinfo['port_ore'] = 0; } if ($sectorinfo['port_goods'] < 0) { $fixres = $db->Execute("UPDATE {$db->prefix}universe SET port_goods = 0 WHERE sector_id = ?;", array($playerinfo['sector'])); - Tki\Db::LogDbErrors($pdo_db, $fixres, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $fixres, __LINE__, __FILE__); $sectorinfo['port_goods'] = 0; } if ($sectorinfo['port_organics'] < 0) { $fixres = $db->Execute("UPDATE {$db->prefix}universe SET port_organics = 0 WHERE sector_id = ?;", array($playerinfo['sector'])); - Tki\Db::LogDbErrors($pdo_db, $fixres, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $fixres, __LINE__, __FILE__); $sectorinfo['port_organics'] = 0; } if ($sectorinfo['port_energy'] < 0) { $fixres = $db->Execute("UPDATE {$db->prefix}universe SET port_energy = 0 WHERE sector_id = ?;", array($playerinfo['sector'])); - Tki\Db::LogDbErrors($pdo_db, $fixres, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $fixres, __LINE__, __FILE__); $sectorinfo['port_energy'] = 0; } @@ -326,12 +326,12 @@ if ($tkireg->bounty_all_special) { $res2 = $db->Execute("SELECT SUM(amount) as total_bounty FROM {$db->prefix}bounty WHERE placed_by = 0 AND bounty_on = ?;", array($playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $res2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res2, __LINE__, __FILE__); } else { $res2 = $db->Execute("SELECT SUM(amount) as total_bounty FROM {$db->prefix}bounty WHERE placed_by = 0 AND bounty_on = ? AND ?=2;", array($playerinfo['ship_id'], $sectorinfo['zone_id'])); - Tki\Db::LogDbErrors($pdo_db, $res2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res2, __LINE__, __FILE__); } if ($res2) @@ -357,10 +357,10 @@ else { $resx = $db->Execute("UPDATE {$db->prefix}ships SET credits = credits - ? WHERE ship_id = ?;", array($bty['total_bounty'], $playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); $resx = $db->Execute("DELETE FROM {$db->prefix}bounty WHERE bounty_on = ? AND placed_by = 0;", array($playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); $langvars['l_port_bountypaid'] = str_replace("[here]", "" . $langvars['l_here'] . "", $langvars['l_port_bountypaid']); echo $langvars['l_port_bountypaid'] . "
"; @@ -390,10 +390,10 @@ $bounty_payment = $bty['total_bounty']; $resx = $db->Execute("UPDATE {$db->prefix}ibank_accounts SET balance = balance - ? WHERE ship_id = ?;", array($bounty_payment, $playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); $resx = $db->Execute("DELETE FROM {$db->prefix}bounty WHERE bounty_on = ? AND placed_by = 0;", array($playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); $langvars['l_port_bountypaid'] = str_replace("[here]", "" . $langvars['l_here'] . "", $langvars['l_port_bountypaid']); echo $langvars['l_port_bountypaid'] . "
"; @@ -409,9 +409,9 @@ echo "
\n"; $resx = $db->Execute("UPDATE {$db->prefix}ibank_accounts SET balance = balance - ? WHERE ship_id = ?;", array($bounty_payment, $playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); $resx = $db->Execute("UPDATE {$db->prefix}bounty SET amount = amount - ? WHERE bounty_on = ? AND placed_by = 0;", array($bounty_payment, $playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); echo "You have paid part of the bounty.
\n"; echo "
\n"; diff --git a/port2.php b/port2.php index f5bad8780..d45c02f5c 100644 --- a/port2.php +++ b/port2.php @@ -509,7 +509,7 @@ $query = $query . ", turns = turns - 1, turns_used = turns_used + 1 WHERE ship_id = " . $playerinfo['ship_id']; $purchase = $db->Execute("$query"); - Tki\Db::LogDbErrors($pdo_db, $purchase, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $purchase, __LINE__, __FILE__); $hull_upgrade = 0; echo "

"; @@ -522,7 +522,7 @@ // Tki\Ports::buildTwoCol("Detected Illegal Cargo", "Fixed", "left", "right"); echo "Detected illegal cargo, as a penalty, we are confiscating all of your cargo, you may now continue.\n"; $resx = $db->Execute("UPDATE {$db->prefix}ships SET ship_ore=0, ship_organics=0, ship_goods=0, ship_energy=0, ship_colonists =0 WHERE ship_id = ? LIMIT 1;", array($playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); $admin_log->writeLog($pdo_db, 5001, "Detected illegal cargo on shipID: {$playerinfo['ship_id']}"); } else @@ -682,7 +682,7 @@ // Update ship cargo, credits and turns $trade_result = $db->Execute("UPDATE {$db->prefix}ships SET turns = turns - 1, turns_used = turns_used + 1, rating = rating + 1, credits = credits - ?, ship_ore = ship_ore + ?, ship_organics = ship_organics + ?, ship_goods = ship_goods + ?, ship_energy = ship_energy + ? WHERE ship_id = ?;", array($total_cost, $trade_ore, $trade_organics, $trade_goods, $trade_energy, $playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $trade_result, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $trade_result, __LINE__, __FILE__); // Make all trades positive to change port values $trade_ore = round(abs($trade_ore)); @@ -692,7 +692,7 @@ // Decrease supply and demand on port $trade_result2 = $db->Execute("UPDATE {$db->prefix}universe SET port_ore = port_ore - ?, port_organics = port_organics - ?, port_goods = port_goods - ?, port_energy = port_energy - ? WHERE sector_id = ?;", array($trade_ore, $trade_organics, $trade_goods, $trade_energy, $sectorinfo['sector_id'])); - Tki\Db::LogDbErrors($pdo_db, $trade_result2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $trade_result2, __LINE__, __FILE__); echo $langvars['l_trade_complete'] . ".

"; } diff --git a/pwreset.php b/pwreset.php index 95222a102..fb506264a 100644 --- a/pwreset.php +++ b/pwreset.php @@ -39,7 +39,7 @@ // because 8 characters is 4,294,967,296 combinations, and that should be sufficiently secure $result = $db->SelectLimit("SELECT character_name, email, recovery_time FROM {$db->prefix}ships WHERE substr(MD5(password),6,8) = ?", 1, -1, array('password' => $reset_code)); -Tki\Db::LogDbErrors($pdo_db, $result, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $result, __LINE__, __FILE__); if (!$result->EOF && $result !== false) { @@ -101,7 +101,7 @@ // $stmt = $pdo_db->prepare($sql); // $stmt->bindParam(':ship_id', $playerinfo['ship_id'], \PDO::PARAM_INT); // $result = $stmt->execute(); -// Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); +// Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); /// Log user in (like login does) diff --git a/pwreset2.php b/pwreset2.php index b12f9c621..6f9cdf954 100644 --- a/pwreset2.php +++ b/pwreset2.php @@ -41,7 +41,7 @@ // because 8 characters is 4,294,967,296 combinations, and that should be sufficiently secure $result = $db->SelectLimit("SELECT ship_id, email, recovery_time FROM {$db->prefix}ships WHERE substr(MD5(password),6,8) = ?", 1, -1, array('password' => $reset_code)); -Tki\Db::LogDbErrors($pdo_db, $result, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $result, __LINE__, __FILE__); if (!$result->EOF && $result !== false) { @@ -91,7 +91,7 @@ $stmt->bindParam(':hashed_pass', $hashed_pass, \PDO::PARAM_STR); $stmt->bindParam(':ship_id', $playerinfo['ship_id'], \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); // Now check to see if we have a valid update and have ONLY 1 changed record. if ((is_bool($rs) && $rs === false) || $db->Affected_Rows() != 1) @@ -123,7 +123,7 @@ $stmt = $pdo_db->prepare($sql); $stmt->bindParam(':ship_id', $playerinfo['ship_id'], \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); echo $langvars['l_pwr_success'] . "

"; echo str_replace("[here]", "" . $langvars['l_here'] . "", $langvars['l_global_mmenu']); diff --git a/readmail.php b/readmail.php index 90c09abfa..730516529 100644 --- a/readmail.php +++ b/readmail.php @@ -48,19 +48,19 @@ if ($_GET['action'] == "delete") { $resx = $db->Execute("DELETE FROM {$db->prefix}messages WHERE ID=? AND recp_id = ?;", array($ID, $playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); } elseif ($_GET['action'] == "delete_all") { $resx = $db->Execute("DELETE FROM {$db->prefix}messages WHERE recp_id = ?;", array($playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); } $cur_D = date("Y-m-d"); $cur_T = date("H:i:s"); $res = $db->Execute("SELECT * FROM {$db->prefix}messages WHERE recp_id = ? ORDER BY sent DESC;", array($playerinfo['ship_id'])); -Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); ?>
@@ -108,7 +108,7 @@ { $msg = $res->fields; $result = $db->Execute("SELECT * FROM {$db->prefix}ships WHERE ship_id = ?;", array($msg['sender_id'])); - Tki\Db::LogDbErrors($pdo_db, $result, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result, __LINE__, __FILE__); $sender = $result->fields; ?> diff --git a/rsmove.php b/rsmove.php index 4b1d1b652..5a075e048 100644 --- a/rsmove.php +++ b/rsmove.php @@ -58,7 +58,7 @@ $stmt = $pdo_db->prepare($sql); $stmt->bindParam(':ship_id', $playerinfo['ship_id'], \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); } else { @@ -86,12 +86,12 @@ // Ok, we have been given the destination value. // Get the players current sector information. $result2 = $db->Execute("SELECT angle1, angle2, distance FROM {$db->prefix}universe WHERE sector_id = ?;", array($playerinfo['sector'])); - Tki\Db::LogDbErrors($pdo_db, $result2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result2, __LINE__, __FILE__); $start = $result2->fields; // Get the destination sector information. $result3 = $db->Execute("SELECT angle1, angle2, distance FROM {$db->prefix}universe WHERE sector_id = ?;", array($destination)); - Tki\Db::LogDbErrors($pdo_db, $result3, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result3, __LINE__, __FILE__); $finish = $result3->fields; // Calculate the distance. @@ -174,7 +174,7 @@ $stmt = $pdo_db->prepare($sql); $stmt->bindParam(':ship_id', $playerinfo['ship_id'], \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); } else { @@ -190,7 +190,7 @@ $langvars = Tki\Translate::load($pdo_db, $lang, array('rsmove', 'common', 'global_funcs', 'global_includes', 'combat', 'footer', 'news')); $stamp = date("Y-m-d H:i:s"); $update = $db->Execute("UPDATE {$db->prefix}ships SET last_login = ?, sector = ?, ship_energy = ship_energy + ?, turns = turns - ?, turns_used = turns_used + ? WHERE ship_id = ?;", array($stamp, $destination, $energyscooped, $triptime, $triptime, $playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $update, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $update, __LINE__, __FILE__); // Future: Determine where $destination gets changed to something other than int. In the meantime, make it correct here. $destination = (int) $destination; diff --git a/scan.php b/scan.php index 3d616a4ed..199ad65a6 100644 --- a/scan.php +++ b/scan.php @@ -45,7 +45,7 @@ } $result2 = $db->Execute("SELECT * FROM {$db->prefix}ships WHERE ship_id = ?;", array($filtered_ship_id)); -Tki\Db::LogDbErrors($pdo_db, $result2, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $result2, __LINE__, __FILE__); $targetinfo = $result2->fields; $targetinfo['ship_id'] = (int) $targetinfo['ship_id']; @@ -111,7 +111,7 @@ // Get total bounty on this player, if any $btyamount = 0; $hasbounty = $db->Execute("SELECT SUM(amount) AS btytotal FROM {$db->prefix}bounty WHERE bounty_on = ?", array($targetinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $hasbounty, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $hasbounty, __LINE__, __FILE__); if ($hasbounty) { @@ -125,7 +125,7 @@ // Check for Federation bounty $hasfedbounty = $db->Execute("SELECT SUM(amount) AS btytotal FROM {$db->prefix}bounty WHERE bounty_on = ? AND placed_by = 0", array($targetinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $hasfedbounty, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $hasfedbounty, __LINE__, __FILE__); if ($hasfedbounty) { $resy = $hasfedbounty->fields; @@ -468,7 +468,7 @@ $stmt = $pdo_db->prepare($sql); $stmt->bindParam(':ship_id', $playerinfo['ship_id'], \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); } } diff --git a/scheduler.php b/scheduler.php index c1021bff8..9939c44ab 100644 --- a/scheduler.php +++ b/scheduler.php @@ -104,7 +104,7 @@ $schedCount = 0; $lastrunList = null; $sched_res = $db->Execute("SELECT * FROM {$db->prefix}scheduler"); - Tki\Db::LogDbErrors($pdo_db, $sched_res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sched_res, __LINE__, __FILE__); if ($sched_res) { while (!$sched_res->EOF) @@ -129,7 +129,7 @@ if ($event['spawn'] - $multiplier == 0) { $resx = $db->Execute("DELETE FROM {$db->prefix}scheduler WHERE sched_id = ?", array($event['sched_id'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); } else { @@ -139,7 +139,7 @@ $stmt->bindParam(':multiplier', $multiplier, \PDO::PARAM_INT); $stmt->bindParam(':sched_id', $event['sched_id'], \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); } } else @@ -149,7 +149,7 @@ $stmt->bindParam(':ticks_left', $ticks_left, \PDO::PARAM_INT); $stmt->bindParam(':sched_id', $event['sched_id'], \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); } $sched_var_id = $event['sched_id']; @@ -184,7 +184,7 @@ $stmt = $pdo_db->prepare($sql); $stmt->bindParam(':time', time(), \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); } echo "
"; diff --git a/scheduler/sched_apocalypse.php b/scheduler/sched_apocalypse.php index 947a4ef8a..252ac072d 100644 --- a/scheduler/sched_apocalypse.php +++ b/scheduler/sched_apocalypse.php @@ -24,7 +24,7 @@ echo $langvars['l_apoc_begins'] . "..
"; $doomsday = $db->Execute("SELECT * FROM {$db->prefix}planets WHERE colonists > ?;", array($tkireg->doomsday_value)); -Tki\Db::LogDbErrors($pdo_db, $doomsday, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $doomsday, __LINE__, __FILE__); $chance = 9; $reccount = $doomsday->RecordCount(); if ($reccount > 200) @@ -53,7 +53,7 @@ { echo $langvars['l_apoc_plague'] . "
."; $resx = $db->Execute("UPDATE {$db->prefix}planets SET colonists = ROUND (colonists - colonists * ?) WHERE planet_id = ?;", array($space_plague_kills, $targetinfo['planet_id'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); $logpercent = round($space_plague_kills * 100); Tki\PlayerLog::WriteLog($pdo_db, $targetinfo['owner'], \Tki\LogEnums::SPACE_PLAGUE, "$targetinfo[name]|$targetinfo[sector_id]|$logpercent"); } @@ -61,7 +61,7 @@ { echo $langvars['l_apoc_plasma'] . "
."; $resy = $db->Execute("UPDATE {$db->prefix}planets SET energy = 0 WHERE planet_id = ?;", array($targetinfo['planet_id'])); - Tki\Db::LogDbErrors($pdo_db, $resy, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resy, __LINE__, __FILE__); Tki\PlayerLog::WriteLog($pdo_db, $targetinfo['owner'], \Tki\LogEnums::PLASMA_STORM, "$targetinfo[name]|$targetinfo[sector_id]"); } } diff --git a/scheduler/sched_degrade.php b/scheduler/sched_degrade.php index ae44caa5c..a28fc8c33 100644 --- a/scheduler/sched_degrade.php +++ b/scheduler/sched_degrade.php @@ -22,20 +22,20 @@ echo "" . $langvars['l_degrade_title'] . "

"; $res = $db->Execute("SELECT * FROM {$db->prefix}sector_defense WHERE defense_type = 'F'"); -Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); while (!$res->EOF) { $row = $res->fields; $res3 = $db->Execute("SELECT * FROM {$db->prefix}ships WHERE ship_id = ?;", array($row['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $res3, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res3, __LINE__, __FILE__); $sched_playerinfo = $res3->fields; $res2 = $db->Execute("SELECT * FROM {$db->prefix}planets WHERE (owner = ? OR (team = ? AND ? <> 0)) AND sector_id = ? AND energy > 0;", array($row['ship_id'], $sched_playerinfo['team'], $sched_playerinfo['team'], $row['sector_id'])); - Tki\Db::LogDbErrors($pdo_db, $res2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res2, __LINE__, __FILE__); if ($res2->EOF) { $resa = $db->Execute("UPDATE {$db->prefix}sector_defense SET quantity = quantity - GREATEST(ROUND(quantity * ?),1) WHERE defense_id = ? AND quantity > 0;", array($defense_degrade_rate, $row['defense_id'])); - Tki\Db::LogDbErrors($pdo_db, $resa, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resa, __LINE__, __FILE__); $degrade_rate = $defense_degrade_rate * 100; Tki\PlayerLog::WriteLog($pdo_db, $row['ship_id'], \Tki\LogEnums::DEFENSE_DEGRADE, $row['sector_id'] ."|". $degrade_rate); } @@ -43,7 +43,7 @@ { $energy_required = round($row['quantity'] * $energy_per_fighter); $res4 = $db->Execute("SELECT IFNULL(SUM(energy),0) AS energy_available FROM {$db->prefix}planets WHERE (owner = ? OR (team = ? AND ? <> 0)) AND sector_id = ?", array($row['ship_id'], $sched_playerinfo['team'], $sched_playerinfo['team'], $row['sector_id'])); - Tki\Db::LogDbErrors($pdo_db, $res4, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res4, __LINE__, __FILE__); $planet_energy = $res4->fields; $energy_available = $planet_energy['energy_available']; $langvars['l_degrade_note'] = str_replace("[energy_avail]", $energy_available, $langvars['l_degrade_note']); @@ -55,14 +55,14 @@ { $degrade_row = $res2->fields; $resb = $db->Execute("UPDATE {$db->prefix}planets SET energy = energy - GREATEST(ROUND(? * (energy / ?)),1) WHERE planet_id = ?", array($energy_required, $energy_available, $degrade_row['planet_id'])); - Tki\Db::LogDbErrors($pdo_db, $resb, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resb, __LINE__, __FILE__); $res2->MoveNext(); } } else { $resc = $db->Execute("UPDATE {$db->prefix}sector_defense SET quantity = quantity - GREATEST(ROUND(quantity * ?),1) WHERE defense_id = ?;", array($defense_degrade_rate, $row['defense_id'])); - Tki\Db::LogDbErrors($pdo_db, $resc, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resc, __LINE__, __FILE__); $degrade_rate = $defense_degrade_rate * 100; Tki\PlayerLog::WriteLog($pdo_db, $row['ship_id'], \Tki\LogEnums::DEFENSE_DEGRADE, $row['sector_id'] ."|". $degrade_rate); } @@ -72,4 +72,4 @@ } $resx = $db->Execute("DELETE FROM {$db->prefix}sector_defense WHERE quantity <= 0"); -Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); diff --git a/scheduler/sched_ibank.php b/scheduler/sched_ibank.php index 4c309cbe8..dbe96b4ec 100644 --- a/scheduler/sched_ibank.php +++ b/scheduler/sched_ibank.php @@ -26,7 +26,7 @@ echo "" . $langvars['l_sched_ibank_title'] . "

"; $ibank_result = $db->Execute("UPDATE {$db->prefix}ibank_accounts SET balance = balance * ?, loan = loan * ?", array($exponinter, $expoloan)); -Tki\Db::LogDbErrors($pdo_db, $ibank_result, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $ibank_result, __LINE__, __FILE__); $langvars['l_sched_ibank_note'] = str_replace("[multiplier]", $multiplier, $langvars['l_sched_ibank_note']); echo $langvars['l_sched_ibank_note'] . "

"; diff --git a/scheduler/sched_kabal.php b/scheduler/sched_kabal.php index eab6af186..109f6fca4 100644 --- a/scheduler/sched_kabal.php +++ b/scheduler/sched_kabal.php @@ -38,7 +38,7 @@ $furcount3h = 0; /* -//Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); +//Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); $res = $db->Execute("SELECT * FROM {$db->prefix}ships JOIN {$db->prefix}kabal WHERE email=kabal_id and active='Y' and ship_destroyed='N' ORDER BY ship_id"); while (($res instanceof ADORecordSet) && ($res != false)) //while (!$res->EOF) @@ -59,7 +59,7 @@ // Find a target in my sector, not myself, not on a planet $reso0 = $db->Execute("SELECT * FROM {$db->prefix}ships WHERE sector = ? AND email! = ? AND email NOT LIKE '%@kabal' AND planet_id = 0 AND ship_id > 1", array($playerinfo['sector'], $playerinfo['email'])); - Tki\Db::LogDbErrors($pdo_db, $res0, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res0, __LINE__, __FILE__); if (!$reso0->EOF) { $rowo0 = $reso0->fields; @@ -108,7 +108,7 @@ } // Find a target in my sector, not myself $reso1 = $db->Execute("SELECT * FROM {$db->prefix}ships WHERE sector = ? and email! = ? and ship_id > 1", array($targetlink, $playerinfo['email'])); - Tki\Db::LogDbErrors($pdo_db, $reso1, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $reso1, __LINE__, __FILE__); if (!$reso1->EOF) { $rowo1 = $reso1->fields; @@ -170,7 +170,7 @@ // FIND A TARGET // IN MY SECTOR, NOT MYSELF $reso2 = $db->Execute("SELECT * FROM {$db->prefix}ships WHERE sector = ? and email! = ? and ship_id > 1", array($targetlink, $playerinfo['email'])); - Tki\Db::LogDbErrors($pdo_db, $reso2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $reso2, __LINE__, __FILE__); if (!$reso2->EOF) { $rowo2 = $reso2->fields; @@ -245,7 +245,7 @@ // FIND A TARGET // IN MY SECTOR, NOT MYSELF $reso3 = $db->Execute("SELECT * FROM {$db->prefix}ships WHERE sector = ? and email! = ? and ship_id > 1", array($playerinfo['sector'], $playerinfo['email'])); - Tki\Db::LogDbErrors($pdo_db, $reso3, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $reso3, __LINE__, __FILE__); if (!$reso3->EOF) { $rowo3 = $reso3->fields; diff --git a/scheduler/sched_news.php b/scheduler/sched_news.php index e73366baf..54a4e1b0a 100644 --- a/scheduler/sched_news.php +++ b/scheduler/sched_news.php @@ -22,7 +22,7 @@ echo "" . $langvars['l_sched_news_title'] . "
\n"; $sql = $db->Execute("SELECT IF(COUNT(*)>0, SUM(colonists), 0) AS total_colonists, COUNT(owner) AS total_planets, owner, character_name FROM {$db->prefix}planets, {$db->prefix}ships WHERE owner != '0' AND owner=ship_id GROUP BY owner ORDER BY owner ASC;"); -Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); while (!$sql->EOF) { @@ -40,7 +40,7 @@ if ($row['total_planets'] >= 1000) { $sql2 = $db->Execute("SELECT * FROM {$db->prefix}news WHERE user_id = ? AND news_type = 'planet1000';", array($row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $sql2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql2, __LINE__, __FILE__); if ($sql2->EOF) { @@ -49,13 +49,13 @@ $headline = $langvars['l_news_p_headline2'] ." ". $planetcount ." ". $langvars['l_news_planets']; $langvars['l_news_p_text1002'] = str_replace("[name]", $name, $langvars['l_news_p_text1000']); $news = $db->Execute("INSERT INTO {$db->prefix}news (headline, newstext, user_id, date, news_type) VALUES (?, ?, ?, NOW(), 'planet1000');", array($headline, $langvars['l_news_p_text1002'], $row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $news, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $news, __LINE__, __FILE__); } } elseif ($row['total_planets'] >= 500) { $sql2 = $db->Execute("SELECT * FROM {$db->prefix}news WHERE user_id = ? AND news_type = 'planet500';", array($row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $sql2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql2, __LINE__, __FILE__); if ($sql2->EOF) { @@ -64,13 +64,13 @@ $headline = $langvars['l_news_p_headline2'] ." ". $planetcount ." ". $langvars['l_news_planets']; $langvars['l_news_p_text502'] = str_replace("[name]", $name, $langvars['l_news_p_text500']); $news = $db->Execute("INSERT INTO {$db->prefix}news (headline, newstext, user_id, date, news_type) VALUES (?, ?, ?, NOW(), 'planet500');", array($headline, $langvars['l_news_p_text502'], $row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $news, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $news, __LINE__, __FILE__); } } elseif ($row['total_planets'] >= 250) { $sql2 = $db->Execute("SELECT * FROM {$db->prefix}news WHERE user_id = ? AND news_type = 'planet250';", array($row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $sql2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql2, __LINE__, __FILE__); if ($sql2->EOF) { @@ -79,13 +79,13 @@ $headline = $langvars['l_news_p_headline2'] ." ". $planetcount ." ". $langvars['l_news_planets']; $langvars['l_news_p_text2502'] = str_replace("[name]", $name, $langvars['l_news_p_text250']); $news = $db->Execute("INSERT INTO {$db->prefix}news (headline, newstext, user_id, date, news_type) VALUES (?, ?, ?, NOW(), 'planet250');", array($headline, $langvars['l_news_p_text2502'], $row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $news, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $news, __LINE__, __FILE__); } } elseif ($row['total_planets'] >= 100) { $sql2 = $db->Execute("SELECT * FROM {$db->prefix}news WHERE user_id = ? AND news_type = 'planet100';", array($row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $sql2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql2, __LINE__, __FILE__); if ($sql2->EOF) { @@ -94,13 +94,13 @@ $headline = $langvars['l_news_p_headline2'] ." ". $planetcount ." ". $langvars['l_news_planets']; $langvars['l_news_p_text102'] = str_replace("[name]", $name, $langvars['l_news_p_text100']); $news = $db->Execute("INSERT INTO {$db->prefix}news (headline, newstext, user_id, date, news_type) VALUES (?, ?, ?, NOW(), 'planet100');", array($headline, $langvars['l_news_p_text102'], $row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $news, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $news, __LINE__, __FILE__); } } elseif ($row['total_planets'] >= 50) { $sql2 = $db->Execute("SELECT * FROM {$db->prefix}news WHERE user_id = ? AND news_type = 'planet50';", array($row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $sql2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql2, __LINE__, __FILE__); if ($sql2->EOF) { @@ -109,13 +109,13 @@ $headline = $langvars['l_news_p_headline2'] ." ". $planetcount ." ". $langvars['l_news_planets']; $langvars['l_news_p_text502'] = str_replace("[name]", $name, $langvars['l_news_p_text50']); $news = $db->Execute("INSERT INTO {$db->prefix}news (headline, newstext, user_id, date, news_type) VALUES (?, ?, ?, NOW(), 'planet50');", array($headline, $langvars['l_news_p_text502'], $row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $news, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $news, __LINE__, __FILE__); } } elseif ($row['total_planets'] >= 25) { $sql2 = $db->Execute("SELECT * FROM {$db->prefix}news WHERE user_id = ? AND news_type = 'planet25';", array($row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $sql2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql2, __LINE__, __FILE__); if ($sql2->EOF) { @@ -124,13 +124,13 @@ $headline = $langvars['l_news_p_headline2'] ." ". $planetcount ." ". $langvars['l_news_planets']; $langvars['l_news_p_text252'] = str_replace("[name]", $name, $langvars['l_news_p_text25']); $news = $db->Execute("INSERT INTO {$db->prefix}news (headline, newstext, user_id, date, news_type) VALUES (?, ?, ?, NOW(), 'planet25');", array($headline, $langvars['l_news_p_text252'], $row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $news, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $news, __LINE__, __FILE__); } } elseif ($row['total_planets'] >= 10) { $sql2 = $db->Execute("SELECT * FROM {$db->prefix}news WHERE user_id = ? AND news_type = 'planet10'", array($row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $sql2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql2, __LINE__, __FILE__); if ($sql2->EOF) { @@ -139,13 +139,13 @@ $headline = $langvars['l_news_p_headline2'] ." ". $planetcount ." ". $langvars['l_news_planets']; $langvars['l_news_p_text102'] = str_replace("[name]", $name, $langvars['l_news_p_text10']); $news = $db->Execute("INSERT INTO {$db->prefix}news (headline, newstext, user_id, date, news_type) VALUES (?, ?, ?, NOW(), 'planet10');", array($headline, $langvars['l_news_p_text102'], $row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $news, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $news, __LINE__, __FILE__); } } elseif ($row['total_planets'] >= 5) { $sql2 = $db->Execute("SELECT * FROM {$db->prefix}news WHERE user_id = ? AND news_type = 'planet5';", array($row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $sql2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql2, __LINE__, __FILE__); if ($sql2->EOF) { @@ -154,7 +154,7 @@ $headline = $langvars['l_news_p_headline2'] ." ". $planetcount ." ". $langvars['l_news_planets']; $langvars['l_news_p_text52'] = str_replace("[name]", $name, $langvars['l_news_p_text5']); $news = $db->Execute("INSERT INTO {$db->prefix}news (headline, newstext, user_id, date, news_type) VALUES (?, ?, ?, NOW(), 'planet5');", array($headline, $langvars['l_news_p_text52'], $row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $news, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $news, __LINE__, __FILE__); } } // End generation of planet amount @@ -162,7 +162,7 @@ if ($row['total_colonists'] >= 1000000000) { $sql2 = $db->Execute("SELECT * FROM {$db->prefix}news WHERE user_id = ? AND news_type = 'col1000';", array($row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $sql2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql2, __LINE__, __FILE__); if ($sql2->EOF) { @@ -171,13 +171,13 @@ $headline = $langvars['l_news_p_headline2'] ." ". $colcount ." ". $langvars['l_news_cols']; $langvars['l_news_c_text10002'] = str_replace("[name]", $name, $langvars['l_news_c_text1000']); $news = $db->Execute("INSERT INTO {$db->prefix}news (headline, newstext, user_id, date, news_type) VALUES (?, ?, ?, NOW(), 'col1000');", array($headline, $langvars['l_news_c_text10002'], $row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $news, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $news, __LINE__, __FILE__); } } elseif ($row['total_colonists'] >= 500000000) { $sql2 = $db->Execute("SELECT * FROM {$db->prefix}news WHERE user_id = ? AND news_type = 'col500';", array($row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $sql2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql2, __LINE__, __FILE__); if ($sql2->EOF) { @@ -186,13 +186,13 @@ $headline = $langvars['l_news_p_headline2'] ." ". $colcount ." ". $langvars['l_news_cols']; $langvars['l_news_c_text5002'] = str_replace("[name]", $name, $langvars['l_news_c_text500']); $news = $db->Execute("INSERT INTO {$db->prefix}news (headline, newstext, user_id, date, news_type) VALUES (?, ?, ?, NOW(), 'col500');", array($headline, $langvars['l_news_c_text5002'], $row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $news, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $news, __LINE__, __FILE__); } } elseif ($row['total_colonists'] >= 100000000) { $sql2 = $db->Execute("SELECT * FROM {$db->prefix}news WHERE user_id = ? AND news_type = 'col100';", array($row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $sql2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql2, __LINE__, __FILE__); if ($sql2->EOF) { @@ -201,13 +201,13 @@ $headline = $langvars['l_news_p_headline2'] ." ". $colcount ." ". $langvars['l_news_cols']; $langvars['l_news_c_text1002'] = str_replace("[name]", $name, $langvars['l_news_c_text100']); $news = $db->Execute("INSERT INTO {$db->prefix}news (headline, newstext, user_id, date, news_type) VALUES (?, ?, ?, NOW(), 'col100');", array($headline, $langvars['l_news_c_text1002'], $row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $news, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $news, __LINE__, __FILE__); } } elseif ($row['total_colonists'] >= 25000000) { $sql2 = $db->Execute("SELECT * FROM {$db->prefix}news WHERE user_id = ? AND news_type = 'col25';", array($row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $sql2, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql2, __LINE__, __FILE__); if ($sql2->EOF) { @@ -216,7 +216,7 @@ $headline = $langvars['l_news_p_headline2'] ." ". $colcount ." ". $langvars['l_news_cols']; $langvars['l_news_c_text252'] = str_replace("[name]", $name, $langvars['l_news_c_text25']); $news = $db->Execute("INSERT INTO {$db->prefix}news (headline, newstext, user_id, date, news_type) VALUES (?, ?, ?, NOW(), 'col25');", array($headline, $langvars['l_news_c_text252'], $row['owner'])); - Tki\Db::LogDbErrors($pdo_db, $news, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $news, __LINE__, __FILE__); } } diff --git a/scheduler/sched_planets.php b/scheduler/sched_planets.php index d475de16c..9552a6814 100644 --- a/scheduler/sched_planets.php +++ b/scheduler/sched_planets.php @@ -25,11 +25,11 @@ echo "" . $langvars['l_sched_planets_title'] . "

"; $res = $db->Execute("SELECT * FROM {$db->prefix}planets WHERE owner > 0"); -Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); // We are now using transactions to off load the SQL stuff in full to the Database Server. $result = $db->Execute("START TRANSACTION"); -Tki\Db::LogDbErrors($pdo_db, $result, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $result, __LINE__, __FILE__); while (!$res->EOF) { $row = $res->fields; @@ -77,16 +77,16 @@ $credits_production = floor($production * $credits_prate * (100.0 - $total_percent) / 100.0); $ret = $db->Execute("UPDATE {$db->prefix}planets SET organics = organics + ?, ore = ore + ?, goods = goods + ?, energy = energy + ?, colonists = colonists + ? - ?, torps = torps + ?, fighters = fighters + ?, credits = credits * ? + ? WHERE planet_id = ? LIMIT 1; ", array($organics_production, $ore_production, $goods_production, $energy_production, $reproduction, $starvation, $torp_production, $fighter_production, $interest_rate, $credits_production, $row['planet_id'])); - Tki\Db::LogDbErrors($pdo_db, $ret, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $ret, __LINE__, __FILE__); $res->MoveNext(); } $ret = $db->Execute("COMMIT"); -Tki\Db::LogDbErrors($pdo_db, $ret, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $ret, __LINE__, __FILE__); if ($tkireg->sched_planet_valid_credits) { $ret = $db->Execute("UPDATE {$db->prefix}planets SET credits = ? WHERE credits > ? AND base = 'N';", array($tkireg->max_credits_without_base, $tkireg->max_credits_without_base)); - Tki\Db::LogDbErrors($pdo_db, $ret, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $ret, __LINE__, __FILE__); } echo $langvars['l_sched_planets_updated'] . ".

"; diff --git a/scheduler/sched_ports.php b/scheduler/sched_ports.php index 13c62ab24..198a71693 100644 --- a/scheduler/sched_ports.php +++ b/scheduler/sched_ports.php @@ -27,90 +27,90 @@ echo $langvars['l_sched_ports_addore']; $resa = $db->Execute("UPDATE {$db->prefix}universe SET port_ore = port_ore + ($tkireg->ore_rate * $multiplier * $tkireg->port_regenrate ) WHERE port_type='ore' AND port_ore < $tkireg->ore_limit"); -$debug = Tki\Db::LogDbErrors($pdo_db, $resa, __LINE__, __FILE__); +$debug = Tki\Db::logDbErrors($pdo_db, $resa, __LINE__, __FILE__); Tki\Scheduler::isQueryOk($pdo_db, $debug); echo $langvars['l_sched_ports_addore_ore']; $resb = $db->Execute("UPDATE {$db->prefix}universe SET port_ore = port_ore + ($tkireg->ore_rate * $multiplier * $tkireg->port_regenrate) WHERE port_type!='special' AND port_type!='none' AND port_ore < $tkireg->ore_limit"); -$debug = Tki\Db::LogDbErrors($pdo_db, $resb, __LINE__, __FILE__); +$debug = Tki\Db::logDbErrors($pdo_db, $resb, __LINE__, __FILE__); Tki\Scheduler::isQueryOk($pdo_db, $debug); echo $langvars['l_sched_ports_min_ore']; $resc = $db->Execute("UPDATE {$db->prefix}universe SET port_ore = 0 WHERE port_ore < 0"); -$debug = Tki\Db::LogDbErrors($pdo_db, $resc, __LINE__, __FILE__); +$debug = Tki\Db::logDbErrors($pdo_db, $resc, __LINE__, __FILE__); Tki\Scheduler::isQueryOk($pdo_db, $debug); echo "
"; // Update Organics in Ports echo $langvars['l_sched_ports_addorg']; $resd = $db->Execute("UPDATE {$db->prefix}universe SET port_organics = port_organics + (? * ? * ?) WHERE port_type='organics' AND port_organics < ?", array($tkireg->organics_rate, $multiplier, $tkireg->port_regenrate, $tkireg->organics_limit)); -$debug = Tki\Db::LogDbErrors($pdo_db, $resd, __LINE__, __FILE__); +$debug = Tki\Db::logDbErrors($pdo_db, $resd, __LINE__, __FILE__); Tki\Scheduler::isQueryOk($pdo_db, $debug); echo $langvars['l_sched_ports_addorg_org']; $rese = $db->Execute("UPDATE {$db->prefix}universe SET port_organics = port_organics + (? * ? * ?) WHERE port_type!='special' AND port_type!='none' AND port_organics < ?", array($tkireg->organics_rate, $multiplier, $tkireg->port_regenrate, $tkireg->organics_limit)); -$debug = Tki\Db::LogDbErrors($pdo_db, $rese, __LINE__, __FILE__); +$debug = Tki\Db::logDbErrors($pdo_db, $rese, __LINE__, __FILE__); Tki\Scheduler::isQueryOk($pdo_db, $debug); echo $langvars['l_sched_ports_min_org']; $resf = $db->Execute("UPDATE {$db->prefix}universe SET port_organics = 0 WHERE port_organics < 0"); -$debug = Tki\Db::LogDbErrors($pdo_db, $resf, __LINE__, __FILE__); +$debug = Tki\Db::logDbErrors($pdo_db, $resf, __LINE__, __FILE__); Tki\Scheduler::isQueryOk($pdo_db, $debug); echo "
"; // Update Goods in Ports echo $langvars['l_sched_ports_addgoods']; $resg = $db->Execute("UPDATE {$db->prefix}universe SET port_goods = port_goods + (? * ? * ?) WHERE port_type='goods' AND port_goods < ?", array($tkireg->goods_rate, $multiplier, $tkireg->port_regenrate, $tkireg->goods_limit)); -$debug = Tki\Db::LogDbErrors($pdo_db, $resg, __LINE__, __FILE__); +$debug = Tki\Db::logDbErrors($pdo_db, $resg, __LINE__, __FILE__); Tki\Scheduler::isQueryOk($pdo_db, $debug); echo $langvars['l_sched_ports_addgoods_goods']; $resh = $db->Execute("UPDATE {$db->prefix}universe SET port_goods = port_goods + (? * ? * ?) WHERE port_type!='special' AND port_type!='none' AND port_goods < ?", array($tkireg->goods_rate, $multiplier, $tkireg->port_regenrate, $tkireg->goods_limit)); -$debug = Tki\Db::LogDbErrors($pdo_db, $resh, __LINE__, __FILE__); +$debug = Tki\Db::logDbErrors($pdo_db, $resh, __LINE__, __FILE__); Tki\Scheduler::isQueryOk($pdo_db, $debug); echo $langvars['l_sched_ports_min_goods']; $resi = $db->Execute("UPDATE {$db->prefix}universe SET port_goods = 0 WHERE port_goods < 0"); -$debug = Tki\Db::LogDbErrors($pdo_db, $resi, __LINE__, __FILE__); +$debug = Tki\Db::logDbErrors($pdo_db, $resi, __LINE__, __FILE__); Tki\Scheduler::isQueryOk($pdo_db, $debug); echo "
"; // Update Energy in Ports echo $langvars['l_sched_ports_addenergy']; $resj = $db->Execute("UPDATE {$db->prefix}universe SET port_energy = port_energy + (? * ? * ?) WHERE port_type='energy' AND port_energy < ?", array($tkireg->energy_rate, $multiplier, $tkireg->port_regenrate, $tkireg->energy_limit)); -$debug = Tki\Db::LogDbErrors($pdo_db, $resj, __LINE__, __FILE__); +$debug = Tki\Db::logDbErrors($pdo_db, $resj, __LINE__, __FILE__); Tki\Scheduler::isQueryOk($pdo_db, $debug); echo $langvars['l_sched_ports_addenergy_energy']; $resk = $db->Execute("UPDATE {$db->prefix}universe SET port_energy = port_energy + (? * ? * ?) WHERE port_type!='special' AND port_type!='none' AND port_energy < ?", array($tkireg->energy_rate, $multiplier, $tkireg->port_regenrate, $tkireg->energy_limit)); -$debug = Tki\Db::LogDbErrors($pdo_db, $resk, __LINE__, __FILE__); +$debug = Tki\Db::logDbErrors($pdo_db, $resk, __LINE__, __FILE__); Tki\Scheduler::isQueryOk($pdo_db, $debug); echo $langvars['l_sched_ports_min_energy']; $resl = $db->Execute("UPDATE {$db->prefix}universe SET port_energy = 0 WHERE port_energy < 0"); -$debug = Tki\Db::LogDbErrors($pdo_db, $resl, __LINE__, __FILE__); +$debug = Tki\Db::logDbErrors($pdo_db, $resl, __LINE__, __FILE__); Tki\Scheduler::isQueryOk($pdo_db, $debug); echo "
"; // Now check to see if any ports are over max, if so correct them. echo $langvars['l_sched_ports_energy_cap']; $resm = $db->Execute("UPDATE {$db->prefix}universe SET port_energy = ? WHERE port_energy > ?", array($tkireg->energy_limit, $tkireg->energy_limit)); -$debug = Tki\Db::LogDbErrors($pdo_db, $resm, __LINE__, __FILE__); +$debug = Tki\Db::logDbErrors($pdo_db, $resm, __LINE__, __FILE__); Tki\Scheduler::isQueryOk($pdo_db, $debug); echo $langvars['l_sched_ports_goods_cap']; $resn = $db->Execute("UPDATE {$db->prefix}universe SET port_goods = ? WHERE port_goods > ?", array($tkireg->goods_limit, $tkireg->goods_limit)); -$debug = Tki\Db::LogDbErrors($pdo_db, $resn, __LINE__, __FILE__); +$debug = Tki\Db::logDbErrors($pdo_db, $resn, __LINE__, __FILE__); Tki\Scheduler::isQueryOk($pdo_db, $debug); echo $langvars['l_sched_ports_organics_cap']; $reso = $db->Execute("UPDATE {$db->prefix}universe SET port_organics = ? WHERE port_organics > ?", array($tkireg->organics_limit, $tkireg->organics_limit)); -$debug = Tki\Db::LogDbErrors($pdo_db, $reso, __LINE__, __FILE__); +$debug = Tki\Db::logDbErrors($pdo_db, $reso, __LINE__, __FILE__); Tki\Scheduler::isQueryOk($pdo_db, $debug); echo $langvars['l_sched_ports_ore_cap']; $resp = $db->Execute("UPDATE {$db->prefix}universe SET port_ore = ? WHERE port_ore > ?", array($tkireg->ore_limit, $tkireg->ore_limit)); -$debug = Tki\Db::LogDbErrors($pdo_db, $resp, __LINE__, __FILE__); +$debug = Tki\Db::logDbErrors($pdo_db, $resp, __LINE__, __FILE__); Tki\Scheduler::isQueryOk($pdo_db, $debug); $multiplier = 0; diff --git a/scheduler/sched_ranking.php b/scheduler/sched_ranking.php index eb6f8ec5e..ac774dc34 100644 --- a/scheduler/sched_ranking.php +++ b/scheduler/sched_ranking.php @@ -22,7 +22,7 @@ echo "" . $langvars['l_sched_ranking_title'] . "

"; $res = $db->Execute("SELECT ship_id FROM {$db->prefix}ships WHERE ship_destroyed='N'"); -Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); while (!$res->EOF) { Tki\Score::updateScore($pdo_db, $res->fields['ship_id'], $tkireg, $playerinfo); diff --git a/scheduler/sched_thegovernor.php b/scheduler/sched_thegovernor.php index d41f34083..db05b945e 100644 --- a/scheduler/sched_thegovernor.php +++ b/scheduler/sched_thegovernor.php @@ -28,7 +28,7 @@ echo $langvars['l_sched_gov_valid_fits']; $tdres = $db->Execute("SELECT * FROM {$db->prefix}ships"); -Tki\Db::LogDbErrors($pdo_db, $tdres, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $tdres, __LINE__, __FILE__); $detected = (bool) false; @@ -45,7 +45,7 @@ { echo "'-> " . $langvars['l_sched_gov_detect_fits_ships'] . $playerinfo['ship_id'] . " *** " . $langvars['l_sched_fixed'] . "***
"; $resx = $db->Execute("UPDATE {$db->prefix}ships SET ship_fighters = ? WHERE ship_id = ? LIMIT 1;", array($ship_fighters_max, $playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); if ($db->ErrorNo() > 0) { @@ -60,7 +60,7 @@ echo $langvars['l_sched_gov_detect_fits_ships']; echo "'-> " . $langvars['l_sched_gov_fit_flip'] . $playerinfo['ship_id'] . " *** " . $langvars['l_sched_fixed'] . "***
"; $resy = $db->Execute("UPDATE {$db->prefix}ships SET ship_fighters = ? WHERE ship_id = ? LIMIT 1;", array(0, $playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resy, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resy, __LINE__, __FILE__); if ($db->ErrorNo() > 0) { @@ -76,7 +76,7 @@ { echo "'-> " . $langvars['l_sched_gov_torp_over'] . $playerinfo['ship_id'] . " *** " . $langvars['l_sched_fixed'] . "***
"; $resz = $db->Execute("UPDATE {$db->prefix}ships SET torps = ? WHERE ship_id = ? LIMIT 1;", array($torps_max, $playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resz, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resz, __LINE__, __FILE__); if ($db->ErrorNo() > 0) { @@ -90,7 +90,7 @@ { echo "'-> " . $langvars['l_sched_gov_torp_flip'] . $playerinfo['ship_id'] . " *** " . $langvars['l_sched_fixed'] . "***
"; $resa = $db->Execute("UPDATE {$db->prefix}ships SET torps = ? WHERE ship_id = ? LIMIT 1;", array(0, $playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resa, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resa, __LINE__, __FILE__); if ($db->ErrorNo() > 0) { echo $langvars['l_sched_database_error'] . $db->ErrorMsg() . "
"; @@ -105,7 +105,7 @@ { echo "'-> " . $langvars['l_sched_gov_armor_over'] . $playerinfo['ship_id'] . " *** " . $langvars['l_sched_fixed'] . "***
"; $resb = $db->Execute("UPDATE {$db->prefix}ships SET armor_pts = ? WHERE ship_id = ? LIMIT 1;", array($armor_pts_max, $playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resb, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resb, __LINE__, __FILE__); if ($db->ErrorNo() > 0) { @@ -119,7 +119,7 @@ { echo "'-> " . $langvars['l_sched_gov_armor_flip'] . $playerinfo['ship_id'] . " *** " . $langvars['l_sched_fixed'] . "***
"; $resc = $db->Execute("UPDATE {$db->prefix}ships SET armor_pts = ? WHERE ship_id = ? LIMIT 1;", array(0, $playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resc, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resc, __LINE__, __FILE__); if ($db->ErrorNo() > 0) { @@ -135,7 +135,7 @@ { echo "'-> " . $langvars['l_sched_gov_credits_flip'] . $playerinfo['ship_id'] . " *** " . $langvars['l_sched_fixed'] . "***
"; $resd = $db->Execute("UPDATE {$db->prefix}ships SET credits = ? WHERE ship_id = ? LIMIT 1;", array(0, $playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resd, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resd, __LINE__, __FILE__); if ($db->ErrorNo() > 0) { @@ -150,7 +150,7 @@ { echo "'-> " . $langvars['l_sched_gov_credits_over'] . $playerinfo['ship_id'] . " *** " . $langvars['l_sched_fixed'] . "***
"; $rese = $db->Execute("UPDATE {$db->prefix}ships SET credits = ? WHERE ship_id = ? LIMIT 1;", array(100000000000000000000, $playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $rese, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $rese, __LINE__, __FILE__); if ($db->ErrorNo() > 0) { @@ -166,7 +166,7 @@ echo $langvars['l_sched_gov_valid_planets'] . "
"; $tdres = $db->Execute("SELECT planet_id, credits, fighters, torps, owner FROM {$db->prefix}planets"); -Tki\Db::LogDbErrors($pdo_db, $tdres, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $tdres, __LINE__, __FILE__); while (!$tdres->EOF) { @@ -177,7 +177,7 @@ { echo "'-> " . $langvars['l_sched_gov_credits_flip'] . $planetinfo['planet_id'] . " *** " . $langvars['l_sched_fixed'] . "***
"; $rese = $db->Execute("UPDATE {$db->prefix}planets SET credits = ? WHERE planet_id = ? LIMIT 1;", array(0, $planetinfo['planet_id'])); - Tki\Db::LogDbErrors($pdo_db, $rese, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $rese, __LINE__, __FILE__); if ($db->ErrorNo() > 0) { @@ -192,7 +192,7 @@ { echo "'-> " . $langvars['l_sched_gov_credits_over'] . $planetinfo['planet_id'] . " *** " . $langvars['l_sched_fixed'] . "***
"; $resf = $db->Execute("UPDATE {$db->prefix}planets SET credits = ? WHERE planet_id = ? LIMIT 1;", array(100000000000000000000, $planetinfo['planet_id'])); - Tki\Db::LogDbErrors($pdo_db, $resf, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resf, __LINE__, __FILE__); if ($db->ErrorNo() > 0) { @@ -208,7 +208,7 @@ { echo "'-> " . $langvars['l_sched_gov_fighters_flip'] . $planetinfo['planet_id'] . " *** " . $langvars['l_sched_fixed'] . "***
"; $resg = $db->Execute("UPDATE {$db->prefix}planets SET fighters = ? WHERE planet_id = ? LIMIT 1;", array(0, $planetinfo['planet_id'])); - Tki\Db::LogDbErrors($pdo_db, $resg, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resg, __LINE__, __FILE__); if ($db->ErrorNo() > 0) { @@ -224,7 +224,7 @@ { echo "'-> " . $langvars['l_sched_gov_torp_flip'] . $planetinfo['planet_id'] . " *** " . $langvars['l_sched_fixed'] . "***
"; $resh = $db->Execute("UPDATE {$db->prefix}planets SET torps = ? WHERE planet_id = ? LIMIT 1;", array(0, $planetinfo['planet_id'])); - Tki\Db::LogDbErrors($pdo_db, $resh, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resh, __LINE__, __FILE__); if ($db->ErrorNo() > 0) { @@ -240,7 +240,7 @@ echo $langvars['l_sched_gov_valid_ibank'] . "
"; $tdres = $db->Execute("SELECT ship_id, balance, loan FROM {$db->prefix}ibank_accounts"); -Tki\Db::LogDbErrors($pdo_db, $tdres, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $tdres, __LINE__, __FILE__); while (!$tdres->EOF) { @@ -251,7 +251,7 @@ { echo "'-> " . $langvars['l_sched_gov_balance_flip'] . $bankinfo['ship_id'] . " *** " . $langvars['l_sched_fixed'] . "***
"; $resi = $db->Execute("UPDATE {$db->prefix}ibank_accounts SET balance = ? WHERE ship_id = ? LIMIT 1;", array(0, $bankinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resi, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resi, __LINE__, __FILE__); if ($db->ErrorNo() > 0) { @@ -266,7 +266,7 @@ { echo "'-> " . $langvars['l_sched_gov_balance_overflow'] . $bankinfo['ship_id'] . " *** " . $langvars['l_sched_fixed'] . "***
"; $resj = $db->Execute("UPDATE {$db->prefix}ibank_accounts SET balance = ? WHERE ship_id = ? LIMIT 1;", array(100000000000000000000, $bankinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resj, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resj, __LINE__, __FILE__); if ($db->ErrorNo() > 0) { @@ -282,7 +282,7 @@ { echo "'-> " . $langvars['l_sched_gov_loan_flip'] . $bankinfo['ship_id'] . " *** " . $langvars['l_sched_fixed'] . "***
"; $resk = $db->Execute("UPDATE {$db->prefix}ibank_accounts SET loan = ? WHERE ship_id = ? LIMIT 1;", array(0, $bankinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resk, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resk, __LINE__, __FILE__); if ($db->ErrorNo() > 0) { @@ -298,7 +298,7 @@ echo $langvars['l_sched_gov_valid_ibank_trans'] . "
"; $tdres = $db->Execute("SELECT transfer_id, source_id, dest_id, amount FROM {$db->prefix}ibank_transfers"); -Tki\Db::LogDbErrors($pdo_db, $tdres, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $tdres, __LINE__, __FILE__); /* while (!$tdres->EOF) diff --git a/scheduler/sched_tow.php b/scheduler/sched_tow.php index 7d73f4eb6..48748c6e9 100644 --- a/scheduler/sched_tow.php +++ b/scheduler/sched_tow.php @@ -28,7 +28,7 @@ do { $res = $db->Execute("SELECT ship_id,character_name,hull,sector,{$db->prefix}universe.zone_id,max_hull FROM {$db->prefix}ships,{$db->prefix}universe,{$db->prefix}zones WHERE sector=sector_id AND {$db->prefix}universe.zone_id={$db->prefix}zones.zone_id AND max_hull<>0 AND (({$db->prefix}ships.hull + {$db->prefix}ships.engines + {$db->prefix}ships.computer + {$db->prefix}ships.beams + {$db->prefix}ships.torp_launchers + {$db->prefix}ships.shields + {$db->prefix}ships.armor)/7) >max_hull AND ship_destroyed='N'"); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); if ($res) { $num_to_tow = $res->RecordCount(); @@ -46,7 +46,7 @@ echo $langvars['l_sched_tow_where'] . ".
"; $query = $db->Execute("UPDATE {$db->prefix}ships SET sector = ?, cleared_defenses=' ' WHERE ship_id=?", array($newsector, $row['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $query, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $query, __LINE__, __FILE__); Tki\PlayerLog::WriteLog($pdo_db, $row['ship_id'], \Tki\LogEnums::TOW, "$row[sector]|$newsector|$row[max_hull]"); Tki\LogMove::writeLog($pdo_db, $row['ship_id'], $newsector); $res->MoveNext(); diff --git a/scheduler/sched_turns.php b/scheduler/sched_turns.php index 968fd8b1a..5b03203f2 100644 --- a/scheduler/sched_turns.php +++ b/scheduler/sched_turns.php @@ -27,7 +27,7 @@ $resa = $db->Execute("UPDATE {$db->prefix}ships SET turns = LEAST (turns + ($tkireg->turns_per_tick * $multiplier), $tkireg->max_turns) WHERE turns < $tkireg->max_turns"); //$resa = $db->Execute("UPDATE {$db->prefix}ships SET turns = LEAST (turns + (? * ?), ?) WHERE turns < ?", array($tkireg->turns_per_tick, $multiplier, $tkireg->max_turns, $tkireg->max_turns)); -$debug = Tki\Db::LogDbErrors($pdo_db, $resa, __LINE__, __FILE__); +$debug = Tki\Db::logDbErrors($pdo_db, $resa, __LINE__, __FILE__); \Tki\Scheduler::isQueryOk($pdo_db, $debug); echo "
"; $multiplier = 0; diff --git a/sector_fighters.php b/sector_fighters.php index 0f3000c99..58d21560f 100644 --- a/sector_fighters.php +++ b/sector_fighters.php @@ -160,7 +160,7 @@ $stmt->bindParam(':playertorps', $playertorpnum, \PDO::PARAM_INT); $stmt->bindParam(':ship_id', $playerinfo['ship_id'], \PDO::PARAM_INT); $result = $stmt->execute(); -Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); $langvars['l_sf_lreport'] = str_replace("[armor]", $armor_lost, $langvars['l_sf_lreport']); $langvars['l_sf_lreport'] = str_replace("[fighters]", $fighters_lost, $langvars['l_sf_lreport']); @@ -194,7 +194,7 @@ $stmt->bindParam(':ship_id', $playerinfo['ship_id'], \PDO::PARAM_INT); $stmt->bindParam(':rating', $rating, \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); Tki\Bounty::cancel($pdo_db, $playerinfo['ship_id']); $ok = 0; diff --git a/team.php b/team.php index 987228934..a3568615a 100644 --- a/team.php +++ b/team.php @@ -38,7 +38,7 @@ $planet_id = preg_replace('/[^0-9]/', '', $planet_id); $result2 = $db->Execute("SELECT * FROM {$db->prefix}planets WHERE planet_id = ?", array($planet_id)); -Tki\Db::LogDbErrors($pdo_db, $result2, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $result2, __LINE__, __FILE__); if ($result2) { $planetinfo = $result2->fields; @@ -56,7 +56,7 @@ $stmt->bindParam(':owner', $playerinfo['ship_id'], \PDO::PARAM_INT); $stmt->bindParam(':planet_id', $planet_id, \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); $ownership = Tki\Ownership::calc($pdo_db, $playerinfo['sector'], $tkireg->min_bases_to_own, $langvars); if ($ownership !== null) @@ -73,7 +73,7 @@ $stmt->bindParam(':owner', $playerinfo['ship_id'], \PDO::PARAM_INT); $stmt->bindParam(':planet_id', $planet_id, \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); $ownership = Tki\Ownership::calc($pdo_db, $playerinfo['sector'], $tkireg->min_bases_to_own, $langvars); // Kick other players off the planet @@ -82,7 +82,7 @@ $stmt->bindParam(':planet_id', $planet_id, \PDO::PARAM_INT); $stmt->bindParam(':ship_id', $playerinfo['ship_id'], \PDO::PARAM_INT); $result = $stmt->execute(); - Tki\Db::LogDbErrors($pdo_db, $sql, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $sql, __LINE__, __FILE__); if ($ownership !== null) { echo "

" . $ownership . "

"; diff --git a/team_planets.php b/team_planets.php index 3d0f665a3..7e5d575ea 100644 --- a/team_planets.php +++ b/team_planets.php @@ -71,7 +71,7 @@ } $res = $db->Execute($query); -Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); echo "

" . $title . "

\n"; echo "
"; @@ -151,7 +151,7 @@ $owner = $planet[$i]['owner']; $res = $db->Execute("SELECT character_name FROM {$db->prefix}ships WHERE ship_id = " . $owner); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); $player = $res->fields['character_name']; echo ""; diff --git a/teams.php b/teams.php index abc762bcd..29e86e94e 100644 --- a/teams.php +++ b/teams.php @@ -98,7 +98,7 @@ FROM {$db->prefix}ships LEFT JOIN {$db->prefix}teams ON {$db->prefix}ships.team = {$db->prefix}teams.id WHERE {$db->prefix}ships.email = ?;", array($_SESSION['username'])); -Tki\Db::LogDbErrors($pdo_db, $result, __LINE__, __FILE__); +Tki\Db::logDbErrors($pdo_db, $result, __LINE__, __FILE__); $playerinfo = $result->fields; $playerinfo['ship_id'] = (int) $playerinfo['ship_id']; @@ -110,7 +110,7 @@ FROM {$db->prefix}ships LEFT JOIN {$db->prefix}teams ON {$db->prefix}ships.team_invite = {$db->prefix}teams.id WHERE {$db->prefix}ships.email = ?;", array($_SESSION['username'])); - Tki\Db::LogDbErrors($pdo_db, $invite, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $invite, __LINE__, __FILE__); $invite_info = $invite->fields; } else @@ -122,13 +122,13 @@ if ($whichteam !== null) { $result_team = $db->Execute("SELECT * FROM {$db->prefix}teams WHERE id = ?;", array($whichteam)); - Tki\Db::LogDbErrors($pdo_db, $result_team, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result_team, __LINE__, __FILE__); $team = $result_team->fields; } else { $result_team = $db->Execute("SELECT * FROM {$db->prefix}teams WHERE id = ?;", array($playerinfo['team'])); - Tki\Db::LogDbErrors($pdo_db, $result_team, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result_team, __LINE__, __FILE__); $team = $result_team->fields; } @@ -164,16 +164,16 @@ } $resx = $db->Execute("DELETE FROM {$db->prefix}teams WHERE id = ?;", array($whichteam)); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); $resy = $db->Execute("UPDATE {$db->prefix}ships SET team='0' WHERE ship_id = ?;", array($playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resy, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resy, __LINE__, __FILE__); $resz = $db->Execute("UPDATE {$db->prefix}ships SET team_invite = 0 WHERE team_invite = ?;", array($whichteam)); - Tki\Db::LogDbErrors($pdo_db, $resz, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resz, __LINE__, __FILE__); $res = $db->Execute("SELECT DISTINCT sector_id FROM {$db->prefix}planets WHERE owner = ? AND base = 'Y';", array($playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $res, __LINE__, __FILE__); $i = 0; while (!$res->EOF) { @@ -184,7 +184,7 @@ } $resx = $db->Execute("UPDATE {$db->prefix}planets SET team = 0 WHERE owner = ?;", array($playerinfo['ship_id'])); - Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $resx, __LINE__, __FILE__); if ($sectors !== null) { foreach ($sectors as $sector) @@ -210,7 +210,7 @@ echo "
" . $langvars['l_team_newc'] . ""; echo ""; } @@ -375,7 +375,7 @@ else { $result = $db->Execute("SELECT name, sector_id FROM {$db->prefix}planets WHERE planet_id=?;", array($traderoutes[$i]['dest_id'])); - Tki\Db::LogDbErrors($pdo_db, $result, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result, __LINE__, __FILE__); if ($result) { $planet2 = $result->fields; @@ -391,7 +391,7 @@ if ($traderoutes[$i]['dest_type'] == 'P') { $result = $db->Execute("SELECT * FROM {$db->prefix}universe WHERE sector_id = ?;", array($traderoutes[$i]['dest_id'])); - Tki\Db::LogDbErrors($pdo_db, $result, __LINE__, __FILE__); + Tki\Db::logDbErrors($pdo_db, $result, __LINE__, __FILE__); $port2 = $result->fields; echo " " . Tki\Ports::getType($port2['port_type'], $langvars) . ""; }
" . $langvars['l_team_selectp'] . ":