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

Dark Sector · handler “Dark Sector”

Version 1 (current)

Release notes

release

Released
Size
719 KB
Downloads
114
Check
Verified
SHA-256
8cafda0a809e220a675130614ceb6cd9f3a5df31152c54668633baaa183e1e41
Download v1 (.nc)All versions

Files 4

PathSize
handler.js4.2 KB
Dark Sector/AutoRebind32.dll1.5 MB
Dark Sector/AutoRebindInjector32.exe921 KB
Dark Sector/EasyHook32.dll225 KB

handler.js

Plain text
Hub.Handler.Version = 1; // Released at https://hub.splitscreen.me/ on Mon Dec 02 2024 20:31:30 GMT+0000 (Coordinated Universal Time).
Hub.Handler.Id = "XDBr35mLBei78mpY7";
Hub.Maintainer.Name = "birden";
Hub.Maintainer.Id = "rRycxSn253ZCjQy5C";

Game.KillMutex = ["DarkSector"];
Game.FileSymlinkExclusions = ["apyr720.avi", "AutoRebind32.dll", "AutoRebindInjector32.exe", "EasyHook32.dll", "launch.bat"];
Game.FileSymlinkCopyInstead = ["DS.cfg", "Editor.cfg", "defbind.cfg"];
Game.NeedsSteamEmulation = false;
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.SymlinkFolders = false;
Game.ExecutableName = "DS.exe";
Game.ExecutableToLaunch = "launch.bat";
Game.SteamID = "29900";
Game.GUID = "Dark Sector";
Game.GameName = "Dark Sector";
Game.MaxPlayers = 8;
Game.MaxPlayersOneMonitor = 8;
Game.BinariesFolder = "";
Game.HideTaskbar = true;
Game.Hook.ForceFocus = false;
Game.Hook.ForceFocusWindowName = "Dark Sector";
Game.Hook.DInputEnabled = false;
Game.Hook.XInputEnabled = false;
Game.Hook.XInputReroute = false;
Game.Hook.CustomDllEnabled = false;
Game.XInputPlusDll = [];
Game.Description =
  "Start a LAN game in one instance and join in with others\n\nTo control the instances alt+tab to each of them and click with your mouse on them or you can also press END to give them focus (works sometimes)\n\nThe game fails to run at any resolution wider than 2048 pixels";
Game.PauseBetweenProcessGrab = 8;
Game.PauseBetweenStarts = 8;

Game.SetWindowHook = true;
Game.LaunchAsDifferentUsers = true;
Game.UseNucleusEnvironment = true;
Game.UserProfileConfigPath = "AppData\\Roaming\\Dark Sector";

Game.UseSteamless = true;
Game.SteamlessArgs = "--quiet --keepbind";
Game.HookFocus = true;

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

Game.ProtoInput.XinputHook = true;
Game.ProtoInput.UseOpenXinput = true;

Game.Play = function() {
  Context.Wait(5000);

  Context.CopyFolder(Context.ScriptFolder, Context.GetFolder(Nucleus.Folder.InstancedGameFolder));

  var timese = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\launch.bat";
  var lines = ["@echo off", "AutoRebindInjector32.exe DS.exe"];
  Context.WriteTextFile(timese, lines);

  var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Configs\\DS.cfg";
  Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
    new Nucleus.IniSaveInfo("Windows_Config,/Types/Config", "Graphics.FullScreen", 0),
    new Nucleus.IniSaveInfo("Windows_Config,/Types/Config", "Graphics.DisplayAspectRatio", "FullScreen4x3")
  ]);

  var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Configs\\Editor.cfg";
  Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
    new Nucleus.IniSaveInfo("MainGameWindowed,/Editor/WinRect", "SizeX", Context.Width),
    new Nucleus.IniSaveInfo("MainGameWindowed,/Editor/WinRect", "SizeY", Context.Height)
  ]);

  if (Context.AspectRatioDecimal > 2.2) {
    Context.PatchFile(System.IO.Path.Combine(Context.RootFolder, "DS.exe"), System.IO.Path.Combine(Context.RootFolder, "DS.exe"), [0x3d, 0x00, 0x00, 0x40, 0x3f], [0x3d, 0x00, 0x00, 0xd6, 0x3e]);

    Context.PatchFile(System.IO.Path.Combine(Context.RootFolder, "DS.exe"), System.IO.Path.Combine(Context.RootFolder, "DS.exe"), [0x00, 0x00, 0x82, 0x42, 0x46], [0x00, 0x00, 0xd0, 0x42, 0x46]);
    //32:9
    Context.PatchFile(
      System.IO.Path.Combine(Context.RootFolder, "DS.exe"),
      System.IO.Path.Combine(Context.RootFolder, "DS.exe"),
      [0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f],
      [0x40, 0x00, 0x00, 0x00, 0x00, 0x9a, 0x99, 0xf9, 0x3f]
    );
  }

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

      ProtoInput.StartFocusMessageLoop(player.ProtoInputInstanceHandle, 10, true, true, true, true, true);

      System.Threading.Thread.Sleep(1000);

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