mirror of
https://github.com/islehorse/HISP.git
synced 2025-07-19 13:31:33 +12:00
add build script
This commit is contained in:
parent
063c267755
commit
bf4d5f5005
14 changed files with 8903 additions and 9004 deletions
|
@ -1,76 +1,74 @@
|
|||
using HISP.Game;
|
||||
using HISP.Game.Horse;
|
||||
using HISP.Game.Items;
|
||||
using HISP.Game.Services;
|
||||
using HISP.Game.SwfModules;
|
||||
using HISP.Game.Chat;
|
||||
using HISP.Security;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using HISP.Modding;
|
||||
using HISP.Game;
|
||||
using HISP.Game.Horse;
|
||||
using HISP.Game.Items;
|
||||
using HISP.Game.Services;
|
||||
using HISP.Game.SwfModules;
|
||||
using HISP.Game.Chat;
|
||||
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()
|
||||
namespace HISP.Server
|
||||
{
|
||||
public static class Entry
|
||||
{
|
||||
// "Entry Point"
|
||||
|
||||
private static void defaultOnShutdownCallback()
|
||||
{
|
||||
#if (!DEBUG)
|
||||
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
|
||||
#endif
|
||||
Process.GetCurrentProcess().Close();
|
||||
}
|
||||
public static Action OnShutdown = defaultOnShutdownCallback;
|
||||
|
||||
ModLoader.ReloadModsFromFilesystem();
|
||||
|
||||
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();
|
||||
Command.RegisterCommands();
|
||||
|
||||
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. */ };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
Command.RegisterCommands();
|
||||
|
||||
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. */ };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,6 @@
|
|||
using HISP.Properties;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using HISP.Properties;
|
||||
|
||||
namespace HISP.Server
|
||||
{
|
||||
|
@ -44,27 +46,33 @@ namespace HISP.Server
|
|||
}
|
||||
public static string GetVersionString()
|
||||
{
|
||||
return Resources.GitTag.Replace("\r", "").Replace("\n", "");
|
||||
return Resources.GitTag.Replace("\r", "").Replace("\n", "").ToString().Trim() + "."+ GetCommitHashVersion();
|
||||
}
|
||||
public static string GetBranch()
|
||||
{
|
||||
return Resources.GitBranch.Replace("\r", "").Replace("\n", "");
|
||||
return Resources.GitBranch.Replace("\r", "").Replace("\n", "").ToString().Trim();
|
||||
}
|
||||
public static string GetBuildDate()
|
||||
{
|
||||
return Resources.BuildDate.Replace("\r", "").Replace("\n", "");
|
||||
return Resources.BuildDate.Replace("\r", "").Replace("\n", "").ToString().Trim();
|
||||
}
|
||||
public static string GetBuildTime()
|
||||
{
|
||||
return Resources.BuildTime.Replace("\r", "").Replace("\n", "");
|
||||
return Resources.BuildTime.Replace("\r", "").Replace("\n", "").ToString().Trim();
|
||||
}
|
||||
|
||||
public static string GetCommitHashVersion()
|
||||
{
|
||||
return UInt16.Parse(Resources.GitCommit.Substring(0, 4), NumberStyles.HexNumber).ToString();
|
||||
}
|
||||
|
||||
public static string GetCommitHash(int TotalBytes)
|
||||
{
|
||||
return Resources.GitCommit.Substring(0, TotalBytes).Replace("\r", "").Replace("\n", "");
|
||||
return Resources.GitCommit.Substring(0, TotalBytes).Replace("\r", "").Replace("\n", "").ToString().Trim();
|
||||
}
|
||||
public static string GetBuildString()
|
||||
{
|
||||
return PRODUCT + " " + GetVersionString() + " `" + GetBranch() + "@" + GetCommitHash(7) + "`; (" + GetArchitecture() + "; " + GetPlatform() + "); Built on " + GetBuildDate() + " at " + GetBuildTime();
|
||||
return PRODUCT + " " + GetVersionString() + " " + GetBranch() + " (" + GetArchitecture() + "; " + GetPlatform() + "); Built @ " + GetBuildDate() + " " + GetBuildTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue