File tree Expand file tree Collapse file tree
TerrariaServerAPI/TerrariaApi.Server Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ namespace TerrariaApi.Server
1919 public static class ServerApi
2020 {
2121 public const string PluginsPath = "ServerPlugins" ;
22+ public static string ? AdditionalPluginsPath { get ; private set ; } = null ;
2223
2324 public static readonly Version ApiVersion = new Version ( 2 , 1 , 0 , 0 ) ;
2425 private static Main game ;
@@ -263,6 +264,9 @@ internal static void HandleCommandLine(string[] parms)
263264 case "-crashdir" :
264265 CrashReporter . crashReportPath = arg . Value ;
265266 break ;
267+ case "-additionalplugins" :
268+ AdditionalPluginsPath = arg . Value ;
269+ break ;
266270 }
267271 }
268272 }
@@ -306,6 +310,12 @@ internal static void LoadPlugins()
306310
307311 List < FileInfo > fileInfos = new DirectoryInfo ( ServerPluginsDirectoryPath ) . GetFiles ( "*.dll" ) . ToList ( ) ;
308312 fileInfos . AddRange ( new DirectoryInfo ( ServerPluginsDirectoryPath ) . GetFiles ( "*.dll-plugin" ) ) ;
313+ if ( AdditionalPluginsPath is string additionalPath )
314+ {
315+ var di = new DirectoryInfo ( Path . Combine ( AppContext . BaseDirectory , additionalPath ) ) ;
316+ fileInfos . AddRange ( di . GetFiles ( "*.dll" ) ) ;
317+ fileInfos . AddRange ( di . GetFiles ( "*.dll-plugin" ) ) ;
318+ }
309319
310320 Dictionary < TerrariaPlugin , Stopwatch > pluginInitWatches = new Dictionary < TerrariaPlugin , Stopwatch > ( ) ;
311321 foreach ( FileInfo fileInfo in fileInfos )
You can’t perform that action at this time.
0 commit comments