|
|
|
@ -26,7 +26,7 @@ namespace dedicated
|
|
|
|
|
initialized = true;
|
|
|
|
|
|
|
|
|
|
// R_LoadGraphicsAssets
|
|
|
|
|
utils::hook::invoke<void>(0x1405DF4B0);
|
|
|
|
|
utils::hook::invoke<void>(0x686310_b);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void send_heartbeat()
|
|
|
|
@ -197,96 +197,96 @@ namespace dedicated
|
|
|
|
|
dvars::override::register_bool("r_preloadShaders", false, game::DVAR_FLAG_READ);
|
|
|
|
|
|
|
|
|
|
// Stop crashing from sys_errors
|
|
|
|
|
utils::hook::jump(0x140511520, sys_error_stub);
|
|
|
|
|
utils::hook::jump(0x1D8710_b, sys_error_stub);
|
|
|
|
|
|
|
|
|
|
// Hook R_SyncGpu
|
|
|
|
|
utils::hook::jump(0x1405E12F0, sync_gpu_stub);
|
|
|
|
|
utils::hook::jump(0x688620_b, sync_gpu_stub);
|
|
|
|
|
|
|
|
|
|
utils::hook::jump(0x140254800, init_dedicated_server);
|
|
|
|
|
utils::hook::jump(0x135600_b, init_dedicated_server);
|
|
|
|
|
|
|
|
|
|
// delay startup commands until the initialization is done
|
|
|
|
|
utils::hook::call(0x1400D72D6, execute_startup_command);
|
|
|
|
|
utils::hook::call(0x157DDA_b, execute_startup_command);
|
|
|
|
|
|
|
|
|
|
// delay console commands until the initialization is done
|
|
|
|
|
utils::hook::call(0x1400D808C, execute_console_command);
|
|
|
|
|
utils::hook::nop(0x1400D80A4, 5);
|
|
|
|
|
// delay console commands until the initialization is done // COULDN'T FOUND
|
|
|
|
|
//utils::hook::call(0x1400D808C, execute_console_command);
|
|
|
|
|
//utils::hook::nop(0x1400D80A4, 5);
|
|
|
|
|
|
|
|
|
|
// patch GScr_SetDynamicDvar to behave better
|
|
|
|
|
gscr_set_dynamic_dvar_hook.create(0x14036B600, &gscr_set_dynamic_dvar);
|
|
|
|
|
gscr_set_dynamic_dvar_hook.create(0x43CF60_b, &gscr_set_dynamic_dvar);
|
|
|
|
|
|
|
|
|
|
utils::hook::nop(0x1404ED90E, 5); // don't load config file
|
|
|
|
|
utils::hook::nop(0x140403D92, 5); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x1400DC1D0, 0xC3); // don't save config file
|
|
|
|
|
utils::hook::set<uint8_t>(0x140274710, 0xC3); // disable self-registration
|
|
|
|
|
utils::hook::set<uint8_t>(0x140515890, 0xC3); // init sound system (1)
|
|
|
|
|
utils::hook::set<uint8_t>(0x1406574F0, 0xC3); // init sound system (2)
|
|
|
|
|
utils::hook::set<uint8_t>(0x140620D10, 0xC3); // render thread
|
|
|
|
|
utils::hook::set<uint8_t>(0x14025B850, 0xC3); // called from Com_Frame, seems to do renderer stuff
|
|
|
|
|
utils::hook::set<uint8_t>(0x1402507B0, 0xC3); // CL_CheckForResend, which tries to connect to the local server constantly
|
|
|
|
|
utils::hook::set<uint8_t>(0x1405D5178, 0x00); // r_loadForRenderer default to 0
|
|
|
|
|
utils::hook::set<uint8_t>(0x14050C2D0, 0xC3); // recommended settings check - TODO: Check hook
|
|
|
|
|
utils::hook::set<uint8_t>(0x140514C00, 0xC3); // some mixer-related function called on shutdown
|
|
|
|
|
utils::hook::set<uint8_t>(0x140409830, 0xC3); // dont load ui gametype stuff
|
|
|
|
|
//utils::hook::nop(0x1404ED90E, 5); // don't load config file // NOT FOUND
|
|
|
|
|
utils::hook::nop(0x156C46_b, 5); // ^ // NOT SURE
|
|
|
|
|
utils::hook::set<uint8_t>(0x17F470_b, 0xC3); // don't save config file
|
|
|
|
|
utils::hook::set<uint8_t>(0x351AA0_b, 0xC3); // disable self-registration
|
|
|
|
|
utils::hook::set<uint8_t>(0x5BF4E0_b, 0xC3); // init sound system (1)
|
|
|
|
|
utils::hook::set<uint8_t>(0x702650_b, 0xC3); // init sound system (2) NOT SURE
|
|
|
|
|
//utils::hook::set<uint8_t>(0x140620D10, 0xC3); // render thread ARXAN'D
|
|
|
|
|
utils::hook::set<uint8_t>(0x343950_b, 0xC3); // called from Com_Frame, seems to do renderer stuff
|
|
|
|
|
utils::hook::set<uint8_t>(0x12CCA0_b, 0xC3); // CL_CheckForResend, which tries to connect to the local server constantly
|
|
|
|
|
utils::hook::set<uint8_t>(0x67ADCE_b, 0x00); // r_loadForRenderer default to 0 NOT SURE
|
|
|
|
|
utils::hook::set<uint8_t>(0x5B7AF0_b, 0xC3); // recommended settings check - TODO: Check hook
|
|
|
|
|
utils::hook::set<uint8_t>(0x5BE850_b, 0xC3); // some mixer-related function called on shutdown
|
|
|
|
|
utils::hook::set<uint8_t>(0x4DEA50_b, 0xC3); // dont load ui gametype stuff
|
|
|
|
|
|
|
|
|
|
utils::hook::nop(0x140481B06, 6); // unknown check in SV_ExecuteClientMessage
|
|
|
|
|
utils::hook::nop(0x140480FAC, 4); // allow first slot to be occupied
|
|
|
|
|
utils::hook::nop(0x14025619B, 2); // properly shut down dedicated servers
|
|
|
|
|
utils::hook::nop(0x14025615E, 2); // ^
|
|
|
|
|
utils::hook::nop(0x1402561C0, 5); // don't shutdown renderer
|
|
|
|
|
utils::hook::nop(0x54ED81_b, 6); // unknown check in SV_ExecuteClientMessage
|
|
|
|
|
utils::hook::nop(0x54E337_b, 4); // allow first slot to be occupied
|
|
|
|
|
utils::hook::nop(0x13ABCB_b, 2); // properly shut down dedicated servers
|
|
|
|
|
utils::hook::nop(0x13AB8E_b, 2); // ^
|
|
|
|
|
utils::hook::nop(0x13ABF0_b, 5); // don't shutdown renderer
|
|
|
|
|
|
|
|
|
|
utils::hook::set<uint8_t>(0x140091840, 0xC3); // something to do with blendShapeVertsView
|
|
|
|
|
utils::hook::nop(0x140659A0D, 8); // sound thing
|
|
|
|
|
utils::hook::set<uint8_t>(0xAA290_b, 0xC3); // something to do with blendShapeVertsView
|
|
|
|
|
utils::hook::nop(0x70465D_b, 8); // sound thing
|
|
|
|
|
|
|
|
|
|
// (COULD NOT FIND IN H1)
|
|
|
|
|
// utils::hook::set<uint8_t>(0x1404D6960, 0xC3); // cpu detection stuff?
|
|
|
|
|
utils::hook::set<uint8_t>(0x1405E97F0, 0xC3); // gfx stuff during fastfile loading
|
|
|
|
|
utils::hook::set<uint8_t>(0x1405E9700, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x1405E9790, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x1402C1180, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x1405E9750, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x1405AD5B0, 0xC3); // directx stuff
|
|
|
|
|
utils::hook::set<uint8_t>(0x1405DB150, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x140625220, 0xC3); // ^ - mutex
|
|
|
|
|
utils::hook::set<uint8_t>(0x1405DB650, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x690F30_b, 0xC3); // gfx stuff during fastfile loading
|
|
|
|
|
utils::hook::set<uint8_t>(0x690E00_b, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x690ED0_b, 0xC3); // ^
|
|
|
|
|
//utils::hook::set<uint8_t>(0x1402C1180, 0xC3); // ^ NOT FOUND?
|
|
|
|
|
utils::hook::set<uint8_t>(0x690E50_b, 0xC3); // ^ MAAAAAAAAAAAYBE NOTTTT
|
|
|
|
|
utils::hook::set<uint8_t>(0x651BA0_b, 0xC3); // directx stuff
|
|
|
|
|
utils::hook::set<uint8_t>(0x681950_b, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x6CE390_b, 0xC3); // ^ - mutex
|
|
|
|
|
utils::hook::set<uint8_t>(0x681ED0_b, 0xC3); // ^
|
|
|
|
|
|
|
|
|
|
utils::hook::set<uint8_t>(0x14008B5F0, 0xC3); // rendering stuff
|
|
|
|
|
utils::hook::set<uint8_t>(0x1405DB8B0, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x1405DB9C0, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x1405DC050, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x1405DCBA0, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x1405DD240, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0xA3CD0_b, 0xC3); // rendering stuff
|
|
|
|
|
utils::hook::set<uint8_t>(0x682150_b, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x682260_b, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x6829C0_b, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x6834A0_b, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x683B40_b, 0xC3); // ^
|
|
|
|
|
|
|
|
|
|
// shaders
|
|
|
|
|
utils::hook::set<uint8_t>(0x1400916A0, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x140091610, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x14061ACC0, 0xC3); // ^ - mutex
|
|
|
|
|
utils::hook::set<uint8_t>(0xAA090_b, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0xA9FE0_b, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x6C38D0_b, 0xC3); // ^ - mutex
|
|
|
|
|
|
|
|
|
|
utils::hook::set<uint8_t>(0x140516080, 0xC3); // idk
|
|
|
|
|
utils::hook::set<uint8_t>(0x1405AE5F0, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x5BFD10_b, 0xC3); // idk
|
|
|
|
|
utils::hook::set<uint8_t>(0x652E10_b, 0xC3); // ^
|
|
|
|
|
|
|
|
|
|
utils::hook::set<uint8_t>(0x1405E0B30, 0xC3); // R_Shutdown
|
|
|
|
|
utils::hook::set<uint8_t>(0x1405AE400, 0xC3); // shutdown stuff
|
|
|
|
|
utils::hook::set<uint8_t>(0x1405E0C00, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x1405DFE50, 0xC3); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x687D20_b, 0xC3); // R_Shutdown
|
|
|
|
|
utils::hook::set<uint8_t>(0x652BA0_b, 0xC3); // shutdown stuff
|
|
|
|
|
utils::hook::set<uint8_t>(0x687DF0_b, 0xC3); // ^
|
|
|
|
|
//utils::hook::set<uint8_t>(0x1405DFE50, 0xC3); // ^ COULDN'T FOUND
|
|
|
|
|
|
|
|
|
|
// utils::hook::set<uint8_t>(0x1404B67E0, 0xC3); // sound crashes (H1 - questionable, function looks way different)
|
|
|
|
|
|
|
|
|
|
utils::hook::set<uint8_t>(0x14048B660, 0xC3); // disable host migration
|
|
|
|
|
utils::hook::set<uint8_t>(0x556250_b, 0xC3); // disable host migration
|
|
|
|
|
|
|
|
|
|
utils::hook::set<uint8_t>(0x14042B2E0, 0xC3); // render synchronization lock
|
|
|
|
|
utils::hook::set<uint8_t>(0x14042B210, 0xC3); // render synchronization unlock
|
|
|
|
|
utils::hook::set<uint8_t>(0x4F7C10_b, 0xC3); // render synchronization lock
|
|
|
|
|
utils::hook::set<uint8_t>(0x42B210_b, 0xC3); // render synchronization unlock
|
|
|
|
|
|
|
|
|
|
utils::hook::set<uint8_t>(0x140176D2D, 0xEB); // LUI: Unable to start the LUI system due to errors in main.lua
|
|
|
|
|
utils::hook::set<uint8_t>(0x27AA9D_b, 0xEB); // LUI: Unable to start the LUI system due to errors in main.lua
|
|
|
|
|
|
|
|
|
|
utils::hook::nop(0x140506ECE, 5); // Disable sound pak file loading
|
|
|
|
|
utils::hook::nop(0x140506ED6, 2); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x1402C5910, 0xC3); // Disable image pak file loading
|
|
|
|
|
utils::hook::nop(0x5B25BE_b, 5); // Disable sound pak file loading
|
|
|
|
|
utils::hook::nop(0x5B25C6_b, 2); // ^
|
|
|
|
|
utils::hook::set<uint8_t>(0x3A0BA0_b, 0xC3); // Disable image pak file loading
|
|
|
|
|
|
|
|
|
|
// Reduce min required memory
|
|
|
|
|
utils::hook::set<uint64_t>(0x14050C717, 0x80000000);
|
|
|
|
|
utils::hook::set<uint64_t>(0x5B7F37_b, 0x80000000);
|
|
|
|
|
|
|
|
|
|
utils::hook::set(0x1402BF7F0, 0xC3); // some loop
|
|
|
|
|
utils::hook::set(0x14007E150, 0xC3); // related to shader caching / techsets / fastfiles
|
|
|
|
|
utils::hook::set(0x399E10_b, 0xC3); // some loop
|
|
|
|
|
utils::hook::set(0x1D48B0_b, 0xC3); // related to shader caching / techsets / fastfiles
|
|
|
|
|
|
|
|
|
|
// initialize the game after onlinedataflags is 32 (workaround)
|
|
|
|
|
scheduler::schedule([=]()
|
|
|
|
@ -318,14 +318,14 @@ namespace dedicated
|
|
|
|
|
execute_startup_command_queue();
|
|
|
|
|
execute_console_command_queue();
|
|
|
|
|
|
|
|
|
|
// Send heartbeat to dpmaster
|
|
|
|
|
// Send heartbeat to master
|
|
|
|
|
scheduler::once(send_heartbeat, scheduler::pipeline::server);
|
|
|
|
|
scheduler::loop(send_heartbeat, scheduler::pipeline::server, 10min);
|
|
|
|
|
command::add("heartbeat", send_heartbeat);
|
|
|
|
|
}, scheduler::pipeline::main, 1s);
|
|
|
|
|
|
|
|
|
|
command::add("killserver", kill_server);
|
|
|
|
|
com_quit_f_hook.create(0x1400DA640, &kill_server);
|
|
|
|
|
com_quit_f_hook.create(0x17CD00_b, &kill_server);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|