-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.cs
79 lines (66 loc) · 2.41 KB
/
App.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using System.Text.Json;
using System.Text.Json.Nodes;
using LeagueProxyLib;
var leagueProxy = new LeagueProxy();
leagueProxy.Events.OnProcessConfigPublic += (string content) =>
{
var configObject = JsonSerializer.Deserialize<JsonNode>(content);
// disable vanguard
if (configObject?["anticheat.vanguard.enabled"] is not null)
{
Console.WriteLine("patched anticheat.vanguard.enabled");
configObject["anticheat.vanguard.enabled"] = false;
}
if (configObject?["lol.client_settings.vanguard.enabled"] is not null)
{
Console.WriteLine("patched lol.client_settings.vanguard.enabled");
configObject["lol.client_settings.vanguard.enabled"] = false;
}
var lol = configObject?["keystone.products.league_of_legends.patchlines.live"];
if (lol is not null)
{
var configs = lol["platforms"]?["win"]?["configurations"]?.AsArray();
if (configs is not null)
{
for (var i = 0; i < configs.Count; ++i)
{
var dependencies = configs[i]!["dependencies"]!.AsArray();
var vanguard = dependencies.FirstOrDefault(x => x!["id"]!.GetValue<string>() == "vanguard");
if (vanguard is not null)
{
Console.WriteLine("removing vanguard dependency for league");
dependencies.Remove(vanguard);
}
}
}
}
var val = configObject?["keystone.products.valorant.patchlines.live"];
if (val is not null)
{
var configs = val["platforms"]?["win"]?["configurations"]?.AsArray();
if (configs is not null)
{
for (var i = 0; i < configs.Count; ++i)
{
var dependencies = configs[i]!["dependencies"]!.AsArray();
var vanguard = dependencies.FirstOrDefault(x => x!["id"]!.GetValue<string>() == "vanguard");
if (vanguard is not null)
{
Console.WriteLine("removing vanguard dependency for valorant");
dependencies.Remove(vanguard);
}
}
}
}
return JsonSerializer.Serialize(configObject);
};
var process = leagueProxy.StartAndLaunchRCS(args);
if (process is null)
{
Console.WriteLine("Failed to create RCS process!");
leagueProxy.Stop();
return;
}
await process.WaitForExitAsync();
// Gracefully exit.
leagueProxy.Stop();