mirror of
https://github.com/islehorse/HISP.git
synced 2025-05-26 00:19:00 +12:00
Add error handling
This commit is contained in:
parent
b906012175
commit
0356930a5c
2 changed files with 14 additions and 8 deletions
HorseIsleServer/N00BS
|
@ -89,10 +89,14 @@ namespace HISP
|
|||
}
|
||||
|
||||
// Start Web Server
|
||||
cs = new ContentServer();
|
||||
string[] fileList = Directory.GetFiles(Path.Combine(baseDir, "client"), "*", SearchOption.AllDirectories);
|
||||
foreach (string file in fileList)
|
||||
addToList(file);
|
||||
try{
|
||||
cs = new ContentServer();
|
||||
string[] fileList = Directory.GetFiles(Path.Combine(baseDir, "client"), "*", SearchOption.AllDirectories);
|
||||
foreach (string file in fileList)
|
||||
addToList(file);
|
||||
}catch(Exception as e){
|
||||
MessageBox.Show("Web server failed to start: "+e.Message, "Error starting web server", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
|
||||
IncrementProgress();
|
||||
|
||||
|
@ -138,13 +142,15 @@ namespace HISP
|
|||
|
||||
Item.DoSpecialCases();
|
||||
IncrementProgress();
|
||||
|
||||
try{
|
||||
GameServer.StartServer();
|
||||
}catch(Exception as e){
|
||||
MessageBox.Show("Horse Isle server failed to start: "+e.Message, "Error starting web server", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
IncrementProgress();
|
||||
|
||||
lfrm.DialogResult = DialogResult.OK;
|
||||
startForm.Wait();
|
||||
|
||||
|
||||
SystemTrayIcon stry = new SystemTrayIcon();
|
||||
stry.ShowDialog();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue