mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-12 07:59:48 +12:00
Fix global exception handler
This commit is contained in:
parent
9930832730
commit
1c57c3fefd
4 changed files with 38 additions and 37 deletions
|
@ -109,7 +109,7 @@ namespace HISP.Game.Events
|
||||||
string msgCheck = message.ToLower();
|
string msgCheck = message.ToLower();
|
||||||
foreach(string answer in Answers)
|
foreach(string answer in Answers)
|
||||||
{
|
{
|
||||||
if (answer.ToLower().Contains(msgCheck))
|
if (msgCheck.ToLower().Contains(answer))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -6,6 +6,8 @@ using HISP.Game.SwfModules;
|
||||||
using HISP.Security;
|
using HISP.Security;
|
||||||
using HISP.Server;
|
using HISP.Server;
|
||||||
using HISP.Game.Services;
|
using HISP.Game.Services;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace HISP
|
namespace HISP
|
||||||
{
|
{
|
||||||
public class Program
|
public class Program
|
||||||
|
@ -13,48 +15,45 @@ namespace HISP
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
#if (!DEBUG)
|
#if (!DEBUG)
|
||||||
try
|
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
Console.Title = "HISP - Horse Isle Server Emulator";
|
|
||||||
ConfigReader.OpenConfig();
|
Console.Title = "HISP - Horse Isle Server Emulator";
|
||||||
CrossDomainPolicy.GetPolicy();
|
ConfigReader.OpenConfig();
|
||||||
Database.OpenDatabase();
|
CrossDomainPolicy.GetPolicy();
|
||||||
GameDataJson.ReadGamedata();
|
Database.OpenDatabase();
|
||||||
|
GameDataJson.ReadGamedata();
|
||||||
|
|
||||||
Map.OpenMap();
|
Map.OpenMap();
|
||||||
World.ReadWorldData();
|
World.ReadWorldData();
|
||||||
Treasure.Init();
|
Treasure.Init();
|
||||||
|
|
||||||
DroppedItems.Init();
|
DroppedItems.Init();
|
||||||
WildHorse.Init();
|
WildHorse.Init();
|
||||||
|
|
||||||
Drawingroom.LoadAllDrawingRooms();
|
Drawingroom.LoadAllDrawingRooms();
|
||||||
Brickpoet.LoadPoetryRooms();
|
Brickpoet.LoadPoetryRooms();
|
||||||
Multiroom.CreateMultirooms();
|
Multiroom.CreateMultirooms();
|
||||||
|
|
||||||
Auction.LoadAllAuctionRooms();
|
Auction.LoadAllAuctionRooms();
|
||||||
|
|
||||||
Item.DoSpecialCases();
|
Item.DoSpecialCases();
|
||||||
|
|
||||||
GameServer.StartServer();
|
GameServer.StartServer();
|
||||||
#if (!DEBUG)
|
|
||||||
}
|
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
Logger.ErrorPrint("Server has crashed! :(");
|
|
||||||
Logger.ErrorPrint("");
|
|
||||||
Logger.ErrorPrint("");
|
|
||||||
Logger.ErrorPrint("UNCAUGHT EXCEPTION!");
|
|
||||||
Logger.ErrorPrint("");
|
|
||||||
Logger.ErrorPrint("");
|
|
||||||
Logger.ErrorPrint(e.Message);
|
|
||||||
Logger.ErrorPrint("");
|
|
||||||
Logger.ErrorPrint(e.StackTrace);
|
|
||||||
while(true){};
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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) { };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5539,6 +5539,8 @@ namespace HISP.Server
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message = message.Trim();
|
||||||
|
|
||||||
if (Chat.ProcessCommand(sender.LoggedinUser, message))
|
if (Chat.ProcessCommand(sender.LoggedinUser, message))
|
||||||
{
|
{
|
||||||
Logger.DebugPrint(sender.LoggedinUser.Username + " Attempting to run command '" + message + "' in channel: " + channel.ToString());
|
Logger.DebugPrint(sender.LoggedinUser.Username + " Attempting to run command '" + message + "' in channel: " + channel.ToString());
|
||||||
|
|
|
@ -83,10 +83,10 @@ if(isset($_POST['cbt'], $_POST['user'],$_POST['pass1'],$_POST['pass2'],$_POST['s
|
||||||
if($username == $password)
|
if($username == $password)
|
||||||
array_push($problems, "Username and Password can not be the same!");
|
array_push($problems, "Username and Password can not be the same!");
|
||||||
|
|
||||||
if(str_contains($username, $password))
|
if(strpos($username, $password) !== false)
|
||||||
array_push($problems, "The password cannot be within the username!.");
|
array_push($problems, "The password cannot be within the username!.");
|
||||||
|
|
||||||
if(str_contains($password, $username))
|
if(strpos($password, $username) !== false)
|
||||||
array_push($problems, "The password cannot have the username within it!.");
|
array_push($problems, "The password cannot have the username within it!.");
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue