From afc4e2b3d40f2a85cf80e250cd9e333111b243f3 Mon Sep 17 00:00:00 2001 From: Taiizor <41683699+Taiizor@users.noreply.github.com> Date: Mon, 18 Sep 2023 03:36:02 +0300 Subject: [PATCH] Preparing Performance Setting Page --- .../Sucrose.Manager/Manage/Internal.cs | 4 + src/Library/Sucrose.Memory/Readonly.cs | 4 + src/Project/Sucrose.Backgroundog/App.cs | 59 ++++++++++ src/Project/Sucrose.Backgroundog/App.manifest | 81 ++++++++++++++ .../Sucrose.Backgroundog/App.net48.config | 6 ++ .../Sucrose.Backgroundog/App.net481.config | 6 ++ .../App.net6.0-windows.config | 3 + .../App.net7.0-windows.config | 3 + .../App.net8.0-windows.config | 3 + .../Sucrose.Backgroundog/Assets/ICO.ico | Bin 0 -> 16958 bytes .../Sucrose.Backgroundog/Manage/Internal.cs | 7 ++ .../Sucrose.Backgroundog/Manage/Manager.cs | 9 ++ .../Sucrose.Backgroundog.csproj | 101 ++++++++++++++++++ src/Project/Sucrose.Commandog/App.cs | 7 +- .../Sucrose.Commandog/Helper/Arguments.cs | 3 + .../Enum/CommandsType.cs | 3 +- .../Sucrose.Shared.Launcher/Command/Close.cs | 5 + src/Shared/Sucrose.Shared.Live/Helper/Run.cs | 2 + .../Services/BackgroundogServerService.cs | 20 ++++ .../Services/LauncherServerService.cs | 10 +- .../Sucrose.Shared.Server.projitems | 1 + .../Sucrose.Shared.Space/Manage/Internal.cs | 2 + src/Shared/Sucrose.Shared.Watchdog/Watch.cs | 2 + src/Sucrose.sln | 35 ++++-- .../Services/BackgroundogClientService.cs | 16 +++ .../Proto/Backgroundog.proto | 14 +++ .../Sucrose.Grpc.Common.csproj | 5 +- 27 files changed, 394 insertions(+), 17 deletions(-) create mode 100644 src/Project/Sucrose.Backgroundog/App.cs create mode 100644 src/Project/Sucrose.Backgroundog/App.manifest create mode 100644 src/Project/Sucrose.Backgroundog/App.net48.config create mode 100644 src/Project/Sucrose.Backgroundog/App.net481.config create mode 100644 src/Project/Sucrose.Backgroundog/App.net6.0-windows.config create mode 100644 src/Project/Sucrose.Backgroundog/App.net7.0-windows.config create mode 100644 src/Project/Sucrose.Backgroundog/App.net8.0-windows.config create mode 100644 src/Project/Sucrose.Backgroundog/Assets/ICO.ico create mode 100644 src/Project/Sucrose.Backgroundog/Manage/Internal.cs create mode 100644 src/Project/Sucrose.Backgroundog/Manage/Manager.cs create mode 100644 src/Project/Sucrose.Backgroundog/Sucrose.Backgroundog.csproj create mode 100644 src/Shared/Sucrose.Shared.Server/Services/BackgroundogServerService.cs create mode 100644 src/gRPC/Sucrose.Grpc.Client/Services/BackgroundogClientService.cs create mode 100644 src/gRPC/Sucrose.Grpc.Common/Proto/Backgroundog.proto diff --git a/src/Library/Sucrose.Manager/Manage/Internal.cs b/src/Library/Sucrose.Manager/Manage/Internal.cs index b03331577..737fba350 100644 --- a/src/Library/Sucrose.Manager/Manage/Internal.cs +++ b/src/Library/Sucrose.Manager/Manage/Internal.cs @@ -47,6 +47,10 @@ public static class Internal public static readonly SMLM CefSharpLiveLogManager = new("CefSharpLive-{0}.log"); + public static readonly SMLM BackgroundogLogManager = new("Backgroundog-{0}.log"); + + public static readonly SMSM BackgroundogSettingManager = new("Backgroundog.json"); + public static readonly SMLM MpvPlayerLiveLogManager = new("MpvPlayerLive-{0}.log"); } } \ No newline at end of file diff --git a/src/Library/Sucrose.Memory/Readonly.cs b/src/Library/Sucrose.Memory/Readonly.cs index 013c7539d..bf70fa092 100644 --- a/src/Library/Sucrose.Memory/Readonly.cs +++ b/src/Library/Sucrose.Memory/Readonly.cs @@ -78,6 +78,8 @@ public static class Readonly public static readonly string ValueSeparator = $"{ValueSeparatorChar}"; + public static readonly string Backgroundog = "Sucrose.Backgroundog.exe"; + public static readonly string LogDescription = "SucroseWatchdog Thread"; public static readonly string DiscordApplication = "1126294965950103612"; @@ -108,6 +110,8 @@ public static class Readonly public static readonly string KeyYouTube = $"https://www.youtube.com/watch?v=kRyML8axJxA"; + public static readonly string BackgroundogMutex = "{Sucrose-Wallpaper-Engine-Backgroundog}"; + public static readonly string WikiWebsite = $"https://github.com/{Owner}/{Repository}/wiki"; public static readonly string StoreWebsite = $"https://github.com/{Owner}/{StoreRepository}"; diff --git a/src/Project/Sucrose.Backgroundog/App.cs b/src/Project/Sucrose.Backgroundog/App.cs new file mode 100644 index 000000000..285b42a65 --- /dev/null +++ b/src/Project/Sucrose.Backgroundog/App.cs @@ -0,0 +1,59 @@ +using System.Globalization; +using SBMM = Sucrose.Backgroundog.Manage.Manager; +using SGCB = Sucrose.Grpc.Common.Backgroundog; +using SGSGSS = Sucrose.Grpc.Services.GeneralServerService; +using SHC = Skylark.Helper.Culture; +using SMC = Sucrose.Memory.Constant; +using SMMI = Sucrose.Manager.Manage.Internal; +using SMMM = Sucrose.Manager.Manage.Manager; +using SMR = Sucrose.Memory.Readonly; +using SSSHP = Sucrose.Shared.Space.Helper.Processor; +using SSSSBSS = Sucrose.Shared.Server.Services.BackgroundogServerService; +using SSWW = Sucrose.Shared.Watchdog.Watch; + +namespace Sucrose.Backgroundog +{ + internal class App + { + internal static void Main() + { + try + { + SHC.All = new CultureInfo(SMMM.Culture, true); + + if (SBMM.Mutex.WaitOne(TimeSpan.Zero, true) && SSSHP.WorkCount(SMR.Backgroundog) <= 1) + { + Console.WriteLine("Start"); + + SGSGSS.ServerCreate(SGCB.BindService(new SSSSBSS())); + + SMMI.BackgroundogSettingManager.SetSetting(SMC.Host, SGSGSS.Host); + SMMI.BackgroundogSettingManager.SetSetting(SMC.Port, SGSGSS.Port); + + SGSGSS.ServerInstance.Start(); + + Console.ReadKey(); + + SGSGSS.ServerInstance.KillAsync().Wait(); + //SGSGSS.ServerInstance.ShutdownAsync().Wait(); + + Console.WriteLine("Stop"); + } + } + catch (Exception Exception) + { + SSWW.Watch_CatchException(Exception); + } + finally + { + Close(); + } + } + + protected static void Close() + { + Environment.Exit(0); + Application.Exit(); + } + } +} \ No newline at end of file diff --git a/src/Project/Sucrose.Backgroundog/App.manifest b/src/Project/Sucrose.Backgroundog/App.manifest new file mode 100644 index 000000000..6fad7e2af --- /dev/null +++ b/src/Project/Sucrose.Backgroundog/App.manifest @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true/PM + PerMonitorV2, PerMonitor + + + + + + + + \ No newline at end of file diff --git a/src/Project/Sucrose.Backgroundog/App.net48.config b/src/Project/Sucrose.Backgroundog/App.net48.config new file mode 100644 index 000000000..49a002181 --- /dev/null +++ b/src/Project/Sucrose.Backgroundog/App.net48.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/Project/Sucrose.Backgroundog/App.net481.config b/src/Project/Sucrose.Backgroundog/App.net481.config new file mode 100644 index 000000000..a410199fe --- /dev/null +++ b/src/Project/Sucrose.Backgroundog/App.net481.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/Project/Sucrose.Backgroundog/App.net6.0-windows.config b/src/Project/Sucrose.Backgroundog/App.net6.0-windows.config new file mode 100644 index 000000000..99ddf3e08 --- /dev/null +++ b/src/Project/Sucrose.Backgroundog/App.net6.0-windows.config @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/Project/Sucrose.Backgroundog/App.net7.0-windows.config b/src/Project/Sucrose.Backgroundog/App.net7.0-windows.config new file mode 100644 index 000000000..99ddf3e08 --- /dev/null +++ b/src/Project/Sucrose.Backgroundog/App.net7.0-windows.config @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/Project/Sucrose.Backgroundog/App.net8.0-windows.config b/src/Project/Sucrose.Backgroundog/App.net8.0-windows.config new file mode 100644 index 000000000..99ddf3e08 --- /dev/null +++ b/src/Project/Sucrose.Backgroundog/App.net8.0-windows.config @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/Project/Sucrose.Backgroundog/Assets/ICO.ico b/src/Project/Sucrose.Backgroundog/Assets/ICO.ico new file mode 100644 index 0000000000000000000000000000000000000000..9745cea10172e6de548a517d77a1f256cdeafb50 GIT binary patch literal 16958 zcmeI4X>3&28HTU132IVWq@X0NiVBLV;righ&NiL$JXc<2@$e7<)Evc$1egChXmr&pCG)2_z{DfA;K=@O!7Ed0CR4lO#z4uuIATykGv=<1Cc?ZSE_Q zz_&o8ifGW*R-mLxKy`5+z{_A9Osm8g+Sv^P>a&t3aUZ}gFbYT|hSARVfs!f#)zynW zbPUKD#G^kCRPg6E4wwwZlDU85{W&xq2e1X~2WD`;x4(F$x4)E}lsJ0(13{c$yn;IK z0X>KV+*Uy2wO%LjSb#9}>p62@@lS6LfB4%;OWm32nUkd;oWail=77)s_i*gbfa3j8yFzvV-veX7*EukXW4{a3?ylnP zu><%H7zV!j58~M8f#Us9yFzvVe*4eCAE?${gYl{a!u5tLJ9_lhzv%9%`lS-w>aKdl z+*|jD$*GRXDa&;`Sp5p@ICk9JTl;&o|B4cQ;5yi;M}K8UcTaUVSj*L5tdZc%JP(e7 zQScw|UjfPCUfmJY+qNq4`ky@6Ey(b;*spYXXXYmL_Ib=;L;cxvVoEQgw6lAC;}aiyngbi|&+}c$Iq&W* zKHvSUlkhy{o`LK?{rOGJ^jzoUo!L$Yuqg%VwYze6uFDQ=8^O%%r#4f6z5SMyJ=e+d+z|Pn3z(rPy-^|6wg#sC1MqTqHF) zJzq(050=wg#!^?N@i|hTkf1TfCs;bu5*;V2GOUT_Y)UdIL!u#zUT;gKy$wk+amXNV zu*h1zaM1xsEz00u2>)a7cVQaakp}n!3o;;NU=PI%eDOyH6sj5c>L02Z_~Rdn8TjiT zY8eFLA4(Yn>K`f@1mhnH83gP9b;NcqEh}!XP`CZ(6ONsDjYdY zT4T;58RXtBvX(6d|E%oA-*Te6c@Pq6`|2)^3nl{|cc*(Z{F|NQkA3{! z#qUh}K2D{Ke+jFb(EjYw$<#5nQHj+s{xIFFd2AqcYWXF z_s?A2;nkMRL>p&p0Nu_ERswx*T=O@Su=^_9sV*vdx-L38D1XkupLyVmdtOuKYFn1p z=`Pk}kQvDS1Lck~r@I~Q1b0RJea(Qc^H~E0RCBj!ZO*%oyGM5gGANs?bbN3jf3+qq zMz|~L?`sC>z4>%{{GW7U_|!w+vGAOSyX}#27w)1AWFFw!Sylg@RrlA|;U2}_0>#EZ znCpSh?(P{h7Jc>g0PfWd?^(N3lI%?}vBF!Fe)}5};>i^6L^!*b{#+0IcK0WPFWve6 zp+}#aVgvVQZzI}nNj*dtGvB1@jBL88O_sB8_vg>PWWetEzRY>y>|Tns;AtMXxbyu( zkNyYh&+csp)97zS=SlNX4{fi#O)u08(C%~XRGjxN>h}EH^tcRU_eOcW+xa+88Tz!( zJ%dGjr|Ra;^#nTpJmwwAsr0K4u2Fd7ByDP%Lg^%|$wJT84bkyqB^d8`j}D$PP|RKA z&Kaa?ZB>m$%N28#c3$s1=Xu;khJpI?TF-j-3_aC$mm-*E3q>FY0cY@o%X(@^&-66| zN4^r{F5E@Q8KfoKT2AM#Ad83GgBky>BrUyEYo@S%qKIBQMHrVU;*)ubz&sEcJf)kU z6PN?$_ycQsi`+%Y^WbKBlKsrtG;3?NHn=%2oIRA@=3yY?&vXAe*8Pv#CMj$H{+t2R z=b(ri_tyM*O{AVY`&fUG14@U>w%5FrJ|+-kKwSJVc-Y%D)4K~Wnmv#g7=eqeGpv!oJ{&b<8c62V% zR?`Y?Gd!Rl*YsiDmr{3P;)cv=U%bUJ!T56>JP&%{S)2KHI&<_Soy#qt_Jiq9^qd#& zTn6he>f*V;_c?~23&s8?y;REoN%!>DzsLCVcYiy3FN>%bVWgbMJtG{?sBde`x|>tbS_7VhF7g1}Y6cNshvz6tocz}Lo*0REb`efxI7 z`xzpVI`;1u+7eL?{(}JQeWYxcq;TFZ%1KGu!k-t?aqe6?>ozH{}1Tir;q>u literal 0 HcmV?d00001 diff --git a/src/Project/Sucrose.Backgroundog/Manage/Internal.cs b/src/Project/Sucrose.Backgroundog/Manage/Internal.cs new file mode 100644 index 000000000..ae10bcfa4 --- /dev/null +++ b/src/Project/Sucrose.Backgroundog/Manage/Internal.cs @@ -0,0 +1,7 @@ +namespace Sucrose.Backgroundog.Manage +{ + internal static class Internal + { + public static bool State = true; + } +} \ No newline at end of file diff --git a/src/Project/Sucrose.Backgroundog/Manage/Manager.cs b/src/Project/Sucrose.Backgroundog/Manage/Manager.cs new file mode 100644 index 000000000..1ba44919a --- /dev/null +++ b/src/Project/Sucrose.Backgroundog/Manage/Manager.cs @@ -0,0 +1,9 @@ +using SMR = Sucrose.Memory.Readonly; + +namespace Sucrose.Backgroundog.Manage +{ + internal static class Manager + { + public static Mutex Mutex => new(true, SMR.BackgroundogMutex); + } +} \ No newline at end of file diff --git a/src/Project/Sucrose.Backgroundog/Sucrose.Backgroundog.csproj b/src/Project/Sucrose.Backgroundog/Sucrose.Backgroundog.csproj new file mode 100644 index 000000000..f1f1427e0 --- /dev/null +++ b/src/Project/Sucrose.Backgroundog/Sucrose.Backgroundog.csproj @@ -0,0 +1,101 @@ + + + + Exe + net48;net481;net6.0-windows;net7.0-windows;net8.0-windows + Assets\ICO.ico + Sucrose.Backgroundog.App + enable + disable + Taiizor + Sucrose Wallpaper Engine + $(Title) + $(Title) + $(Version) + $(Version) + $(Version) + $([System.DateTime]::Today.ToString(yy)).$([System.DateTime]::Today.ToString(MM)).$([System.DateTime]::Today.ToString(dd)) + Sucrose.Backgroundog + $(AssemblyName) + true + true + preview + preview + AnyCPU;ARM64;x64;x86 + $(DefineConstants);BACKGROUNDOG + Copyright © $([System.DateTime]::Today.ToString(yyyy)) $(Company) + false + false + true + false + App.manifest + ..\..\Sucrose\Backgroundog\$(Platform) + + + + true + true + true + 1 + 100 + + true + false + + + + win-x86 + false + $(DefineConstants);X86 + + + + win-x64 + false + $(DefineConstants);X64 + + + + win-arm64 + false + $(DefineConstants);ARM64 + + + + + $(AssemblyName).exe.config + + + + + + + + + + + + + + + + + + + + + + + + $(OutputPath)\$(TargetFramework)\win-$(Platform) + ..\..\Sucrose\Package\$(TargetFramework)\$(Platform)\$(AssemblyName)\ + + + + + + + + + + \ No newline at end of file diff --git a/src/Project/Sucrose.Commandog/App.cs b/src/Project/Sucrose.Commandog/App.cs index abf46be78..d290da7f1 100644 --- a/src/Project/Sucrose.Commandog/App.cs +++ b/src/Project/Sucrose.Commandog/App.cs @@ -1,4 +1,7 @@ -using SCHA = Sucrose.Commandog.Helper.Arguments; +using System.Globalization; +using SCHA = Sucrose.Commandog.Helper.Arguments; +using SHC = Skylark.Helper.Culture; +using SMMM = Sucrose.Manager.Manage.Manager; using SSWW = Sucrose.Shared.Watchdog.Watch; namespace Sucrose.Commandog @@ -9,6 +12,8 @@ internal static void Main(string[] Args) { try { + SHC.All = new CultureInfo(SMMM.Culture, true); + SCHA.Parse(Args); } catch (Exception Exception) diff --git a/src/Project/Sucrose.Commandog/Helper/Arguments.cs b/src/Project/Sucrose.Commandog/Helper/Arguments.cs index 67794d2ad..c7e01bd8f 100644 --- a/src/Project/Sucrose.Commandog/Helper/Arguments.cs +++ b/src/Project/Sucrose.Commandog/Helper/Arguments.cs @@ -144,6 +144,9 @@ public static void Parse(string[] Arguments) SSSHP.Run(SCHP.ArgumentValue(Values[0])); } break; + case SSDECT.Backgroundog: + SSSHP.Run(SCHP.ArgumentValue(Values[0]), string.Empty); + break; default: break; } diff --git a/src/Shared/Sucrose.Shared.Dependency/Enum/CommandsType.cs b/src/Shared/Sucrose.Shared.Dependency/Enum/CommandsType.cs index 28984c273..2b384765c 100644 --- a/src/Shared/Sucrose.Shared.Dependency/Enum/CommandsType.cs +++ b/src/Shared/Sucrose.Shared.Dependency/Enum/CommandsType.cs @@ -18,7 +18,8 @@ internal enum CommandsType StartupM, StartupP, Scheduler, - Interface + Interface, + Backgroundog } internal enum ArgumentCommandsType diff --git a/src/Shared/Sucrose.Shared.Launcher/Command/Close.cs b/src/Shared/Sucrose.Shared.Launcher/Command/Close.cs index 92b1d38ba..eb0d21a4c 100644 --- a/src/Shared/Sucrose.Shared.Launcher/Command/Close.cs +++ b/src/Shared/Sucrose.Shared.Launcher/Command/Close.cs @@ -46,6 +46,11 @@ public static void Command() { SSSHP.Kill(SMR.Commandog); } + + if (SSSHP.Work(SMR.Backgroundog)) + { + SSSHP.Kill(SMR.Backgroundog); + } } WinForms.ExitThread(); diff --git a/src/Shared/Sucrose.Shared.Live/Helper/Run.cs b/src/Shared/Sucrose.Shared.Live/Helper/Run.cs index e98677d44..449d5b068 100644 --- a/src/Shared/Sucrose.Shared.Live/Helper/Run.cs +++ b/src/Shared/Sucrose.Shared.Live/Helper/Run.cs @@ -23,6 +23,8 @@ public static void Start() if (Info.AppVersion.CompareTo(SHV.Entry()) <= 0) { + SSSHP.Run(SSSMI.Commandog, $"{SMR.StartCommand}{SSDECT.Backgroundog}{SMR.ValueSeparator}{SSSMI.Backgroundog}"); + switch (Info.Type) { case SSDEWT.Web: diff --git a/src/Shared/Sucrose.Shared.Server/Services/BackgroundogServerService.cs b/src/Shared/Sucrose.Shared.Server/Services/BackgroundogServerService.cs new file mode 100644 index 000000000..52135bfd5 --- /dev/null +++ b/src/Shared/Sucrose.Shared.Server/Services/BackgroundogServerService.cs @@ -0,0 +1,20 @@ +#if BACKGROUNDOG + +using Google.Protobuf.WellKnownTypes; +using Grpc.Core; +using Sucrose.Grpc.Common; +using static Sucrose.Grpc.Common.Backgroundog; +using SBMI = Sucrose.Backgroundog.Manage.Internal; + +namespace Sucrose.Shared.Server.Services +{ + public class BackgroundogServerService : BackgroundogBase + { + public override Task StateBackgroundog(Empty _, ServerCallContext Context) + { + return Task.FromResult(new BackgroundogStateResponse { State = SBMI.State }); + } + } +} + +#endif \ No newline at end of file diff --git a/src/Shared/Sucrose.Shared.Server/Services/LauncherServerService.cs b/src/Shared/Sucrose.Shared.Server/Services/LauncherServerService.cs index 76998db9c..35b65a152 100644 --- a/src/Shared/Sucrose.Shared.Server/Services/LauncherServerService.cs +++ b/src/Shared/Sucrose.Shared.Server/Services/LauncherServerService.cs @@ -3,7 +3,7 @@ using Google.Protobuf.WellKnownTypes; using Grpc.Core; using Sucrose.Grpc.Common; -using Sucrose.Shared.Launcher.Manage; +using SSLMI = Sucrose.Shared.Launcher.Manage.Internal; using static Sucrose.Grpc.Common.Launcher; namespace Sucrose.Shared.Server.Services @@ -12,22 +12,22 @@ public class LauncherServerService : LauncherBase { public override Task ReleaseLauncher(Empty _, ServerCallContext Context) { - return Task.FromResult(new LauncherReleaseResponse { State = Internal.TrayIconManager.Release() }); + return Task.FromResult(new LauncherReleaseResponse { State = SSLMI.TrayIconManager.Release() }); } public override Task StateLauncher(Empty _, ServerCallContext Context) { - return Task.FromResult(new LauncherStateResponse { State = Internal.TrayIconManager.State() }); + return Task.FromResult(new LauncherStateResponse { State = SSLMI.TrayIconManager.State() }); } public override Task ShowLauncher(Empty _, ServerCallContext Context) { - return Task.FromResult(new LauncherShowResponse { Result = Internal.TrayIconManager.Show() }); + return Task.FromResult(new LauncherShowResponse { Result = SSLMI.TrayIconManager.Show() }); } public override Task HideLauncher(Empty _, ServerCallContext Context) { - return Task.FromResult(new LauncherHideResponse { Result = Internal.TrayIconManager.Hide() }); + return Task.FromResult(new LauncherHideResponse { Result = SSLMI.TrayIconManager.Hide() }); } } } diff --git a/src/Shared/Sucrose.Shared.Server/Sucrose.Shared.Server.projitems b/src/Shared/Sucrose.Shared.Server/Sucrose.Shared.Server.projitems index 6e991dd6f..f72adccf3 100644 --- a/src/Shared/Sucrose.Shared.Server/Sucrose.Shared.Server.projitems +++ b/src/Shared/Sucrose.Shared.Server/Sucrose.Shared.Server.projitems @@ -9,6 +9,7 @@ Sucrose.Shared.Server + diff --git a/src/Shared/Sucrose.Shared.Space/Manage/Internal.cs b/src/Shared/Sucrose.Shared.Space/Manage/Internal.cs index bf744db38..3936704e1 100644 --- a/src/Shared/Sucrose.Shared.Space/Manage/Internal.cs +++ b/src/Shared/Sucrose.Shared.Space/Manage/Internal.cs @@ -40,6 +40,8 @@ internal static class Internal public static string Commandog => Path.Combine(Folder, Path.GetFileNameWithoutExtension(SMR.Commandog), SMR.Commandog); + public static string Backgroundog => Path.Combine(Folder, Path.GetFileNameWithoutExtension(SMR.Backgroundog), SMR.Backgroundog); + public static Dictionary EngineLive => new() { { SSDEET.AuroraLive, Path.Combine(Folder, Path.GetFileNameWithoutExtension(SMR.AuroraLive), SMR.AuroraLive) }, diff --git a/src/Shared/Sucrose.Shared.Watchdog/Watch.cs b/src/Shared/Sucrose.Shared.Watchdog/Watch.cs index 4d7212f7e..642a0ff14 100644 --- a/src/Shared/Sucrose.Shared.Watchdog/Watch.cs +++ b/src/Shared/Sucrose.Shared.Watchdog/Watch.cs @@ -64,6 +64,8 @@ private static void WriteLog(string Text) SMMI.WebViewLiveLogManager.Log(SELLT.Error, Text); #elif LIVE_CEFSHARP SMMI.CefSharpLiveLogManager.Log(SELLT.Error, Text); +#elif BACKGROUNDOG + SMMI.BackgroundogLogManager.Log(SELLT.Error, Text); #elif LIVE_MPVPLAYER SMMI.MpvPlayerLiveLogManager.Log(SELLT.Error, Text); #endif diff --git a/src/Sucrose.sln b/src/Sucrose.sln index e3a26aed3..b22abc016 100644 --- a/src/Sucrose.sln +++ b/src/Sucrose.sln @@ -99,6 +99,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sucrose.Live.MpvPlayer", "L EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Sucrose.Shared.Engine.MpvPlayer", "Shared\Engine\Sucrose.Shared.Engine.MpvPlayer\Sucrose.Shared.Engine.MpvPlayer.shproj", "{6D8A6597-DA61-4972-A978-2942F076E4A4}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sucrose.Backgroundog", "Project\Sucrose.Backgroundog\Sucrose.Backgroundog.csproj", "{68FA689E-F4C8-4A71-A603-ED5773E29F9A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -369,12 +371,12 @@ Global {A3992108-8907-4197-AC25-DAB73F106C8F}.Release|x86.Build.0 = Release|x86 {A45DD78F-8C1D-4825-91DF-DC0BC0B75288}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A45DD78F-8C1D-4825-91DF-DC0BC0B75288}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A45DD78F-8C1D-4825-91DF-DC0BC0B75288}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {A45DD78F-8C1D-4825-91DF-DC0BC0B75288}.Debug|ARM64.Build.0 = Debug|Any CPU - {A45DD78F-8C1D-4825-91DF-DC0BC0B75288}.Debug|x64.ActiveCfg = Debug|Any CPU - {A45DD78F-8C1D-4825-91DF-DC0BC0B75288}.Debug|x64.Build.0 = Debug|Any CPU - {A45DD78F-8C1D-4825-91DF-DC0BC0B75288}.Debug|x86.ActiveCfg = Debug|Any CPU - {A45DD78F-8C1D-4825-91DF-DC0BC0B75288}.Debug|x86.Build.0 = Debug|Any CPU + {A45DD78F-8C1D-4825-91DF-DC0BC0B75288}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {A45DD78F-8C1D-4825-91DF-DC0BC0B75288}.Debug|ARM64.Build.0 = Debug|ARM64 + {A45DD78F-8C1D-4825-91DF-DC0BC0B75288}.Debug|x64.ActiveCfg = Debug|x64 + {A45DD78F-8C1D-4825-91DF-DC0BC0B75288}.Debug|x64.Build.0 = Debug|x64 + {A45DD78F-8C1D-4825-91DF-DC0BC0B75288}.Debug|x86.ActiveCfg = Debug|x86 + {A45DD78F-8C1D-4825-91DF-DC0BC0B75288}.Debug|x86.Build.0 = Debug|x86 {A45DD78F-8C1D-4825-91DF-DC0BC0B75288}.Release|Any CPU.ActiveCfg = Release|Any CPU {A45DD78F-8C1D-4825-91DF-DC0BC0B75288}.Release|Any CPU.Build.0 = Release|Any CPU {A45DD78F-8C1D-4825-91DF-DC0BC0B75288}.Release|ARM64.ActiveCfg = Release|ARM64 @@ -383,6 +385,22 @@ Global {A45DD78F-8C1D-4825-91DF-DC0BC0B75288}.Release|x64.Build.0 = Release|x64 {A45DD78F-8C1D-4825-91DF-DC0BC0B75288}.Release|x86.ActiveCfg = Release|x86 {A45DD78F-8C1D-4825-91DF-DC0BC0B75288}.Release|x86.Build.0 = Release|x86 + {68FA689E-F4C8-4A71-A603-ED5773E29F9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {68FA689E-F4C8-4A71-A603-ED5773E29F9A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {68FA689E-F4C8-4A71-A603-ED5773E29F9A}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {68FA689E-F4C8-4A71-A603-ED5773E29F9A}.Debug|ARM64.Build.0 = Debug|ARM64 + {68FA689E-F4C8-4A71-A603-ED5773E29F9A}.Debug|x64.ActiveCfg = Debug|x64 + {68FA689E-F4C8-4A71-A603-ED5773E29F9A}.Debug|x64.Build.0 = Debug|x64 + {68FA689E-F4C8-4A71-A603-ED5773E29F9A}.Debug|x86.ActiveCfg = Debug|x86 + {68FA689E-F4C8-4A71-A603-ED5773E29F9A}.Debug|x86.Build.0 = Debug|x86 + {68FA689E-F4C8-4A71-A603-ED5773E29F9A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {68FA689E-F4C8-4A71-A603-ED5773E29F9A}.Release|Any CPU.Build.0 = Release|Any CPU + {68FA689E-F4C8-4A71-A603-ED5773E29F9A}.Release|ARM64.ActiveCfg = Release|ARM64 + {68FA689E-F4C8-4A71-A603-ED5773E29F9A}.Release|ARM64.Build.0 = Release|ARM64 + {68FA689E-F4C8-4A71-A603-ED5773E29F9A}.Release|x64.ActiveCfg = Release|x64 + {68FA689E-F4C8-4A71-A603-ED5773E29F9A}.Release|x64.Build.0 = Release|x64 + {68FA689E-F4C8-4A71-A603-ED5773E29F9A}.Release|x86.ActiveCfg = Release|x86 + {68FA689E-F4C8-4A71-A603-ED5773E29F9A}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -425,6 +443,7 @@ Global {72B01810-F520-460B-8BD3-2301AAC6983B} = {232CD10B-4CA0-403C-B469-82A002F7C130} {A45DD78F-8C1D-4825-91DF-DC0BC0B75288} = {04361DC9-3E9F-481A-9489-068DE8688332} {6D8A6597-DA61-4972-A978-2942F076E4A4} = {5B4A4BA0-D823-4720-8C8C-10E5ECBB4474} + {68FA689E-F4C8-4A71-A603-ED5773E29F9A} = {E9FDFBCD-9AC8-4C03-8E94-17B50D0AD090} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {5DA4A105-4BC7-4943-9328-F7274E75FCB3} @@ -448,6 +467,10 @@ Global Shared\Sucrose.Shared.Watchdog\Sucrose.Shared.Watchdog.projitems*{5e032b27-faf9-4821-aa35-7e2a49e1e90e}*SharedItemsImports = 5 Shared\Sucrose.Shared.Zip\Sucrose.Shared.Zip.projitems*{5e032b27-faf9-4821-aa35-7e2a49e1e90e}*SharedItemsImports = 5 Shared\Engine\Sucrose.Shared.Engine.Nebula\Sucrose.Shared.Engine.Nebula.projitems*{66354b15-cdd7-4744-bb1a-3703c08e7d3b}*SharedItemsImports = 13 + Shared\Sucrose.Shared.Dependency\Sucrose.Shared.Dependency.projitems*{68fa689e-f4c8-4a71-a603-ed5773e29f9a}*SharedItemsImports = 5 + Shared\Sucrose.Shared.Server\Sucrose.Shared.Server.projitems*{68fa689e-f4c8-4a71-a603-ed5773e29f9a}*SharedItemsImports = 5 + Shared\Sucrose.Shared.Space\Sucrose.Shared.Space.projitems*{68fa689e-f4c8-4a71-a603-ed5773e29f9a}*SharedItemsImports = 5 + Shared\Sucrose.Shared.Watchdog\Sucrose.Shared.Watchdog.projitems*{68fa689e-f4c8-4a71-a603-ed5773e29f9a}*SharedItemsImports = 5 Shared\Engine\Sucrose.Shared.Engine.MpvPlayer\Sucrose.Shared.Engine.MpvPlayer.projitems*{6d8a6597-da61-4972-a978-2942f076e4a4}*SharedItemsImports = 13 Shared\Sucrose.Shared.Live\Sucrose.Shared.Live.projitems*{72b01810-f520-460b-8bd3-2301aac6983b}*SharedItemsImports = 13 Shared\Engine\Sucrose.Shared.Engine.Aurora\Sucrose.Shared.Engine.Aurora.projitems*{77a043b9-fed0-4cd8-8697-8963a277393d}*SharedItemsImports = 5 diff --git a/src/gRPC/Sucrose.Grpc.Client/Services/BackgroundogClientService.cs b/src/gRPC/Sucrose.Grpc.Client/Services/BackgroundogClientService.cs new file mode 100644 index 000000000..d179df8b9 --- /dev/null +++ b/src/gRPC/Sucrose.Grpc.Client/Services/BackgroundogClientService.cs @@ -0,0 +1,16 @@ +using Google.Protobuf.WellKnownTypes; +using Sucrose.Grpc.Common; +using static Sucrose.Grpc.Common.Backgroundog; + +namespace Sucrose.Grpc.Client.Services +{ + public static class BackgroundogClientService + { + public static BackgroundogStateResponse GetState(BackgroundogClient Client) + { + BackgroundogStateResponse Response = Client.StateBackgroundog(new Empty()); + + return Response; + } + } +} \ No newline at end of file diff --git a/src/gRPC/Sucrose.Grpc.Common/Proto/Backgroundog.proto b/src/gRPC/Sucrose.Grpc.Common/Proto/Backgroundog.proto new file mode 100644 index 000000000..035d90fdf --- /dev/null +++ b/src/gRPC/Sucrose.Grpc.Common/Proto/Backgroundog.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +package Sucrose.Grpc.Common.Proto.Backgroundog; +option csharp_namespace = "Sucrose.Grpc.Common"; + +import "google/protobuf/empty.proto"; + +service Backgroundog { + rpc StateBackgroundog (google.protobuf.Empty) returns (BackgroundogStateResponse); +} + +message BackgroundogStateResponse { + bool state = 1; +} \ No newline at end of file diff --git a/src/gRPC/Sucrose.Grpc.Common/Sucrose.Grpc.Common.csproj b/src/gRPC/Sucrose.Grpc.Common/Sucrose.Grpc.Common.csproj index 83567a01b..baee80d14 100644 --- a/src/gRPC/Sucrose.Grpc.Common/Sucrose.Grpc.Common.csproj +++ b/src/gRPC/Sucrose.Grpc.Common/Sucrose.Grpc.Common.csproj @@ -12,10 +12,7 @@ - - - - +