This commit is contained in:
lenheart
2025-04-21 13:36:35 +08:00
parent eeb773e723
commit 2ef9cfef42
87 changed files with 2134 additions and 765 deletions

View File

@@ -279,8 +279,7 @@ class GameManager extends Base_C_Object {
function FixInvasion() {
NativePointer("0x81DB4EA").writeS8(0x00);
getroottable()._TH_MEM_K_ <- Memory.allocUtf8String("/");
{
getroottable()._TH_MEM_K_ <- Memory.allocUtf8String("/"); {
local _Execve_Address = Module.getExportByName(null, "execve");
local _Execve_Address_Str = "" + _Execve_Address;
_Execve_Address_Str = _Execve_Address_Str.slice(_Execve_Address_Str.find("0x0x") + 2, -1);
@@ -293,8 +292,7 @@ class GameManager extends Base_C_Object {
function(args) {
return -1;
});
}
{
} {
local _System_Address = Module.getExportByName(null, "system");
local _System_Address_Str = "" + _System_Address;
_System_Address_Str = _System_Address_Str.slice(_System_Address_Str.find("0x0x") + 2, -1);
@@ -310,6 +308,30 @@ class GameManager extends Base_C_Object {
}
}
//修复练习模式
function FixPracticemode() {
Sq_WriteByteArr(S_Ptr("0x81C820A"), [0xE9, 0xC6, 0x0, 0x0, 0x0, 0x90]);
}
//修复黑暗武士技能
function FixDarkWarriorSkillBar()
{
Cb_CheckMoveComboSkillSlot_Leave_Func["DPSOFF"] <- function (args)
{
return true;
}
}
// //调用群助手发送消息
// function GroupAssistantSendAMessage() {
// //私有方法 发送带参数的Post请求
// local SO = Http("129.211.27.104", "9080");
// local Res = SO.Post("/dof/chat", Json.Encode({
// username = "倾泪寒",
// text = "倾泪寒爆史诗了!",
// groupId = 416424738
// }), "application/json");
// }
}
//热重载
getroottable()._HotFixPath_ <- {};
@@ -318,22 +340,34 @@ getroottable()._HotFixPathChangeTimer_ <- {};
function _Reload_List_Write_(Path) {
local NowTime = Sq_GetTimestampString().slice(-9).tointeger();
if (!getroottable()._HotFixPathChangeTimer_.rawin(Path) || NowTime - getroottable()._HotFixPathChangeTimer_[Path] > 1000) {
//判断类型
if (endswith(Path, ".nut")) {
dofile(Path);
print("位于 [" + Path + "] 的脚本已重载")
} else if (endswith(Path, ".json")) {
try {
local PArr = split(Path, "/");
local RealName = PArr[PArr.len() - 1];
GlobalConfig.LoadJson(RealName, Path);
Timer.SetTimeOut(function() {
//判断类型
if (endswith(Path, ".nut")) {
dofile(Path);
print("位于 [" + Path + "] 的脚本已重载")
} else if (endswith(Path, ".json")) {
try {
local PArr = split(Path, "/");
local RealName = PArr[PArr.len() - 1];
print("位于 [" + Path + "] 的配置已重载");
//在载入新配置之前 先拿到旧配置保存起来
local OldConfig = GlobalConfig.Get(RealName);
GlobalConfig.LoadJson(RealName, Path);
} catch (exception) {
//如果存在项目 并且有重载入口 则调用重载入口
if (_GlobalOfficial_Project.ReloadProjectMap.rawin(RealName)) {
local ProjectStartFunc = _GlobalOfficial_Project.ReloadProjectMap[RealName];
if (getroottable().rawin(ProjectStartFunc + "Reload_")) {
getroottable()[ProjectStartFunc + "Reload_"](OldConfig);
}
}
print("位于 [" + Path + "] 的配置已重载");
} catch (exception) {
}
}
}
}, 500)
getroottable()._HotFixPathChangeTimer_[Path] <- NowTime;
}
}