Skip to content

Commit e2688bb

Browse files
committed
feat: dumping schemas from tools
1 parent c08a6b8 commit e2688bb

2 files changed

Lines changed: 33 additions & 2 deletions

File tree

src/main/appframework.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ std::vector<AppSystemInfo> g_appSystems{
6666
{ false, "soundsystem", SOUNDOPSYSTEMEDIT_INTERFACE_VERSION },
6767
{ false, "vphysics2", VPHYSICS2HANDLE_INTERFACE_VERSION },
6868
{ false, "worldrenderer", WORLD_RENDERER_MGR_INTERFACE_VERSION },
69+
{ false, "assetsystem", ASSETSYSTEM_INTERFACE_VERSION, false, CS2_ONLY },
70+
{ false, "assetpreview", ASSETPREVIEWSYSTEM_INTERFACE_VERSION, false, CS2_ONLY },
71+
{ false, "resourcecompiler", RESOURCECOMPILERSYSTEM_INTERFACE_VERSION, false, CS2_ONLY },
72+
{ false, "tools/hammer", "ToolSystem2_001", false, CS2_ONLY},
73+
{ false, "tools/met", "ToolSystem2_001", false, CS2_ONLY},
74+
{ false, "tools/pet", "ToolSystem2_001", false, CS2_ONLY},
75+
{ false, "tools/cs2_item_editor", "ToolSystem2_001", false, CS2_ONLY},
6976
};
7077

7178
std::map<std::string, IAppSystem*> g_factoryMap;

src/main/dumpers/schemas/metadata_stringifier.cpp

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
#include <fmt/format.h>
3131
#include "metadata_stringifier.h"
3232
#include <modules.h>
33+
#include <vector>
34+
#include <regex>
3335

3436
class SimpleCUtlString {
3537
public:
@@ -54,7 +56,23 @@ std::unordered_set<std::string> g_classWithBrokenDefaults =
5456
"vphysics_save_ragdoll_control_t",
5557
"CAnimAttachment",
5658
"CBlockSelectionMetricEvaluator",
57-
"HitReactFixedSettings_t"
59+
"HitReactFixedSettings_t",
60+
"RnSoftbodySpring_t",
61+
"CAnimGraphDoc_GroupNode"
62+
};
63+
64+
std::vector<std::regex> g_regexFilters =
65+
{
66+
std::regex(R"#(("m_id":) .*)#"),
67+
std::regex(R"#(("m_ID":) .*,)#"),
68+
std::regex(R"#(("m_nControlPointCount":) .*)#"),
69+
std::regex(R"#(("m_nControlPointStart":) .*)#"),
70+
std::regex(R"#(("m_nRandomSeed":) .*,)#"),
71+
std::regex(R"#(("m_seed":) .*,)#"),
72+
std::regex(R"#(("m_outputPinID":) .*,)#"),
73+
std::regex(R"#(("m_stateID":) .*)#"),
74+
std::regex(R"#(("m_pinID":) .*)#"),
75+
std::regex(R"#(("m_entryStateID":) .*)#"),
5876
};
5977

6078
// Any function called after this will have uninitialized variables set to zero
@@ -165,7 +183,13 @@ std::optional<std::string> GetMetadataValue(const SchemaMetadataEntryData_t& ent
165183
int res = SaveKV3AsJson(*(void**)value, err, buf);
166184

167185
if (res) {
168-
return buf.Get();
186+
std::string out = buf.Get();
187+
188+
for (const auto& regex : g_regexFilters) {
189+
out = std::regex_replace(out, regex, "$1 <HIDDEN FOR DIFF>,");
190+
}
191+
192+
return out;
169193
}
170194

171195
return "Could not parse KV3 Defaults";

0 commit comments

Comments
 (0)