Merge pull request #3 from Solipsis23/fast-restart-cmd

fast restart cmd
This commit is contained in:
MatrixMMOfficial 2023-09-30 15:24:50 -04:00 committed by GitHub
commit 0e3352c444
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View File

@ -865,6 +865,11 @@ bool DDL_SetUInt_Detour(const DDLState* state, DDLContext* ddlContext, unsigned
return ddl_setuint.stub<bool>(state, ddlContext, val); return ddl_setuint.stub<bool>(state, ddlContext, val);
} }
void SV_CmdsMP_FastRestart_f() {
auto SV_CmdsMP_RequestMapRestart = reinterpret_cast<void(*)(bool loadScripts, bool migrate)>(0x14136C310_g);
SV_CmdsMP_RequestMapRestart(1, 0);
}
void* exception_handler_handle; void* exception_handler_handle;
BOOL WINAPI DllMain(HMODULE hModule, DWORD Reason, LPVOID lpVoid) { BOOL WINAPI DllMain(HMODULE hModule, DWORD Reason, LPVOID lpVoid) {
g_Addrs.ModuleBase = (uintptr_t)(GetModuleHandle(0)); g_Addrs.ModuleBase = (uintptr_t)(GetModuleHandle(0));
@ -904,6 +909,7 @@ BOOL WINAPI DllMain(HMODULE hModule, DWORD Reason, LPVOID lpVoid) {
//Cmd_AddCommandInternal("view_vehicle_ents", Cmd_ViewVehicleEnts_f, &view_vehicle_ents_f_VAR); //Cmd_AddCommandInternal("view_vehicle_ents", Cmd_ViewVehicleEnts_f, &view_vehicle_ents_f_VAR);
//Cmd_AddCommandInternal("loadout_save", Cmd_LoadoutSave_f, &loadout_save_f_VAR); //Cmd_AddCommandInternal("loadout_save", Cmd_LoadoutSave_f, &loadout_save_f_VAR);
Cmd_AddCommandInternal("loadout_save", SaveOperatorSkins, &loadout_save_f_VAR); Cmd_AddCommandInternal("loadout_save", SaveOperatorSkins, &loadout_save_f_VAR);
Cmd_AddCommandInternal("fast_restart", SV_CmdsMP_FastRestart_f, &FastRestart_f_VAR);
// patch ui_maxclients limit // patch ui_maxclients limit
utils::hook::nop(0x140F30210_g, 5); utils::hook::nop(0x140F30210_g, 5);

View File

@ -372,6 +372,7 @@ cmd_function_s ddldump_f_VAR;
cmd_function_s weapondefdump_f_VAR; cmd_function_s weapondefdump_f_VAR;
cmd_function_s view_vehicle_ents_f_VAR; cmd_function_s view_vehicle_ents_f_VAR;
cmd_function_s loadout_save_f_VAR; cmd_function_s loadout_save_f_VAR;
cmd_function_s FastRestart_f_VAR;
CmdArgs* cmd_args; CmdArgs* cmd_args;

View File

@ -125,6 +125,7 @@ extern cmd_function_s ddldump_f_VAR;
extern cmd_function_s weapondefdump_f_VAR; extern cmd_function_s weapondefdump_f_VAR;
extern cmd_function_s view_vehicle_ents_f_VAR; extern cmd_function_s view_vehicle_ents_f_VAR;
extern cmd_function_s loadout_save_f_VAR; extern cmd_function_s loadout_save_f_VAR;
extern cmd_function_s FastRestart_f_VAR;
extern CmdArgs* cmd_args; extern CmdArgs* cmd_args;
void* RtlAddVectoredExceptionHandler(LONG First, PVECTORED_EXCEPTION_HANDLER Handler); void* RtlAddVectoredExceptionHandler(LONG First, PVECTORED_EXCEPTION_HANDLER Handler);