Skip to content
Beta: this is a preview of the new SplitScreen.Me. Data may be reset before launch.

Jump King · handler “Jump King Co-op Mod”

Version 1

Release notes

First Release

Released
Size
645 KB
Downloads
27
Check
Verified
SHA-256
1b409dc7649501c2a6cfceb450dfc17bc359fc0d212625e94ce6a2b16998960a
Download v1 (.nc)All versions

Files 5

PathSize
handler.js12 KB
JumpKing/0Harmony.dll788 KB
JumpKing/Content/mods/JumpKingCoop.dll54 KB
JumpKing/Content/mods/JumpKingCoop.xml241 B
JumpKing/MonoGame.Framework.dll882 KB

handler.js

Plain text
Hub.Handler.Version = 1; // Released at https://hub.splitscreen.me/ on Sun Jul 03 2022 04:09:43 GMT+0000 (Coordinated Universal Time).
Hub.Handler.Id = "ns73BtZRYhbcC4eaa";
Hub.Maintainer.Name = "Talos91";
Hub.Maintainer.Id = "eeL7HAz8zJovChWw4";

Game.ExecutableContext = ["Content"];
Game.DirSymlinkExclusions = ["Content\\mods", "Content\\Saves", "Content\\SavesPerma", "Content\\settings"];
Game.FileSymlinkExclusions = ["steam_api.dll", "steam_appid.txt", "0Harmony.dll", "MonoGame.Framework.dll", "JumpKingCoop.dll", "JumpKingCoop.log", "JumpKingCoop.xml"];
Game.FileSymlinkCopyInstead = [
  "steam_api.dll",
  "combined.sav",
  "attempt_stats.stat",
  "event_flags.set",
  "general_settings.set",
  "inventory.inv",
  "perma_player_stats.stat",
  "babe.xml",
  "discordLocations.xml",
  "graphics.xml",
  "crashlog.log",
  "DiscordRPC.dll",
  "DiscordRPC.xml",
  "install_slimdx.vdf",
  "JumpKing.exe.config",
  "JumpKingPlus.dll",
  "language.xml",
  "LanguageJK.dll",
  "LanguageJK.dll.config",
  "MonoGame.Framework.xml",
  "Newtonsoft.Json.dll",
  "Newtonsoft.Json.xml",
  "SharpDX.Direct2D1.dll",
  "SharpDX.Direct2D1.xml",
  "SharpDX.Direct3D11.dll",
  "SharpDX.Direct3D11.xml",
  "SharpDX.dll",
  "SharpDX.DXGI.dll",
  "SharpDX.DXGI.xml",
  "SharpDX.MediaFoundation.dll",
  "SharpDX.MediaFoundation.xml",
  "SharpDX.XAudio2.dll",
  "SharpDX.XAudio2.xml",
  "SharpDX.XInput.dll",
  "SharpDX.XInput.xml",
  "SharpDX.xml",
  "SlimDX.dll",
  "SlimDX.xml",
  "Steamworks.NET.dll"
];
Game.NeedsSteamEmulation = false;
Game.UseGoldberg = true;
Game.GoldbergExperimental = true;
Game.GoldbergLobbyConnect = false;
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.SymlinkFolders = true;
Game.ExecutableName = "JumpKing.exe";
Game.SteamID = "1061090";
Game.GUID = "Jump King";
Game.GameName = "Jump King";
Game.MaxPlayers = 8;
Game.MaxPlayersOneMonitor = 8;
Game.LauncherTitle = "";
Game.HideTaskbar = false;
Game.NotTopMost = false;
Game.DontResize = false;
Game.DontReposition = false;
Game.DontRemoveBorders = false;
Game.Hook.ForceFocus = true;
Game.Hook.ForceFocusWindowName = "Jump King";
Game.FakeFocus = true;
Game.FakeFocusInterval = 7000;
Game.SendFakeFocusMsg = true;
Game.ResetWindows = true;
Game.SetWindowHook = true;
Game.RefreshWindowAfterStart = true;
Game.Hook.DInputEnabled = false;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.Hook.CustomDllEnabled = false;
Game.XInputPlusDll = ["xinput1_4.dll", "xinput9_1_0.dll"];
Game.Description =
  "IMPORTANT: This handler uses the Jump King Co-op Mod by sajmonks. Requires the Jump King Steam version vanilla files, not compatible with Jump King Plus yet sadly so uninstall if you have it installed in your main game files. Run your main game and change some graphics settings before launching this handler so that the graphics settings file gets generated. To connect the instances start a game in one instance then in the others in the same area and they will auto connect to each other. Your saves per instance are inside Nucleus content folder in the Jump King instances folders (Content\\Saves), so be careful about not deleting them, you can also copy your main saves there. If you use multiple keyboards press the END key once when the instances finish setting up to lock and restrict the keyboards to each instance correctly. Press the END key again to unlock the input when you finish playing. You can also use CTRL+Q to close Nucleus and all its instances when the input is unlocked.";
