Skip to content

Commit 7e69d4e

Browse files
committed
fix an oversight in the driver downloader, add a debug mode to log messages. update to latest ms edge version
1 parent 88aca23 commit 7e69d4e

9 files changed

Lines changed: 25 additions & 11 deletions

File tree

ModHelperData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public static class ModHelperData
44
{
55
internal const string Name = "StreamActions";
66
internal const string Description = "A mod to interact with viewers in chat. It gives you 4 random actions that will happen every 30-60 seconds, which people vote on by typing a number from 1-4, corresponding to the action. The mod should be mostly stable but it is hard to test, keep in mind there may be bugs. If you find any, please report them on the GitHub page alongside a log.";
7-
internal const string Version = "1.1.0";
7+
internal const string Version = "1.1.1";
88
internal const string RepoOwner = "GrahamKracker";
99
internal const string RepoName = "StreamActions";
1010
internal const string WorksOnVersion = "48";

SeleniumWrapper/DriverHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ public static void DownloadLatest(string cacheFolder)
1515

1616
var driverExecutable = Path.Combine(cacheFolder, "edgedriver_win64", "msedgedriver.exe");
1717

18-
var fileVersionInfo = FileVersionInfo.GetVersionInfo(driverExecutable);
18+
var fileVersionInfo = File.Exists(driverExecutable) ? FileVersionInfo.GetVersionInfo(driverExecutable) : null;
1919

20-
if (!File.Exists(driverExecutable) || fileVersionInfo.FileVersion != json?.driverVersion.ToString())
20+
if (!File.Exists(driverExecutable) || fileVersionInfo?.FileVersion != json?.driverVersion.ToString())
2121
{
2222
if(json == null)
2323
throw new InvalidOperationException("Failed to get driver version from github");

SeleniumWrapper/Program.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
using System.Diagnostics.CodeAnalysis;
2-
using System.IO.Compression;
32
using System.Text.Json;
43
using System.Text.Json.Nodes;
54
using H.Formatters;
65
using H.Pipes;
76
using OpenQA.Selenium;
87
using OpenQA.Selenium.DevTools;
9-
using OpenQA.Selenium.DevTools.V135.Network;
8+
using OpenQA.Selenium.DevTools.V137.Network;
109
using OpenQA.Selenium.Edge;
1110

1211
namespace SeleniumWrapper;
@@ -75,7 +74,7 @@ static async Task Main(string[] args)
7574
}
7675

7776
var fetch = devToolsSession
78-
.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V135.DevToolsSessionDomains>().Network;
77+
.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V137.DevToolsSessionDomains>().Network;
7978

8079
_ = fetch.Enable(new EnableCommandSettings());
8180

SeleniumWrapper/SeleniumWrapper.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<ItemGroup>
1515
<PackageReference Include="H.Formatters.Newtonsoft.Json" Version="15.0.0" />
1616
<PackageReference Include="H.Pipes" Version="15.0.0" />
17-
<PackageReference Include="Selenium.Support" Version="4.31.0" />
18-
<PackageReference Include="Selenium.WebDriver" Version="4.31.0" />
17+
<PackageReference Include="Selenium.Support" Version="4.33.0" />
18+
<PackageReference Include="Selenium.WebDriver" Version="4.33.0" />
1919
</ItemGroup>
2020
</Project>

StreamActions/Main.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ public override void OnTitleScreen()
7878

7979
public static void ChatMessageReceived(string chatMessage)
8080
{
81+
if (Settings.DebugMode)
82+
ModLogger.Msg("Chat message received: " + chatMessage);
8183
int charPos = 0;
8284
char cToCheck = chatMessage[0];
8385
if (cToCheck is not '1' and not '2' and not '3' and not '4')

StreamActions/Settings.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,10 @@ public class Settings : ModSettings
2424
displayName = nameof(PausePollsOnGamePause).Spaced(),
2525
description = "Whether to pause the poll countdown when the game is paused.",
2626
};
27+
28+
public static ModSettingBool DebugMode { get; } = new(false)
29+
{
30+
displayName = nameof(DebugMode).Spaced(),
31+
description = "Enable this to log each chat message that is received from the active streaming platform, not just ones that count for votes.",
32+
};
2733
}

StreamActions/StreamActions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<PackageReference Include="H.Formatters.Newtonsoft.Json" Version="15.0.0" />
2525
<PackageReference Include="H.Pipes" Version="15.0.0" />
2626
<PackageReference Include="TwitchLib.Client" Version="3.3.1" />
27-
<PackageReference Include="ILRepack.Lib.MSBuild.Task" Version="2.0.40">
27+
<PackageReference Include="ILRepack.Lib.MSBuild.Task" Version="2.0.43">
2828
<PrivateAssets>all</PrivateAssets>
2929
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3030
</PackageReference>

StreamActions/UI/Menus/PlatformSetupMenu.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,18 @@ public void SetSelectedPlatform(StreamingPlatform platform)
8383

8484
private void ConnectToPlatform(StreamingPlatform platform)
8585
{
86-
StreamingPlatform.CurrentPlatform?.Disconnect();
86+
var currentPlatform = StreamingPlatform.CurrentPlatform;
87+
if (currentPlatform != null)
88+
{
89+
ModLogger.Msg($"Disconnecting from {currentPlatform.DisplayName}...");
90+
currentPlatform.Disconnect();
91+
}
8792

93+
ModLogger.Msg($"Connecting to {platform.DisplayName}...");
8894
StreamingPlatform.CurrentPlatform = platform;
8995

9096
platform.ConnectToPlatform();
97+
ModLogger.Msg($"Connected to {platform.DisplayName}.");
9198
}
9299

93100
private void CreateRightMenu(ModHelperPanel modPanel)

remotevars.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"driverVersion": '135.0.3179.85'
2+
"driverVersion": "137.0.3296.62"
33
}

0 commit comments

Comments
 (0)