Kaynağa Gözat

解决#r指令不能使用相对目录的问题

tanghai 7 yıl önce
ebeveyn
işleme
c537d2f796

+ 6 - 4
Server/Hotfix/Module/Repl/ReplComponentSystem.cs

@@ -12,9 +12,11 @@ namespace ETHotfix
     {
         public override void Start(ReplComponent self)
         {
-            self.ScriptOptions = ScriptOptions.Default.WithFilePath(Environment.CurrentDirectory)
-                    .AddReferences(typeof (ReplComponent).Assembly);
-            
+            self.ScriptOptions = ScriptOptions.Default
+                    .WithMetadataResolver(ScriptMetadataResolver.Default.WithBaseDirectory(Environment.CurrentDirectory))
+                    .AddReferences(typeof (ReplComponent).Assembly)
+                    .AddImports("System");
+
             self.Run().NoAwait();
         }
     }
@@ -48,7 +50,7 @@ namespace ETHotfix
                     
                     line = line.Trim();
                     
-                    if (line == "quit")
+                    if (line == "exit")
                     {
                         self.ScriptState = null;
                         continue;