Skip to content

Commit 8c2e918

Browse files
build: Upgrade to Buttplug FFI
1 parent 9435723 commit 8c2e918

File tree

9 files changed

+289
-244
lines changed

9 files changed

+289
-244
lines changed

NogasmChart/AboutWindow.xaml.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
using System.Diagnostics;
3-
using System.Reflection;
1+
using System.Diagnostics;
42
using System.Windows;
53
using System.Windows.Navigation;
64

NogasmChart/App.config

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,31 @@
77
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
88
<dependentAssembly>
99
<assemblyIdentity name="System.Reactive.Linq" publicKeyToken="94bc3704cddfc263" culture="neutral" />
10-
<bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" />
10+
<bindingRedirect oldVersion="0.0.0.0-3.0.6000.0" newVersion="3.0.6000.0" />
1111
</dependentAssembly>
1212
<dependentAssembly>
1313
<assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" />
14-
<bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" />
14+
<bindingRedirect oldVersion="0.0.0.0-3.0.6000.0" newVersion="3.0.6000.0" />
1515
</dependentAssembly>
1616
<dependentAssembly>
1717
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
18-
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
18+
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
1919
</dependentAssembly>
2020
<dependentAssembly>
2121
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
22-
<bindingRedirect oldVersion="0.0.0.0-1.8.5.0" newVersion="1.8.5.0" />
22+
<bindingRedirect oldVersion="0.0.0.0-1.8.10.0" newVersion="1.8.10.0" />
2323
</dependentAssembly>
2424
<dependentAssembly>
2525
<assemblyIdentity name="NJsonSchema" publicKeyToken="c2f9c3bdfae56102" culture="neutral" />
2626
<bindingRedirect oldVersion="0.0.0.0-10.2.2.0" newVersion="10.2.2.0" />
2727
</dependentAssembly>
2828
<dependentAssembly>
2929
<assemblyIdentity name="System.Threading.Tasks.Dataflow" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
30-
<bindingRedirect oldVersion="0.0.0.0-4.6.5.0" newVersion="4.6.5.0" />
30+
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
3131
</dependentAssembly>
3232
<dependentAssembly>
3333
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
34-
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
34+
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
3535
</dependentAssembly>
3636
<dependentAssembly>
3737
<assemblyIdentity name="Namotion.Reflection" publicKeyToken="c2f9c3bdfae56102" culture="neutral" />
@@ -43,7 +43,7 @@
4343
</dependentAssembly>
4444
<dependentAssembly>
4545
<assemblyIdentity name="deniszykov.WebSocketListener" publicKeyToken="7f78616efb4a208d" culture="neutral" />
46-
<bindingRedirect oldVersion="0.0.0.0-4.2.10.0" newVersion="4.2.10.0" />
46+
<bindingRedirect oldVersion="0.0.0.0-4.2.14.0" newVersion="4.2.14.0" />
4747
</dependentAssembly>
4848
<dependentAssembly>
4949
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
@@ -55,7 +55,15 @@
5555
</dependentAssembly>
5656
<dependentAssembly>
5757
<assemblyIdentity name="System.Text.Encoding.CodePages" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
58-
<bindingRedirect oldVersion="0.0.0.0-4.1.3.0" newVersion="4.1.3.0" />
58+
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
59+
</dependentAssembly>
60+
<dependentAssembly>
61+
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
62+
<bindingRedirect oldVersion="0.0.0.0-3.17.3.0" newVersion="3.17.3.0" />
63+
</dependentAssembly>
64+
<dependentAssembly>
65+
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
66+
<bindingRedirect oldVersion="0.0.0.0-5.0.0.2" newVersion="5.0.0.2" />
5967
</dependentAssembly>
6068
</assemblyBinding>
6169
</runtime>

NogasmChart/App.xaml.cs

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.IO;
4-
using System.Resources;
54
using System.Windows;
6-
using System.Windows.Threading;
7-
using System.Xml;
85
using Newtonsoft.Json;
96
using Sentry;
107

