@@ -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