2026-05-05 09:27:00 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
|
|
namespace wowee {
|
|
|
|
|
namespace editor {
|
|
|
|
|
|
|
|
|
|
struct ContentPackInfo {
|
|
|
|
|
std::string name;
|
|
|
|
|
std::string author;
|
|
|
|
|
std::string description;
|
|
|
|
|
std::string version = "1.0";
|
|
|
|
|
uint32_t mapId = 9000;
|
|
|
|
|
std::string format = "wcp-1.0";
|
|
|
|
|
|
|
|
|
|
struct FileEntry {
|
|
|
|
|
std::string path; // path inside pack
|
|
|
|
|
std::string category; // terrain, object, creature, quest, texture, model
|
|
|
|
|
uint64_t size = 0;
|
|
|
|
|
};
|
|
|
|
|
std::vector<FileEntry> files;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class ContentPacker {
|
|
|
|
|
public:
|
|
|
|
|
// Pack all zone data from output directory into a .wcp file
|
|
|
|
|
static bool packZone(const std::string& outputDir, const std::string& mapName,
|
|
|
|
|
const std::string& destPath, const ContentPackInfo& info);
|
|
|
|
|
|
|
|
|
|
// Unpack a .wcp file to a directory
|
|
|
|
|
static bool unpackZone(const std::string& wcpPath, const std::string& destDir);
|
|
|
|
|
|
|
|
|
|
// Read pack info without extracting
|
|
|
|
|
static bool readInfo(const std::string& wcpPath, ContentPackInfo& info);
|
2026-05-05 10:38:57 -07:00
|
|
|
|
|
|
|
|
// Validate that a zone directory has all required open format files
|
|
|
|
|
struct ValidationResult {
|
|
|
|
|
bool hasWot = false, hasWhm = false, hasZoneJson = false;
|
2026-05-05 15:23:58 -07:00
|
|
|
bool hasPng = false, hasWom = false, hasWob = false, hasWoc = false;
|
2026-05-05 12:48:50 -07:00
|
|
|
bool hasCreatures = false, hasQuests = false, hasObjects = false;
|
2026-05-05 15:23:58 -07:00
|
|
|
bool whmValid = false, womValid = false, wobValid = false, wocValid = false;
|
2026-05-05 10:38:57 -07:00
|
|
|
int openFormatScore() const;
|
|
|
|
|
std::string summary() const;
|
|
|
|
|
};
|
|
|
|
|
static ValidationResult validateZone(const std::string& zoneDir);
|
2026-05-05 09:27:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace editor
|
|
|
|
|
} // namespace wowee
|