Skip to content

Commit

Permalink
Merge pull request #596 from TheTrackerCouncil/msu-messenger-v1
Browse files Browse the repository at this point in the history
Msu Messenger
  • Loading branch information
MattEqualsCoder authored Nov 10, 2024
2 parents 331b769 + 0f304d3 commit 889c9d6
Show file tree
Hide file tree
Showing 20 changed files with 158 additions and 88 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NJsonSchema" Version="11.0.1" />
<PackageReference Include="NJsonSchema.NewtonsoftJson" Version="11.0.1" />
<PackageReference Include="Serilog" Version="4.0.0" />
<PackageReference Include="NJsonSchema" Version="11.0.2" />
<PackageReference Include="NJsonSchema.NewtonsoftJson" Version="11.0.2" />
<PackageReference Include="Serilog" Version="4.1.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 7 additions & 1 deletion src/TrackerCouncil.Smz3.Data/Options/GeneralOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ public string? TwitchId
/// </summary>
public bool DisplayTrackerSpeechWindow { get; set; }

/// <summary>
/// If the gRPC server for receiving MSU randomizer messages should be enabled
/// </summary>
public bool MsuMessageReceiverEnabled { get; set; } = true;

/// <summary>
/// Check for new releases on GitHub on startup
/// </summary>
Expand Down Expand Up @@ -262,7 +267,8 @@ public bool Validate()
SpeechRecognitionMode = SpeechRecognitionMode,
PushToTalkKey = PushToTalkKey,
PushToTalkDevice = PushToTalkDevice,
TrackerTimerEnabled = TrackerTimerEnabled
TrackerTimerEnabled = TrackerTimerEnabled,
MsuMessageReceiverEnabled = MsuMessageReceiverEnabled
};

protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null)
Expand Down
5 changes: 5 additions & 0 deletions src/TrackerCouncil.Smz3.Data/Options/TrackerOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ public record TrackerOptions
/// </summary>
public TrackDisplayFormat TrackDisplayFormat { get; set; }

/// <summary>
/// If the gRPC server for receiving MSU randomizer messages should be enabled
/// </summary>
public bool MsuMessageReceiverEnabled { get; set; } = true;

/// <summary>
/// The file to write the current song to
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<ItemGroup>
<PackageReference Include="MattEqualsCoder.DynamicForms.Core" Version="1.0.1" />
<PackageReference Include="MattEqualsCoder.GitHubReleaseChecker" Version="1.1.2" />
<PackageReference Include="MattEqualsCoder.MSURandomizer.Library" Version="2.1.0" />
<PackageReference Include="MattEqualsCoder.MSURandomizer.Library" Version="3.0.0-rc.5" />
<PackageReference Include="NAudio.Wasapi" Version="2.2.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="YamlDotNet" Version="16.1.3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,8 @@ public class OptionsWindowTrackerOptions
[DynamicFormFieldCheckBox(checkBoxText: "Enable timer", groupName: "Bottom")]
public bool TrackerTimerEnabled { get; set; } = true;

[DynamicFormFieldCheckBox(checkBoxText: "Enable MSU Randomizer message server", groupName: "Bottom", toolTipText: "Enables the gRPC server that allows the separate MSU Randomizer application from informing Tracker of when the MSU was shuffled and when the playing track is changed.")]
public bool MsuMessageReceiverEnabled { get; set; } = true;

public Dictionary<string, string> AudioDevices { get; set; } = new();
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public OptionsWindowViewModel(GeneralOptions options, Dictionary<string, string>
TrackerOptions.TrackerSpoilersEnabled = options.TrackerSpoilersEnabled;
TrackerOptions.AudioDevices = audioInputDevices;
TrackerOptions.TrackerTimerEnabled = options.TrackerTimerEnabled;
TrackerOptions.MsuMessageReceiverEnabled = options.MsuMessageReceiverEnabled;

TwitchIntegration.TwitchUserName = options.TwitchUserName;
TwitchIntegration.TwitchChannel = options.TwitchChannel;
Expand Down Expand Up @@ -107,6 +108,7 @@ public void UpdateOptions(GeneralOptions options)
options.TrackerHintsEnabled = TrackerOptions.TrackerHintsEnabled;
options.TrackerSpoilersEnabled = TrackerOptions.TrackerSpoilersEnabled;
options.TrackerTimerEnabled = TrackerOptions.TrackerTimerEnabled;
options.MsuMessageReceiverEnabled = TrackerOptions.MsuMessageReceiverEnabled;

options.TwitchUserName = TwitchIntegration.TwitchUserName;
options.TwitchChannel = TwitchIntegration.TwitchChannel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.7" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.10" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.7">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.10">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.2" />
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.4" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.Debug" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MattEqualsCoder.MSURandomizer.Library" Version="2.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageReference Include="MattEqualsCoder.MSURandomizer.Library" Version="3.0.0-rc.5" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,13 @@ private bool ApplyMsuOptions(RandomizerOptions options, string romPath)
return false;
}

if (!_msuLookupService.Msus.Any())
if (!_msuLookupService.Msus.Any() && !string.IsNullOrEmpty(options.GeneralOptions.MsuPath))
{
_msuLookupService.LookupMsus(options.GeneralOptions.MsuPath);
var smz3MsuType = _msuTypeService.GetSMZ3MsuType() ?? throw new InvalidOperationException();
_msuLookupService.LookupMsus(options.GeneralOptions.MsuPath, new Dictionary<string, string>()
{
{ options.GeneralOptions.MsuPath, smz3MsuType.DisplayName }
});
}

var romFileInfo = new FileInfo(romPath);
Expand Down
10 changes: 5 additions & 5 deletions src/TrackerCouncil.Smz3.Shared/TrackerCouncil.Smz3.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MattEqualsCoder.MSURandomizer.Library" Version="2.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.7">
<PackageReference Include="MattEqualsCoder.MSURandomizer.Library" Version="3.0.0-rc.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.10">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

<ItemGroup>
<PackageReference Include="NHyphenator" Version="2.0.0" />
<PackageReference Include="NJsonSchema" Version="11.0.1" />
<PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" />
<PackageReference Include="NJsonSchema" Version="11.0.2" />
<PackageReference Include="Serilog.Sinks.Debug" Version="3.0.0" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.21216.1" />
<PackageReference Include="YamlDotNet" Version="16.1.3" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ private void CheckZeldaState(SnesData data, SnesData? prevData)
Logger.LogDebug("{StateDetails}", zeldaState.ToString());
if (prevState == null) return;

AutoTracker.UpdateValidState(zeldaState.IsValid);

if (!_seenGTTorch
&& zeldaState is { CurrentRoom: 140, IsOnBottomHalfOfRoom: false, IsOnRightHalfOfRoom: false }
&& zeldaState.Substate != 14)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="BunLabs.Common" Version="1.0.4" />
<PackageReference Include="MattEqualsCoder.MSURandomizer.Library" Version="2.1.2" />
<PackageReference Include="MattEqualsCoder.MSURandomizer.Library" Version="3.0.0-rc.5" />
<PackageReference Include="NAudio.Wasapi" Version="2.2.1" />
<PackageReference Include="SharpHook" Version="5.3.8" />
<PackageReference Include="System.Speech" Version="8.0.0" />
Expand Down
Loading

0 comments on commit 889c9d6

Please sign in to comment.