mirror of
https://github.com/JezuzLizard/T4SP-Server-Plugin.git
synced 2025-04-20 13:35:43 +00:00
Added pluto code
This commit is contained in:
parent
30ce0ad8eb
commit
8c36a218de
@ -298,7 +298,12 @@ namespace codsrc
|
||||
game::gScrParserPub[inst].scriptfilename = extFilename;
|
||||
game:: gScrCompilePub[inst].in_ptr = "+";
|
||||
game::gScrCompilePub[inst].parseBuf = sourceBuffer;
|
||||
game::ScriptParse(inst, &parseData);
|
||||
|
||||
// pluto
|
||||
game::plutonium::script_preprocess(sourceBuffer, inst, &parseData); // the pluto hook will call ScriptParse, so we dont have to
|
||||
// game::ScriptParse(inst, &parseData);
|
||||
//
|
||||
|
||||
scriptPosVar = game::GetVariable(inst, game::gScrCompilePub[inst].scriptsPos, name);
|
||||
filePosId = game::GetObject(inst, scriptPosVar);
|
||||
scriptCountVar = game::GetVariable(inst, game::gScrCompilePub[inst].scriptsCount, name);
|
||||
|
@ -437,7 +437,10 @@ namespace codsrc
|
||||
char* buffer;
|
||||
int fh;
|
||||
|
||||
if (*(*game::fs_game)->current.string || (*game::com_developer)->current.enabled)
|
||||
// pluto
|
||||
if (true)
|
||||
// if (*(*game::fs_game)->current.string || (*game::com_developer)->current.enabled)
|
||||
//
|
||||
{
|
||||
*game::statmon_related_bool = 1;
|
||||
if (game::FS_FOpenFileByMode(filename, &fh, game::FS_READ) < 0)
|
||||
|
@ -1274,9 +1274,12 @@ namespace codsrc
|
||||
++game::gScrVmPub[inst].function_frame;
|
||||
game::gScrVmPub[inst].function_frame->fs.localId = game::gFs[inst].localId;
|
||||
|
||||
// pluto
|
||||
game::plutonium::vm_execute_update_codepos(inst);
|
||||
//
|
||||
|
||||
assert(game::gFs[inst].pos);
|
||||
|
||||
// replace func
|
||||
}
|
||||
|
||||
void OP_ScriptFunctionCall(game::scriptInstance_t inst)
|
||||
@ -4207,7 +4210,17 @@ namespace codsrc
|
||||
game::Scr_ClearOutParams(inst);
|
||||
startTop = &game::gScrVmPub[inst].top[-paramcount];
|
||||
paramcounta = game::gScrVmPub[inst].inparamcount - paramcount;
|
||||
id = game::FindEntityId(classnum, entnum, inst);
|
||||
|
||||
// pluto
|
||||
if (classnum == -1)
|
||||
{
|
||||
id = entnum; // this is for level notify
|
||||
}
|
||||
//
|
||||
else
|
||||
{
|
||||
id = game::FindEntityId(classnum, entnum, inst);
|
||||
}
|
||||
|
||||
if ( id )
|
||||
{
|
||||
@ -4496,6 +4509,10 @@ namespace codsrc
|
||||
unsigned short threadId;
|
||||
const char* pos;
|
||||
|
||||
// pluto
|
||||
game::plutonium::scr_execthread_update_codepos_func(inst, inst, &handle, &handle);
|
||||
//
|
||||
|
||||
pos = &game::gScrVarPub[inst].programBuffer[handle];
|
||||
|
||||
if ( !game::gScrVmPub[inst].function_count )
|
||||
@ -4537,6 +4554,10 @@ namespace codsrc
|
||||
const char* pos;
|
||||
game::classNum_e classnum = game::CLASS_NUM_ENTITY;
|
||||
|
||||
// pluto
|
||||
game::plutonium::scr_execentthread_update_codepos_func(inst, &handle);
|
||||
//
|
||||
|
||||
pos = &game::gScrVarPub[inst].programBuffer[handle];
|
||||
|
||||
if ( !game::gScrVmPub[inst].function_count )
|
||||
@ -4576,6 +4597,10 @@ namespace codsrc
|
||||
unsigned int thread;
|
||||
unsigned int paramcount = 0;
|
||||
|
||||
// pluto
|
||||
game::plutonium::scr_addexecthread_update_codepos_func(inst, &handle);
|
||||
//
|
||||
|
||||
if ( !game::gScrVmPub[inst].function_count )
|
||||
{
|
||||
assert(game::gScrVmPub[inst].localVars == game::gScrVmGlob[inst].localVarsStack - 1);
|
||||
|
@ -147,6 +147,12 @@ namespace signatures
|
||||
bool handle_funcs()
|
||||
{
|
||||
game::plutonium::load_custom_script_func.set(reinterpret_cast<size_t>(utils::hook::get_displacement_addr(reinterpret_cast<size_t>(utils::hook::get_displacement_addr(0x689C80)) + 0x6)));
|
||||
game::plutonium::script_preprocess.set(reinterpret_cast<size_t>(utils::hook::get_displacement_addr(reinterpret_cast<size_t>(utils::hook::get_displacement_addr(0x689BCF)) + 0x2)));
|
||||
|
||||
game::plutonium::vm_execute_update_codepos.set(reinterpret_cast<size_t>(utils::hook::get_displacement_addr(reinterpret_cast<size_t>(utils::hook::get_displacement_addr(0x69608C)) + 0x2)));
|
||||
game::plutonium::scr_execthread_update_codepos_func.set(reinterpret_cast<size_t>(utils::hook::get_displacement_addr(reinterpret_cast<size_t>(utils::hook::get_displacement_addr(0x699560)) + 0x11)));
|
||||
game::plutonium::scr_execentthread_update_codepos_func.set(reinterpret_cast<size_t>(utils::hook::get_displacement_addr(reinterpret_cast<size_t>(utils::hook::get_displacement_addr(0x699640)) + 0x7)));
|
||||
game::plutonium::scr_addexecthread_update_codepos_func.set(reinterpret_cast<size_t>(utils::hook::get_displacement_addr(reinterpret_cast<size_t>(utils::hook::get_displacement_addr(0x699730)) + 0x7)));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -73,5 +73,10 @@ namespace game
|
||||
WEAK symbol<int(const char* fmt, ...)> printf{0x0, 0x0};
|
||||
|
||||
WEAK symbol<void(scriptInstance_t)> load_custom_script_func{0x0, 0x0};
|
||||
WEAK symbol<void(char*, game::scriptInstance_t, sval_u*)> script_preprocess{0x0, 0x0};
|
||||
WEAK symbol<void(game::scriptInstance_t)> vm_execute_update_codepos{0x0, 0x0};
|
||||
WEAK symbol<void(game::scriptInstance_t, game::scriptInstance_t, unsigned int*, unsigned int*)> scr_execthread_update_codepos_func{0x0, 0x0};
|
||||
WEAK symbol<void(game::scriptInstance_t, unsigned int*)> scr_execentthread_update_codepos_func{ 0x0, 0x0 };
|
||||
WEAK symbol<void(game::scriptInstance_t, unsigned int*)> scr_addexecthread_update_codepos_func{ 0x0, 0x0 };
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user