From a55a64c7a94d2b8838839030e8d27fd9ca69ca79 Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Tue, 25 Jan 2022 21:54:23 -0700 Subject: [PATCH] WIP --- Wabbajack.Common/ProcessHelper.cs | 11 ++++ Wabbajack.DTOs.ConverterGenerators/Program.cs | 4 +- .../BrowserMessages/DownloadProgress.cs | 11 ++++ Wabbajack.DTOs/BrowserMessages/IMessage.cs | 6 ++ .../BrowserMessages/ManualDownload.cs | 16 ++++++ Wabbajack.DTOs/BrowserMessages/Terminate.cs | 9 +++ .../.gitignore | 0 .../App.axaml | 0 .../App.axaml.cs | 0 .../Assets/avalonia-logo.ico | Bin .../BrowserExtensions.cs | 0 .../CefAppImpl.cs | 1 + .../CustomWebView.cs | 52 ++++++++++++++++++ .../FodyWeavers.xml | 0 .../Program.cs | 0 .../ServiceExtensions.cs | 7 +++ .../AbsolutePathTypeConverter.cs | 25 +++++++++ .../ModListCategoryConverter.cs | 25 +++++++++ .../Verbs/AOAuthLoginVerb.cs | 4 +- .../Verbs/AVerb.cs | 0 .../Verbs/IVerb.cs | 0 .../Verbs/LoverLabLogin.cs | 0 .../Verbs/ManualDownload.cs | 42 ++++++++++++++ .../Verbs/NexusLogin.cs | 0 .../Verbs/VectorPlexusLogin.cs | 0 .../ViewLocator.cs | 0 .../ViewModels/MainWindowViewModel.cs | 0 .../ViewModels/ViewModelBase.cs | 0 .../Views/MainWindow.axaml | 5 +- .../Views/MainWindow.axaml.cs | 0 .../Wabbajack.Networking.Browser.Host.csproj | 33 +++++++++++ Wabbajack.Networking.Browser/Configuration.cs | 10 ++++ .../Wabbajack.Networking.Browser.csproj | 47 ++++++---------- Wabbajack.sln | 9 ++- 34 files changed, 281 insertions(+), 36 deletions(-) create mode 100644 Wabbajack.DTOs/BrowserMessages/DownloadProgress.cs create mode 100644 Wabbajack.DTOs/BrowserMessages/IMessage.cs create mode 100644 Wabbajack.DTOs/BrowserMessages/ManualDownload.cs create mode 100644 Wabbajack.DTOs/BrowserMessages/Terminate.cs rename {Wabbajack.Networking.Browser => Wabbajack.Networking.Browser.Host}/.gitignore (100%) rename {Wabbajack.Networking.Browser => Wabbajack.Networking.Browser.Host}/App.axaml (100%) rename {Wabbajack.Networking.Browser => Wabbajack.Networking.Browser.Host}/App.axaml.cs (100%) rename {Wabbajack.Networking.Browser => Wabbajack.Networking.Browser.Host}/Assets/avalonia-logo.ico (100%) rename {Wabbajack.Networking.Browser => Wabbajack.Networking.Browser.Host}/BrowserExtensions.cs (100%) rename {Wabbajack.Networking.Browser => Wabbajack.Networking.Browser.Host}/CefAppImpl.cs (99%) create mode 100644 Wabbajack.Networking.Browser.Host/CustomWebView.cs rename {Wabbajack.Networking.Browser => Wabbajack.Networking.Browser.Host}/FodyWeavers.xml (100%) rename {Wabbajack.Networking.Browser => Wabbajack.Networking.Browser.Host}/Program.cs (100%) rename {Wabbajack.Networking.Browser => Wabbajack.Networking.Browser.Host}/ServiceExtensions.cs (90%) create mode 100644 Wabbajack.Networking.Browser.Host/TypeConverters/AbsolutePathTypeConverter.cs create mode 100644 Wabbajack.Networking.Browser.Host/TypeConverters/ModListCategoryConverter.cs rename {Wabbajack.Networking.Browser => Wabbajack.Networking.Browser.Host}/Verbs/AOAuthLoginVerb.cs (95%) rename {Wabbajack.Networking.Browser => Wabbajack.Networking.Browser.Host}/Verbs/AVerb.cs (100%) rename {Wabbajack.Networking.Browser => Wabbajack.Networking.Browser.Host}/Verbs/IVerb.cs (100%) rename {Wabbajack.Networking.Browser => Wabbajack.Networking.Browser.Host}/Verbs/LoverLabLogin.cs (100%) create mode 100644 Wabbajack.Networking.Browser.Host/Verbs/ManualDownload.cs rename {Wabbajack.Networking.Browser => Wabbajack.Networking.Browser.Host}/Verbs/NexusLogin.cs (100%) rename {Wabbajack.Networking.Browser => Wabbajack.Networking.Browser.Host}/Verbs/VectorPlexusLogin.cs (100%) rename {Wabbajack.Networking.Browser => Wabbajack.Networking.Browser.Host}/ViewLocator.cs (100%) rename {Wabbajack.Networking.Browser => Wabbajack.Networking.Browser.Host}/ViewModels/MainWindowViewModel.cs (100%) rename {Wabbajack.Networking.Browser => Wabbajack.Networking.Browser.Host}/ViewModels/ViewModelBase.cs (100%) rename {Wabbajack.Networking.Browser => Wabbajack.Networking.Browser.Host}/Views/MainWindow.axaml (81%) rename {Wabbajack.Networking.Browser => Wabbajack.Networking.Browser.Host}/Views/MainWindow.axaml.cs (100%) create mode 100644 Wabbajack.Networking.Browser.Host/Wabbajack.Networking.Browser.Host.csproj create mode 100644 Wabbajack.Networking.Browser/Configuration.cs diff --git a/Wabbajack.Common/ProcessHelper.cs b/Wabbajack.Common/ProcessHelper.cs index 8d4c7e4a..56cd74b9 100644 --- a/Wabbajack.Common/ProcessHelper.cs +++ b/Wabbajack.Common/ProcessHelper.cs @@ -18,6 +18,8 @@ public class ProcessHelper public readonly Subject<(StreamType Type, string Line)> Output = new Subject<(StreamType Type, string)>(); + private readonly Subject _input = new(); + public IObserver Input => _input; public AbsolutePath Path { get; set; } public IEnumerable Arguments { get; set; } = Enumerable.Empty(); @@ -71,6 +73,14 @@ public class ProcessHelper }; p.ErrorDataReceived += ErrorEventHandler; + var din = _input.Subscribe(s => + { + lock (p) + { + p.StandardInput.Write(s); + } + }); + p.Start(); p.BeginErrorReadLine(); @@ -91,6 +101,7 @@ public class ProcessHelper var result = await finished.Task; // Do this to make sure everything flushes p.WaitForExit(); + din.Dispose(); p.CancelErrorRead(); p.CancelOutputRead(); p.OutputDataReceived -= OutputDataReceived; diff --git a/Wabbajack.DTOs.ConverterGenerators/Program.cs b/Wabbajack.DTOs.ConverterGenerators/Program.cs index a66ddb33..d7bd2417 100644 --- a/Wabbajack.DTOs.ConverterGenerators/Program.cs +++ b/Wabbajack.DTOs.ConverterGenerators/Program.cs @@ -1,4 +1,5 @@ -using Wabbajack.DTOs.BSA.ArchiveStates; +using Wabbajack.DTOs.BrowserMessages; +using Wabbajack.DTOs.BSA.ArchiveStates; using Wabbajack.DTOs.BSA.FileStates; using Wabbajack.DTOs.DownloadStates; @@ -13,6 +14,7 @@ internal class Program new PolymorphicGenerator().GenerateAll(cfile); new PolymorphicGenerator().GenerateAll(cfile); new PolymorphicGenerator().GenerateAll(cfile); + new PolymorphicGenerator().GenerateAll(cfile); cfile.Write(@"..\Wabbajack.DTOs\JsonConverters\Generated.cs"); diff --git a/Wabbajack.DTOs/BrowserMessages/DownloadProgress.cs b/Wabbajack.DTOs/BrowserMessages/DownloadProgress.cs new file mode 100644 index 00000000..dd56940d --- /dev/null +++ b/Wabbajack.DTOs/BrowserMessages/DownloadProgress.cs @@ -0,0 +1,11 @@ +using Wabbajack.DTOs.JsonConverters; + +namespace Wabbajack.DTOs.BrowserMessages; + +[JsonName("DownloadProgress")] +public class DownloadProgress : IMessage +{ + public bool IsDone { get; set; } + public long BytesPerSecond { get; set; } + public long BytesCompleted { get; set; } +} \ No newline at end of file diff --git a/Wabbajack.DTOs/BrowserMessages/IMessage.cs b/Wabbajack.DTOs/BrowserMessages/IMessage.cs new file mode 100644 index 00000000..d26904d7 --- /dev/null +++ b/Wabbajack.DTOs/BrowserMessages/IMessage.cs @@ -0,0 +1,6 @@ +namespace Wabbajack.DTOs.BrowserMessages; + +public interface IMessage +{ + +} \ No newline at end of file diff --git a/Wabbajack.DTOs/BrowserMessages/ManualDownload.cs b/Wabbajack.DTOs/BrowserMessages/ManualDownload.cs new file mode 100644 index 00000000..e471b91b --- /dev/null +++ b/Wabbajack.DTOs/BrowserMessages/ManualDownload.cs @@ -0,0 +1,16 @@ +using System; +using Wabbajack.DTOs.JsonConverters; +using Wabbajack.Paths; + +namespace Wabbajack.DTOs.BrowserMessages; + +/// +/// Show a manual download page for the given Url +/// +[JsonName("ManualDownload")] +public class ManualDownload : IMessage +{ + public string Prompt { get; set; } + public Uri Url { get; set; } + public AbsolutePath Path { get; set; } +} \ No newline at end of file diff --git a/Wabbajack.DTOs/BrowserMessages/Terminate.cs b/Wabbajack.DTOs/BrowserMessages/Terminate.cs new file mode 100644 index 00000000..02c18b42 --- /dev/null +++ b/Wabbajack.DTOs/BrowserMessages/Terminate.cs @@ -0,0 +1,9 @@ +using Wabbajack.DTOs.JsonConverters; + +namespace Wabbajack.DTOs.BrowserMessages; + +[JsonName("Terminate")] +public class Terminate : IMessage +{ + +} \ No newline at end of file diff --git a/Wabbajack.Networking.Browser/.gitignore b/Wabbajack.Networking.Browser.Host/.gitignore similarity index 100% rename from Wabbajack.Networking.Browser/.gitignore rename to Wabbajack.Networking.Browser.Host/.gitignore diff --git a/Wabbajack.Networking.Browser/App.axaml b/Wabbajack.Networking.Browser.Host/App.axaml similarity index 100% rename from Wabbajack.Networking.Browser/App.axaml rename to Wabbajack.Networking.Browser.Host/App.axaml diff --git a/Wabbajack.Networking.Browser/App.axaml.cs b/Wabbajack.Networking.Browser.Host/App.axaml.cs similarity index 100% rename from Wabbajack.Networking.Browser/App.axaml.cs rename to Wabbajack.Networking.Browser.Host/App.axaml.cs diff --git a/Wabbajack.Networking.Browser/Assets/avalonia-logo.ico b/Wabbajack.Networking.Browser.Host/Assets/avalonia-logo.ico similarity index 100% rename from Wabbajack.Networking.Browser/Assets/avalonia-logo.ico rename to Wabbajack.Networking.Browser.Host/Assets/avalonia-logo.ico diff --git a/Wabbajack.Networking.Browser/BrowserExtensions.cs b/Wabbajack.Networking.Browser.Host/BrowserExtensions.cs similarity index 100% rename from Wabbajack.Networking.Browser/BrowserExtensions.cs rename to Wabbajack.Networking.Browser.Host/BrowserExtensions.cs diff --git a/Wabbajack.Networking.Browser/CefAppImpl.cs b/Wabbajack.Networking.Browser.Host/CefAppImpl.cs similarity index 99% rename from Wabbajack.Networking.Browser/CefAppImpl.cs rename to Wabbajack.Networking.Browser.Host/CefAppImpl.cs index f1cbad00..2888314d 100644 --- a/Wabbajack.Networking.Browser/CefAppImpl.cs +++ b/Wabbajack.Networking.Browser.Host/CefAppImpl.cs @@ -53,6 +53,7 @@ delete newProto.webdriver; navigator.__proto__ = newProto; }", frame.Url, 0); } + protected override void OnCefProcessMessageReceived(CefProcessMessageReceivedEventArgs e) { diff --git a/Wabbajack.Networking.Browser.Host/CustomWebView.cs b/Wabbajack.Networking.Browser.Host/CustomWebView.cs new file mode 100644 index 00000000..f17d1fe1 --- /dev/null +++ b/Wabbajack.Networking.Browser.Host/CustomWebView.cs @@ -0,0 +1,52 @@ +using System; +using CefNet; +using CefNet.Avalonia; +using CefNet.Internal; +using Wabbajack.Paths; + +namespace Wabbajack.Networking.Browser; + +public class CustomWebView : WebView +{ + private CustomGlue Glue { get; } + + public CustomWebView() : base() + { + Glue = new CustomGlue(this); + } + + protected override WebViewGlue CreateWebViewGlue() + { + return Glue; + } +} + +class CustomGlue : AvaloniaWebViewGlue +{ + private readonly CustomWebView _view; + public Func? RedirectDownloadsFn { get; set; } + + public CustomGlue(CustomWebView view) : base(view) + { + _view = view; + } + + protected override void OnBeforeDownload(CefBrowser browser, CefDownloadItem downloadItem, string suggestedName, + CefBeforeDownloadCallback callback) + { + if (RedirectDownloadsFn == null) + { + base.OnBeforeDownload(browser, downloadItem, suggestedName, callback); + return; + } + + var path = RedirectDownloadsFn!(new Uri(downloadItem.OriginalUrl)); + callback.Continue(path.ToString(), false); + } + + protected override void OnDownloadUpdated(CefBrowser browser, CefDownloadItem downloadItem, CefDownloadItemCallback callback) + { + downloadItem. + base.OnDownloadUpdated(browser, downloadItem, callback); + } +} \ No newline at end of file diff --git a/Wabbajack.Networking.Browser/FodyWeavers.xml b/Wabbajack.Networking.Browser.Host/FodyWeavers.xml similarity index 100% rename from Wabbajack.Networking.Browser/FodyWeavers.xml rename to Wabbajack.Networking.Browser.Host/FodyWeavers.xml diff --git a/Wabbajack.Networking.Browser/Program.cs b/Wabbajack.Networking.Browser.Host/Program.cs similarity index 100% rename from Wabbajack.Networking.Browser/Program.cs rename to Wabbajack.Networking.Browser.Host/Program.cs diff --git a/Wabbajack.Networking.Browser/ServiceExtensions.cs b/Wabbajack.Networking.Browser.Host/ServiceExtensions.cs similarity index 90% rename from Wabbajack.Networking.Browser/ServiceExtensions.cs rename to Wabbajack.Networking.Browser.Host/ServiceExtensions.cs index a4209435..2fdc282b 100644 --- a/Wabbajack.Networking.Browser/ServiceExtensions.cs +++ b/Wabbajack.Networking.Browser.Host/ServiceExtensions.cs @@ -1,13 +1,16 @@ using System; +using System.ComponentModel; using System.Threading; using System.Threading.Tasks; using Avalonia.Threading; using CefNet; using Microsoft.Extensions.DependencyInjection; +using Wabbajack.CLI.TypeConverters; using Wabbajack.CLI.Verbs; using Wabbajack.Networking.Browser.Verbs; using Wabbajack.Networking.Browser.ViewModels; using Wabbajack.Networking.Browser.Views; +using Wabbajack.Paths; using Wabbajack.Paths.IO; using Wabbajack.Services.OSIntegrated; @@ -24,6 +27,9 @@ public static class ServiceExtensions public static IServiceCollection AddAppServices(this IServiceCollection services) { + TypeDescriptor.AddAttributes(typeof(AbsolutePath), + new TypeConverterAttribute(typeof(AbsolutePathTypeConverter))); + var resources = KnownFolders.EntryPoint; services.AddSingleton(); services.AddSingleton(); @@ -31,6 +37,7 @@ public static class ServiceExtensions services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); + services.AddSingleton(); services.AddOSIntegrated(); services.AddSingleton(s => new CefSettings diff --git a/Wabbajack.Networking.Browser.Host/TypeConverters/AbsolutePathTypeConverter.cs b/Wabbajack.Networking.Browser.Host/TypeConverters/AbsolutePathTypeConverter.cs new file mode 100644 index 00000000..39725cd0 --- /dev/null +++ b/Wabbajack.Networking.Browser.Host/TypeConverters/AbsolutePathTypeConverter.cs @@ -0,0 +1,25 @@ +using System; +using System.ComponentModel; +using System.Globalization; +using Wabbajack.Paths; + +namespace Wabbajack.CLI.TypeConverters; + +public class AbsolutePathTypeConverter : TypeConverter +{ + public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) + { + return sourceType == typeof(string); + } + + public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, + Type destinationType) + { + return (AbsolutePath) (string) value; + } + + public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) + { + return (AbsolutePath) (string) value; + } +} \ No newline at end of file diff --git a/Wabbajack.Networking.Browser.Host/TypeConverters/ModListCategoryConverter.cs b/Wabbajack.Networking.Browser.Host/TypeConverters/ModListCategoryConverter.cs new file mode 100644 index 00000000..e413e3fe --- /dev/null +++ b/Wabbajack.Networking.Browser.Host/TypeConverters/ModListCategoryConverter.cs @@ -0,0 +1,25 @@ +using System; +using System.ComponentModel; +using System.Globalization; +using Wabbajack.DTOs.GitHub; + +namespace Wabbajack.Networking.Browser.TypeConverters; + +public class ModListCategoryConverter : TypeConverter +{ + public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) + { + return sourceType == typeof(string); + } + + public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, + Type destinationType) + { + throw new NotImplementedException(); + } + + public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) + { + return Enum.Parse((string) value); + } +} \ No newline at end of file diff --git a/Wabbajack.Networking.Browser/Verbs/AOAuthLoginVerb.cs b/Wabbajack.Networking.Browser.Host/Verbs/AOAuthLoginVerb.cs similarity index 95% rename from Wabbajack.Networking.Browser/Verbs/AOAuthLoginVerb.cs rename to Wabbajack.Networking.Browser.Host/Verbs/AOAuthLoginVerb.cs index 29ff735b..ea0290cf 100644 --- a/Wabbajack.Networking.Browser/Verbs/AOAuthLoginVerb.cs +++ b/Wabbajack.Networking.Browser.Host/Verbs/AOAuthLoginVerb.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.CommandLine; using System.CommandLine.Invocation; +using System.Globalization; using System.Linq; using System.Net.Http; using System.Net.Http.Json; @@ -36,8 +37,9 @@ where TLoginType : OAuth2LoginState, new() public override Command MakeCommand() { + var textInfo = new CultureInfo("en-US", false).TextInfo; var command = new Command($"{_namePrefix}-login"); - command.Description = "Prompt the user to log into the nexus"; + command.Description = $"Prompt the user to log into {textInfo.ToTitleCase(_namePrefix.Replace("-", " "))}"; command.Handler = CommandHandler.Create(Run); return command; } diff --git a/Wabbajack.Networking.Browser/Verbs/AVerb.cs b/Wabbajack.Networking.Browser.Host/Verbs/AVerb.cs similarity index 100% rename from Wabbajack.Networking.Browser/Verbs/AVerb.cs rename to Wabbajack.Networking.Browser.Host/Verbs/AVerb.cs diff --git a/Wabbajack.Networking.Browser/Verbs/IVerb.cs b/Wabbajack.Networking.Browser.Host/Verbs/IVerb.cs similarity index 100% rename from Wabbajack.Networking.Browser/Verbs/IVerb.cs rename to Wabbajack.Networking.Browser.Host/Verbs/IVerb.cs diff --git a/Wabbajack.Networking.Browser/Verbs/LoverLabLogin.cs b/Wabbajack.Networking.Browser.Host/Verbs/LoverLabLogin.cs similarity index 100% rename from Wabbajack.Networking.Browser/Verbs/LoverLabLogin.cs rename to Wabbajack.Networking.Browser.Host/Verbs/LoverLabLogin.cs diff --git a/Wabbajack.Networking.Browser.Host/Verbs/ManualDownload.cs b/Wabbajack.Networking.Browser.Host/Verbs/ManualDownload.cs new file mode 100644 index 00000000..924011c8 --- /dev/null +++ b/Wabbajack.Networking.Browser.Host/Verbs/ManualDownload.cs @@ -0,0 +1,42 @@ +using System; +using System.CommandLine; +using System.CommandLine.Invocation; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Wabbajack.CLI.Verbs; +using Wabbajack.Paths; +using Wabbajack.Paths.IO; +using Wabbajack.Services.OSIntegrated; + +namespace Wabbajack.Networking.Browser.Verbs; + +public class ManualDownload : AVerb +{ + private readonly ILogger _logger; + + public ManualDownload(ILogger logger) + { + _logger = logger; + + } + + public override Command MakeCommand() + { + var command = new Command("manual-download"); + command.Description = "Prompt the user to download a file"; + command.Add(new Option(new[] {"-u", "-url"}, "Uri")); + command.Add(new Option); + command.Handler = CommandHandler.Create(Run); + return command; + } + + public async Task Run(Uri url) + { + await Browser.WaitForReady(); + await Browser.NavigateTo(url); + + + await Task.Delay(100000); + return 0; + } +} \ No newline at end of file diff --git a/Wabbajack.Networking.Browser/Verbs/NexusLogin.cs b/Wabbajack.Networking.Browser.Host/Verbs/NexusLogin.cs similarity index 100% rename from Wabbajack.Networking.Browser/Verbs/NexusLogin.cs rename to Wabbajack.Networking.Browser.Host/Verbs/NexusLogin.cs diff --git a/Wabbajack.Networking.Browser/Verbs/VectorPlexusLogin.cs b/Wabbajack.Networking.Browser.Host/Verbs/VectorPlexusLogin.cs similarity index 100% rename from Wabbajack.Networking.Browser/Verbs/VectorPlexusLogin.cs rename to Wabbajack.Networking.Browser.Host/Verbs/VectorPlexusLogin.cs diff --git a/Wabbajack.Networking.Browser/ViewLocator.cs b/Wabbajack.Networking.Browser.Host/ViewLocator.cs similarity index 100% rename from Wabbajack.Networking.Browser/ViewLocator.cs rename to Wabbajack.Networking.Browser.Host/ViewLocator.cs diff --git a/Wabbajack.Networking.Browser/ViewModels/MainWindowViewModel.cs b/Wabbajack.Networking.Browser.Host/ViewModels/MainWindowViewModel.cs similarity index 100% rename from Wabbajack.Networking.Browser/ViewModels/MainWindowViewModel.cs rename to Wabbajack.Networking.Browser.Host/ViewModels/MainWindowViewModel.cs diff --git a/Wabbajack.Networking.Browser/ViewModels/ViewModelBase.cs b/Wabbajack.Networking.Browser.Host/ViewModels/ViewModelBase.cs similarity index 100% rename from Wabbajack.Networking.Browser/ViewModels/ViewModelBase.cs rename to Wabbajack.Networking.Browser.Host/ViewModels/ViewModelBase.cs diff --git a/Wabbajack.Networking.Browser/Views/MainWindow.axaml b/Wabbajack.Networking.Browser.Host/Views/MainWindow.axaml similarity index 81% rename from Wabbajack.Networking.Browser/Views/MainWindow.axaml rename to Wabbajack.Networking.Browser.Host/Views/MainWindow.axaml index 33a78bb5..43e00b02 100644 --- a/Wabbajack.Networking.Browser/Views/MainWindow.axaml +++ b/Wabbajack.Networking.Browser.Host/Views/MainWindow.axaml @@ -6,10 +6,11 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:avalonia="clr-namespace:CefNet.Avalonia;assembly=CefNet.Avalonia" xmlns:reactiveUi="http://reactiveui.net" + xmlns:browser="clr-namespace:Wabbajack.Networking.Browser" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="600" x:Class="Wabbajack.Networking.Browser.Views.MainWindow" Icon="/Assets/avalonia-logo.ico" - Title="Wabbajack.Networking.Browser" + Title="Wabbajack.Networking.Browser.Host" Width="800" Height="600" @@ -25,6 +26,6 @@ - + diff --git a/Wabbajack.Networking.Browser/Views/MainWindow.axaml.cs b/Wabbajack.Networking.Browser.Host/Views/MainWindow.axaml.cs similarity index 100% rename from Wabbajack.Networking.Browser/Views/MainWindow.axaml.cs rename to Wabbajack.Networking.Browser.Host/Views/MainWindow.axaml.cs diff --git a/Wabbajack.Networking.Browser.Host/Wabbajack.Networking.Browser.Host.csproj b/Wabbajack.Networking.Browser.Host/Wabbajack.Networking.Browser.Host.csproj new file mode 100644 index 00000000..43cf54ae --- /dev/null +++ b/Wabbajack.Networking.Browser.Host/Wabbajack.Networking.Browser.Host.csproj @@ -0,0 +1,33 @@ + + + WinExe + net6.0 + enable + 10 + Wabbajack.Networking.Browser + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Wabbajack.Networking.Browser/Configuration.cs b/Wabbajack.Networking.Browser/Configuration.cs new file mode 100644 index 00000000..41b4a60c --- /dev/null +++ b/Wabbajack.Networking.Browser/Configuration.cs @@ -0,0 +1,10 @@ +using Wabbajack.Paths; +using Wabbajack.Paths.IO; + +namespace Wabbajack.Networking.Browser.Client; + +public class Configuration +{ + public AbsolutePath HostExecutable { get; set; } = + KnownFolders.EntryPoint.Combine("Wabbajack.Networking.Browser.Host.exe"); +} \ No newline at end of file diff --git a/Wabbajack.Networking.Browser/Wabbajack.Networking.Browser.csproj b/Wabbajack.Networking.Browser/Wabbajack.Networking.Browser.csproj index 9aefeb0e..c1f0a5f7 100644 --- a/Wabbajack.Networking.Browser/Wabbajack.Networking.Browser.csproj +++ b/Wabbajack.Networking.Browser/Wabbajack.Networking.Browser.csproj @@ -1,32 +1,17 @@ - - - WinExe - net6.0 - enable - latest - - - - - - - - - - - - - - - - - - - - - - - - - + + + + net6.0 + enable + enable + Wabbajack.Networking.Browser.Client + + + + + + + + + diff --git a/Wabbajack.sln b/Wabbajack.sln index dc336c52..c1fd6ae4 100644 --- a/Wabbajack.sln +++ b/Wabbajack.sln @@ -125,7 +125,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wabbajack.App.Blazor", "Wab EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{18E36813-CB53-4172-8FF3-EFE3B9B30A5F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wabbajack.Networking.Browser", "Wabbajack.Networking.Browser\Wabbajack.Networking.Browser.csproj", "{44860A8E-C3E4-4BF0-8EAB-BFA2D6DA217A}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wabbajack.Networking.Browser.Host", "Wabbajack.Networking.Browser.Host\Wabbajack.Networking.Browser.Host.csproj", "{44860A8E-C3E4-4BF0-8EAB-BFA2D6DA217A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wabbajack.Networking.Browser", "Wabbajack.Networking.Browser\Wabbajack.Networking.Browser.csproj", "{860A06B3-AE35-4C69-95E5-EC9E8D6630CF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -345,6 +347,10 @@ Global {44860A8E-C3E4-4BF0-8EAB-BFA2D6DA217A}.Debug|Any CPU.Build.0 = Debug|Any CPU {44860A8E-C3E4-4BF0-8EAB-BFA2D6DA217A}.Release|Any CPU.ActiveCfg = Release|Any CPU {44860A8E-C3E4-4BF0-8EAB-BFA2D6DA217A}.Release|Any CPU.Build.0 = Release|Any CPU + {860A06B3-AE35-4C69-95E5-EC9E8D6630CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {860A06B3-AE35-4C69-95E5-EC9E8D6630CF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {860A06B3-AE35-4C69-95E5-EC9E8D6630CF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {860A06B3-AE35-4C69-95E5-EC9E8D6630CF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -387,6 +393,7 @@ Global {AB9A5C22-10CC-4EE0-A808-FB1DC9E24247} = {F01F8595-5FD7-4506-8469-F4A5522DACC1} {D6351587-CAF6-4CB6-A2BD-5368E69F297C} = {F01F8595-5FD7-4506-8469-F4A5522DACC1} {44860A8E-C3E4-4BF0-8EAB-BFA2D6DA217A} = {F01F8595-5FD7-4506-8469-F4A5522DACC1} + {860A06B3-AE35-4C69-95E5-EC9E8D6630CF} = {F01F8595-5FD7-4506-8469-F4A5522DACC1} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {0AA30275-0F38-4A7D-B645-F5505178DDE8}