Add //dotnetref comment so you can add dotnet build specific assembly references when compiling plugins in the dotnet build

This commit is contained in:
UnknownShadow200 2024-01-01 22:48:17 +11:00
parent e9a94fda48
commit 03ba36f694
4 changed files with 17 additions and 5 deletions

View File

@ -65,12 +65,16 @@ namespace MCGalaxy.Eco
}
public static void UpdateMoney(string name, int money) {
PlayerDB.Update(name, PlayerData.ColumnMoney, money.ToString());
PlayerDB.Update(name, PlayerData.ColumnMoney,
NumberUtils.StringifyInt(money));
}
public struct EcoStats {
public string Player, Purchase, Payment, Salary, Fine; public int TotalSpent, __unused;
public struct EcoStats
{
public string Player;
public string Purchase, Payment, Salary, Fine;
public int TotalSpent, __unused;
}
public static void UpdateStats(EcoStats stats) {
@ -81,7 +85,7 @@ namespace MCGalaxy.Eco
static EcoStats ParseStats(ISqlRecord record) {
EcoStats stats;
stats.Player = record.GetText("player");
stats.Player = record.GetText("player");
stats.Payment = Parse(record.GetText("payment"));
stats.Purchase = Parse(record.GetText("purchase"));
stats.Salary = Parse(record.GetText("salary"));

View File

@ -156,6 +156,10 @@ namespace MCGalaxy.Modules.Compiling
} else if (line.CaselessStarts(plgPrefix)) {
path = Path.Combine(IScripting.PLUGINS_DLL_DIR, GetDLL(line));
referenced.Add(Path.GetFullPath(path));
#if NETSTANDARD
} else if (line.CaselessStarts(commentPrefix + "dotnetref")) {
referenced.Add(GetDLL(line));
#endif
} else {
continue;
}

View File

@ -97,6 +97,10 @@ namespace MCGalaxy.Modules.Compiling
{
static Regex outputRegWithFileAndLine;
static Regex outputRegSimple;
public static List<string> PrepareInput(string[] srcPaths) {
return ICompiler.ProcessInput(srcPaths, "//");
}
public static ICompilerErrors Compile(string[] srcPaths, string dstPath, List<string> referenced) {
string args = GetCommandLineArguments(srcPaths, dstPath, referenced);

View File

@ -43,7 +43,7 @@ namespace MCGalaxy.Modules.Compiling
}
#else
protected override ICompilerErrors DoCompile(string[] srcPaths, string dstPath) {
List<string> referenced = ProcessInput(srcPaths, "//");
List<string> referenced = RoslynCSharpCompiler.PrepareInput(srcPaths);
return RoslynCSharpCompiler.Compile(srcPaths, dstPath, referenced);
}
#endif