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

Sven Co-op · handler “SvenCoop”

Version 2

Release notes

.js only now.

Released
Size
1.5 KB
Downloads
4
Check
Verified
SHA-256
3ee343a37c19d62099f984db87c1136d65ea2004b4473cca8d0e97a3e4e345d9
Download v2 (.nc)All versions

Files 1

PathSize
handler.js3.6 KB

handler.js

Plain text
Hub.Handler.Version = 2; // Released at https://hub.splitscreen.me/ on Sun Jul 11 2021 05:15:16 GMT+0000 (UTC).
Hub.Handler.Id = "wQeHLrPwbvRLAtNk9";
Hub.Maintainer.Name = "Talos91";
Hub.Maintainer.Id = "eeL7HAz8zJovChWw4";

Game.ExecutableContext = ["svencoop"];
Game.KillMutex = ["SvenCoopLauncherMutex", "ValvePlatformUIMutex", "ValvePlatformWaitMutex"];
Game.FileSymlinkExclusions = ["autoexec.cfg"];
Game.FileSymlinkCopyInstead = ["config.cfg", "controller-xb360.cfg"];
Game.NeedsSteamEmulation = false;
Game.UseGoldberg = true;
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.SupportsKeyboard = false;
Game.ExecutableName = "svencoop.exe";
Game.SteamID = "225840";
Game.GUID = "Sven Coop";
Game.GameName = "Sven Co-op";
Game.MaxPlayers = 8;
Game.MaxPlayersOneMonitor = 8;
Game.LauncherTitle = "";
Game.HideTaskbar = false;
Game.Hook.ForceFocus = false;
Game.Hook.ForceFocusWindowName = "Sven Co-op";
Game.FakeFocus = true;
Game.FakeFocusInterval = 20000;
Game.SendFakeFocusMsg = true;
Game.HookFocus = true;
Game.ResetWindows = true;
Game.Hook.DInputEnabled = false;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.XInputPlusDll = ["xinput1_4.dll"];
Game.Hook.CustomDllEnabled = false;
Game.Description =
  "Start a map in the first instance then after you are in-game press the prompt to open the next instance and it will join the same game automatically. If the buttons in your gamepad do not do anything, open the console with the key under Escape and write: exec controller-xb360.cfg then press enter. Press that key in all instances by alt-tabbing.";
Game.PromptBetweenInstances = true;
Game.PauseBetweenStarts = 30;

Game.SupportsMultipleKeyboardsAndMice = true;

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

Game.SendNormalMouseInput = true;
Game.SendNormalKeyboardInput = true;
Game.SendScrollWheel = true;
Game.ForwardRawKeyboardInput = false;
Game.ForwardRawMouseInput = false;
Game.HookReRegisterRawInput = true;
Game.HookReRegisterRawInputMouse = true;
Game.HookReRegisterRawInputKeyboard = false;
Game.DrawFakeMouseCursor = false;
Game.LockInputAtStart = false;
Game.LockInputToggleKey = 0x23;

Game.Play = function() {
  var Args = (Context.Args = "-windowed -noborder " + "-w" + Context.Width + " -h" + Context.Height);

  Context.StartArguments = Args;

  var autoExec = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\svencoop\\autoexec.cfg";
  var lines = ["sv_lan 1", "sv_aim 1", "maxplayers 8"];

  if (Context.IsKeyboardPlayer) {
    lines.push("exec undocontroller-xb360.cfg");

    var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\svencoop\\config.cfg";
    var dict = [Context.FindLineNumberInTextFile(txtPath, "joystick", Nucleus.SearchType.StartsWith) + '|joystick "0"'];
    Context.ReplaceLinesInTextFile(txtPath, dict);
  } else {
    lines.push("exec controller-xb360.cfg");

    var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\svencoop\\config.cfg";
    var dict = [Context.FindLineNumberInTextFile(txtPath, "joystick", Nucleus.SearchType.StartsWith) + '|joystick "1"'];
    Context.ReplaceLinesInTextFile(txtPath, dict);
  }

  if (Context.PlayerID == 0) {
  } else {
    lines.push("connect " + Context.LocalIP);
  }

  Context.WriteTextFile(autoExec, lines);
};