Make playable

This commit is contained in:
Sky Johnson 2024-08-08 12:55:08 -05:00
parent ae49476b96
commit 6f782914ca
9 changed files with 1385 additions and 328 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
config.php

View File

@ -3,6 +3,12 @@ Changelog
***** BETA FIVE *****
8.8.2024 - Build 21 (Make Playable):
- Add a mysql_ shim to replace old database functions
- Modify some SQL to make it work with MySQL 8.0+
- Create botcheck folder and add a .gitkeep to pass tests
- Remove magic quotes functions as they have entirely been removed
9.2.2007 - Build 20 (Consolation Prize Part Deux):
- Fixed incorrect story values in install.sql.
- Some changes to the version/copyright/moddedby display.

View File

@ -15,11 +15,11 @@
// (see our website for that).
$dbsettings = Array(
"server" => "localhost", // MySQL server name. (Usually localhost.)
"user" => "", // MySQL username.
"pass" => "", // MySQL password.
"name" => "", // MySQL database name.
"server" => "127.0.0.1", // MySQL server name. (Usually localhost.)
"user" => "root", // MySQL username.
"pass" => "root", // MySQL password.
"name" => "scourge", // MySQL database name.
"prefix" => "sx", // Prefix for table names.
"secretword" => ""); // Secret word used when hashing information for cookies.
"secretword" => "poop"); // Secret word used when hashing information for cookies.
?>

0
images/botcheck/.gitkeep Normal file
View File

View File

@ -14,16 +14,10 @@
// within the confines of the Dragon Scourge License Agreement
// (see our website for that).
require_once 'shim.php';
opendb();
// Handling for servers with magic_quotes turned on.
if (get_magic_quotes_gpc()) {
$_POST = array_map('uber_ss', $_POST);
$_GET = array_map('uber_ss', $_GET);
$_COOKIE = array_map('uber_ss', $_COOKIE);
}
$_POST = array_map('uber_mres', $_POST);
$_POST = array_map('uber_hsc', $_POST);
$_GET = array_map('uber_mres', $_GET);
@ -85,7 +79,7 @@ function opendb() { // Open database connection.
define("DBRESULT", true);
}
}
return $link;
//return $link;
}

View File

