switchmods fixed session vars, saved to db in d2config class. Need to test d2s editor with modifyBit() function. need to fix app.js uniqueitems editor required fields on misc/weapons/armor

This commit is contained in:
Hash Borgir
2022-05-24 00:16:01 -06:00
parent 16174f5efd
commit 6b4b0c564e
22 changed files with 405 additions and 10360 deletions

View File

@@ -56,7 +56,7 @@ if (!empty($_POST)) {
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$path = rtrim($_POST['path'], "\\");
$path = str_replace("\\", "\\\\", $path);
$modpath = $path;
$savePath = $path . '\\\\save\\\\';
$tbl = $path.'\\\\data\\\\local\\\\lng\\\\eng\\\\';
@@ -69,6 +69,8 @@ if (!empty($_POST)) {
PDO_Connect("sqlite:../D2Modder.db");
$sql = "CREATE TABLE IF NOT EXISTS D2Modder (
modname VARCHAR(255),
modpath VARCHAR(255),
savepath VARCHAR(255),
path VARCHAR(255),
tbl VARCHAR(255),
lastused INT,
@@ -85,15 +87,15 @@ ERROR: INVALID PATH</h1></center>';
// set this mod to active mod in session
$_SESSION['path'] = $path;
$_SESSION['tbl'] = $tbl;
$_SESSION['savePath'] = $savePath;
$_SESSION['savepath'] = $savePath;
// Don't yell at me, security is the least of my considerations atm
// check modname in db
$sql = "SELECT * FROM D2Modder WHERE modname=?";
$res = PDO_FetchAll($sql, [$modname]);
if (empty($res)) {
$sql = "INSERT INTO D2Modder(`modname`,`path`,`tbl`,`lastused`) VALUES(?, ?, ?, ?)";
PDO_Execute($sql, [$modname, $path, $tbl, $time]);
$sql = "INSERT INTO D2Modder(`modname`,`modpath`,`savepath`,`path`,`tbl`,`lastused`) VALUES(?, ?, ?, ?, ?, ?)";
PDO_Execute($sql, [$modname, $modpath, $savePath, $path, $tbl, $time]);
}
header("Location: /processFiles.php");
}