Skip to content

Commit

Permalink
- Added debug file for Left 4 Dead 1
Browse files Browse the repository at this point in the history
- Added a PreAlpha access to builds
  • Loading branch information
distrohelena committed Mar 20, 2017
1 parent d856513 commit 9d62c2e
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 12 deletions.
6 changes: 5 additions & 1 deletion Master/Games/Nucleus.Coop.Games.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<None Include="games\Left4Dead.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
5 changes: 4 additions & 1 deletion Master/Games/games/CallOfDutyBlackOps2Zombies.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ Game.Options = [
Nucleus.KeyboardPlayer.NoKeyboardPlayer,
"KeyboardPlayer"),
];
//Game.SymlinkIgnore = [
// "steam_api.dll"
//];

Game.Debug = true;
Game.NeedsSteamEmulation = true;
Game.NeedsSteamEmulation = false;
Game.SymlinkExe = false;
Game.SupportsKeyboard = true;
Game.ExecutableName = "t6zm.exe";
Expand Down
56 changes: 56 additions & 0 deletions Master/Games/games/Left4Dead.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Game.Options = [
new Nucleus.GameOption(
"Keyboard Player",
"The player that will be playing on keyboard and mouse (if any)",
Nucleus.KeyboardPlayer.NoKeyboardPlayer,
"KeyboardPlayer"),
];
Game.KillMutex = [ // 2nd instance won't launch without these removed
"hl2_singleton_mutex",
"steam_singleton_mutext"
];
Game.SymlinkIgnore = [
"video.txt",
"autoexec.cfg"
];

Game.SymlinkExe = false;
Game.SupportsKeyboard = true;
Game.ExecutableName = "left4dead.exe";
Game.SteamID = "500";
Game.GUID = "500";
Game.GameName = "Left 4 Dead";
Game.MaxPlayers = 4;
Game.MaxPlayersOneMonitor = 4;
Game.BinariesFolder = "";
Game.NeedsSteamEmulation = false;
Game.LauncherTitle = "";
Game.SaveType = Nucleus.SaveType.CFG;
Game.SupportsPositioning = true;
Game.HideTaskbar = false;
Game.CustomXinput = true;
Game.StartArguments = "-novid";

Game.Play = function () {
Context.ModifySave = [
new Nucleus.CfgSaveInfo("VideoConfig", "setting.fullscreen", "0"),
new Nucleus.CfgSaveInfo("VideoConfig", "setting.defaultres", Context.Width),
new Nucleus.CfgSaveInfo("VideoConfig", "setting.defaultresheight", Context.Height),
new Nucleus.CfgSaveInfo("VideoConfig", "setting.nowindowborder", "0"),
];

var autoExec = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\left4dead\\cfg\\autoexec.cfg";
var lines = [
"sv_lan 1",
"sv_allow_lobby_connect_only 0"
]
Context.WriteTextFile(autoExec, lines);

Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\left4dead\\cfg\\video.txt";

if (Context.IsKeyboardPlayer) {
Handler.StartPlayTick(1, function () {
Handler.CenterCursor();
});
}
}
14 changes: 11 additions & 3 deletions Master/Games/games/SaintsRow3DX11.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,25 @@ Game.GameName = "Saints Row 3 (DX11)";
Game.MaxPlayers = 4;
Game.MaxPlayersOneMonitor = 4;
Game.BinariesFolder = "";
Game.NeedsSteamEmulation = true;
Game.NeedsSteamEmulation = false;
Game.LauncherTitle = "";
Game.SaveType = Nucleus.SaveType.None;
Game.SupportsPositioning = true;
Game.HideTaskbar = false;
Game.CustomXinput = true;
Game.StartArguments = "-windowed -NoLauncher -nostartupmovies";
Game.StartArguments = "";
Game.HookNeeded = true;
Game.HookGameWindowName = "Saints Row: The Third";
Game.LauncherExe = "game_launcher.exe";

