Skip to content

Commit

Permalink
integrate SteelSeries Server
Browse files Browse the repository at this point in the history
  • Loading branch information
gyorokpeter committed Jun 12, 2022
1 parent 63a7fad commit 768d7cc
Show file tree
Hide file tree
Showing 17 changed files with 179 additions and 11 deletions.
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "SBAuroraR.NET"]
path = SBAuroraR.NET
url = https://github.com/rajkosto/SBAuroraR.NET.git
url = https://github.com/rajkosto/SBAuroraR.NET.git
[submodule "SteelSeriesServer"]
path = SteelSeriesServer
url = https://github.com/gyorokpeter/SteelSeriesServer.git
2 changes: 1 addition & 1 deletion Project-Aurora/Aurora-Updater/Aurora-Updater.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

<ItemGroup>
<PackageReference Include="Newtonsoft.Json">
<Version>12.0.3</Version>
<Version>13.0.1</Version>
</PackageReference>
<PackageReference Include="Octokit">
<Version>0.47.0</Version>
Expand Down
7 changes: 7 additions & 0 deletions Project-Aurora/Project-Aurora.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Project-Aurora", "Project-A
{A759300D-9550-47BA-8616-C24B6BC05A02} = {A759300D-9550-47BA-8616-C24B6BC05A02}
{40085232-ACED-4CBE-945B-90BA8153C151} = {40085232-ACED-4CBE-945B-90BA8153C151}
{004D1E3E-F20E-4ECA-ABB1-467D1CE2C173} = {004D1E3E-F20E-4ECA-ABB1-467D1CE2C173}
{87555B4B-E379-4ACC-9899-CAD4CCA227CA} = {87555B4B-E379-4ACC-9899-CAD4CCA227CA}
{20259BE1-55C9-4EFB-9D30-C933F621B9D4} = {20259BE1-55C9-4EFB-9D30-C933F621B9D4}
EndProjectSection
EndProject
Expand All @@ -27,6 +28,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Plugin-Example", "Plugin-Ex
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SBAuroraReactive", "..\SBAuroraR.NET\SBAuroraReactive\SBAuroraReactive.vcxproj", "{053A704B-5C79-4CDE-B1FC-B952051ACAA0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SteelSeriesServer", "..\SteelSeriesServer\SteelSeriesServer.csproj", "{87555B4B-E379-4ACC-9899-CAD4CCA227CA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand Down Expand Up @@ -65,6 +68,10 @@ Global
{053A704B-5C79-4CDE-B1FC-B952051ACAA0}.Debug|x64.Build.0 = Debug|x64
{053A704B-5C79-4CDE-B1FC-B952051ACAA0}.Release|x64.ActiveCfg = Release|x64
{053A704B-5C79-4CDE-B1FC-B952051ACAA0}.Release|x64.Build.0 = Release|x64
{87555B4B-E379-4ACC-9899-CAD4CCA227CA}.Debug|x64.ActiveCfg = Debug|Any CPU
{87555B4B-E379-4ACC-9899-CAD4CCA227CA}.Debug|x64.Build.0 = Debug|Any CPU
{87555B4B-E379-4ACC-9899-CAD4CCA227CA}.Release|x64.ActiveCfg = Release|Any CPU
{87555B4B-E379-4ACC-9899-CAD4CCA227CA}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
6 changes: 6 additions & 0 deletions Project-Aurora/Project-Aurora/ConfigUI.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ private void CtrlLayerManager_ProfileOverviewRequest(UserControl profile_control
SelectedControl = profile_control;
}

internal void GoToSteelSeriesPage()
{
DesktopControl_MouseLeftButtonDown(null, null);
settingsControl.tabMain.SelectedIndex = settingsControl.tabMain.Items.IndexOf(settingsControl.devicesAndWrappersPage);
}

private void Layer_manager_NewLayer(Layer layer)
{
layerPresenter.Layer = layer;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Aurora.Settings.Layers;

namespace Aurora.Profiles.Cardaclysm
{
public class Cardaclysm : Application
{
public Cardaclysm() : base(new LightEventConfig {
Name = "Cardaclysm",
ID = "Cardaclysm",
ProcessNames = new[] { "cardaclysm.exe" },
ProfileType = typeof(WrapperProfile),
OverviewControlType = typeof(Control_Cardaclysm),
GameStateType = typeof(GameState_Wrapper),
Event = new GameEvent_Generic(),
IconURI = "Resources/cardaclysm_64x64.png"
})
{
AllowLayer<WrapperLightsLayerHandler>();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Aurora.Profiles.Cardaclysm"
xmlns:EnumDeviceKeys="clr-namespace:Aurora.Devices"
xmlns:EnumPercentEffectType="clr-namespace:Aurora.Settings"
xmlns:EnumValueConverters="clr-namespace:Aurora.Utils"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:Controls="clr-namespace:Aurora.Controls" x:Class="Aurora.Profiles.Cardaclysm.Control_Cardaclysm"
mc:Ignorable="d"
d:DesignHeight="300" Height="Auto" Width="Auto" d:DesignWidth="850" >
<Grid>
<TabControl>
<TabItem Header="Overview for Cardaclysm">
<Grid>
<StackPanel>
<CheckBox x:Name="game_enabled" Content="Enable Aurora to provide lighting effects with Cardaclysm" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Checked="game_enabled_Checked" Unchecked="game_enabled_Checked"/>
<TextBlock Margin="10,10,64,0" VerticalAlignment="Top" TextWrapping="Wrap"><Run Text="To enable Cardaclysm support, you need to start the SteelSeries Server which will allow receiving lighting information from all games that support SteelSeries GameSense, including Cardaclysm."/></TextBlock>
<Button x:Name="go_to_steelseries" Content="Go to SteelSeries Configuration" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Click="go_to_steelseries_Click"/>
</StackPanel>
</Grid>
</TabItem>
</TabControl>
</Grid>
</UserControl>
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using Aurora.Settings;
using System;
using System.IO;
using System.Windows;
using System.Windows.Controls;

namespace Aurora.Profiles.Cardaclysm
{
/// <summary>
/// Interaction logic for Control_Cardaclysm.xaml
/// </summary>
public partial class Control_Cardaclysm : UserControl
{
private Application profile_manager;

public Control_Cardaclysm(Application profile)
{
InitializeComponent();

profile_manager = profile;

SetSettings();
}

private void SetSettings()
{
this.game_enabled.IsChecked = profile_manager.Settings.IsEnabled;
}

private void game_enabled_Checked(object sender, RoutedEventArgs e)
{
if (IsLoaded)
{
profile_manager.Settings.IsEnabled = (this.game_enabled.IsChecked.HasValue) ? this.game_enabled.IsChecked.Value : false;
profile_manager.SaveProfiles();
}
}

private void go_to_steelseries_Click(object sender, RoutedEventArgs e)
{
var mainWindow = (ConfigUI)System.Windows.Application.Current.MainWindow;
mainWindow.GoToSteelSeriesPage();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
<Grid>
<StackPanel>
<CheckBox x:Name="game_enabled" Content="Enable Aurora to provide lighting effects with Factorio" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Checked="game_enabled_Checked" Unchecked="game_enabled_Checked"/>
<TextBlock Margin="10,10,64,0" VerticalAlignment="Top" TextWrapping="Wrap"><Run Text="In order for Factorio support to work, you have to apply the Aurora Wrapper Patch for Razer in order for Aurora to receive lighting information. Press the &quot;Patch Factorio&quot; button to install automatically to the detected game directory. To choose manually press the &quot;Patch "/><Run Text="Factorio "/><Run Text="Manually&quot; button and navigate to the "/><Run Text="Factorio "/><Run Text="install directory. This should not trigger any anti-cheat, but it should be used at your own risk. P.S. You can actually apply this patch to any Razer Chroma supported game, and Aurora will work with it."/></TextBlock>
<TextBlock Margin="10,10,64,0" VerticalAlignment="Top" TextWrapping="Wrap"><Run Text="There are two ways to enable Factorio support:"/></TextBlock>
<TextBlock Margin="10,10,64,0" VerticalAlignment="Top" TextWrapping="Wrap"><Run Text="1. Apply the Aurora Wrapper Patch for Razer in order for Aurora to receive lighting information. Press the &quot;Patch Factorio&quot; button to install automatically to the detected game directory. To choose manually press the &quot;Patch "/><Run Text="Factorio "/><Run Text="Manually&quot; button and navigate to the "/><Run Text="Factorio "/><Run Text="install directory. This should not trigger any anti-cheat, but it should be used at your own risk. P.S. You can actually apply this patch to any Razer Chroma supported game, and Aurora will work with it."/></TextBlock>
<StackPanel Orientation="Horizontal" Margin="10,10,0,0">
<Button x:Name="patch_button" Content="Patch Factorio" HorizontalAlignment="Left" VerticalAlignment="Top" Click="patch_button_Click"/>
<Button x:Name="patch_button_manually" Content="Patch Factorio Manually" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top" Click="patch_button_manually_Click"/>
</StackPanel>
<Button x:Name="unpatch_button" Content="Unpatch Factorio" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Click="unpatch_button_Click"/>
<TextBlock Margin="10,10,64,0" VerticalAlignment="Top" TextWrapping="Wrap"><Run Text="2. Start the SteelSeries Server which will allow receiving lighting information from all games that support SteelSeries GameSense, including Factorio."/></TextBlock>
<Button x:Name="go_to_steelseries" Content="Go to SteelSeries Configuration" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Click="go_to_steelseries_Click"/>
</StackPanel>
</Grid>
</TabItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Aurora.Profiles.Factorio
{
/// <summary>
/// Interaction logic for Control_Overwatch.xaml
/// Interaction logic for Control_Factorio.xaml
/// </summary>
public partial class Control_Factorio : UserControl
{
Expand Down Expand Up @@ -115,5 +115,11 @@ private void game_enabled_Checked(object sender, RoutedEventArgs e)
profile_manager.SaveProfiles();
}
}

private void go_to_steelseries_Click(object sender, RoutedEventArgs e)
{
var mainWindow = (ConfigUI)System.Windows.Application.Current.MainWindow;
mainWindow.GoToSteelSeriesPage();
}
}
}
5 changes: 3 additions & 2 deletions Project-Aurora/Project-Aurora/Project-Aurora.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">

<PropertyGroup>
<TargetFramework>net48</TargetFramework>
Expand Down Expand Up @@ -72,7 +72,7 @@
<PackageReference Include="LibreHardwareMonitorLib" Version="0.8.5" />
<PackageReference Include="MouseKeyHook" Version="5.6.0" />
<PackageReference Include="NAudio" Version="1.10.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NLog" Version="4.7.0" />
<PackageReference Include="Octokit" Version="0.47.0" />
<PackageReference Include="OpenRGB.NET" Version="1.2.0" />
Expand All @@ -95,6 +95,7 @@
<ProjectReference Include="..\..\SBAuroraR.NET\SBAuroraReactive\SBAuroraReactive.vcxproj">
<Private>false</Private>
</ProjectReference>
<ProjectReference Include="..\..\SteelSeriesServer\SteelSeriesServer.csproj" />
<ProjectReference Include="..\ColorBox\ColorBox.csproj" />
</ItemGroup>

Expand Down
10 changes: 10 additions & 0 deletions Project-Aurora/Project-Aurora/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Project-Aurora/Project-Aurora/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -289,4 +289,7 @@
<data name="icons8_folder_30" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-folder-30.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="cardaclysm_64x64" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\cardaclysm_64x64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Project-Aurora/Project-Aurora/Settings/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ public class Configuration : INotifyPropertyChanged
[JsonProperty("allow_peripheral_devices")] public bool AllowPeripheralDevices { get; set; } = true;
[JsonProperty("allow_wrappers_in_background")] public bool AllowWrappersInBackground { get; set; } = true;
[JsonProperty("allow_all_logitech_bitmaps")] public bool AllowAllLogitechBitmaps { get; set; } = true;
[JsonProperty("auto_start_steelseries_server")] public bool AutoStartSteelSeriesServer { get; set; } = false;

[JsonProperty("use_volume_as_brightness")] public bool UseVolumeAsBrightness { get; set; } = false;
[JsonProperty("global_brightness")] public float GlobalBrightness { get; set; } = 1.0f;
Expand Down
16 changes: 11 additions & 5 deletions Project-Aurora/Project-Aurora/Settings/Control_Settings.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
<TextBlock Text="seconds" Margin="160,170,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"/>
</Grid>
</TabItem>
<TabItem Header="Devices &amp; Wrappers">
<TabItem x:Name="devicesAndWrappersPage" Header="Devices &amp; Wrappers">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
Expand Down Expand Up @@ -201,10 +201,16 @@
<GroupBox Header="Wrappers">
<StackPanel Orientation="Vertical">
<TextBlock TextWrapping="Wrap" Margin="4" Text="Wrappers are not needed for Aurora to connect to your RGB devices. Only use these if you know what you're doing, otherwise you could cause issues in games or other applications! Read the wiki for more information."/>
<Button Content="Patch for LightFX (32 bit)" Margin="4" Width="200" Click="wrapper_install_lightfx_32_Click"/>
<Button Content="Patch for LightFX (64 bit)" Margin="4" Width="200" Click="wrapper_install_lightfx_64_Click"/>
<Button Content="Patch for Logitech" Margin="4" Width="200" Click="wrapper_install_logitech_Click"/>
<Button Content="Patch for Razer (Legacy, deprecated)" Margin="4" Width="200" Click="wrapper_install_razer_Click"/>
<Button Content="Patch for LightFX (32 bit)" Margin="2" Width="200" Click="wrapper_install_lightfx_32_Click"/>
<Button Content="Patch for LightFX (64 bit)" Margin="2" Width="200" Click="wrapper_install_lightfx_64_Click"/>
<Button Content="Patch for Logitech" Margin="2" Width="200" Click="wrapper_install_logitech_Click"/>
<Button Content="Patch for Razer (Legacy, deprecated)" Margin="2" Width="200" Click="wrapper_install_razer_Click"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock Text="SteelSeries Server:" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<Button Content="Start" Margin="2" Width="50" Click="wrapper_install_steelseries_Click"/>
<Button Content="Stop" Margin="2" Width="50" Click="wrapper_uninstall_steelseries_Click"/>
<CheckBox x:Name="auto_start_steelseries_server" Content="Auto start" IsChecked="{Binding AutoStartSteelSeriesServer}" Checked="ResetDevices" Unchecked="ResetDevices" VerticalAlignment="Center" />
</StackPanel>
</StackPanel>
</GroupBox>
</StackPanel>
Expand Down
28 changes: 28 additions & 0 deletions Project-Aurora/Project-Aurora/Settings/Control_Settings.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using Aurora.Devices.Asus.Config;
using Aurora.Utils;
using System.Globalization;
using SteelSeriesServer;

namespace Aurora.Settings
{
Expand All @@ -31,6 +32,7 @@ public partial class Control_Settings : UserControl
{
private RegistryKey runRegistryPath = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
private const string StartupTaskID = "AuroraStartup";
private SteelSeriesServer.SteelSeriesServer steelSeriesServer;

public Control_Settings()
{
Expand Down Expand Up @@ -93,6 +95,8 @@ public Control_Settings()
this.razer_wrapper_installed_version_label.Content = rzVersion.ToString();
this.razer_wrapper_installed_version_label.Foreground = new SolidColorBrush(RzHelper.IsSdkVersionSupported(rzVersion) ? Colors.LightGreen : Colors.PaleVioletRed);
this.razer_wrapper_supported_versions_label.Content = $"[{RzHelper.SupportedFromVersion}-{RzHelper.SupportedToVersion}]";
if (auto_start_steelseries_server.IsChecked == true)
StartSteelSeriesServer();

if (rzVersion == new RzSdkVersion())
this.razer_wrapper_uninstall_button.Visibility = Visibility.Hidden;
Expand Down Expand Up @@ -453,5 +457,29 @@ private void btnDumpSensors_Click(object sender, RoutedEventArgs e)
else
System.Windows.MessageBox.Show("Error dumping file. Consult log for details.");
}

private void StartSteelSeriesServer()
{
if (steelSeriesServer == null)
{
AuroraSender auroraSender = new AuroraSender();
steelSeriesServer = new SteelSeriesServer.SteelSeriesServer(auroraSender);
steelSeriesServer.Start();
}
}

private void wrapper_install_steelseries_Click(object sender, RoutedEventArgs e)
{
StartSteelSeriesServer();
}

private void wrapper_uninstall_steelseries_Click(object sender, RoutedEventArgs e)
{
if (steelSeriesServer != null)
{
steelSeriesServer.Stop();
steelSeriesServer = null;
}
}
}
}
1 change: 1 addition & 0 deletions SteelSeriesServer
Submodule SteelSeriesServer added at 47f474

0 comments on commit 768d7cc

Please sign in to comment.