Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 138b769f81 |
1
.idea/.idea.Nebula/.idea/avalonia.xml
generated
1
.idea/.idea.Nebula/.idea/avalonia.xml
generated
@@ -45,7 +45,6 @@
|
|||||||
<entry key="Nebula.Launcher/Views/ServerListView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
<entry key="Nebula.Launcher/Views/ServerListView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||||
<entry key="Nebula.Launcher/Views/Tabs/AccountInfoTab.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
<entry key="Nebula.Launcher/Views/Tabs/AccountInfoTab.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||||
<entry key="Nebula.Launcher/Views/Tabs/ServerListTab.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
<entry key="Nebula.Launcher/Views/Tabs/ServerListTab.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
||||||
<entry key="Nebula.Launcher/Views/VisualErrorView.axaml" value="Nebula.Launcher/Nebula.Launcher.csproj" />
|
|
||||||
<entry key="Nebula.UpdateResolver/App.axaml" value="Nebula.UpdateResolver/Nebula.UpdateResolver.csproj" />
|
<entry key="Nebula.UpdateResolver/App.axaml" value="Nebula.UpdateResolver/Nebula.UpdateResolver.csproj" />
|
||||||
<entry key="Nebula.UpdateResolver/MainWindow.axaml" value="Nebula.UpdateResolver/Nebula.UpdateResolver.csproj" />
|
<entry key="Nebula.UpdateResolver/MainWindow.axaml" value="Nebula.UpdateResolver/Nebula.UpdateResolver.csproj" />
|
||||||
</map>
|
</map>
|
||||||
|
|||||||
@@ -28,16 +28,14 @@ public class App : Application
|
|||||||
{
|
{
|
||||||
case IClassicDesktopStyleApplicationLifetime desktop:
|
case IClassicDesktopStyleApplicationLifetime desktop:
|
||||||
DisableAvaloniaDataAnnotationValidation();
|
DisableAvaloniaDataAnnotationValidation();
|
||||||
desktop.MainWindow = (Window)(provider = new MessageWindow());
|
desktop.MainWindow = new MessageWindow(out provider);
|
||||||
break;
|
break;
|
||||||
case ISingleViewApplicationLifetime singleViewPlatform:
|
case ISingleViewApplicationLifetime singleViewPlatform:
|
||||||
singleViewPlatform.MainView = (Control)(provider = new MessageView());
|
singleViewPlatform.MainView = new MessageView(out provider);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
provider?.ShowMessage(
|
provider?.ShowMessage("Launcher is already running.","hey shithead!");
|
||||||
"Error: An instance of the application is already running. Please close the existing instance before launching a new one.",
|
|
||||||
"Duplicate instance detected.");
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 150 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 158 KiB |
@@ -24,9 +24,8 @@ account-auth-server = Authentication Server
|
|||||||
account-auth-button = Authenticate
|
account-auth-button = Authenticate
|
||||||
account-auth-save = Save Profile
|
account-auth-save = Save Profile
|
||||||
account-auth-hello = Hello,
|
account-auth-hello = Hello,
|
||||||
account-auth-current-server = Current server auth:
|
|
||||||
account-auth-logout = Log out
|
account-auth-logout = Log out
|
||||||
auth-current-login-name = Current login {$auth_server}: {$login}
|
auth-current-login-name = Current login: {$login}
|
||||||
auth-current-login-no-name = Profile not selected
|
auth-current-login-no-name = Profile not selected
|
||||||
|
|
||||||
auth-processing = Processing authentication request...
|
auth-processing = Processing authentication request...
|
||||||
@@ -38,7 +37,6 @@ auth-name-resolution-error = Failed to resolve server address. Check your networ
|
|||||||
auth-secure-error = Failed to cinnect to the server using SSL
|
auth-secure-error = Failed to cinnect to the server using SSL
|
||||||
auth-config-read = Reading authentication configuration...
|
auth-config-read = Reading authentication configuration...
|
||||||
auth-try-auth-config = Attempting to authenticate using saved configuration.
|
auth-try-auth-config = Attempting to authenticate using saved configuration.
|
||||||
auth-try-auth-profile = Attempting to authenticate using profile
|
|
||||||
|
|
||||||
config-export-logs = Export logs
|
config-export-logs = Export logs
|
||||||
config-open-data = Open data path
|
config-open-data = Open data path
|
||||||
|
|||||||
@@ -24,9 +24,8 @@ account-auth-server = Сервер аутентификации
|
|||||||
account-auth-button = Аутентифицировать
|
account-auth-button = Аутентифицировать
|
||||||
account-auth-save = Сохранить профиль
|
account-auth-save = Сохранить профиль
|
||||||
account-auth-hello = Привет,
|
account-auth-hello = Привет,
|
||||||
account-auth-current-server = Текущий сервер авторизации:
|
|
||||||
account-auth-logout = Выйти
|
account-auth-logout = Выйти
|
||||||
auth-current-login-name = Текущий профиль {$auth_server}: {$login}
|
auth-current-login-name = Текущий профиль: {$login}
|
||||||
auth-current-login-no-name = Профиль не выбран
|
auth-current-login-no-name = Профиль не выбран
|
||||||
|
|
||||||
auth-processing = Обработка запроса аутентификации...
|
auth-processing = Обработка запроса аутентификации...
|
||||||
@@ -38,7 +37,6 @@ auth-name-resolution-error = Не удалось разрешить адрес
|
|||||||
auth-secure-error = Не удалось подключиться к серверу по SSL. Проверьте сетевые настройки.
|
auth-secure-error = Не удалось подключиться к серверу по SSL. Проверьте сетевые настройки.
|
||||||
auth-config-read = Чтение конфигурации аутентификации...
|
auth-config-read = Чтение конфигурации аутентификации...
|
||||||
auth-try-auth-config = Попытка аутентификации с использованием сохраненной конфигурации.
|
auth-try-auth-config = Попытка аутентификации с использованием сохраненной конфигурации.
|
||||||
auth-try-auth-profile = Попытка аутентификации с использованием профиля
|
|
||||||
|
|
||||||
config-export-logs = Экспортировать логи
|
config-export-logs = Экспортировать логи
|
||||||
config-open-data = Открыть путь данных
|
config-open-data = Открыть путь данных
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using Avalonia.Media;
|
|
||||||
|
|
||||||
namespace Nebula.Launcher.ViewModels.Pages;
|
|
||||||
|
|
||||||
public static class ColorUtils
|
|
||||||
{
|
|
||||||
public static Color GetColorFromString(string input)
|
|
||||||
{
|
|
||||||
var hash = MD5.HashData(Encoding.UTF8.GetBytes(input));
|
|
||||||
|
|
||||||
var r = byte.Clamp(hash[0], 10, 200);
|
|
||||||
var g = byte.Clamp(hash[1], 10, 100);
|
|
||||||
var b = byte.Clamp(hash[2], 10, 100);
|
|
||||||
|
|
||||||
return Color.FromArgb(Byte.MaxValue, r, g, b);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
|
||||||
using Avalonia.Layout;
|
|
||||||
|
|
||||||
namespace Nebula.Launcher.ViewModels.Pages;
|
|
||||||
|
|
||||||
public sealed class ArrayUnitConfigControl : Border, IConfigControl
|
|
||||||
{
|
|
||||||
private readonly List<IConfigControl> _itemControls = [];
|
|
||||||
private readonly StackPanel _itemsPanel = new StackPanel() { Orientation = Orientation.Vertical };
|
|
||||||
private readonly Button _addButton = new Button() { Content = new Label()
|
|
||||||
{
|
|
||||||
Content = "Add Item"
|
|
||||||
}, Classes = { "ConfigBorder" }};
|
|
||||||
private readonly int _oldCount;
|
|
||||||
private readonly Type _elementType;
|
|
||||||
private readonly StackPanel _panel = new();
|
|
||||||
|
|
||||||
public string ConfigName { get; }
|
|
||||||
public bool Dirty => _itemControls.Any(dirty => dirty.Dirty) || _itemControls.Count != _oldCount;
|
|
||||||
|
|
||||||
public ArrayUnitConfigControl(string name, object value)
|
|
||||||
{
|
|
||||||
Classes.Add("ConfigBorder");
|
|
||||||
_elementType = value.GetType().GetElementType()!;
|
|
||||||
|
|
||||||
ConfigName = name;
|
|
||||||
_panel.Orientation = Orientation.Vertical;
|
|
||||||
_panel.Spacing = 4f;
|
|
||||||
_itemsPanel.Spacing = 4f;
|
|
||||||
|
|
||||||
_panel.Children.Add(new Label { Content = name });
|
|
||||||
_panel.Children.Add(_itemsPanel);
|
|
||||||
_panel.Children.Add(_addButton);
|
|
||||||
|
|
||||||
_addButton.Click += (_, _) => AddItem(ConfigControlHelper.CreateDefaultValue(_elementType)!);
|
|
||||||
Child = _panel;
|
|
||||||
SetValue(value);
|
|
||||||
_oldCount = _itemControls.Count;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AddItem(object value)
|
|
||||||
{
|
|
||||||
var itemPanel = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2 };
|
|
||||||
var control = ConfigControlHelper.GetConfigControl(_itemControls.Count.ToString(), value);
|
|
||||||
var removeButton = new Button { Content = new Label(){ Content = "Remove" }, Classes = { "ConfigBorder" }};
|
|
||||||
|
|
||||||
removeButton.Click += (_, _) =>
|
|
||||||
{
|
|
||||||
_itemControls.Remove(control);
|
|
||||||
_itemsPanel.Children.Remove(itemPanel);
|
|
||||||
};
|
|
||||||
|
|
||||||
((Control)control).Margin = new Thickness(5);
|
|
||||||
itemPanel.Children.Add((Control)control);
|
|
||||||
itemPanel.Children.Add(removeButton);
|
|
||||||
|
|
||||||
_itemsPanel.Children.Add(itemPanel);
|
|
||||||
_itemControls.Add(control);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetValue(object value)
|
|
||||||
{
|
|
||||||
_itemControls.Clear();
|
|
||||||
_itemsPanel.Children.Clear();
|
|
||||||
|
|
||||||
if (value is IEnumerable list)
|
|
||||||
{
|
|
||||||
foreach (var item in list)
|
|
||||||
{
|
|
||||||
AddItem(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public object GetValue()
|
|
||||||
{
|
|
||||||
return ConvertArray(_itemControls.Select(c => c.GetValue()).ToArray(), _elementType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Array ConvertArray(Array sourceArray, Type targetType)
|
|
||||||
{
|
|
||||||
int length = sourceArray.Length;
|
|
||||||
var newArray = Array.CreateInstance(targetType, length);
|
|
||||||
|
|
||||||
for (int i = 0; i < length; i++)
|
|
||||||
{
|
|
||||||
var value = sourceArray.GetValue(i);
|
|
||||||
var converted = Convert.ChangeType(value, targetType);
|
|
||||||
newArray.SetValue(converted, i);
|
|
||||||
}
|
|
||||||
|
|
||||||
return newArray;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Nebula.Shared.Configurations;
|
|
||||||
|
|
||||||
namespace Nebula.Launcher.Configurations;
|
|
||||||
|
|
||||||
public abstract class ComplexConVarBinder<T> : INotifyPropertyChanged, INotifyPropertyChanging
|
|
||||||
{
|
|
||||||
private readonly ConVarObserver<T> _baseConVar;
|
|
||||||
private readonly Lock _lock = new();
|
|
||||||
private readonly SemaphoreSlim _valueChangeSemaphore = new(1, 1);
|
|
||||||
|
|
||||||
public T? Value
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
lock (_lock)
|
|
||||||
{
|
|
||||||
return _baseConVar.Value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_ = SetValueAsync(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool HasValue
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
lock (_lock)
|
|
||||||
{
|
|
||||||
return _baseConVar.HasValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected ComplexConVarBinder(ConVarObserver<T> baseConVar)
|
|
||||||
{
|
|
||||||
_baseConVar = baseConVar ?? throw new ArgumentNullException(nameof(baseConVar));
|
|
||||||
_baseConVar.PropertyChanged += BaseConVarOnPropertyChanged;
|
|
||||||
_baseConVar.PropertyChanging += BaseConVarOnPropertyChanging;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private async Task SetValueAsync(T? value)
|
|
||||||
{
|
|
||||||
await _valueChangeSemaphore.WaitAsync().ConfigureAwait(false);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var newValue = await OnValueChange(value).ConfigureAwait(false);
|
|
||||||
|
|
||||||
lock (_lock)
|
|
||||||
{
|
|
||||||
_baseConVar.Value = newValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
_valueChangeSemaphore.Release();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract Task<T?> OnValueChange(T? newValue);
|
|
||||||
|
|
||||||
private void BaseConVarOnPropertyChanged(object? sender, PropertyChangedEventArgs e)
|
|
||||||
{
|
|
||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(HasValue)));
|
|
||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Value)));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void BaseConVarOnPropertyChanging(object? sender, PropertyChangingEventArgs e)
|
|
||||||
{
|
|
||||||
PropertyChanging?.Invoke(this, new PropertyChangingEventArgs(nameof(HasValue)));
|
|
||||||
PropertyChanging?.Invoke(this, new PropertyChangingEventArgs(nameof(Value)));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public event PropertyChangedEventHandler? PropertyChanged;
|
|
||||||
|
|
||||||
public event PropertyChangingEventHandler? PropertyChanging;
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
|
||||||
using Avalonia.Layout;
|
|
||||||
|
|
||||||
namespace Nebula.Launcher.ViewModels.Pages;
|
|
||||||
|
|
||||||
public sealed class ComplexUnitConfigControl : Border, IConfigControl
|
|
||||||
{
|
|
||||||
private readonly List<(PropertyInfo, IConfigControl)> _units = [];
|
|
||||||
|
|
||||||
private Type _objectType = typeof(object);
|
|
||||||
|
|
||||||
private readonly StackPanel _panel = new();
|
|
||||||
|
|
||||||
public string ConfigName { get; }
|
|
||||||
public bool Dirty => _units.Any(dirty => dirty.Item2.Dirty);
|
|
||||||
|
|
||||||
public ComplexUnitConfigControl(string name, object obj)
|
|
||||||
{
|
|
||||||
Classes.Add("ConfigBorder");
|
|
||||||
_panel.Orientation = Orientation.Vertical;
|
|
||||||
_panel.Spacing = 4f;
|
|
||||||
ConfigName = name;
|
|
||||||
Child = _panel;
|
|
||||||
SetValue(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetValue(object value)
|
|
||||||
{
|
|
||||||
_units.Clear();
|
|
||||||
_panel.Children.Clear();
|
|
||||||
_objectType = value.GetType();
|
|
||||||
|
|
||||||
_panel.Children.Add(new Label()
|
|
||||||
{
|
|
||||||
Content = ConfigName
|
|
||||||
});
|
|
||||||
|
|
||||||
foreach (var propInfo in _objectType.GetProperties())
|
|
||||||
{
|
|
||||||
if(propInfo.PropertyType.IsInterface)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
var propValue = propInfo.GetValue(value);
|
|
||||||
|
|
||||||
var control = ConfigControlHelper.GetConfigControl(propInfo.Name, propValue!);
|
|
||||||
|
|
||||||
((Control)control).Margin = new Thickness(5);
|
|
||||||
_panel.Children.Add((Control)control);
|
|
||||||
_units.Add((propInfo,control));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public object GetValue()
|
|
||||||
{
|
|
||||||
var obj = ConfigControlHelper.CreateDefaultValue(_objectType);
|
|
||||||
foreach (var (fieldInfo, configControl) in _units)
|
|
||||||
{
|
|
||||||
fieldInfo.SetValue(obj, configControl.GetValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
return obj!;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace Nebula.Launcher.ViewModels.Pages;
|
|
||||||
|
|
||||||
public static class ConfigControlHelper{
|
|
||||||
public static IConfigControl GetConfigControl(string name,object value)
|
|
||||||
{
|
|
||||||
switch (value)
|
|
||||||
{
|
|
||||||
case string stringValue:
|
|
||||||
return new StringUnitConfigControl(name, stringValue);
|
|
||||||
case int intValue:
|
|
||||||
return new IntUnitConfigControl(name, intValue);
|
|
||||||
case float floatValue:
|
|
||||||
return new FloatUnitConfigControl(name, floatValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
var valueType = value.GetType();
|
|
||||||
|
|
||||||
if (valueType.IsArray)
|
|
||||||
return new ArrayUnitConfigControl(name, value);
|
|
||||||
|
|
||||||
return new ComplexUnitConfigControl(name, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static object? CreateDefaultValue(Type type)
|
|
||||||
{
|
|
||||||
if(type.IsValueType)
|
|
||||||
return Activator.CreateInstance(type);
|
|
||||||
|
|
||||||
var ctor = type.GetConstructors().First();
|
|
||||||
var parameters = ctor.GetParameters()
|
|
||||||
.Select(p => CreateDefaultValue(p.ParameterType))
|
|
||||||
.ToArray();
|
|
||||||
|
|
||||||
return ctor.Invoke(parameters);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
using System.Globalization;
|
|
||||||
|
|
||||||
namespace Nebula.Launcher.ViewModels.Pages;
|
|
||||||
|
|
||||||
public sealed class FloatUnitConfigControl(string name, float value) : UnitConfigControl<float>(name, value)
|
|
||||||
{
|
|
||||||
|
|
||||||
public CultureInfo CultureInfo = CultureInfo.InvariantCulture;
|
|
||||||
|
|
||||||
public override void SetConfValue(float value)
|
|
||||||
{
|
|
||||||
ConfigValue = value.ToString(CultureInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override float GetConfValue()
|
|
||||||
{
|
|
||||||
return float.Parse(ConfigValue, CultureInfo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
namespace Nebula.Launcher.ViewModels.Pages;
|
|
||||||
|
|
||||||
public interface IConfigControl
|
|
||||||
{
|
|
||||||
public string ConfigName { get; }
|
|
||||||
public bool Dirty {get;}
|
|
||||||
public abstract void SetValue(object value);
|
|
||||||
public abstract object GetValue();
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
namespace Nebula.Launcher.ViewModels.Pages;
|
|
||||||
|
|
||||||
public sealed class IntUnitConfigControl(string name, int value) : UnitConfigControl<int>(name, value)
|
|
||||||
{
|
|
||||||
public override void SetConfValue(int value)
|
|
||||||
{
|
|
||||||
ConfigValue = value.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int GetConfValue()
|
|
||||||
{
|
|
||||||
return int.Parse(ConfigValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
namespace Nebula.Launcher.ViewModels.Pages;
|
|
||||||
|
|
||||||
public sealed class StringUnitConfigControl(string name, string value) : UnitConfigControl<string>(name, value)
|
|
||||||
{
|
|
||||||
public override void SetConfValue(string value)
|
|
||||||
{
|
|
||||||
ConfigValue = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string GetConfValue()
|
|
||||||
{
|
|
||||||
return ConfigValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
using Avalonia.Controls;
|
|
||||||
using Avalonia.Layout;
|
|
||||||
|
|
||||||
namespace Nebula.Launcher.ViewModels.Pages;
|
|
||||||
|
|
||||||
public abstract class UnitConfigControl<T> : Border, IConfigControl where T : notnull
|
|
||||||
{
|
|
||||||
private readonly Label _nameLabel = new();
|
|
||||||
private readonly TextBox _valueLabel = new();
|
|
||||||
private string _originalValue;
|
|
||||||
|
|
||||||
private StackPanel _panel = new();
|
|
||||||
|
|
||||||
public string ConfigName { get; }
|
|
||||||
|
|
||||||
public bool Dirty => _originalValue != ConfigValue;
|
|
||||||
|
|
||||||
protected string ConfigValue
|
|
||||||
{
|
|
||||||
get => _valueLabel.Text ?? string.Empty;
|
|
||||||
set => _valueLabel.Text = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public UnitConfigControl(string name, T value)
|
|
||||||
{
|
|
||||||
Classes.Add("ConfigBorder");
|
|
||||||
ConfigName = name;
|
|
||||||
_panel.Orientation = Orientation.Horizontal;
|
|
||||||
_panel.Children.Add(_nameLabel);
|
|
||||||
_panel.Children.Add(_valueLabel);
|
|
||||||
|
|
||||||
_nameLabel.Content = name;
|
|
||||||
_nameLabel.VerticalAlignment = VerticalAlignment.Center;
|
|
||||||
Child = _panel;
|
|
||||||
|
|
||||||
SetConfValue(value);
|
|
||||||
_originalValue = ConfigValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract void SetConfValue(T value);
|
|
||||||
|
|
||||||
public abstract T GetConfValue();
|
|
||||||
|
|
||||||
public void SetValue(object value)
|
|
||||||
{
|
|
||||||
SetConfValue((T)value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public object GetValue()
|
|
||||||
{
|
|
||||||
return GetConfValue()!;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +1,11 @@
|
|||||||
using System;
|
using Avalonia;
|
||||||
|
using Avalonia.Controls;
|
||||||
using Avalonia.Data.Converters;
|
using Avalonia.Data.Converters;
|
||||||
using Avalonia.Media;
|
using Avalonia.Media;
|
||||||
using Avalonia.Platform;
|
|
||||||
using Nebula.Launcher.ViewModels.Pages;
|
|
||||||
using Color = System.Drawing.Color;
|
|
||||||
|
|
||||||
namespace Nebula.Launcher.Converters;
|
namespace Nebula.Launcher.Converters;
|
||||||
|
|
||||||
public static class TypeConverters
|
public class TypeConverters
|
||||||
{
|
{
|
||||||
public static FuncValueConverter<string, string?> IconConverter { get; } =
|
public static FuncValueConverter<string, string?> IconConverter { get; } =
|
||||||
new(iconKey =>
|
new(iconKey =>
|
||||||
@@ -15,14 +13,4 @@ public static class TypeConverters
|
|||||||
if (iconKey == null) return null;
|
if (iconKey == null) return null;
|
||||||
return $"/Assets/svg/{iconKey}.svg";
|
return $"/Assets/svg/{iconKey}.svg";
|
||||||
});
|
});
|
||||||
|
|
||||||
public static FuncValueConverter<string, IImage?> ImageConverter { get; } =
|
|
||||||
new(iconKey =>
|
|
||||||
{
|
|
||||||
if (iconKey == null) return null;
|
|
||||||
return new Avalonia.Media.Imaging.Bitmap(AssetLoader.Open(new Uri($"avares://Nebula.Launcher/Assets/error_presentation/{iconKey}.png")));
|
|
||||||
});
|
|
||||||
|
|
||||||
public static FuncValueConverter<string, Avalonia.Media.Color> NameColorRepresentation { get; } =
|
|
||||||
new((str)=>ColorUtils.GetColorFromString(str ?? throw new ArgumentNullException(nameof(str),"Name of color is null!")));
|
|
||||||
}
|
}
|
||||||
@@ -3,8 +3,6 @@ using System.Globalization;
|
|||||||
using Nebula.Launcher.Models;
|
using Nebula.Launcher.Models;
|
||||||
using Nebula.Launcher.Models.Auth;
|
using Nebula.Launcher.Models.Auth;
|
||||||
using Nebula.Shared.ConfigMigrations;
|
using Nebula.Shared.ConfigMigrations;
|
||||||
using Nebula.Shared.Configurations;
|
|
||||||
using Nebula.Shared.Configurations.Migrations;
|
|
||||||
using Nebula.Shared.Services;
|
using Nebula.Shared.Services;
|
||||||
|
|
||||||
namespace Nebula.Launcher;
|
namespace Nebula.Launcher;
|
||||||
@@ -36,22 +34,18 @@ public static class LauncherConVar
|
|||||||
"WizDen",
|
"WizDen",
|
||||||
[
|
[
|
||||||
"https://harpy.durenko.tatar/auth-api/",
|
"https://harpy.durenko.tatar/auth-api/",
|
||||||
"https://auth.spacestation14.com/",
|
|
||||||
"https://auth.fallback.spacestation14.com/",
|
"https://auth.fallback.spacestation14.com/",
|
||||||
]),
|
|
||||||
new AuthServerCredentials(
|
|
||||||
"SimpleStation",
|
|
||||||
[
|
|
||||||
"https://auth.simplestation.org/",
|
|
||||||
])
|
])
|
||||||
]);
|
]);
|
||||||
|
|
||||||
public static readonly ConVar<ServerHubRecord[]> Hub = ConVarBuilder.Build<ServerHubRecord[]>("launcher.hub.v2", [
|
public static readonly ConVar<ServerHubRecord[]> Hub = ConVarBuilder.Build<ServerHubRecord[]>("launcher.hub.v2", [
|
||||||
new ServerHubRecord("WizDen", "https://harpy.durenko.tatar/hub-api/api/servers"),
|
new ServerHubRecord("WizDen", "https://harpy.durenko.tatar/hub-api/api/servers"),
|
||||||
new ServerHubRecord("AltHub","https://hub.singularity14.co.uk/api/servers")
|
new ServerHubRecord("AltHub","https://web.networkgamez.com/api/servers")
|
||||||
]);
|
]);
|
||||||
|
|
||||||
public static readonly ConVar<string> CurrentLang = ConVarBuilder.Build<string>("launcher.language", CultureInfo.CurrentCulture.Name);
|
public static readonly ConVar<string> CurrentLang = ConVarBuilder.Build<string>("launcher.language", CultureInfo.CurrentCulture.Name);
|
||||||
public static readonly ConVar<string> ILSpyUrl = ConVarBuilder.Build<string>("decompiler.url",
|
public static readonly ConVar<string> ILSpyUrl = ConVarBuilder.Build<string>("decompiler.url",
|
||||||
"https://github.com/icsharpcode/ILSpy/releases/download/v9.0/ILSpy_binaries_9.0.0.7889-x64.zip");
|
"https://github.com/icsharpcode/ILSpy/releases/download/v9.0/ILSpy_binaries_9.0.0.7889-x64.zip");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,9 +2,16 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:views="clr-namespace:Nebula.Launcher.Views"
|
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
|
Width="600"
|
||||||
|
Height="400"
|
||||||
x:Class="Nebula.Launcher.MessageBox.MessageView">
|
x:Class="Nebula.Launcher.MessageBox.MessageView">
|
||||||
<views:VisualErrorView x:Name="ErrorView"/>
|
<Grid RowDefinitions="50,*" ColumnDefinitions="*">
|
||||||
|
<Border Grid.Column="0" Background="#222222" Padding="10" BorderBrush="#444444" BorderThickness="0,0,0,3">
|
||||||
|
<Label VerticalAlignment="Center" x:Name="Title">Text</Label>
|
||||||
|
</Border>
|
||||||
|
<Panel Margin="5" Grid.Row="1">
|
||||||
|
<Label x:Name="Message">Message</Label>
|
||||||
|
</Panel>
|
||||||
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -1,22 +1,21 @@
|
|||||||
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Nebula.Launcher.ViewModels;
|
using Avalonia.Markup.Xaml;
|
||||||
|
|
||||||
namespace Nebula.Launcher.MessageBox;
|
namespace Nebula.Launcher.MessageBox;
|
||||||
|
|
||||||
public partial class MessageView : UserControl, IMessageContainerProvider
|
public partial class MessageView : UserControl, IMessageContainerProvider
|
||||||
{
|
{
|
||||||
private readonly VisualErrorViewModel _context;
|
public MessageView(out IMessageContainerProvider provider)
|
||||||
public MessageView()
|
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_context = new VisualErrorViewModel();
|
provider = this;
|
||||||
ErrorView.Content = _context;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowMessage(string message, string title)
|
public void ShowMessage(string message, string title)
|
||||||
{
|
{
|
||||||
_context.Title = title;
|
Title.Content = title;
|
||||||
_context.Description = message;
|
Message.Content = message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,52 +3,10 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:messageBox="clr-namespace:Nebula.Launcher.MessageBox"
|
xmlns:messageBox="clr-namespace:Nebula.Launcher.MessageBox"
|
||||||
SystemDecorations="BorderOnly"
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
mc:Ignorable="d" d:DesignWidth="600" d:DesignHeight="260"
|
|
||||||
Width="600"
|
Width="600"
|
||||||
Height="260"
|
Height="400"
|
||||||
CanResize="False"
|
|
||||||
x:Class="Nebula.Launcher.MessageBox.MessageWindow"
|
x:Class="Nebula.Launcher.MessageBox.MessageWindow"
|
||||||
Title="MessageWindow">
|
Title="MessageWindow">
|
||||||
<Grid ColumnDefinitions="*" RowDefinitions="30,*">
|
|
||||||
<messageBox:MessageView
|
|
||||||
Grid.Column="0"
|
|
||||||
Grid.Row="0"
|
|
||||||
Grid.RowSpan="2"
|
|
||||||
x:Name="MessageView" />
|
|
||||||
<Border
|
|
||||||
|
|
||||||
BorderThickness="0,0,0,2"
|
|
||||||
CornerRadius="0"
|
|
||||||
Grid.Column="0"
|
|
||||||
Grid.Row="0">
|
|
||||||
<Border.BorderBrush>
|
|
||||||
<LinearGradientBrush EndPoint="100%,50%" StartPoint="0%,50%">
|
|
||||||
<GradientStop Color="#222222" Offset="0.0" />
|
|
||||||
<GradientStop Color="#442222" Offset="1.0" />
|
|
||||||
</LinearGradientBrush>
|
|
||||||
</Border.BorderBrush>
|
|
||||||
<Panel
|
|
||||||
Height="30"
|
|
||||||
PointerPressed="InputElement_OnPointerPressed">
|
|
||||||
<TextBlock
|
|
||||||
FontSize="10"
|
|
||||||
Foreground="White"
|
|
||||||
IsVisible="False"
|
|
||||||
Margin="15,0"
|
|
||||||
Text="Nebula Launcher"
|
|
||||||
VerticalAlignment="Center" />
|
|
||||||
<StackPanel
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
Margin="5,0,5,0"
|
|
||||||
Orientation="Horizontal"
|
|
||||||
Spacing="8">
|
|
||||||
<Button
|
|
||||||
Click="Close_Click"
|
|
||||||
Content="🗙"
|
|
||||||
Foreground="Azure" />
|
|
||||||
</StackPanel>
|
|
||||||
</Panel>
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -1,28 +1,12 @@
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Input;
|
|
||||||
using Avalonia.Interactivity;
|
|
||||||
|
|
||||||
namespace Nebula.Launcher.MessageBox;
|
namespace Nebula.Launcher.MessageBox;
|
||||||
|
|
||||||
public partial class MessageWindow : Window, IMessageContainerProvider
|
public partial class MessageWindow : Window
|
||||||
{
|
{
|
||||||
public MessageWindow()
|
public MessageWindow(out IMessageContainerProvider provider)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
Content = new MessageView(out provider);
|
||||||
|
|
||||||
public void ShowMessage(string message, string title)
|
|
||||||
{
|
|
||||||
MessageView.ShowMessage(message, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Close_Click(object? sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void InputElement_OnPointerPressed(object? sender, PointerPressedEventArgs e)
|
|
||||||
{
|
|
||||||
BeginMoveDrag(e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,10 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using Avalonia.Media;
|
|
||||||
using Nebula.Shared.Services;
|
using Nebula.Shared.Services;
|
||||||
|
|
||||||
namespace Nebula.Launcher.Models.Auth;
|
namespace Nebula.Launcher.Models.Auth;
|
||||||
|
|
||||||
public sealed record ProfileAuthCredentials(
|
public sealed record ProfileAuthCredentials(
|
||||||
AuthTokenCredentials Credentials,
|
AuthTokenCredentials Credentials,
|
||||||
string AuthName,
|
|
||||||
[property: JsonIgnore] ICommand OnSelect = default!,
|
[property: JsonIgnore] ICommand OnSelect = default!,
|
||||||
[property: JsonIgnore] ICommand OnDelete = default!);
|
[property: JsonIgnore] ICommand OnDelete = default!);
|
||||||
@@ -32,6 +32,7 @@
|
|||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0"/>
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0"/>
|
||||||
<PackageReference Include="libsodium" Version="1.0.20"/>
|
<PackageReference Include="libsodium" Version="1.0.20"/>
|
||||||
<PackageReference Include="Robust.Natives" Version="0.1.1" />
|
<PackageReference Include="Robust.Natives" Version="0.1.1" />
|
||||||
|
<PackageReference Include="NLua" Version="1.7.5" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public sealed class GameProcessStartInfoProvider(DotnetResolverService resolverS
|
|||||||
{
|
{
|
||||||
var baseStart = await base.GetProcessStartInfo();
|
var baseStart = await base.GetProcessStartInfo();
|
||||||
|
|
||||||
var authProv = accountInfoViewModel.Credentials.Value;
|
var authProv = accountInfoViewModel.Credentials;
|
||||||
if(authProv is null)
|
if(authProv is null)
|
||||||
throw new Exception("Client is without selected auth");
|
throw new Exception("Client is without selected auth");
|
||||||
|
|
||||||
|
|||||||
@@ -68,12 +68,12 @@ public partial class LocalisationService
|
|||||||
public class LocaledText : MarkupExtension
|
public class LocaledText : MarkupExtension
|
||||||
{
|
{
|
||||||
public string Key { get; set; }
|
public string Key { get; set; }
|
||||||
public Dictionary<string, object>? Options { get; set; }
|
|
||||||
|
|
||||||
public LocaledText(string key) => Key = key;
|
public LocaledText(string key) => Key = key;
|
||||||
|
|
||||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||||
{
|
{
|
||||||
return LocalisationService.GetString(Key, Options);
|
// Fetch the localized string using the key
|
||||||
|
return LocalisationService.GetString(Key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
|||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Avalonia.Logging;
|
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
using CommunityToolkit.Mvvm.Input;
|
using CommunityToolkit.Mvvm.Input;
|
||||||
using Nebula.Launcher.Models;
|
using Nebula.Launcher.Models;
|
||||||
@@ -41,7 +40,15 @@ public partial class MainViewModel : ViewModelBase
|
|||||||
[ObservableProperty] private bool _isPopupClosable = true;
|
[ObservableProperty] private bool _isPopupClosable = true;
|
||||||
[ObservableProperty] private bool _popup;
|
[ObservableProperty] private bool _popup;
|
||||||
[ObservableProperty] private ListItemTemplate? _selectedListItem;
|
[ObservableProperty] private ListItemTemplate? _selectedListItem;
|
||||||
[ObservableProperty] private string? _loginText = LocalisationService.GetString("auth-current-login-no-name");
|
|
||||||
|
public bool IsLoggedIn => AccountInfoViewModel.Credentials is not null;
|
||||||
|
public string LoginName => AccountInfoViewModel.Credentials?.Login ?? string.Empty;
|
||||||
|
|
||||||
|
public string LoginText => LocalisationService.GetString("auth-current-login-name",
|
||||||
|
new Dictionary<string, object>
|
||||||
|
{
|
||||||
|
{ "login", LoginName }
|
||||||
|
});
|
||||||
|
|
||||||
[GenerateProperty] private LocalisationService LocalisationService { get; } // Не убирать! Без этой хуйни вся локализация идет в пизду!
|
[GenerateProperty] private LocalisationService LocalisationService { get; } // Не убирать! Без этой хуйни вся локализация идет в пизду!
|
||||||
[GenerateProperty] private AccountInfoViewModel AccountInfoViewModel { get; }
|
[GenerateProperty] private AccountInfoViewModel AccountInfoViewModel { get; }
|
||||||
@@ -67,14 +74,14 @@ public partial class MainViewModel : ViewModelBase
|
|||||||
|
|
||||||
protected override void Initialise()
|
protected override void Initialise()
|
||||||
{
|
{
|
||||||
AccountInfoViewModel.Credentials.PropertyChanged += (_, args) =>
|
AccountInfoViewModel.PropertyChanged += (sender, args) =>
|
||||||
{
|
{
|
||||||
if (args.PropertyName is not nameof(AccountInfoViewModel.Credentials.Value))
|
if (args.PropertyName != nameof(AccountInfoViewModel.Credentials))
|
||||||
return;
|
return;
|
||||||
UpdateCredentialsInfo();
|
|
||||||
};
|
|
||||||
|
|
||||||
UpdateCredentialsInfo();
|
OnPropertyChanged(nameof(LoginText));
|
||||||
|
OnPropertyChanged(nameof(IsLoggedIn));
|
||||||
|
};
|
||||||
|
|
||||||
_logger = DebugService.GetLogger(this);
|
_logger = DebugService.GetLogger(this);
|
||||||
|
|
||||||
@@ -103,27 +110,6 @@ public partial class MainViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateCredentialsInfo()
|
|
||||||
{
|
|
||||||
if(AccountInfoViewModel.Credentials.HasValue)
|
|
||||||
{
|
|
||||||
LoginText =
|
|
||||||
LocalisationService.GetString("auth-current-login-name",
|
|
||||||
new Dictionary<string, object>
|
|
||||||
{
|
|
||||||
{ "login", AccountInfoViewModel.Credentials.Value?.Login ?? "" },
|
|
||||||
{
|
|
||||||
"auth_server",
|
|
||||||
AccountInfoViewModel.GetServerAuthName(AccountInfoViewModel.Credentials.Value) ?? ""
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LoginText = LocalisationService.GetString("auth-current-login-no-name");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CheckMigration()
|
private void CheckMigration()
|
||||||
{
|
{
|
||||||
if (!ConfigurationService.GetConfigValue(LauncherConVar.DoMigration))
|
if (!ConfigurationService.GetConfigValue(LauncherConVar.DoMigration))
|
||||||
|
|||||||
@@ -5,12 +5,11 @@ using System.Linq;
|
|||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
using Nebula.Launcher.Configurations;
|
using CommunityToolkit.Mvvm.Input;
|
||||||
using Nebula.Launcher.Models.Auth;
|
using Nebula.Launcher.Models.Auth;
|
||||||
using Nebula.Launcher.Services;
|
using Nebula.Launcher.Services;
|
||||||
using Nebula.Launcher.ViewModels.Popup;
|
using Nebula.Launcher.ViewModels.Popup;
|
||||||
using Nebula.Launcher.Views.Pages;
|
using Nebula.Launcher.Views.Pages;
|
||||||
using Nebula.Shared.Configurations;
|
|
||||||
using Nebula.Shared.Models.Auth;
|
using Nebula.Shared.Models.Auth;
|
||||||
using Nebula.Shared.Services;
|
using Nebula.Shared.Services;
|
||||||
using Nebula.Shared.Services.Logging;
|
using Nebula.Shared.Services.Logging;
|
||||||
@@ -24,14 +23,20 @@ namespace Nebula.Launcher.ViewModels.Pages;
|
|||||||
public partial class AccountInfoViewModel : ViewModelBase
|
public partial class AccountInfoViewModel : ViewModelBase
|
||||||
{
|
{
|
||||||
[ObservableProperty] private bool _authMenuExpand;
|
[ObservableProperty] private bool _authMenuExpand;
|
||||||
|
|
||||||
[ObservableProperty] private bool _authUrlConfigExpand;
|
[ObservableProperty] private bool _authUrlConfigExpand;
|
||||||
|
|
||||||
[ObservableProperty] private int _authViewSpan = 1;
|
[ObservableProperty] private int _authViewSpan = 1;
|
||||||
|
|
||||||
[ObservableProperty] private string _currentAuthServer = string.Empty;
|
[ObservableProperty] private string _currentAuthServer = string.Empty;
|
||||||
|
|
||||||
[ObservableProperty] private string _currentLogin = string.Empty;
|
[ObservableProperty] private string _currentLogin = string.Empty;
|
||||||
|
|
||||||
[ObservableProperty] private string _currentPassword = string.Empty;
|
[ObservableProperty] private string _currentPassword = string.Empty;
|
||||||
|
|
||||||
[ObservableProperty] private bool _isLogged;
|
[ObservableProperty] private bool _isLogged;
|
||||||
[ObservableProperty] private bool _doRetryAuth;
|
[ObservableProperty] private bool _doRetryAuth;
|
||||||
[ObservableProperty] private AuthServerCredentials _authItemSelect;
|
[ObservableProperty] private AuthTokenCredentials? _credentials;
|
||||||
|
|
||||||
private bool _isProfilesEmpty;
|
private bool _isProfilesEmpty;
|
||||||
[GenerateProperty] private PopupMessageService PopupMessageService { get; } = default!;
|
[GenerateProperty] private PopupMessageService PopupMessageService { get; } = default!;
|
||||||
@@ -43,26 +48,51 @@ public partial class AccountInfoViewModel : ViewModelBase
|
|||||||
public ObservableCollection<ProfileAuthCredentials> Accounts { get; } = new();
|
public ObservableCollection<ProfileAuthCredentials> Accounts { get; } = new();
|
||||||
public ObservableCollection<AuthServerCredentials> AuthUrls { get; } = new();
|
public ObservableCollection<AuthServerCredentials> AuthUrls { get; } = new();
|
||||||
|
|
||||||
public ComplexConVarBinder<AuthTokenCredentials?> Credentials { get; private set; }
|
[ObservableProperty] private AuthServerCredentials _authItemSelect;
|
||||||
|
|
||||||
private ILogger _logger;
|
private ILogger _logger;
|
||||||
|
|
||||||
//Design think
|
//Design think
|
||||||
protected override void InitialiseInDesignMode()
|
protected override void InitialiseInDesignMode()
|
||||||
{
|
{
|
||||||
AuthUrls.Add(new AuthServerCredentials("Test",["example.com"]));
|
|
||||||
|
|
||||||
AddAccount(new AuthTokenCredentials(Guid.Empty, LoginToken.Empty, "Binka", "example.com"));
|
|
||||||
AddAccount(new AuthTokenCredentials(Guid.Empty, LoginToken.Empty, "Binka", ""));
|
AddAccount(new AuthTokenCredentials(Guid.Empty, LoginToken.Empty, "Binka", ""));
|
||||||
|
AddAccount(new AuthTokenCredentials(Guid.Empty, LoginToken.Empty, "Binka", ""));
|
||||||
|
|
||||||
|
AuthUrls.Add(new AuthServerCredentials("Test",["example.com"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Real think
|
//Real think
|
||||||
protected override void Initialise()
|
protected override void Initialise()
|
||||||
{
|
{
|
||||||
_logger = DebugService.GetLogger(this);
|
_logger = DebugService.GetLogger(this);
|
||||||
Credentials = new AuthTokenCredentialsVar(this);
|
|
||||||
Task.Run(ReadAuthConfig);
|
Task.Run(ReadAuthConfig);
|
||||||
Credentials.Value = Credentials.Value;
|
}
|
||||||
|
|
||||||
|
public async void AuthByProfile(ProfileAuthCredentials credentials)
|
||||||
|
{
|
||||||
|
var message = ViewHelperService.GetViewModel<InfoPopupViewModel>();
|
||||||
|
message.InfoText = LocalisationService.GetString("auth-try-auth-profile");
|
||||||
|
message.IsInfoClosable = false;
|
||||||
|
PopupMessageService.Popup(message);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await CatchAuthError(async () => await TryAuth(credentials.Credentials), () => message.Dispose());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
CurrentLogin = credentials.Credentials.Login;
|
||||||
|
CurrentAuthServer = credentials.Credentials.AuthServer;
|
||||||
|
|
||||||
|
var unexpectedError = new Exception(LocalisationService.GetString("auth-error"), ex);
|
||||||
|
_logger.Error(unexpectedError);
|
||||||
|
PopupMessageService.Popup(unexpectedError);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ConfigurationService.SetConfigValue(LauncherConVar.AuthCurrent, Credentials);
|
||||||
|
|
||||||
|
message.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DoAuth(string? code = null)
|
public void DoAuth(string? code = null)
|
||||||
@@ -82,32 +112,54 @@ public partial class AccountInfoViewModel : ViewModelBase
|
|||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
Exception? exception = null;
|
Exception? exception = null;
|
||||||
|
|
||||||
foreach (var server in serverCandidates)
|
foreach (var server in serverCandidates)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await CatchAuthError(async() =>
|
await CatchAuthError(async () => await TryAuth(CurrentLogin, CurrentPassword, server, code), ()=> message.Dispose());
|
||||||
{
|
|
||||||
Credentials.Value = await AuthService.Auth(CurrentLogin, CurrentPassword, server, code);
|
|
||||||
}, ()=> message.Dispose());
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
exception = new Exception(LocalisationService.GetString("auth-error"), ex);
|
var unexpectedError = new Exception(LocalisationService.GetString("auth-error"), ex);
|
||||||
|
_logger.Error(unexpectedError);
|
||||||
|
PopupMessageService.Popup(unexpectedError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
message.Dispose();
|
message.Dispose();
|
||||||
|
|
||||||
if (exception != null)
|
if (!IsLogged)
|
||||||
{
|
{
|
||||||
PopupMessageService.Popup(new Exception("Error while auth", exception));
|
PopupMessageService.Popup(exception ?? new Exception(LocalisationService.GetString("auth-error")));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task TryAuth(AuthTokenCredentials authTokenCredentials)
|
||||||
|
{
|
||||||
|
CurrentLogin = authTokenCredentials.Login;
|
||||||
|
CurrentAuthServer = authTokenCredentials.AuthServer;
|
||||||
|
await SetAuth(authTokenCredentials);
|
||||||
|
IsLogged = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task SetAuth(AuthTokenCredentials authTokenCredentials)
|
||||||
|
{
|
||||||
|
await AuthService.EnsureToken(authTokenCredentials);
|
||||||
|
Credentials = authTokenCredentials;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task TryAuth(string login, string password, string authServer, string? code)
|
||||||
|
{
|
||||||
|
Credentials = await AuthService.Auth(login, password, authServer, code);
|
||||||
|
CurrentLogin = login;
|
||||||
|
CurrentPassword = password;
|
||||||
|
CurrentAuthServer = authServer;
|
||||||
|
IsLogged = true;
|
||||||
|
ConfigurationService.SetConfigValue(LauncherConVar.AuthCurrent, Credentials);
|
||||||
|
}
|
||||||
|
|
||||||
private async Task CatchAuthError(Func<Task> a, Action? onError)
|
private async Task CatchAuthError(Func<Task> a, Action? onError)
|
||||||
{
|
{
|
||||||
DoRetryAuth = false;
|
DoRetryAuth = false;
|
||||||
@@ -124,24 +176,15 @@ public partial class AccountInfoViewModel : ViewModelBase
|
|||||||
case AuthenticateDenyCode.TfaRequired:
|
case AuthenticateDenyCode.TfaRequired:
|
||||||
case AuthenticateDenyCode.TfaInvalid:
|
case AuthenticateDenyCode.TfaInvalid:
|
||||||
var p = ViewHelperService.GetViewModel<TfaViewModel>();
|
var p = ViewHelperService.GetViewModel<TfaViewModel>();
|
||||||
|
p.OnTfaEntered += OnTfaEntered;
|
||||||
PopupMessageService.Popup(p);
|
PopupMessageService.Popup(p);
|
||||||
_logger.Log("TFA required");
|
_logger.Log("TFA required");
|
||||||
break;
|
break;
|
||||||
case AuthenticateDenyCode.InvalidCredentials:
|
case AuthenticateDenyCode.InvalidCredentials:
|
||||||
PopupError(LocalisationService.GetString("auth-invalid-credentials"), e);
|
PopupError(LocalisationService.GetString("auth-invalid-credentials"), e);
|
||||||
break;
|
break;
|
||||||
case AuthenticateDenyCode.AccountLocked:
|
|
||||||
PopupError(LocalisationService.GetString("auth-account-locked"), e);
|
|
||||||
break;
|
|
||||||
case AuthenticateDenyCode.AccountUnconfirmed:
|
|
||||||
PopupError(LocalisationService.GetString("auth-account-unconfirmed"), e);
|
|
||||||
break;
|
|
||||||
case AuthenticateDenyCode.None:
|
|
||||||
PopupError(LocalisationService.GetString("auth-none"),e);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
PopupError(LocalisationService.GetString("auth-error-fuck"), e);
|
throw;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (HttpRequestException e)
|
catch (HttpRequestException e)
|
||||||
@@ -153,41 +196,17 @@ public partial class AccountInfoViewModel : ViewModelBase
|
|||||||
PopupError(LocalisationService.GetString("auth-connection-error"), e);
|
PopupError(LocalisationService.GetString("auth-connection-error"), e);
|
||||||
DoRetryAuth = true;
|
DoRetryAuth = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HttpRequestError.NameResolutionError:
|
case HttpRequestError.NameResolutionError:
|
||||||
PopupError(LocalisationService.GetString("auth-name-resolution-error"), e);
|
PopupError(LocalisationService.GetString("auth-name-resolution-error"), e);
|
||||||
DoRetryAuth = true;
|
DoRetryAuth = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HttpRequestError.SecureConnectionError:
|
case HttpRequestError.SecureConnectionError:
|
||||||
PopupError(LocalisationService.GetString("auth-secure-error"), e);
|
PopupError(LocalisationService.GetString("auth-secure-error"), e);
|
||||||
DoRetryAuth = true;
|
DoRetryAuth = true;
|
||||||
break;
|
break;
|
||||||
case HttpRequestError.UserAuthenticationError:
|
|
||||||
PopupError(LocalisationService.GetString("auth-user-authentication-error"), e);
|
|
||||||
break;
|
|
||||||
case HttpRequestError.Unknown:
|
|
||||||
PopupError(LocalisationService.GetString("auth-unknown"), e);
|
|
||||||
break;
|
|
||||||
case HttpRequestError.HttpProtocolError:
|
|
||||||
PopupError(LocalisationService.GetString("auth-http-protocol-error"), e);
|
|
||||||
break;
|
|
||||||
case HttpRequestError.ExtendedConnectNotSupported:
|
|
||||||
PopupError(LocalisationService.GetString("auth-extended-connect-not-support"), e);
|
|
||||||
break;
|
|
||||||
case HttpRequestError.VersionNegotiationError:
|
|
||||||
PopupError(LocalisationService.GetString("auth-version-negotiation-error"), e);
|
|
||||||
break;
|
|
||||||
case HttpRequestError.ProxyTunnelError:
|
|
||||||
PopupError(LocalisationService.GetString("auth-proxy-tunnel-error"), e);
|
|
||||||
break;
|
|
||||||
case HttpRequestError.InvalidResponse:
|
|
||||||
PopupError(LocalisationService.GetString("auth-invalid-response"), e);
|
|
||||||
break;
|
|
||||||
case HttpRequestError.ResponseEnded:
|
|
||||||
PopupError(LocalisationService.GetString("auth-response-ended"), e);
|
|
||||||
break;
|
|
||||||
case HttpRequestError.ConfigurationLimitExceeded:
|
|
||||||
PopupError(LocalisationService.GetString("auth-configuration-limit-exceeded"), e);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
var authError = new Exception(LocalisationService.GetString("auth-error"), e);
|
var authError = new Exception(LocalisationService.GetString("auth-error"), e);
|
||||||
_logger.Error(authError);
|
_logger.Error(authError);
|
||||||
@@ -204,14 +223,8 @@ public partial class AccountInfoViewModel : ViewModelBase
|
|||||||
|
|
||||||
public void Logout()
|
public void Logout()
|
||||||
{
|
{
|
||||||
Credentials.Value = null;
|
IsLogged = false;
|
||||||
CurrentAuthServer = "";
|
Credentials = null;
|
||||||
}
|
|
||||||
|
|
||||||
public string GetServerAuthName(AuthTokenCredentials? credentials)
|
|
||||||
{
|
|
||||||
if (credentials is null) return "";
|
|
||||||
return AuthUrls.FirstOrDefault(p => p.Servers.Contains(credentials.AuthServer))?.Name ?? "CustomAuth";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateAuthMenu()
|
private void UpdateAuthMenu()
|
||||||
@@ -225,13 +238,10 @@ public partial class AccountInfoViewModel : ViewModelBase
|
|||||||
private void AddAccount(AuthTokenCredentials credentials)
|
private void AddAccount(AuthTokenCredentials credentials)
|
||||||
{
|
{
|
||||||
var onDelete = new DelegateCommand<ProfileAuthCredentials>(OnDeleteProfile);
|
var onDelete = new DelegateCommand<ProfileAuthCredentials>(OnDeleteProfile);
|
||||||
var onSelect = new DelegateCommand<ProfileAuthCredentials>((p) => Credentials.Value = p.Credentials);
|
var onSelect = new DelegateCommand<ProfileAuthCredentials>(AuthByProfile);
|
||||||
|
|
||||||
var serverName = GetServerAuthName(credentials);
|
|
||||||
|
|
||||||
var alpm = new ProfileAuthCredentials(
|
var alpm = new ProfileAuthCredentials(
|
||||||
credentials,
|
credentials,
|
||||||
serverName,
|
|
||||||
onSelect,
|
onSelect,
|
||||||
onDelete);
|
onDelete);
|
||||||
|
|
||||||
@@ -241,84 +251,60 @@ public partial class AccountInfoViewModel : ViewModelBase
|
|||||||
Accounts.Add(alpm);
|
Accounts.Add(alpm);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task ReadAuthConfig()
|
private void ReadAuthConfig()
|
||||||
{
|
{
|
||||||
var message = ViewHelperService.GetViewModel<InfoPopupViewModel>();
|
var message = ViewHelperService.GetViewModel<InfoPopupViewModel>();
|
||||||
message.InfoText = LocalisationService.GetString("auth-config-read");
|
message.InfoText = LocalisationService.GetString("auth-config-read");
|
||||||
message.IsInfoClosable = false;
|
message.IsInfoClosable = false;
|
||||||
PopupMessageService.Popup(message);
|
PopupMessageService.Popup(message);
|
||||||
|
foreach (var profile in
|
||||||
|
ConfigurationService.GetConfigValue(LauncherConVar.AuthProfiles)!)
|
||||||
|
AddAccount(profile);
|
||||||
|
|
||||||
_logger.Log("Reading auth config");
|
if (Accounts.Count == 0) UpdateAuthMenu();
|
||||||
|
|
||||||
AuthUrls.Clear();
|
AuthUrls.Clear();
|
||||||
var authUrls = ConfigurationService.GetConfigValue(LauncherConVar.AuthServers)!;
|
var authUrls = ConfigurationService.GetConfigValue(LauncherConVar.AuthServers)!;
|
||||||
foreach (var url in authUrls) AuthUrls.Add(url);
|
foreach (var url in authUrls) AuthUrls.Add(url);
|
||||||
if(authUrls.Length > 0) AuthItemSelect = authUrls[0];
|
if(authUrls.Length > 0) AuthItemSelect = authUrls[0];
|
||||||
|
message.Dispose();
|
||||||
|
|
||||||
var profileCandidates = new List<AuthTokenCredentials>();
|
DoCurrentAuth();
|
||||||
|
|
||||||
foreach (var profile in
|
|
||||||
ConfigurationService.GetConfigValue(LauncherConVar.AuthProfiles)!)
|
|
||||||
{
|
|
||||||
_logger.Log($"Reading profile {profile.Login}");
|
|
||||||
var checkedCredit = await CheckOrRenewToken(profile);
|
|
||||||
if(checkedCredit is null)
|
|
||||||
{
|
|
||||||
_logger.Error($"Profile {profile.Login} is not available");
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.Log($"Profile {profile.Login} is available");
|
public async void DoCurrentAuth()
|
||||||
profileCandidates.Add(checkedCredit);
|
{
|
||||||
AddAccount(checkedCredit);
|
var message = ViewHelperService.GetViewModel<InfoPopupViewModel>();
|
||||||
|
message.InfoText = LocalisationService.GetString("auth-try-auth-config");
|
||||||
|
message.IsInfoClosable = false;
|
||||||
|
PopupMessageService.Popup(message);
|
||||||
|
|
||||||
|
var currProfile = ConfigurationService.GetConfigValue(LauncherConVar.AuthCurrent);
|
||||||
|
|
||||||
|
if (currProfile != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await CatchAuthError(async () => await TryAuth(currProfile), () => message.Dispose());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
var unexpectedError = new Exception(LocalisationService.GetString("auth-error"), ex);
|
||||||
|
_logger.Error(unexpectedError);
|
||||||
|
PopupMessageService.Popup(unexpectedError);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigurationService.SetConfigValue(LauncherConVar.AuthProfiles, profileCandidates.ToArray());
|
|
||||||
|
|
||||||
if (Accounts.Count == 0) UpdateAuthMenu();
|
|
||||||
|
|
||||||
message.Dispose();
|
message.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DoCurrentAuth()
|
[RelayCommand]
|
||||||
|
private void OnSaveProfile()
|
||||||
{
|
{
|
||||||
DoAuth();
|
if(Credentials is null) return;
|
||||||
}
|
|
||||||
|
|
||||||
private async Task<AuthTokenCredentials?> CheckOrRenewToken(AuthTokenCredentials? authTokenCredentials)
|
AddAccount(Credentials);
|
||||||
{
|
|
||||||
if(authTokenCredentials is null)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
var daysLeft = (int)(authTokenCredentials.Token.ExpireTime - DateTime.Now).TotalDays;
|
|
||||||
|
|
||||||
if(daysLeft >= 4)
|
|
||||||
{
|
|
||||||
_logger.Log("Token " + authTokenCredentials.Login + " is active, "+daysLeft+" days left, undo renewing!");
|
|
||||||
return authTokenCredentials;
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
_logger.Log($"Renewing token for {authTokenCredentials.Login}");
|
|
||||||
return await ExceptionHelper.TryRun(() => AuthService.Refresh(authTokenCredentials),3, (attempt, e) =>
|
|
||||||
{
|
|
||||||
_logger.Error(new Exception("Error while renewing, attempts: " + attempt, e));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
var unexpectedError = new Exception(LocalisationService.GetString("auth-error"), e);
|
|
||||||
_logger.Error(unexpectedError);
|
|
||||||
return authTokenCredentials;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnSaveProfile()
|
|
||||||
{
|
|
||||||
if(Credentials.Value is null) return;
|
|
||||||
|
|
||||||
AddAccount(Credentials.Value);
|
|
||||||
_isProfilesEmpty = Accounts.Count == 0;
|
_isProfilesEmpty = Accounts.Count == 0;
|
||||||
UpdateAuthMenu();
|
UpdateAuthMenu();
|
||||||
DirtyProfile();
|
DirtyProfile();
|
||||||
@@ -343,12 +329,14 @@ public partial class AccountInfoViewModel : ViewModelBase
|
|||||||
PopupMessageService.Popup(messageView);
|
PopupMessageService.Popup(messageView);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnExpandAuthUrl()
|
[RelayCommand]
|
||||||
|
private void OnExpandAuthUrl()
|
||||||
{
|
{
|
||||||
AuthUrlConfigExpand = !AuthUrlConfigExpand;
|
AuthUrlConfigExpand = !AuthUrlConfigExpand;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnExpandAuthView()
|
[RelayCommand]
|
||||||
|
private void OnExpandAuthView()
|
||||||
{
|
{
|
||||||
AuthMenuExpand = !AuthMenuExpand;
|
AuthMenuExpand = !AuthMenuExpand;
|
||||||
UpdateAuthMenu();
|
UpdateAuthMenu();
|
||||||
@@ -359,75 +347,4 @@ public partial class AccountInfoViewModel : ViewModelBase
|
|||||||
ConfigurationService.SetConfigValue(LauncherConVar.AuthProfiles,
|
ConfigurationService.SetConfigValue(LauncherConVar.AuthProfiles,
|
||||||
Accounts.Select(a => a.Credentials).ToArray());
|
Accounts.Select(a => a.Credentials).ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed class AuthTokenCredentialsVar(AccountInfoViewModel accountInfoViewModel)
|
|
||||||
: ComplexConVarBinder<AuthTokenCredentials?>(
|
|
||||||
accountInfoViewModel.ConfigurationService.SubscribeVarChanged(LauncherConVar.AuthCurrent))
|
|
||||||
{
|
|
||||||
protected override async Task<AuthTokenCredentials?> OnValueChange(AuthTokenCredentials? currProfile)
|
|
||||||
{
|
|
||||||
if (currProfile is null)
|
|
||||||
{
|
|
||||||
accountInfoViewModel.IsLogged = false;
|
|
||||||
accountInfoViewModel._logger.Log("clearing credentials");
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var message = accountInfoViewModel.ViewHelperService.GetViewModel<InfoPopupViewModel>();
|
|
||||||
message.InfoText = LocalisationService.GetString("auth-try-auth-config");
|
|
||||||
message.IsInfoClosable = false;
|
|
||||||
accountInfoViewModel.PopupMessageService.Popup(message);
|
|
||||||
|
|
||||||
accountInfoViewModel._logger.Log($"trying auth with {currProfile.Login}");
|
|
||||||
|
|
||||||
var errorRun = false;
|
|
||||||
|
|
||||||
currProfile = await accountInfoViewModel.CheckOrRenewToken(currProfile);
|
|
||||||
|
|
||||||
if (currProfile is null)
|
|
||||||
{
|
|
||||||
message.Dispose();
|
|
||||||
|
|
||||||
accountInfoViewModel._logger.Log("profile credentials update required!");
|
|
||||||
|
|
||||||
accountInfoViewModel.PopupMessageService.Popup("profile credentials update required!");
|
|
||||||
|
|
||||||
accountInfoViewModel.IsLogged = false;
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await accountInfoViewModel.CatchAuthError(async () =>
|
|
||||||
{
|
|
||||||
await accountInfoViewModel.AuthService.EnsureToken(currProfile);
|
|
||||||
}, () =>
|
|
||||||
{
|
|
||||||
message.Dispose();
|
|
||||||
errorRun = true;
|
|
||||||
});
|
|
||||||
message.Dispose();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
accountInfoViewModel.CurrentLogin = currProfile.Login;
|
|
||||||
accountInfoViewModel.CurrentAuthServer = currProfile.AuthServer;
|
|
||||||
var unexpectedError = new Exception(LocalisationService.GetString("auth-error"), ex);
|
|
||||||
accountInfoViewModel._logger.Error(unexpectedError);
|
|
||||||
accountInfoViewModel.PopupMessageService.Popup(unexpectedError);
|
|
||||||
errorRun = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (errorRun)
|
|
||||||
{
|
|
||||||
accountInfoViewModel.IsLogged = false;
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
accountInfoViewModel.IsLogged = true;
|
|
||||||
|
|
||||||
return currProfile;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,20 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Layout;
|
||||||
using Nebula.Launcher.Services;
|
using Nebula.Launcher.Services;
|
||||||
using Nebula.Launcher.ViewModels.Popup;
|
using Nebula.Launcher.ViewModels.Popup;
|
||||||
using Nebula.Launcher.Views.Pages;
|
using Nebula.Launcher.Views.Pages;
|
||||||
using Nebula.Shared;
|
using Nebula.Shared;
|
||||||
using Nebula.Shared.Configurations;
|
|
||||||
using Nebula.Shared.Services;
|
using Nebula.Shared.Services;
|
||||||
using Nebula.Shared.ViewHelper;
|
using Nebula.Shared.ViewHelper;
|
||||||
|
|
||||||
@@ -113,3 +119,287 @@ public partial class ConfigurationViewModel : ViewModelBase
|
|||||||
InitConfiguration();
|
InitConfiguration();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class ConfigControlHelper{
|
||||||
|
public static IConfigControl GetConfigControl(string name,object value)
|
||||||
|
{
|
||||||
|
switch (value)
|
||||||
|
{
|
||||||
|
case string stringValue:
|
||||||
|
return new StringUnitConfigControl(name, stringValue);
|
||||||
|
case int intValue:
|
||||||
|
return new IntUnitConfigControl(name, intValue);
|
||||||
|
case float floatValue:
|
||||||
|
return new FloatUnitConfigControl(name, floatValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
var valueType = value.GetType();
|
||||||
|
|
||||||
|
if (valueType.IsArray)
|
||||||
|
return new ArrayUnitConfigControl(name, value);
|
||||||
|
|
||||||
|
return new ComplexUnitConfigControl(name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static object? CreateDefaultValue(Type type)
|
||||||
|
{
|
||||||
|
if(type.IsValueType)
|
||||||
|
return Activator.CreateInstance(type);
|
||||||
|
|
||||||
|
var ctor = type.GetConstructors().First();
|
||||||
|
var parameters = ctor.GetParameters()
|
||||||
|
.Select(p => CreateDefaultValue(p.ParameterType))
|
||||||
|
.ToArray();
|
||||||
|
|
||||||
|
return ctor.Invoke(parameters);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed class ComplexUnitConfigControl : Border, IConfigControl
|
||||||
|
{
|
||||||
|
private readonly List<(PropertyInfo, IConfigControl)> _units = [];
|
||||||
|
|
||||||
|
private Type _objectType = typeof(object);
|
||||||
|
|
||||||
|
private readonly StackPanel _panel = new();
|
||||||
|
|
||||||
|
public string ConfigName { get; }
|
||||||
|
public bool Dirty => _units.Any(dirty => dirty.Item2.Dirty);
|
||||||
|
|
||||||
|
public ComplexUnitConfigControl(string name, object obj)
|
||||||
|
{
|
||||||
|
Classes.Add("ConfigBorder");
|
||||||
|
_panel.Orientation = Orientation.Vertical;
|
||||||
|
_panel.Spacing = 4f;
|
||||||
|
ConfigName = name;
|
||||||
|
Child = _panel;
|
||||||
|
SetValue(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetValue(object value)
|
||||||
|
{
|
||||||
|
_units.Clear();
|
||||||
|
_panel.Children.Clear();
|
||||||
|
_objectType = value.GetType();
|
||||||
|
|
||||||
|
_panel.Children.Add(new Label()
|
||||||
|
{
|
||||||
|
Content = ConfigName
|
||||||
|
});
|
||||||
|
|
||||||
|
foreach (var propInfo in _objectType.GetProperties())
|
||||||
|
{
|
||||||
|
if(propInfo.PropertyType.IsInterface)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var propValue = propInfo.GetValue(value);
|
||||||
|
|
||||||
|
var control = ConfigControlHelper.GetConfigControl(propInfo.Name, propValue!);
|
||||||
|
|
||||||
|
((Control)control).Margin = new Thickness(5);
|
||||||
|
_panel.Children.Add((Control)control);
|
||||||
|
_units.Add((propInfo,control));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public object GetValue()
|
||||||
|
{
|
||||||
|
var obj = ConfigControlHelper.CreateDefaultValue(_objectType);
|
||||||
|
foreach (var (fieldInfo, configControl) in _units)
|
||||||
|
{
|
||||||
|
fieldInfo.SetValue(obj, configControl.GetValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
return obj!;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed class ArrayUnitConfigControl : Border, IConfigControl
|
||||||
|
{
|
||||||
|
private readonly List<IConfigControl> _itemControls = [];
|
||||||
|
private readonly StackPanel _itemsPanel = new StackPanel() { Orientation = Orientation.Vertical };
|
||||||
|
private readonly Button _addButton = new Button() { Content = new Label()
|
||||||
|
{
|
||||||
|
Content = "Add Item"
|
||||||
|
}, Classes = { "ConfigBorder" }};
|
||||||
|
private readonly int _oldCount;
|
||||||
|
private readonly Type _elementType;
|
||||||
|
private readonly StackPanel _panel = new();
|
||||||
|
|
||||||
|
public string ConfigName { get; }
|
||||||
|
public bool Dirty => _itemControls.Any(dirty => dirty.Dirty) || _itemControls.Count != _oldCount;
|
||||||
|
|
||||||
|
public ArrayUnitConfigControl(string name, object value)
|
||||||
|
{
|
||||||
|
Classes.Add("ConfigBorder");
|
||||||
|
_elementType = value.GetType().GetElementType()!;
|
||||||
|
|
||||||
|
ConfigName = name;
|
||||||
|
_panel.Orientation = Orientation.Vertical;
|
||||||
|
_panel.Spacing = 4f;
|
||||||
|
_itemsPanel.Spacing = 4f;
|
||||||
|
|
||||||
|
_panel.Children.Add(new Label { Content = name });
|
||||||
|
_panel.Children.Add(_itemsPanel);
|
||||||
|
_panel.Children.Add(_addButton);
|
||||||
|
|
||||||
|
_addButton.Click += (_, _) => AddItem(ConfigControlHelper.CreateDefaultValue(_elementType)!);
|
||||||
|
Child = _panel;
|
||||||
|
SetValue(value);
|
||||||
|
_oldCount = _itemControls.Count;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddItem(object value)
|
||||||
|
{
|
||||||
|
var itemPanel = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2 };
|
||||||
|
var control = ConfigControlHelper.GetConfigControl(_itemControls.Count.ToString(), value);
|
||||||
|
var removeButton = new Button { Content = new Label(){ Content = "Remove" }, Classes = { "ConfigBorder" }};
|
||||||
|
|
||||||
|
removeButton.Click += (_, _) =>
|
||||||
|
{
|
||||||
|
_itemControls.Remove(control);
|
||||||
|
_itemsPanel.Children.Remove(itemPanel);
|
||||||
|
};
|
||||||
|
|
||||||
|
((Control)control).Margin = new Thickness(5);
|
||||||
|
itemPanel.Children.Add((Control)control);
|
||||||
|
itemPanel.Children.Add(removeButton);
|
||||||
|
|
||||||
|
_itemsPanel.Children.Add(itemPanel);
|
||||||
|
_itemControls.Add(control);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetValue(object value)
|
||||||
|
{
|
||||||
|
_itemControls.Clear();
|
||||||
|
_itemsPanel.Children.Clear();
|
||||||
|
|
||||||
|
if (value is IEnumerable list)
|
||||||
|
{
|
||||||
|
foreach (var item in list)
|
||||||
|
{
|
||||||
|
AddItem(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public object GetValue()
|
||||||
|
{
|
||||||
|
return ConvertArray(_itemControls.Select(c => c.GetValue()).ToArray(), _elementType);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Array ConvertArray(Array sourceArray, Type targetType)
|
||||||
|
{
|
||||||
|
int length = sourceArray.Length;
|
||||||
|
var newArray = Array.CreateInstance(targetType, length);
|
||||||
|
|
||||||
|
for (int i = 0; i < length; i++)
|
||||||
|
{
|
||||||
|
var value = sourceArray.GetValue(i);
|
||||||
|
var converted = Convert.ChangeType(value, targetType);
|
||||||
|
newArray.SetValue(converted, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
return newArray;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract class UnitConfigControl<T> : Border, IConfigControl where T : notnull
|
||||||
|
{
|
||||||
|
private readonly Label _nameLabel = new();
|
||||||
|
private readonly TextBox _valueLabel = new();
|
||||||
|
private string _originalValue;
|
||||||
|
|
||||||
|
private StackPanel _panel = new();
|
||||||
|
|
||||||
|
public string ConfigName { get; }
|
||||||
|
|
||||||
|
public bool Dirty => _originalValue != ConfigValue;
|
||||||
|
|
||||||
|
protected string ConfigValue
|
||||||
|
{
|
||||||
|
get => _valueLabel.Text ?? string.Empty;
|
||||||
|
set => _valueLabel.Text = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UnitConfigControl(string name, T value)
|
||||||
|
{
|
||||||
|
Classes.Add("ConfigBorder");
|
||||||
|
ConfigName = name;
|
||||||
|
_panel.Orientation = Orientation.Horizontal;
|
||||||
|
_panel.Children.Add(_nameLabel);
|
||||||
|
_panel.Children.Add(_valueLabel);
|
||||||
|
|
||||||
|
_nameLabel.Content = name;
|
||||||
|
_nameLabel.VerticalAlignment = VerticalAlignment.Center;
|
||||||
|
Child = _panel;
|
||||||
|
|
||||||
|
SetConfValue(value);
|
||||||
|
_originalValue = ConfigValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void SetConfValue(T value);
|
||||||
|
|
||||||
|
public abstract T GetConfValue();
|
||||||
|
|
||||||
|
public void SetValue(object value)
|
||||||
|
{
|
||||||
|
SetConfValue((T)value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public object GetValue()
|
||||||
|
{
|
||||||
|
return GetConfValue()!;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed class StringUnitConfigControl(string name, string value) : UnitConfigControl<string>(name, value)
|
||||||
|
{
|
||||||
|
public override void SetConfValue(string value)
|
||||||
|
{
|
||||||
|
ConfigValue = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string GetConfValue()
|
||||||
|
{
|
||||||
|
return ConfigValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed class IntUnitConfigControl(string name, int value) : UnitConfigControl<int>(name, value)
|
||||||
|
{
|
||||||
|
public override void SetConfValue(int value)
|
||||||
|
{
|
||||||
|
ConfigValue = value.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int GetConfValue()
|
||||||
|
{
|
||||||
|
return int.Parse(ConfigValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed class FloatUnitConfigControl(string name, float value) : UnitConfigControl<float>(name, value)
|
||||||
|
{
|
||||||
|
|
||||||
|
public CultureInfo CultureInfo = CultureInfo.InvariantCulture;
|
||||||
|
|
||||||
|
public override void SetConfValue(float value)
|
||||||
|
{
|
||||||
|
ConfigValue = value.ToString(CultureInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override float GetConfValue()
|
||||||
|
{
|
||||||
|
return float.Parse(ConfigValue, CultureInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public interface IConfigControl
|
||||||
|
{
|
||||||
|
public string ConfigName { get; }
|
||||||
|
public bool Dirty {get;}
|
||||||
|
public abstract void SetValue(object value);
|
||||||
|
public abstract object GetValue();
|
||||||
|
}
|
||||||
@@ -416,20 +416,7 @@ public abstract class BaseFolderContentEntry : ViewModelBase, IContentEntry
|
|||||||
private Dictionary<string, IContentEntry> _childs = [];
|
private Dictionary<string, IContentEntry> _childs = [];
|
||||||
|
|
||||||
public string IconPath => "/Assets/svg/folder.svg";
|
public string IconPath => "/Assets/svg/folder.svg";
|
||||||
|
public IContentHolder Holder { get; private set; }
|
||||||
private IContentHolder? _holder = null;
|
|
||||||
public IContentHolder Holder
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if(_holder == null)
|
|
||||||
throw new InvalidOperationException(
|
|
||||||
GetType().Name + " was not initialised! Call Init(IContentHolder holder, string? name = null) before using it.");
|
|
||||||
|
|
||||||
return _holder;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public IContentEntry? Parent { get; set; }
|
public IContentEntry? Parent { get; set; }
|
||||||
public string? Name { get; private set; }
|
public string? Name { get; private set; }
|
||||||
|
|
||||||
@@ -445,7 +432,7 @@ public abstract class BaseFolderContentEntry : ViewModelBase, IContentEntry
|
|||||||
public void Init(IContentHolder holder, string? name = null)
|
public void Init(IContentHolder holder, string? name = null)
|
||||||
{
|
{
|
||||||
Name = name;
|
Name = name;
|
||||||
_holder = holder;
|
Holder = holder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public T AddChild<T>(T child) where T: IContentEntry
|
public T AddChild<T>(T child) where T: IContentEntry
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ public abstract class PopupViewModelBase : ViewModelBase, IDisposable
|
|||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
OnDispose();
|
|
||||||
PopupMessageService.ClosePopup(this);
|
PopupMessageService.ClosePopup(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnDispose(){}
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using Nebula.Launcher.Services;
|
using Nebula.Launcher.Services;
|
||||||
using Nebula.Launcher.ViewModels.Pages;
|
|
||||||
using Nebula.Launcher.Views.Popup;
|
using Nebula.Launcher.Views.Popup;
|
||||||
using Nebula.Shared.Services;
|
using Nebula.Shared.Services;
|
||||||
using Nebula.Shared.ViewHelper;
|
using Nebula.Shared.ViewHelper;
|
||||||
@@ -10,10 +9,7 @@ namespace Nebula.Launcher.ViewModels.Popup;
|
|||||||
[ConstructGenerator, ViewModelRegister(typeof(TfaView))]
|
[ConstructGenerator, ViewModelRegister(typeof(TfaView))]
|
||||||
public partial class TfaViewModel : PopupViewModelBase
|
public partial class TfaViewModel : PopupViewModelBase
|
||||||
{
|
{
|
||||||
[GenerateProperty] public override PopupMessageService PopupMessageService { get; }
|
public Action<string>? OnTfaEntered;
|
||||||
[GenerateProperty] public AccountInfoViewModel AccountInfo { get; }
|
|
||||||
public override string Title => LocalisationService.GetString("popup-twofa");
|
|
||||||
public override bool IsClosable => true;
|
|
||||||
|
|
||||||
protected override void InitialiseInDesignMode()
|
protected override void InitialiseInDesignMode()
|
||||||
{
|
{
|
||||||
@@ -25,7 +21,11 @@ public partial class TfaViewModel : PopupViewModelBase
|
|||||||
|
|
||||||
public void OnTfaEnter(string code)
|
public void OnTfaEnter(string code)
|
||||||
{
|
{
|
||||||
AccountInfo.DoAuth(code);
|
OnTfaEntered?.Invoke(code);
|
||||||
Dispose();
|
Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[GenerateProperty] public override PopupMessageService PopupMessageService { get; }
|
||||||
|
public override string Title => LocalisationService.GetString("popup-twofa");
|
||||||
|
public override bool IsClosable => true;
|
||||||
}
|
}
|
||||||
@@ -174,8 +174,7 @@ public partial class ServerEntryModelView : ViewModelBase, IFilterConsumer, ILis
|
|||||||
|
|
||||||
private async Task RunInstanceAsync(bool ignoreLoginCredentials = false)
|
private async Task RunInstanceAsync(bool ignoreLoginCredentials = false)
|
||||||
{
|
{
|
||||||
_logger.Log("Running instance..." + RealName);
|
if (!ignoreLoginCredentials && AccountInfoViewModel.Credentials is null)
|
||||||
if (!ignoreLoginCredentials && AccountInfoViewModel.Credentials.Value is null)
|
|
||||||
{
|
{
|
||||||
var warningContext = ViewHelperService.GetViewModel<IsLoginCredentialsNullPopupViewModel>()
|
var warningContext = ViewHelperService.GetViewModel<IsLoginCredentialsNullPopupViewModel>()
|
||||||
.WithServerEntry(this);
|
.WithServerEntry(this);
|
||||||
@@ -184,8 +183,6 @@ public partial class ServerEntryModelView : ViewModelBase, IFilterConsumer, ILis
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
using var loadingContext = ViewHelperService.GetViewModel<LoadingContextViewModel>();
|
using var loadingContext = ViewHelperService.GetViewModel<LoadingContextViewModel>();
|
||||||
loadingContext.LoadingName = "Loading instance...";
|
loadingContext.LoadingName = "Loading instance...";
|
||||||
((ILoadingHandler)loadingContext).AppendJob();
|
((ILoadingHandler)loadingContext).AppendJob();
|
||||||
@@ -193,21 +190,12 @@ public partial class ServerEntryModelView : ViewModelBase, IFilterConsumer, ILis
|
|||||||
PopupMessageService.Popup(loadingContext);
|
PopupMessageService.Popup(loadingContext);
|
||||||
_currentInstance =
|
_currentInstance =
|
||||||
await GameRunnerPreparer.GetGameProcessStartInfoProvider(Address, loadingContext, CancellationService.Token);
|
await GameRunnerPreparer.GetGameProcessStartInfoProvider(Address, loadingContext, CancellationService.Token);
|
||||||
_logger.Log("Preparing instance...");
|
|
||||||
_currentInstance.RegisterLogger(_currentContentLogConsumer);
|
_currentInstance.RegisterLogger(_currentContentLogConsumer);
|
||||||
_currentInstance.RegisterLogger(new DebugLoggerBridge(DebugService.GetLogger($"PROCESS_{Random.Shared.Next(65535)}")));
|
_currentInstance.RegisterLogger(new DebugLoggerBridge(DebugService.GetLogger($"PROCESS_{Random.Shared.Next(65535)}")));
|
||||||
_currentInstance.OnProcessExited += OnProcessExited;
|
_currentInstance.OnProcessExited += OnProcessExited;
|
||||||
RunVisible = false;
|
RunVisible = false;
|
||||||
_currentInstance.Start();
|
_currentInstance.Start();
|
||||||
_logger.Log("Starting instance..." + RealName);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
var error = new Exception("Error while attempt run instance", e);
|
|
||||||
_logger.Error(error);
|
|
||||||
PopupMessageService.Popup(error);
|
|
||||||
RunVisible = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnProcessExited(ProcessRunHandler<GameProcessStartInfoProvider> obj)
|
private void OnProcessExited(ProcessRunHandler<GameProcessStartInfoProvider> obj)
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
|
||||||
using Nebula.Launcher.Views;
|
|
||||||
using Nebula.Shared.ViewHelper;
|
|
||||||
|
|
||||||
namespace Nebula.Launcher.ViewModels;
|
|
||||||
|
|
||||||
|
|
||||||
[ViewModelRegister(typeof(VisualErrorView))]
|
|
||||||
public partial class VisualErrorViewModel : ViewModelBase
|
|
||||||
{
|
|
||||||
[ObservableProperty] private string _imgPath = "cinka";
|
|
||||||
[ObservableProperty] private string _title = "Error";
|
|
||||||
[ObservableProperty] private string _description = "This is an error.";
|
|
||||||
|
|
||||||
protected override void InitialiseInDesignMode()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Initialise()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -133,9 +133,8 @@
|
|||||||
Path="/Assets/svg/user.svg"
|
Path="/Assets/svg/user.svg"
|
||||||
Width="10" />
|
Width="10" />
|
||||||
<Panel>
|
<Panel>
|
||||||
<TextBlock
|
<TextBlock Foreground="#777777" IsVisible="{Binding IsLoggedIn}" Text="{Binding LoginText}"/>
|
||||||
Foreground="#777777"
|
<TextBlock Foreground="#777777" IsVisible="{Binding !IsLoggedIn}" Text="{services:LocaledText auth-current-login-no-name}"/>
|
||||||
Text="{Binding LoginText}"/>
|
|
||||||
</Panel>
|
</Panel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<UserControl
|
<UserControl
|
||||||
d:DesignHeight="450"
|
d:DesignHeight="450"
|
||||||
d:DesignWidth="1000"
|
d:DesignWidth="800"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
x:Class="Nebula.Launcher.Views.Pages.AccountInfoView"
|
x:Class="Nebula.Launcher.Views.Pages.AccountInfoView"
|
||||||
x:DataType="pages:AccountInfoViewModel"
|
x:DataType="pages:AccountInfoViewModel"
|
||||||
@@ -10,8 +10,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:pages="clr-namespace:Nebula.Launcher.ViewModels.Pages"
|
xmlns:pages="clr-namespace:Nebula.Launcher.ViewModels.Pages"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:auth="clr-namespace:Nebula.Launcher.Models.Auth"
|
xmlns:auth="clr-namespace:Nebula.Launcher.Models.Auth">
|
||||||
xmlns:converters="clr-namespace:Nebula.Launcher.Converters">
|
|
||||||
<Design.DataContext>
|
<Design.DataContext>
|
||||||
<pages:AccountInfoViewModel />
|
<pages:AccountInfoViewModel />
|
||||||
</Design.DataContext>
|
</Design.DataContext>
|
||||||
@@ -40,57 +39,39 @@
|
|||||||
Padding="0">
|
Padding="0">
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate DataType="{x:Type auth:ProfileAuthCredentials}">
|
<DataTemplate DataType="{x:Type auth:ProfileAuthCredentials}">
|
||||||
<Grid ColumnDefinitions="4*,*">
|
|
||||||
<Border
|
<Border
|
||||||
BoxShadow="0 1 15 -2 #121212"
|
BoxShadow="0 1 15 -2 #121212"
|
||||||
CornerRadius="0,10,0,10"
|
CornerRadius="0,10,0,10"
|
||||||
Margin="5,5,5,0">
|
Margin="5,5,5,0"
|
||||||
|
VerticalAlignment="Center">
|
||||||
<Border.Background>
|
<Border.Background>
|
||||||
<LinearGradientBrush EndPoint="100%,50%" StartPoint="20%,50%">
|
<LinearGradientBrush EndPoint="50%,100%" StartPoint="50%,0%">
|
||||||
<GradientStop Color="{Binding Credentials.AuthServer,
|
<GradientStop Color="#292222" Offset="0.0" />
|
||||||
Converter={x:Static converters:TypeConverters.NameColorRepresentation}}" Offset="0.0" />
|
|
||||||
<GradientStop Color="#222222" Offset="1.0" />
|
<GradientStop Color="#222222" Offset="1.0" />
|
||||||
</LinearGradientBrush>
|
</LinearGradientBrush>
|
||||||
</Border.Background>
|
</Border.Background>
|
||||||
|
<Panel>
|
||||||
|
<StackPanel Margin="10,5,5,5" Orientation="Horizontal">
|
||||||
<Label>
|
<Label>
|
||||||
<TextBlock Text="{Binding AuthName}" Margin="5"/>
|
<TextBlock Text="{Binding Credentials.Login}" />
|
||||||
</Label>
|
</Label>
|
||||||
</Border>
|
</StackPanel>
|
||||||
<Border Grid.Column="0"
|
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
||||||
CornerRadius="0,10,0,10"
|
|
||||||
Margin="5,5,5,0">
|
|
||||||
<Border.Background>
|
|
||||||
<LinearGradientBrush EndPoint="100%,50%" StartPoint="20%,50%">
|
|
||||||
<GradientStop Color="#aa222222" Offset="0.0" />
|
|
||||||
<GradientStop Color="#222222" Offset="0.4" />
|
|
||||||
</LinearGradientBrush>
|
|
||||||
</Border.Background>
|
|
||||||
<Button
|
<Button
|
||||||
HorizontalAlignment="Stretch"
|
Command="{Binding OnSelect}"
|
||||||
Command="{Binding OnSelect}">
|
CornerRadius="0,0,0,10"
|
||||||
<Label>
|
Padding="5">
|
||||||
<TextBlock Text="{Binding Credentials.Login}" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,5,0"/>
|
<customControls:LocalizedLabel LocalId="account-profile-select"/>
|
||||||
</Label>
|
|
||||||
</Button>
|
</Button>
|
||||||
</Border>
|
<Button
|
||||||
<Border
|
Command="{Binding OnDelete}"
|
||||||
BoxShadow="0 1 15 -2 #121212"
|
CornerRadius="0,10,0,0"
|
||||||
CornerRadius="0,10,0,10"
|
Padding="5">
|
||||||
Margin="0,5,5,0" Grid.Column="1" Padding="0">
|
<customControls:LocalizedLabel LocalId="account-profile-delete"/>
|
||||||
<Border.Background>
|
|
||||||
<LinearGradientBrush EndPoint="100%,50%" StartPoint="20%,50%">
|
|
||||||
<GradientStop Color="#292222" Offset="1.0" />
|
|
||||||
<GradientStop Color="#222222" Offset="1.0" />
|
|
||||||
</LinearGradientBrush>
|
|
||||||
</Border.Background>
|
|
||||||
<Button Command="{Binding OnDelete}" CornerRadius="0,10,0,10" HorizontalAlignment="Stretch">
|
|
||||||
<Svg
|
|
||||||
Height="15"
|
|
||||||
Path="/Assets/svg/delete.svg"
|
|
||||||
Width="15" />
|
|
||||||
</Button>
|
</Button>
|
||||||
|
</StackPanel>
|
||||||
|
</Panel>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
@@ -140,7 +121,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<customControls:LocalizedLabel VerticalAlignment="Center" LocalId="account-auth-server"/>
|
<customControls:LocalizedLabel VerticalAlignment="Center" LocalId="account-auth-server"/>
|
||||||
<Button Command="{Binding OnExpandAuthUrl}" VerticalAlignment="Stretch">
|
<Button Command="{Binding ExpandAuthUrlCommand}" VerticalAlignment="Stretch">
|
||||||
<Label>+</Label>
|
<Label>+</Label>
|
||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
@@ -175,7 +156,7 @@
|
|||||||
<customControls:LocalizedLabel LocalId="account-auth-button"/>
|
<customControls:LocalizedLabel LocalId="account-auth-button"/>
|
||||||
</Button>
|
</Button>
|
||||||
</Border>
|
</Border>
|
||||||
<Button Command="{Binding OnExpandAuthView}" HorizontalAlignment="Right">
|
<Button Command="{Binding ExpandAuthViewCommand}" HorizontalAlignment="Right">
|
||||||
<Label>
|
<Label>
|
||||||
>
|
>
|
||||||
</Label>
|
</Label>
|
||||||
@@ -188,15 +169,9 @@
|
|||||||
Margin="0,0,0,20"
|
Margin="0,0,0,20"
|
||||||
Path="/Assets/svg/user.svg" />
|
Path="/Assets/svg/user.svg" />
|
||||||
<Label>
|
<Label>
|
||||||
<StackPanel>
|
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
|
||||||
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal" Spacing="5">
|
|
||||||
<customControls:LocalizedLabel LocalId="account-auth-hello"/>
|
<customControls:LocalizedLabel LocalId="account-auth-hello"/>
|
||||||
<TextBlock Text="{Binding Credentials.Value.Login}" />
|
<TextBlock Text="{Binding CurrentLogin}" />
|
||||||
</StackPanel>
|
|
||||||
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal" Spacing="5">
|
|
||||||
<customControls:LocalizedLabel LocalId="account-auth-current-server"/>
|
|
||||||
<TextBlock Text="{Binding Credentials.Value.AuthServer}" />
|
|
||||||
</StackPanel>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Label>
|
</Label>
|
||||||
<StackPanel
|
<StackPanel
|
||||||
@@ -210,7 +185,7 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</Border>
|
</Border>
|
||||||
<Border BoxShadow="{StaticResource DefaultShadow}">
|
<Border BoxShadow="{StaticResource DefaultShadow}">
|
||||||
<Button Command="{Binding OnSaveProfile}">
|
<Button Command="{Binding SaveProfileCommand}">
|
||||||
<customControls:LocalizedLabel LocalId="account-auth-save"/>
|
<customControls:LocalizedLabel LocalId="account-auth-save"/>
|
||||||
</Button>
|
</Button>
|
||||||
</Border>
|
</Border>
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
<UserControl xmlns="https://github.com/avaloniaui"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:viewModels="clr-namespace:Nebula.Launcher.ViewModels"
|
|
||||||
xmlns:converters="clr-namespace:Nebula.Launcher.Converters"
|
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
|
||||||
x:DataType="viewModels:VisualErrorViewModel"
|
|
||||||
x:Class="Nebula.Launcher.Views.VisualErrorView">
|
|
||||||
<Design.DataContext>
|
|
||||||
<viewModels:VisualErrorViewModel />
|
|
||||||
</Design.DataContext>
|
|
||||||
<Grid RowDefinitions="30,*" ColumnDefinitions="200,*">
|
|
||||||
<Border Grid.Row="1" Grid.Column="0"
|
|
||||||
CornerRadius="10,0,0,10"
|
|
||||||
BorderThickness="0,0,2,0"
|
|
||||||
BorderBrush="{StaticResource DefaultForeground}">
|
|
||||||
<Image Source="{Binding ImgPath, Converter={x:Static converters:TypeConverters.ImageConverter}}" Width="200" Height="200"/>
|
|
||||||
</Border>
|
|
||||||
<Border Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" CornerRadius="10,10,0,0">
|
|
||||||
<Border.Background>
|
|
||||||
<LinearGradientBrush EndPoint="100%,50%" StartPoint="10%,20%">
|
|
||||||
<GradientStop Color="#FF6B6B" Offset="0.0" />
|
|
||||||
<GradientStop Color="#FF8E53" Offset="0.3" />
|
|
||||||
<GradientStop Color="#FF5E3A" Offset="0.6" />
|
|
||||||
<GradientStop Color="#FF5e5e" Offset="1.0" />
|
|
||||||
</LinearGradientBrush>
|
|
||||||
</Border.Background>
|
|
||||||
<Label HorizontalAlignment="Center"><TextBlock Text="{Binding Title}"/></Label>
|
|
||||||
</Border>
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="1"
|
|
||||||
Grid.Column="1"
|
|
||||||
Margin="15"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
TextWrapping="Wrap"
|
|
||||||
Text="{Binding Description}"/>
|
|
||||||
</Grid>
|
|
||||||
</UserControl>
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
using Avalonia.Controls;
|
|
||||||
|
|
||||||
namespace Nebula.Launcher.Views;
|
|
||||||
|
|
||||||
public partial class VisualErrorView : UserControl
|
|
||||||
{
|
|
||||||
public VisualErrorView()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,18 +2,15 @@ using Nebula.Runner.Services;
|
|||||||
using Nebula.Shared;
|
using Nebula.Shared;
|
||||||
using Nebula.Shared.Models;
|
using Nebula.Shared.Models;
|
||||||
using Nebula.Shared.Services;
|
using Nebula.Shared.Services;
|
||||||
using Nebula.Shared.Services.Logging;
|
|
||||||
using Nebula.Shared.Utils;
|
using Nebula.Shared.Utils;
|
||||||
using Robust.LoaderApi;
|
using Robust.LoaderApi;
|
||||||
|
|
||||||
namespace Nebula.Runner;
|
namespace Nebula.Runner;
|
||||||
|
|
||||||
[ServiceRegister]
|
[ServiceRegister]
|
||||||
public sealed class App(RunnerService runnerService, ContentService contentService, DebugService debugService)
|
public sealed class App(RunnerService runnerService, ContentService contentService)
|
||||||
: IRedialApi
|
: IRedialApi
|
||||||
{
|
{
|
||||||
public ILogger logger = debugService.GetLogger("Runner");
|
|
||||||
|
|
||||||
public void Redial(Uri uri, string text = "")
|
public void Redial(Uri uri, string text = "")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -25,8 +22,6 @@ public sealed class App(RunnerService runnerService, ContentService contentServi
|
|||||||
|
|
||||||
var url = urlraw.ToRobustUrl();
|
var url = urlraw.ToRobustUrl();
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
using var cancelTokenSource = new CancellationTokenSource();
|
using var cancelTokenSource = new CancellationTokenSource();
|
||||||
var buildInfo = await contentService.GetBuildInfo(url, cancelTokenSource.Token);
|
var buildInfo = await contentService.GetBuildInfo(url, cancelTokenSource.Token);
|
||||||
|
|
||||||
@@ -51,10 +46,4 @@ public sealed class App(RunnerService runnerService, ContentService contentServi
|
|||||||
|
|
||||||
await runnerService.Run(args.ToArray(), buildInfo, this, new ConsoleLoadingHandler(), cancelTokenSource.Token);
|
await runnerService.Run(args.ToArray(), buildInfo, this, new ConsoleLoadingHandler(), cancelTokenSource.Token);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
logger.Error(e);
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Lib.Harmony" Version="2.3.6" />
|
<PackageReference Include="Lib.Harmony" Version="2.3.6" />
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0"/>
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0"/>
|
||||||
|
<PackageReference Include="NLua" Version="1.7.5" />
|
||||||
<PackageReference Include="SharpZstd.Interop" Version="1.5.6"/>
|
<PackageReference Include="SharpZstd.Interop" Version="1.5.6"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
using System.Data;
|
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using Nebula.Shared;
|
using Nebula.Shared;
|
||||||
|
|
||||||
namespace Nebula.Runner.Services;
|
namespace Nebula.Runner.Services;
|
||||||
|
|
||||||
[ServiceRegister]
|
[ServiceRegister]
|
||||||
public class HarmonyService(ReflectionService reflectionService)
|
public class HarmonyService
|
||||||
{
|
{
|
||||||
private HarmonyInstance? _instance;
|
private HarmonyInstance? _instance;
|
||||||
|
|
||||||
@@ -25,21 +24,6 @@ public class HarmonyService(ReflectionService reflectionService)
|
|||||||
throw new Exception();
|
throw new Exception();
|
||||||
|
|
||||||
_instance = new HarmonyInstance();
|
_instance = new HarmonyInstance();
|
||||||
UnShittyWizard();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Я помню пенис большой,Я помню пенис большой, Я помню пенис большой, я помню....
|
|
||||||
/// </summary>
|
|
||||||
private void UnShittyWizard()
|
|
||||||
{
|
|
||||||
var method = reflectionService.GetType("Robust.Client.GameController").TypeInitializer;
|
|
||||||
_instance!.Harmony.Patch(method, new HarmonyMethod(Prefix));
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool Prefix()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,33 +1,29 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Nebula.Shared;
|
using Nebula.Shared;
|
||||||
using Nebula.Shared.FileApis;
|
|
||||||
using Nebula.Shared.Services;
|
using Nebula.Shared.Services;
|
||||||
|
|
||||||
namespace Nebula.Runner.Services;
|
namespace Nebula.Runner.Services;
|
||||||
|
|
||||||
[ServiceRegister]
|
[ServiceRegister]
|
||||||
public class ReflectionService(AssemblyService assemblyService)
|
public class ReflectionService
|
||||||
{
|
{
|
||||||
private Dictionary<string, Assembly> _typeCache = new();
|
private readonly Dictionary<string, Assembly> _typeCache = new();
|
||||||
|
|
||||||
|
public ReflectionService(AssemblyService assemblyService)
|
||||||
|
{
|
||||||
|
assemblyService.OnAssemblyLoaded += OnAssemblyLoaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnAssemblyLoaded(Assembly obj)
|
||||||
|
{
|
||||||
|
RegisterAssembly(obj);
|
||||||
|
}
|
||||||
|
|
||||||
public void RegisterAssembly(Assembly robustAssembly)
|
public void RegisterAssembly(Assembly robustAssembly)
|
||||||
{
|
{
|
||||||
_typeCache.Add(robustAssembly.GetName().Name!, robustAssembly);
|
_typeCache.Add(robustAssembly.GetName().Name!, robustAssembly);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RegisterRobustAssemblies(AssemblyApi engine)
|
|
||||||
{
|
|
||||||
RegisterAssembly(GetRobustAssembly("Robust.Shared", engine));
|
|
||||||
RegisterAssembly(GetRobustAssembly("Robust.Client", engine));
|
|
||||||
}
|
|
||||||
|
|
||||||
private Assembly GetRobustAssembly(string assemblyName, AssemblyApi engine)
|
|
||||||
{
|
|
||||||
if(!assemblyService.TryOpenAssembly(assemblyName, engine, out var assembly))
|
|
||||||
throw new Exception($"Unable to locate {assemblyName}.dll in engine build!");
|
|
||||||
return assembly;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Type? GetTypeImp(string name)
|
public Type? GetTypeImp(string name)
|
||||||
{
|
{
|
||||||
foreach (var (prefix,assembly) in _typeCache)
|
foreach (var (prefix,assembly) in _typeCache)
|
||||||
@@ -51,7 +47,7 @@ public class ReflectionService(AssemblyService assemblyService)
|
|||||||
: assembly.GetType(name)!;
|
: assembly.GetType(name)!;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string ExtrackPrefix(string path)
|
public string ExtrackPrefix(string path)
|
||||||
{
|
{
|
||||||
var sp = path.Split(".");
|
var sp = path.Split(".");
|
||||||
return sp[0] + "." + sp[1];
|
return sp[0] + "." + sp[1];
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Reflection.Emit;
|
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using Nebula.Shared;
|
using Nebula.Shared;
|
||||||
using Nebula.Shared.Models;
|
using Nebula.Shared.Models;
|
||||||
@@ -18,9 +17,10 @@ public sealed class RunnerService(
|
|||||||
EngineService engineService,
|
EngineService engineService,
|
||||||
AssemblyService assemblyService,
|
AssemblyService assemblyService,
|
||||||
ReflectionService reflectionService,
|
ReflectionService reflectionService,
|
||||||
HarmonyService harmonyService)
|
HarmonyService harmonyService,
|
||||||
|
ScriptService scriptService)
|
||||||
{
|
{
|
||||||
private ILogger _logger = debugService.GetLogger("RunnerService");
|
private readonly ILogger _logger = debugService.GetLogger("RunnerService");
|
||||||
private bool MetricEnabled = false; //TODO: ADD METRIC THINKS LATER
|
private bool MetricEnabled = false; //TODO: ADD METRIC THINKS LATER
|
||||||
|
|
||||||
public async Task Run(string[] runArgs, RobustBuildInfo buildInfo, IRedialApi redialApi,
|
public async Task Run(string[] runArgs, RobustBuildInfo buildInfo, IRedialApi redialApi,
|
||||||
@@ -58,6 +58,24 @@ public sealed class RunnerService(
|
|||||||
|
|
||||||
var args = new MainArgs(runArgs, engine, redialApi, extraMounts);
|
var args = new MainArgs(runArgs, engine, redialApi, extraMounts);
|
||||||
|
|
||||||
|
|
||||||
|
var assemblyManifest = hashApi.Manifest.Where(p =>
|
||||||
|
p.Key.StartsWith("Assemblies/"))
|
||||||
|
.Select(p =>
|
||||||
|
{
|
||||||
|
return p.Value with { Path = Path.GetFileNameWithoutExtension(p.Key) };
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
|
var assembliesHash = contentService.CreateHashApi(assemblyManifest);
|
||||||
|
|
||||||
|
var contentAssemblyApi = assemblyService.Mount(assembliesHash);
|
||||||
|
|
||||||
|
foreach (var file in contentAssemblyApi.AllFiles.Where(p => Path.GetExtension(p) == ".dll"))
|
||||||
|
{
|
||||||
|
var newExt = Path.GetFileNameWithoutExtension(file);
|
||||||
|
if(!assemblyService.TryOpenAssembly(newExt, contentAssemblyApi, out _)) throw new Exception("Assembly not found: " + newExt);
|
||||||
|
}
|
||||||
|
|
||||||
if (!assemblyService.TryOpenAssembly(varService.GetConfigValue(CurrentConVar.RobustAssemblyName)!, engine,
|
if (!assemblyService.TryOpenAssembly(varService.GetConfigValue(CurrentConVar.RobustAssemblyName)!, engine,
|
||||||
out var clientAssembly))
|
out var clientAssembly))
|
||||||
throw new Exception("Unable to locate Robust.Client.dll in engine build!");
|
throw new Exception("Unable to locate Robust.Client.dll in engine build!");
|
||||||
@@ -68,7 +86,6 @@ public sealed class RunnerService(
|
|||||||
if(!assemblyService.TryOpenAssembly("Prometheus.NetStandard", engine, out var prometheusAssembly))
|
if(!assemblyService.TryOpenAssembly("Prometheus.NetStandard", engine, out var prometheusAssembly))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
reflectionService.RegisterRobustAssemblies(engine);
|
|
||||||
harmonyService.CreateInstance();
|
harmonyService.CreateInstance();
|
||||||
|
|
||||||
IDisposable? metricServer = null;
|
IDisposable? metricServer = null;
|
||||||
@@ -79,11 +96,17 @@ public sealed class RunnerService(
|
|||||||
metricServer = RunHelper.RunMetric(prometheusAssembly);
|
metricServer = RunHelper.RunMetric(prometheusAssembly);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scriptService.LoadScripts();
|
||||||
|
|
||||||
await Task.Run(() => loader.Main(args), cancellationToken);
|
await Task.Run(() => loader.Main(args), cancellationToken);
|
||||||
|
|
||||||
metricServer?.Dispose();
|
metricServer?.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CacheAssembly()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class MetricsEnabledPatcher
|
public static class MetricsEnabledPatcher
|
||||||
@@ -93,8 +116,7 @@ public static class MetricsEnabledPatcher
|
|||||||
var harmony = harmonyService.Instance.Harmony;
|
var harmony = harmonyService.Instance.Harmony;
|
||||||
|
|
||||||
var targetType = reflectionService.GetType("Robust.Shared.GameObjects.EntitySystemManager");
|
var targetType = reflectionService.GetType("Robust.Shared.GameObjects.EntitySystemManager");
|
||||||
var targetMethod = targetType.GetProperty("MetricsEnabled")?.GetGetMethod() ??
|
var targetMethod = targetType.GetProperty("MetricsEnabled").GetGetMethod();
|
||||||
throw new Exception("target method is null.. huh.. do we have patch a right think?");
|
|
||||||
|
|
||||||
var prefix = typeof(MetricsEnabledPatcher).GetMethod(nameof(MetricsEnabledGetterPrefix),
|
var prefix = typeof(MetricsEnabledPatcher).GetMethod(nameof(MetricsEnabledGetterPrefix),
|
||||||
BindingFlags.Static | BindingFlags.NonPublic);
|
BindingFlags.Static | BindingFlags.NonPublic);
|
||||||
|
|||||||
181
Nebula.Runner/Services/ScriptService.cs
Normal file
181
Nebula.Runner/Services/ScriptService.cs
Normal file
@@ -0,0 +1,181 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Text.Json;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
using HarmonyLib;
|
||||||
|
using Nebula.Shared;
|
||||||
|
using Nebula.Shared.FileApis;
|
||||||
|
using Nebula.Shared.Services;
|
||||||
|
using NLua;
|
||||||
|
|
||||||
|
namespace Nebula.Runner.Services;
|
||||||
|
|
||||||
|
[ServiceRegister]
|
||||||
|
public class ScriptService
|
||||||
|
{
|
||||||
|
private readonly HarmonyService _harmonyService;
|
||||||
|
private readonly ReflectionService _reflectionService;
|
||||||
|
private readonly AssemblyService _assemblyService;
|
||||||
|
|
||||||
|
private readonly FileApi _scriptFileApi;
|
||||||
|
|
||||||
|
private static Dictionary<MethodBase, ScriptManifestDict> _scriptCache = [];
|
||||||
|
private static Dictionary<string, Action> _assemblyLoadingQuery = [];
|
||||||
|
|
||||||
|
public ScriptService(HarmonyService harmonyService, ReflectionService reflectionService, FileService fileService, AssemblyService assemblyService)
|
||||||
|
{
|
||||||
|
_harmonyService = harmonyService;
|
||||||
|
_reflectionService = reflectionService;
|
||||||
|
_assemblyService = assemblyService;
|
||||||
|
|
||||||
|
_scriptFileApi = fileService.CreateFileApi("scripts");
|
||||||
|
_assemblyService.OnAssemblyLoaded += OnAssemblyLoaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnAssemblyLoaded(Assembly obj)
|
||||||
|
{
|
||||||
|
var objName = obj.GetName().Name ?? string.Empty;
|
||||||
|
if (!_assemblyLoadingQuery.TryGetValue(objName, out var a)) return;
|
||||||
|
Console.WriteLine("Inject assembly: " + objName);
|
||||||
|
a();
|
||||||
|
_assemblyLoadingQuery.Remove(objName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LoadScripts()
|
||||||
|
{
|
||||||
|
Console.WriteLine("Loading scripts... " + _scriptFileApi.EnumerateDirectories("").Count());
|
||||||
|
foreach (var dir in _scriptFileApi.EnumerateDirectories(""))
|
||||||
|
{
|
||||||
|
LoadScript(dir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LoadScript(string name)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Reading script {name}");
|
||||||
|
var manifests = ReadManifest(name);
|
||||||
|
|
||||||
|
foreach (var entry in manifests)
|
||||||
|
{
|
||||||
|
if (entry.TypeInitializer.HasValue) LoadTypeInitializer(entry.TypeInitializer.Value, name);
|
||||||
|
if (entry.Method.HasValue) LoadMethod(entry.Method.Value, name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadTypeInitializer(ScriptMethodInjectItem item, string name)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Loading Initializer injection {name}...");
|
||||||
|
var assemblyName = _reflectionService.ExtrackPrefix(item.Method.Class);
|
||||||
|
|
||||||
|
if (!_assemblyService.Assemblies.Select(a => a.GetName().Name).Contains(assemblyName))
|
||||||
|
{
|
||||||
|
_assemblyLoadingQuery.Add(assemblyName, () => LoadTypeInitializer(item, name));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var targetType = _reflectionService.GetType(item.Method.Class);
|
||||||
|
var method = targetType.TypeInitializer;
|
||||||
|
InitialiseShared(method!, name, item);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadMethod(ScriptMethodInjectItem item, string name)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Loading method injection {name}...");
|
||||||
|
var assemblyName = _reflectionService.ExtrackPrefix(item.Method.Class);
|
||||||
|
|
||||||
|
if (!_assemblyService.Assemblies.Select(a => a.GetName().Name).Contains(assemblyName))
|
||||||
|
{
|
||||||
|
_assemblyLoadingQuery.Add(assemblyName, () => LoadMethod(item, name));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var targetType = _reflectionService.GetType(item.Method.Class);
|
||||||
|
var method = targetType.GetMethod(item.Method.Method, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static);
|
||||||
|
InitialiseShared(method!, name, item);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitialiseShared(MethodBase method, string scriptName, ScriptMethodInjectItem item)
|
||||||
|
{
|
||||||
|
var scriptCode = File.ReadAllText(Path.Combine(_scriptFileApi.RootPath, scriptName, item.Script.LuaFile));
|
||||||
|
|
||||||
|
var methodInfo = method as MethodInfo;
|
||||||
|
HarmonyMethod dynamicPatch;
|
||||||
|
|
||||||
|
if (methodInfo == null || methodInfo.ReturnType == typeof(void))
|
||||||
|
dynamicPatch = new HarmonyMethod(typeof(ScriptService).GetMethod(nameof(LuaPrefix), BindingFlags.Static | BindingFlags.NonPublic));
|
||||||
|
else
|
||||||
|
dynamicPatch = new HarmonyMethod(typeof(ScriptService).GetMethod(nameof(LuaPrefixResult), BindingFlags.Static | BindingFlags.NonPublic));
|
||||||
|
|
||||||
|
_scriptCache[method] = new ScriptManifestDict(scriptCode, item);
|
||||||
|
|
||||||
|
_harmonyService.Instance.Harmony.Patch(method, prefix: dynamicPatch);
|
||||||
|
Console.WriteLine($"Injected {scriptName}");
|
||||||
|
}
|
||||||
|
|
||||||
|
private ScriptEntry[] ReadManifest(string scriptName)
|
||||||
|
{
|
||||||
|
if(!_scriptFileApi.TryOpen(Path.Join(scriptName, "MANIFEST.json"), out var stream))
|
||||||
|
throw new FileNotFoundException(Path.Join(scriptName, "MANIFEST.json") + " not found manifest!");
|
||||||
|
|
||||||
|
return JsonSerializer.Deserialize<ScriptEntry[]>(stream) ?? [];
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool LuaPrefix(MethodBase __originalMethod, object __instance)
|
||||||
|
{
|
||||||
|
if (!_scriptCache.TryGetValue(__originalMethod, out var luaCode))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
using var lua = new Lua();
|
||||||
|
|
||||||
|
lua["this"] = __instance;
|
||||||
|
|
||||||
|
var results = lua.DoString(luaCode.Code);
|
||||||
|
|
||||||
|
if (results is { Length: > 0 } && results[0] is bool b)
|
||||||
|
return b;
|
||||||
|
|
||||||
|
return luaCode.ScriptMethodInjectItem.ContinueAfterInject;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool LuaPrefixResult(MethodBase __originalMethod, object __instance, ref object __result)
|
||||||
|
{
|
||||||
|
if (!_scriptCache.TryGetValue(__originalMethod, out var luaCode))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
using var lua = new Lua();
|
||||||
|
|
||||||
|
lua["this"] = __instance;
|
||||||
|
lua["result"] = __result;
|
||||||
|
|
||||||
|
var results = lua.DoString(luaCode.Code);
|
||||||
|
|
||||||
|
if (lua["result"] != null)
|
||||||
|
__result = lua["result"];
|
||||||
|
|
||||||
|
if (results is { Length: > 0 } && results[0] is bool b)
|
||||||
|
return b;
|
||||||
|
|
||||||
|
return luaCode.ScriptMethodInjectItem.ContinueAfterInject;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public record struct ScriptManifestDict(string Code, ScriptMethodInjectItem ScriptMethodInjectItem);
|
||||||
|
|
||||||
|
public record struct ScriptEntry(
|
||||||
|
[property: JsonPropertyName("method")] ScriptMethodInjectItem? Method,
|
||||||
|
[property: JsonPropertyName("type_initializer")] ScriptMethodInjectItem? TypeInitializer
|
||||||
|
);
|
||||||
|
|
||||||
|
public record struct ScriptMethodInjectItem(
|
||||||
|
[property: JsonPropertyName("method")] ScriptMethodInfo Method,
|
||||||
|
[property: JsonPropertyName("continue")] bool ContinueAfterInject,
|
||||||
|
[property: JsonPropertyName("script")] LuaMethodEntry Script
|
||||||
|
);
|
||||||
|
|
||||||
|
public record struct ScriptMethodInfo(
|
||||||
|
[property: JsonPropertyName("class")] string Class,
|
||||||
|
[property: JsonPropertyName("method")] string Method
|
||||||
|
);
|
||||||
|
|
||||||
|
public record struct LuaMethodEntry(
|
||||||
|
[property: JsonPropertyName("lua_file")] string LuaFile
|
||||||
|
);
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Nebula.Shared.Configurations.Migrations;
|
|
||||||
using Nebula.Shared.Models;
|
using Nebula.Shared.Models;
|
||||||
using Nebula.Shared.Services;
|
using Nebula.Shared.Services;
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
using Nebula.Shared.Services;
|
|
||||||
|
|
||||||
namespace Nebula.Shared.Configurations;
|
|
||||||
|
|
||||||
public class ConVar<T>
|
|
||||||
{
|
|
||||||
internal ConfigurationService.OnConfigurationChangedDelegate<T?>? OnValueChanged;
|
|
||||||
|
|
||||||
public ConVar(string name, T? defaultValue = default)
|
|
||||||
{
|
|
||||||
Name = name ?? throw new ArgumentNullException(nameof(name));
|
|
||||||
DefaultValue = defaultValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Name { get; }
|
|
||||||
public Type Type => typeof(T);
|
|
||||||
public T? DefaultValue { get; }
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
using Nebula.Shared.Configurations.Migrations;
|
|
||||||
using Nebula.Shared.Services;
|
|
||||||
|
|
||||||
namespace Nebula.Shared.Configurations;
|
|
||||||
|
|
||||||
public static class ConVarBuilder
|
|
||||||
{
|
|
||||||
public static ConVar<T> Build<T>(string name, T? defaultValue = default)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrWhiteSpace(name))
|
|
||||||
throw new ArgumentException("ConVar name cannot be null or whitespace.", nameof(name));
|
|
||||||
|
|
||||||
return new ConVar<T>(name, defaultValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ConVar<T> BuildWithMigration<T>(string name, IConfigurationMigration migration, T? defaultValue = default)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrWhiteSpace(name))
|
|
||||||
throw new ArgumentException("ConVar name cannot be null or whitespace.", nameof(name));
|
|
||||||
|
|
||||||
ConfigurationService.AddConfigurationMigration(migration);
|
|
||||||
|
|
||||||
return new ConVar<T>(name, defaultValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
using System.ComponentModel;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using Nebula.Shared.Services;
|
|
||||||
|
|
||||||
namespace Nebula.Shared.Configurations;
|
|
||||||
|
|
||||||
public sealed class ConVarObserver<T> : IDisposable, INotifyPropertyChanged, INotifyPropertyChanging
|
|
||||||
{
|
|
||||||
private readonly ConVar<T> _convar;
|
|
||||||
private readonly ConfigurationService _configurationService;
|
|
||||||
|
|
||||||
private T? _value;
|
|
||||||
private ConfigurationService.OnConfigurationChangedDelegate<T> _delegate;
|
|
||||||
|
|
||||||
public bool HasValue => Value != null;
|
|
||||||
|
|
||||||
public T? Value
|
|
||||||
{
|
|
||||||
get => _value;
|
|
||||||
set => _configurationService.SetConfigValue(_convar, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ConVarObserver(ConVar<T> convar, ConfigurationService configurationService)
|
|
||||||
{
|
|
||||||
_convar = convar;
|
|
||||||
_convar.OnValueChanged += OnValueChanged;
|
|
||||||
_configurationService = configurationService;
|
|
||||||
_delegate += OnValueChanged;
|
|
||||||
|
|
||||||
OnValueChanged(configurationService.GetConfigValue(_convar));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnValueChanged(T? value)
|
|
||||||
{
|
|
||||||
OnPropertyChanging(nameof(Value));
|
|
||||||
OnPropertyChanging(nameof(HasValue));
|
|
||||||
|
|
||||||
if(value is null && _value is null)
|
|
||||||
return;
|
|
||||||
if (_value is not null && _value.Equals(value))
|
|
||||||
return;
|
|
||||||
|
|
||||||
_value = value;
|
|
||||||
OnPropertyChanged(nameof(Value));
|
|
||||||
OnPropertyChanged(nameof(HasValue));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
_convar.OnValueChanged -= OnValueChanged;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static implicit operator T? (ConVarObserver<T> convar) => convar.Value;
|
|
||||||
|
|
||||||
public event PropertyChangingEventHandler? PropertyChanging;
|
|
||||||
public event PropertyChangedEventHandler? PropertyChanged;
|
|
||||||
|
|
||||||
private void OnPropertyChanged([CallerMemberName] string? propertyName = null)
|
|
||||||
{
|
|
||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
||||||
}
|
|
||||||
private void OnPropertyChanging([CallerMemberName] string? propertyName = null)
|
|
||||||
{
|
|
||||||
PropertyChanging?.Invoke(this, new PropertyChangingEventArgs(propertyName));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
using Nebula.Shared.Models;
|
|
||||||
using Nebula.Shared.Services;
|
|
||||||
|
|
||||||
namespace Nebula.Shared.Configurations.Migrations;
|
|
||||||
|
|
||||||
public abstract class BaseConfigurationMigration<T1,T2> : IConfigurationMigration
|
|
||||||
{
|
|
||||||
protected ConVar<T1> OldConVar;
|
|
||||||
protected ConVar<T2> NewConVar;
|
|
||||||
|
|
||||||
public BaseConfigurationMigration(string oldName, string newName)
|
|
||||||
{
|
|
||||||
OldConVar = ConVarBuilder.Build<T1>(oldName);
|
|
||||||
NewConVar = ConVarBuilder.Build<T2>(newName);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task DoMigrate(ConfigurationService configurationService, IServiceProvider serviceProvider, ILoadingHandler loadingHandler)
|
|
||||||
{
|
|
||||||
var oldValue = configurationService.GetConfigValue(OldConVar);
|
|
||||||
if(oldValue == null) return;
|
|
||||||
|
|
||||||
var newValue = await Migrate(serviceProvider, oldValue, loadingHandler);
|
|
||||||
configurationService.SetConfigValue(NewConVar, newValue);
|
|
||||||
configurationService.ClearConfigValue(OldConVar);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract Task<T2> Migrate(IServiceProvider serviceProvider, T1 oldValue, ILoadingHandler loadingHandler);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
using Nebula.Shared.Models;
|
|
||||||
using Nebula.Shared.Services;
|
|
||||||
|
|
||||||
namespace Nebula.Shared.Configurations.Migrations;
|
|
||||||
|
|
||||||
public interface IConfigurationMigration
|
|
||||||
{
|
|
||||||
public Task DoMigrate(ConfigurationService configurationService, IServiceProvider serviceProvider, ILoadingHandler loadingHandler);
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
using Nebula.Shared.Models;
|
|
||||||
using Nebula.Shared.Services;
|
|
||||||
|
|
||||||
namespace Nebula.Shared.Configurations.Migrations;
|
|
||||||
|
|
||||||
public class MigrationQueue(List<IConfigurationMigration> migrations) : IConfigurationMigration
|
|
||||||
{
|
|
||||||
public async Task DoMigrate(ConfigurationService configurationService, IServiceProvider serviceProvider , ILoadingHandler loadingHandler)
|
|
||||||
{
|
|
||||||
foreach (var migration in migrations)
|
|
||||||
{
|
|
||||||
await migration.DoMigrate(configurationService, serviceProvider, loadingHandler);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
namespace Nebula.Shared.Configurations.Migrations;
|
|
||||||
|
|
||||||
public class MigrationQueueBuilder
|
|
||||||
{
|
|
||||||
public static MigrationQueueBuilder Instance => new();
|
|
||||||
|
|
||||||
private readonly List<IConfigurationMigration> _migrations = [];
|
|
||||||
|
|
||||||
public MigrationQueueBuilder With(IConfigurationMigration migration)
|
|
||||||
{
|
|
||||||
_migrations.Add(migration);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MigrationQueue Build()
|
|
||||||
{
|
|
||||||
return new MigrationQueue(_migrations);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
using Nebula.Shared.Configurations;
|
|
||||||
using Nebula.Shared.Models;
|
using Nebula.Shared.Models;
|
||||||
using Nebula.Shared.Services;
|
using Nebula.Shared.Services;
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,11 @@ public sealed class FileApi : IReadWriteFileApi
|
|||||||
return File.Exists(fullPath);
|
return File.Exists(fullPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IEnumerable<string> EnumerateDirectories(string path)
|
||||||
|
{
|
||||||
|
return Directory.GetDirectories(Path.Join(RootPath, path)).Select(p=>p.Replace(RootPath,"").Substring(1));
|
||||||
|
}
|
||||||
|
|
||||||
private IEnumerable<string> GetAllFiles(){
|
private IEnumerable<string> GetAllFiles(){
|
||||||
|
|
||||||
if(!Directory.Exists(RootPath)) return [];
|
if(!Directory.Exists(RootPath)) return [];
|
||||||
|
|||||||
@@ -12,15 +12,23 @@ namespace Nebula.Shared.Services;
|
|||||||
[ServiceRegister]
|
[ServiceRegister]
|
||||||
public class AssemblyService
|
public class AssemblyService
|
||||||
{
|
{
|
||||||
private readonly List<Assembly> _assemblies = new();
|
private readonly Dictionary<string, Assembly> _assemblyCache = new();
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
|
|
||||||
private readonly HashSet<string> _resolvingAssemblies = new();
|
private readonly HashSet<string> _resolvingAssemblies = new();
|
||||||
|
|
||||||
|
private List<AssemblyApi> _mountedApis = [];
|
||||||
|
|
||||||
|
public Action<Assembly>? OnAssemblyLoaded;
|
||||||
|
public IReadOnlyList<Assembly> Assemblies => _assemblyCache.Values.ToList().AsReadOnly();
|
||||||
|
|
||||||
public AssemblyService(DebugService debugService)
|
public AssemblyService(DebugService debugService)
|
||||||
{
|
{
|
||||||
_logger = debugService.GetLogger(this);
|
_logger = debugService.GetLogger(this);
|
||||||
|
|
||||||
|
AssemblyLoadContext.Default.ResolvingUnmanagedDll += LoadContextOnResolvingUnmanaged;
|
||||||
|
AssemblyLoadContext.Default.Resolving += (context, name) => OnAssemblyResolving(context, name);
|
||||||
|
|
||||||
ZstdImportResolver.ResolveLibrary += (name, assembly1, path) =>
|
ZstdImportResolver.ResolveLibrary += (name, assembly1, path) =>
|
||||||
{
|
{
|
||||||
if (name.Equals("SharpZstd.Native"))
|
if (name.Equals("SharpZstd.Native"))
|
||||||
@@ -36,21 +44,41 @@ public class AssemblyService
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public IReadOnlyList<Assembly> Assemblies => _assemblies;
|
private Assembly? OnAssemblyResolving(AssemblyLoadContext context, AssemblyName name)
|
||||||
|
{
|
||||||
|
if (_resolvingAssemblies.Contains(name.FullName))
|
||||||
|
{
|
||||||
|
_logger.Debug($"Already resolving {name.Name}, skipping.");
|
||||||
|
return null; // Prevent recursive resolution
|
||||||
|
}
|
||||||
|
|
||||||
|
Assembly? assembly;
|
||||||
|
|
||||||
|
if (_assemblyCache.TryGetValue(name.Name ?? "", out assembly))
|
||||||
|
{
|
||||||
|
return assembly;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var api in _mountedApis)
|
||||||
|
{
|
||||||
|
if((assembly = OnAssemblyResolving(context, name, api)) != null)
|
||||||
|
return assembly;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public AssemblyApi Mount(IFileApi fileApi)
|
public AssemblyApi Mount(IFileApi fileApi)
|
||||||
{
|
{
|
||||||
var asmApi = new AssemblyApi(fileApi);
|
var asmApi = new AssemblyApi(fileApi);
|
||||||
AssemblyLoadContext.Default.Resolving += (context, name) => OnAssemblyResolving(context, name, asmApi);
|
_mountedApis.Add(asmApi);
|
||||||
AssemblyLoadContext.Default.ResolvingUnmanagedDll += LoadContextOnResolvingUnmanaged;
|
|
||||||
|
|
||||||
return asmApi;
|
return asmApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TryGetLoader(Assembly clientAssembly, [NotNullWhen(true)] out ILoaderEntryPoint? loader)
|
public bool TryGetLoader(Assembly clientAssembly, [NotNullWhen(true)] out ILoaderEntryPoint? loader)
|
||||||
{
|
{
|
||||||
loader = null;
|
loader = null;
|
||||||
// Find ILoaderEntryPoint with the LoaderEntryPointAttribute
|
|
||||||
var attrib = clientAssembly.GetCustomAttribute<LoaderEntryPointAttribute>();
|
var attrib = clientAssembly.GetCustomAttribute<LoaderEntryPointAttribute>();
|
||||||
if (attrib == null)
|
if (attrib == null)
|
||||||
{
|
{
|
||||||
@@ -80,8 +108,10 @@ public class AssemblyService
|
|||||||
assembly = AssemblyLoadContext.Default.LoadFromStream(asm, pdb);
|
assembly = AssemblyLoadContext.Default.LoadFromStream(asm, pdb);
|
||||||
_logger.Log("LOADED ASSEMBLY " + name);
|
_logger.Log("LOADED ASSEMBLY " + name);
|
||||||
|
|
||||||
|
if (_assemblyCache.TryAdd(name, assembly))
|
||||||
if (!_assemblies.Contains(assembly)) _assemblies.Add(assembly);
|
{
|
||||||
|
OnAssemblyLoaded?.Invoke(assembly);
|
||||||
|
}
|
||||||
|
|
||||||
asm.Dispose();
|
asm.Dispose();
|
||||||
pdb?.Dispose();
|
pdb?.Dispose();
|
||||||
@@ -103,12 +133,8 @@ public class AssemblyService
|
|||||||
|
|
||||||
private Assembly? OnAssemblyResolving(AssemblyLoadContext context, AssemblyName name, AssemblyApi assemblyApi)
|
private Assembly? OnAssemblyResolving(AssemblyLoadContext context, AssemblyName name, AssemblyApi assemblyApi)
|
||||||
{
|
{
|
||||||
if (_resolvingAssemblies.Contains(name.FullName))
|
lock (_resolvingAssemblies)
|
||||||
{
|
{
|
||||||
_logger.Debug($"Already resolving {name.Name}, skipping.");
|
|
||||||
return null; // Prevent recursive resolution
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_resolvingAssemblies.Add(name.FullName);
|
_resolvingAssemblies.Add(name.FullName);
|
||||||
@@ -120,6 +146,7 @@ public class AssemblyService
|
|||||||
_resolvingAssemblies.Remove(name.FullName);
|
_resolvingAssemblies.Remove(name.FullName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private IntPtr LoadContextOnResolvingUnmanaged(Assembly assembly, string unmanaged)
|
private IntPtr LoadContextOnResolvingUnmanaged(Assembly assembly, string unmanaged)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -50,21 +50,6 @@ public class AuthService(
|
|||||||
requestMessage.Headers.Authorization = new AuthenticationHeaderValue("SS14Auth", tokenCredentials.Token.Token);
|
requestMessage.Headers.Authorization = new AuthenticationHeaderValue("SS14Auth", tokenCredentials.Token.Token);
|
||||||
using var resp = await _httpClient.SendAsync(requestMessage, cancellationService.Token);
|
using var resp = await _httpClient.SendAsync(requestMessage, cancellationService.Token);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task Logout(AuthTokenCredentials tokenCredentials)
|
|
||||||
{
|
|
||||||
var authUrl = new Uri($"{tokenCredentials.AuthServer}api/auth/logout");
|
|
||||||
await restService.PostAsync<NullResponse, TokenRequest>(TokenRequest.From(tokenCredentials), authUrl, cancellationService.Token);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<AuthTokenCredentials> Refresh(AuthTokenCredentials tokenCredentials)
|
|
||||||
{
|
|
||||||
var authUrl = new Uri($"{tokenCredentials.AuthServer}api/auth/refresh");
|
|
||||||
var newToken = await restService.PostAsync<LoginToken, TokenRequest>(
|
|
||||||
TokenRequest.From(tokenCredentials), authUrl, cancellationService.Token);
|
|
||||||
|
|
||||||
return tokenCredentials with { Token = newToken };
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed record AuthTokenCredentials(Guid UserId, LoginToken Token, string Login, string AuthServer);
|
public sealed record AuthTokenCredentials(Guid UserId, LoginToken Token, string Login, string AuthServer);
|
||||||
@@ -74,19 +59,6 @@ public sealed record AuthDenyError(string[] Errors, AuthenticateDenyCode Code);
|
|||||||
public sealed class AuthException(AuthDenyError error) : Exception
|
public sealed class AuthException(AuthDenyError error) : Exception
|
||||||
{
|
{
|
||||||
public AuthDenyError Error { get; } = error;
|
public AuthDenyError Error { get; } = error;
|
||||||
|
|
||||||
public override string Message
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
var str = "Error while logging in. Please try again. " + Error.Code;
|
|
||||||
foreach (var error in Error.Errors)
|
|
||||||
{
|
|
||||||
str += "\n" + error;
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||||
@@ -99,14 +71,3 @@ public enum AuthenticateDenyCode
|
|||||||
TfaInvalid = 4,
|
TfaInvalid = 4,
|
||||||
AccountLocked = 5,
|
AccountLocked = 5,
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed record TokenRequest(string Token)
|
|
||||||
{
|
|
||||||
public static TokenRequest From(AuthTokenCredentials authTokenCredentials)
|
|
||||||
{
|
|
||||||
return new TokenRequest(authTokenCredentials.Token.Token);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static TokenRequest Empty { get; } = new TokenRequest("");
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,13 +1,107 @@
|
|||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using Nebula.Shared.Configurations;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Nebula.Shared.Configurations.Migrations;
|
|
||||||
using Nebula.Shared.FileApis.Interfaces;
|
using Nebula.Shared.FileApis.Interfaces;
|
||||||
using Nebula.Shared.Models;
|
using Nebula.Shared.Models;
|
||||||
using Nebula.Shared.Services.Logging;
|
using Nebula.Shared.Services.Logging;
|
||||||
|
using Robust.LoaderApi;
|
||||||
|
|
||||||
namespace Nebula.Shared.Services;
|
namespace Nebula.Shared.Services;
|
||||||
|
|
||||||
|
public class ConVar<T>
|
||||||
|
{
|
||||||
|
internal ConfigurationService.OnConfigurationChangedDelegate<T?>? OnValueChanged;
|
||||||
|
|
||||||
|
public ConVar(string name, T? defaultValue = default)
|
||||||
|
{
|
||||||
|
Name = name ?? throw new ArgumentNullException(nameof(name));
|
||||||
|
DefaultValue = defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Name { get; }
|
||||||
|
public Type Type => typeof(T);
|
||||||
|
public T? DefaultValue { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ConVarBuilder
|
||||||
|
{
|
||||||
|
public static ConVar<T> Build<T>(string name, T? defaultValue = default)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(name))
|
||||||
|
throw new ArgumentException("ConVar name cannot be null or whitespace.", nameof(name));
|
||||||
|
|
||||||
|
return new ConVar<T>(name, defaultValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ConVar<T> BuildWithMigration<T>(string name, IConfigurationMigration migration, T? defaultValue = default)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(name))
|
||||||
|
throw new ArgumentException("ConVar name cannot be null or whitespace.", nameof(name));
|
||||||
|
|
||||||
|
ConfigurationService.AddConfigurationMigration(migration);
|
||||||
|
|
||||||
|
return new ConVar<T>(name, defaultValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IConfigurationMigration
|
||||||
|
{
|
||||||
|
public Task DoMigrate(ConfigurationService configurationService, IServiceProvider serviceProvider, ILoadingHandler loadingHandler);
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract class BaseConfigurationMigration<T1,T2> : IConfigurationMigration
|
||||||
|
{
|
||||||
|
protected ConVar<T1> OldConVar;
|
||||||
|
protected ConVar<T2> NewConVar;
|
||||||
|
|
||||||
|
public BaseConfigurationMigration(string oldName, string newName)
|
||||||
|
{
|
||||||
|
OldConVar = ConVarBuilder.Build<T1>(oldName);
|
||||||
|
NewConVar = ConVarBuilder.Build<T2>(newName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task DoMigrate(ConfigurationService configurationService, IServiceProvider serviceProvider, ILoadingHandler loadingHandler)
|
||||||
|
{
|
||||||
|
var oldValue = configurationService.GetConfigValue(OldConVar);
|
||||||
|
if(oldValue == null) return;
|
||||||
|
|
||||||
|
var newValue = await Migrate(serviceProvider, oldValue, loadingHandler);
|
||||||
|
configurationService.SetConfigValue(NewConVar, newValue);
|
||||||
|
configurationService.ClearConfigValue(OldConVar);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract Task<T2> Migrate(IServiceProvider serviceProvider, T1 oldValue, ILoadingHandler loadingHandler);
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MigrationQueue(List<IConfigurationMigration> migrations) : IConfigurationMigration
|
||||||
|
{
|
||||||
|
public async Task DoMigrate(ConfigurationService configurationService, IServiceProvider serviceProvider , ILoadingHandler loadingHandler)
|
||||||
|
{
|
||||||
|
foreach (var migration in migrations)
|
||||||
|
{
|
||||||
|
await migration.DoMigrate(configurationService, serviceProvider, loadingHandler);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MigrationQueueBuilder
|
||||||
|
{
|
||||||
|
public static MigrationQueueBuilder Instance => new();
|
||||||
|
|
||||||
|
private readonly List<IConfigurationMigration> _migrations = [];
|
||||||
|
|
||||||
|
public MigrationQueueBuilder With(IConfigurationMigration migration)
|
||||||
|
{
|
||||||
|
_migrations.Add(migration);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MigrationQueue Build()
|
||||||
|
{
|
||||||
|
return new MigrationQueue(_migrations);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[ServiceRegister]
|
[ServiceRegister]
|
||||||
public class ConfigurationService
|
public class ConfigurationService
|
||||||
{
|
{
|
||||||
@@ -48,7 +142,7 @@ public class ConfigurationService
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConVarObserver<T> SubscribeVarChanged<T>(ConVar<T> convar, OnConfigurationChangedDelegate<T?> @delegate, bool invokeNow = false)
|
public ConfigChangeSubscriberDisposable<T> SubscribeVarChanged<T>(ConVar<T> convar, OnConfigurationChangedDelegate<T?> @delegate, bool invokeNow = false)
|
||||||
{
|
{
|
||||||
convar.OnValueChanged += @delegate;
|
convar.OnValueChanged += @delegate;
|
||||||
if (invokeNow)
|
if (invokeNow)
|
||||||
@@ -56,14 +150,7 @@ public class ConfigurationService
|
|||||||
@delegate(GetConfigValue(convar));
|
@delegate(GetConfigValue(convar));
|
||||||
}
|
}
|
||||||
|
|
||||||
var delegation = SubscribeVarChanged<T>(convar);
|
return new ConfigChangeSubscriberDisposable<T>(convar, @delegate);
|
||||||
delegation.PropertyChanged += (_, _) => @delegate(delegation.Value);
|
|
||||||
return delegation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ConVarObserver<T> SubscribeVarChanged<T>(ConVar<T> convar)
|
|
||||||
{
|
|
||||||
return new ConVarObserver<T>(convar, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public T? GetConfigValue<T>(ConVar<T> conVar)
|
public T? GetConfigValue<T>(ConVar<T> conVar)
|
||||||
@@ -166,3 +253,19 @@ public class ConfigurationService
|
|||||||
return $"{conVar.Name}.json";
|
return $"{conVar.Name}.json";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public sealed class ConfigChangeSubscriberDisposable<T> : IDisposable
|
||||||
|
{
|
||||||
|
private readonly ConVar<T> _convar;
|
||||||
|
private readonly ConfigurationService.OnConfigurationChangedDelegate<T> _delegate;
|
||||||
|
|
||||||
|
public ConfigChangeSubscriberDisposable(ConVar<T> convar, ConfigurationService.OnConfigurationChangedDelegate<T> @delegate)
|
||||||
|
{
|
||||||
|
_convar = convar;
|
||||||
|
_delegate = @delegate;
|
||||||
|
}
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
_convar.OnValueChanged -= _delegate;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
using System.Collections.Concurrent;
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using Nebula.Shared.FileApis;
|
||||||
using Nebula.Shared.Services.Logging;
|
using Nebula.Shared.Services.Logging;
|
||||||
|
using Robust.LoaderApi;
|
||||||
|
|
||||||
namespace Nebula.Shared.Services;
|
namespace Nebula.Shared.Services;
|
||||||
|
|
||||||
@@ -8,6 +9,7 @@ namespace Nebula.Shared.Services;
|
|||||||
public class DebugService : IDisposable
|
public class DebugService : IDisposable
|
||||||
{
|
{
|
||||||
public static bool DoFileLog;
|
public static bool DoFileLog;
|
||||||
|
private ServiceLogger Root {get; set;}
|
||||||
|
|
||||||
private readonly string _path =
|
private readonly string _path =
|
||||||
Path.Combine(FileService.RootPath, "log", Assembly.GetEntryAssembly()?.GetName().Name ?? "App");
|
Path.Combine(FileService.RootPath, "log", Assembly.GetEntryAssembly()?.GetName().Name ?? "App");
|
||||||
@@ -16,15 +18,7 @@ public class DebugService : IDisposable
|
|||||||
{
|
{
|
||||||
ClearLog();
|
ClearLog();
|
||||||
Root = new ServiceLogger("Root",_path);
|
Root = new ServiceLogger("Root",_path);
|
||||||
Root.GetLogger("DebugService")
|
Root.GetLogger("DebugService").Log("Initializing debug service " + (DoFileLog ? "with file logging" : "without file logging"));
|
||||||
.Log("Initializing debug service " + (DoFileLog ? "with file logging" : "without file logging"));
|
|
||||||
}
|
|
||||||
|
|
||||||
private ServiceLogger Root { get; }
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
Root.Dispose();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ILogger GetLogger(string loggerName)
|
public ILogger GetLogger(string loggerName)
|
||||||
@@ -37,14 +31,25 @@ public class DebugService : IDisposable
|
|||||||
return Root.GetLogger(objectToLog.GetType().Name);
|
return Root.GetLogger(objectToLog.GetType().Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
Root.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
private void ClearLog()
|
private void ClearLog()
|
||||||
{
|
{
|
||||||
if(!Directory.Exists(_path))
|
if(!Directory.Exists(_path))
|
||||||
return;
|
return;
|
||||||
var di = new DirectoryInfo(_path);
|
var di = new DirectoryInfo(_path);
|
||||||
|
|
||||||
foreach (var file in di.GetFiles()) file.Delete();
|
foreach (var file in di.GetFiles())
|
||||||
foreach (var dir in di.GetDirectories()) dir.Delete(true);
|
{
|
||||||
|
file.Delete();
|
||||||
|
}
|
||||||
|
foreach (var dir in di.GetDirectories())
|
||||||
|
{
|
||||||
|
dir.Delete(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,8 +63,7 @@ public enum LoggerCategory
|
|||||||
internal class ServiceLogger : ILogger
|
internal class ServiceLogger : ILogger
|
||||||
{
|
{
|
||||||
private readonly string _directory;
|
private readonly string _directory;
|
||||||
private readonly string _path;
|
public ServiceLogger? Root { get; private set; }
|
||||||
|
|
||||||
public ServiceLogger(string category, string directory)
|
public ServiceLogger(string category, string directory)
|
||||||
{
|
{
|
||||||
_directory = directory;
|
_directory = directory;
|
||||||
@@ -74,10 +78,24 @@ internal class ServiceLogger : ILogger
|
|||||||
File.Create(_path).Dispose();
|
File.Create(_path).Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServiceLogger? Root { get; private set; }
|
|
||||||
|
|
||||||
public string Category { get; init; }
|
public string Category { get; init; }
|
||||||
private ConcurrentDictionary<string, ServiceLogger> Childs { get; } = new();
|
|
||||||
|
private Dictionary<string, ServiceLogger> Childs { get; init; } = new();
|
||||||
|
|
||||||
|
private FileStream? _fileStream;
|
||||||
|
private StreamWriter? _streamWriter;
|
||||||
|
private readonly string _path;
|
||||||
|
|
||||||
|
public ServiceLogger GetLogger(string category)
|
||||||
|
{
|
||||||
|
if (Childs.TryGetValue(category, out var logger))
|
||||||
|
return logger;
|
||||||
|
|
||||||
|
logger = new ServiceLogger(category, _directory);
|
||||||
|
logger.Root = this;
|
||||||
|
Childs.Add(category, logger);
|
||||||
|
return logger;
|
||||||
|
}
|
||||||
|
|
||||||
public void Log(LoggerCategory loggerCategory, string message)
|
public void Log(LoggerCategory loggerCategory, string message)
|
||||||
{
|
{
|
||||||
@@ -90,46 +108,33 @@ internal class ServiceLogger : ILogger
|
|||||||
LogToFile(output);
|
LogToFile(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void LogToFile(string output)
|
||||||
|
{
|
||||||
|
if(!DebugService.DoFileLog) return;
|
||||||
|
_fileStream = File.Open(_path, FileMode.Append, FileAccess.Write, FileShare.ReadWrite);
|
||||||
|
_streamWriter = new StreamWriter(_fileStream);
|
||||||
|
Root?.LogToFile(output);
|
||||||
|
_streamWriter.WriteLine(output);
|
||||||
|
_streamWriter.Flush();
|
||||||
|
|
||||||
|
_streamWriter.Dispose();
|
||||||
|
_fileStream.Dispose();
|
||||||
|
|
||||||
|
_fileStream = null;
|
||||||
|
_streamWriter = null;
|
||||||
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
if (!DebugService.DoFileLog) return;
|
if (!DebugService.DoFileLog) return;
|
||||||
|
|
||||||
|
_streamWriter?.Dispose();
|
||||||
|
_fileStream?.Dispose();
|
||||||
foreach (var (_, child) in Childs)
|
foreach (var (_, child) in Childs)
|
||||||
{
|
{
|
||||||
child.Dispose();
|
child.Dispose();
|
||||||
}
|
}
|
||||||
|
Childs.Clear();
|
||||||
Childs.Clear(); // Not strictly necessary, but keeps intent clear
|
|
||||||
}
|
|
||||||
|
|
||||||
public ServiceLogger GetLogger(string category)
|
|
||||||
{
|
|
||||||
return Childs.GetOrAdd(category, key =>
|
|
||||||
{
|
|
||||||
var logger = new ServiceLogger(key, _directory)
|
|
||||||
{
|
|
||||||
Root = this
|
|
||||||
};
|
|
||||||
return logger;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LogToFile(string output)
|
|
||||||
{
|
|
||||||
if (!DebugService.DoFileLog) return;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Root?.LogToFile(output); // Log to parent first
|
|
||||||
|
|
||||||
using var fileStream = File.Open(_path, FileMode.Append, FileAccess.Write, FileShare.ReadWrite);
|
|
||||||
using var streamWriter = new StreamWriter(fileStream);
|
|
||||||
streamWriter.WriteLine(output);
|
|
||||||
}
|
|
||||||
catch (IOException ex)
|
|
||||||
{
|
|
||||||
Console.WriteLine($"[Logging Error] Failed to write log: {ex.Message}");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using Nebula.Shared.Configurations;
|
|
||||||
using Nebula.Shared.FileApis;
|
using Nebula.Shared.FileApis;
|
||||||
using Nebula.Shared.FileApis.Interfaces;
|
using Nebula.Shared.FileApis.Interfaces;
|
||||||
using Nebula.Shared.Models;
|
using Nebula.Shared.Models;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class FileService
|
|||||||
Directory.CreateDirectory(RootPath);
|
Directory.CreateDirectory(RootPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IReadWriteFileApi CreateFileApi(string path)
|
public FileApi CreateFileApi(string path)
|
||||||
{
|
{
|
||||||
_logger.Debug($"Creating file api for {path}");
|
_logger.Debug($"Creating file api for {path}");
|
||||||
return new FileApi(Path.Join(RootPath, path));
|
return new FileApi(Path.Join(RootPath, path));
|
||||||
|
|||||||
@@ -33,31 +33,6 @@ public class RestService
|
|||||||
return await ReadResult<T>(response, cancellationToken, uri);
|
return await ReadResult<T>(response, cancellationToken, uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<K> PostAsync<K, T>(T information, Uri uri, CancellationToken cancellationToken) where K : notnull
|
|
||||||
{
|
|
||||||
var json = JsonSerializer.Serialize(information, _serializerOptions);
|
|
||||||
var content = new StringContent(json, Encoding.UTF8, "application/json");
|
|
||||||
var response = await _client.PostAsync(uri, content, cancellationToken);
|
|
||||||
return await ReadResult<K>(response, cancellationToken, uri);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Pure]
|
|
||||||
public async Task<T> PostAsync<T>(Stream stream, string fileName, Uri uri, CancellationToken cancellationToken) where T : notnull
|
|
||||||
{
|
|
||||||
using var multipartFormContent =
|
|
||||||
new MultipartFormDataContent("Upload----" + DateTime.Now.ToString(CultureInfo.InvariantCulture));
|
|
||||||
multipartFormContent.Add(new StreamContent(stream), "formFile", fileName);
|
|
||||||
var response = await _client.PostAsync(uri, multipartFormContent, cancellationToken);
|
|
||||||
return await ReadResult<T>(response, cancellationToken, uri);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Pure]
|
|
||||||
public async Task<T> DeleteAsync<T>(Uri uri, CancellationToken cancellationToken) where T : notnull
|
|
||||||
{
|
|
||||||
var response = await _client.DeleteAsync(uri, cancellationToken);
|
|
||||||
return await ReadResult<T>(response, cancellationToken, uri);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Pure]
|
[Pure]
|
||||||
public async Task<T> GetAsyncDefault<T>(Uri uri, T defaultValue, CancellationToken cancellationToken) where T : notnull
|
public async Task<T> GetAsyncDefault<T>(Uri uri, T defaultValue, CancellationToken cancellationToken) where T : notnull
|
||||||
{
|
{
|
||||||
@@ -73,14 +48,37 @@ public class RestService
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Pure]
|
[Pure]
|
||||||
private async Task<T> ReadResult<T>(HttpResponseMessage response, CancellationToken cancellationToken, Uri uri) where T : notnull
|
public async Task<K> PostAsync<K, T>(T information, Uri uri, CancellationToken cancellationToken) where K : notnull
|
||||||
{
|
{
|
||||||
if (typeof(T) == typeof(NullResponse) && new NullResponse() is T nullResponse)
|
var json = JsonSerializer.Serialize(information, _serializerOptions);
|
||||||
{
|
var content = new StringContent(json, Encoding.UTF8, "application/json");
|
||||||
return nullResponse;
|
var response = await _client.PostAsync(uri, content, cancellationToken);
|
||||||
|
return await ReadResult<K>(response, cancellationToken, uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof(T) == typeof(string) && await response.Content.ReadAsStringAsync(cancellationToken) is T t)
|
[Pure]
|
||||||
|
public async Task<T> PostAsync<T>(Stream stream, Uri uri, CancellationToken cancellationToken) where T : notnull
|
||||||
|
{
|
||||||
|
using var multipartFormContent =
|
||||||
|
new MultipartFormDataContent("Upload----" + DateTime.Now.ToString(CultureInfo.InvariantCulture));
|
||||||
|
multipartFormContent.Add(new StreamContent(stream), "formFile", "image.png");
|
||||||
|
var response = await _client.PostAsync(uri, multipartFormContent, cancellationToken);
|
||||||
|
return await ReadResult<T>(response, cancellationToken, uri);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Pure]
|
||||||
|
public async Task<T> DeleteAsync<T>(Uri uri, CancellationToken cancellationToken) where T : notnull
|
||||||
|
{
|
||||||
|
var response = await _client.DeleteAsync(uri, cancellationToken);
|
||||||
|
return await ReadResult<T>(response, cancellationToken, uri);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Pure]
|
||||||
|
private async Task<T> ReadResult<T>(HttpResponseMessage response, CancellationToken cancellationToken, Uri uri) where T : notnull
|
||||||
|
{
|
||||||
|
var content = await response.Content.ReadAsStringAsync(cancellationToken);
|
||||||
|
|
||||||
|
if (typeof(T) == typeof(string) && content is T t)
|
||||||
return t;
|
return t;
|
||||||
|
|
||||||
if (response.IsSuccessStatusCode)
|
if (response.IsSuccessStatusCode)
|
||||||
@@ -92,10 +90,6 @@ public class RestService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed class NullResponse
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class RestRequestException(HttpContent content, HttpStatusCode statusCode, string message) : Exception(message)
|
public sealed class RestRequestException(HttpContent content, HttpStatusCode statusCode, string message) : Exception(message)
|
||||||
{
|
{
|
||||||
public HttpStatusCode StatusCode { get; } = statusCode;
|
public HttpStatusCode StatusCode { get; } = statusCode;
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
namespace Nebula.Shared.Utils;
|
|
||||||
|
|
||||||
public static class ExceptionHelper
|
|
||||||
{
|
|
||||||
public static Task<T> TryRun<T>(Func<Task<T>> func, int attempts = 3, Action<int, Exception>? attemptsCallback = null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return func.Invoke();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
if (attempts <= 0) throw new("Attempts was expired! ", e);
|
|
||||||
attempts--;
|
|
||||||
attemptsCallback?.Invoke(attempts, e);
|
|
||||||
return TryRun(func, attempts);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Nebula.Shared.Configurations;
|
|
||||||
using Nebula.Shared.Services;
|
using Nebula.Shared.Services;
|
||||||
|
|
||||||
namespace Nebula.UnitTest.NebulaSharedTests;
|
namespace Nebula.UnitTest.NebulaSharedTests;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
|
||||||
using Avalonia.Controls.ApplicationLifetimes;
|
using Avalonia.Controls.ApplicationLifetimes;
|
||||||
using Avalonia.Markup.Xaml;
|
using Avalonia.Markup.Xaml;
|
||||||
|
|
||||||
@@ -14,6 +13,8 @@ public partial class App : Application
|
|||||||
|
|
||||||
public override void OnFrameworkInitializationCompleted()
|
public override void OnFrameworkInitializationCompleted()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||||
{
|
{
|
||||||
desktop.MainWindow = new MainWindow();
|
desktop.MainWindow = new MainWindow();
|
||||||
|
|||||||
@@ -36,11 +36,7 @@ public partial class MainWindow : Window
|
|||||||
Console.WriteLine(messageOut);
|
Console.WriteLine(messageOut);
|
||||||
LogStr += messageOut + "\n";
|
LogStr += messageOut + "\n";
|
||||||
};
|
};
|
||||||
LogStandalone.Log("Starting up");
|
Start();
|
||||||
if (!Design.IsDesignMode)
|
|
||||||
_ = Start();
|
|
||||||
else
|
|
||||||
LogStandalone.Log("Debug information", 51);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task Start()
|
private async Task Start()
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AArchiving_002EUtils_002EWindows_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F27e9f12ad1e4318b9b02849ec3e6a502fa3ee761c4f0522ba756ab30cde1c_003FArchiving_002EUtils_002EWindows_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AArchiving_002EUtils_002EWindows_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F27e9f12ad1e4318b9b02849ec3e6a502fa3ee761c4f0522ba756ab30cde1c_003FArchiving_002EUtils_002EWindows_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAssemblyLoadContext_002ECoreCLR_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F99b58e5049c4c1b08628baf3843f62e765df3a131566566b5bcf4a2c47fb4bd_003FAssemblyLoadContext_002ECoreCLR_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAssemblyLoadContext_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fa6b7f037ba7b44df80b8d3aa7e58eeb2e8e938_003F9f_003F247e98fb_003FAssemblyLoadContext_002Ecs_002Fz_003A2_002D1/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAssemblyLoadContext_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F47e646b7b981834f2b1298e9ba8543fc4994cc50e15f81d515ec883b6e3797b_003FAssemblyLoadContext_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAssemblyName_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003Fe151f62e5a2bc2dcf247d43eb37d7ba6ae4177aabc3e46e7aa6563b35a374536_003FAssemblyName_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAssembly_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F501151723a8d43558c75acbd334f26322066fa4b1c82b1297291314bf92ff_003FAssembly_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAssembly_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F501151723a8d43558c75acbd334f26322066fa4b1c82b1297291314bf92ff_003FAssembly_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAuthenticationHeaderValue_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F88b338246f59cffdb6f3dc3d8dbcfc169599dc71d6f44a8f2732983db7f73a_003FAuthenticationHeaderValue_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAuthenticationHeaderValue_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F88b338246f59cffdb6f3dc3d8dbcfc169599dc71d6f44a8f2732983db7f73a_003FAuthenticationHeaderValue_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAvaloniaXamlLoader_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F80462644bd1cc7e0b229dc4f5752b48c01cb67b46ae563b1b5078cc2556b98_003FAvaloniaXamlLoader_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAvaloniaXamlLoader_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F80462644bd1cc7e0b229dc4f5752b48c01cb67b46ae563b1b5078cc2556b98_003FAvaloniaXamlLoader_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
@@ -20,8 +24,6 @@
|
|||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AFileShare_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fa6b7f037ba7b44df80b8d3aa7e58eeb2e8e938_003F54_003Fc3f4f140_003FFileShare_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AFileShare_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fa6b7f037ba7b44df80b8d3aa7e58eeb2e8e938_003F54_003Fc3f4f140_003FFileShare_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AFile_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F3f31e7e8aa33de883c2ccfa62a9c81bfc246c36e825b489476f9472032e512_003FFile_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AFile_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F3f31e7e8aa33de883c2ccfa62a9c81bfc246c36e825b489476f9472032e512_003FFile_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AFrozenDictionary_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F89dff9063ddb01ff8125b579122b88bf4de94526490d77bcbbef7d0ee662a_003FFrozenDictionary_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AFrozenDictionary_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F89dff9063ddb01ff8125b579122b88bf4de94526490d77bcbbef7d0ee662a_003FFrozenDictionary_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AFuncValueConverter_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003Fe91c13e7e24d7ba324e0e6eb12a24ea8c7761299d3c4703e55c86dd120835e61_003FFuncValueConverter_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AFunc_00601_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fa6b7f037ba7b44df80b8d3aa7e58eeb2e8e938_003Fab_003F4dac48f4_003FFunc_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AFuture_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003Fb3575a2f41d7c2dbfaa36e866b8a361e11dd7223ff82bc574c1d5d4b7522f735_003FFuture_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AFuture_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003Fb3575a2f41d7c2dbfaa36e866b8a361e11dd7223ff82bc574c1d5d4b7522f735_003FFuture_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AHttpClient_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003Fc439425da351c75ac7d966a1cc8324b51a9c471865af79d2f2f3fcb65e392_003FHttpClient_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AHttpClient_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003Fc439425da351c75ac7d966a1cc8324b51a9c471865af79d2f2f3fcb65e392_003FHttpClient_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AHttpContent_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F9657cc383c70851dc2bdcf91eff27f21196844abfe552fc9c3243ff36974cd_003FHttpContent_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AHttpContent_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F9657cc383c70851dc2bdcf91eff27f21196844abfe552fc9c3243ff36974cd_003FHttpContent_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
@@ -34,19 +36,18 @@
|
|||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AHttpResponseMessage_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F4cfeb8b377bc81e1fbb5f7d7a02492cb6ac23e88c8c9d7155944f0716f3d4b_003FHttpResponseMessage_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AHttpResponseMessage_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F4cfeb8b377bc81e1fbb5f7d7a02492cb6ac23e88c8c9d7155944f0716f3d4b_003FHttpResponseMessage_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIDispatcherImpl_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F22d92db124764b1ab49745245c66f01b1e1a00_003F0f_003F01061787_003FIDispatcherImpl_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIDispatcherImpl_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F22d92db124764b1ab49745245c66f01b1e1a00_003F0f_003F01061787_003FIDispatcherImpl_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIDisposable_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fa6b7f037ba7b44df80b8d3aa7e58eeb2e8e938_003F98_003Fd1b23281_003FIDisposable_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIDisposable_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fa6b7f037ba7b44df80b8d3aa7e58eeb2e8e938_003F98_003Fd1b23281_003FIDisposable_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AImage_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F2b95745d8f2ddf7b8ad6130e01c5b2782e253ff11247a9aeefcef47277b1ab_003FImage_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIndex_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F2a1a813823579c69832f1304f97761e7be433bd6aa928f351d138050b56a38_003FIndex_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIndex_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F2a1a813823579c69832f1304f97761e7be433bd6aa928f351d138050b56a38_003FIndex_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AInt32_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003Fa882d183338544fdbcbdfc7b6d3dcb78916630765551644a221b5be9c45a121b_003FInt32_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AInt32_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003Fa882d183338544fdbcbdfc7b6d3dcb78916630765551644a221b5be9c45a121b_003FInt32_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AInterop_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fc4d71b51722245ae8cde97bfd996e68386928_003F3a_003F004a1338_003FInterop_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AInterop_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fc4d71b51722245ae8cde97bfd996e68386928_003F3a_003F004a1338_003FInterop_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AJsonSerializer_002ERead_002EString_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F27c4858128168eda568c1334d70d5241efb9461e2a3209258a04deee5d9c367_003FJsonSerializer_002ERead_002EString_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AJsonSerializer_002ERead_002EString_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F27c4858128168eda568c1334d70d5241efb9461e2a3209258a04deee5d9c367_003FJsonSerializer_002ERead_002EString_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AKnownHeader_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F1079f3c57a31ec97cba3b6ebb3d45c5a4afcdf6fa483a4db57c3d58ea59d7a9_003FKnownHeader_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AKnownHeader_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F1079f3c57a31ec97cba3b6ebb3d45c5a4afcdf6fa483a4db57c3d58ea59d7a9_003FKnownHeader_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AListBox_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F3a6cdc26ff4d30986a9a16b6bbc9bb6a7f2657431c82cde5c66dd377cf51e2b_003FListBox_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AListBox_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F3a6cdc26ff4d30986a9a16b6bbc9bb6a7f2657431c82cde5c66dd377cf51e2b_003FListBox_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMethodInfo_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F6bd3b909e3250b8181899b1a1238cd417918c6c816fbeba173df45af2ec41e_003FMethodInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMetricServer_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fb07ddb833489431aae882d295a4e94797e00_003Fcf_003F23af7cad_003FMetricServer_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMetricServer_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fb07ddb833489431aae882d295a4e94797e00_003Fcf_003F23af7cad_003FMetricServer_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMetricServer_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F66d3496ea2e7f3cbfb5f2ba1362869af0588ac72e87912659693443b5b7c3a_003FMetricServer_002Ecs_002Fz_003A2_002D1/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMetricServer_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F66d3496ea2e7f3cbfb5f2ba1362869af0588ac72e87912659693443b5b7c3a_003FMetricServer_002Ecs_002Fz_003A2_002D1/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMetrics_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fb07ddb833489431aae882d295a4e94797e00_003F0f_003Fc9e3d448_003FMetrics_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMetrics_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fb07ddb833489431aae882d295a4e94797e00_003F0f_003Fc9e3d448_003FMetrics_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANativeLibrary_002ECoreCLR_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F88c2c65e1618f68cb5969f70dfc0986e9571015ac8d487b18d26e89c926264_003FNativeLibrary_002ECoreCLR_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANativeLibrary_002ECoreCLR_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F88c2c65e1618f68cb5969f70dfc0986e9571015ac8d487b18d26e89c926264_003FNativeLibrary_002ECoreCLR_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANativeLibrary_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F49393f3cda2f9a5c2fa811fc9179dcbaf5bd94d9dc8afc76aaff2bc23287f3_003FNativeLibrary_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANativeLibrary_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F49393f3cda2f9a5c2fa811fc9179dcbaf5bd94d9dc8afc76aaff2bc23287f3_003FNativeLibrary_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANullable_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F5acc345db3c207bc9d886a36ff14867ef8d65557432172c2a42f19aeac04d1b_003FNullable_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AObservableCollection_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F3e2c48e6b3ec8b39cf721287f93972c7f3df25d306753bcc539eaad73126c68_003FObservableCollection_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AObservableCollection_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F3e2c48e6b3ec8b39cf721287f93972c7f3df25d306753bcc539eaad73126c68_003FObservableCollection_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AObservableObject_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F3e432edeee9469b7cfdb81d6e6bd278cf57afb9e54ab75649b8bb2f52cdde69_003FObservableObject_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AObservableObject_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F3e432edeee9469b7cfdb81d6e6bd278cf57afb9e54ab75649b8bb2f52cdde69_003FObservableObject_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APanel_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F9b699722324e3615b57977447b25bf953fccb2d6e912ae584f16b7e691ad9d3_003FPanel_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APanel_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F9b699722324e3615b57977447b25bf953fccb2d6e912ae584f16b7e691ad9d3_003FPanel_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
@@ -56,7 +57,6 @@
|
|||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APerfCounterCollector_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fb07ddb833489431aae882d295a4e94797e00_003F4f_003F4c0b90e8_003FPerfCounterCollector_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APerfCounterCollector_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fb07ddb833489431aae882d295a4e94797e00_003F4f_003F4c0b90e8_003FPerfCounterCollector_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AProcessStartInfo_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003Fc5ffb8c166be164bc221db4c64e826a1e8ff54f2f1c9ee8e7f9cfabce707fa4_003FProcessStartInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AProcessStartInfo_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003Fc5ffb8c166be164bc221db4c64e826a1e8ff54f2f1c9ee8e7f9cfabce707fa4_003FProcessStartInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APropertyInfo_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F408236be4b0703755f3ed96daaae245919a792d65ce5eaa672d9fa945b1f_003FPropertyInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APropertyInfo_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F408236be4b0703755f3ed96daaae245919a792d65ce5eaa672d9fa945b1f_003FPropertyInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ARelayCommand_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F20c0f49b8854743afaecc2f359655fdbfc6c5264f49e9eb333686e85a87bf_003FRelayCommand_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AScrollBar_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003Fda7bce95d5f888176a5f93c8965e402ca33cba794ac7e7aa776363c664488d_003FScrollBar_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AScrollBar_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003Fda7bce95d5f888176a5f93c8965e402ca33cba794ac7e7aa776363c664488d_003FScrollBar_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AServiceCollectionContainerBuilderExtensions_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fa8ceca48b7b645dd875a40ee6d28725416d08_003F1b_003F6cd78dc8_003FServiceCollectionContainerBuilderExtensions_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AServiceCollectionContainerBuilderExtensions_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fa8ceca48b7b645dd875a40ee6d28725416d08_003F1b_003F6cd78dc8_003FServiceCollectionContainerBuilderExtensions_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AServiceProviderServiceExtensions_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4f1fdec7cbfe4433a7ec3a6d1bd0e54210118_003F04_003Fe2f5322d_003FServiceProviderServiceExtensions_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AServiceProviderServiceExtensions_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FUsers_003FCinka_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4f1fdec7cbfe4433a7ec3a6d1bd0e54210118_003F04_003Fe2f5322d_003FServiceProviderServiceExtensions_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
|||||||
Reference in New Issue
Block a user