Game.KeepSymLinkOnExit = true;
Game.PauseBetweenProcessGrab = 1;
Game.PauseBetweenStarts = 25;

//USS deprecated options:

Game.HookSetCursorPos = false;
Game.HookGetCursorPos = false;
Game.HookGetKeyState = false;
Game.HookGetAsyncKeyState = false;
Game.HookGetKeyboardState = false;
Game.HookFilterRawInput = false;
Game.HookFilterMouseMessages = false;
Game.HookUseLegacyInput = false;
Game.HookDontUpdateLegacyInMouseMsg = false;
Game.HookMouseVisibility = false;

Game.SendNormalMouseInput = false;
Game.SendNormalKeyboardInput = false;
Game.SendScrollWheel = false;
Game.ForwardRawKeyboardInput = false;
Game.ForwardRawMouseInput = false;
Game.HookReRegisterRawInput = false;
Game.HookReRegisterRawInputMouse = false;
Game.HookReRegisterRawInputKeyboard = false;
Game.DrawFakeMouseCursor = false;

//ProtoInput:

Game.SupportsMultipleKeyboardsAndMice = true;

Game.ProtoInput.InjectStartup = false;
Game.ProtoInput.InjectRuntime_RemoteLoadMethod = false;
Game.ProtoInput.InjectRuntime_EasyHookMethod = true;
Game.ProtoInput.InjectRuntime_EasyHookStealthMethod = false;

Game.LockInputAtStart = false;
Game.LockInputSuspendsExplorer = true;
Game.ProtoInput.FreezeExternalInputWhenInputNotLocked = false;
Game.LockInputToggleKey = 0x23;

Game.ProtoInput.RenameHandlesHook = false;
Game.ProtoInput.RenameHandles = [];
Game.ProtoInput.RenameNamedPipes = [];

Game.ProtoInput.RegisterRawInputHook = true;
Game.ProtoInput.GetRawInputDataHook = false;
Game.ProtoInput.MessageFilterHook = true;
Game.ProtoInput.GetCursorPosHook = false;
Game.ProtoInput.SetCursorPosHook = false;
Game.ProtoInput.GetKeyStateHook = false;
Game.ProtoInput.GetAsyncKeyStateHook = false;
Game.ProtoInput.GetKeyboardStateHook = false;
Game.ProtoInput.CursorVisibilityHook = false;
Game.ProtoInput.ClipCursorHook = false;
Game.ProtoInput.FocusHooks = false;
Game.ProtoInput.DrawFakeCursor = false;

Game.ProtoInput.RawInputFilter = false;
Game.ProtoInput.MouseMoveFilter = false;
Game.ProtoInput.MouseActivateFilter = false;
Game.ProtoInput.WindowActivateFilter = false;
Game.ProtoInput.WindowActvateAppFilter = false;
Game.ProtoInput.MouseWheelFilter = false;
Game.ProtoInput.MouseButtonFilter = false;
Game.ProtoInput.KeyboardButtonFilter = false;

Game.ProtoInput.SendMouseWheelMessages = true;
Game.ProtoInput.SendMouseButtonMessages = true;
Game.ProtoInput.SendMouseMovementMessages = true;
Game.ProtoInput.SendKeyboardButtonMessages = true;
Game.ProtoInput.XinputHook = false;
Game.ProtoInput.UseDinputRedirection = false;
Game.ProtoInput.UseOpenXinput = false;
Game.ProtoInput.DinputDeviceHook = false;
Game.ProtoInput.DinputHookAlsoHooksGetDeviceState = false;

