#pragma once
#include <string>

#include "Core/Models.h"
#include "Core/RuntimeSession.h"
#include "Memory/VmmAccessor.h"

// -------------------------------------------------------------------------
// NetworkMetadataReader
// Reads server name, game version, and map name from the game's network
// manager structures.
// -------------------------------------------------------------------------

class NetworkMetadataReader {
public:
    /// Attempt to read network metadata into @p meta.
    /// Returns true only when serverName and gameVersion are both usable.
    bool TryRead(VmmAccessor& mem, const RuntimeSession& session, NetworkMetadata& meta);

    [[nodiscard]] const std::string& LastFailureReason() const noexcept {
        return m_lastFailureReason;
    }

private:
    std::string m_lastFailureReason;
};