Game.Play = function () {
//Context.SavePath = Context.GetFolder(Nucleus.Folder.Documents) + "\\My Games\\Borderlands\\WillowGame\\Config\\WillowEngine.ini";
Context.ModifySave = [
new Nucleus.IniSaveInfo("", "ResolutionWidth", Context.Width),
new Nucleus.IniSaveInfo("", "ResolutionHeight", Context.Height),
new Nucleus.IniSaveInfo("", "Fullscreen", false),
new Nucleus.IniSaveInfo("", "VerifyResolution", false),
new Nucleus.IniSaveInfo("", "SkipIntroVideo", true),
];

Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\display.ini";
}
Binary file modified Master/NucleusCoop.VC.db
Binary file not shown.
6 changes: 6 additions & 0 deletions Master/NucleusGaming/Coop/Generic/GenericContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ public class GenericContext
private bool debug;
private double handlerInterval;
private string[] symlinkIgnore;
private string[] backupFiles;

public string[] BackupFiles
{
get { return backupFiles; }
}

public string[] SymlinkIgnore
{
Expand Down
19 changes: 17 additions & 2 deletions Master/NucleusGaming/Coop/Generic/GenericGameHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,15 @@ public string Play()
GameManager.Instance.BackupFile(gen, saveFile);
}

if (context.BackupFiles != null)
{
string[] backupFiles = context.BackupFiles;
for (int j = 0; j < backupFiles.Length; j++)
{
GameManager.Instance.BackupFile(gen, backupFiles[j]);
}
}

List<string> exclusions = new List<string>();
exclusions.Add("xinput");
exclusions.Add("ncoop");
Expand Down Expand Up @@ -415,7 +424,8 @@ public string Play()
emu.IniWriteValue("Launcher", "CommandLine", startArgs);
emu.IniWriteValue("Launcher", "SteamClientPath", Path.Combine(steamEmu, "SmartSteamEmu.dll"));
emu.IniWriteValue("Launcher", "SteamClientPath64", Path.Combine(steamEmu, "SmartSteamEmu64.dll"));
emu.IniWriteValue("Launcher", "InjectDll", "0");
emu.IniWriteValue("Launcher", "InjectDll", "1");

emu.IniWriteValue("SmartSteamEmu", "AppId", context.SteamID);
//emu.IniWriteValue("SmartSteamEmu", "SteamIdGeneration", "Static");

Expand Down Expand Up @@ -718,13 +728,18 @@ public void Update(double delayMS)
{
data.HWnd = new HwndObject(data.Process.MainWindowHandle);
Point pos = data.HWnd.Location;

if (String.IsNullOrEmpty(data.HWnd.Title) ||
pos.X == -32000 ||
data.HWnd.Title.ToLower() == gen.LauncherTitle.ToLower())
{
data.HWNDRetry = true;
}
else if (!string.IsNullOrEmpty(gen.HookGameWindowName) &&
data.HWnd.Title != gen.HookGameWindowName)
{
data.HWNDRetry = true;
}
else
{
Size s = data.Size;
Expand Down
11 changes: 7 additions & 4 deletions Master/NucleusGaming/Coop/Generic/GenericGameInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ public class GenericGameInfo : IGenericGameInfo
private bool debug;
private double handlerInterval = 500;
private string[] symlinkIgnore;
private string[] backupFiles;

public string[] BackupFiles
{
get { return backupFiles; }
}

public string[] SymlinkIgnore
{
Expand Down Expand Up @@ -233,10 +239,7 @@ public void PrePlay(GenericContext context, GenericGameHandler handler)
engine.SetValue("Context", context);
engine.SetValue("Handler", handler);

if (play != null)
{
play();
}
play?.Invoke();
}

/// <summary>
Expand Down
Binary file added PreAlpha.rar
Binary file not shown.
2 changes: 1 addition & 1 deletion Submodules/x360ce

0 comments on commit 9d62c2e

Please sign in to comment.