diff --git a/src/ZoneWriting/Game/IW4/ZoneWriterFactoryIW4.cpp b/src/ZoneWriting/Game/IW4/ZoneWriterFactoryIW4.cpp index eb12359b..60743fdd 100644 --- a/src/ZoneWriting/Game/IW4/ZoneWriterFactoryIW4.cpp +++ b/src/ZoneWriting/Game/IW4/ZoneWriterFactoryIW4.cpp @@ -43,37 +43,36 @@ public: #undef XBLOCK_DEF } - static ZoneHeader CreateHeaderForParams(const bool isSecure, const bool isOfficial, const bool isEncrypted) + static ZoneHeader CreateHeaderForParams(const bool isSecure, const bool isOfficial) { - // ZoneHeader header{}; - // header.m_version = ZoneConstants::ZONE_VERSION; - // - // if (isSecure) - // { - // if (isOfficial) - // memcpy(header.m_magic, ZoneConstants::MAGIC_SIGNED_TREYARCH, sizeof(ZoneHeader::m_magic)); - // else - // memcpy(header.m_magic, ZoneConstants::MAGIC_SIGNED_OAT, sizeof(ZoneHeader::m_magic)); - // } - // else - // { - // if (isEncrypted) - // memcpy(header.m_magic, ZoneConstants::MAGIC_UNSIGNED, sizeof(ZoneHeader::m_magic)); - // else - // memcpy(header.m_magic, ZoneConstants::MAGIC_UNSIGNED_SERVER, sizeof(ZoneHeader::m_magic)); - // } - // - // return header; + ZoneHeader header{}; + header.m_version = ZoneConstants::ZONE_VERSION; + + if (isSecure) + { + if (isOfficial) + memcpy(header.m_magic, ZoneConstants::MAGIC_SIGNED_INFINITY_WARD, sizeof(ZoneHeader::m_magic)); + else + memcpy(header.m_magic, ZoneConstants::MAGIC_SIGNED_OAT, sizeof(ZoneHeader::m_magic)); + } + else + { + memcpy(header.m_magic, ZoneConstants::MAGIC_UNSIGNED, sizeof(ZoneHeader::m_magic)); + } + + return header; } std::unique_ptr CreateWriter() { // TODO Support signed fastfiles bool isSecure = false; - bool isEncrypted = true; SetupBlocks(); + // Write zone header + m_writer->AddWritingStep(std::make_unique(CreateHeaderForParams(isSecure, false))); + // Return the fully setup zoneloader return std::move(m_writer); }