File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ public class ServerDllSource
144
144
/// <summary>
145
145
/// The path to the Uchu.Instance DLL
146
146
/// </summary>
147
- [ XmlElement ] public string Instance { get ; set ; } = "Uchu.Instance.dll" ;
147
+ [ XmlElement ] public string Instance { get ; set ; } = "Enter path to Uchu.Instance.dll" ;
148
148
149
149
/// <summary>
150
150
/// The path to the script source DLLs
Original file line number Diff line number Diff line change @@ -218,6 +218,8 @@ private static async Task ConfigureAsync()
218
218
{
219
219
LogQueue . Config = Config = new UchuConfiguration ( ) ;
220
220
221
+ Config . DllSource . ScriptDllSource . Add ( "Enter path to Uchu.StandardScripts.dll" ) ;
222
+
221
223
var backup = File . CreateText ( "config.default.xml" ) ;
222
224
223
225
serializer . Serialize ( backup , Config ) ;
@@ -265,10 +267,24 @@ private static async Task ConfigureAsync()
265
267
266
268
if ( ! File . Exists ( DllLocation ) )
267
269
{
268
- Logger . Error ( "Could not find file specified in DllSource -> Instance in config.xml." ) ;
269
- throw new FileNotFoundException ( "Could not find Instance file." ) ;
270
+ throw new FileNotFoundException ( "Could not find file specified in <Instance> under <DllSource> in config.xml." ) ;
270
271
}
271
272
273
+ var validScriptPackExists = Config . DllSource . ScriptDllSource . Exists ( scriptPackPath =>
274
+ {
275
+ if ( File . Exists ( scriptPackPath ) )
276
+ return true ;
277
+
278
+ Logger . Warning ( $ "Could not find script pack at { scriptPackPath } ") ;
279
+ return false ;
280
+ } ) ;
281
+
282
+ if ( ! validScriptPackExists )
283
+ {
284
+ throw new FileNotFoundException ( "No valid <ScriptDllSource> specified under <DllSource> in config.xml.\n "
285
+ + "Without Uchu.StandardScripts.dll, Uchu cannot function correctly." ) ;
286
+ }
287
+
272
288
foreach ( var scriptPackPath in Config . DllSource . ScriptDllSource )
273
289
{
274
290
if ( ! File . Exists ( scriptPackPath ) )
You can’t perform that action at this time.
0 commit comments