diff --git a/build/.cmake/api/v1/reply/index-2024-06-17T13-29-02-0885.json b/build/.cmake/api/v1/reply/index-2024-06-19T11-32-42-0217.json similarity index 100% rename from build/.cmake/api/v1/reply/index-2024-06-17T13-29-02-0885.json rename to build/.cmake/api/v1/reply/index-2024-06-19T11-32-42-0217.json diff --git a/build/src/CMakeFiles/hook_aurora.dir/df_main.cpp.o b/build/src/CMakeFiles/hook_aurora.dir/df_main.cpp.o index efe34db..d7763be 100644 Binary files a/build/src/CMakeFiles/hook_aurora.dir/df_main.cpp.o and b/build/src/CMakeFiles/hook_aurora.dir/df_main.cpp.o differ diff --git a/build/src/CMakeFiles/hook_aurora.dir/l_squirrel.cpp.o b/build/src/CMakeFiles/hook_aurora.dir/l_squirrel.cpp.o index 3ade5c7..11f15ac 100644 Binary files a/build/src/CMakeFiles/hook_aurora.dir/l_squirrel.cpp.o and b/build/src/CMakeFiles/hook_aurora.dir/l_squirrel.cpp.o differ diff --git a/src/df_main.cpp b/src/df_main.cpp index b15da05..96b3941 100644 --- a/src/df_main.cpp +++ b/src/df_main.cpp @@ -46,6 +46,7 @@ SUBHOOK_INIT(BossDieCheckSend, 0x81CDA62); SUBHOOK_INIT(Giveup_Game, 0x81C40B4); SUBHOOK_INIT(CUserWorkPerFiveMin, 0x8652F0C); SUBHOOK_INIT(TimerDispatcher_dispatch, 0x8632A18); +SUBHOOK_INIT(SetUserMaxLevel, 0x0868fec8); //_setCharacInfoDetail @@ -720,6 +721,25 @@ void _CUserWorkPerFiveMin(void *CUser) CUserWorkPerFiveMin(CUser); } +void *_SetUserMaxLevel(void *CUser, int level) +{ + // 用户每五分钟执行 + std::lock_guard lock(SqMtx); + // 执行虚拟机Main函数 + SQInteger top = sq_gettop(v); // saves the stack size before the call + sq_pushroottable(v); // pushes the global table + sq_pushstring(v, _SC("Cb_user_setusermaxlevel"), -1); + if (SQ_SUCCEEDED(sq_get(v, -2))) + { // gets the fie123oo' from the global table + sq_pushroottable(v); // push the 'this' (in this case is the global table) + sq_pushuserpointer(v, CUser); + sq_pushinteger(v, level); + sq_call(v, 3, SQFalse, SQTrue); // calls the function + } + sq_settop(v, top); // restores the original stack size + return CUser; +} + int _TimerDispatcher_dispatch(void *A, void *B) { int ret = TimerDispatcher_dispatch(A, B); @@ -832,6 +852,8 @@ void Lenheart() SUBHOOK_SETUP(CUserWorkPerFiveMin); // 每帧执行 SUBHOOK_SETUP(TimerDispatcher_dispatch); + // 设置角色等级 + SUBHOOK_SETUP(SetUserMaxLevel); // SUBHOOK_SETUP(doDispatch); // 收包注册 diff --git a/src/import.h b/src/import.h index b89d378..069b141 100644 --- a/src/import.h +++ b/src/import.h @@ -109,4 +109,7 @@ typedef void (*fnCUserWorkPerFiveMin)(void *CUser); // 线程执行 typedef int (*fnTimerDispatcher_dispatch)(void *A, void *B); +// 线程执行 +typedef void *(*fnSetUserMaxLevel)(void *CUser, int level); + __END_DECLS \ No newline at end of file diff --git a/src/l_squirrel.cpp b/src/l_squirrel.cpp index a0ccab9..5821e72 100644 --- a/src/l_squirrel.cpp +++ b/src/l_squirrel.cpp @@ -37,7 +37,7 @@ void setupLogger() logger->set_level(spdlog::level::info); logger->flush_on(spdlog::level::info); - logger->info("欢迎使用Dps插件"); + // logger->info("欢迎使用Dps插件"); spdlog::register_logger(logger); spdlog::set_default_logger(logger);