diff --git a/src/Library/Sucrose.Manager/Manage/Manager.cs b/src/Library/Sucrose.Manager/Manage/Manager.cs index 10b437bc4..a1962e1c1 100644 --- a/src/Library/Sucrose.Manager/Manage/Manager.cs +++ b/src/Library/Sucrose.Manager/Manage/Manager.cs @@ -85,6 +85,8 @@ public static class Manager public static int Volume => SHS.Clamp(SMMI.EngineSettingManager.GetSettingStable(SMC.Volume, 100), 0, 100); + public static bool SignalRequired => SMMI.BackgroundogSettingManager.GetSetting(SMC.SignalRequired, false); + public static string UpdatePercentage => SMMI.UpdateSettingManager.GetSetting(SMC.UpdatePercentage, "0%"); public static bool StorePreviewHide => SMMI.PortalSettingManager.GetSetting(SMC.StorePreviewHide, false); diff --git a/src/Library/Sucrose.Memory/Constant.cs b/src/Library/Sucrose.Memory/Constant.cs index d9a12b162..4b2f1c8dc 100644 --- a/src/Library/Sucrose.Memory/Constant.cs +++ b/src/Library/Sucrose.Memory/Constant.cs @@ -126,6 +126,8 @@ public static class Constant public const string CpuPerformance = "CpuPerformance"; + public const string SignalRequired = "SignalRequired"; + public const string StorePagination = "StorePagination"; public const string LibraryLocation = "LibraryLocation"; diff --git a/src/Library/Sucrose.Signal/Helper/Deleter.cs b/src/Library/Sucrose.Signal/Helper/Deleter.cs new file mode 100644 index 000000000..abb487050 --- /dev/null +++ b/src/Library/Sucrose.Signal/Helper/Deleter.cs @@ -0,0 +1,46 @@ +using SMR = Sucrose.Memory.Readonly; + +namespace Sucrose.Signal.Helper +{ + internal static class Deleter + { + public static async Task Delete(string filePath) + { + try + { + if (File.Exists(filePath)) + { + File.Delete(filePath); + } + } + catch + { + try + { + await Task.Delay(SMR.Randomise.Next(5, 50)); + + if (File.Exists(filePath)) + { + File.Delete(filePath); + } + } + catch + { + try + { + await Task.Delay(SMR.Randomise.Next(5, 50)); + + if (File.Exists(filePath)) + { + File.Delete(filePath); + } + } + catch + { + // + } + } + } + } + } +} \ No newline at end of file diff --git a/src/Library/Sucrose.Signal/Interface/Backgroundog.cs b/src/Library/Sucrose.Signal/Interface/Backgroundog.cs new file mode 100644 index 000000000..fcfbb378b --- /dev/null +++ b/src/Library/Sucrose.Signal/Interface/Backgroundog.cs @@ -0,0 +1,25 @@ +using Newtonsoft.Json.Linq; + +namespace Sucrose.Signal.Interface +{ + public class Backgroundog + { + public JObject Cpu { get; set; } = null; + + public JObject Bios { get; set; } = null; + + public JObject Date { get; set; } = null; + + public JObject Audio { get; set; } = null; + + public JObject Memory { get; set; } = null; + + public JObject Battery { get; set; } = null; + + public JObject Graphic { get; set; } = null; + + public JObject Network { get; set; } = null; + + public JObject Motherboard { get; set; } = null; + } +} \ No newline at end of file diff --git a/src/Library/Sucrose.Signal/Manage/Internal.cs b/src/Library/Sucrose.Signal/Manage/Internal.cs index e23937601..10076ea0d 100644 --- a/src/Library/Sucrose.Signal/Manage/Internal.cs +++ b/src/Library/Sucrose.Signal/Manage/Internal.cs @@ -9,5 +9,7 @@ public static class Internal public static readonly SSST LauncherManager = new("Launcher.sgnl"); public static readonly SSST WebsiterManager = new("Websiter.sgnl"); + + public static readonly SSST BackgroundogManager = new("Backgroundog.sgnl"); } } \ No newline at end of file diff --git a/src/Library/Sucrose.Signal/SignalT.cs b/src/Library/Sucrose.Signal/SignalT.cs index 46cb0ca17..6ad68f0bb 100644 --- a/src/Library/Sucrose.Signal/SignalT.cs +++ b/src/Library/Sucrose.Signal/SignalT.cs @@ -1,15 +1,16 @@ -using System.Text.Json; +using Newtonsoft.Json; using SMR = Sucrose.Memory.Readonly; +using SSHD = Sucrose.Signal.Helper.Deleter; using SSHR = Sucrose.Signal.Helper.Reader; using SSHW = Sucrose.Signal.Helper.Writer; +using Timer = System.Timers.Timer; namespace Sucrose.Signal { public class SignalT(string Name) { + private readonly JsonSerializerSettings SerializerSettings = new() { TypeNameHandling = TypeNameHandling.None, Formatting = Formatting.Indented }; private readonly string Source = Path.Combine(SMR.AppDataPath, SMR.AppName, SMR.CacheFolder, SMR.Signal); - private readonly JsonSerializerOptions Options = new() { WriteIndented = true }; - private readonly Random Random = new(); private FileSystemWatcher FileWatcher; public FileSystemEventHandler CreatedEventHandler; @@ -95,10 +96,10 @@ public void FileSave(T Data) while (File.Exists(Destination)) { - Destination = Path.Combine(Source, $"{Path.GetFileNameWithoutExtension(Name)}-{Random.Next(0, int.MaxValue)}{Path.GetExtension(Name)}"); + Destination = Path.Combine(Source, $"{Path.GetFileNameWithoutExtension(Name)}-{SMR.Randomise.Next(0, int.MaxValue)}{Path.GetExtension(Name)}"); } - SSHW.Write(Destination, JsonSerializer.Serialize(Data, Options)); + SSHW.Write(Destination, JsonConvert.SerializeObject(Data, SerializerSettings)); } public string FileName(string Source) @@ -106,13 +107,23 @@ public string FileName(string Source) return Path.GetFileName(Source); } - public T FileRead(string Source, T Default) + public async void FileDelete(string Source) + { + await SSHD.Delete(Source); + } + + public T FileRead(string Source, T Default, bool Delete = true) { try { string Data = SSHR.Read(Source).Result; - return JsonSerializer.Deserialize(Data, Options); + if (Delete) + { + DeletionTimer(Source); + } + + return JsonConvert.DeserializeObject(Data, SerializerSettings); } catch { @@ -120,12 +131,17 @@ public T FileRead(string Source, T Default) } } - public string FileRead(string Source, string Default) + public string FileRead(string Source, string Default, bool Delete = true) { try { string Data = SSHR.Read(Source).Result; + if (Delete) + { + DeletionTimer(Source); + } + return Data; } catch @@ -145,5 +161,14 @@ private bool FileCheck(string Source) return false; } } + + private void DeletionTimer(string Source) + { + Timer Deletion = new(3000); + + Deletion.Elapsed += (sender, e) => FileDelete(Source); + Deletion.AutoReset = false; + Deletion.Start(); + } } } \ No newline at end of file diff --git a/src/Library/Sucrose.Signal/Sucrose.Signal.csproj b/src/Library/Sucrose.Signal/Sucrose.Signal.csproj index 693471c09..3ec9e965e 100644 --- a/src/Library/Sucrose.Signal/Sucrose.Signal.csproj +++ b/src/Library/Sucrose.Signal/Sucrose.Signal.csproj @@ -11,8 +11,8 @@ preview - - + + diff --git a/src/Live/Sucrose.Live.Aurora/App.xaml.cs b/src/Live/Sucrose.Live.Aurora/App.xaml.cs index 8920d6f24..67d304ebd 100644 --- a/src/Live/Sucrose.Live.Aurora/App.xaml.cs +++ b/src/Live/Sucrose.Live.Aurora/App.xaml.cs @@ -4,6 +4,7 @@ using Application = System.Windows.Application; using SEWTT = Skylark.Enum.WindowsThemeType; 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; @@ -141,6 +142,8 @@ protected void Configure() { Source = Path.Combine(SMMM.LibraryLocation, SMMM.LibrarySelected, Source); + SMMI.BackgroundogSettingManager.SetSetting(SMC.SignalRequired, false); + if (File.Exists(Source)) { SSSHS.Apply(); diff --git a/src/Live/Sucrose.Live.Aurora/Sucrose.Live.Aurora.csproj b/src/Live/Sucrose.Live.Aurora/Sucrose.Live.Aurora.csproj index 76265d930..e68fa0c9e 100644 --- a/src/Live/Sucrose.Live.Aurora/Sucrose.Live.Aurora.csproj +++ b/src/Live/Sucrose.Live.Aurora/Sucrose.Live.Aurora.csproj @@ -82,9 +82,7 @@ - - diff --git a/src/Live/Sucrose.Live.CefSharp/App.xaml.cs b/src/Live/Sucrose.Live.CefSharp/App.xaml.cs index 96a0d5b14..bd6504dd7 100644 --- a/src/Live/Sucrose.Live.CefSharp/App.xaml.cs +++ b/src/Live/Sucrose.Live.CefSharp/App.xaml.cs @@ -186,6 +186,8 @@ protected void Configure() Source = Path.Combine(SMMM.LibraryLocation, SMMM.LibrarySelected, Source); } + SMMI.BackgroundogSettingManager.SetSetting(SMC.SignalRequired, false); + if (SSTHV.IsUrl(Source) || File.Exists(Source)) { SSSHS.Apply(); diff --git a/src/Live/Sucrose.Live.CefSharp/Sucrose.Live.CefSharp.csproj b/src/Live/Sucrose.Live.CefSharp/Sucrose.Live.CefSharp.csproj index ff7e1a6ad..05fc02911 100644 --- a/src/Live/Sucrose.Live.CefSharp/Sucrose.Live.CefSharp.csproj +++ b/src/Live/Sucrose.Live.CefSharp/Sucrose.Live.CefSharp.csproj @@ -87,15 +87,15 @@ - + - + diff --git a/src/Live/Sucrose.Live.MpvPlayer/App.xaml.cs b/src/Live/Sucrose.Live.MpvPlayer/App.xaml.cs index 8a9dd15ab..103c23c68 100644 --- a/src/Live/Sucrose.Live.MpvPlayer/App.xaml.cs +++ b/src/Live/Sucrose.Live.MpvPlayer/App.xaml.cs @@ -4,6 +4,7 @@ using Application = System.Windows.Application; using SEWTT = Skylark.Enum.WindowsThemeType; 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; @@ -138,6 +139,8 @@ protected void Configure() Source = Path.Combine(SMMM.LibraryLocation, SMMM.LibrarySelected, Source); } + SMMI.BackgroundogSettingManager.SetSetting(SMC.SignalRequired, false); + if (SSTHV.IsUrl(Source) || File.Exists(Source)) { SSSHS.Apply(); diff --git a/src/Live/Sucrose.Live.MpvPlayer/Sucrose.Live.MpvPlayer.csproj b/src/Live/Sucrose.Live.MpvPlayer/Sucrose.Live.MpvPlayer.csproj index 635cc6720..f4ee948ee 100644 --- a/src/Live/Sucrose.Live.MpvPlayer/Sucrose.Live.MpvPlayer.csproj +++ b/src/Live/Sucrose.Live.MpvPlayer/Sucrose.Live.MpvPlayer.csproj @@ -88,9 +88,7 @@ - - diff --git a/src/Live/Sucrose.Live.Nebula/App.xaml.cs b/src/Live/Sucrose.Live.Nebula/App.xaml.cs index 8eba2c9bd..e099e30e5 100644 --- a/src/Live/Sucrose.Live.Nebula/App.xaml.cs +++ b/src/Live/Sucrose.Live.Nebula/App.xaml.cs @@ -4,6 +4,7 @@ using Application = System.Windows.Application; using SEWTT = Skylark.Enum.WindowsThemeType; 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; @@ -138,6 +139,8 @@ protected void Configure() Source = Path.Combine(SMMM.LibraryLocation, SMMM.LibrarySelected, Source); } + SMMI.BackgroundogSettingManager.SetSetting(SMC.SignalRequired, false); + if (SSTHV.IsUrl(Source) || File.Exists(Source)) { SSSHS.Apply(); diff --git a/src/Live/Sucrose.Live.Nebula/Sucrose.Live.Nebula.csproj b/src/Live/Sucrose.Live.Nebula/Sucrose.Live.Nebula.csproj index b508bade6..e3ea5dbc9 100644 --- a/src/Live/Sucrose.Live.Nebula/Sucrose.Live.Nebula.csproj +++ b/src/Live/Sucrose.Live.Nebula/Sucrose.Live.Nebula.csproj @@ -82,9 +82,7 @@ - - diff --git a/src/Live/Sucrose.Live.Vexana/App.xaml.cs b/src/Live/Sucrose.Live.Vexana/App.xaml.cs index abb09ebd9..cfaf788ae 100644 --- a/src/Live/Sucrose.Live.Vexana/App.xaml.cs +++ b/src/Live/Sucrose.Live.Vexana/App.xaml.cs @@ -4,6 +4,7 @@ using Application = System.Windows.Application; using SEWTT = Skylark.Enum.WindowsThemeType; 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; @@ -138,6 +139,8 @@ protected void Configure() Source = Path.Combine(SMMM.LibraryLocation, SMMM.LibrarySelected, Source); } + SMMI.BackgroundogSettingManager.SetSetting(SMC.SignalRequired, false); + if (SSTHV.IsUrl(Source) || File.Exists(Source)) { SSSHS.Apply(); diff --git a/src/Live/Sucrose.Live.Vexana/Sucrose.Live.Vexana.csproj b/src/Live/Sucrose.Live.Vexana/Sucrose.Live.Vexana.csproj index 5c6e98c49..a2cdf4606 100644 --- a/src/Live/Sucrose.Live.Vexana/Sucrose.Live.Vexana.csproj +++ b/src/Live/Sucrose.Live.Vexana/Sucrose.Live.Vexana.csproj @@ -82,9 +82,7 @@ - - diff --git a/src/Live/Sucrose.Live.WebView/App.xaml.cs b/src/Live/Sucrose.Live.WebView/App.xaml.cs index 392318301..5cec6c8d5 100644 --- a/src/Live/Sucrose.Live.WebView/App.xaml.cs +++ b/src/Live/Sucrose.Live.WebView/App.xaml.cs @@ -173,6 +173,8 @@ protected void Configure() Source = Path.Combine(SMMM.LibraryLocation, SMMM.LibrarySelected, Source); } + SMMI.BackgroundogSettingManager.SetSetting(SMC.SignalRequired, false); + if (SSTHV.IsUrl(Source) || File.Exists(Source)) { SSSHS.Apply(); diff --git a/src/Live/Sucrose.Live.WebView/Sucrose.Live.WebView.csproj b/src/Live/Sucrose.Live.WebView/Sucrose.Live.WebView.csproj index f74e92e55..2403ee26a 100644 --- a/src/Live/Sucrose.Live.WebView/Sucrose.Live.WebView.csproj +++ b/src/Live/Sucrose.Live.WebView/Sucrose.Live.WebView.csproj @@ -83,15 +83,15 @@ - + - + diff --git a/src/Portal/Sucrose.Portal/Sucrose.Portal.csproj b/src/Portal/Sucrose.Portal/Sucrose.Portal.csproj index 5235a8b73..352d82c03 100644 --- a/src/Portal/Sucrose.Portal/Sucrose.Portal.csproj +++ b/src/Portal/Sucrose.Portal/Sucrose.Portal.csproj @@ -106,7 +106,6 @@ - diff --git a/src/Project/Sucrose.Backgroundog/App.cs b/src/Project/Sucrose.Backgroundog/App.cs index 02356fc75..b35954752 100644 --- a/src/Project/Sucrose.Backgroundog/App.cs +++ b/src/Project/Sucrose.Backgroundog/App.cs @@ -1,15 +1,10 @@ using System.Globalization; using System.Text; using SBMI = Sucrose.Backgroundog.Manage.Internal; -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 SSSHI = Sucrose.Shared.Space.Helper.Instance; -using SSSSBSS = Sucrose.Shared.Signal.Services.BackgroundogServerService; using SSWW = Sucrose.Shared.Watchdog.Watch; namespace Sucrose.Backgroundog @@ -25,13 +20,6 @@ public static async Task Main() if (SSSHI.Basic(SMR.BackgroundogMutex, SMR.Backgroundog)) { - SGSGSS.ServerCreate(SGCB.BindService(new SSSSBSS())); - - SMMI.BackgroundogSettingManager.SetSetting(SMC.Host, SGSGSS.Host); - SMMI.BackgroundogSettingManager.SetSetting(SMC.Port, SGSGSS.Port); - - SGSGSS.ServerInstance.Start(); - SBMI.Initialize.Start(); do @@ -42,9 +30,6 @@ public static async Task Main() } while (SBMI.Exit); SBMI.Initialize.Stop(); - - SGSGSS.ServerInstance.KillAsync().Wait(); - //SGSGSS.ServerInstance.ShutdownAsync().Wait(); } } catch (Exception Exception) diff --git a/src/Project/Sucrose.Backgroundog/Helper/Specification.cs b/src/Project/Sucrose.Backgroundog/Helper/Specification.cs index a28e073a5..19c828c88 100644 --- a/src/Project/Sucrose.Backgroundog/Helper/Specification.cs +++ b/src/Project/Sucrose.Backgroundog/Helper/Specification.cs @@ -4,6 +4,7 @@ using System.Management; using System.Text; using SBEAS = Sucrose.Backgroundog.Extension.AudioSession; +using SBED = Sucrose.Backgroundog.Extension.Data; using SBER = Sucrose.Backgroundog.Extension.Remote; using SBEUV = Sucrose.Backgroundog.Extension.UpdateVisitor; using SBEV = Sucrose.Backgroundog.Extension.Virtual; @@ -22,6 +23,8 @@ using SSDSHS = Sucrose.Shared.Dependency.Struct.HostStruct; using SSEPPE = Skylark.Standard.Extension.Ping.PingExtension; using SSESSE = Skylark.Standard.Extension.Storage.StorageExtension; +using SSIB = Sucrose.Signal.Interface.Backgroundog; +using SSMI = Sucrose.Signal.Manage.Internal; using SSMMS = Skylark.Struct.Monitor.MonitorStruct; using SSSHG = Sucrose.Shared.Space.Helper.Graphic; using SSSHN = Sucrose.Shared.Space.Helper.Network; @@ -717,6 +720,37 @@ public static async Task Start() }); } + if (SMMM.SignalRequired && SBMI.SignalManagement) + { + SBMI.SignalManagement = false; + + _ = Task.Run(() => + { + try + { + SSMI.BackgroundogManager.FileSave(new() + { + Cpu = SBED.GetCpuInfo(), + Bios = SBED.GetBiosInfo(), + Date = SBED.GetDateInfo(), + Audio = SBED.GetAudioInfo(), + Memory = SBED.GetMemoryInfo(), + Battery = SBED.GetBatteryInfo(), + Graphic = SBED.GetGraphicInfo(), + Network = SBED.GetNetworkInfo(), + Motherboard = SBED.GetMotherboardInfo() + }); + + SBMI.SignalManagement = true; + } + catch (Exception Exception) + { + SBMI.SignalManagement = true; + SSWW.Watch_CatchException(Exception); + } + }); + } + //_ = Task.Run(() => //{ // foreach (IHardware Hardware in SBMI.Computer.Hardware) diff --git a/src/Project/Sucrose.Backgroundog/Manage/Internal.cs b/src/Project/Sucrose.Backgroundog/Manage/Internal.cs index 0a7c20654..af358c36b 100644 --- a/src/Project/Sucrose.Backgroundog/Manage/Internal.cs +++ b/src/Project/Sucrose.Backgroundog/Manage/Internal.cs @@ -54,6 +54,8 @@ internal static class Internal public static bool FocusManagement = true; + public static bool SignalManagement = true; + public static bool RemoteManagement = true; public static Timer InitializeTimer = null; diff --git a/src/Project/Sucrose.Backgroundog/Sucrose.Backgroundog.csproj b/src/Project/Sucrose.Backgroundog/Sucrose.Backgroundog.csproj index 3f920827c..18c9a7a0a 100644 --- a/src/Project/Sucrose.Backgroundog/Sucrose.Backgroundog.csproj +++ b/src/Project/Sucrose.Backgroundog/Sucrose.Backgroundog.csproj @@ -79,14 +79,13 @@ - + - diff --git a/src/Project/Sucrose.WPF.CS/App.xaml.cs b/src/Project/Sucrose.WPF.CS/App.xaml.cs index 80b28f8d7..65ce688de 100644 --- a/src/Project/Sucrose.WPF.CS/App.xaml.cs +++ b/src/Project/Sucrose.WPF.CS/App.xaml.cs @@ -5,14 +5,14 @@ using System.Windows; using Application = System.Windows.Application; using SEWTT = Skylark.Enum.WindowsThemeType; -using SSSSWSS = Sucrose.Shared.Signal.Services.WebsiterSignalService; using SHC = Skylark.Helper.Culture; using SMC = Sucrose.Memory.Constant; using SMMI = Sucrose.Manager.Manage.Internal; using SMR = Sucrose.Memory.Readonly; +using SSMI = Sucrose.Signal.Manage.Internal; using SSRHR = Sucrose.Shared.Resources.Helper.Resources; using SSSHI = Sucrose.Shared.Space.Helper.Instance; -using SSMI = Sucrose.Signal.Manage.Internal; +using SSSSWSS = Sucrose.Shared.Signal.Services.WebsiterSignalService; using SSWDEMB = Sucrose.Shared.Watchdog.DarkErrorMessageBox; using SSWLEMB = Sucrose.Shared.Watchdog.LightErrorMessageBox; using SSWW = Sucrose.Shared.Watchdog.Watch; diff --git a/src/Project/Sucrose.WPF.CS/Sucrose.WPF.CS.csproj b/src/Project/Sucrose.WPF.CS/Sucrose.WPF.CS.csproj index 2a00bcec2..f93e603e9 100644 --- a/src/Project/Sucrose.WPF.CS/Sucrose.WPF.CS.csproj +++ b/src/Project/Sucrose.WPF.CS/Sucrose.WPF.CS.csproj @@ -22,7 +22,7 @@ preview preview AnyCPU;ARM64;x64;x86 - $(DefineConstants);GENERAL;LIVE_CEFSHARP;BROWSER;SERVER + $(DefineConstants);GENERAL;BROWSER;SERVER Copyright © $([System.DateTime]::Today.ToString(yyyy)) $(Company) false false diff --git a/src/Shared/Engine/Sucrose.Shared.Engine.CefSharp/Helper/Web.cs b/src/Shared/Engine/Sucrose.Shared.Engine.CefSharp/Helper/Web.cs index 5c5e2a4b1..6e63fb6ff 100644 --- a/src/Shared/Engine/Sucrose.Shared.Engine.CefSharp/Helper/Web.cs +++ b/src/Shared/Engine/Sucrose.Shared.Engine.CefSharp/Helper/Web.cs @@ -1,9 +1,13 @@ using CefSharp; using SHS = Skylark.Helper.Skymath; +using SMC = Sucrose.Memory.Constant; +using SMMI = Sucrose.Manager.Manage.Internal; using SSECSHM = Sucrose.Shared.Engine.CefSharp.Helper.Management; using SSECSMI = Sucrose.Shared.Engine.CefSharp.Manage.Internal; using SSEHC = Sucrose.Shared.Engine.Helper.Compatible; using SSEMI = Sucrose.Shared.Engine.Manage.Internal; +using SSMI = Sucrose.Signal.Manage.Internal; +using SSSSBSS = Sucrose.Shared.Signal.Services.BackgroundogSignalService; using SWEACAM = Skylark.Wing.Extension.AudioController.AudioManager; using SWEVPCAM = Skylark.Wing.Extension.VideoPlayerController.AudioManager; @@ -17,6 +21,8 @@ public static void StartCompatible() { SSEMI.CompatibleTimer.Interval = TimeSpan.FromMilliseconds(SHS.Clamp(SSEMI.Compatible.TriggerTime, 1, int.MaxValue)); SSEMI.CompatibleTimer.Tick += (s, e) => SSEHC.ExecuteNormal(SSECSMI.CefEngine.ExecuteScriptAsync); + SMMI.BackgroundogSettingManager.SetSetting(SMC.SignalRequired, true); + SSMI.BackgroundogManager.StartChannel(SSSSBSS.Handler); SSEMI.CompatibleTimer.Start(); } } diff --git a/src/Shared/Engine/Sucrose.Shared.Engine.WebView/Helper/Web.cs b/src/Shared/Engine/Sucrose.Shared.Engine.WebView/Helper/Web.cs index eccd3954b..03cc5c5b8 100644 --- a/src/Shared/Engine/Sucrose.Shared.Engine.WebView/Helper/Web.cs +++ b/src/Shared/Engine/Sucrose.Shared.Engine.WebView/Helper/Web.cs @@ -1,8 +1,12 @@ using SHS = Skylark.Helper.Skymath; +using SMC = Sucrose.Memory.Constant; +using SMMI = Sucrose.Manager.Manage.Internal; using SSEHC = Sucrose.Shared.Engine.Helper.Compatible; using SSEMI = Sucrose.Shared.Engine.Manage.Internal; using SSEWVHM = Sucrose.Shared.Engine.WebView.Helper.Management; using SSEWVMI = Sucrose.Shared.Engine.WebView.Manage.Internal; +using SSMI = Sucrose.Signal.Manage.Internal; +using SSSSBSS = Sucrose.Shared.Signal.Services.BackgroundogSignalService; using SWEACAM = Skylark.Wing.Extension.AudioController.AudioManager; using SWEVPCAM = Skylark.Wing.Extension.VideoPlayerController.AudioManager; @@ -16,6 +20,8 @@ public static void StartCompatible() { SSEMI.CompatibleTimer.Interval = TimeSpan.FromMilliseconds(SHS.Clamp(SSEMI.Compatible.TriggerTime, 1, int.MaxValue)); SSEMI.CompatibleTimer.Tick += (s, e) => SSEHC.ExecuteTask(SSEWVMI.WebEngine.CoreWebView2.ExecuteScriptAsync); + SMMI.BackgroundogSettingManager.SetSetting(SMC.SignalRequired, true); + SSMI.BackgroundogManager.StartChannel(SSSSBSS.Handler); SSEMI.CompatibleTimer.Start(); } } diff --git a/src/Shared/Engine/Sucrose.Shared.Engine/Helper/Compatible.cs b/src/Shared/Engine/Sucrose.Shared.Engine/Helper/Compatible.cs index 656ddbcc3..9a73dc52b 100644 --- a/src/Shared/Engine/Sucrose.Shared.Engine/Helper/Compatible.cs +++ b/src/Shared/Engine/Sucrose.Shared.Engine/Helper/Compatible.cs @@ -1,7 +1,6 @@ using SESMIEN = Sucrose.Shared.Engine.Manage.Internal.ExecuteNormal; using SESMIET = Sucrose.Shared.Engine.Manage.Internal.ExecuteTask; using SSEHD = Sucrose.Shared.Engine.Helper.Data; -using SSEHS = Sucrose.Shared.Engine.Helper.System; using SSEMI = Sucrose.Shared.Engine.Manage.Internal; namespace Sucrose.Shared.Engine.Helper @@ -12,8 +11,6 @@ public static async void ExecuteNormal(SESMIEN Function) { if (SSEMI.Initialized) { - _ = Task.Run(SSEHS.GetSystem); - if (!string.IsNullOrEmpty(SSEMI.Compatible.LoopMode)) { Function(string.Format(SSEMI.Compatible.LoopMode, SSEHD.GetLoop())); diff --git a/src/Shared/Engine/Sucrose.Shared.Engine/Helper/System.cs b/src/Shared/Engine/Sucrose.Shared.Engine/Helper/System.cs deleted file mode 100644 index 195dfc239..000000000 --- a/src/Shared/Engine/Sucrose.Shared.Engine/Helper/System.cs +++ /dev/null @@ -1,184 +0,0 @@ -using Sucrose.Grpc.Common; -using SGCSBCS = Sucrose.Grpc.Client.Services.BackgroundogClientService; -using SGSGSS = Sucrose.Grpc.Services.GeneralServerService; -using SMR = Sucrose.Memory.Readonly; -using SSEMI = Sucrose.Shared.Engine.Manage.Internal; -using SSEMM = Sucrose.Shared.Engine.Manage.Manager; -using SSSHP = Sucrose.Shared.Space.Helper.Processor; - -namespace Sucrose.Shared.Engine.Helper -{ - internal static class System - { - public static async void GetSystem() - { - if (SSSHP.Work(SMR.Backgroundog)) - { - try - { - SGSGSS.ChannelCreate($"{SSEMM.Host}", SSEMM.Port); - SSEMI.Client = new(SGSGSS.ChannelInstance); - } - catch { } - - if (!string.IsNullOrEmpty(SSEMI.Compatible.SystemCpu)) - { - _ = Task.Run(() => - { - try - { - BackgroundogCpuResponse Response = SGCSBCS.GetCpu(SSEMI.Client); - SSEMI.CpuData = Response.Info; - } - catch - { - SSEMI.CpuData = string.Empty; - } - }); - } - - if (!string.IsNullOrEmpty(SSEMI.Compatible.SystemBios)) - { - _ = Task.Run(() => - { - try - { - BackgroundogBiosResponse Response = SGCSBCS.GetBios(SSEMI.Client); - SSEMI.BiosData = Response.Info; - } - catch - { - SSEMI.BiosData = string.Empty; - } - }); - } - - if (!string.IsNullOrEmpty(SSEMI.Compatible.SystemDate)) - { - _ = Task.Run(() => - { - try - { - BackgroundogDateResponse Response = SGCSBCS.GetDate(SSEMI.Client); - SSEMI.DateData = Response.Info; - } - catch - { - SSEMI.DateData = string.Empty; - } - }); - } - - if (!string.IsNullOrEmpty(SSEMI.Compatible.SystemAudio)) - { - _ = Task.Run(() => - { - try - { - BackgroundogAudioResponse Response = SGCSBCS.GetAudio(SSEMI.Client); - SSEMI.AudioData = Response.Info; - } - catch - { - SSEMI.AudioData = string.Empty; - } - }); - } - - if (!string.IsNullOrEmpty(SSEMI.Compatible.SystemMemory)) - { - _ = Task.Run(() => - { - try - { - BackgroundogMemoryResponse Response = SGCSBCS.GetMemory(SSEMI.Client); - SSEMI.MemoryData = Response.Info; - } - catch - { - SSEMI.MemoryData = string.Empty; - } - }); - } - - if (!string.IsNullOrEmpty(SSEMI.Compatible.SystemBattery)) - { - _ = Task.Run(() => - { - try - { - BackgroundogBatteryResponse Response = SGCSBCS.GetBattery(SSEMI.Client); - SSEMI.BatteryData = Response.Info; - } - catch - { - SSEMI.BatteryData = string.Empty; - } - }); - } - - if (!string.IsNullOrEmpty(SSEMI.Compatible.SystemGraphic)) - { - _ = Task.Run(() => - { - try - { - BackgroundogGraphicResponse Response = SGCSBCS.GetGraphic(SSEMI.Client); - SSEMI.GraphicData = Response.Info; - } - catch - { - SSEMI.GraphicData = string.Empty; - } - }); - } - - if (!string.IsNullOrEmpty(SSEMI.Compatible.SystemNetwork)) - { - _ = Task.Run(() => - { - try - { - BackgroundogNetworkResponse Response = SGCSBCS.GetNetwork(SSEMI.Client); - SSEMI.NetworkData = Response.Info; - } - catch - { - SSEMI.NetworkData = string.Empty; - } - }); - } - - if (!string.IsNullOrEmpty(SSEMI.Compatible.SystemMotherboard)) - { - _ = Task.Run(() => - { - try - { - BackgroundogMotherboardResponse Response = SGCSBCS.GetMotherboard(SSEMI.Client); - SSEMI.MotherboardData = Response.Info; - } - catch - { - SSEMI.MotherboardData = string.Empty; - } - }); - } - } - else - { - SSEMI.CpuData = string.Empty; - SSEMI.BiosData = string.Empty; - SSEMI.DateData = string.Empty; - SSEMI.AudioData = string.Empty; - SSEMI.MemoryData = string.Empty; - SSEMI.BatteryData = string.Empty; - SSEMI.GraphicData = string.Empty; - SSEMI.NetworkData = string.Empty; - SSEMI.MotherboardData = string.Empty; - } - - await Task.CompletedTask; - } - } -} \ No newline at end of file diff --git a/src/Shared/Engine/Sucrose.Shared.Engine/Manage/Internal.cs b/src/Shared/Engine/Sucrose.Shared.Engine/Manage/Internal.cs index 69ac2b578..8636b056e 100644 --- a/src/Shared/Engine/Sucrose.Shared.Engine/Manage/Internal.cs +++ b/src/Shared/Engine/Sucrose.Shared.Engine/Manage/Internal.cs @@ -1,5 +1,4 @@ using System.Windows.Threading; -using SGCBBC = Sucrose.Grpc.Common.Backgroundog.BackgroundogClient; using SSESB = Sucrose.Shared.Engine.Setting.Browser; using SSTHC = Sucrose.Shared.Theme.Helper.Compatible; using SSTHP = Sucrose.Shared.Theme.Helper.Properties; @@ -8,8 +7,6 @@ namespace Sucrose.Shared.Engine.Manage { internal static class Internal { - public static SGCBBC Client = null; - public static bool Initialized = false; public static SSTHP Properties = new(); diff --git a/src/Shared/Engine/Sucrose.Shared.Engine/Sucrose.Shared.Engine.projitems b/src/Shared/Engine/Sucrose.Shared.Engine/Sucrose.Shared.Engine.projitems index eaa77b1ab..18d874194 100644 --- a/src/Shared/Engine/Sucrose.Shared.Engine/Sucrose.Shared.Engine.projitems +++ b/src/Shared/Engine/Sucrose.Shared.Engine/Sucrose.Shared.Engine.projitems @@ -10,7 +10,6 @@ - diff --git a/src/Shared/Sucrose.Shared.Signal/Services/BackgroundogSignalService.cs b/src/Shared/Sucrose.Shared.Signal/Services/BackgroundogSignalService.cs index b8f2da8e1..9f42778d0 100644 --- a/src/Shared/Sucrose.Shared.Signal/Services/BackgroundogSignalService.cs +++ b/src/Shared/Sucrose.Shared.Signal/Services/BackgroundogSignalService.cs @@ -1,59 +1,63 @@ -#if BACKGROUNDOG +#if LIVE_WEBVIEW || LIVE_CEFSHARP -using Google.Protobuf.WellKnownTypes; -using Grpc.Core; using Newtonsoft.Json; -using Sucrose.Grpc.Common; -using static Sucrose.Grpc.Common.Backgroundog; -using SBED = Sucrose.Backgroundog.Extension.Data; +using System.IO; +using SSEMI = Sucrose.Shared.Engine.Manage.Internal; +using SSIB = Sucrose.Signal.Interface.Backgroundog; +using SSMI = Sucrose.Signal.Manage.Internal; namespace Sucrose.Shared.Signal.Services { - public class BackgroundogServerService : BackgroundogBase + public static class BackgroundogSignalService { - public override Task MotherboardBackgroundog(Empty _, ServerCallContext Context) + public static void Handler(object sender, FileSystemEventArgs e) { - return Task.FromResult(new BackgroundogMotherboardResponse { Info = JsonConvert.SerializeObject(SBED.GetMotherboardInfo(), Formatting.Indented) }); - } + SSIB Data = SSMI.BackgroundogManager.FileRead(e.FullPath, new()); - public override Task NetworkBackgroundog(Empty _, ServerCallContext Context) - { - return Task.FromResult(new BackgroundogNetworkResponse { Info = JsonConvert.SerializeObject(SBED.GetNetworkInfo(), Formatting.Indented) }); - } + if (Data.Cpu != null) + { + SSEMI.CpuData = JsonConvert.SerializeObject(Data.Cpu, Formatting.Indented); + } - public override Task GraphicBackgroundog(Empty _, ServerCallContext Context) - { - return Task.FromResult(new BackgroundogGraphicResponse { Info = JsonConvert.SerializeObject(SBED.GetGraphicInfo(), Formatting.Indented) }); - } + if (Data.Bios != null) + { + SSEMI.BiosData = JsonConvert.SerializeObject(Data.Bios, Formatting.Indented); + } - public override Task BatteryBackgroundog(Empty _, ServerCallContext Context) - { - return Task.FromResult(new BackgroundogBatteryResponse { Info = JsonConvert.SerializeObject(SBED.GetBatteryInfo(), Formatting.Indented) }); - } + if (Data.Date != null) + { + SSEMI.DateData = JsonConvert.SerializeObject(Data.Date, Formatting.Indented); + } - public override Task MemoryBackgroundog(Empty _, ServerCallContext Context) - { - return Task.FromResult(new BackgroundogMemoryResponse { Info = JsonConvert.SerializeObject(SBED.GetMemoryInfo(), Formatting.Indented) }); - } + if (Data.Audio != null) + { + SSEMI.AudioData = JsonConvert.SerializeObject(Data.Audio, Formatting.Indented); + } - public override Task AudioBackgroundog(Empty _, ServerCallContext Context) - { - return Task.FromResult(new BackgroundogAudioResponse { Info = JsonConvert.SerializeObject(SBED.GetAudioInfo(), Formatting.Indented) }); - } + if (Data.Memory != null) + { + SSEMI.MemoryData = JsonConvert.SerializeObject(Data.Memory, Formatting.Indented); + } - public override Task DateBackgroundog(Empty _, ServerCallContext Context) - { - return Task.FromResult(new BackgroundogDateResponse { Info = JsonConvert.SerializeObject(SBED.GetDateInfo(), Formatting.Indented) }); - } + if (Data.Battery != null) + { + SSEMI.BatteryData = JsonConvert.SerializeObject(Data.Battery, Formatting.Indented); + } - public override Task BiosBackgroundog(Empty _, ServerCallContext Context) - { - return Task.FromResult(new BackgroundogBiosResponse { Info = JsonConvert.SerializeObject(SBED.GetBiosInfo(), Formatting.Indented) }); - } + if (Data.Graphic != null) + { + SSEMI.GraphicData = JsonConvert.SerializeObject(Data.Graphic, Formatting.Indented); + } - public override Task CpuBackgroundog(Empty _, ServerCallContext Context) - { - return Task.FromResult(new BackgroundogCpuResponse { Info = JsonConvert.SerializeObject(SBED.GetCpuInfo(), Formatting.Indented) }); + if (Data.Network != null) + { + SSEMI.NetworkData = JsonConvert.SerializeObject(Data.Network, Formatting.Indented); + } + + if (Data.Motherboard != null) + { + SSEMI.MotherboardData = JsonConvert.SerializeObject(Data.Motherboard, Formatting.Indented); + } } } } diff --git a/src/Shared/Sucrose.Shared.Signal/Services/WebsiterSignalService.cs b/src/Shared/Sucrose.Shared.Signal/Services/WebsiterSignalService.cs index 342f28ca6..638525d31 100644 --- a/src/Shared/Sucrose.Shared.Signal/Services/WebsiterSignalService.cs +++ b/src/Shared/Sucrose.Shared.Signal/Services/WebsiterSignalService.cs @@ -1,9 +1,9 @@ #if BROWSER +using Sucrose.WPF.CS; using System.IO; using SSIW = Sucrose.Signal.Interface.Websiter; using SSMI = Sucrose.Signal.Manage.Internal; -using Sucrose.WPF.CS; namespace Sucrose.Shared.Signal.Services { diff --git a/src/Sucrose.sln b/src/Sucrose.sln index a4efd195d..dc542e40d 100644 --- a/src/Sucrose.sln +++ b/src/Sucrose.sln @@ -15,8 +15,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Live", "Live", "{04361DC9-3 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Launcher", "Launcher", "{02D54F9E-8518-40C9-B2CD-2A4F8CA339A3}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gRPC", "gRPC", "{E597A504-C449-4C3C-941E-F84DBA4A740C}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{232CD10B-4CA0-403C-B469-82A002F7C130}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Library", "Library", "{1DD66D11-65BD-40CB-BF05-4E7951DDFED3}" @@ -31,12 +29,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sucrose.Commandog", "Projec EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sucrose.WPF.CS", "Project\Sucrose.WPF.CS\Sucrose.WPF.CS.csproj", "{B7E4127D-30FE-4284-9B15-E74B7D09390B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sucrose.Grpc", "gRPC\Sucrose.Grpc\Sucrose.Grpc.csproj", "{340F2EDD-E01F-4B7C-B0A1-5A4BEF814534}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sucrose.Grpc.Client", "gRPC\Sucrose.Grpc.Client\Sucrose.Grpc.Client.csproj", "{0E65C7D5-CCEA-43F6-8FCD-7BA4582353BF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sucrose.Grpc.Common", "gRPC\Sucrose.Grpc.Common\Sucrose.Grpc.Common.csproj", "{11190493-676A-4ACC-BB29-99800FE8AC8F}" -EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Sucrose.Shared.Launcher", "Shared\Sucrose.Shared.Launcher\Sucrose.Shared.Launcher.shproj", "{8A0AB1F0-443D-4815-AA0A-D5B700D54827}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sucrose.Launcher", "Launcher\Sucrose.Launcher\Sucrose.Launcher.csproj", "{F6308570-6FD5-4419-A396-4949C2F642F6}" @@ -101,7 +93,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sucrose.Backgroundog", "Pro EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Sucrose.Shared.SevenZip", "Shared\Sucrose.Shared.SevenZip\Sucrose.Shared.SevenZip.shproj", "{84DA2385-E56F-47E5-AF07-06331DC04933}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sucrose.Signal", "Library\Sucrose.Signal\Sucrose.Signal.csproj", "{57E55D0B-F281-47DE-8F6B-CB0D1A118705}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sucrose.Signal", "Library\Sucrose.Signal\Sucrose.Signal.csproj", "{57E55D0B-F281-47DE-8F6B-CB0D1A118705}" EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Sucrose.Shared.Signal", "Shared\Sucrose.Shared.Signal\Sucrose.Shared.Signal.shproj", "{F46507E3-5E5D-429F-97BB-1559DD4C2B38}" EndProject @@ -181,54 +173,6 @@ Global {B7E4127D-30FE-4284-9B15-E74B7D09390B}.Release|x64.Build.0 = Release|x64 {B7E4127D-30FE-4284-9B15-E74B7D09390B}.Release|x86.ActiveCfg = Release|x86 {B7E4127D-30FE-4284-9B15-E74B7D09390B}.Release|x86.Build.0 = Release|x86 - {340F2EDD-E01F-4B7C-B0A1-5A4BEF814534}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {340F2EDD-E01F-4B7C-B0A1-5A4BEF814534}.Debug|Any CPU.Build.0 = Debug|Any CPU - {340F2EDD-E01F-4B7C-B0A1-5A4BEF814534}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {340F2EDD-E01F-4B7C-B0A1-5A4BEF814534}.Debug|ARM64.Build.0 = Debug|ARM64 - {340F2EDD-E01F-4B7C-B0A1-5A4BEF814534}.Debug|x64.ActiveCfg = Debug|x64 - {340F2EDD-E01F-4B7C-B0A1-5A4BEF814534}.Debug|x64.Build.0 = Debug|x64 - {340F2EDD-E01F-4B7C-B0A1-5A4BEF814534}.Debug|x86.ActiveCfg = Debug|x86 - {340F2EDD-E01F-4B7C-B0A1-5A4BEF814534}.Debug|x86.Build.0 = Debug|x86 - {340F2EDD-E01F-4B7C-B0A1-5A4BEF814534}.Release|Any CPU.ActiveCfg = Release|Any CPU - {340F2EDD-E01F-4B7C-B0A1-5A4BEF814534}.Release|Any CPU.Build.0 = Release|Any CPU - {340F2EDD-E01F-4B7C-B0A1-5A4BEF814534}.Release|ARM64.ActiveCfg = Release|ARM64 - {340F2EDD-E01F-4B7C-B0A1-5A4BEF814534}.Release|ARM64.Build.0 = Release|ARM64 - {340F2EDD-E01F-4B7C-B0A1-5A4BEF814534}.Release|x64.ActiveCfg = Release|x64 - {340F2EDD-E01F-4B7C-B0A1-5A4BEF814534}.Release|x64.Build.0 = Release|x64 - {340F2EDD-E01F-4B7C-B0A1-5A4BEF814534}.Release|x86.ActiveCfg = Release|x86 - {340F2EDD-E01F-4B7C-B0A1-5A4BEF814534}.Release|x86.Build.0 = Release|x86 - {0E65C7D5-CCEA-43F6-8FCD-7BA4582353BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0E65C7D5-CCEA-43F6-8FCD-7BA4582353BF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0E65C7D5-CCEA-43F6-8FCD-7BA4582353BF}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {0E65C7D5-CCEA-43F6-8FCD-7BA4582353BF}.Debug|ARM64.Build.0 = Debug|ARM64 - {0E65C7D5-CCEA-43F6-8FCD-7BA4582353BF}.Debug|x64.ActiveCfg = Debug|x64 - {0E65C7D5-CCEA-43F6-8FCD-7BA4582353BF}.Debug|x64.Build.0 = Debug|x64 - {0E65C7D5-CCEA-43F6-8FCD-7BA4582353BF}.Debug|x86.ActiveCfg = Debug|x86 - {0E65C7D5-CCEA-43F6-8FCD-7BA4582353BF}.Debug|x86.Build.0 = Debug|x86 - {0E65C7D5-CCEA-43F6-8FCD-7BA4582353BF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0E65C7D5-CCEA-43F6-8FCD-7BA4582353BF}.Release|Any CPU.Build.0 = Release|Any CPU - {0E65C7D5-CCEA-43F6-8FCD-7BA4582353BF}.Release|ARM64.ActiveCfg = Release|ARM64 - {0E65C7D5-CCEA-43F6-8FCD-7BA4582353BF}.Release|ARM64.Build.0 = Release|ARM64 - {0E65C7D5-CCEA-43F6-8FCD-7BA4582353BF}.Release|x64.ActiveCfg = Release|x64 - {0E65C7D5-CCEA-43F6-8FCD-7BA4582353BF}.Release|x64.Build.0 = Release|x64 - {0E65C7D5-CCEA-43F6-8FCD-7BA4582353BF}.Release|x86.ActiveCfg = Release|x86 - {0E65C7D5-CCEA-43F6-8FCD-7BA4582353BF}.Release|x86.Build.0 = Release|x86 - {11190493-676A-4ACC-BB29-99800FE8AC8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {11190493-676A-4ACC-BB29-99800FE8AC8F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {11190493-676A-4ACC-BB29-99800FE8AC8F}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {11190493-676A-4ACC-BB29-99800FE8AC8F}.Debug|ARM64.Build.0 = Debug|ARM64 - {11190493-676A-4ACC-BB29-99800FE8AC8F}.Debug|x64.ActiveCfg = Debug|x64 - {11190493-676A-4ACC-BB29-99800FE8AC8F}.Debug|x64.Build.0 = Debug|x64 - {11190493-676A-4ACC-BB29-99800FE8AC8F}.Debug|x86.ActiveCfg = Debug|x86 - {11190493-676A-4ACC-BB29-99800FE8AC8F}.Debug|x86.Build.0 = Debug|x86 - {11190493-676A-4ACC-BB29-99800FE8AC8F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {11190493-676A-4ACC-BB29-99800FE8AC8F}.Release|Any CPU.Build.0 = Release|Any CPU - {11190493-676A-4ACC-BB29-99800FE8AC8F}.Release|ARM64.ActiveCfg = Release|ARM64 - {11190493-676A-4ACC-BB29-99800FE8AC8F}.Release|ARM64.Build.0 = Release|ARM64 - {11190493-676A-4ACC-BB29-99800FE8AC8F}.Release|x64.ActiveCfg = Release|x64 - {11190493-676A-4ACC-BB29-99800FE8AC8F}.Release|x64.Build.0 = Release|x64 - {11190493-676A-4ACC-BB29-99800FE8AC8F}.Release|x86.ActiveCfg = Release|x86 - {11190493-676A-4ACC-BB29-99800FE8AC8F}.Release|x86.Build.0 = Release|x86 {F6308570-6FD5-4419-A396-4949C2F642F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F6308570-6FD5-4419-A396-4949C2F642F6}.Debug|Any CPU.Build.0 = Debug|Any CPU {F6308570-6FD5-4419-A396-4949C2F642F6}.Debug|ARM64.ActiveCfg = Debug|ARM64 @@ -431,9 +375,6 @@ Global {F68F78A4-2FAF-4EB1-8B67-FDF86CB7B59A} = {1DD66D11-65BD-40CB-BF05-4E7951DDFED3} {22011896-0652-4D71-BEDA-3EC200D4ED8B} = {E9FDFBCD-9AC8-4C03-8E94-17B50D0AD090} {B7E4127D-30FE-4284-9B15-E74B7D09390B} = {E9FDFBCD-9AC8-4C03-8E94-17B50D0AD090} - {340F2EDD-E01F-4B7C-B0A1-5A4BEF814534} = {E597A504-C449-4C3C-941E-F84DBA4A740C} - {0E65C7D5-CCEA-43F6-8FCD-7BA4582353BF} = {E597A504-C449-4C3C-941E-F84DBA4A740C} - {11190493-676A-4ACC-BB29-99800FE8AC8F} = {E597A504-C449-4C3C-941E-F84DBA4A740C} {8A0AB1F0-443D-4815-AA0A-D5B700D54827} = {232CD10B-4CA0-403C-B469-82A002F7C130} {F6308570-6FD5-4419-A396-4949C2F642F6} = {02D54F9E-8518-40C9-B2CD-2A4F8CA339A3} {BDC71D9E-A243-44E0-BDF7-0CEC5B184B9B} = {A98F348B-49A9-43CB-924A-9F0A40CA88B2} @@ -487,6 +428,7 @@ Global Shared\Sucrose.Shared.Dependency\Sucrose.Shared.Dependency.projitems*{5e032b27-faf9-4821-aa35-7e2a49e1e90e}*SharedItemsImports = 5 Shared\Sucrose.Shared.Live\Sucrose.Shared.Live.projitems*{5e032b27-faf9-4821-aa35-7e2a49e1e90e}*SharedItemsImports = 5 Shared\Sucrose.Shared.Resources\Sucrose.Shared.Resources.projitems*{5e032b27-faf9-4821-aa35-7e2a49e1e90e}*SharedItemsImports = 5 + Shared\Sucrose.Shared.Signal\Sucrose.Shared.Signal.projitems*{5e032b27-faf9-4821-aa35-7e2a49e1e90e}*SharedItemsImports = 5 Shared\Sucrose.Shared.Space\Sucrose.Shared.Space.projitems*{5e032b27-faf9-4821-aa35-7e2a49e1e90e}*SharedItemsImports = 5 Shared\Sucrose.Shared.Theme\Sucrose.Shared.Theme.projitems*{5e032b27-faf9-4821-aa35-7e2a49e1e90e}*SharedItemsImports = 5 Shared\Sucrose.Shared.Watchdog\Sucrose.Shared.Watchdog.projitems*{5e032b27-faf9-4821-aa35-7e2a49e1e90e}*SharedItemsImports = 5 @@ -494,7 +436,6 @@ Global 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.Live\Sucrose.Shared.Live.projitems*{68fa689e-f4c8-4a71-a603-ed5773e29f9a}*SharedItemsImports = 5 - Shared\Sucrose.Shared.Signal\Sucrose.Shared.Signal.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.Theme\Sucrose.Shared.Theme.projitems*{68fa689e-f4c8-4a71-a603-ed5773e29f9a}*SharedItemsImports = 5 Shared\Sucrose.Shared.Watchdog\Sucrose.Shared.Watchdog.projitems*{68fa689e-f4c8-4a71-a603-ed5773e29f9a}*SharedItemsImports = 5 @@ -552,7 +493,6 @@ Global Shared\Sucrose.Shared.Dependency\Sucrose.Shared.Dependency.projitems*{bdc71d9e-a243-44e0-bdf7-0cec5b184b9b}*SharedItemsImports = 5 Shared\Sucrose.Shared.Live\Sucrose.Shared.Live.projitems*{bdc71d9e-a243-44e0-bdf7-0cec5b184b9b}*SharedItemsImports = 5 Shared\Sucrose.Shared.Resources\Sucrose.Shared.Resources.projitems*{bdc71d9e-a243-44e0-bdf7-0cec5b184b9b}*SharedItemsImports = 5 - Shared\Sucrose.Shared.Signal\Sucrose.Shared.Signal.projitems*{bdc71d9e-a243-44e0-bdf7-0cec5b184b9b}*SharedItemsImports = 5 Shared\Sucrose.Shared.Space\Sucrose.Shared.Space.projitems*{bdc71d9e-a243-44e0-bdf7-0cec5b184b9b}*SharedItemsImports = 5 Shared\Sucrose.Shared.Store\Sucrose.Shared.Store.projitems*{bdc71d9e-a243-44e0-bdf7-0cec5b184b9b}*SharedItemsImports = 5 Shared\Sucrose.Shared.Theme\Sucrose.Shared.Theme.projitems*{bdc71d9e-a243-44e0-bdf7-0cec5b184b9b}*SharedItemsImports = 5 @@ -574,6 +514,7 @@ Global Shared\Sucrose.Shared.Dependency\Sucrose.Shared.Dependency.projitems*{dc4c148f-da09-473d-9dcf-058171d210ff}*SharedItemsImports = 5 Shared\Sucrose.Shared.Live\Sucrose.Shared.Live.projitems*{dc4c148f-da09-473d-9dcf-058171d210ff}*SharedItemsImports = 5 Shared\Sucrose.Shared.Resources\Sucrose.Shared.Resources.projitems*{dc4c148f-da09-473d-9dcf-058171d210ff}*SharedItemsImports = 5 + Shared\Sucrose.Shared.Signal\Sucrose.Shared.Signal.projitems*{dc4c148f-da09-473d-9dcf-058171d210ff}*SharedItemsImports = 5 Shared\Sucrose.Shared.Space\Sucrose.Shared.Space.projitems*{dc4c148f-da09-473d-9dcf-058171d210ff}*SharedItemsImports = 5 Shared\Sucrose.Shared.Theme\Sucrose.Shared.Theme.projitems*{dc4c148f-da09-473d-9dcf-058171d210ff}*SharedItemsImports = 5 Shared\Sucrose.Shared.Watchdog\Sucrose.Shared.Watchdog.projitems*{dc4c148f-da09-473d-9dcf-058171d210ff}*SharedItemsImports = 5 diff --git a/src/gRPC/Sucrose.Grpc.Client/Services/BackgroundogClientService.cs b/src/gRPC/Sucrose.Grpc.Client/Services/BackgroundogClientService.cs deleted file mode 100644 index 358e02f48..000000000 --- a/src/gRPC/Sucrose.Grpc.Client/Services/BackgroundogClientService.cs +++ /dev/null @@ -1,72 +0,0 @@ -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 BackgroundogMotherboardResponse GetMotherboard(BackgroundogClient Client) - { - BackgroundogMotherboardResponse Response = Client.MotherboardBackgroundog(new Empty()); - - return Response; - } - - public static BackgroundogNetworkResponse GetNetwork(BackgroundogClient Client) - { - BackgroundogNetworkResponse Response = Client.NetworkBackgroundog(new Empty()); - - return Response; - } - - public static BackgroundogGraphicResponse GetGraphic(BackgroundogClient Client) - { - BackgroundogGraphicResponse Response = Client.GraphicBackgroundog(new Empty()); - - return Response; - } - - public static BackgroundogBatteryResponse GetBattery(BackgroundogClient Client) - { - BackgroundogBatteryResponse Response = Client.BatteryBackgroundog(new Empty()); - - return Response; - } - - public static BackgroundogMemoryResponse GetMemory(BackgroundogClient Client) - { - BackgroundogMemoryResponse Response = Client.MemoryBackgroundog(new Empty()); - - return Response; - } - - public static BackgroundogAudioResponse GetAudio(BackgroundogClient Client) - { - BackgroundogAudioResponse Response = Client.AudioBackgroundog(new Empty()); - - return Response; - } - - public static BackgroundogDateResponse GetDate(BackgroundogClient Client) - { - BackgroundogDateResponse Response = Client.DateBackgroundog(new Empty()); - - return Response; - } - - public static BackgroundogBiosResponse GetBios(BackgroundogClient Client) - { - BackgroundogBiosResponse Response = Client.BiosBackgroundog(new Empty()); - - return Response; - } - - public static BackgroundogCpuResponse GetCpu(BackgroundogClient Client) - { - BackgroundogCpuResponse Response = Client.CpuBackgroundog(new Empty()); - - return Response; - } - } -} \ No newline at end of file diff --git a/src/gRPC/Sucrose.Grpc.Client/Services/WebsiterClientService.cs b/src/gRPC/Sucrose.Grpc.Client/Services/WebsiterClientService.cs deleted file mode 100644 index 4636c7943..000000000 --- a/src/gRPC/Sucrose.Grpc.Client/Services/WebsiterClientService.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Sucrose.Grpc.Common; -using static Sucrose.Grpc.Common.Websiter; - -namespace Sucrose.Grpc.Client.Services -{ - public static class WebsiterClientService - { - public static WebsiterChangeResponse ChangeAddress(WebsiterClient Client, string Url, bool Hook) - { - WebsiterChangeRequest Request = new() { Url = Url, Hook = Hook }; - - WebsiterChangeResponse Response = Client.ChangeAddress(Request); - - return Response; - } - } -} \ No newline at end of file diff --git a/src/gRPC/Sucrose.Grpc.Client/Sucrose.Grpc.Client.csproj b/src/gRPC/Sucrose.Grpc.Client/Sucrose.Grpc.Client.csproj deleted file mode 100644 index 34adc9249..000000000 --- a/src/gRPC/Sucrose.Grpc.Client/Sucrose.Grpc.Client.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - $([System.DateTime]::Today.ToString(yy)).$([System.DateTime]::Today.ToString(MM)).$([System.DateTime]::Today.ToString(dd)) - net48;net481;net6.0;net7.0;net8.0 - ..\..\Sucrose\Grpc.Client\$(Platform) - $(Version) - AnyCPU;ARM64;x64;x86 - enable - preview - $(Version) - preview - - - - - - - \ 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 deleted file mode 100644 index c853919ae..000000000 --- a/src/gRPC/Sucrose.Grpc.Common/Proto/Backgroundog.proto +++ /dev/null @@ -1,54 +0,0 @@ -syntax = "proto3"; - -package Sucrose.Grpc.Common.Proto.Backgroundog; -option csharp_namespace = "Sucrose.Grpc.Common"; - -import "google/protobuf/empty.proto"; - -service Backgroundog { - rpc MotherboardBackgroundog (google.protobuf.Empty) returns (BackgroundogMotherboardResponse); - rpc NetworkBackgroundog (google.protobuf.Empty) returns (BackgroundogNetworkResponse); - rpc GraphicBackgroundog (google.protobuf.Empty) returns (BackgroundogGraphicResponse); - rpc BatteryBackgroundog (google.protobuf.Empty) returns (BackgroundogBatteryResponse); - rpc MemoryBackgroundog (google.protobuf.Empty) returns (BackgroundogMemoryResponse); - rpc AudioBackgroundog (google.protobuf.Empty) returns (BackgroundogAudioResponse); - rpc DateBackgroundog (google.protobuf.Empty) returns (BackgroundogDateResponse); - rpc BiosBackgroundog (google.protobuf.Empty) returns (BackgroundogBiosResponse); - rpc CpuBackgroundog (google.protobuf.Empty) returns (BackgroundogCpuResponse); -} - -message BackgroundogMotherboardResponse { - string info = 1; -} - -message BackgroundogNetworkResponse { - string info = 1; -} - -message BackgroundogGraphicResponse { - string info = 1; -} - -message BackgroundogBatteryResponse { - string info = 1; -} - -message BackgroundogMemoryResponse { - string info = 1; -} - -message BackgroundogAudioResponse { - string info = 1; -} - -message BackgroundogDateResponse { - string info = 1; -} - -message BackgroundogBiosResponse { - string info = 1; -} - -message BackgroundogCpuResponse { - string info = 1; -} \ No newline at end of file diff --git a/src/gRPC/Sucrose.Grpc.Common/Proto/Websiter.proto b/src/gRPC/Sucrose.Grpc.Common/Proto/Websiter.proto deleted file mode 100644 index 9a9fad7eb..000000000 --- a/src/gRPC/Sucrose.Grpc.Common/Proto/Websiter.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; - -package Sucrose.Grpc.Common.Proto.Websiter; -option csharp_namespace = "Sucrose.Grpc.Common"; - -service Websiter { - rpc ChangeAddress (WebsiterChangeRequest) returns (WebsiterChangeResponse); -} - -message WebsiterChangeRequest { - string url = 1; - bool hook = 2; -} - -message WebsiterChangeResponse { - bool result = 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 deleted file mode 100644 index d89f5ec2d..000000000 --- a/src/gRPC/Sucrose.Grpc.Common/Sucrose.Grpc.Common.csproj +++ /dev/null @@ -1,34 +0,0 @@ - - - - $([System.DateTime]::Today.ToString(yy)).$([System.DateTime]::Today.ToString(MM)).$([System.DateTime]::Today.ToString(dd)) - net48;net481;net6.0;net7.0;net8.0 - ..\..\Sucrose\Grpc.Common\$(Platform) - $(Version) - AnyCPU;ARM64;x64;x86 - disable - preview - $(Version) - preview - - - - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - \ No newline at end of file diff --git a/src/gRPC/Sucrose.Grpc/Helper/Gadget.cs b/src/gRPC/Sucrose.Grpc/Helper/Gadget.cs deleted file mode 100644 index f384e5376..000000000 --- a/src/gRPC/Sucrose.Grpc/Helper/Gadget.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Net; -using System.Net.Sockets; - -namespace Sucrose.Grpc.Helper -{ - internal static class Gadget - { - public static int AvailablePort(IPAddress Host) - { - TcpListener Listener = new(Host, 0); - - Listener.Start(); - - int Port = ((IPEndPoint)Listener.LocalEndpoint).Port; - - Listener.Stop(); - - return Port; - } - } -} \ No newline at end of file diff --git a/src/gRPC/Sucrose.Grpc/Services/GeneralServerService.cs b/src/gRPC/Sucrose.Grpc/Services/GeneralServerService.cs deleted file mode 100644 index b7b28afa2..000000000 --- a/src/gRPC/Sucrose.Grpc/Services/GeneralServerService.cs +++ /dev/null @@ -1,58 +0,0 @@ -using Grpc.Core; -using System.Net; -using SGHG = Sucrose.Grpc.Helper.Gadget; - -namespace Sucrose.Grpc.Services -{ - public static class GeneralServerService - { - public static IPAddress Host = IPAddress.Loopback; - public static int Port = SGHG.AvailablePort(Host); - - public static Server ServerInstance { get; set; } - public static Channel ChannelInstance { get; set; } - - public static void ServerCreate(ServerServiceDefinition Services) - { - ServerInstance = new Server - { - Services = - { - Services - }, - Ports = - { - new ServerPort(Host.ToString(), Port, ServerCredentials.Insecure) - } - }; - } - - public static void ServerCreate(IEnumerable Services) - { - ServerInstance = new Server - { - Ports = - { - new ServerPort(Host.ToString(), Port, ServerCredentials.Insecure) - } - }; - - foreach (ServerServiceDefinition Service in Services) - { - ServerInstance.Services.Add(Service); - } - } - - public static void ChannelCreate(string Hosting = null, int Porting = -1) - { - if (string.IsNullOrEmpty(Hosting) && Porting < 0) - { - ChannelInstance = new($"{Host}:{Port}", ChannelCredentials.Insecure); - } - else - { - ChannelInstance = new($"{Hosting}:{Porting}", ChannelCredentials.Insecure); - } - } - } -} \ No newline at end of file diff --git a/src/gRPC/Sucrose.Grpc/Sucrose.Grpc.csproj b/src/gRPC/Sucrose.Grpc/Sucrose.Grpc.csproj deleted file mode 100644 index 9aee0c74e..000000000 --- a/src/gRPC/Sucrose.Grpc/Sucrose.Grpc.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - $([System.DateTime]::Today.ToString(yy)).$([System.DateTime]::Today.ToString(MM)).$([System.DateTime]::Today.ToString(dd)) - net48;net481;net6.0;net7.0;net8.0 - ..\..\Sucrose\Grpc\$(Platform) - $(Version) - AnyCPU;ARM64;x64;x86 - enable - preview - $(Version) - preview - - - - - - - \ No newline at end of file