diff options
Diffstat (limited to 'source/WindowsFormsApplication1/Program.cs')
| -rw-r--r-- | source/WindowsFormsApplication1/Program.cs | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/source/WindowsFormsApplication1/Program.cs b/source/WindowsFormsApplication1/Program.cs index e7fb173..668b08e 100644 --- a/source/WindowsFormsApplication1/Program.cs +++ b/source/WindowsFormsApplication1/Program.cs @@ -24,23 +24,30 @@ namespace ShiftOS //Extract all dependencies before starting the engine. ExtractDependencies(); var poolThread = new Thread(new ThreadStart(new Action(() => { - //Download ShiftOS server startup-pool - string pool = new WebClient().DownloadString("http://playshiftos.ml/server/startup_pool"); - string[] splitter = pool.Split(';'); - foreach(string address in splitter) + try { - try - { - string[] addSplitter = address.Split(':'); - string host = addSplitter[0]; - int port = Convert.ToInt32(addSplitter[1]); - Package_Grabber.ConnectToServer(host, port); - } - catch + //Download ShiftOS server startup-pool + string pool = new WebClient().DownloadString("http://playshiftos.ml/server/startup_pool"); + string[] splitter = pool.Split(';'); + foreach (string address in splitter) { + try + { + string[] addSplitter = address.Split(':'); + string host = addSplitter[0]; + int port = Convert.ToInt32(addSplitter[1]); + Package_Grabber.ConnectToServer(host, port); + } + catch + { + } } } + catch(Exception ex) + { + Console.WriteLine("[ServerThread/WARNING] Couldn't retrieve startup pool. Not connecting to any servers."); + } }))); poolThread.Start(); //Start the Windows Forms backend |
