- Config Services almost ready.
- Refactored and flattened namespaces.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace Barotrauma.LuaCs.Configuration;
|
||||
namespace Barotrauma.LuaCs.Data;
|
||||
|
||||
public interface ISettingControl : ISettingBase
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Barotrauma.LuaCs.Configuration;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
|
||||
namespace Barotrauma.LuaCs.Data;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Barotrauma.CharacterEditor;
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs;
|
||||
|
||||
// ReSharper disable ObjectCreationAsStatement
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Barotrauma.Networking;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services.Compatibility;
|
||||
namespace Barotrauma.LuaCs.Compatibility;
|
||||
|
||||
internal partial interface ILuaCsNetworking : ILuaCsShim
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ using Barotrauma.LuaCs.Data;
|
||||
using Barotrauma.Networking;
|
||||
using FluentResults;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public sealed partial class ConfigService
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface IClientLoggerService : IReusableService
|
||||
{
|
||||
|
||||
@@ -3,10 +3,10 @@ using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using Barotrauma.LuaCs.Configuration;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs;
|
||||
using Barotrauma.Networking;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public partial interface IConfigService
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Barotrauma.Networking;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
internal partial interface INetworkingService : IReusableService
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public partial class LoggerService : ILoggerService, IClientLoggerService
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs;
|
||||
using Barotrauma.Networking;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
partial class NetworkingService : INetworkingService
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
using Barotrauma.Networking;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
internal partial interface INetworkingService : IReusableService
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs;
|
||||
using Barotrauma.Networking;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
partial class NetworkingService : INetworkingService
|
||||
{
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using Barotrauma.LuaCs;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services.Compatibility;
|
||||
namespace Barotrauma.LuaCs.Compatibility;
|
||||
|
||||
public interface ILuaCsHook : ILuaPatcher, ILuaCsShim
|
||||
{
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Barotrauma.LuaCs.Compatibility;
|
||||
|
||||
public interface ILuaCsLogger : ILuaCsShim
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Barotrauma.LuaCs.Services.Compatibility;
|
||||
namespace Barotrauma.LuaCs.Compatibility;
|
||||
|
||||
internal partial interface ILuaCsNetworking : ILuaCsShim
|
||||
{
|
||||
@@ -0,0 +1,8 @@
|
||||
using Barotrauma.LuaCs;
|
||||
|
||||
namespace Barotrauma.LuaCs.Compatibility;
|
||||
|
||||
public interface ILuaCsShim : IService
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services.Compatibility;
|
||||
namespace Barotrauma.LuaCs.Compatibility;
|
||||
|
||||
internal partial interface ILuaCsTimer : ILuaCsShim
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Barotrauma.LuaCs.Services.Compatibility;
|
||||
namespace Barotrauma.LuaCs.Compatibility;
|
||||
|
||||
public interface ILuaCsUtility : ILuaCsShim
|
||||
{
|
||||
@@ -6,7 +6,7 @@ using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Xml.Linq;
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs;
|
||||
using Barotrauma.Steam;
|
||||
using OneOf;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using System.Xml.Linq;
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs;
|
||||
using Barotrauma.Networking;
|
||||
|
||||
namespace Barotrauma.LuaCs.Data;
|
||||
|
||||
@@ -3,10 +3,10 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Xml.Linq;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs;
|
||||
using Barotrauma.Networking;
|
||||
|
||||
namespace Barotrauma.LuaCs.Configuration;
|
||||
namespace Barotrauma.LuaCs.Data;
|
||||
|
||||
public interface ISettingBase : IDataInfo, IEquatable<ISettingBase>, IDisposable
|
||||
{
|
||||
@@ -68,9 +68,10 @@ public interface ISettingBase<T> : ISettingBase where T : IEquatable<T>, IConver
|
||||
|
||||
/// <summary>
|
||||
/// Creates a setting representing a value of the given <see cref="Type"/> with a minimum and maximum value.
|
||||
/// Must be a type compatible with <see cref="ISettingBase{T}"/>.
|
||||
/// Can only be either an <see cref="int"/> or a <see cref="float"/>.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The value type. See <see cref="ISettingBase{T}"/></typeparam>
|
||||
/// <remarks>The type selection is limited by the Undertow implementation of the GUI Slider.</remarks>
|
||||
/// <typeparam name="T">The value type, either <see cref="int"/> or <see cref="float"/></typeparam>
|
||||
public interface ISettingRangeBase<T> : ISettingBase<T> where T : IEquatable<T>, IConvertible
|
||||
{
|
||||
T MinValue { get; }
|
||||
@@ -7,7 +7,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Security.AccessControl;
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs;
|
||||
using Barotrauma.Networking;
|
||||
using FluentResults;
|
||||
using OneOf.Types;
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Xml.Linq;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using OneOf;
|
||||
|
||||
namespace Barotrauma.LuaCs.Configuration;
|
||||
namespace Barotrauma.LuaCs.Data;
|
||||
|
||||
public abstract class SettingBase : ISettingBase
|
||||
{
|
||||
@@ -2,12 +2,12 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Xml.Linq;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs;
|
||||
using Barotrauma.Networking;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
using OneOf;
|
||||
|
||||
namespace Barotrauma.LuaCs.Configuration;
|
||||
namespace Barotrauma.LuaCs.Data;
|
||||
|
||||
public class SettingEntry<T> : SettingBase, ISettingBase<T>, INetworkSyncEntity where T : IEquatable<T>, IConvertible
|
||||
{
|
||||
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using System.Xml.Linq;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
using OneOf;
|
||||
|
||||
namespace Barotrauma.LuaCs.Data;
|
||||
|
||||
public abstract class SettingRangeBase<T> : SettingEntry<T>, ISettingRangeBase<T> where T : IEquatable<T>, IConvertible
|
||||
{
|
||||
public SettingRangeBase(IConfigInfo configInfo, Func<OneOf<string, XElement, object>, bool> valueChangePredicate) : base(configInfo, valueChangePredicate)
|
||||
{
|
||||
}
|
||||
|
||||
public T MinValue { get; protected init; }
|
||||
public T MaxValue { get; protected init; }
|
||||
public int IncrementalSteps { get; protected init; }
|
||||
}
|
||||
|
||||
public class SettingRangeFloat : SettingRangeBase<float>
|
||||
{
|
||||
public class RangeFactory : ISettingBase.IFactory<SettingRangeFloat>
|
||||
{
|
||||
public SettingRangeFloat CreateInstance(IConfigInfo configInfo, Func<OneOf<string, XElement, object>, bool> valueChangePredicate)
|
||||
{
|
||||
Guard.IsNotNull(configInfo, nameof(configInfo));
|
||||
return new SettingRangeFloat(configInfo, valueChangePredicate);
|
||||
}
|
||||
}
|
||||
|
||||
public SettingRangeFloat(IConfigInfo configInfo, Func<OneOf<string, XElement, object>, bool> valueChangePredicate) : base(configInfo, valueChangePredicate)
|
||||
{
|
||||
// funny values in case they forget to set them in the config.
|
||||
MinValue = configInfo.Element.GetAttributeFloat("Min", float.MinValue);
|
||||
MaxValue = configInfo.Element.GetAttributeFloat("Max", float.MaxValue);
|
||||
IncrementalSteps = configInfo.Element.GetAttributeInt("Steps", 3);
|
||||
}
|
||||
|
||||
public override bool TrySetValue(float value)
|
||||
{
|
||||
if (value > MaxValue || value < MinValue)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return base.TrySetValue(value);
|
||||
}
|
||||
}
|
||||
|
||||
public class SettingRangeInt : SettingRangeBase<int>
|
||||
{
|
||||
public class RangeFactory : ISettingBase.IFactory<SettingRangeInt>
|
||||
{
|
||||
public SettingRangeInt CreateInstance(IConfigInfo configInfo, Func<OneOf<string, XElement, object>, bool> valueChangePredicate)
|
||||
{
|
||||
Guard.IsNotNull(configInfo, nameof(configInfo));
|
||||
return new SettingRangeInt(configInfo, valueChangePredicate);
|
||||
}
|
||||
}
|
||||
|
||||
public SettingRangeInt(IConfigInfo configInfo, Func<OneOf<string, XElement, object>, bool> valueChangePredicate) : base(configInfo, valueChangePredicate)
|
||||
{
|
||||
// funny values in case they forget to set them in the config.
|
||||
MinValue = configInfo.Element.GetAttributeInt("Min", int.MinValue);
|
||||
MaxValue = configInfo.Element.GetAttributeInt("Max", int.MaxValue);
|
||||
IncrementalSteps = configInfo.Element.GetAttributeInt("Steps", 3);
|
||||
}
|
||||
|
||||
public override bool TrySetValue(int value)
|
||||
{
|
||||
if (value > MaxValue || value < MinValue)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return base.TrySetValue(value);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using System.Xml.Linq;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using Barotrauma.LuaCs;
|
||||
|
||||
namespace Barotrauma.LuaCs.Data;
|
||||
|
||||
public interface ISettingsRegistrationProvider : IService
|
||||
{
|
||||
void RegisterTypeProviders(IConfigService configService, Func<OneOf<string, XElement, object>, bool> valueChangePredicate);
|
||||
}
|
||||
|
||||
public class SettingsEntryRegistrar : ISettingsRegistrationProvider
|
||||
{
|
||||
private ILuaCsInfoProvider _infoProvider;
|
||||
|
||||
public SettingsEntryRegistrar(ILuaCsInfoProvider infoProvider)
|
||||
{
|
||||
_infoProvider = infoProvider;
|
||||
}
|
||||
|
||||
public void RegisterTypeProviders(IConfigService configService, Func<OneOf<string, XElement, object>, bool> valueChangePredicate)
|
||||
{
|
||||
// ISettingBase<T>
|
||||
RegisterSettingEntry<bool>(configService, "bool");
|
||||
RegisterSettingEntry<byte>(configService, "byte");
|
||||
RegisterSettingEntry<sbyte>(configService, "sbyte");
|
||||
RegisterSettingEntry<short>(configService, "short");
|
||||
RegisterSettingEntry<ushort>(configService, "ushort");
|
||||
RegisterSettingEntry<int>(configService, "int");
|
||||
RegisterSettingEntry<uint>(configService, "uint");
|
||||
RegisterSettingEntry<long>(configService, "long");
|
||||
RegisterSettingEntry<ulong>(configService, "ulong");
|
||||
RegisterSettingEntry<string>(configService, "string");
|
||||
// ISettingRangeBase<T>
|
||||
// ISettingList
|
||||
}
|
||||
|
||||
private void RegisterSettingEntry<T>(IConfigService configService, string typeName) where T : IEquatable<T>, IConvertible
|
||||
{
|
||||
configService.RegisterSettingTypeInitializer(typeName, cfgInfo =>
|
||||
{
|
||||
return new SettingEntry<bool>.Factory().CreateInstance(cfgInfo.Info, (val) =>
|
||||
{
|
||||
return !cfgInfo.Info.Element.GetAttributeBool("ReadOnly", false)
|
||||
&& cfgInfo.Info.EditableStates.HasFlag(_infoProvider?.CurrentRunState ?? RunState.Running);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (!ModUtils.Threading.CheckIfClearAndSetBool(ref _isDisposed))
|
||||
{
|
||||
return;
|
||||
}
|
||||
_infoProvider.Dispose();
|
||||
_infoProvider = null;
|
||||
}
|
||||
|
||||
private int _isDisposed;
|
||||
public bool IsDisposed
|
||||
{
|
||||
get => ModUtils.Threading.GetBool(ref _isDisposed);
|
||||
private set => ModUtils.Threading.SetBool(ref _isDisposed, value);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Barotrauma.LuaCs.Configuration;
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using Barotrauma.LuaCs;
|
||||
using Barotrauma.Networking;
|
||||
using Dynamitey;
|
||||
using ImpromptuInterface;
|
||||
|
||||
@@ -9,20 +9,16 @@ using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Barotrauma.LuaCs;
|
||||
using Barotrauma.LuaCs.Configuration;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using Barotrauma.LuaCs.Events;
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs.Services.Compatibility;
|
||||
using Barotrauma.LuaCs.Services.Processing;
|
||||
using Barotrauma.LuaCs.Services.Safe;
|
||||
using Barotrauma.LuaCs.Compatibility;
|
||||
using Barotrauma.Networking;
|
||||
using Barotrauma.Steam;
|
||||
using FluentResults;
|
||||
using ImpromptuInterface;
|
||||
using LightInject;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
using AssemblyLoader = Barotrauma.LuaCs.Services.AssemblyLoader;
|
||||
using AssemblyLoader = Barotrauma.LuaCs.AssemblyLoader;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
@@ -193,10 +189,11 @@ namespace Barotrauma
|
||||
servicesProvider.RegisterServiceType<ILuaPatcher, LuaPatcherService>(ServiceLifetime.Singleton);
|
||||
servicesProvider.RegisterServiceType<ILuaUserDataService, LuaUserDataService>(ServiceLifetime.Singleton);
|
||||
servicesProvider.RegisterServiceType<ISafeLuaUserDataService, SafeLuaUserDataService>(ServiceLifetime.Singleton);
|
||||
|
||||
servicesProvider.RegisterServiceType<ILuaCsInfoProvider, LuaCsInfoProvider>(ServiceLifetime.Transient);
|
||||
servicesProvider.RegisterServiceType<ILuaScriptLoader, LuaScriptLoader>(ServiceLifetime.Transient);
|
||||
servicesProvider.RegisterServiceType<LuaGame, LuaGame>(ServiceLifetime.Singleton);
|
||||
servicesProvider.RegisterServiceType<ILuaCsTimer, LuaCsTimer>(ServiceLifetime.Singleton);
|
||||
servicesProvider.RegisterServiceType<ISettingsRegistrationProvider, SettingsEntryRegistrar>(ServiceLifetime.Transient);
|
||||
// TODO: INetworkingService
|
||||
servicesProvider.RegisterServiceType<IConfigService, ConfigService>(ServiceLifetime.Singleton);
|
||||
servicesProvider.RegisterServiceType<IModConfigService, ModConfigService>(ServiceLifetime.Transient);
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Barotrauma.LuaCs.Services.Compatibility;
|
||||
|
||||
public interface ILuaCsLogger : ILuaCsShim
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Barotrauma.LuaCs.Services.Compatibility;
|
||||
|
||||
public interface ILuaCsShim : IService
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
|
||||
public class PluginService
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Barotrauma.LuaCs.Services.Safe;
|
||||
|
||||
public interface ILuaService
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public partial interface INetCallback
|
||||
{
|
||||
@@ -1,10 +1,9 @@
|
||||
using System;
|
||||
using Barotrauma.LuaCs.Configuration;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs;
|
||||
using Barotrauma.Networking;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface INetworkSyncEntity
|
||||
{
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Barotrauma.LuaCs;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Barotrauma;
|
||||
|
||||
public enum ApplicationMode
|
||||
{
|
||||
Client, Server
|
||||
}
|
||||
@@ -21,7 +21,7 @@ using Path = System.IO.Path;
|
||||
|
||||
[assembly: InternalsVisibleTo(IAssemblyLoaderService.InternalsAwareAssemblyName)]
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
public sealed class AssemblyLoader : AssemblyLoadContext, IAssemblyLoaderService
|
||||
{
|
||||
public class Factory : IAssemblyLoaderService.IFactory
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
namespace Barotrauma;
|
||||
|
||||
public enum AssemblyLoadingSuccessState
|
||||
{
|
||||
ACLLoadFailure,
|
||||
AlreadyLoaded,
|
||||
BadFilePath,
|
||||
CannotLoadFile,
|
||||
InvalidAssembly,
|
||||
NoAssemblyFound,
|
||||
PluginInstanceFailure,
|
||||
BadName,
|
||||
CannotLoadFromStream,
|
||||
Success
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@ using System.ComponentModel.DataAnnotations;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using Barotrauma.LuaCs.Events;
|
||||
|
||||
namespace Barotrauma;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface IAssemblyPlugin : IDisposable, IEventPluginPreInitialize, IEventPluginInitialize, IEventPluginLoadCompleted { }
|
||||
|
||||
@@ -6,6 +6,7 @@ using Barotrauma.LuaCs.Data;
|
||||
namespace Barotrauma;
|
||||
|
||||
[Serializable]
|
||||
[Obsolete($"Use {nameof(IModConfigInfo)} instead. This class exists for legacy compatibility only.")]
|
||||
public sealed class RunConfig : IRunConfig
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -9,14 +9,13 @@ using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
using Barotrauma.LuaCs.Configuration;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using Barotrauma.LuaCs.Events;
|
||||
using Barotrauma.LuaCs.Services.Processing;
|
||||
using Barotrauma.LuaCs;
|
||||
using FluentResults;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public sealed partial class ConfigService : IConfigService
|
||||
{
|
||||
@@ -122,7 +121,7 @@ public sealed partial class ConfigService : IConfigService
|
||||
|
||||
private readonly ConcurrentDictionary<(ContentPackage OwnerPackage, string InternalName), ISettingBase>
|
||||
_settingsInstances = new();
|
||||
private readonly ConcurrentDictionary<string, Func<IConfigInfo, ISettingBase>>
|
||||
private readonly ConcurrentDictionary<string, Func<(IConfigService ConfigService, IConfigInfo Info), ISettingBase>>
|
||||
_instanceFactory = new();
|
||||
private readonly ConcurrentDictionary<ContentPackage, ConcurrentBag<ISettingBase>>
|
||||
_settingsInstancesByPackage = new();
|
||||
@@ -146,7 +145,7 @@ public sealed partial class ConfigService : IConfigService
|
||||
}
|
||||
|
||||
|
||||
public void RegisterSettingTypeInitializer<T>(string typeIdentifier, Func<IConfigInfo, T> settingFactory) where T : class, ISettingBase
|
||||
public void RegisterSettingTypeInitializer<T>(string typeIdentifier, Func<(IConfigService ConfigService, IConfigInfo Info), T> settingFactory) where T : class, ISettingBase
|
||||
{
|
||||
Guard.IsNotNullOrWhiteSpace(typeIdentifier, nameof(typeIdentifier));
|
||||
Guard.IsNotNull(settingFactory, nameof(settingFactory));
|
||||
@@ -199,7 +198,7 @@ public sealed partial class ConfigService : IConfigService
|
||||
.SelectMany(tr => tr)
|
||||
.ToImmutableArray();
|
||||
|
||||
var instanceQueue = new Queue<(IConfigInfo configInfo, Func<IConfigInfo, ISettingBase> factory)>();
|
||||
var instanceQueue = new Queue<(IConfigInfo configInfo, Func<(IConfigService ConfigService, IConfigInfo Info), ISettingBase> factory)>();
|
||||
|
||||
foreach (var info in toProcessDocs)
|
||||
{
|
||||
@@ -222,7 +221,7 @@ public sealed partial class ConfigService : IConfigService
|
||||
{
|
||||
try
|
||||
{
|
||||
toProcessInstanceQueue.Enqueue((instanceFactoryInfo.configInfo, instanceFactoryInfo.factory(instanceFactoryInfo.configInfo)));
|
||||
toProcessInstanceQueue.Enqueue((instanceFactoryInfo.configInfo, instanceFactoryInfo.factory((this, instanceFactoryInfo.configInfo))));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using Barotrauma.Extensions;
|
||||
using Barotrauma.LuaCs.Events;
|
||||
using Barotrauma.LuaCs.Services.Compatibility;
|
||||
using Barotrauma.LuaCs.Compatibility;
|
||||
using FluentResults;
|
||||
using FluentResults.LuaCs;
|
||||
using HarmonyLib;
|
||||
@@ -15,7 +15,7 @@ using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public partial class EventService : IEventService
|
||||
{
|
||||
@@ -5,7 +5,7 @@ using FluentResults;
|
||||
using Microsoft.Xna.Framework;
|
||||
using MoonSharp.Interpreter;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public partial class LoggerService : ILoggerService
|
||||
{
|
||||
@@ -0,0 +1,18 @@
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public sealed class LuaCsInfoProvider : ILuaCsInfoProvider
|
||||
{
|
||||
public void Dispose()
|
||||
{
|
||||
// stateless service
|
||||
}
|
||||
|
||||
public bool IsDisposed => false;
|
||||
public bool IsCsEnabled => GameMain.LuaCs.IsCsEnabled;
|
||||
public bool DisableErrorGUIOverlay => GameMain.LuaCs.DisableErrorGUIOverlay;
|
||||
public bool HideUserNamesInLogs => GameMain.LuaCs.HideUserNamesInLogs;
|
||||
public ulong LuaForBarotraumaSteamId => GameMain.LuaCs.LuaForBarotraumaSteamId;
|
||||
public bool RestrictMessageSize => GameMain.LuaCs.RestrictMessageSize;
|
||||
public string LocalDataSavePath => GameMain.LuaCs.LocalDataSavePath;
|
||||
public RunState CurrentRunState => GameMain.LuaCs.CurrentRunState;
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
#nullable enable
|
||||
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using Barotrauma.LuaCs.Services.Compatibility;
|
||||
using Barotrauma.LuaCs.Services.Safe;
|
||||
using Barotrauma.LuaCs.Compatibility;
|
||||
using Barotrauma.Networking;
|
||||
using FluentResults;
|
||||
using Microsoft.CodeAnalysis;
|
||||
@@ -21,8 +20,9 @@ using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Barotrauma.LuaCs;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
class LuaScriptManagementService : ILuaScriptManagementService, ILuaDataService
|
||||
{
|
||||
@@ -8,7 +8,7 @@ using Barotrauma.LuaCs.Data;
|
||||
using FluentResults;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services.Processing;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public sealed class ModConfigFileParserService :
|
||||
IParserServiceAsync<ResourceParserInfo, IAssemblyResourceInfo>,
|
||||
@@ -14,7 +14,7 @@ using FluentResults;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
using MoonSharp.VsCodeDebugger.SDK;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services.Processing;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public sealed class ModConfigService : IModConfigService
|
||||
{
|
||||
@@ -1,9 +1,9 @@
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs;
|
||||
using Barotrauma.Networking;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
internal partial class NetworkingService : INetworkingService
|
||||
{
|
||||
@@ -9,7 +9,7 @@ using Barotrauma.LuaCs.Data;
|
||||
using FluentResults;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public sealed class PackageManagementService : IPackageManagementService
|
||||
{
|
||||
@@ -25,7 +25,7 @@ using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
using OneOf;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public class PluginManagementService : IAssemblyManagementService
|
||||
{
|
||||
@@ -71,12 +71,11 @@ public class PluginManagementService : IAssemblyManagementService
|
||||
|
||||
private static readonly SyntaxTree BaseAssemblyImports = CSharpSyntaxTree.ParseText(
|
||||
new StringBuilder()
|
||||
.AppendLine("global using LuaCsHook = Barotrauma.LuaCs.Services.Compatibility.ILuaCsHook;")
|
||||
.AppendLine("global using LuaCsHook = Barotrauma.LuaCs.Compatibility.ILuaCsHook;")
|
||||
.AppendLine("using System.Reflection;")
|
||||
.AppendLine("using Barotrauma;")
|
||||
.AppendLine("using Barotrauma.LuaCs;")
|
||||
.AppendLine("using Barotrauma.LuaCs.Services;")
|
||||
.AppendLine("using Barotrauma.LuaCs.Services.Compatibility;")
|
||||
.AppendLine("using Barotrauma.LuaCs.Compatibility;")
|
||||
.AppendLine("using System.Runtime.CompilerServices;")
|
||||
.AppendLine("[assembly: IgnoresAccessChecksTo(\"BarotraumaCore\")]")
|
||||
#if CLIENT
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public class PluginService
|
||||
{
|
||||
|
||||
}
|
||||
@@ -15,7 +15,7 @@ using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
using Path = System.IO.Path;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services.Safe;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public class SafeStorageService : StorageService, ISafeStorageService
|
||||
{
|
||||
@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using LightInject;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
|
||||
public class ServicesProvider : IServicesProvider
|
||||
@@ -9,7 +9,7 @@ using FluentResults;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
using OneOf;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services.Processing;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public sealed class SettingsFileParserService :
|
||||
IParserServiceOneToManyAsync<IConfigResourceInfo, IConfigInfo>,
|
||||
@@ -17,7 +17,7 @@ using Microsoft.Toolkit.Diagnostics;
|
||||
using Error = FluentResults.Error;
|
||||
using Path = System.IO.Path;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public class StorageService : IStorageService
|
||||
{
|
||||
@@ -10,7 +10,7 @@ using OneOf;
|
||||
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface IAssemblyManagementService : IPluginManagementService
|
||||
{
|
||||
@@ -4,26 +4,17 @@ using System.Collections.Immutable;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
using Barotrauma.LuaCs.Configuration;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs.Services.Safe;
|
||||
using Barotrauma.LuaCs;
|
||||
using Barotrauma.Networking;
|
||||
using FluentResults;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public partial interface IConfigService : IReusableService, ILuaConfigService
|
||||
{
|
||||
void RegisterSettingTypeInitializer<T>(string typeIdentifier, Func<IConfigInfo, T> settingFactory)
|
||||
void RegisterSettingTypeInitializer<T>(string typeIdentifier, Func<(IConfigService ConfigService, IConfigInfo Info), T> settingFactory)
|
||||
where T : class, ISettingBase;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="configResources"></param>
|
||||
/// <exception cref="ArgumentException"></exception>
|
||||
/// <exception cref="NullReferenceException"></exception>
|
||||
/// <returns></returns>
|
||||
Task<FluentResults.Result> LoadConfigsAsync(ImmutableArray<IConfigResourceInfo> configResources);
|
||||
Task<FluentResults.Result> LoadConfigsProfilesAsync(ImmutableArray<IConfigResourceInfo> configProfileResources);
|
||||
FluentResults.Result DisposePackageData(ContentPackage package);
|
||||
@@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using Barotrauma.LuaCs.Events;
|
||||
using Barotrauma.LuaCs.Services.Compatibility;
|
||||
using Barotrauma.LuaCs.Services.Safe;
|
||||
using Barotrauma.LuaCs.Compatibility;
|
||||
using Barotrauma.LuaCs;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface IEventService : IReusableService, ILuaEventService
|
||||
{
|
||||
@@ -5,7 +5,7 @@ using System.Xml.Linq;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using FluentResults;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services.Processing;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface IParserService<in TSrc, TOut> : IService
|
||||
{
|
||||
@@ -3,7 +3,7 @@ using Barotrauma.Networking;
|
||||
using FluentResults;
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
/// <summary>
|
||||
/// Provides console and debug logging services
|
||||
@@ -0,0 +1,42 @@
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to data from the current <see cref="LuaCsSetup"/>.
|
||||
/// </summary>
|
||||
public interface ILuaCsInfoProvider : IService
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether C# plugin code is enabled.
|
||||
/// </summary>
|
||||
public bool IsCsEnabled { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether the popup error GUI should be hidden/suppressed.
|
||||
/// </summary>
|
||||
public bool DisableErrorGUIOverlay { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether usernames are anonymized or show in logs.
|
||||
/// </summary>
|
||||
public bool HideUserNamesInLogs { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The SteamId of the Workshop LuaCs CPackage in use, if available.
|
||||
/// </summary>
|
||||
public ulong LuaForBarotraumaSteamId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Restrict the maximum size of messages sent over the network.
|
||||
/// </summary>
|
||||
public bool RestrictMessageSize { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The local save path for all local data storage for mods.
|
||||
/// </summary>
|
||||
public string LocalDataSavePath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The current state of the Execution State Machine.
|
||||
/// </summary>
|
||||
public RunState CurrentRunState { get; }
|
||||
}
|
||||
@@ -10,7 +10,7 @@ using FluentResults;
|
||||
using MoonSharp.Interpreter;
|
||||
using MoonSharp.Interpreter.Interop;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface ILuaScriptManagementService : IReusableService
|
||||
{
|
||||
@@ -4,10 +4,10 @@ using System.Collections.Immutable;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Threading.Tasks;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using Barotrauma.LuaCs.Services.Processing;
|
||||
using Barotrauma.LuaCs;
|
||||
using FluentResults;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface IModConfigService : IService
|
||||
{
|
||||
@@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs.Services.Compatibility;
|
||||
using Barotrauma.LuaCs;
|
||||
using Barotrauma.LuaCs.Compatibility;
|
||||
using Barotrauma.Networking;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
internal delegate void NetMessageReceived(IReadMessage netMessage);
|
||||
|
||||
@@ -8,7 +8,7 @@ using Barotrauma.Extensions;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using FluentResults;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface IPackageManagementService : IReusableService
|
||||
{
|
||||
@@ -5,7 +5,7 @@ using System.Reflection;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using Microsoft.CodeAnalysis;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface IPluginManagementService : IReusableService
|
||||
{
|
||||
@@ -4,7 +4,7 @@ using System.Collections.Immutable;
|
||||
using System.Reflection;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface IPluginService : IReusableService
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Immutable;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services.Safe;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface ISafeStorageService : IStorageService, ISafeStorageValidation { }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
/// <summary>
|
||||
/// Defines a service that can be reset to it's post-constructor state and reused without needing to be disposed.
|
||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using LightInject;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
/// <summary>
|
||||
/// Provides instancing and management of IServices.
|
||||
@@ -5,7 +5,7 @@ using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
using FluentResults;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface IStorageService : IService
|
||||
{
|
||||
@@ -7,7 +7,7 @@ using System.Numerics;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface IDefaultLuaRegistrar : IService
|
||||
{
|
||||
@@ -1,8 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using Barotrauma.LuaCs.Configuration;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services.Safe;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface ILuaConfigService : ILuaService
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using MoonSharp.Interpreter;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services.Safe;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
/// <summary>
|
||||
/// Service for providing stateful functions and in-memory storage for lua functions
|
||||
@@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Barotrauma.LuaCs.Events;
|
||||
using Barotrauma.LuaCs.Services.Compatibility;
|
||||
using Barotrauma.LuaCs.Compatibility;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services.Safe;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface ILuaSafeEventService : ILuaService, ILuaCsHook
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Barotrauma.LuaCs.Services.Safe;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface ILuaNetworkingService : ILuaService
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Barotrauma.LuaCs.Services.Safe;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface ILuaPackageManagementService : ILuaService
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Barotrauma.LuaCs.Services.Safe;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface ILuaPackageService : ILuaService
|
||||
{
|
||||
@@ -1,8 +1,8 @@
|
||||
using System.Reflection;
|
||||
using static Barotrauma.LuaCs.Services.Compatibility.ILuaCsHook;
|
||||
using static Barotrauma.LuaCs.Compatibility.ILuaCsHook;
|
||||
using LuaCsCompatPatchFunc = Barotrauma.LuaCsPatch;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface ILuaPatcher : IReusableService
|
||||
{
|
||||
@@ -4,7 +4,7 @@ using Barotrauma.LuaCs.Data;
|
||||
using FluentResults;
|
||||
using MoonSharp.Interpreter.Loaders;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services.Safe;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface ILuaScriptLoader : IService, IScriptLoader, ISafeStorageValidation
|
||||
{
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface ILuaService
|
||||
{
|
||||
|
||||
}
|
||||
@@ -5,7 +5,7 @@ using FarseerPhysics.Dynamics;
|
||||
using LuaCsCompatPatchFunc = Barotrauma.LuaCsPatch;
|
||||
using Barotrauma.Networking;
|
||||
using System.Collections.Immutable;
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
@@ -1,6 +1,6 @@
|
||||
using Barotrauma.LuaCs.Events;
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs.Services.Compatibility;
|
||||
using Barotrauma.LuaCs;
|
||||
using Barotrauma.LuaCs.Compatibility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
@@ -3,13 +3,13 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using Barotrauma.Items.Components;
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs;
|
||||
using Barotrauma.Networking;
|
||||
using FarseerPhysics.Dynamics;
|
||||
using Microsoft.Xna.Framework;
|
||||
using MoonSharp.Interpreter;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services
|
||||
namespace Barotrauma.LuaCs
|
||||
{
|
||||
partial class LuaGame : IReusableService
|
||||
{
|
||||
@@ -1,11 +1,11 @@
|
||||
global using LuaCsHook = Barotrauma.LuaCs.Services.Compatibility.ILuaCsHook;
|
||||
global using LuaCsHook = Barotrauma.LuaCs.Compatibility.ILuaCsHook;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using HarmonyLib;
|
||||
using System.Collections.Generic;
|
||||
using Barotrauma.LuaCs.Services.Compatibility;
|
||||
using Barotrauma.LuaCs.Compatibility;
|
||||
using MoonSharp.Interpreter;
|
||||
using LuaCsCompatPatchFunc = Barotrauma.LuaCsPatch;
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Barotrauma
|
||||
public delegate object LuaCsPatch(object self, Dictionary<string, object> args);
|
||||
}
|
||||
|
||||
namespace Barotrauma.LuaCs.Services
|
||||
namespace Barotrauma.LuaCs
|
||||
{
|
||||
partial class LuaPatcherService
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs;
|
||||
using HarmonyLib;
|
||||
using Microsoft.Xna.Framework;
|
||||
using MoonSharp.Interpreter;
|
||||
@@ -23,7 +23,7 @@ namespace Barotrauma
|
||||
public delegate DynValue LuaCsPatchFunc(object instance, LuaPatcherService.ParameterTable ptable);
|
||||
}
|
||||
|
||||
namespace Barotrauma.LuaCs.Services
|
||||
namespace Barotrauma.LuaCs
|
||||
{
|
||||
public partial class LuaPatcherService : ILuaPatcher
|
||||
{
|
||||
@@ -8,10 +8,10 @@ using MoonSharp.Interpreter.Loaders;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Barotrauma.LuaCs.Data;
|
||||
using Barotrauma.LuaCs.Services.Safe;
|
||||
using Barotrauma.LuaCs;
|
||||
using FluentResults;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services.Safe
|
||||
namespace Barotrauma.LuaCs
|
||||
{
|
||||
public class LuaScriptLoader : ScriptLoaderBase, ILuaScriptLoader
|
||||
{
|
||||
@@ -6,7 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface ILuaUserDataService : IReusableService
|
||||
{
|
||||
@@ -1,12 +1,12 @@
|
||||
using Barotrauma;
|
||||
using Barotrauma.LuaCs.Services;
|
||||
using Barotrauma.LuaCs;
|
||||
using MoonSharp.Interpreter;
|
||||
using MoonSharp.Interpreter.Interop;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Barotrauma.LuaCs.Services;
|
||||
namespace Barotrauma.LuaCs;
|
||||
|
||||
public interface ISafeLuaUserDataService : IService
|
||||
{
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user