Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.

Commit c93c52d

Browse files
author
Dankrushen
authored
Merge pull request #221 from Grover-c13/3.2.4
MultiAdmin Version 3.2.4 Update
2 parents 34da69c + 0f81189 commit c93c52d

File tree

9 files changed

+234
-143
lines changed

9 files changed

+234
-143
lines changed

MultiAdmin/Config/MultiAdminConfig.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,14 @@ public class MultiAdminConfig : InheritableConfigRegister
138138
new ConfigEntry<double>("server_stop_timeout", 10,
139139
"Server Stop Timeout", "The time in seconds before MultiAdmin forces a server shutdown if it doesn't respond to the regular shutdown command");
140140

141+
public ConfigEntry<bool> ServerStartRetry { get; } =
142+
new ConfigEntry<bool>("server_start_retry", true,
143+
"Server Start Retry", "Whether to try to start the server again after crashing");
144+
145+
public ConfigEntry<int> ServerStartRetryDelay { get; } =
146+
new ConfigEntry<int>("server_start_retry_delay", 10000,
147+
"Server Start Retry Delay", "The time in milliseconds to wait before trying to start the server again after crashing");
148+
141149
public ConfigEntry<string> ServersFolder { get; } =
142150
new ConfigEntry<string>("servers_folder", "servers",
143151
"Servers Folder", "The location of the `servers` folder for MultiAdmin to load multiple server configurations from");

MultiAdmin/EventInterfaces.cs

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,53 @@
11
namespace MultiAdmin
22
{
3-
public interface IEventServerPreStart
3+
public interface IMAEvent
4+
{
5+
}
6+
7+
public interface IEventServerPreStart: IMAEvent
48
{
59
void OnServerPreStart();
610
}
711

8-
public interface IEventServerStart
12+
public interface IEventServerStart: IMAEvent
913
{
1014
void OnServerStart();
1115
}
1216

13-
public interface IEventServerStop
17+
public interface IEventServerStop: IMAEvent
1418
{
1519
void OnServerStop();
1620
}
1721

18-
public interface IEventRoundEnd
22+
public interface IEventRoundEnd: IMAEvent
1923
{
2024
void OnRoundEnd();
2125
}
2226

23-
public interface IEventWaitingForPlayers
27+
public interface IEventWaitingForPlayers: IMAEvent
2428
{
2529
void OnWaitingForPlayers();
2630
}
2731

28-
public interface IEventRoundStart
32+
public interface IEventRoundStart: IMAEvent
2933
{
3034
void OnRoundStart();
3135
}
3236

33-
public interface IEventCrash
37+
public interface IEventCrash: IMAEvent
3438
{
3539
void OnCrash();
3640
}
3741

38-
public interface IEventTick
42+
public interface IEventTick: IMAEvent
3943
{
4044
void OnTick();
4145
}
4246

47+
public interface IServerMod: IMAEvent
48+
{
49+
}
50+
4351
public interface IEventServerFull : IServerMod
4452
{
4553
void OnServerFull();
@@ -60,10 +68,6 @@ public interface IEventAdminAction : IServerMod
6068
void OnAdminAction(string message);
6169
}
6270

63-
public interface IServerMod
64-
{
65-
}
66-
6771
public interface ICommand
6872
{
6973
void OnCall(string[] args);

MultiAdmin/Features/MultiAdminInfo.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,12 @@ public override void OnConfigReload()
5050

5151
public void PrintInfo()
5252
{
53-
Server.Write($"MultiAdmin v{Program.MaVersion} (https://github.com/Grover-c13/MultiAdmin/)", ConsoleColor.DarkMagenta);
54-
Server.Write("Released under MIT License Copyright © Grover 2019", ConsoleColor.DarkMagenta);
53+
Server.Write($"{nameof(MultiAdmin)} v{Program.MaVersion} (https://github.com/Grover-c13/MultiAdmin/)\nReleased under MIT License Copyright © Grover 2019", ConsoleColor.DarkMagenta);
5554
}
5655

5756
public override string GetFeatureDescription()
5857
{
59-
return "Prints MultiAdmin license and version information";
58+
return $"Prints {nameof(MultiAdmin)} license and version information";
6059
}
6160

6261
public override string GetFeatureName()

MultiAdmin/Program.cs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ namespace MultiAdmin
1515
{
1616
public static class Program
1717
{
18-
public const string MaVersion = "3.2.3.1";
19-
public const string RecommendedMonoVersion = "5.18.0";
18+
public const string MaVersion = "3.2.4.3";
19+
public const string RecommendedMonoVersion = "5.18";
2020

2121
private static readonly List<Server> InstantiatedServers = new List<Server>();
2222

2323
private static readonly string MaDebugLogDir = Utils.GetFullPathSafe("logs");
24-
private static readonly string MaDebugLogFile = !string.IsNullOrEmpty(MaDebugLogDir) ? Utils.GetFullPathSafe($"{MaDebugLogDir}{Path.DirectorySeparatorChar}{Utils.DateTime}_MA_{MaVersion}_debug_log.txt") : null;
24+
private static readonly string MaDebugLogFile = !string.IsNullOrEmpty(MaDebugLogDir) ? Utils.GetFullPathSafe(Path.Combine(MaDebugLogDir, $"{Utils.DateTime}_MA_{MaVersion}_debug_log.txt")) : null;
2525

2626
private static uint? portArg;
2727

@@ -178,7 +178,8 @@ public static void Main()
178178

179179
Headless = GetFlagFromArgs("headless", "h");
180180

181-
CheckMonoVersion();
181+
if (!Headless)
182+
CheckMonoVersion();
182183

183184
string serverIdArg = GetParamFromArgs("server-id", "id");
184185
string configArg = GetParamFromArgs("config", "c");
@@ -372,11 +373,11 @@ public static Process StartServer(Server server)
372373
return serverProcess;
373374
}
374375

375-
private static bool IsVersionFormat(string input)
376+
private static bool IsVersionFormat(string input, char separator = '.')
376377
{
377378
foreach (char character in input)
378379
{
379-
if (!char.IsNumber(character) && character != '.')
380+
if (!char.IsNumber(character) && character != separator)
380381
return false;
381382
}
382383

@@ -388,17 +389,17 @@ public static void CheckMonoVersion()
388389
try
389390
{
390391
string monoVersionRaw = Type.GetType("Mono.Runtime")?.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static)?.Invoke(null, null)?.ToString();
391-
string monoVersion = monoVersionRaw?.Split(' ').FirstOrDefault(IsVersionFormat);
392+
string monoVersion = monoVersionRaw?.Split(' ').FirstOrDefault(version => IsVersionFormat(version));
392393

393394
if (string.IsNullOrEmpty(monoVersion))
394395
return;
395396

396397
int versionDifference = Utils.CompareVersionStrings(monoVersion, RecommendedMonoVersion);
397398

398-
if (versionDifference >= 0 && (versionDifference != 0 || monoVersion.Length >= RecommendedMonoVersion.Length))
399+
if (versionDifference >= 0)
399400
return;
400401

401-
Write($"Warning: Your Mono version ({monoVersion}) is below the recommended version ({RecommendedMonoVersion})", ConsoleColor.Red);
402+
Write($"Warning: Your Mono version ({monoVersion}) is below the minimum recommended version ({RecommendedMonoVersion})", ConsoleColor.Red);
402403
Write("Please update your Mono installation: https://www.mono-project.com/download/stable/", ConsoleColor.Red);
403404
}
404405
catch (Exception e)

0 commit comments

Comments
 (0)