Skip to content

Commit

Permalink
Add support for RiotClient, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
molenzwiebel committed Sep 22, 2019
1 parent 59b5920 commit 917cf29
Show file tree
Hide file tree
Showing 7 changed files with 2,189 additions and 14 deletions.
1 change: 1 addition & 0 deletions Deceive/Deceive.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="SimpleJson.cs" />
<Compile Include="Utils.cs" />
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Deceive/MainController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public MainController()

private void SetupMenuItems()
{
var aboutMenuItem = new MenuItem("Deceive v1.3.1");
var aboutMenuItem = new MenuItem("Deceive v1.4.0");
aboutMenuItem.Enabled = false;

var enabledMenuItem = new MenuItem("Enabled", (a, e) =>
Expand Down
30 changes: 22 additions & 8 deletions Deceive/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,31 @@ private static void StartDeceive()
var yamlPath = Path.Combine(Path.GetDirectoryName(leaguePath), "Config", "deceive-system.yaml");
File.WriteAllText(yamlPath, contents);

// Step 3: Start league and wait for a connect.
var startArgs = new ProcessStartInfo
// Step 3: Either launch Riot Client or launch League, depending on local configuration.
var riotClientPath = Utils.GetRiotClientPath();

ProcessStartInfo startArgs;
if (riotClientPath != null)
{
startArgs = new ProcessStartInfo
{
FileName = riotClientPath,
Arguments = "--priority-launch-pid=12345 --priority-launch-path=\"" + leaguePath + "\" -- --system-yaml-override=\"" + yamlPath + "\"",
};
} else
{
FileName = leaguePath,
Arguments = "--system-yaml-override=\"" + yamlPath + "\"",
UseShellExecute = false
};
startArgs = new ProcessStartInfo
{
FileName = leaguePath,
Arguments = "--system-yaml-override=\"" + yamlPath + "\"",
};
}

// Step 4: Start the process and wait for a connect.
Process.Start(startArgs);
var incoming = listener.AcceptTcpClient();

// Step 4: Connect sockets.
// Step 5: Connect sockets.
var sslIncoming = new SslStream(incoming.GetStream());
var cert = new X509Certificate2(Properties.Resources.certificates);
sslIncoming.AuthenticateAsServer(cert);
Expand All @@ -108,7 +122,7 @@ private static void StartDeceive()
var sslOutgoing = new SslStream(outgoing.GetStream());
sslOutgoing.AuthenticateAsClient(chatHost);

// Step 5: All sockets are now connected, start tray icon.
// Step 6: All sockets are now connected, start tray icon.
var mainController = new MainController();
mainController.StartThreads(sslIncoming, sslOutgoing);
Application.EnableVisualStyles();
Expand Down
4 changes: 2 additions & 2 deletions Deceive/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.1.0")]
[assembly: AssemblyFileVersion("1.3.1.0")]
[assembly: AssemblyVersion("1.4.0.0")]
[assembly: AssemblyFileVersion("1.4.0.0")]
Loading

0 comments on commit 917cf29

Please sign in to comment.