mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
* Added separate function to resolve relative addresses in address.h * Added new patterns to the print function. * Updated IsFlagSet hooks. * Cleaned up code to properly mask off Dev and Cheat flags. * Added separate define from _DEBUG so you can define it in release builds for people without C++ Debug Restributeables. * Removed un-used define in hooks.h * Fixed potential crashes in r5net and added debug prints. * Potential crashes were when in certain post functions the returned status wasn't 200. * Changed map-select drop down menu, now it displays 'Map Name + Season' instead of file-name. (#41) * Host Server shows normal map names * Changed a few stuff... * redid some stuff that isn't crucial * Update CCompanion.cpp * Update CCompanion.cpp * Updated mapname displaying. * Moved "ServerMap" as a static object into CCompanion::HostServerSection(). Co-authored-by: IcePixelx <41352111+PixieCore@users.noreply.github.com> * prevent squirrel compiler errors from killing game process (#43) * Read description for all changes. * Added ability to register custom ConVar. * Added 2 custom ConVars to open the CGameConsole and CCompanion Windows. * Changed ResolveRelativeAddress. * Added Config System for the Gui. * Added ImGui::Hotkey. * Added the ability to change 2 hotkeys for opening the window for CGameConsole and CCompanion. * Changed pattern for Squirrel_CompilerError to use a String. * Added IMemAlloc::AllocWrapper to patterns.h * Changes in description. * Added icon to launcher.exe * Launcher.exe gets remnamed to Run R5 Reloaded.exe in launcher release compilation configuration. * Extended argument buffer for starting the game in launcher.exe. * Added exception printing if in the custom ConVars an invalid value gets passed. * Wrong return. * Added shortcut with launch params. * Fixed prints. Co-authored-by: Marcii0 <58266292+Marcii0@users.noreply.github.com> Co-authored-by: BobTheBob <32057864+BobTheBob9@users.noreply.github.com>
117 lines
3.8 KiB
C++
117 lines
3.8 KiB
C++
#pragma once
|
|
#include "patterns.h"
|
|
#include "structs.h"
|
|
#include "hooks.h"
|
|
#include "gameclasses.h"
|
|
#include "CCompanion.h"
|
|
#include "CGameConsole.h"
|
|
|
|
inline bool g_bDebugLoading = false;
|
|
inline bool g_bReturnAllFalse = false;
|
|
inline bool g_bDebugConsole = false;
|
|
extern bool g_bBlockInput;
|
|
|
|
namespace Hooks
|
|
{
|
|
#pragma region CHLClient
|
|
void __fastcall FrameStageNotify(CHLClient* rcx, ClientFrameStage_t curStage);
|
|
|
|
using FrameStageNotifyFn = void(__fastcall*)(CHLClient*, ClientFrameStage_t);
|
|
extern FrameStageNotifyFn originalFrameStageNotify;
|
|
#pragma endregion
|
|
|
|
#pragma region Squirrel
|
|
void* SQVM_Print(void* sqvm, char* fmt, ...);
|
|
__int64 SQVM_Warning(void* sqvm, int a2, int a3, int* stringSize, void** string);
|
|
__int64 SQVM_LoadRson(const char* rson_name);
|
|
bool SQVM_LoadScript(void* sqvm, const char* script_path, const char* script_name, int flag);
|
|
|
|
using SQVM_WarningFn = __int64(*)(void*, int, int, int*, void**);
|
|
extern SQVM_WarningFn originalSQVM_Warning;
|
|
|
|
using SQVM_LoadRsonFn = __int64(*)(const char*);
|
|
extern SQVM_LoadRsonFn originalSQVM_LoadRson;
|
|
|
|
using SQVM_LoadScriptFn = bool(*)(void*, const char*, const char*, int);
|
|
extern SQVM_LoadScriptFn originalSQVM_LoadScript;
|
|
#pragma endregion
|
|
|
|
#pragma region CVEngineServer
|
|
bool IsPersistenceDataAvailable(__int64 thisptr, int client);
|
|
|
|
using IsPersistenceDataAvailableFn = bool(*)(__int64, int);
|
|
extern IsPersistenceDataAvailableFn originalIsPersistenceDataAvailable;
|
|
#pragma endregion
|
|
|
|
#pragma region NetChannel
|
|
bool NET_ReceiveDatagram(int sock, void* inpacket, bool raw);
|
|
unsigned int NET_SendDatagram(SOCKET s, const char* buf, int len, int flags);
|
|
void NET_PrintFunc(const char* fmt, ...);
|
|
void NetChanShutdown(void* rcx, const char* reason, unsigned __int8 unk1, char unk2);
|
|
|
|
using NET_PrintFuncFn = void(*)(const char* fmt, ...);
|
|
extern NET_PrintFuncFn originalNET_PrintFunc;
|
|
|
|
using NET_ReceiveDatagramFn = bool(*)(int, void*, bool);
|
|
extern NET_ReceiveDatagramFn originalNET_ReceiveDatagram;
|
|
|
|
using NET_SendDatagramFn = unsigned int(*)(SOCKET, const char*, int, int);
|
|
extern NET_SendDatagramFn originalNET_SendDatagram;
|
|
using NetChan_ShutDown = void(*)(void*, const char*, unsigned __int8, char);
|
|
extern NetChan_ShutDown originalNetChanShutDown;
|
|
#pragma endregion
|
|
|
|
#pragma region ConVar
|
|
bool ConVar_IsFlagSet(ConVar* cvar, int flag);
|
|
bool ConCommand_IsFlagSet(ConCommandBase* cmd, int flag);
|
|
|
|
using ConVar_IsFlagSetFn = bool(*)(ConVar*, int);
|
|
extern ConVar_IsFlagSetFn originalConVar_IsFlagSet;
|
|
|
|
using ConCommand_IsFlagSetFn = bool(*)(ConCommandBase*, int);
|
|
extern ConCommand_IsFlagSetFn originalConCommand_IsFlagSet;
|
|
|
|
using Map_CallbackFn = void(*)(void*);
|
|
extern Map_CallbackFn originalMap_Callback;
|
|
#pragma endregion
|
|
|
|
#pragma region WinAPI
|
|
BOOL WINAPI GetCursorPos(LPPOINT lpPoint);
|
|
BOOL WINAPI SetCursorPos(int X, int Y);
|
|
BOOL WINAPI ClipCursor(const RECT* lpRect);
|
|
BOOL WINAPI ShowCursor(BOOL bShow);
|
|
|
|
using GetCursorPosFn = BOOL(WINAPI*)(LPPOINT);
|
|
extern GetCursorPosFn originalGetCursorPos;
|
|
|
|
using SetCursorPosFn = BOOL(WINAPI*)(int, int);
|
|
extern SetCursorPosFn originalSetCursorPos;
|
|
|
|
using ClipCursorFn = BOOL(WINAPI*)(const RECT*);
|
|
extern ClipCursorFn originalClipCursor;
|
|
|
|
using ShowCursorFn = BOOL(WINAPI*)(BOOL);
|
|
extern ShowCursorFn originalShowCursor;
|
|
#pragma endregion
|
|
|
|
#pragma region CBaseFileSystem
|
|
void FileSystemWarning(void* thisptr, FileWarningLevel_t level, const char* fmt, ...);
|
|
|
|
using FileSystemWarningFn = void(*)(void*, FileWarningLevel_t, const char*, ...);
|
|
extern FileSystemWarningFn originalFileSystemWarning;
|
|
#pragma endregion
|
|
|
|
#pragma region Other
|
|
int MSG_EngineError(char* fmt, va_list args);
|
|
|
|
using MSG_EngineErrorFn = int(*)(char*, va_list);
|
|
extern MSG_EngineErrorFn originalMSG_EngineError;
|
|
#pragma endregion
|
|
|
|
void InstallHooks();
|
|
void RemoveHooks();
|
|
void ToggleNetTrace();
|
|
extern bool bToggledNetTrace;
|
|
void ToggleDevCommands();
|
|
extern bool bToggledDevFlags;
|
|
} |