@@ -13,7 +10,7 @@ namespace NogasmChart
1310
/// <summary>
1411
/// Interaction logic for App.xaml
1512
/// </summary>
16-
public partial class App : Application
13+
public partial class App
1714
{
1815
protected override void OnStartup(StartupEventArgs e)
1916
{
@@ -32,21 +29,45 @@ void AppUnhandledException(object sender, UnhandledExceptionEventArgs e)
3229
{
3330
using (Stream stream = GetType().Assembly.GetManifestResourceStream("NogasmChart.secrets.json"))
3431
{
35-
using (var reader = new StreamReader(stream))
32+
using (var reader = new StreamReader(stream ?? throw new InvalidOperationException()))
3633
{
3734
var res = JsonConvert.DeserializeObject<Dictionary<String, String>>(reader.ReadToEnd());
3835
res.TryGetValue("sentryUrl", out sentryUrl);
3936
}
4037
}
4138
}
42-
catch (Exception e1)
39+
catch (ArgumentException e1)
40+
{
41+
Console.WriteLine(e1.Message);
42+
}
43+
catch (JsonException e1)
44+
{
45+
Console.WriteLine(e1.Message);
46+
}
47+
catch (FileLoadException e1)
48+
{
49+
Console.WriteLine(e1.Message);
50+
}
51+
catch (FileNotFoundException e1)
52+
{
53+
Console.WriteLine(e1.Message);
54+
}
55+
catch (BadImageFormatException e1)
56+
{
57+
Console.WriteLine(e1.Message);
58+
}
59+
catch (NotImplementedException e1)
60+
{
61+
Console.WriteLine(e1.Message);
62+
}
63+
catch (InvalidOperationException e1)
4364
{
4465
Console.WriteLine(e1.Message);
4566
}
4667

47-
if (sentryUrl.Length == 0 || MessageBox.Show(
48-
"A crash was detected! We'd like to send a crash report to the developers, but since this could contain sensitive information, we need your permission. Click yes send the report.",
49-
"Crash detected", MessageBoxButton.YesNo, MessageBoxImage.Error) != MessageBoxResult.Yes) return;
68+
if (sentryUrl == null || sentryUrl.Length == 0 || MessageBox.Show(
69+
"A crash was detected! We'd like to send a crash report to the developers, but since this could contain sensitive information, we need your permission. Click yes send the report.",
70+
"Crash detected", MessageBoxButton.YesNo, MessageBoxImage.Error) != MessageBoxResult.Yes) return;
5071
using (SentrySdk.Init(sentryUrl))
5172
{
5273
SentrySdk.CaptureException(e.ExceptionObject as Exception);

NogasmChart/ButtplugPanel.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6-
xmlns:local="clr-namespace:NogasmChart"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
76
mc:Ignorable="d"
87
d:DesignHeight="450" d:DesignWidth="800" Padding="5px">
98
<Grid>
@@ -22,16 +21,17 @@
2221
<ColumnDefinition Width="auto"/>
2322
<ColumnDefinition Width="*"/>
2423
<ColumnDefinition Width="Auto"/>
24+
<ColumnDefinition Width="Auto"/>
2525
</Grid.ColumnDefinitions>
2626
<Label Grid.Column="0" Grid.Row="0">Connection Mode:</Label>
2727
<ComboBox Grid.Column="0" Grid.Row="1" Name="ButtplugConnType" SelectionChanged="ButtplugConnType_SelectionChanged">
2828
<ComboBoxItem Content="WebSocket"/>
2929
<ComboBoxItem Content="Embedded"/>
30-
<ComboBoxItem Content="IPC"/>
3130
</ComboBox>
32-
<Label Grid.Column="1" Grid.Row="0">URL or Pipe Name:</Label>
31+
<Label Grid.Column="1" Grid.Row="0">URL:</Label>
3332
<TextBox Grid.Column="1" Grid.Row="1" Name="ButtplugTarget"/>
3433
<Button Grid.Column="2" Grid.Row="1" Content="Connect" Name="Connect" Click="Connect_Click"/>
34+
<Button Grid.Column="3" Grid.Row="1" Content="Scan for devices" Name="Scan" Click="Scan_Click"/>
3535
</Grid>
3636
</GroupBox>
3737
<Label Grid.Row="1">Devices:</Label>

0 commit comments

Comments
 (0)