mirror of
https://github.com/accelerator74/Cleaner.git
synced 2025-12-06 18:18:27 +00:00
Fix finding strings
This commit is contained in:
parent
d1809a7085
commit
59a9ed08d9
@ -15,16 +15,24 @@ unordered_set<string> szStrings;
|
|||||||
#if SOURCE_ENGINE >= SE_LEFT4DEAD2
|
#if SOURCE_ENGINE >= SE_LEFT4DEAD2
|
||||||
DETOUR_DECL_MEMBER4(Detour_LogDirect, LoggingResponse_t, LoggingChannelID_t, channelID, LoggingSeverity_t, severity, Color, color, const tchar *, pMessage)
|
DETOUR_DECL_MEMBER4(Detour_LogDirect, LoggingResponse_t, LoggingChannelID_t, channelID, LoggingSeverity_t, severity, Color, color, const tchar *, pMessage)
|
||||||
{
|
{
|
||||||
if (szStrings.find(pMessage) != szStrings.end())
|
for (const auto& str : szStrings) {
|
||||||
return LR_CONTINUE;
|
const char* str_cstr = str.c_str();
|
||||||
|
if (strstr(pMessage, str_cstr) != nullptr) {
|
||||||
|
return LR_CONTINUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return DETOUR_MEMBER_CALL(Detour_LogDirect)(channelID, severity, color, pMessage);
|
return DETOUR_MEMBER_CALL(Detour_LogDirect)(channelID, severity, color, pMessage);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
DETOUR_DECL_STATIC2(Detour_DefSpew, SpewRetval_t, SpewType_t, channel, char *, text)
|
DETOUR_DECL_STATIC2(Detour_DefSpew, SpewRetval_t, SpewType_t, channel, char *, text)
|
||||||
{
|
{
|
||||||
if (szStrings.find(text) != szStrings.end())
|
for (const auto& str : szStrings) {
|
||||||
|
const char* str_cstr = str.c_str();
|
||||||
|
if (strstr(text, str_cstr) != nullptr) {
|
||||||
return SPEW_CONTINUE;
|
return SPEW_CONTINUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return DETOUR_STATIC_CALL(Detour_DefSpew)(channel, text);
|
return DETOUR_STATIC_CALL(Detour_DefSpew)(channel, text);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
// for string manipulation
|
// for string manipulation
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <string>
|
#include <cstring>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user