@ -5,7 +5,7 @@ CREATE TABLE `<<accounts>>` (
`password` varchar(32) NOT NULL default '',
`emailaddress` varchar(200) NOT NULL default '',
`verifycode` varchar(32) NOT NULL default '',
`regdate` datetime NOT NULL default '0000-00-00 00:00:00',
`regdate` datetime NOT NULL default NOW(),
`regip` varchar(16) NOT NULL default '',
`authlevel` tinyint(3) unsigned NOT NULL default '1',
`language` varchar(30) NOT NULL default '',
@ -14,18 +14,18 @@ CREATE TABLE `<<accounts>>` (
`imageformat` varchar(4) NOT NULL default '0',
`minimap` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
);
DROP TABLE IF EXISTS `<<babblebox>>`;
CREATE TABLE `<<babblebox>>` (
`id` int(11) unsigned NOT NULL auto_increment,
`posttime` datetime NOT NULL default '0000-00-00 00:00:00',
`posttime` datetime NOT NULL default NOW(),
`charname` varchar(30) NOT NULL default '',
`charid` int(11) unsigned NOT NULL default '0',
`content` varchar(255) NOT NULL default '',
`guild` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
);
DROP TABLE IF EXISTS `<<classes>>`;
CREATE TABLE `<<classes>>` (
@ -39,7 +39,7 @@ CREATE TABLE `<<classes>>` (
`mpperenergy` float unsigned NOT NULL default '0',
`description` text NOT NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
);
INSERT INTO `<<classes>>` (`id`, `name`, `expbonus`, `goldbonus`, `damageperstrength`, `defenseperdex`, `hpperlife`, `mpperenergy`, `description`) VALUES
(1, 'Barbarian', 0, 0, 3, 1, 2, 1, 'Barbarians specialize in physical damage. 3 damage per strength point, 1 defense per dexterity point, 2 hp per life point, 1 mp per energy point.'),
@ -77,7 +77,7 @@ CREATE TABLE `<<control>>` (
`guildjoinlvl` int(10) unsigned NOT NULL default '0',
`guildupdate` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
);
DROP TABLE IF EXISTS `<<difficulties>>`;
CREATE TABLE `<<difficulties>>` (
@ -88,7 +88,7 @@ CREATE TABLE `<<difficulties>>` (
`multiplier` float NOT NULL default '0',
`deathpenalty` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
);
INSERT INTO `<<difficulties>>` (`id`, `name`, `expbonus`, `goldbonus`, `multiplier`, `deathpenalty`) VALUES
(1, 'Easy', 0, 0, 1, 0),
@ -102,7 +102,7 @@ CREATE TABLE `<<guildapps>>` (
`charid` int(10) unsigned NOT NULL default '0',
`charname` varchar(30) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
);
DROP TABLE IF EXISTS `<<guilds>>`;
CREATE TABLE `<<guilds>>` (
@ -127,7 +127,7 @@ CREATE TABLE `<<guilds>>` (
`statement` text NOT NULL,
`news` text NOT NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
);
DROP TABLE IF EXISTS `<<itembase>>`;
CREATE TABLE `<<itembase>>` (
@ -157,7 +157,7 @@ CREATE TABLE `<<itembase>>` (
`mod6name` varchar(50) NOT NULL default '',
`mod6attr` smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
);
INSERT INTO `<<itembase>>` (`id`, `name`, `slotnumber`, `isunique`, `willdrop`, `buycost`, `sellcost`, `reqlevel`, `reqstrength`, `reqdexterity`, `reqenergy`, `basename`, `baseattr`, `mod1name`, `mod1attr`, `mod2name`, `mod2attr`, `mod3name`, `mod3attr`, `mod4name`, `mod4attr`, `mod5name`, `mod5attr`, `mod6name`, `mod6attr`) VALUES
(1, 'Pointy Stick', 1, 0, 1, 10, 5, 1, 0, 0, 0, 'physattack', 3, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0),
@ -341,7 +341,7 @@ CREATE TABLE `<<itemmodnames>>` (
`prettyname` varchar(50) NOT NULL default '',
`percent` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
);
INSERT INTO `<<itemmodnames>>` (`id`, `fieldname`, `prettyname`, `percent`) VALUES
(1, 'expbonus', 'Experience Bonus', 1),
@ -381,7 +381,7 @@ CREATE TABLE `<<itemprefixes>>` (
`basename` varchar(50) NOT NULL default '',
`baseattr` smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
);
INSERT INTO `<<itemprefixes>>` (`id`, `name`, `slotnumber`, `unique`, `willdrop`, `buycost`, `sellcost`, `reqlevel`, `reqstrength`, `reqdexterity`, `reqenergy`, `basename`, `baseattr`) VALUES
(1, 'Sharp', 1, 0, 0, 5, 3, 1, 0, 0, 0, 'physattack', 2),
@ -403,7 +403,7 @@ CREATE TABLE `<<itemsuffixes>>` (
`basename` varchar(50) NOT NULL default '',
`baseattr` smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
);
INSERT INTO `<<itemsuffixes>>` (`id`, `name`, `slotnumber`, `unique`, `willdrop`, `buycost`, `sellcost`, `reqlevel`, `reqstrength`, `reqdexterity`, `reqenergy`, `basename`, `baseattr`) VALUES
(1, 'of the Vampire', 1, 0, 0, 5, 3, 1, 0, 0, 0, 'hpleech', 5),
@ -412,7 +412,7 @@ INSERT INTO `<<itemsuffixes>>` (`id`, `name`, `slotnumber`, `unique`, `willdrop`
DROP TABLE IF EXISTS `<<messages>>`;
CREATE TABLE `<<messages>>` (
`id` int(10) unsigned NOT NULL auto_increment,
`postdate` datetime NOT NULL default '0000-00-00 00:00:00',
`postdate` datetime NOT NULL default NOW(),
`senderid` int(10) unsigned NOT NULL default '0',
`sendername` varchar(30) NOT NULL default '',
`recipientid` int(10) unsigned NOT NULL default '0',
@ -422,7 +422,7 @@ CREATE TABLE `<<messages>>` (
`message` text NOT NULL,
`gold` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
);
DROP TABLE IF EXISTS `<<monsters>>`;
CREATE TABLE `<<monsters>>` (
@ -449,7 +449,7 @@ CREATE TABLE `<<monsters>>` (
`newstory` int(10) unsigned NOT NULL default '0',
`hpleech` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
);
INSERT INTO `<<monsters>>` (`id`, `name`, `world`, `level`, `maxexp`, `maxgold`, `maxhp`, `physattack`, `physdefense`, `magicattack`, `magicdefense`, `fireattack`, `firedefense`, `lightattack`, `lightdefense`, `spell1`, `spell2`, `spellimmune1`, `spellimmune2`, `boss`, `newstory`, `hpleech`) VALUES
(1, 'Small Slime', 1, 1, 4, 2, 3, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
@ -673,7 +673,7 @@ CREATE TABLE `<<pvp>>` (
`turntime` timestamp NOT NULL,
`fightrow` text NOT NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
);
DROP TABLE IF EXISTS `<<spells>>`;
CREATE TABLE `<<spells>>` (
@ -686,7 +686,7 @@ CREATE TABLE `<<spells>>` (
`classonly` int(10) unsigned NOT NULL default '0',
`classexclude` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
);
INSERT INTO `<<spells>>` (`id`, `name`, `fname`, `value`, `mp`, `minlevel`, `classonly`, `classexclude`) VALUES
(1, 'Heal 1', 'heal', 5, 2, 5, 2, 0),
@ -783,7 +783,7 @@ CREATE TABLE `<<story>>` (
`rewardname` varchar(30) NOT NULL default '',
`rewardattr` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
);
INSERT INTO `<<story>>` (`id`, `title`, `story`, `world`, `latitude`, `longitude`, `nextstory`, `targetmonster`, `targetitem`, `targetworld`, `targetlat`, `targetlon`, `targetaction`, `rewardname`, `rewardattr`) VALUES
(1, 'Prologue', 'The light has forsaken this land, and not for the first time. Centuries ago, it was overrun by darkness and then saved by a hero whose lifelong quest was to eradicate evil. The hero succeeded, and in the end, Lucifuge, King of the Dragons, was destroyed... at least for the time being. In the many long years since that time, Lucifuge has been gathering his forces and his power, and has finally regained enough of his former strength to return.\r\n\r\nSo the land is once again in need of a saviour. It will be no easy task, dear adventurer. In the last age, Lucifuge and his minions controlled but a small country. This time, he has sent his forces to sow chaos and darkness throughout the world. Only a brave adventurer will be able to conquer him and restore peace and order to the world.\r\n\r\nContinue on, dear adventurer. You shall be tested dearly, but the rewards will be great.', 1, 0, 0, 2, 0, '', 1, 0, 0, '', '', 0),
@ -820,7 +820,7 @@ CREATE TABLE `<<towns>>` (
`itemminlvl` int(10) unsigned NOT NULL default '0',
`itemmaxlvl` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
);
INSERT INTO `<<towns>>` (`id`, `name`, `world`, `latitude`, `longitude`, `innprice`, `mapprice`, `travelpoints`, `itemminlvl`, `itemmaxlvl`) VALUES
(1, 'Middleton', 1, 0, 0, 5, 0, 0, 1, 5),
@ -853,9 +853,9 @@ DROP TABLE IF EXISTS `<<users>>`;
CREATE TABLE `<<users>>` (
`id` int(10) unsigned NOT NULL auto_increment,
`account` int(10) unsigned NOT NULL default '0',
`birthdate` datetime NOT NULL default '0000-00-00 00:00:00',
`birthdate` datetime NOT NULL default NOW(),
`lastip` varchar(16) NOT NULL default '',
`onlinetime` datetime NOT NULL default '0000-00-00 00:00:00',
`onlinetime` datetime NOT NULL default NOW(),
`exploreverify` varchar(6) NOT NULL default '',
`exploreverifyimage` varchar(12) NOT NULL default '',
`explorefailed` int(10) unsigned NOT NULL default '0',
@ -953,7 +953,7 @@ CREATE TABLE `<<users>>` (
`bonusdefense` smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
FULLTEXT KEY `item1name` (`item1name`)
) TYPE=MyISAM ;
);
DROP TABLE IF EXISTS `<<worlds>>`;
CREATE TABLE `<<worlds>>` (
@ -961,7 +961,7 @@ CREATE TABLE `<<worlds>>` (
`name` varchar(30) NOT NULL default '',
`size` smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
);
INSERT INTO `<<worlds>>` (`id`, `name`, `size`) VALUES
(1, 'Raenslide', 100),

15
lib.php
View File

@ -20,24 +20,19 @@
//if (file_exists("install.php")) { die("Please remove the <b>install.php</b> and <b>install.sql</b> files from your game directory before continuing."); }
//if (file_exists("install.sql")) { die("Please remove the install.php file from your game directory before continuing."); }
require_once 'shim.php';
// Setup for superglobal stuff that can't go in globals.php.
$starttime = getmicrotime();
$numqueries = 0;
$link = opendb();
$version = "Beta 5";
$bnumber = "20";
$bname = "Consolation Prize Part Deux";
$bdate = "9.2.2007";
$bnumber = "21";
$bname = "Make Playable";
$bdate = "8.8.2024";
include("lib2.php");
// Handling for servers with magic_quotes turned on.
if (get_magic_quotes_gpc()) {
$_POST = array_map('uber_ss', $_POST);
$_GET = array_map('uber_ss', $_GET);
$_COOKIE = array_map('uber_ss', $_COOKIE);
}
$_POST = array_map('uber_mres', $_POST);
$_POST = array_map('uber_hsc', $_POST);
$_GET = array_map('uber_mres', $_GET);

1061
shim.php Normal file

File diff suppressed because it is too large Load Diff

View File

@ -403,7 +403,7 @@ function charnew() {
if ($errors == 0) {
// Now everything's cool. Create new character row.
$query = doquery("INSERT INTO <<users>> SET id='', account='".$acctrow["id"]."', birthdate=NOW(), lastip='".$_SERVER["REMOTE_ADDR"]."', onlinetime=NOW(), charname='$charname', charpicture='$newcharpicture', charclass='$charclass', difficulty='$difficulty', deathpenalty='$deathpenalty', expbonus='$expbonus', goldbonus='$goldbonus'");
$query = doquery("INSERT INTO <<users>> SET account='".$acctrow["id"]."', birthdate=NOW(), lastip='".$_SERVER["REMOTE_ADDR"]."', onlinetime=NOW(), charname='$charname', charpicture='$newcharpicture', charclass='$charclass', difficulty='$difficulty', deathpenalty='$deathpenalty', expbonus='$expbonus', goldbonus='$goldbonus'");
// Update account row.
$default = "";