mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
The KeyValues class belongs here. Also reimplemented most loading methods for KeyValues, and adjusted the VPK building code to account for it. Pointers to the engine's implementation of KeyValues have been moved to a separate header ('keyvalues_iface.h'), as this allows external tools code to utilize the standalone KeyValues class implementation. Playlist utilities are completely separated from the KeyValues header; these have nothing to do with KeyValues other than manipulating a global KeyValues object for the playlists, and thus have been named as such and moved to rtech/playlists.
46 lines
1.8 KiB
C++
46 lines
1.8 KiB
C++
#ifndef RTECH_PLAYLISTS_H
|
|
#define RTECH_PLAYLISTS_H
|
|
#include "tier1/keyvalues.h"
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
void Playlists_SDKInit(void);
|
|
bool Playlists_Load(const char* pszPlaylist);
|
|
bool Playlists_Parse(const char* pszPlaylist);
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
inline bool(*v_Playlists_Load)(const char* pszPlaylist);
|
|
inline bool(*v_Playlists_Parse)(const char* pszPlaylist);
|
|
inline const char* (*v_Playlists_GetCurrent)(void);
|
|
|
|
extern KeyValues** g_pPlaylistKeyValues;
|
|
|
|
extern vector<string> g_vAllPlaylists;
|
|
extern std::mutex g_PlaylistsVecMutex;
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
class VPlaylists : public IDetour
|
|
{
|
|
virtual void GetAdr(void) const
|
|
{
|
|
LogFunAdr("Playlists_Load", v_Playlists_Load);
|
|
LogFunAdr("Playlists_Parse", v_Playlists_Parse);
|
|
LogFunAdr("Playlists_GetCurrent", v_Playlists_GetCurrent);
|
|
LogVarAdr("g_pPlaylistKeyValues", g_pPlaylistKeyValues);
|
|
}
|
|
virtual void GetFun(void) const
|
|
{
|
|
g_GameDll.FindPatternSIMD("48 89 5C 24 ?? 48 89 6C 24 ?? 56 57 41 56 48 83 EC 40 48 8B F1").GetPtr(v_Playlists_Load);
|
|
g_GameDll.FindPatternSIMD("E8 ?? ?? ?? ?? 80 3D ?? ?? ?? ?? ?? 74 0C").FollowNearCallSelf().GetPtr(v_Playlists_Parse);
|
|
g_GameDll.FindPatternSIMD("48 8B 05 ?? ?? ?? ?? 48 85 C0 75 08 48 8D 05 ?? ?? ?? ?? C3 0F B7 50 2A").GetPtr(v_Playlists_GetCurrent);
|
|
}
|
|
virtual void GetVar(void) const
|
|
{
|
|
g_pPlaylistKeyValues = g_GameDll.FindPatternSIMD("48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 48 83 EC 20 48 8B F9 E8 B4")
|
|
.FindPatternSelf("48 8B 0D", CMemory::Direction::DOWN, 100).ResolveRelativeAddressSelf(0x3, 0x7).RCast<KeyValues**>();
|
|
}
|
|
virtual void GetCon(void) const { }
|
|
virtual void Detour(const bool bAttach) const;
|
|
};
|
|
|
|
#endif // RTECH_PLAYLISTS_H
|