MCPcopy Create free account
hub / github.com/Lovrom8/RSMods / IsSongKeyStringValid

Function IsSongKeyStringValid

DLL/GameState.cpp:49–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49bool IsSongKeyStringValid(const char* str, size_t max_len)
50{
51 if (!str)
52 return false;
53
54 if (MemUtil::IsBadReadPtr((void*)str))
55 return false;
56
57 size_t strLen = strlen(str);
58 if (strLen <= 13 || strLen > max_len)
59 return false;
60
61 std::string_view sv(str, strLen);
62
63 constexpr std::string_view prefix = "Play_";
64 return sv.size() >= prefix.size() && sv.substr(0, prefix.size()) == prefix;
65}
66
67/// <summary>
68/// Gets the SongKey of the current playing song, based on the initial preview.

Callers 1

GetSongKeyMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected