mirror of
https://github.com/ACEmulator/ACE
synced 2026-08-17 12:26:06 -04:00
* ACE.DatLoader LandblockInfo removed testing code * ACE.DatLoader rename PackableExtensions to UnpackableExtensions * ACE.DatLoader.Tests: Better testing to make sure full objects are being parsed * ACE.DatLoader bug fixes * ACE.DatLoader: Add missing file for build * ACE.DatLoader Switch to native Vector3 object * ACE.DatLoader: This changes the spell variables back to their enum types from ACE.Entity * ACE.DatLoader improvements
30 lines
981 B
C#
30 lines
981 B
C#
using System.Collections.Generic;
|
|
using System.IO;
|
|
|
|
namespace ACE.DatLoader
|
|
{
|
|
public class CellDatDatabase : DatDatabase
|
|
{
|
|
public CellDatDatabase(string filename) : base(filename)
|
|
{
|
|
}
|
|
|
|
public void ExtractLandblockContents(string path)
|
|
{
|
|
foreach (KeyValuePair<uint, DatFile> entry in AllFiles)
|
|
{
|
|
string thisFolder = Path.Combine(path, (entry.Value.ObjectId >> 16).ToString("X4"));
|
|
|
|
if (!Directory.Exists(thisFolder))
|
|
Directory.CreateDirectory(thisFolder);
|
|
|
|
// Use the DatReader to get the file data - file blocks can extend over block size.
|
|
DatReader dr = GetReaderForFile(entry.Value.ObjectId);
|
|
|
|
string hex = entry.Value.ObjectId.ToString("X8");
|
|
string thisFile = Path.Combine(thisFolder, hex + ".bin");
|
|
File.WriteAllBytes(thisFile, dr.Buffer);
|
|
}
|
|
}
|
|
}
|
|
}
|