Skip to content

Commit 5354f2f

Browse files
committed
Initial Commit
1 parent 2b4b22d commit 5354f2f

2 files changed

Lines changed: 53 additions & 25 deletions

File tree

Forms/MainFrm.cs

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ private void ManualInjectBtn_Click(object sender, EventArgs e)
203203

204204
private void ReloadSessionsBtn_OnButtonClick(object sender, EventArgs e)
205205
{
206-
Sessions.ReloadSessions();
206+
Sessions.ParseSessions();
207207
}
208208

209209
private void AutoCheckUpdatesBx_OnCheckChanged(object sender, EventArgs e)
@@ -815,8 +815,17 @@ private async Task<bool> CheckForUpdates(bool bInvalidate)
815815

816816
if (LibraryManager.AnyProcessRunning())
817817
{
818-
UpdatePopupCtrl.ButtonLayout = CRPopup.ButtonLayouts.TYPE_SINGLE;
819-
UpdatePopupCtrl.DisplayDescription = "A new version of both the module and launcher were found, but Rocket League needs to be closed in order to install it first! Please close the game and try again.";
818+
List<Process> processes = ProcessManager.GetFilteredProcesses(LibraryManager.Settings.ProcessName);
819+
820+
if (processes.Count > 0 && LibraryManager.IsModuleLoaded(processes[0], true))
821+
{
822+
UpdatePopupCtrl.ButtonLayout = CRPopup.ButtonLayouts.TYPE_SINGLE;
823+
UpdatePopupCtrl.DisplayDescription = "A new version of both the module and launcher were found, but Rocket League needs to be closed in order to install it first! Please close the game and try again.";
824+
}
825+
else
826+
{
827+
UpdatePopupCtrl.DisplayDescription = "A new version of both the module and launcher were found, would you like to automatically install both now?";
828+
}
820829
}
821830
else
822831
{
@@ -832,8 +841,17 @@ private async Task<bool> CheckForUpdates(bool bInvalidate)
832841

833842
if (LibraryManager.AnyProcessRunning())
834843
{
835-
UpdatePopupCtrl.ButtonLayout = CRPopup.ButtonLayouts.TYPE_DOUBLE;
836-
UpdatePopupCtrl.DisplayDescription = "A new version of the module was found, but Rocket League needs to be closed in order to install it first! Please close the game and try again.";
844+
List<Process> processes = ProcessManager.GetFilteredProcesses(LibraryManager.Settings.ProcessName);
845+
846+
if (processes.Count > 0 && LibraryManager.IsModuleLoaded(processes[0], true))
847+
{
848+
UpdatePopupCtrl.ButtonLayout = CRPopup.ButtonLayouts.TYPE_DOUBLE;
849+
UpdatePopupCtrl.DisplayDescription = "A new version of the module was found, but Rocket League needs to be closed in order to install it first! Please close the game and try again.";
850+
}
851+
else
852+
{
853+
UpdatePopupCtrl.DisplayDescription = "A new version of the module was found, would you like to automatically install it now?";
854+
}
837855
}
838856
else
839857
{

Framework/Sessions.cs

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,50 @@
99

1010
namespace CodeRedLauncher
1111
{
12-
public class MatchObject
12+
public class MatchData
1313
{
14-
public UInt64 Timestamp { get; set; }
14+
public UInt32 Score { get; set; }
15+
public UInt32 Goals { get; set; }
16+
public UInt32 Assists { get; set; }
17+
public UInt32 Saves { get; set; }
18+
public UInt32 Shots { get; set; }
19+
public UInt32 Clears { get; set; }
20+
public UInt32 Demolishes { get; set; }
21+
public UInt32 DropshotDamage { get; set; }
22+
public UInt32 Knockouts { get; set; }
23+
public UInt32 KnockoutAssists { get; set; }
24+
public UInt32 KnockoutDeaths { get; set; }
25+
public UInt32 KnockoutDamage { get; set; }
26+
public UInt32 KnockoutHits { get; set; }
27+
public UInt32 KnockoutGrabs { get; set; }
28+
public UInt32 KnockoutBlocks { get; set; }
29+
public UInt64 StartTime { get; set; }
30+
public UInt64 EndTime { get; set; }
1531
public float StartSkill { get; set; }
1632
public float EndSkill { get; set; }
17-
public Int32 Score { get; set; }
18-
public Int32 Goals { get; set; }
19-
public Int32 Assists { get; set; }
20-
public Int32 Saves { get; set; }
21-
public Int32 Shots { get; set; }
22-
public Int32 Damage { get; set; }
23-
public Int32 Demolishes { get; set; }
24-
public bool Partied { get; set; }
33+
public bool StartCached { get; set; }
34+
public bool EndCached { get; set; }
2535
public bool LeftEarly { get; set; }
2636
public bool Won { get; set; }
2737
}
2838

29-
public class SessionObject
39+
public class SessionInfo
3040
{
3141
public Int32 Playlist { get; set; }
32-
public Int32 Wins { get; set; }
33-
public Int32 Losses { get; set; }
34-
public Int32 Streak { get; set; }
42+
public UInt32 Wins { get; set; }
43+
public UInt32 Losses { get; set; }
44+
public UInt32 Streak { get; set; }
3545
public bool OnFire { get; set; }
36-
public Int32 Matches { get; set; }
37-
public MatchObject[] MatchData { get; set; }
46+
public UInt64 Matches { get; set; }
47+
public MatchData[] MatchData { get; set; }
3848
}
3949

4050
public static class Sessions
4151
{
42-
private static List<SessionObject> ParsedSessions = new List<SessionObject>();
52+
private static List<SessionInfo> ParsedSessions = new List<SessionInfo>();
4353
public static Architecture.Range32 Timeframe = new Architecture.Range32(0, 30); // Current day, to thirty days back.
4454

45-
public static void ReloadSessions()
55+
public static void ParseSessions()
4656
{
4757
Architecture.Path sessionsFolder = Storage.GetModulePath() / "Sessions";
4858

@@ -54,11 +64,11 @@ public static void ReloadSessions()
5464

5565
foreach (Architecture.Path sessionsFile in sessionsFiles)
5666
{
57-
List<SessionObject> sessionObjects = JsonSerializer.Deserialize<List<SessionObject>>(File.ReadAllText(sessionsFile.GetPath()));
67+
List<SessionInfo> sessionObjects = JsonSerializer.Deserialize<List<SessionInfo>>(File.ReadAllText(sessionsFile.GetPath()));
5868

5969
if (sessionObjects.Count > 0)
6070
{
61-
foreach (SessionObject sessionObject in sessionObjects)
71+
foreach (SessionInfo sessionObject in sessionObjects)
6272
{
6373
ParsedSessions.Add(sessionObject);
6474
}

0 commit comments

Comments
 (0)