diff --git a/.github/workflows/build-artifacts.yaml b/.github/workflows/build-artifacts.yaml
new file mode 100644
index 0000000..6aa1113
--- /dev/null
+++ b/.github/workflows/build-artifacts.yaml
@@ -0,0 +1,48 @@
+name: Build Artifacts
+
+permissions:
+ contents: write
+
+on:
+ push:
+ branches:
+ - '*'
+
+jobs:
+ build-artifacts:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Set up .NET Core
+ uses: actions/setup-dotnet@v3.0.3
+ with:
+ dotnet-version: 6
+
+ - name: NuGet Restore
+ run: dotnet restore
+
+ - name: Build and Publish project
+ run: dotnet publish BattleBitAPIRunner/BattleBitAPIRunner.csproj -c Release -o ./publish --self-contained false --framework net6.0 --runtime win-x64
+
+ - name: Build nuget
+ run: dotnet build BattleBitAPIRunner/BattleBitAPIRunner.csproj -c Release
+
+ - name: Create NuGet package
+ run: dotnet pack BBRAPIModules/BBRAPIModules.csproj --configuration Release --output ./nuget
+
+ - name: Upload NuGet package artifact
+ uses: actions/upload-artifact@v2
+ with:
+ name: NuGet Package
+ path: ./nuget/*.nupkg
+
+ - name: Upload Release artifact
+ uses: actions/upload-artifact@v2
+ with:
+ name: BattleBitAPIRunner-beta
+ path: ./publish/*
\ No newline at end of file
diff --git a/BBRAPIModuleVerfication/BBRAPIModuleVerification.csproj b/BBRAPIModuleVerfication/BBRAPIModuleVerification.csproj
new file mode 100644
index 0000000..af16098
--- /dev/null
+++ b/BBRAPIModuleVerfication/BBRAPIModuleVerification.csproj
@@ -0,0 +1,15 @@
+
+
+
+ Exe
+ net6.0
+ enable
+ enable
+
+
+
+
+
+
+
+
diff --git a/BBRAPIModuleVerfication/Program.cs b/BBRAPIModuleVerfication/Program.cs
new file mode 100644
index 0000000..cc1e105
--- /dev/null
+++ b/BBRAPIModuleVerfication/Program.cs
@@ -0,0 +1,99 @@
+using BattleBitAPIRunner;
+using BBRAPIModules;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis;
+using Newtonsoft.Json;
+using Microsoft.CodeAnalysis.CSharp;
+using System.Text;
+using System.Collections.ObjectModel;
+
+namespace BBRAPIModuleVerification;
+
+internal class Program
+{
+ static void Main(string[] args)
+ {
+ if (args.Length != 1)
+ {
+ Console.WriteLine("Usage: BBRAPIModuleVerification ");
+ return;
+ }
+
+ string filePath = args[0];
+
+ Module.logToConsole = false;
+
+ Module module;
+ try
+ {
+ module = new Module(filePath);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(new VerificationResponse(false, Path.GetFileNameWithoutExtension(filePath), null, null, null, null, e.Message)));
+ return;
+ }
+
+ List missingDependencies = new();
+ List references = new();
+
+ foreach (string dependency in module.RequiredDependencies)
+ {
+ if (!Directory.Exists($"./cache/modules/{dependency}"))
+ {
+ missingDependencies.Add(dependency);
+ }
+ else
+ {
+ references.Add(MetadataReference.CreateFromFile($"./cache/modules/{dependency}/{dependency}.dll"));
+ }
+ }
+
+ if (missingDependencies.Count > 0)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(new VerificationResponse(false, module.Name, module.Description, module.Version, module.RequiredDependencies, module.OptionalDependencies, $"Missing dependencies: {string.Join(", ", missingDependencies)}")));
+ return;
+ }
+
+ try
+ {
+ module.Compile(references.ToArray());
+ if (!Directory.Exists($"./cache/modules/{module.Name}"))
+ {
+ Directory.CreateDirectory($"./cache/modules/{module.Name}");
+ }
+ File.WriteAllBytes($"./cache/modules/{module.Name}/{module.Name}.dll", module.AssemblyBytes);
+
+ Console.WriteLine(JsonConvert.SerializeObject(new VerificationResponse(true, module.Name, module.Description, module.Version, module.RequiredDependencies, module.OptionalDependencies, null)));
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(JsonConvert.SerializeObject(new VerificationResponse(false, module.Name, module.Description, module.Version, module.RequiredDependencies, module.OptionalDependencies, e.Message)));
+ return;
+ }
+ }
+
+
+}
+
+internal class VerificationResponse
+{
+ public VerificationResponse(bool success, string name, string description, string version, string[] requiredDependencies, string[] optionalDependencies, string errors)
+ {
+ this.Success = success;
+ this.Name = name;
+ this.Description = description;
+ this.Version = version;
+ this.RequiredDependencies = requiredDependencies;
+ this.OptionalDependencies = optionalDependencies;
+ this.Errors = errors;
+ }
+
+ public bool Success { get; set; }
+ public string? Name { get; set; }
+ public string? Description { get; set; }
+ public string? Version { get; set; }
+ public string[]? RequiredDependencies { get; set; }
+ public string[]? OptionalDependencies { get; set; }
+ public string? Errors { get; set; }
+}
\ No newline at end of file
diff --git a/BBRAPIModuleVerfication/Properties/launchSettings.json b/BBRAPIModuleVerfication/Properties/launchSettings.json
new file mode 100644
index 0000000..2f09f78
--- /dev/null
+++ b/BBRAPIModuleVerfication/Properties/launchSettings.json
@@ -0,0 +1,8 @@
+{
+ "profiles": {
+ "BBRAPIModuleVerification": {
+ "commandName": "Project",
+ "commandLineArgs": "E:\\Create\\Development\\Software\\C#\\BattleBit\\BattleBitBaseModules\\SpectateControl.cs"
+ }
+ }
+}
\ No newline at end of file
diff --git a/BBRAPIModules/BBRAPIModules.csproj b/BBRAPIModules/BBRAPIModules.csproj
index 07c3b0d..ff30b00 100644
--- a/BBRAPIModules/BBRAPIModules.csproj
+++ b/BBRAPIModules/BBRAPIModules.csproj
@@ -6,7 +6,7 @@
enable
True
BattleBit Remastered Modular Community Server API
- 0.4.11
+ 0.4.13
$(AssemblyVersion)
$(AssemblyVersion)
RainOrigami
diff --git a/BBRAPIModules/BattleBitModule.cs b/BBRAPIModules/BattleBitModule.cs
index 9444326..81e0684 100644
--- a/BBRAPIModules/BattleBitModule.cs
+++ b/BBRAPIModules/BattleBitModule.cs
@@ -1,7 +1,5 @@
-using BattleBitAPI;
-using BattleBitAPI.Common;
+using BattleBitAPI.Common;
using BattleBitAPI.Server;
-using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("BattleBitAPIRunner")]
@@ -19,41 +17,6 @@ internal void SetServer(RunnerServer server)
this.Server = server;
}
- public void Call(string methodName, params object?[]? parameters)
- {
- this.Call