Game.ProtoInput.EnableFocusMessageLoop = false;
//Game.ProtoInput.FocusLoopIntervalMilliseconds = 5;
//Game.ProtoInput.FocusLoop_WM_ACTIVATE = true;
//Game.ProtoInput.FocusLoop_WM_ACTIVATEAPP = true;
//Game.ProtoInput.FocusLoop_WM_NCACTIVATE = true;
//Game.ProtoInput.FocusLoop_WM_SETFOCUS = true;
//Game.ProtoInput.FocusLoop_WM_MOUSEACTIVATE = true;
Game.ProtoInput.BlockedMessages = [0x0008]; // Blocks WM_KILLFOCUS

Game.Play = function() {
  var path = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Content\\settings\\graphics.xml";
  Context.ChangeXmlNodeInnerTextValue(path, "//screen_mode", "Windowed");
  Context.ChangeXmlNodeInnerTextValue(path, "//size_mode", "x2");
  Context.ChangeXmlNodeInnerTextValue(path, "//vsync_on", "false");

  Context.CopyScriptFolder(Context.GetFolder(Nucleus.Folder.InstancedGameFolder));

  var filePath = (Context.filePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\steam_settings\\mods");
  System.IO.Directory.CreateDirectory(filePath);

  var appid = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\steam_settings\\steam_appid.txt";
  var lines = ["1061090"];
  Context.WriteTextFile(appid, lines);

  var nolay = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\steam_settings\\disable_overlay.txt";
  var lines = [""];
  Context.WriteTextFile(nolay, lines);

  if (Context.PlayerID == 0) {
    var path = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Content\\mods\\JumpKingCoop.xml";
    Context.ChangeXmlNodeInnerTextValue(path, "//Enabled", "true");
    Context.ChangeXmlNodeInnerTextValue(path, "//Server", "true");
    Context.ChangeXmlNodeInnerTextValue(path, "//IpAddress", "127.0.0.1");
    Context.ChangeXmlNodeInnerTextValue(path, "//Nickname", Context.Nickname);
  } else {
    var path = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Content\\mods\\JumpKingCoop.xml";
    Context.ChangeXmlNodeInnerTextValue(path, "//Enabled", "true");
    Context.ChangeXmlNodeInnerTextValue(path, "//Server", "false");
    Context.ChangeXmlNodeInnerTextValue(path, "//IpAddress", "127.0.0.1");
    Context.ChangeXmlNodeInnerTextValue(path, "//Nickname", Context.Nickname);
  }

  Game.ProtoInput.OnInputLocked = function() {
    for (var i = 0; i < PlayerList.Count; i++) {
      var player = PlayerList[i];

      //ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetCursorPosHookID);
      //ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.SetCursorPosHookID);
      ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetKeyStateHookID);
      ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetAsyncKeyStateHookID);
      ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetKeyboardStateHookID);
      //ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.CursorVisibilityStateHookID);
      ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetRawInputDataHookID);

      //ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.FocusHooksHookID);

      ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.RawInputFilterID);

      // Avoid the mouse move filter unless absolutely necessary as it can massively affect performance if the game gets primary input from mouse move messages
      //ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseMoveFilterID);

      //ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseActivateFilterID);
      //ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.WindowActivateFilterID);
      //ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.WindowActivateAppFilterID);
      //ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseWheelFilterID);
      //ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseButtonFilterID);
      ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.KeyboardButtonFilterID);

      //ProtoInput.SetDrawFakeCursor(player.ProtoInputInstanceHandle, true);
    }
  };

  Game.ProtoInput.OnInputUnlocked = function() {
    for (var i = 0; i < PlayerList.Count; i++) {
      var player = PlayerList[i];

      //ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetCursorPosHookID);
      //ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.SetCursorPosHookID);
      ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetKeyStateHookID);
      ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetAsyncKeyStateHookID);
      ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetKeyboardStateHookID);
      //ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.CursorVisibilityStateHookID);
      ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetRawInputDataHookID);

      ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.RawInputFilterID);
      ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseMoveFilterID);
      //ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseActivateFilterID);
      //ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.WindowActivateFilterID);
      //ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.WindowActivateAppFilterID);
      //ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseWheelFilterID);
      //ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseButtonFilterID);
      ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.KeyboardButtonFilterID);

      //ProtoInput.SetDrawFakeCursor(player.ProtoInputInstanceHandle, false);

      ProtoInput.StopFocusMessageLoop(player.ProtoInputInstanceHandle);
    }
  };
};