static void Main(string[] args) { Console.WriteLine("Yorick " + SERVER_VERSION); WriteToLog.ExecutingDirectory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); WriteToLog.LogfileName = "IntWarsSharp.txt"; WriteToLog.CreateLogFile(); ExecutingDirectory = WriteToLog.ExecutingDirectory; System.AppDomain.CurrentDomain.FirstChanceException += Logger.CurrentDomain_FirstChanceException; System.AppDomain.CurrentDomain.UnhandledException += Logger.CurrentDomain_UnhandledException; Logger.LogCoreInfo("Loading Config."); Config.LoadConfig("Settings/GameInfo.json"); Logger.LogCoreInfo("Loading RAF files in filearchives/."); var settings = Settings.Load("Settings/Settings.json"); if (!RAFManager.getInstance().init(System.IO.Path.Combine(settings.RadsPath, "filearchives"))) { Logger.LogCoreError("Couldn't load RAF files. Make sure you have a 'filearchives' directory in the server's root directory. This directory is to be taken from RADS/projects/lol_game_client/"); return; } ItemManager.getInstance().init(); Logger.LogCoreInfo("Game started"); Game g = new Game(); var address = new ENetAddress(); address.host = SERVER_HOST; address.port = SERVER_PORT; if (!g.initialize(address, SERVER_KEY)) { Logger.LogCoreError("Couldn't listen on port " + SERVER_PORT + ", or invalid key"); return; } //Sniffer.getInstance().setGame(g); //var p = Process.Start("SnifferApp.exe"); g.netLoop(); PathNode.DestroyTable(); // Cleanup }
public void Dispose() { PathNode.DestroyTable(); }