IT BUILDS!!!

- Removed LocalizationServices and other sus things.
- Rewrote AssemblyLoader
[In Progress] SafeStorageService
[In Progress] LuaScriptLoader
This commit is contained in:
MapleWheels
2025-03-30 06:20:45 -04:00
committed by Maplewheels
parent 52d920d969
commit c6713f37bb
67 changed files with 3336 additions and 1283 deletions
@@ -0,0 +1,103 @@
using System;
using System.Xml.Linq;
using Barotrauma.LuaCs.Data;
using Barotrauma.LuaCs.Services;
using Barotrauma.Networking;
using OneOf;
namespace Barotrauma.LuaCs.Configuration;
public class ConfigEntry<T> : IConfigEntry<T> where T : IEquatable<T>
{
private readonly Action<ConfigEntry<T>, INetReadMessage> _readMessageHandler;
private readonly Action<ConfigEntry<T>, INetWriteMessage> _writeMessageHandler;
public ConfigEntry(IConfigInfo configInfo, Action<ConfigEntry<T>, INetReadMessage> readMessageHandler,
Action<ConfigEntry<T>, INetWriteMessage> writeMessageHandler)
{
_readMessageHandler = readMessageHandler;
_writeMessageHandler = writeMessageHandler;
}
public string InternalName { get; init; }
public ContentPackage OwnerPackage { get; init; }
public bool Equals(IConfigBase other)
{
if (ReferenceEquals(this, other))
return true;
throw new NotImplementedException();
}
public void Dispose()
{
throw new NotImplementedException();
}
public Type GetValueType()
{
throw new NotImplementedException();
}
public string GetValue()
{
throw new NotImplementedException();
}
public bool TrySetValue(OneOf<string, XElement> value)
{
throw new NotImplementedException();
}
public bool IsAssignable(OneOf<string, XElement> value)
{
throw new NotImplementedException();
}
private event Action<IConfigEntry<T>> _onValueChanged;
public event Action<IConfigEntry<T>> OnValueChanged
{
add => _onValueChanged += value;
remove => _onValueChanged -= value;
}
event Action<IConfigBase> IConfigBase.OnValueChanged
{
add => _onValueChanged += value;
remove => _onValueChanged -= value;
}
public OneOf<string, XElement> GetSerializableValue()
{
throw new NotImplementedException();
}
public Guid InstanceId => throw new NotImplementedException();
public NetSync SyncType => throw new NotImplementedException();
public ClientPermissions WritePermissions => throw new NotImplementedException();
public void ReadNetMessage(INetReadMessage message)
{
throw new NotImplementedException();
}
public void WriteNetMessage(INetWriteMessage message)
{
throw new NotImplementedException();
}
public T Value => throw new NotImplementedException();
public bool TrySetValue(T value)
{
throw new NotImplementedException();
}
public bool IsAssignable(T value)
{
throw new NotImplementedException();
}
}
@@ -0,0 +1,111 @@
using System;
using System.Collections.Generic;
using System.Xml.Linq;
using Barotrauma.LuaCs.Data;
using Barotrauma.LuaCs.Services;
using Barotrauma.Networking;
using OneOf;
namespace Barotrauma.LuaCs.Configuration;
public class ConfigList<T> : IConfigList<T> where T : IEquatable<T>
{
private readonly Action<ConfigList<T>, INetReadMessage> _readMessageHandler;
private readonly Action<ConfigList<T>, INetWriteMessage> _writeMessageHandler;
public ConfigList(IConfigInfo configInfo, Action<ConfigList<T>, INetReadMessage> readMessageHandler,
Action<ConfigList<T>, INetWriteMessage> writeMessageHandler)
{
_readMessageHandler = readMessageHandler;
_writeMessageHandler = writeMessageHandler;
}
public string InternalName => throw new NotImplementedException();
public ContentPackage OwnerPackage => throw new NotImplementedException();
public bool Equals(IConfigBase other)
{
throw new NotImplementedException();
}
public void Dispose()
{
throw new NotImplementedException();
}
public Type GetValueType()
{
throw new NotImplementedException();
}
public string GetValue()
{
throw new NotImplementedException();
}
public bool TrySetValue(OneOf<string, XElement> value)
{
throw new NotImplementedException();
}
public bool IsAssignable(OneOf<string, XElement> value)
{
throw new NotImplementedException();
}
private event Action<IConfigList<T>> _onValueChanged;
public event Action<IConfigList<T>> OnValueChanged
{
add => _onValueChanged += value;
remove => _onValueChanged -= value;
}
event Action<IConfigEntry<T>> IConfigEntry<T>.OnValueChanged
{
add => _onValueChanged += value;
remove => _onValueChanged -= value;
}
event Action<IConfigBase> IConfigBase.OnValueChanged
{
add => _onValueChanged += value;
remove => _onValueChanged -= value;
}
public T Value => throw new NotImplementedException();
public bool TrySetValue(T value)
{
throw new NotImplementedException();
}
public bool IsAssignable(T value)
{
throw new NotImplementedException();
}
public OneOf<string, XElement> GetSerializableValue()
{
throw new NotImplementedException();
}
public Guid InstanceId => throw new NotImplementedException();
public NetSync SyncType => throw new NotImplementedException();
public ClientPermissions WritePermissions => throw new NotImplementedException();
public void ReadNetMessage(INetReadMessage message)
{
throw new NotImplementedException();
}
public void WriteNetMessage(INetWriteMessage message)
{
throw new NotImplementedException();
}
public IReadOnlyList<T> Options => throw new NotImplementedException();
}
@@ -1,20 +1,17 @@
using System;
using System.Xml.Linq;
using Barotrauma.LuaCs.Data;
using Barotrauma.LuaCs.Services;
using Barotrauma.Networking;
namespace Barotrauma.LuaCs.Configuration;
public partial interface IConfigBase : IVarId
public partial interface IConfigBase : IDataInfo, IEquatable<IConfigBase>, IDisposable
{
bool IsInitialized { get; }
string GetValue();
bool TrySetValue(string value);
bool IsAssignable(string value);
Type GetValueType();
void Initialize(IVarId id, string defaultValue);
}
public interface IVarId : IDataInfo
{
Guid InstanceId { get; }
string GetValue();
bool TrySetValue(OneOf.OneOf<string, XElement> value);
bool IsAssignable(OneOf.OneOf<string, XElement> value);
event Action<IConfigBase> OnValueChanged;
OneOf.OneOf<string, XElement> GetSerializableValue();
}
@@ -3,10 +3,10 @@ using Barotrauma.LuaCs.Services;
namespace Barotrauma.LuaCs.Configuration;
public interface IConfigEntry<T> : IConfigBase, INetVar where T : IConvertible, IEquatable<T>
public interface IConfigEntry<T> : IConfigBase, INetworkSyncEntity where T : IEquatable<T>
{
T Value { get; }
bool TrySetValue(T value);
bool IsAssignable(T value);
void Initialize(IVarId id, T defaultValue);
new event Action<IConfigEntry<T>> OnValueChanged;
}
@@ -0,0 +1,9 @@
using System;
using Barotrauma.LuaCs.Services;
namespace Barotrauma.LuaCs.Configuration;
public interface IConfigEnum : IConfigBase, INetworkSyncEntity
{
}
@@ -1,8 +1,11 @@
using System;
using System.Collections.Generic;
using Barotrauma.LuaCs.Services;
namespace Barotrauma.LuaCs.Configuration;
public interface IConfigList : IConfigBase, INetVar
public interface IConfigList<T> : IConfigEntry<T>, INetworkSyncEntity where T : IEquatable<T>
{
IReadOnlyList<T> Options { get; }
new event Action<IConfigList<T>> OnValueChanged;
}