mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-19 19:29:15 +12:00
Add VSIX Installer project
This commit is contained in:
parent
567b848eea
commit
6891561263
37 changed files with 2517 additions and 859 deletions
43
HorseIsleServer/HISPCli/Program.cs
Normal file
43
HorseIsleServer/HISPCli/Program.cs
Normal file
|
@ -0,0 +1,43 @@
|
|||
using HISP.Server;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace HISP
|
||||
{
|
||||
public static class Program
|
||||
{
|
||||
public static bool ShuttingDown = false;
|
||||
public static string LogFile;
|
||||
public static string BaseDir;
|
||||
|
||||
public static void OnShutdown()
|
||||
{
|
||||
ShuttingDown = true;
|
||||
}
|
||||
public static void LogToFile(string text)
|
||||
{
|
||||
File.AppendAllTextAsync(text, LogFile);
|
||||
}
|
||||
public static void LogStdout(string text)
|
||||
{
|
||||
Console.Out.WriteAsync(text + Console.Out.NewLine);
|
||||
}
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
string BaseDir = Directory.GetCurrentDirectory();
|
||||
#if DEB_PACKAGE
|
||||
ConfigReader.ConfigurationFileName = "/etc/hisp.conf"
|
||||
LogFile = "/var/log/hisp.log"
|
||||
Logger.SetCallback(LogToFile);
|
||||
#else
|
||||
Logger.SetCallback(LogStdout);
|
||||
#endif
|
||||
|
||||
Entry.SetShutdownCallback(OnShutdown);
|
||||
Entry.Start();
|
||||
|
||||
while (!ShuttingDown) { /* Allow asyncronous operations to happen. */ };
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue