Hollow Knight · handler “Hollow Knight Multiplayer Mod”
Version 9
Release notes
different localow folder and registry per instance, latest modding api applies to all instances now.
- Released
- Size
- 2.1 KB
- Downloads
- 18,964
- Check
- Verified
- SHA-256
- fffb88e445089ec18d4609740dee28ed8758ee5e03f478513ff6a14af7cdf230
Files 1
| Path | Size |
|---|---|
| handler.js | 5.8 KB |
handler.js
Plain textHub.Handler.Version = 9; // Released at https://hub.splitscreen.me/ on Tue Nov 05 2024 06:51:41 GMT+0000 (Coordinated Universal Time).
Hub.Handler.Id = "sWgnoTqjmk8M49QML";
Hub.Maintainer.Name = "Talos91";
Hub.Maintainer.Id = "eeL7HAz8zJovChWw4";
var answers1 = ["Yes", "No"];
Game.AddOption("Letterboxing/Pillarboxing fix?", "Removes the black bars in split-screen.", "Pillar", answers1);
Game.ExecutableContext = ["hollow_knight_Data"];
Game.DirSymlinkExclusions = ["hollow_knight_Data\\Plugins\\x86_64", "hollow_knight_Data\\Managed\\Mods\\Disabled", "hollow_knight_Data\\Managed\\Mods\\HKMP"];
Game.FileSymlinkExclusions = ["steam_appid.txt", "dinput8.dll", "xinput1_3.dll", "xinput1_4.dll"];
Game.FileSymlinkCopyInstead = [
"UnityCrashHandler64.exe",
"UnityPlayer.dll",
"boot.config",
"Config.ini",
"globalgamemanagers",
"InControlNative.dll",
"steam_api64.dll",
"XInputInterface64.dll",
"Assembly-CSharp.dll",
"Assembly-CSharp.xml",
"MMHOOK_Assembly-CSharp.dll",
"MMHOOK_PlayMaker.dll",
"authorized.json",
"banned.json",
"HKMP.dll",
"HKMP.xml",
"whitelist.json"
];
Game.GameName = "Hollow Knight";
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.SymlinkFolders = true;
Game.ExecutableName = "hollow_knight.exe";
Game.SteamID = "367520";
Game.GUID = "Hollow Knight";
Game.MaxPlayers = 5;
Game.MaxPlayersOneMonitor = 5;
Game.UseGoldberg = false;
Game.CreateSteamAppIdByExe = true;
Game.SetTopMostAtEnd = true;
Game.Hook.ForceFocus = true;
Game.Hook.ForceFocusWindowName = "Hollow Knight";
Game.HasDynamicWindowTitle = true;
Game.SendFakeFocusMsg = true;
Game.ResetWindows = true;
Game.Hook.DInputEnabled = false;
Game.UseDInputBlocker = true;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.XInputPlusDll = ["xinput1_3.dll", "xinput1_4.dll"];
Game.Hook.CustomDllEnabled = false;
Game.SupportsKeyboard = true;
Game.BlockRawInput = false;
Game.UserProfileSavePath = "AppData\\LocalLow\\Team Cherry";
Game.Description =
"IMPORTANT: This handler only works with the Hollow Knight Multiplayer mod by Extremelyd1, make sure you install the HKMP.dll mod using the Lumafly Mod Installer in your main game files first. To connect the instances press start in the first instance and write the port number in the Port field right above connect (e.g. 26950) then click start hosting to start the server, only start a server in one instance, to connect all instances to the same server write localhost in the IP field, then the same port number as the server, write your nickname and click connect using the mouse cursor, do the same in the other instances, alt-tab between instances to use the keyboard. Disable Steam Input for this game or the gamepads will not restrict correctly.";
Game.KeepSymLinkOnExit = false;
Game.PromptBetweenInstances = true;
Game.PauseBetweenStarts = 40;
Game.Play = function() {
Context.StartArguments = " -screen-fullscreen 0 -popupwindow " + " -screen-width " + Context.Width + " -screen-height " + Context.Height;
Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\Team Cherry\\Hollow Knight", "Screenmanager Fullscreen mode_h3630240806", 0, Nucleus.RegType.DWord);
Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\Team Cherry\\Hollow Knight", "Screenmanager Resolution Height_h2627697771", Context.Height, Nucleus.RegType.DWord);
Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\Team Cherry\\Hollow Knight", "Screenmanager Resolution Width_h182942802", Context.Width, Nucleus.RegType.DWord);
Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\Team Cherry\\Hollow Knight", "NativeInput_h1840871570", 1, Nucleus.RegType.DWord);
var filePath = (Context.filePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\hollow_knight_Data\\Managed\\Mods\\Disabled");
System.IO.Directory.CreateDirectory(filePath);
if (Context.PlayerID == 0) {
} else {
var fillPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\hollow_knight_Data\\globalgamemanagers";
var base = Context.Nickname;
var og_Path = "Hollow Knight";
//Create newPath by rearranging characters from base
var newPath = og_Path.substring(0, og_Path.length - 3) + base.charAt(0) + base.charAt(base.length - 1) + base.length;
//Ensure newPath is at least as long as og_Path
if (newPath.length < og_Path.length) {
while (newPath.length < og_Path.length) {
newPath += base.charAt(base.length - 1);
}
} else if (og_Path.length < newPath.length) {
//Ensure og_Path is at least 3 characters long
newPath = newPath.substring(0, og_Path.length);
}
Context.PatchFile(fillPath, fillPath, og_Path, newPath);
Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\Team Cherry\\" + newPath, "Screenmanager Fullscreen mode_h3630240806", 3, Nucleus.RegType.DWord);
Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\Team Cherry\\" + newPath, "Screenmanager Resolution Height_h2627697771", Context.Height, Nucleus.RegType.DWord);
Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\Team Cherry\\" + newPath, "Screenmanager Resolution Width_h182942802", Context.Width, Nucleus.RegType.DWord);
Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\Team Cherry\\" + newPath, "NativeInput_h1840871570", 1, Nucleus.RegType.DWord);
}
var pillar = Context.Options["Pillar"];
if (pillar == "Yes") {
//remove pillar boxing
Context.PatchFileFindAll(
System.IO.Path.Combine(Context.RootFolder, "hollow_knight_Data\\Managed\\Assembly-CSharp.dll"),
System.IO.Path.Combine(Context.RootFolder, "hollow_knight_Data\\Managed\\Assembly-CSharp.dll"),
[0x39, 0x8e, 0xe3, 0x3f],
Context.ConvertToBytes(Context.AspectRatioDecimal)
);
}
if (pillar == "No") {
}
};