Skip to content

Commit c6d73e1

Browse files
committed
Add compiler version output on start
1 parent f09744d commit c6d73e1

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

src/CompilerService.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ private bool Start()
136136

137137
Stop(false, "starting new process");
138138

139-
string args = compilerBasicArguments + $" --parent {Process.GetCurrentProcess().Id} -l:file compiler_{DateTime.Now.ToString("yyyy-MM-dd")}.log";
139+
string args = compilerBasicArguments + $" --parent {Process.GetCurrentProcess().Id} -l:file compiler_{DateTime.Now:yyyy-MM-dd}.log";
140140
#if DEBUG
141141
args += " -v Debug";
142142
#endif
@@ -195,7 +195,7 @@ private bool Start()
195195
client.Error += OnError;
196196
client.Start();
197197
ResetIdleTimer();
198-
Log(LogType.Info, "Compiler has been started successfully");
198+
Log(LogType.Info, $"Started Oxide.Compiler v{GetCompilerVersion()} successfully");
199199
return true;
200200
}
201201

@@ -682,5 +682,16 @@ private static bool TryDownload(string url, int retries, ref int current, DateTi
682682
}
683683

684684
private static void Log(LogType type, string message, Exception exception = null) => Interface.Oxide.RootLogger.WriteDebug(type, LogEvent.Compile, "CSharp", message, exception);
685+
686+
private string GetCompilerVersion()
687+
{
688+
if (!Installed)
689+
{
690+
return "0.0.0";
691+
}
692+
693+
FileVersionInfo version = FileVersionInfo.GetVersionInfo(filePath);
694+
return version.FileVersion;
695+
}
685696
}
686697
}

0 commit comments

Comments
 (0)