mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-10-13 08:24:24 -05:00
testing changes
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
include "./config.php";
|
||||
require_once "../src/D2Functions.php";
|
||||
require_once '../src/D2ItemData.php';
|
||||
require_once '../src/D2ItemDesc.php';
|
||||
$idata = new D2ItemData();
|
||||
$idesc = new D2ItemDesc();
|
||||
/*
|
||||
|
||||
Copyright (C) 2021 Hash Borgir
|
||||
@@ -149,18 +151,42 @@ if ($cmd == 'search') {
|
||||
/*
|
||||
* @cmd = getString
|
||||
*
|
||||
*
|
||||
* @arg = property, par, min, max
|
||||
*
|
||||
*
|
||||
*/
|
||||
if ($cmd == 'getString') {
|
||||
|
||||
|
||||
$prop = $_GET['prop'];
|
||||
|
||||
$sql = "SELECT stat1,stat2,stat3,stat4,stat5,stat6,stat7 FROM `properties` WHERE `code` = '$prop'";
|
||||
$stat = array_filter(PDO_FetchRow($sql));
|
||||
|
||||
$s = array_filter(getIscStrings($stat['stat1']));
|
||||
$s = array_filter($idata->getIscStrings($stat['stat1']));
|
||||
|
||||
// now combine isc strings with par, min, max
|
||||
|
||||
$params = array_merge($_GET, $s);
|
||||
|
||||
|
||||
$return = $idesc->getDesc($params);
|
||||
|
||||
/*
|
||||
* This goes into D2ItemDesc->getDesc();
|
||||
*
|
||||
$s1 = $params['string1'];
|
||||
$s2 = $params['string2'];
|
||||
$prop = $params['prop'];
|
||||
$par = $params['par'];
|
||||
$min = (int) $params['min'];
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($s, JSON_INVALID_UTF8_IGNORE);
|
||||
echo json_encode($return, JSON_INVALID_UTF8_IGNORE);
|
||||
}
|
Reference in New Issue
Block a user