Dragon-Scourge/globals.php
Jamin Blount 0f3f0dc8ed Beta 4 Build 18
09.03.2006 - Build 18 (Joe Camel):
- Fixed function redeclaration with Blessed Strike & Stone Skin spells.
- When you're all alone, you no longer have a little blue "undefined"
orb to keep you company.
- Changing worlds after a quest now gives you the world's starting town
to avoid panel errors.
- Minor optimization fix for item building.
- Unique items no longer drop with prefixes/suffixes, and you can no
longer buy unique items.
- Removed alphanumeric requirement for passwords.
- hpleech(monster) now properly accounts for difficulty multiplier when
checking against the monster's maxhp.
- Added Deposit/Withdraw All links to the Bank.
- Fixed PVP and Post office bugs related to the new doquery syntax.
- Fixed single-quote bugs in mymail().
- Removed verbiage from the levelup template that was no longer
necessary.
- Fixed some more verbiage in the registration message that was also no
longer necessary.
- Added admin-definable cookie name and cookie domain to controlrow.
2017-02-05 11:58:57 -06:00

51 lines
2.0 KiB
PHP

<?php // globals.php :: Storage for lots of super important arrays we're probably going to need eventually.
// Config.php.
include("config.php");
if (trim($dbsettings["secretword"]) == "") { die("Invalid setting for secretword in config.php. This setting must never be blank."); }
// Control row.
$controlrow = dorow(doquery("SELECT * FROM <<control>> WHERE id='1' LIMIT 1"));
// Account row.
include("cookies.php");
$acctrow = checkcookies();
if ($acctrow == false && substr($_SERVER["REQUEST_URI"], -21) != "users.php?do=register") { die(header("Location: login.php?do=login")); }
if ($acctrow != false && $acctrow["characters"] == 0 && substr($_SERVER["REQUEST_URI"], -20) != "users.php?do=charnew") { die(header("Location: users.php?do=charnew")); }
// User row.
if (substr($_SERVER["REQUEST_URI"], -19) != "login.php?do=logout") {
$online = doquery("UPDATE <<users>> SET onlinetime=NOW() WHERE id='".$acctrow["activechar"]."' LIMIT 1");
} else {
$online = doquery("UPDATE <<users>> SET onlinetime = DATE_SUB(onlinetime, INTERVAL 11 MINUTE) WHERE id='".$acctrow["activechar"]."' LIMIT 1");
}
$userrow = dorow(doquery("SELECT * FROM <<users>> WHERE id='".$acctrow["activechar"]."' LIMIT 1"));
if ($userrow != false) { $userrow = array_map("stripslashes", $userrow); }
// World row.
$worldrow = dorow(doquery("SELECT * FROM <<worlds>> WHERE id='".$userrow["world"]."' LIMIT 1"));
// Town row.
if ($userrow["currentaction"] == "In Town") {
$townrow = dorow(doquery("SELECT * FROM <<towns>> WHERE world='".$userrow["world"]."' AND longitude='".$userrow["longitude"]."' AND latitude='".$userrow["latitude"]."' LIMIT 1"));
} else {
$townrow = false;
}
// Spells.
$spells = dorow(doquery("SELECT * FROM <<spells>> ORDER BY id", "spells"), "id");
// Global fightrow.
$fightrow = array(
"playerphysdamage"=>0,
"playermagicdamage"=>0,
"playerfiredamage"=>0,
"playerlightdamage"=>0,
"monsterphysdamage"=>0,
"monstermagicdamage"=>0,
"monsterfiredamage"=>0,
"monsterlightdamage"=>0,
"track"=>"",
"message"=>"");
?>