Day of Infamy · handler “Day of Infamy”
Version 3
Release notes
Multiple Keyboards/Mice support and FPS limiter.
- Released
- Size
- 1.4 MB
- Downloads
- 15
- Check
- Verified
- SHA-256
- f3dcdb29584c4a88eb222aeb29ea9f028f5567508b64ab56215c605687035269
Files 13
| Path | Size |
|---|---|
| handler.js | 8.2 KB |
| StarWarsRacer1/current_control.map | 5.7 KB |
| StarWarsRacer1/D3D8.dll | 332 KB |
| StarWarsRacer1/D3DImm.dll | 171 KB |
| StarWarsRacer1/DDraw.dll | 209 KB |
| StarWarsRacer1/dgVoodoo.conf | 15 KB |
| StarWarsRacer1/dgVoodooCpl.exe | 344 KB |
| StarWarsRacer1/Dinput.dll | 172 KB |
| StarWarsRacer1/Dinput8.dll | 173 KB |
| StarWarsRacer1/nircmd.exe | 117 KB |
| StarWarsRacer1/position.cmd | 201 B |
| StarWarsRacer1/XInput1_3.dll | 478 KB |
| StarWarsRacer1/XInputPlus.ini | 2.4 KB |
handler.js
Plain textHub.Handler.Version = 3; // Released at https://hub.splitscreen.me/ on Sat Nov 28 2020 00:13:01 GMT+0000 (UTC).
Hub.Handler.Id = "sZrAZ5kA9MjuaiTFq";
Hub.Maintainer.Name = "Bizzo";
Hub.Maintainer.Id = "HEgozNi3MNvhAmWfi";
/*Nucleus R4 make the mouse pointer lag when using DInput. This should be used only with controllers:
With more than 4 controllers, you can use only ONE XboxOne controller and you can't use at the same time the keyboard.
You must click/alt+tab on the corresponding instance to make it work.
In alternative you can try fix the problem by doing this http://www.snes9x.com/phpbb3/viewtopic.php?t=27510 or try Xoutput.
For enable the support, set on true or remove slashes from this line:
- Game.Hook.XInputReroute
*/
var answers = ["No", "Yes"]; //adding variables that user can use on the options
Game.AddOption("More than four controllers?", "You must enable XInputReroute inside the .js file", "Pad", answers);
var answers1 = ["60", "45", "30", "120", "144", "240", "300"];
Game.AddOption("Which FPS Cap the game will use?", "", "Fps", answers1);
Game.KillMutex = [
//killing the right mutex for open the game multiple times
"hl2_singleton_mutex"
];
Game.RenameNotKillMutex = true;
Game.DirSymlinkExclusions = [
//what folder should be copied and not symlinked
"doi",
"doi\\cfg",
"bin",
"bin\\x64"
];
Game.FileSymlinkExclusions = [
//what files should not be copied
"dayofinfamy_BE.exe",
"steam_appid.txt",
"autoexec.cfg",
"xinput1_3.dll"
];
Game.FileSymlinkCopyInstead = [
//what files should be copied and not symlinked
"video.txt",
"config.cfg"
];
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.SymlinkFolders = true;
Game.SupportsKeyboard = false;
Game.ExecutableName = "dayofinfamy_x64.exe";
Game.SteamID = "447820";
Game.GUID = "Day of Infamy";
Game.GameName = "Day of Infamy";
Game.NeedsSteamEmulation = false;
Game.CreateSteamAppIdByExe = true;
Game.LauncherTitle = "";
Game.SupportsPositioning = true;
Game.StartArguments = "";
Game.WorkingFolder = "";
Game.MaxPlayersOneMonitor = 6;
Game.MaxPlayers = 16;
Game.Hook.ForceFocus = false;
Game.Hook.ForceFocusWindowName = "Day of Infamy";
Game.PauseBetweenStarts = 30;
Game.PromptBetweenInstances = true;
Game.HookInit = true;
Game.HookFocus = true;
Game.SetWindowHookStart = true;
Game.DontResize = true;
Game.Hook.DInputEnabled = false;
Game.Hook.DInputForceDisable = false;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false; //set on true for play more than 4 controllers . You can use only ONE XboxOne controller and you can't use at the same time the keyboard. You must click/alt+tab on the corrisponding instance for make it work. In alternative you can try fix the problem by doing this http://www.snes9x.com/phpbb3/viewtopic.php?t=27510 or try Xoutput.
Game.Hook.CustomDllEnabled = true;
//Game.XInputPlusDll = ["xinput1_3.dll"];
Game.SupportsMultipleKeyboardsAndMice = true;
Game.HookSetCursorPos = true;
Game.HookGetCursorPos = true;
Game.HookGetKeyState = true;
Game.HookGetAsyncKeyState = true;
Game.HookGetKeyboardState = false;
Game.HookFilterRawInput = true;
Game.HookFilterMouseMessages = false;
Game.HookUseLegacyInput = false;
Game.HookDontUpdateLegacyInMouseMsg = false;
Game.SendNormalMouseInput = true;
Game.SendNormalKeyboardInput = true;
Game.SendScrollWheel = true;
Game.ForwardRawMouseInput = false;
Game.ForwardRawKeyboardInput = false;
Game.HookReRegisterRawInput = false;
Game.HookReRegisterRawInputMouse = false;
Game.HookReRegisterRawInputKeyboard = false;
Game.DrawFakeMouseCursor = true;
Game.LockInputAtStart = false;
Game.LockInputToggleKey = 0x23;
Game.Description =
"The first time one instance could crash and the map will take long time to load. Start a practice mode match in the first instance, use the mouse cursor to navigate the menus. Select the team and edit the player equipments (do not apply). When the player is ready, start the next instance (repeat the process for each instance). When all instances are set, click 'ok' on the last prompt (hook/sends fake messages) and press END for restrict keyboard players to their instance (press again for unlock). Gamepads players can confirm their equipments by pressing B. Enable XInputReroute inside the .js file for play with more than 4 controllers.";
Game.Play = function() {
//The configuration of multi keyboards/mice must have FakeFocus turned on. Also HookMouseVisibility could cause crashes so it will enable only on the keyboard players.
if (Player.IsKeyboardPlayer) {
Game.FakeFocus = true;
Game.HookMouseVisibility = true;
} else {
Game.FakeFocus = false;
Game.HookMouseVisibility = false;
}
var fps = Context.Options["Fps"];
var Args = (Context.Args = " -windowed -noborder -AlwaysFocus -insecure -novid +sv_lan 1 +sv_pausable 1 +fps_max " + fps); //launch options that the game should use
Context.StartArguments = Args;
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\doi\\cfg\\video.txt"); //editing the video.txt file
Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.CFG, [
new Nucleus.CfgSaveInfo("config", "setting.fullscreen", "0"),
new Nucleus.CfgSaveInfo("config", "setting.defaultres", Math.max(640, Context.Width)),
new Nucleus.CfgSaveInfo("config", "setting.defaultresheight", Math.max(360, Context.Height)),
new Nucleus.CfgSaveInfo("config", "setting.nowindowborder", "0"),
new Nucleus.CfgSaveInfo("VideoConfig", "setting.fullscreen", "0"),
new Nucleus.CfgSaveInfo("VideoConfig", "setting.defaultres", Math.max(640, Context.Width)),
new Nucleus.CfgSaveInfo("VideoConfig", "setting.defaultresheight", Math.max(360, Context.Height)),
new Nucleus.CfgSaveInfo("VideoConfig ", "setting.nowindowborder", "0")
]);
if (Player.IsKeyboardPlayer) {
//if the player use keyboard the script will do this
var autoExec = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\doi\\cfg\\autoexec.cfg"; //adding a autoexec.cfg file with the next lines
var lines = [
"engine_no_focus_sleep 0",
'm_rawinput "1"',
"bind F8 pause",
'joystick_force_disabled_set "1"',
"exec undo360controller.cfg",
"host_writeconfig",
'echo "$$$$$$ autoexec.cfg loaded = controller disabled $$$$$$'
];
Context.WriteTextFile(autoExec, lines);
} else {
//if is not using a keyboard the script will do this
var pad = Context.Options["Pad"]; //this is what happens on the "More than four controllers?" option if you choose No.
if (pad == "No") {
var autoExec = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\doi\\cfg\\autoexec.cfg";
var lines = [
"engine_no_focus_sleep 0",
'm_rawinput "0"',
'joystick_force_disabled_set "0"',
"exec controller.cfg",
'zoom_sensitivity_ratio_joystick ".32"',
'bind "L_TRIGGER" "+special2"',
"bind F8 pause",
'bind "BACK" "pause; changeinventory"',
"host_writeconfig",
'echo "$$$$$$ autoexec.cfg loaded = controller enabled $$$$$$$'
];
Context.WriteTextFile(autoExec, lines);
}
if (pad == "Yes") {
//this is what happens on the "More than four controllers?" option if you choose Yes.
var autoExec = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\doi\\cfg\\autoexec.cfg";
var lines = [
"engine_no_focus_sleep 0",
'm_rawinput "0"',
'joystick_force_disabled_set "0"',
"exec controller.cfg",
'zoom_sensitivity_ratio_joystick ".32"',
'bind "L_TRIGGER" "+toggle_zoom"',
"bind F8 pause",
'bind "BACK" "pause; changeinventory"',
"host_writeconfig",
'echo "$$$$$$ autoexec.cfg loaded = controller enabled $$$$$$$'
];
Context.WriteTextFile(autoExec, lines);
}
}
if (Context.PlayerID == 0) {
//The script will do this only for the first player
} else {
//The script will do this only for the others
lines.push("connect " + Context.User.GetLocalIP()); //adding line on the autoexec file (var autoExec)
}
Context.WriteTextFile(autoExec, lines);
};