mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-22 04:35:52 +12:00
Add Feature pt2
This commit is contained in:
parent
092534e331
commit
67275262fb
36 changed files with 1555 additions and 296 deletions
72
HorseIsleServer/LibHISP/Server/Entry.cs
Normal file
72
HorseIsleServer/LibHISP/Server/Entry.cs
Normal file
|
@ -0,0 +1,72 @@
|
|||
using HISP.Game;
|
||||
using HISP.Game.Horse;
|
||||
using HISP.Game.Items;
|
||||
using HISP.Game.Services;
|
||||
using HISP.Game.SwfModules;
|
||||
using HISP.Security;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace HISP.Server
|
||||
{
|
||||
public static class Entry
|
||||
{
|
||||
// "Entry Point"
|
||||
|
||||
|
||||
private static void defaultOnShutdownCallback()
|
||||
{
|
||||
Process.GetCurrentProcess().Close();
|
||||
}
|
||||
public static Action OnShutdown = defaultOnShutdownCallback;
|
||||
|
||||
|
||||
public static void SetShutdownCallback(Action callback)
|
||||
{
|
||||
OnShutdown = callback;
|
||||
}
|
||||
|
||||
public static void Start()
|
||||
{
|
||||
#if (!DEBUG)
|
||||
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
|
||||
#endif
|
||||
|
||||
Console.Title = ServerVersion.GetBuildString();
|
||||
ConfigReader.OpenConfig();
|
||||
CrossDomainPolicy.GetPolicy();
|
||||
Database.OpenDatabase();
|
||||
GameDataJson.ReadGamedata();
|
||||
|
||||
Map.OpenMap();
|
||||
World.ReadWorldData();
|
||||
Treasure.Init();
|
||||
|
||||
DroppedItems.Init();
|
||||
WildHorse.Init();
|
||||
|
||||
Drawingroom.LoadAllDrawingRooms();
|
||||
Brickpoet.LoadPoetryRooms();
|
||||
Multiroom.CreateMultirooms();
|
||||
|
||||
Auction.LoadAllAuctionRooms();
|
||||
|
||||
Item.DoSpecialCases();
|
||||
|
||||
GameServer.StartServer();
|
||||
}
|
||||
|
||||
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
|
||||
{
|
||||
Exception execpt = (Exception)e.ExceptionObject;
|
||||
|
||||
Logger.ErrorPrint("HISP HAS CRASHED :(");
|
||||
Logger.ErrorPrint("Unhandled Exception: " + execpt.ToString());
|
||||
Logger.ErrorPrint(execpt.Message);
|
||||
Logger.ErrorPrint("");
|
||||
Logger.ErrorPrint(execpt.StackTrace);
|
||||
|
||||
while (true) { /* Allow asyncronous operations to happen. */ };
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue