mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-10-13 16:34:23 -05:00
Added D2Strings class to get strings where needed from strings table
This commit is contained in:
@@ -3,12 +3,14 @@
|
||||
require_once 'D2CharStructureData.php';
|
||||
require_once 'D2Files.php';
|
||||
require_once 'D2BitReader.php';
|
||||
require_once 'D2Strings.php';
|
||||
|
||||
class D2Char {
|
||||
|
||||
public $cData; // char data output
|
||||
public $items; // char item data
|
||||
private $sData; // char file structure data
|
||||
private $bData; // char binary data from d2s
|
||||
private $bData; // char binary data from d2s
|
||||
private $filePath; // .d2s file path
|
||||
private $fp; // file pointer
|
||||
|
||||
@@ -23,10 +25,15 @@ class D2Char {
|
||||
fseek($this->fp, $k);
|
||||
$this->bData[$k] = fread($this->fp, $v);
|
||||
}
|
||||
|
||||
$this->strings = new D2Strings();
|
||||
return $this->parseChar();
|
||||
|
||||
}
|
||||
|
||||
public function parseItems(){
|
||||
|
||||
}
|
||||
|
||||
public function parseChar() {
|
||||
$cData = null;
|
||||
$cData['Identifier'] = bin2hex($this->bData[0]);
|
||||
@@ -69,6 +76,8 @@ class D2Char {
|
||||
$cData['NPCIntroductions'] = $this->bData[714];
|
||||
$cData['filePath'] = $this->filePath;
|
||||
$this->cData = $cData;
|
||||
$this->parseItems();
|
||||
|
||||
return $this->cData;
|
||||
}
|
||||
|
||||
|
11
src/D2Strings.php
Normal file
11
src/D2Strings.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
class D2Strings {
|
||||
public array $strings;
|
||||
|
||||
public function __construct(){
|
||||
$sql = "SELECT * FROM strings";
|
||||
$this->strings = PDO_FetchAssoc($sql);
|
||||
return $this->strings;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user