Format project
This commit is contained in:
parent
714282b520
commit
1e5c4a7f6a
|
@ -14,11 +14,11 @@ enum class AudioSelectionStrategy
|
|||
|
||||
class EventOverrideData
|
||||
{
|
||||
public:
|
||||
public:
|
||||
EventOverrideData(const std::string&, const fs::path&);
|
||||
EventOverrideData();
|
||||
|
||||
public:
|
||||
public:
|
||||
bool LoadedSuccessfully = false;
|
||||
|
||||
std::vector<std::string> EventIds = {};
|
||||
|
@ -34,7 +34,7 @@ class EventOverrideData
|
|||
|
||||
class CustomAudioManager
|
||||
{
|
||||
public:
|
||||
public:
|
||||
bool TryLoadAudioOverride(const fs::path&);
|
||||
void ClearAudioOverrides();
|
||||
|
||||
|
|
|
@ -4,13 +4,13 @@ class vgui_BaseRichText_vtable;
|
|||
|
||||
class vgui_BaseRichText
|
||||
{
|
||||
public:
|
||||
public:
|
||||
vgui_BaseRichText_vtable* vtable;
|
||||
};
|
||||
|
||||
class vgui_BaseRichText_vtable
|
||||
{
|
||||
public:
|
||||
public:
|
||||
char unknown1[1880];
|
||||
|
||||
void(__fastcall* InsertChar)(vgui_BaseRichText* self, wchar_t ch);
|
||||
|
@ -49,7 +49,7 @@ class vgui_BaseRichText_vtable
|
|||
|
||||
class CGameSettings
|
||||
{
|
||||
public:
|
||||
public:
|
||||
char unknown1[92];
|
||||
int isChatEnabled;
|
||||
};
|
||||
|
@ -58,7 +58,7 @@ class CGameSettings
|
|||
// have their value at the same offset
|
||||
class CGameFloatVar
|
||||
{
|
||||
public:
|
||||
public:
|
||||
char unknown1[88];
|
||||
float value;
|
||||
};
|
||||
|
@ -101,7 +101,7 @@ Color lightColors[8] = {
|
|||
|
||||
class AnsiEscapeParser
|
||||
{
|
||||
public:
|
||||
public:
|
||||
explicit AnsiEscapeParser(LocalChatWriter* writer) : m_writer(writer) {}
|
||||
|
||||
void HandleVal(unsigned long val)
|
||||
|
@ -129,7 +129,7 @@ class AnsiEscapeParser
|
|||
}
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
enum class Next
|
||||
{
|
||||
ControlType,
|
||||
|
|
|
@ -5,7 +5,7 @@ class vgui_BaseRichText;
|
|||
|
||||
class CHudChat
|
||||
{
|
||||
public:
|
||||
public:
|
||||
static CHudChat** allHuds;
|
||||
|
||||
char unknown1[720];
|
||||
|
@ -29,7 +29,7 @@ class CHudChat
|
|||
|
||||
class LocalChatWriter
|
||||
{
|
||||
public:
|
||||
public:
|
||||
enum Context
|
||||
{
|
||||
NetworkContext = 0,
|
||||
|
@ -56,7 +56,7 @@ class LocalChatWriter
|
|||
void InsertColorChange(Color color);
|
||||
void InsertSwatchColorChange(SwatchColor color);
|
||||
|
||||
private:
|
||||
private:
|
||||
Context m_context;
|
||||
|
||||
const char* ApplyAnsiEscape(const char* escape);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
class ConCommandBase;
|
||||
class IConCommandBaseAccessor
|
||||
{
|
||||
public:
|
||||
public:
|
||||
// Flags is a combination of FCVAR flags in cvar.h.
|
||||
// hOut is filled in with a handle to the variable.
|
||||
virtual bool RegisterConCommandBase(ConCommandBase* pVar) = 0;
|
||||
|
@ -12,7 +12,7 @@ class IConCommandBaseAccessor
|
|||
|
||||
class CCommand
|
||||
{
|
||||
public:
|
||||
public:
|
||||
CCommand() = delete;
|
||||
|
||||
int64_t ArgC() const;
|
||||
|
@ -24,7 +24,7 @@ class CCommand
|
|||
|
||||
static int MaxCommandLength();
|
||||
|
||||
private:
|
||||
private:
|
||||
enum
|
||||
{
|
||||
COMMAND_MAX_ARGC = 64,
|
||||
|
@ -88,7 +88,7 @@ typedef int (*FnCommandCompletionCallback)(const char* partial, char commands[CO
|
|||
// From r5reloaded
|
||||
class ConCommandBase
|
||||
{
|
||||
public:
|
||||
public:
|
||||
bool HasFlags(int nFlags);
|
||||
void AddFlags(int nFlags);
|
||||
void RemoveFlags(int nFlags);
|
||||
|
@ -120,7 +120,7 @@ class ConCommand : public ConCommandBase
|
|||
{
|
||||
friend class CCVar;
|
||||
|
||||
public:
|
||||
public:
|
||||
ConCommand(void) {}; // !TODO: Rebuild engine constructor in SDK instead.
|
||||
ConCommand(const char* szName, const char* szHelpString, int nFlags, void* pCallback, void* pCommandCompletionCallback);
|
||||
void Init(void);
|
||||
|
|
|
@ -124,7 +124,7 @@ typedef void (*FnChangeCallback_t)(ConVar* var, const char* pOldValue, float flO
|
|||
//-----------------------------------------------------------------------------
|
||||
class ConVar
|
||||
{
|
||||
public:
|
||||
public:
|
||||
ConVar(void) {};
|
||||
ConVar(const char* pszName, const char* pszDefaultValue, int nFlags, const char* pszHelpString);
|
||||
ConVar(
|
||||
|
|
|
@ -13,7 +13,7 @@ class ConVar;
|
|||
//-----------------------------------------------------------------------------
|
||||
class CCVarIteratorInternal // Fully reversed table, just look at the virtual function table and rename the function.
|
||||
{
|
||||
public:
|
||||
public:
|
||||
virtual void SetFirst(void) = 0; // 0
|
||||
virtual void Next(void) = 0; // 1
|
||||
virtual bool IsValid(void) = 0; // 2
|
||||
|
@ -25,7 +25,7 @@ class CCVarIteratorInternal // Fully reversed table, just look at the virtual fu
|
|||
//-----------------------------------------------------------------------------
|
||||
class CCvar
|
||||
{
|
||||
public:
|
||||
public:
|
||||
M_VMETHOD(ConCommandBase*, FindCommandBase, 14, (const char* pszCommandName), (this, pszCommandName));
|
||||
M_VMETHOD(ConVar*, FindVar, 16, (const char* pszVarName), (this, pszVarName));
|
||||
M_VMETHOD(ConCommand*, FindCommand, 18, (const char* pszCommandName), (this, pszCommandName));
|
||||
|
|
|
@ -29,14 +29,14 @@ enum SearchPathAdd_t
|
|||
|
||||
class CSearchPath
|
||||
{
|
||||
public:
|
||||
public:
|
||||
unsigned char unknown[0x18];
|
||||
const char* debugPath;
|
||||
};
|
||||
|
||||
class IFileSystem
|
||||
{
|
||||
public:
|
||||
public:
|
||||
struct VTable
|
||||
{
|
||||
void* unknown[10];
|
||||
|
|
|
@ -17,11 +17,11 @@ struct LoadedPak
|
|||
|
||||
class PakLoadManager
|
||||
{
|
||||
private:
|
||||
private:
|
||||
std::map<int, LoadedPak> m_vLoadedPaks {};
|
||||
std::unordered_map<size_t, int> m_HashToPakHandle {};
|
||||
|
||||
public:
|
||||
public:
|
||||
int LoadPakAsync(const char* pPath, const ePakLoadSource nLoadSource);
|
||||
void UnloadPak(const int nPakHandle);
|
||||
void UnloadMapPaks();
|
||||
|
|
|
@ -25,7 +25,7 @@ enum class eDllLoadCallbackSide
|
|||
|
||||
class __dllLoadCallback
|
||||
{
|
||||
public:
|
||||
public:
|
||||
__dllLoadCallback() = delete;
|
||||
__dllLoadCallback(
|
||||
eDllLoadCallbackSide side,
|
||||
|
@ -67,7 +67,7 @@ class __autovar;
|
|||
|
||||
class __fileAutohook
|
||||
{
|
||||
public:
|
||||
public:
|
||||
std::vector<__autohook*> hooks;
|
||||
std::vector<__autovar*> vars;
|
||||
|
||||
|
@ -91,7 +91,7 @@ uintptr_t ParseDLLOffsetString(const char* pAddrString);
|
|||
|
||||
class __autohook
|
||||
{
|
||||
public:
|
||||
public:
|
||||
enum AddressResolutionMode
|
||||
{
|
||||
OFFSET_STRING, // we're using a string that of the format dllname.dll + offset
|
||||
|
@ -111,7 +111,7 @@ class __autohook
|
|||
char* pModuleName; // for PROCADDRESS
|
||||
char* pProcName; // for PROCADDRESS
|
||||
|
||||
public:
|
||||
public:
|
||||
__autohook() = delete;
|
||||
|
||||
__autohook(__fileAutohook* autohook, const char* funcName, LPVOID absoluteAddress, LPVOID* orig, LPVOID func)
|
||||
|
@ -250,13 +250,13 @@ class __autohook
|
|||
|
||||
class ManualHook
|
||||
{
|
||||
public:
|
||||
public:
|
||||
char* pFuncName;
|
||||
|
||||
LPVOID pHookFunc;
|
||||
LPVOID* ppOrigFunc;
|
||||
|
||||
public:
|
||||
public:
|
||||
ManualHook() = delete;
|
||||
ManualHook(const char* funcName, LPVOID func);
|
||||
ManualHook(const char* funcName, LPVOID* orig, LPVOID func);
|
||||
|
@ -284,11 +284,11 @@ void MakeHook(LPVOID pTarget, LPVOID pDetour, void* ppOriginal, const char* pFun
|
|||
|
||||
class __autovar
|
||||
{
|
||||
public:
|
||||
public:
|
||||
char* m_pAddrString;
|
||||
void** m_pTarget;
|
||||
|
||||
public:
|
||||
public:
|
||||
__autovar(__fileAutohook* pAutohook, const char* pAddrString, void** pTarget)
|
||||
{
|
||||
m_pTarget = pTarget;
|
||||
|
|
|
@ -89,13 +89,13 @@ enum EBitCoordType
|
|||
|
||||
class BitBufferBase
|
||||
{
|
||||
protected:
|
||||
protected:
|
||||
INLINE void SetName(const char* name)
|
||||
{
|
||||
m_BufferName = name;
|
||||
}
|
||||
|
||||
public:
|
||||
public:
|
||||
INLINE bool IsOverflowed()
|
||||
{
|
||||
return m_Overflow;
|
||||
|
@ -110,16 +110,16 @@ class BitBufferBase
|
|||
return m_BufferName;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
const char* m_BufferName = "";
|
||||
|
||||
protected:
|
||||
protected:
|
||||
u8 m_Overflow = false;
|
||||
};
|
||||
|
||||
class BFRead : public BitBufferBase
|
||||
{
|
||||
public:
|
||||
public:
|
||||
BFRead() = default;
|
||||
|
||||
INLINE BFRead(uptr data, size_t byteLength, size_t startPos = 0, const char* bufferName = 0)
|
||||
|
@ -130,7 +130,7 @@ class BFRead : public BitBufferBase
|
|||
SetName(bufferName);
|
||||
}
|
||||
|
||||
public:
|
||||
public:
|
||||
INLINE void StartReading(uptr data, size_t byteLength, size_t startPos = 0)
|
||||
{
|
||||
m_Data = reinterpret_cast<u32 const*>(data);
|
||||
|
@ -706,7 +706,7 @@ class BFRead : public BitBufferBase
|
|||
return GetNumBitsLeft() >> 3;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
size_t m_DataBits; // 0x0010
|
||||
size_t m_DataBytes; // 0x0018
|
||||
|
||||
|
@ -720,7 +720,7 @@ class BFRead : public BitBufferBase
|
|||
|
||||
class BFWrite : public BitBufferBase
|
||||
{
|
||||
public:
|
||||
public:
|
||||
BFWrite() = default;
|
||||
|
||||
INLINE BFWrite(uptr data, size_t byteLength, const char* bufferName = 0)
|
||||
|
@ -731,7 +731,7 @@ class BFWrite : public BitBufferBase
|
|||
SetName(bufferName);
|
||||
}
|
||||
|
||||
public:
|
||||
public:
|
||||
INLINE void StartWriting(uptr data, size_t byteLength)
|
||||
{
|
||||
m_Data = reinterpret_cast<u32*>(data);
|
||||
|
@ -1131,7 +1131,7 @@ class BFWrite : public BitBufferBase
|
|||
WriteBitVec3Coord(tmp);
|
||||
}*/
|
||||
|
||||
private:
|
||||
private:
|
||||
size_t m_DataBits = 0;
|
||||
size_t m_DataBytes = 0;
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ struct SourceColor
|
|||
//-----------------------------------------------------------------------------
|
||||
class Color
|
||||
{
|
||||
public:
|
||||
public:
|
||||
Color(int r, int g, int b, int a = 255)
|
||||
{
|
||||
_color[0] = (unsigned char)r;
|
||||
|
@ -169,7 +169,7 @@ class Color
|
|||
return SourceColor(_color[0], _color[1], _color[2], _color[3]);
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
unsigned char _color[4];
|
||||
};
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ void operator delete(void* p) noexcept;
|
|||
|
||||
class SourceAllocator
|
||||
{
|
||||
public:
|
||||
public:
|
||||
static const bool kNeedFree = true;
|
||||
void* Malloc(size_t size)
|
||||
{
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
class CMemoryAddress
|
||||
{
|
||||
public:
|
||||
public:
|
||||
uintptr_t m_nAddress;
|
||||
|
||||
public:
|
||||
public:
|
||||
CMemoryAddress();
|
||||
CMemoryAddress(const uintptr_t nAddress);
|
||||
CMemoryAddress(const void* pAddress);
|
||||
|
@ -47,7 +47,7 @@ class CMemoryAddress
|
|||
// based on https://github.com/Mauler125/r5sdk/blob/master/r5dev/public/include/module.h
|
||||
class CModule : public CMemoryAddress
|
||||
{
|
||||
public:
|
||||
public:
|
||||
struct ModuleSections_t
|
||||
{
|
||||
ModuleSections_t(void) = default;
|
||||
|
@ -71,7 +71,7 @@ class CModule : public CMemoryAddress
|
|||
ModuleSections_t m_RunTimeData;
|
||||
ModuleSections_t m_ReadOnlyData;
|
||||
|
||||
private:
|
||||
private:
|
||||
std::string m_svModuleName;
|
||||
uintptr_t m_pModuleBase {};
|
||||
DWORD m_nModuleSize {};
|
||||
|
@ -79,7 +79,7 @@ class CModule : public CMemoryAddress
|
|||
IMAGE_DOS_HEADER* m_pDOSHeader = nullptr;
|
||||
std::vector<ModuleSections_t> m_vModuleSections;
|
||||
|
||||
public:
|
||||
public:
|
||||
CModule() = delete; // no default, we need a module name
|
||||
CModule(const HMODULE pModule);
|
||||
CModule(const char* pModuleName);
|
||||
|
|
|
@ -6,10 +6,10 @@ typedef void* (*CreateInterfaceFn)(const char* pName, int* pReturnCode);
|
|||
|
||||
template <typename T> class SourceInterface
|
||||
{
|
||||
private:
|
||||
private:
|
||||
T* m_interface;
|
||||
|
||||
public:
|
||||
public:
|
||||
SourceInterface(const std::string& moduleName, const std::string& interfaceName)
|
||||
{
|
||||
HMODULE handle = GetModuleHandleA(moduleName.c_str());
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
class IMemAlloc
|
||||
{
|
||||
public:
|
||||
public:
|
||||
struct VTable
|
||||
{
|
||||
void* unknown[1]; // alloc debug
|
||||
|
@ -25,7 +25,7 @@ class IMemAlloc
|
|||
|
||||
class CCommandLine
|
||||
{
|
||||
public:
|
||||
public:
|
||||
// based on the defs in the 2013 source sdk, but for some reason has an extra function (may be another CreateCmdLine overload?)
|
||||
// these seem to line up with what they should be though
|
||||
virtual void CreateCmdLine(const char* commandline) = 0;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/// as well as various other small changes for compatibility
|
||||
class VanillaCompatibility
|
||||
{
|
||||
public:
|
||||
public:
|
||||
void SetVanillaCompatibility(bool isVanilla)
|
||||
{
|
||||
static bool bInitialised = false;
|
||||
|
@ -22,7 +22,7 @@ class VanillaCompatibility
|
|||
return m_bIsVanillaCompatible;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
bool m_bIsVanillaCompatible = false;
|
||||
};
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
class DedicatedServerLogToClientSink : public CustomSink
|
||||
{
|
||||
protected:
|
||||
protected:
|
||||
void custom_sink_it_(const custom_log_msg& msg);
|
||||
void sink_it_(const spdlog::details::log_msg& msg) override;
|
||||
void flush_() override;
|
||||
|
|
|
@ -14,7 +14,7 @@ enum class HostState_t
|
|||
|
||||
struct CHostState
|
||||
{
|
||||
public:
|
||||
public:
|
||||
HostState_t m_iCurrentState;
|
||||
HostState_t m_iNextState;
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ enum class EngineState_t
|
|||
|
||||
class CEngine
|
||||
{
|
||||
public:
|
||||
public:
|
||||
virtual void unknown() = 0; // unsure if this is where
|
||||
virtual bool Load(bool dedicated, const char* baseDir) = 0;
|
||||
virtual void Unload() = 0;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
class CCrashHandler
|
||||
{
|
||||
public:
|
||||
public:
|
||||
CCrashHandler();
|
||||
~CCrashHandler();
|
||||
|
||||
|
@ -77,7 +77,7 @@ class CCrashHandler
|
|||
//-----------------------------------------------------------------------------
|
||||
void WriteMinidump();
|
||||
|
||||
private:
|
||||
private:
|
||||
PVOID m_hExceptionFilter;
|
||||
EXCEPTION_POINTERS* m_pExceptionInfos;
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ class ColoredLogger;
|
|||
|
||||
struct custom_log_msg : spdlog::details::log_msg
|
||||
{
|
||||
public:
|
||||
public:
|
||||
custom_log_msg(ColoredLogger* origin, spdlog::details::log_msg msg) : origin(origin), spdlog::details::log_msg(msg) {}
|
||||
|
||||
ColoredLogger* origin;
|
||||
|
@ -21,7 +21,7 @@ struct custom_log_msg : spdlog::details::log_msg
|
|||
|
||||
class CustomSink : public spdlog::sinks::base_sink<std::mutex>
|
||||
{
|
||||
public:
|
||||
public:
|
||||
void custom_log(const custom_log_msg& msg);
|
||||
virtual void custom_sink_it_(const custom_log_msg& msg)
|
||||
{
|
||||
|
@ -31,7 +31,7 @@ class CustomSink : public spdlog::sinks::base_sink<std::mutex>
|
|||
|
||||
class ColoredLogger : public spdlog::logger
|
||||
{
|
||||
public:
|
||||
public:
|
||||
std::string ANSIColor;
|
||||
SourceColor SRCColor;
|
||||
|
||||
|
@ -117,7 +117,7 @@ static const char* level_names[] {"trac", "dbug", "info", "warn", "errr", "crit"
|
|||
// spdlog logger, for cool colour things
|
||||
class ExternalConsoleSink : public CustomSink
|
||||
{
|
||||
private:
|
||||
private:
|
||||
std::map<spdlog::level::level_enum, std::string> m_LogColours = {
|
||||
{spdlog::level::trace, NS::Colors::TRACE.ToANSIColor()},
|
||||
{spdlog::level::debug, NS::Colors::DEBUG.ToANSIColor()},
|
||||
|
@ -129,7 +129,7 @@ class ExternalConsoleSink : public CustomSink
|
|||
|
||||
std::string default_color = "\033[39;49m";
|
||||
|
||||
protected:
|
||||
protected:
|
||||
void sink_it_(const spdlog::details::log_msg& msg) override;
|
||||
void custom_sink_it_(const custom_log_msg& msg);
|
||||
void flush_() override;
|
||||
|
|
|
@ -24,7 +24,7 @@ enum class TextMsgPrintType_t
|
|||
|
||||
class ICenterPrint
|
||||
{
|
||||
public:
|
||||
public:
|
||||
virtual void ctor() = 0;
|
||||
virtual void Clear(void) = 0;
|
||||
virtual void ColorPrint(int r, int g, int b, int a, wchar_t* text) = 0;
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
|
||||
class EditablePanel
|
||||
{
|
||||
public:
|
||||
public:
|
||||
virtual ~EditablePanel() = 0;
|
||||
unsigned char unknown[0x2B0];
|
||||
};
|
||||
|
||||
class IConsoleDisplayFunc
|
||||
{
|
||||
public:
|
||||
public:
|
||||
virtual void ColorPrint(const SourceColor& clr, const char* pMessage) = 0;
|
||||
virtual void Print(const char* pMessage) = 0;
|
||||
virtual void DPrint(const char* pMessage) = 0;
|
||||
|
@ -24,7 +24,7 @@ class CConsolePanel : public EditablePanel, public IConsoleDisplayFunc
|
|||
|
||||
class CConsoleDialog
|
||||
{
|
||||
public:
|
||||
public:
|
||||
struct VTable
|
||||
{
|
||||
void* unknown[298];
|
||||
|
@ -38,7 +38,7 @@ class CConsoleDialog
|
|||
|
||||
class CGameConsole
|
||||
{
|
||||
public:
|
||||
public:
|
||||
virtual ~CGameConsole() = 0;
|
||||
|
||||
// activates the console, makes it visible and brings it to the foreground
|
||||
|
@ -66,7 +66,7 @@ extern SourceInterface<CGameConsole>* g_pSourceGameConsole;
|
|||
// spdlog logger
|
||||
class SourceConsoleSink : public CustomSink
|
||||
{
|
||||
private:
|
||||
private:
|
||||
std::map<spdlog::level::level_enum, SourceColor> m_LogColours = {
|
||||
{spdlog::level::trace, NS::Colors::TRACE.ToSourceColor()},
|
||||
{spdlog::level::debug, NS::Colors::DEBUG.ToSourceColor()},
|
||||
|
@ -76,7 +76,7 @@ class SourceConsoleSink : public CustomSink
|
|||
{spdlog::level::critical, NS::Colors::CRIT.ToSourceColor()},
|
||||
{spdlog::level::off, NS::Colors::OFF.ToSourceColor()}};
|
||||
|
||||
protected:
|
||||
protected:
|
||||
void custom_sink_it_(const custom_log_msg& msg);
|
||||
void sink_it_(const spdlog::details::log_msg& msg) override;
|
||||
void flush_() override;
|
||||
|
|
|
@ -13,14 +13,14 @@ extern ConVar* Cvar_ns_curl_log_enable;
|
|||
|
||||
struct RemoteModInfo
|
||||
{
|
||||
public:
|
||||
public:
|
||||
std::string Name;
|
||||
std::string Version;
|
||||
};
|
||||
|
||||
class RemoteServerInfo
|
||||
{
|
||||
public:
|
||||
public:
|
||||
char id[33]; // 32 bytes + nullterminator
|
||||
|
||||
// server info
|
||||
|
@ -37,7 +37,7 @@ class RemoteServerInfo
|
|||
// connection stuff
|
||||
bool requiresPassword;
|
||||
|
||||
public:
|
||||
public:
|
||||
RemoteServerInfo(
|
||||
const char* newId,
|
||||
const char* newName,
|
||||
|
@ -52,7 +52,7 @@ class RemoteServerInfo
|
|||
|
||||
struct RemoteServerConnectionInfo
|
||||
{
|
||||
public:
|
||||
public:
|
||||
char authToken[32];
|
||||
|
||||
in_addr ip;
|
||||
|
@ -61,7 +61,7 @@ struct RemoteServerConnectionInfo
|
|||
|
||||
struct MainMenuPromoData
|
||||
{
|
||||
public:
|
||||
public:
|
||||
std::string newInfoTitle1;
|
||||
std::string newInfoTitle2;
|
||||
std::string newInfoTitle3;
|
||||
|
@ -82,11 +82,11 @@ struct MainMenuPromoData
|
|||
|
||||
class MasterServerManager
|
||||
{
|
||||
private:
|
||||
private:
|
||||
bool m_bRequestingServerList = false;
|
||||
bool m_bAuthenticatingWithGameServer = false;
|
||||
|
||||
public:
|
||||
public:
|
||||
char m_sOwnServerId[33];
|
||||
char m_sOwnServerAuthToken[33];
|
||||
char m_sOwnClientAuthToken[33];
|
||||
|
@ -123,7 +123,7 @@ class MasterServerManager
|
|||
|
||||
std::unordered_set<std::string> m_handledServerConnections;
|
||||
|
||||
public:
|
||||
public:
|
||||
MasterServerManager();
|
||||
|
||||
void ClearServerList();
|
||||
|
@ -156,7 +156,7 @@ enum class MasterServerReportPresenceResult
|
|||
|
||||
class MasterServerPresenceReporter : public ServerPresenceReporter
|
||||
{
|
||||
public:
|
||||
public:
|
||||
/** Full data returned in the std::future of a MasterServerPresenceReporter::ReportPresence() call. */
|
||||
struct ReportPresenceResultData
|
||||
{
|
||||
|
@ -180,7 +180,7 @@ class MasterServerPresenceReporter : public ServerPresenceReporter
|
|||
// Called every frame.
|
||||
void RunFrame(double flCurrentTime, const ServerPresence* pServerPresence) override;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
// Contains the async logic to add the server to the MS.
|
||||
void InternalAddServer(const ServerPresence* pServerPresence);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class ModDownloader
|
||||
{
|
||||
private:
|
||||
private:
|
||||
const char* VERIFICATION_FLAG = "-disablemodverification";
|
||||
const char* CUSTOM_MODS_URL_FLAG = "-customverifiedurl=";
|
||||
const char* STORE_URL = "https://gcdn.thunderstore.io/live/repository/packages/";
|
||||
|
@ -70,7 +70,7 @@ class ModDownloader
|
|||
*/
|
||||
void ExtractMod(fs::path modPath);
|
||||
|
||||
public:
|
||||
public:
|
||||
ModDownloader();
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,7 +19,7 @@ const std::set<std::string> MODS_BLACKLIST = {"Mod Settings"};
|
|||
|
||||
struct ModConVar
|
||||
{
|
||||
public:
|
||||
public:
|
||||
std::string Name;
|
||||
std::string DefaultValue;
|
||||
std::string HelpString;
|
||||
|
@ -28,7 +28,7 @@ struct ModConVar
|
|||
|
||||
struct ModConCommand
|
||||
{
|
||||
public:
|
||||
public:
|
||||
std::string Name;
|
||||
std::string Function;
|
||||
std::string HelpString;
|
||||
|
@ -38,7 +38,7 @@ struct ModConCommand
|
|||
|
||||
struct ModScriptCallback
|
||||
{
|
||||
public:
|
||||
public:
|
||||
ScriptContext Context;
|
||||
|
||||
// called before the codecallback is executed
|
||||
|
@ -51,7 +51,7 @@ struct ModScriptCallback
|
|||
|
||||
struct ModScript
|
||||
{
|
||||
public:
|
||||
public:
|
||||
std::string Path;
|
||||
std::string RunOn;
|
||||
|
||||
|
@ -61,14 +61,14 @@ struct ModScript
|
|||
// these are pretty much identical, could refactor to use the same stuff?
|
||||
struct ModVPKEntry
|
||||
{
|
||||
public:
|
||||
public:
|
||||
bool m_bAutoLoad;
|
||||
std::string m_sVpkPath;
|
||||
};
|
||||
|
||||
struct ModRpakEntry
|
||||
{
|
||||
public:
|
||||
public:
|
||||
bool m_bAutoLoad;
|
||||
std::string m_sPakName;
|
||||
std::string m_sLoadAfterPak;
|
||||
|
@ -76,7 +76,7 @@ struct ModRpakEntry
|
|||
|
||||
class Mod
|
||||
{
|
||||
public:
|
||||
public:
|
||||
// runtime stuff
|
||||
bool m_bEnabled = true;
|
||||
bool m_bWasReadSuccessfully = false;
|
||||
|
@ -127,10 +127,10 @@ class Mod
|
|||
std::unordered_map<std::string, std::string> DependencyConstants;
|
||||
std::vector<std::string> PluginDependencyConstants;
|
||||
|
||||
public:
|
||||
public:
|
||||
Mod(fs::path modPath, char* jsonBuf);
|
||||
|
||||
private:
|
||||
private:
|
||||
void ParseConVars(rapidjson_document& json);
|
||||
void ParseConCommands(rapidjson_document& json);
|
||||
void ParseScripts(rapidjson_document& json);
|
||||
|
@ -142,14 +142,14 @@ class Mod
|
|||
|
||||
struct ModOverrideFile
|
||||
{
|
||||
public:
|
||||
public:
|
||||
Mod* m_pOwningMod;
|
||||
fs::path m_Path;
|
||||
};
|
||||
|
||||
class ModManager
|
||||
{
|
||||
private:
|
||||
private:
|
||||
bool m_bHasLoadedMods = false;
|
||||
bool m_bHasEnabledModsCfg;
|
||||
rapidjson_document m_EnabledModsCfg;
|
||||
|
@ -159,13 +159,13 @@ class ModManager
|
|||
size_t m_hPdefHash;
|
||||
size_t m_hKBActHash;
|
||||
|
||||
public:
|
||||
public:
|
||||
std::vector<Mod> m_LoadedMods;
|
||||
std::unordered_map<std::string, ModOverrideFile> m_ModFiles;
|
||||
std::unordered_map<std::string, std::string> m_DependencyConstants;
|
||||
std::unordered_set<std::string> m_PluginDependencyConstants;
|
||||
|
||||
public:
|
||||
public:
|
||||
ModManager();
|
||||
void LoadMods();
|
||||
void UnloadMods();
|
||||
|
|
|
@ -4,13 +4,13 @@ bool ContainsInvalidChars(std::string str);
|
|||
|
||||
class SaveFileManager
|
||||
{
|
||||
public:
|
||||
public:
|
||||
template <ScriptContext context> void SaveFileAsync(fs::path file, std::string content);
|
||||
template <ScriptContext context> int LoadFileAsync(fs::path file);
|
||||
template <ScriptContext context> void DeleteFileAsync(fs::path file);
|
||||
// Future proofed in that if we ever get multi-threaded SSDs this code will take advantage of them.
|
||||
std::mutex fileMutex;
|
||||
|
||||
private:
|
||||
private:
|
||||
int m_iLastRequestHandle = 0;
|
||||
};
|
||||
|
|
|
@ -17,7 +17,7 @@ union PluginRespondDataCallable
|
|||
|
||||
class PluginDataRequest
|
||||
{
|
||||
public:
|
||||
public:
|
||||
PluginDataRequestType type;
|
||||
PluginRespondDataCallable func;
|
||||
PluginDataRequest(PluginDataRequestType type, PluginRespondDataCallable func) : type(type), func(func) {}
|
||||
|
@ -25,11 +25,11 @@ class PluginDataRequest
|
|||
|
||||
class PluginCommunicationHandler
|
||||
{
|
||||
public:
|
||||
public:
|
||||
void RunFrame();
|
||||
void PushRequest(PluginDataRequestType type, PluginRespondDataCallable func);
|
||||
|
||||
public:
|
||||
public:
|
||||
std::queue<PluginDataRequest> requestQueue = {};
|
||||
std::mutex requestMutex;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ const int IDR_RCDATA1 = 101;
|
|||
|
||||
class Plugin
|
||||
{
|
||||
public:
|
||||
public:
|
||||
std::string name;
|
||||
std::string displayName;
|
||||
std::string dependencyName;
|
||||
|
@ -23,7 +23,7 @@ class Plugin
|
|||
bool run_on_client = false;
|
||||
bool run_on_server = false;
|
||||
|
||||
public:
|
||||
public:
|
||||
PLUGIN_INIT_TYPE init;
|
||||
PLUGIN_INIT_SQVM_TYPE init_sqvm_client;
|
||||
PLUGIN_INIT_SQVM_TYPE init_sqvm_server;
|
||||
|
@ -37,10 +37,10 @@ class Plugin
|
|||
|
||||
class PluginManager
|
||||
{
|
||||
public:
|
||||
public:
|
||||
std::vector<Plugin> m_vLoadedPlugins;
|
||||
|
||||
public:
|
||||
public:
|
||||
bool LoadPlugins();
|
||||
std::optional<Plugin> LoadPlugin(fs::path path, PluginInitFuncs* funcs, PluginNorthstarData* data);
|
||||
|
||||
|
@ -52,7 +52,7 @@ class PluginManager
|
|||
|
||||
void RunFrame();
|
||||
|
||||
private:
|
||||
private:
|
||||
std::string pluginPath;
|
||||
};
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ struct HttpRequest
|
|||
*/
|
||||
class HttpRequestHandler
|
||||
{
|
||||
public:
|
||||
public:
|
||||
HttpRequestHandler();
|
||||
|
||||
// Start/Stop the HTTP request handler. Right now this doesn't do much.
|
||||
|
@ -122,7 +122,7 @@ class HttpRequestHandler
|
|||
/** Registers the HTTP request Squirrel functions for the given script context. */
|
||||
template <ScriptContext context> void RegisterSQFuncs();
|
||||
|
||||
private:
|
||||
private:
|
||||
int m_iLastRequestHandle = 0;
|
||||
std::atomic_bool m_bIsHttpRequestHandlerRunning = false;
|
||||
};
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
|
||||
class ServerBanSystem
|
||||
{
|
||||
private:
|
||||
private:
|
||||
std::ofstream m_sBanlistStream;
|
||||
std::vector<uint64_t> m_vBannedUids;
|
||||
|
||||
public:
|
||||
public:
|
||||
void OpenBanlist();
|
||||
void ReloadBanlist();
|
||||
void ClearBanlist();
|
||||
|
|
|
@ -26,7 +26,7 @@ extern CBaseServer__RejectConnectionType CBaseServer__RejectConnection;
|
|||
|
||||
class ServerAuthenticationManager
|
||||
{
|
||||
public:
|
||||
public:
|
||||
ConVar* Cvar_ns_erase_auth_info;
|
||||
ConVar* Cvar_ns_auth_allow_insecure;
|
||||
ConVar* Cvar_ns_auth_allow_insecure_write;
|
||||
|
@ -40,7 +40,7 @@ class ServerAuthenticationManager
|
|||
bool m_bForceResetLocalPlayerPersistence = false;
|
||||
bool m_bStartingLocalSPGame = false;
|
||||
|
||||
public:
|
||||
public:
|
||||
void AddRemotePlayer(std::string token, uint64_t uid, std::string username, std::string pdata);
|
||||
|
||||
void AddPlayer(CBaseClient* pPlayer, const char* pAuthToken);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
struct ServerPresence
|
||||
{
|
||||
public:
|
||||
public:
|
||||
int m_iPort;
|
||||
|
||||
std::string m_sServerId;
|
||||
|
@ -44,7 +44,7 @@ struct ServerPresence
|
|||
|
||||
class ServerPresenceReporter
|
||||
{
|
||||
public:
|
||||
public:
|
||||
virtual void CreatePresence(const ServerPresence* pServerPresence) {}
|
||||
virtual void ReportPresence(const ServerPresence* pServerPresence) {}
|
||||
virtual void DestroyPresence(const ServerPresence* pServerPresence) {}
|
||||
|
@ -53,7 +53,7 @@ class ServerPresenceReporter
|
|||
|
||||
class ServerPresenceManager
|
||||
{
|
||||
private:
|
||||
private:
|
||||
ServerPresence m_ServerPresence;
|
||||
|
||||
bool m_bHasPresence = false;
|
||||
|
@ -71,7 +71,7 @@ class ServerPresenceManager
|
|||
ConVar* Cvar_ns_report_server_to_masterserver;
|
||||
ConVar* Cvar_ns_report_sp_server_to_masterserver;
|
||||
|
||||
public:
|
||||
public:
|
||||
void AddPresenceReporter(ServerPresenceReporter* reporter);
|
||||
|
||||
void CreateConVars();
|
||||
|
|
|
@ -27,7 +27,7 @@ struct UnconnectedPlayerLimitData
|
|||
|
||||
class ServerLimitsManager
|
||||
{
|
||||
public:
|
||||
public:
|
||||
ConVar* CVar_sv_quota_stringcmdspersecond;
|
||||
ConVar* Cvar_net_chan_limit_mode;
|
||||
ConVar* Cvar_net_chan_limit_msec_per_sec;
|
||||
|
@ -40,7 +40,7 @@ class ServerLimitsManager
|
|||
std::unordered_map<CBaseClient*, PlayerLimitData> m_PlayerLimitData;
|
||||
std::vector<UnconnectedPlayerLimitData> m_UnconnectedPlayerLimitData;
|
||||
|
||||
public:
|
||||
public:
|
||||
void RunFrame(double flCurrentTime, float flFrameTime);
|
||||
void AddPlayer(CBaseClient* player);
|
||||
void RemovePlayer(CBaseClient* player);
|
||||
|
|
|
@ -17,7 +17,7 @@ typedef int HKeySymbol;
|
|||
|
||||
struct CKeyValuesSystem
|
||||
{
|
||||
public:
|
||||
public:
|
||||
struct __VTable
|
||||
{
|
||||
char pad0[8 * 3]; // 2 methods
|
||||
|
|
|
@ -48,10 +48,10 @@ enum MergeKeyValuesOp_t
|
|||
//-----------------------------------------------------------------------------
|
||||
class KeyValues
|
||||
{
|
||||
private:
|
||||
private:
|
||||
KeyValues(); // for internal use only
|
||||
|
||||
public:
|
||||
public:
|
||||
// Constructors/destructors
|
||||
KeyValues(const char* pszSetName);
|
||||
KeyValues(const char* pszSetName, const char* pszFirstKey, const char* pszFirstValue);
|
||||
|
@ -112,7 +112,7 @@ class KeyValues
|
|||
void CopySubkeys(KeyValues* pParent) const;
|
||||
KeyValues* MakeCopy(void) const;
|
||||
|
||||
public:
|
||||
public:
|
||||
uint32_t m_iKeyName : 24; // 0x0000
|
||||
uint32_t m_iKeyNameCaseSensitive1 : 8; // 0x0003
|
||||
char* m_sValue; // 0x0008
|
||||
|
|
|
@ -64,10 +64,10 @@ namespace NS::log
|
|||
// Cuts down on compile time by ~5 seconds
|
||||
class SquirrelManagerBase
|
||||
{
|
||||
protected:
|
||||
protected:
|
||||
std::vector<SQFuncRegistration*> m_funcRegistrations;
|
||||
|
||||
public:
|
||||
public:
|
||||
CSquirrelVM* m_pSQVM;
|
||||
std::map<std::string, SQFunction> m_funcOverrides = {};
|
||||
std::map<std::string, SQFunction> m_funcOriginals = {};
|
||||
|
@ -319,7 +319,7 @@ class SquirrelManagerBase
|
|||
|
||||
template <ScriptContext context> class SquirrelManager : public virtual SquirrelManagerBase
|
||||
{
|
||||
public:
|
||||
public:
|
||||
#pragma region MessageBuffer
|
||||
SquirrelMessageBuffer* messageBuffer;
|
||||
|
||||
|
@ -404,7 +404,7 @@ template <ScriptContext context> class SquirrelManager : public virtual Squirrel
|
|||
|
||||
#pragma endregion
|
||||
|
||||
public:
|
||||
public:
|
||||
SquirrelManager()
|
||||
{
|
||||
m_pSQVM = nullptr;
|
||||
|
|
|
@ -5,7 +5,7 @@ typedef void (*SqAutoBindFunc)();
|
|||
|
||||
class SquirrelAutoBindContainer
|
||||
{
|
||||
public:
|
||||
public:
|
||||
std::vector<std::function<void()>> clientSqAutoBindFuncs;
|
||||
std::vector<std::function<void()>> serverSqAutoBindFuncs;
|
||||
};
|
||||
|
@ -61,7 +61,7 @@ class __squirrelautobind;
|
|||
|
||||
class __squirrelautobind
|
||||
{
|
||||
public:
|
||||
public:
|
||||
__squirrelautobind() = delete;
|
||||
|
||||
__squirrelautobind(std::function<void()> clientAutoBindFunc, std::function<void()> serverAutoBindFunc)
|
||||
|
|
|
@ -122,7 +122,7 @@ typedef void (*sq_schedule_call_externalType)(
|
|||
|
||||
class SquirrelMessage
|
||||
{
|
||||
public:
|
||||
public:
|
||||
std::string functionName;
|
||||
FunctionVector args;
|
||||
bool isExternal = false;
|
||||
|
@ -133,10 +133,10 @@ class SquirrelMessage
|
|||
class SquirrelMessageBuffer
|
||||
{
|
||||
|
||||
private:
|
||||
private:
|
||||
std::queue<SquirrelMessage> messages = {};
|
||||
|
||||
public:
|
||||
public:
|
||||
std::mutex mutex;
|
||||
std::optional<SquirrelMessage> pop()
|
||||
{
|
||||
|
@ -179,7 +179,7 @@ class SquirrelMessageBuffer
|
|||
// Super simple wrapper class to allow pushing Assets via call
|
||||
class SquirrelAsset
|
||||
{
|
||||
public:
|
||||
public:
|
||||
std::string path;
|
||||
SquirrelAsset(std::string path) : path(path) {};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue