mirror of
https://github.com/JezuzLizard/T4SP-Server-Plugin.git
synced 2025-07-04 18:21:50 +00:00
Some debug stuff
This commit is contained in:
@ -61,4 +61,5 @@ namespace game
|
||||
int SL_ConvertFromString(scriptInstance_t inst, const char* str);
|
||||
int SL_ConvertFromRefString(scriptInstance_t inst, RefString* refString);
|
||||
RefString* GetRefString_0(scriptInstance_t inst, const char* str);
|
||||
const char* SL_ConvertToStringSafe(unsigned int id, game::scriptInstance_t inst);
|
||||
}
|
@ -362,4 +362,9 @@ namespace game
|
||||
{
|
||||
return codsrc::GetRefString_0(inst, str);
|
||||
}
|
||||
|
||||
const char* SL_ConvertToStringSafe(unsigned int id, game::scriptInstance_t inst)
|
||||
{
|
||||
return codsrc::SL_ConvertToStringSafe(id, inst);
|
||||
}
|
||||
}
|
@ -188,6 +188,33 @@ namespace game
|
||||
return answer;
|
||||
}
|
||||
|
||||
// cmd_function_s *__usercall Cmd_FindCommand@<eax>(const char *cmdName@<esi>)
|
||||
cmd_function_s* Cmd_FindCommand(const char* cmdName, void* call_addr)
|
||||
{
|
||||
cmd_function_s* answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov esi, cmdName;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
void Cmd_AddCommand(const char* name, void (__cdecl *function)())
|
||||
{
|
||||
cmd_function_s* newCmd = utils::memory::allocate<cmd_function_s>();
|
||||
|
||||
*newCmd = {};
|
||||
newCmd->next = *cmd_functions;
|
||||
newCmd->function = function;
|
||||
newCmd->name = utils::memory::duplicate_string(name);
|
||||
|
||||
*cmd_functions = newCmd;
|
||||
}
|
||||
|
||||
// restored
|
||||
void Sys_EnterCriticalSection(CriticalSection critSect)
|
||||
{
|
||||
|
@ -10,6 +10,16 @@
|
||||
#define ARRAY_COUNT(arrayn) \
|
||||
((sizeof(arrayn)) / (sizeof(arrayn[0])))
|
||||
|
||||
#ifndef NDEBUG
|
||||
#undef assert
|
||||
#define assert(expr) \
|
||||
if (!!!(expr)) \
|
||||
{ \
|
||||
utils::io::write_file("t4sp-server-plugin/gsc_state_assert.json", get_full_gsc_state_str(game::SCRIPTINSTANCE_SERVER)); \
|
||||
_wassert(_CRT_WIDE(#expr), _CRT_WIDE(__FILE__), (unsigned)(__LINE__)); \
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace game
|
||||
{
|
||||
enum gamemode
|
||||
|
@ -55,6 +55,10 @@ namespace game
|
||||
inline void* XAnimGetAnimDebugName_ADDR() { return CALL_ADDR(0x0, 0x60F850); }
|
||||
const char * XAnimGetAnimDebugName(unsigned int animIndex, XAnim_s * anims, void* call_addr = XAnimGetAnimDebugName_ADDR());
|
||||
|
||||
inline void* Cmd_FindCommand_ADDR() { return CALL_ADDR(0x0, 0x594DB0); }
|
||||
cmd_function_s* Cmd_FindCommand(const char* cmdName, void* call_addr = Cmd_FindCommand_ADDR());
|
||||
void Cmd_AddCommand(const char* name, void(__cdecl* function)());
|
||||
|
||||
void Sys_EnterCriticalSection(CriticalSection critSect);
|
||||
void Sys_LeaveCriticalSection(CriticalSection critSect);
|
||||
|
||||
@ -69,6 +73,7 @@ namespace game
|
||||
WEAK symbol<HunkUser*> g_allocNodeUser{ 0x0, 0x3882B20 };
|
||||
WEAK symbol<struct HunkUser *> g_user{ 0x0, 0x3882B48 };
|
||||
WEAK symbol<searchpath_s*> fs_searchpaths{ 0x0, 0x46E5044 };
|
||||
WEAK symbol<cmd_function_s*> cmd_functions{ 0x0, 0x1F416F4 };
|
||||
|
||||
namespace plutonium
|
||||
{
|
||||
|
Reference in New Issue
Block a user