Skip to content

Commit 1e01629

Browse files
committed
More regexes
1 parent c89d22e commit 1e01629

File tree

2 files changed

+187
-4
lines changed

2 files changed

+187
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/.vs/
2+
/out/
23
/build/
34
/linuxbuild/

src/main/dumpers/schemas/metadata_stringifier.cpp

Lines changed: 186 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* =============================================================================
33
* DumpSource2
44
* Copyright (C) 2024 ValveResourceFormat Contributors
5-
*
5+
*
66
* source2gen
77
* Copyright 2024 neverlosecc
88
* =============================================================================
@@ -62,8 +62,57 @@ std::map<std::string, std::vector<std::regex>> g_replaceMap{
6262
std::regex(R"#(("m_nChannels":) .*,)#"),
6363
}
6464
},
65+
{
66+
"CVoiceContainerDefault",
67+
{
68+
std::regex(R"#(("m_nStreamingSize":) .*,)#"),
69+
std::regex(R"#(("m_nRate":) .*,)#"),
70+
std::regex(R"#(("m_nFormat":) .*,)#"),
71+
std::regex(R"#(("m_nSampleCount":) .*,)#"),
72+
std::regex(R"#(("m_nLoopStart":) .*,)#"),
73+
std::regex(R"#(("m_nLoopEnd":) .*,)#"),
74+
std::regex(R"#(("m_nChannels":) .*,)#"),
75+
}
76+
},
77+
{
78+
"CVoiceContainerLoopTrigger",
79+
{
80+
std::regex(R"#(("m_nStreamingSize":) .*,)#"),
81+
std::regex(R"#(("m_nRate":) .*,)#"),
82+
std::regex(R"#(("m_nFormat":) .*,)#"),
83+
std::regex(R"#(("m_nSampleCount":) .*,)#"),
84+
std::regex(R"#(("m_nLoopStart":) .*,)#"),
85+
std::regex(R"#(("m_nLoopEnd":) .*,)#"),
86+
std::regex(R"#(("m_nChannels":) .*,)#"),
87+
}
88+
},
89+
{
90+
"CVoiceContainerNull",
91+
{
92+
std::regex(R"#(("m_nStreamingSize":) .*,)#"),
93+
std::regex(R"#(("m_nRate":) .*,)#"),
94+
std::regex(R"#(("m_nFormat":) .*,)#"),
95+
std::regex(R"#(("m_nSampleCount":) .*,)#"),
96+
std::regex(R"#(("m_nLoopStart":) .*,)#"),
97+
std::regex(R"#(("m_nLoopEnd":) .*,)#"),
98+
std::regex(R"#(("m_nChannels":) .*,)#"),
99+
}
100+
},
65101
{
66102
"CVoiceContainerBlender",
103+
{
104+
std::regex(R"#(("m_nStreamingSize":) .*,)#"),
105+
std::regex(R"#(("m_nRate":) .*,)#"),
106+
std::regex(R"#(("m_nFormat":) .*,)#"),
107+
std::regex(R"#(("m_nSampleCount":) .*,)#"),
108+
std::regex(R"#(("m_nLoopStart":) .*,)#"),
109+
std::regex(R"#(("m_nLoopEnd":) .*,)#"),
110+
std::regex(R"#(("m_nChannels":) .*,)#"),
111+
std::regex(R"#(("m_flBlendFactor":) .*,)#"),
112+
}
113+
},
114+
{
115+
"CVoiceContainerDecayingSineWave",
67116
{
68117
std::regex(R"#(("m_nStreamingSize":) .*,)#"),
69118
std::regex(R"#(("m_nRate":) .*,)#"),
@@ -110,6 +159,18 @@ std::map<std::string, std::vector<std::regex>> g_replaceMap{
110159
std::regex(R"#(("m_nChannels":) .*,)#"),
111160
}
112161
},
162+
{
163+
"CVoiceContainerRealtimeFMSineWave",
164+
{
165+
std::regex(R"#(("m_nStreamingSize":) .*,)#"),
166+
std::regex(R"#(("m_nRate":) .*,)#"),
167+
std::regex(R"#(("m_nFormat":) .*,)#"),
168+
std::regex(R"#(("m_nSampleCount":) .*,)#"),
169+
std::regex(R"#(("m_nLoopStart":) .*,)#"),
170+
std::regex(R"#(("m_nLoopEnd":) .*,)#"),
171+
std::regex(R"#(("m_nChannels":) .*,)#"),
172+
}
173+
},
113174
{
114175
"CVoiceContainerSwitch",
115176
{
@@ -178,7 +239,7 @@ std::map<std::string, std::vector<std::regex>> g_replaceMap{
178239
"CVoxelVisibility",
179240
{
180241
std::regex(R"#(("m_nOffset":) .*,)#"),
181-
std::regex(R"#(("m_nElementCount":) .*,)#"),
242+
std::regex(R"#(("m_nElementCount":) .*)#"),
182243
}
183244
},
184245
{
@@ -194,6 +255,7 @@ std::map<std::string, std::vector<std::regex>> g_replaceMap{
194255
std::regex(R"#(("m_nStageProgressionTimerIncrease":) .*,)#"),
195256
std::regex(R"#(("m_nTimerIncreaseExpireClicks":) .*,)#"),
196257
std::regex(R"#(("m_nTimerIncreaseChance":) .*,)#"),
258+
std::regex(R"#(("m_nIllusionManaCost":) .*,)#"),
197259
}
198260
},
199261
{
@@ -215,6 +277,126 @@ std::map<std::string, std::vector<std::regex>> g_replaceMap{
215277
std::regex(R"#(("m_vWarmupEffectColor":)[\s\S]*?\],)#"),
216278
}
217279
},
280+
{
281+
"AimMatrixOpFixedSettings_t",
282+
{
283+
std::regex(R"#(("m_influenceRotations":)[\s\S]*?\],)#"),
284+
std::regex(R"#(("m_influenceOffsets":)[\s\S]*?\],)#"),
285+
}
286+
},
287+
{
288+
"CLeanMatrixUpdateNode",
289+
{
290+
std::regex(R"#(("m_frameCorners":)[\s\S]*?\],)#"),
291+
}
292+
},
293+
{
294+
"CMotionGraphGroup",
295+
{
296+
std::regex(R"#(("m_nCentroids":) .*,)#"),
297+
std::regex(R"#(("m_nDimensions":) .*,)#"),
298+
}
299+
},
300+
{
301+
"LookAtOpFixedSettings_t",
302+
{
303+
std::regex(R"#(("m_influenceRotations":)[\s\S]*?\],)#"),
304+
}
305+
},
306+
{
307+
"CDOTACandyShopDefinition",
308+
{
309+
std::regex(R"#(("m_unDefaultInventorySize":) .*,)#"),
310+
std::regex(R"#(("m_unMaximumInventorySize":) .*,)#"),
311+
std::regex(R"#(("m_unDefaultRerollCharges":) .*,)#"),
312+
std::regex(R"#(("m_unDefaultMaxRerollCharges":) .*,)#"),
313+
std::regex(R"#(("m_unFixedExchangeRecipeStartDate":) .*,)#"),
314+
std::regex(R"#(("m_unFixedExchangeRecipeUpdateRateInSeconds":) .*,)#"),
315+
std::regex(R"#(("m_unFixedExchangeRecipeDefaultCount":) .*,)#"),
316+
std::regex(R"#(("m_unFixedExchangeRecipeMaximumCount":) .*,)#"),
317+
std::regex(R"#(("m_unVariableExchangeInputCandyCount":) .*,)#"),
318+
std::regex(R"#(("m_unVariableExchangeOutputCandyCount":) .*,)#"),
319+
std::regex(R"#(("m_eExpireEvent":) .*,)#"),
320+
}
321+
},
322+
{
323+
"CDOTARoadToTIChallengeDefinition",
324+
{
325+
std::regex(R"#(("m_eEvent":) .*,)#"),
326+
std::regex(R"#(("m_unTotalQuestPeriods":) .*,)#"),
327+
std::regex(R"#(("m_unHeroesPerQuest":) .*,)#"),
328+
}
329+
},
330+
{
331+
"CSurvivorsPowerUpDefinition_MortimerKisses",
332+
{
333+
std::regex(R"#(("m_vWarmupEffectColor":)[\s\S]*?\],)#"),
334+
}
335+
},
336+
{
337+
"CSurvivorsSpawnerDestructiblesDefinition",
338+
{
339+
std::regex(R"#(("m_flPerpendicularWallSpacing":) .*,)#"),
340+
}
341+
},
342+
{
343+
"CSurvivorsSpawnerTowerDefinition",
344+
{
345+
std::regex(R"#(("m_flPerpendicularWallSpacing":) .*,)#"),
346+
}
347+
},
348+
{
349+
"CPhysSurfaceProperties",
350+
{
351+
std::regex(R"#(("m_nameHash":) .*,)#"),
352+
std::regex(R"#(("m_baseNameHash":) .*,)#"),
353+
}
354+
},
355+
{
356+
"SkeletonAnimCapture_t__Frame_t",
357+
{
358+
std::regex(R"#(("m_flTime":) .*,)#"),
359+
}
360+
},
361+
{
362+
"CFeMorphLayer",
363+
{
364+
std::regex(R"#(("m_nNameHash":) .*,)#"),
365+
}
366+
},
367+
{
368+
"CSSDSMsg_ViewRender",
369+
{
370+
std::regex(R"#(("m_nFrameCount":) .*,)#"),
371+
}
372+
},
373+
{
374+
"VMixModDelayDesc_t",
375+
{
376+
std::regex(R"#(("m_flDelay":) .*,)#"),
377+
}
378+
},
379+
{
380+
"CVoiceContainerAmpedDecayingSineWave",
381+
{
382+
std::regex(R"#(("m_nRate":) .*,)#"),
383+
std::regex(R"#(("m_nFormat":) .*,)#"),
384+
}
385+
},
386+
{
387+
"ClutterSceneObject_t",
388+
{
389+
std::regex(R"#(("m_vMinBounds":)[\s\S]*?\],)#"),
390+
std::regex(R"#(("m_vMaxBounds":)[\s\S]*?\],)#"),
391+
}
392+
},
393+
{
394+
"ClutterTile_t",
395+
{
396+
std::regex(R"#(("m_vMinBounds":)[\s\S]*?\],)#"),
397+
std::regex(R"#(("m_vMaxBounds":)[\s\S]*?\],)#"),
398+
}
399+
},
218400
};
219401

220402
// Determine how and if to output metadata entry value based on it's type.
@@ -284,13 +466,13 @@ std::optional<std::string> GetMetadataValue(const SchemaMetadataEntryData_t& ent
284466
if (!entry.m_pData || !(*(void**)entry.m_pData) || !strcmp(metadataTargetName, "CastSphereSATParams_t")) return "Could not parse KV3 Defaults";
285467

286468
auto value = reinterpret_cast<GetKV3DefaultsFn>(*(void**)entry.m_pData)();
287-
469+
288470
if (!value) return "Could not parse KV3 Defaults";
289471

290472
#ifdef WIN32
291473
static auto SaveKV3AsJson = Modules::tier0->GetSymbol<SaveKV3AsJsonFn>("?SaveKV3AsJSON@@YA_NPEBVKeyValues3@@PEAVCUtlString@@1@Z");
292474
#else
293-
static auto SaveKV3AsJson = Modules::tier0->GetSymbol<SaveKV3AsJsonFn>("_Z13SaveKV3AsJSONPK10KeyValues3P10CUtlStringS3_");
475+
static auto SaveKV3AsJson = Modules::tier0->GetSymbol<SaveKV3AsJsonFn>("_Z13SaveKV3AsJSONPK10KeyValues3P10CUtlStringS3_");
294476
#endif
295477
if (!SaveKV3AsJson) {
296478
spdlog::critical("SaveKV3AsJson not found");

0 commit comments

Comments
 (0)