- Config Services almost ready.
- Refactored and flattened namespaces.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Configuration;
|
namespace Barotrauma.LuaCs.Data;
|
||||||
|
|
||||||
public interface ISettingControl : ISettingBase
|
public interface ISettingControl : ISettingBase
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using Barotrauma.LuaCs.Configuration;
|
using Barotrauma.LuaCs.Data;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Data;
|
namespace Barotrauma.LuaCs.Data;
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Barotrauma.CharacterEditor;
|
using Barotrauma.CharacterEditor;
|
||||||
using Barotrauma.LuaCs.Services;
|
using Barotrauma.LuaCs;
|
||||||
|
|
||||||
// ReSharper disable ObjectCreationAsStatement
|
// ReSharper disable ObjectCreationAsStatement
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services.Compatibility;
|
namespace Barotrauma.LuaCs.Compatibility;
|
||||||
|
|
||||||
internal partial interface ILuaCsNetworking : ILuaCsShim
|
internal partial interface ILuaCsNetworking : ILuaCsShim
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using Barotrauma.LuaCs.Data;
|
|||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
using FluentResults;
|
using FluentResults;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public sealed partial class ConfigService
|
public sealed partial class ConfigService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public interface IClientLoggerService : IReusableService
|
public interface IClientLoggerService : IReusableService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ using System.Collections.Generic;
|
|||||||
using System.Collections.Immutable;
|
using System.Collections.Immutable;
|
||||||
using Barotrauma.LuaCs.Configuration;
|
using Barotrauma.LuaCs.Configuration;
|
||||||
using Barotrauma.LuaCs.Data;
|
using Barotrauma.LuaCs.Data;
|
||||||
using Barotrauma.LuaCs.Services;
|
using Barotrauma.LuaCs;
|
||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public partial interface IConfigService
|
public partial interface IConfigService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
internal partial interface INetworkingService : IReusableService
|
internal partial interface INetworkingService : IReusableService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public partial class LoggerService : ILoggerService, IClientLoggerService
|
public partial class LoggerService : ILoggerService, IClientLoggerService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using Barotrauma.LuaCs.Services;
|
using Barotrauma.LuaCs;
|
||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
partial class NetworkingService : INetworkingService
|
partial class NetworkingService : INetworkingService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
internal partial interface INetworkingService : IReusableService
|
internal partial interface INetworkingService : IReusableService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
using Barotrauma.LuaCs.Services;
|
using Barotrauma.LuaCs;
|
||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
// ReSharper disable once CheckNamespace
|
// ReSharper disable once CheckNamespace
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
partial class NetworkingService : INetworkingService
|
partial class NetworkingService : INetworkingService
|
||||||
{
|
{
|
||||||
|
|||||||
+2
-1
@@ -1,7 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using Barotrauma.LuaCs;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services.Compatibility;
|
namespace Barotrauma.LuaCs.Compatibility;
|
||||||
|
|
||||||
public interface ILuaCsHook : ILuaPatcher, ILuaCsShim
|
public interface ILuaCsHook : ILuaPatcher, ILuaCsShim
|
||||||
{
|
{
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Barotrauma.LuaCs.Compatibility;
|
||||||
|
|
||||||
|
public interface ILuaCsLogger : ILuaCsShim
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
namespace Barotrauma.LuaCs.Services.Compatibility;
|
namespace Barotrauma.LuaCs.Compatibility;
|
||||||
|
|
||||||
internal partial interface ILuaCsNetworking : ILuaCsShim
|
internal partial interface ILuaCsNetworking : ILuaCsShim
|
||||||
{
|
{
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
using Barotrauma.LuaCs;
|
||||||
|
|
||||||
|
namespace Barotrauma.LuaCs.Compatibility;
|
||||||
|
|
||||||
|
public interface ILuaCsShim : IService
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services.Compatibility;
|
namespace Barotrauma.LuaCs.Compatibility;
|
||||||
|
|
||||||
internal partial interface ILuaCsTimer : ILuaCsShim
|
internal partial interface ILuaCsTimer : ILuaCsShim
|
||||||
{
|
{
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
namespace Barotrauma.LuaCs.Services.Compatibility;
|
namespace Barotrauma.LuaCs.Compatibility;
|
||||||
|
|
||||||
public interface ILuaCsUtility : ILuaCsShim
|
public interface ILuaCsUtility : ILuaCsShim
|
||||||
{
|
{
|
||||||
@@ -6,7 +6,7 @@ using System.Linq;
|
|||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using Barotrauma.LuaCs.Services;
|
using Barotrauma.LuaCs;
|
||||||
using Barotrauma.Steam;
|
using Barotrauma.Steam;
|
||||||
using OneOf;
|
using OneOf;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using Barotrauma.LuaCs.Services;
|
using Barotrauma.LuaCs;
|
||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Data;
|
namespace Barotrauma.LuaCs.Data;
|
||||||
|
|||||||
+5
-4
@@ -3,10 +3,10 @@ using System.Collections.Generic;
|
|||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using Barotrauma.LuaCs.Data;
|
using Barotrauma.LuaCs.Data;
|
||||||
using Barotrauma.LuaCs.Services;
|
using Barotrauma.LuaCs;
|
||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Configuration;
|
namespace Barotrauma.LuaCs.Data;
|
||||||
|
|
||||||
public interface ISettingBase : IDataInfo, IEquatable<ISettingBase>, IDisposable
|
public interface ISettingBase : IDataInfo, IEquatable<ISettingBase>, IDisposable
|
||||||
{
|
{
|
||||||
@@ -68,9 +68,10 @@ public interface ISettingBase<T> : ISettingBase where T : IEquatable<T>, IConver
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a setting representing a value of the given <see cref="Type"/> with a minimum and maximum value.
|
/// 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>
|
/// </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
|
public interface ISettingRangeBase<T> : ISettingBase<T> where T : IEquatable<T>, IConvertible
|
||||||
{
|
{
|
||||||
T MinValue { get; }
|
T MinValue { get; }
|
||||||
@@ -7,7 +7,7 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Security.AccessControl;
|
using System.Security.AccessControl;
|
||||||
using Barotrauma.LuaCs.Services;
|
using Barotrauma.LuaCs;
|
||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
using FluentResults;
|
using FluentResults;
|
||||||
using OneOf.Types;
|
using OneOf.Types;
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ using System.Xml.Linq;
|
|||||||
using Barotrauma.LuaCs.Data;
|
using Barotrauma.LuaCs.Data;
|
||||||
using OneOf;
|
using OneOf;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Configuration;
|
namespace Barotrauma.LuaCs.Data;
|
||||||
|
|
||||||
public abstract class SettingBase : ISettingBase
|
public abstract class SettingBase : ISettingBase
|
||||||
{
|
{
|
||||||
+2
-2
@@ -2,12 +2,12 @@
|
|||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using Barotrauma.LuaCs.Data;
|
using Barotrauma.LuaCs.Data;
|
||||||
using Barotrauma.LuaCs.Services;
|
using Barotrauma.LuaCs;
|
||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
using Microsoft.Toolkit.Diagnostics;
|
using Microsoft.Toolkit.Diagnostics;
|
||||||
using OneOf;
|
using OneOf;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Configuration;
|
namespace Barotrauma.LuaCs.Data;
|
||||||
|
|
||||||
public class SettingEntry<T> : SettingBase, ISettingBase<T>, INetworkSyncEntity where T : IEquatable<T>, IConvertible
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
+67
@@ -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;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Barotrauma.LuaCs.Configuration;
|
using Barotrauma.LuaCs.Data;
|
||||||
using Barotrauma.LuaCs.Services;
|
using Barotrauma.LuaCs;
|
||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
using Dynamitey;
|
using Dynamitey;
|
||||||
using ImpromptuInterface;
|
using ImpromptuInterface;
|
||||||
|
|||||||
@@ -9,20 +9,16 @@ using System.Reflection;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Barotrauma.LuaCs;
|
using Barotrauma.LuaCs;
|
||||||
using Barotrauma.LuaCs.Configuration;
|
|
||||||
using Barotrauma.LuaCs.Data;
|
using Barotrauma.LuaCs.Data;
|
||||||
using Barotrauma.LuaCs.Events;
|
using Barotrauma.LuaCs.Events;
|
||||||
using Barotrauma.LuaCs.Services;
|
using Barotrauma.LuaCs.Compatibility;
|
||||||
using Barotrauma.LuaCs.Services.Compatibility;
|
|
||||||
using Barotrauma.LuaCs.Services.Processing;
|
|
||||||
using Barotrauma.LuaCs.Services.Safe;
|
|
||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
using Barotrauma.Steam;
|
using Barotrauma.Steam;
|
||||||
using FluentResults;
|
using FluentResults;
|
||||||
using ImpromptuInterface;
|
using ImpromptuInterface;
|
||||||
using LightInject;
|
using LightInject;
|
||||||
using Microsoft.Toolkit.Diagnostics;
|
using Microsoft.Toolkit.Diagnostics;
|
||||||
using AssemblyLoader = Barotrauma.LuaCs.Services.AssemblyLoader;
|
using AssemblyLoader = Barotrauma.LuaCs.AssemblyLoader;
|
||||||
|
|
||||||
namespace Barotrauma
|
namespace Barotrauma
|
||||||
{
|
{
|
||||||
@@ -193,10 +189,11 @@ namespace Barotrauma
|
|||||||
servicesProvider.RegisterServiceType<ILuaPatcher, LuaPatcherService>(ServiceLifetime.Singleton);
|
servicesProvider.RegisterServiceType<ILuaPatcher, LuaPatcherService>(ServiceLifetime.Singleton);
|
||||||
servicesProvider.RegisterServiceType<ILuaUserDataService, LuaUserDataService>(ServiceLifetime.Singleton);
|
servicesProvider.RegisterServiceType<ILuaUserDataService, LuaUserDataService>(ServiceLifetime.Singleton);
|
||||||
servicesProvider.RegisterServiceType<ISafeLuaUserDataService, SafeLuaUserDataService>(ServiceLifetime.Singleton);
|
servicesProvider.RegisterServiceType<ISafeLuaUserDataService, SafeLuaUserDataService>(ServiceLifetime.Singleton);
|
||||||
|
servicesProvider.RegisterServiceType<ILuaCsInfoProvider, LuaCsInfoProvider>(ServiceLifetime.Transient);
|
||||||
servicesProvider.RegisterServiceType<ILuaScriptLoader, LuaScriptLoader>(ServiceLifetime.Transient);
|
servicesProvider.RegisterServiceType<ILuaScriptLoader, LuaScriptLoader>(ServiceLifetime.Transient);
|
||||||
servicesProvider.RegisterServiceType<LuaGame, LuaGame>(ServiceLifetime.Singleton);
|
servicesProvider.RegisterServiceType<LuaGame, LuaGame>(ServiceLifetime.Singleton);
|
||||||
servicesProvider.RegisterServiceType<ILuaCsTimer, LuaCsTimer>(ServiceLifetime.Singleton);
|
servicesProvider.RegisterServiceType<ILuaCsTimer, LuaCsTimer>(ServiceLifetime.Singleton);
|
||||||
|
servicesProvider.RegisterServiceType<ISettingsRegistrationProvider, SettingsEntryRegistrar>(ServiceLifetime.Transient);
|
||||||
// TODO: INetworkingService
|
// TODO: INetworkingService
|
||||||
servicesProvider.RegisterServiceType<IConfigService, ConfigService>(ServiceLifetime.Singleton);
|
servicesProvider.RegisterServiceType<IConfigService, ConfigService>(ServiceLifetime.Singleton);
|
||||||
servicesProvider.RegisterServiceType<IModConfigService, ModConfigService>(ServiceLifetime.Transient);
|
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
-1
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public partial interface INetCallback
|
public partial interface INetCallback
|
||||||
{
|
{
|
||||||
+2
-3
@@ -1,10 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using Barotrauma.LuaCs.Configuration;
|
|
||||||
using Barotrauma.LuaCs.Data;
|
using Barotrauma.LuaCs.Data;
|
||||||
using Barotrauma.LuaCs.Services;
|
using Barotrauma.LuaCs;
|
||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public interface INetworkSyncEntity
|
public interface INetworkSyncEntity
|
||||||
{
|
{
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using Barotrauma.LuaCs;
|
||||||
|
|
||||||
namespace Barotrauma
|
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)]
|
[assembly: InternalsVisibleTo(IAssemblyLoaderService.InternalsAwareAssemblyName)]
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
public sealed class AssemblyLoader : AssemblyLoadContext, IAssemblyLoaderService
|
public sealed class AssemblyLoader : AssemblyLoadContext, IAssemblyLoaderService
|
||||||
{
|
{
|
||||||
public class Factory : IAssemblyLoaderService.IFactory
|
public class Factory : IAssemblyLoaderService.IFactory
|
||||||
|
|||||||
-15
@@ -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.Diagnostics.CodeAnalysis;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using Barotrauma.LuaCs.Services;
|
using Barotrauma.LuaCs;
|
||||||
using Microsoft.CodeAnalysis;
|
using Microsoft.CodeAnalysis;
|
||||||
using Microsoft.CodeAnalysis.CSharp;
|
using Microsoft.CodeAnalysis.CSharp;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using Barotrauma.LuaCs.Events;
|
using Barotrauma.LuaCs.Events;
|
||||||
|
|
||||||
namespace Barotrauma;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public interface IAssemblyPlugin : IDisposable, IEventPluginPreInitialize, IEventPluginInitialize, IEventPluginLoadCompleted { }
|
public interface IAssemblyPlugin : IDisposable, IEventPluginPreInitialize, IEventPluginInitialize, IEventPluginLoadCompleted { }
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using Barotrauma.LuaCs.Data;
|
|||||||
namespace Barotrauma;
|
namespace Barotrauma;
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
|
[Obsolete($"Use {nameof(IModConfigInfo)} instead. This class exists for legacy compatibility only.")]
|
||||||
public sealed class RunConfig : IRunConfig
|
public sealed class RunConfig : IRunConfig
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
+6
-7
@@ -9,14 +9,13 @@ using System.Text.RegularExpressions;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using Barotrauma.LuaCs.Configuration;
|
|
||||||
using Barotrauma.LuaCs.Data;
|
using Barotrauma.LuaCs.Data;
|
||||||
using Barotrauma.LuaCs.Events;
|
using Barotrauma.LuaCs.Events;
|
||||||
using Barotrauma.LuaCs.Services.Processing;
|
using Barotrauma.LuaCs;
|
||||||
using FluentResults;
|
using FluentResults;
|
||||||
using Microsoft.Toolkit.Diagnostics;
|
using Microsoft.Toolkit.Diagnostics;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public sealed partial class ConfigService : IConfigService
|
public sealed partial class ConfigService : IConfigService
|
||||||
{
|
{
|
||||||
@@ -122,7 +121,7 @@ public sealed partial class ConfigService : IConfigService
|
|||||||
|
|
||||||
private readonly ConcurrentDictionary<(ContentPackage OwnerPackage, string InternalName), ISettingBase>
|
private readonly ConcurrentDictionary<(ContentPackage OwnerPackage, string InternalName), ISettingBase>
|
||||||
_settingsInstances = new();
|
_settingsInstances = new();
|
||||||
private readonly ConcurrentDictionary<string, Func<IConfigInfo, ISettingBase>>
|
private readonly ConcurrentDictionary<string, Func<(IConfigService ConfigService, IConfigInfo Info), ISettingBase>>
|
||||||
_instanceFactory = new();
|
_instanceFactory = new();
|
||||||
private readonly ConcurrentDictionary<ContentPackage, ConcurrentBag<ISettingBase>>
|
private readonly ConcurrentDictionary<ContentPackage, ConcurrentBag<ISettingBase>>
|
||||||
_settingsInstancesByPackage = new();
|
_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.IsNotNullOrWhiteSpace(typeIdentifier, nameof(typeIdentifier));
|
||||||
Guard.IsNotNull(settingFactory, nameof(settingFactory));
|
Guard.IsNotNull(settingFactory, nameof(settingFactory));
|
||||||
@@ -199,7 +198,7 @@ public sealed partial class ConfigService : IConfigService
|
|||||||
.SelectMany(tr => tr)
|
.SelectMany(tr => tr)
|
||||||
.ToImmutableArray();
|
.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)
|
foreach (var info in toProcessDocs)
|
||||||
{
|
{
|
||||||
@@ -222,7 +221,7 @@ public sealed partial class ConfigService : IConfigService
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
toProcessInstanceQueue.Enqueue((instanceFactoryInfo.configInfo, instanceFactoryInfo.factory(instanceFactoryInfo.configInfo)));
|
toProcessInstanceQueue.Enqueue((instanceFactoryInfo.configInfo, instanceFactoryInfo.factory((this, instanceFactoryInfo.configInfo))));
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
using Barotrauma.Extensions;
|
using Barotrauma.Extensions;
|
||||||
using Barotrauma.LuaCs.Events;
|
using Barotrauma.LuaCs.Events;
|
||||||
using Barotrauma.LuaCs.Services.Compatibility;
|
using Barotrauma.LuaCs.Compatibility;
|
||||||
using FluentResults;
|
using FluentResults;
|
||||||
using FluentResults.LuaCs;
|
using FluentResults.LuaCs;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
@@ -15,7 +15,7 @@ using System.Collections.Immutable;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public partial class EventService : IEventService
|
public partial class EventService : IEventService
|
||||||
{
|
{
|
||||||
+1
-1
@@ -5,7 +5,7 @@ using FluentResults;
|
|||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using MoonSharp.Interpreter;
|
using MoonSharp.Interpreter;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public partial class LoggerService : ILoggerService
|
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;
|
||||||
|
}
|
||||||
+3
-3
@@ -1,8 +1,7 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
|
|
||||||
using Barotrauma.LuaCs.Data;
|
using Barotrauma.LuaCs.Data;
|
||||||
using Barotrauma.LuaCs.Services.Compatibility;
|
using Barotrauma.LuaCs.Compatibility;
|
||||||
using Barotrauma.LuaCs.Services.Safe;
|
|
||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
using FluentResults;
|
using FluentResults;
|
||||||
using Microsoft.CodeAnalysis;
|
using Microsoft.CodeAnalysis;
|
||||||
@@ -21,8 +20,9 @@ using System.Diagnostics.CodeAnalysis;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Barotrauma.LuaCs;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
class LuaScriptManagementService : ILuaScriptManagementService, ILuaDataService
|
class LuaScriptManagementService : ILuaScriptManagementService, ILuaDataService
|
||||||
{
|
{
|
||||||
+1
-1
@@ -8,7 +8,7 @@ using Barotrauma.LuaCs.Data;
|
|||||||
using FluentResults;
|
using FluentResults;
|
||||||
using Microsoft.Toolkit.Diagnostics;
|
using Microsoft.Toolkit.Diagnostics;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services.Processing;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public sealed class ModConfigFileParserService :
|
public sealed class ModConfigFileParserService :
|
||||||
IParserServiceAsync<ResourceParserInfo, IAssemblyResourceInfo>,
|
IParserServiceAsync<ResourceParserInfo, IAssemblyResourceInfo>,
|
||||||
+1
-1
@@ -14,7 +14,7 @@ using FluentResults;
|
|||||||
using Microsoft.Toolkit.Diagnostics;
|
using Microsoft.Toolkit.Diagnostics;
|
||||||
using MoonSharp.VsCodeDebugger.SDK;
|
using MoonSharp.VsCodeDebugger.SDK;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services.Processing;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public sealed class ModConfigService : IModConfigService
|
public sealed class ModConfigService : IModConfigService
|
||||||
{
|
{
|
||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
using Barotrauma.LuaCs.Services;
|
using Barotrauma.LuaCs;
|
||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
internal partial class NetworkingService : INetworkingService
|
internal partial class NetworkingService : INetworkingService
|
||||||
{
|
{
|
||||||
+1
-1
@@ -9,7 +9,7 @@ using Barotrauma.LuaCs.Data;
|
|||||||
using FluentResults;
|
using FluentResults;
|
||||||
using Microsoft.Toolkit.Diagnostics;
|
using Microsoft.Toolkit.Diagnostics;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public sealed class PackageManagementService : IPackageManagementService
|
public sealed class PackageManagementService : IPackageManagementService
|
||||||
{
|
{
|
||||||
+3
-4
@@ -25,7 +25,7 @@ using Microsoft.Extensions.Logging;
|
|||||||
using Microsoft.Toolkit.Diagnostics;
|
using Microsoft.Toolkit.Diagnostics;
|
||||||
using OneOf;
|
using OneOf;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public class PluginManagementService : IAssemblyManagementService
|
public class PluginManagementService : IAssemblyManagementService
|
||||||
{
|
{
|
||||||
@@ -71,12 +71,11 @@ public class PluginManagementService : IAssemblyManagementService
|
|||||||
|
|
||||||
private static readonly SyntaxTree BaseAssemblyImports = CSharpSyntaxTree.ParseText(
|
private static readonly SyntaxTree BaseAssemblyImports = CSharpSyntaxTree.ParseText(
|
||||||
new StringBuilder()
|
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 System.Reflection;")
|
||||||
.AppendLine("using Barotrauma;")
|
.AppendLine("using Barotrauma;")
|
||||||
.AppendLine("using Barotrauma.LuaCs;")
|
.AppendLine("using Barotrauma.LuaCs;")
|
||||||
.AppendLine("using Barotrauma.LuaCs.Services;")
|
.AppendLine("using Barotrauma.LuaCs.Compatibility;")
|
||||||
.AppendLine("using Barotrauma.LuaCs.Services.Compatibility;")
|
|
||||||
.AppendLine("using System.Runtime.CompilerServices;")
|
.AppendLine("using System.Runtime.CompilerServices;")
|
||||||
.AppendLine("[assembly: IgnoresAccessChecksTo(\"BarotraumaCore\")]")
|
.AppendLine("[assembly: IgnoresAccessChecksTo(\"BarotraumaCore\")]")
|
||||||
#if CLIENT
|
#if CLIENT
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
|
public class PluginService
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
+1
-1
@@ -15,7 +15,7 @@ using System.Threading.Tasks;
|
|||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using Path = System.IO.Path;
|
using Path = System.IO.Path;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services.Safe;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public class SafeStorageService : StorageService, ISafeStorageService
|
public class SafeStorageService : StorageService, ISafeStorageService
|
||||||
{
|
{
|
||||||
+1
-1
@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using LightInject;
|
using LightInject;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
|
|
||||||
public class ServicesProvider : IServicesProvider
|
public class ServicesProvider : IServicesProvider
|
||||||
+1
-1
@@ -9,7 +9,7 @@ using FluentResults;
|
|||||||
using Microsoft.Toolkit.Diagnostics;
|
using Microsoft.Toolkit.Diagnostics;
|
||||||
using OneOf;
|
using OneOf;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services.Processing;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public sealed class SettingsFileParserService :
|
public sealed class SettingsFileParserService :
|
||||||
IParserServiceOneToManyAsync<IConfigResourceInfo, IConfigInfo>,
|
IParserServiceOneToManyAsync<IConfigResourceInfo, IConfigInfo>,
|
||||||
+1
-1
@@ -17,7 +17,7 @@ using Microsoft.Toolkit.Diagnostics;
|
|||||||
using Error = FluentResults.Error;
|
using Error = FluentResults.Error;
|
||||||
using Path = System.IO.Path;
|
using Path = System.IO.Path;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public class StorageService : IStorageService
|
public class StorageService : IStorageService
|
||||||
{
|
{
|
||||||
+1
-1
@@ -10,7 +10,7 @@ using OneOf;
|
|||||||
|
|
||||||
// ReSharper disable InconsistentNaming
|
// ReSharper disable InconsistentNaming
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public interface IAssemblyManagementService : IPluginManagementService
|
public interface IAssemblyManagementService : IPluginManagementService
|
||||||
{
|
{
|
||||||
+3
-12
@@ -4,26 +4,17 @@ using System.Collections.Immutable;
|
|||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using Barotrauma.LuaCs.Configuration;
|
|
||||||
using Barotrauma.LuaCs.Data;
|
using Barotrauma.LuaCs.Data;
|
||||||
using Barotrauma.LuaCs.Services;
|
using Barotrauma.LuaCs;
|
||||||
using Barotrauma.LuaCs.Services.Safe;
|
|
||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
using FluentResults;
|
using FluentResults;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public partial interface IConfigService : IReusableService, ILuaConfigService
|
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;
|
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> LoadConfigsAsync(ImmutableArray<IConfigResourceInfo> configResources);
|
||||||
Task<FluentResults.Result> LoadConfigsProfilesAsync(ImmutableArray<IConfigResourceInfo> configProfileResources);
|
Task<FluentResults.Result> LoadConfigsProfilesAsync(ImmutableArray<IConfigResourceInfo> configProfileResources);
|
||||||
FluentResults.Result DisposePackageData(ContentPackage package);
|
FluentResults.Result DisposePackageData(ContentPackage package);
|
||||||
+3
-3
@@ -1,10 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Barotrauma.LuaCs.Events;
|
using Barotrauma.LuaCs.Events;
|
||||||
using Barotrauma.LuaCs.Services.Compatibility;
|
using Barotrauma.LuaCs.Compatibility;
|
||||||
using Barotrauma.LuaCs.Services.Safe;
|
using Barotrauma.LuaCs;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public interface IEventService : IReusableService, ILuaEventService
|
public interface IEventService : IReusableService, ILuaEventService
|
||||||
{
|
{
|
||||||
+1
-1
@@ -5,7 +5,7 @@ using System.Xml.Linq;
|
|||||||
using Barotrauma.LuaCs.Data;
|
using Barotrauma.LuaCs.Data;
|
||||||
using FluentResults;
|
using FluentResults;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services.Processing;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public interface IParserService<in TSrc, TOut> : IService
|
public interface IParserService<in TSrc, TOut> : IService
|
||||||
{
|
{
|
||||||
+1
-1
@@ -3,7 +3,7 @@ using Barotrauma.Networking;
|
|||||||
using FluentResults;
|
using FluentResults;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides console and debug logging services
|
/// Provides console and debug logging services
|
||||||
+42
@@ -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; }
|
||||||
|
}
|
||||||
+1
-1
@@ -10,7 +10,7 @@ using FluentResults;
|
|||||||
using MoonSharp.Interpreter;
|
using MoonSharp.Interpreter;
|
||||||
using MoonSharp.Interpreter.Interop;
|
using MoonSharp.Interpreter.Interop;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public interface ILuaScriptManagementService : IReusableService
|
public interface ILuaScriptManagementService : IReusableService
|
||||||
{
|
{
|
||||||
+2
-2
@@ -4,10 +4,10 @@ using System.Collections.Immutable;
|
|||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Barotrauma.LuaCs.Data;
|
using Barotrauma.LuaCs.Data;
|
||||||
using Barotrauma.LuaCs.Services.Processing;
|
using Barotrauma.LuaCs;
|
||||||
using FluentResults;
|
using FluentResults;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public interface IModConfigService : IService
|
public interface IModConfigService : IService
|
||||||
{
|
{
|
||||||
+3
-3
@@ -1,10 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using Barotrauma.LuaCs.Data;
|
using Barotrauma.LuaCs.Data;
|
||||||
using Barotrauma.LuaCs.Services;
|
using Barotrauma.LuaCs;
|
||||||
using Barotrauma.LuaCs.Services.Compatibility;
|
using Barotrauma.LuaCs.Compatibility;
|
||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
internal delegate void NetMessageReceived(IReadMessage netMessage);
|
internal delegate void NetMessageReceived(IReadMessage netMessage);
|
||||||
|
|
||||||
+1
-1
@@ -8,7 +8,7 @@ using Barotrauma.Extensions;
|
|||||||
using Barotrauma.LuaCs.Data;
|
using Barotrauma.LuaCs.Data;
|
||||||
using FluentResults;
|
using FluentResults;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public interface IPackageManagementService : IReusableService
|
public interface IPackageManagementService : IReusableService
|
||||||
{
|
{
|
||||||
+1
-1
@@ -5,7 +5,7 @@ using System.Reflection;
|
|||||||
using Barotrauma.LuaCs.Data;
|
using Barotrauma.LuaCs.Data;
|
||||||
using Microsoft.CodeAnalysis;
|
using Microsoft.CodeAnalysis;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public interface IPluginManagementService : IReusableService
|
public interface IPluginManagementService : IReusableService
|
||||||
{
|
{
|
||||||
+1
-1
@@ -4,7 +4,7 @@ using System.Collections.Immutable;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Barotrauma.LuaCs.Data;
|
using Barotrauma.LuaCs.Data;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public interface IPluginService : IReusableService
|
public interface IPluginService : IReusableService
|
||||||
{
|
{
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Immutable;
|
using System.Collections.Immutable;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services.Safe;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public interface ISafeStorageService : IStorageService, ISafeStorageValidation { }
|
public interface ISafeStorageService : IStorageService, ISafeStorageValidation { }
|
||||||
|
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using Microsoft.Toolkit.Diagnostics;
|
using Microsoft.Toolkit.Diagnostics;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Defines a service that can be reset to it's post-constructor state and reused without needing to be disposed.
|
/// Defines a service that can be reset to it's post-constructor state and reused without needing to be disposed.
|
||||||
+1
-1
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Collections.Immutable;
|
using System.Collections.Immutable;
|
||||||
using LightInject;
|
using LightInject;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides instancing and management of IServices.
|
/// Provides instancing and management of IServices.
|
||||||
+1
-1
@@ -5,7 +5,7 @@ using System.Threading.Tasks;
|
|||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using FluentResults;
|
using FluentResults;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public interface IStorageService : IService
|
public interface IStorageService : IService
|
||||||
{
|
{
|
||||||
+1
-1
@@ -7,7 +7,7 @@ using System.Numerics;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public interface IDefaultLuaRegistrar : IService
|
public interface IDefaultLuaRegistrar : IService
|
||||||
{
|
{
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Barotrauma.LuaCs.Configuration;
|
using Barotrauma.LuaCs.Data;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services.Safe;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public interface ILuaConfigService : ILuaService
|
public interface ILuaConfigService : ILuaService
|
||||||
{
|
{
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
using MoonSharp.Interpreter;
|
using MoonSharp.Interpreter;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services.Safe;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Service for providing stateful functions and in-memory storage for lua functions
|
/// Service for providing stateful functions and in-memory storage for lua functions
|
||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Barotrauma.LuaCs.Events;
|
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
|
public interface ILuaSafeEventService : ILuaService, ILuaCsHook
|
||||||
{
|
{
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
namespace Barotrauma.LuaCs.Services.Safe;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public interface ILuaNetworkingService : ILuaService
|
public interface ILuaNetworkingService : ILuaService
|
||||||
{
|
{
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
namespace Barotrauma.LuaCs.Services.Safe;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public interface ILuaPackageManagementService : ILuaService
|
public interface ILuaPackageManagementService : ILuaService
|
||||||
{
|
{
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
namespace Barotrauma.LuaCs.Services.Safe;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public interface ILuaPackageService : ILuaService
|
public interface ILuaPackageService : ILuaService
|
||||||
{
|
{
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using static Barotrauma.LuaCs.Services.Compatibility.ILuaCsHook;
|
using static Barotrauma.LuaCs.Compatibility.ILuaCsHook;
|
||||||
using LuaCsCompatPatchFunc = Barotrauma.LuaCsPatch;
|
using LuaCsCompatPatchFunc = Barotrauma.LuaCsPatch;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public interface ILuaPatcher : IReusableService
|
public interface ILuaPatcher : IReusableService
|
||||||
{
|
{
|
||||||
+1
-1
@@ -4,7 +4,7 @@ using Barotrauma.LuaCs.Data;
|
|||||||
using FluentResults;
|
using FluentResults;
|
||||||
using MoonSharp.Interpreter.Loaders;
|
using MoonSharp.Interpreter.Loaders;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services.Safe;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public interface ILuaScriptLoader : IService, IScriptLoader, ISafeStorageValidation
|
public interface ILuaScriptLoader : IService, IScriptLoader, ISafeStorageValidation
|
||||||
{
|
{
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
|
public interface ILuaService
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
+1
-1
@@ -5,7 +5,7 @@ using FarseerPhysics.Dynamics;
|
|||||||
using LuaCsCompatPatchFunc = Barotrauma.LuaCsPatch;
|
using LuaCsCompatPatchFunc = Barotrauma.LuaCsPatch;
|
||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
using System.Collections.Immutable;
|
using System.Collections.Immutable;
|
||||||
using Barotrauma.LuaCs.Services;
|
using Barotrauma.LuaCs;
|
||||||
|
|
||||||
namespace Barotrauma
|
namespace Barotrauma
|
||||||
{
|
{
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
using Barotrauma.LuaCs.Services;
|
using Barotrauma.LuaCs;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
using Barotrauma.LuaCs.Events;
|
using Barotrauma.LuaCs.Events;
|
||||||
using Barotrauma.LuaCs.Services;
|
using Barotrauma.LuaCs;
|
||||||
using Barotrauma.LuaCs.Services.Compatibility;
|
using Barotrauma.LuaCs.Compatibility;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
+2
-2
@@ -3,13 +3,13 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using Barotrauma.Items.Components;
|
using Barotrauma.Items.Components;
|
||||||
using Barotrauma.LuaCs.Services;
|
using Barotrauma.LuaCs;
|
||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
using FarseerPhysics.Dynamics;
|
using FarseerPhysics.Dynamics;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using MoonSharp.Interpreter;
|
using MoonSharp.Interpreter;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services
|
namespace Barotrauma.LuaCs
|
||||||
{
|
{
|
||||||
partial class LuaGame : IReusableService
|
partial class LuaGame : IReusableService
|
||||||
{
|
{
|
||||||
+3
-3
@@ -1,11 +1,11 @@
|
|||||||
global using LuaCsHook = Barotrauma.LuaCs.Services.Compatibility.ILuaCsHook;
|
global using LuaCsHook = Barotrauma.LuaCs.Compatibility.ILuaCsHook;
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Barotrauma.LuaCs.Services.Compatibility;
|
using Barotrauma.LuaCs.Compatibility;
|
||||||
using MoonSharp.Interpreter;
|
using MoonSharp.Interpreter;
|
||||||
using LuaCsCompatPatchFunc = Barotrauma.LuaCsPatch;
|
using LuaCsCompatPatchFunc = Barotrauma.LuaCsPatch;
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ namespace Barotrauma
|
|||||||
public delegate object LuaCsPatch(object self, Dictionary<string, object> args);
|
public delegate object LuaCsPatch(object self, Dictionary<string, object> args);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services
|
namespace Barotrauma.LuaCs
|
||||||
{
|
{
|
||||||
partial class LuaPatcherService
|
partial class LuaPatcherService
|
||||||
{
|
{
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
using Barotrauma.LuaCs.Services;
|
using Barotrauma.LuaCs;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using MoonSharp.Interpreter;
|
using MoonSharp.Interpreter;
|
||||||
@@ -23,7 +23,7 @@ namespace Barotrauma
|
|||||||
public delegate DynValue LuaCsPatchFunc(object instance, LuaPatcherService.ParameterTable ptable);
|
public delegate DynValue LuaCsPatchFunc(object instance, LuaPatcherService.ParameterTable ptable);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services
|
namespace Barotrauma.LuaCs
|
||||||
{
|
{
|
||||||
public partial class LuaPatcherService : ILuaPatcher
|
public partial class LuaPatcherService : ILuaPatcher
|
||||||
{
|
{
|
||||||
+2
-2
@@ -8,10 +8,10 @@ using MoonSharp.Interpreter.Loaders;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Barotrauma.LuaCs.Data;
|
using Barotrauma.LuaCs.Data;
|
||||||
using Barotrauma.LuaCs.Services.Safe;
|
using Barotrauma.LuaCs;
|
||||||
using FluentResults;
|
using FluentResults;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services.Safe
|
namespace Barotrauma.LuaCs
|
||||||
{
|
{
|
||||||
public class LuaScriptLoader : ScriptLoaderBase, ILuaScriptLoader
|
public class LuaScriptLoader : ScriptLoaderBase, ILuaScriptLoader
|
||||||
{
|
{
|
||||||
+1
-1
@@ -6,7 +6,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public interface ILuaUserDataService : IReusableService
|
public interface ILuaUserDataService : IReusableService
|
||||||
{
|
{
|
||||||
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
using Barotrauma;
|
using Barotrauma;
|
||||||
using Barotrauma.LuaCs.Services;
|
using Barotrauma.LuaCs;
|
||||||
using MoonSharp.Interpreter;
|
using MoonSharp.Interpreter;
|
||||||
using MoonSharp.Interpreter.Interop;
|
using MoonSharp.Interpreter.Interop;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace Barotrauma.LuaCs.Services;
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
public interface ISafeLuaUserDataService : IService
|
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