Esempio n. 1
0
 void OnConnect(RPCConnectResult result)
 {
     try
     {
         if (result.Success())
         {
             Connected = true;
             WriteLine("Successfully connected to the server");
             TerminateUpdateThread();
             lock (TerminationEvent)
             {
                 AutomaticUpdatesThread      = new Thread(RunAutomaticUpdates);
                 AutomaticUpdatesThread.Name = string.Format("{0} Automatic updates", Profile.Description);
                 AutomaticUpdatesThread.Start();
             }
         }
         else
         {
             if (result.Result == RPCConnectResultType.LoginFault && result.FlexLoginFault.FaultString == "com.riotgames.platform.login.LoginFailedException : null")
             {
                 WriteLine("The server has placed this client in the login queue. Please be patient.");
             }
             else
             {
                 WriteLine(result.GetMessage());
             }
             TerminationEvent.WaitOne(Configuration.ReconnectDelay);
             ConnectInThread();
         }
     }
     catch (Exception exception)
     {
         GlobalHandler.HandleException(exception);
     }
 }
Esempio n. 2
0
 public void RunServer()
 {
     try
     {
         WriteLine("Running web server on {0}", GetServerString());
         Server.Run();
     }
     catch (SocketException exception)
     {
         WriteLine("Unable to run web server on {0}: {1}", GetServerString(), exception.Message);
         WriteLine("It is possible that port {0} is already being used. Make sure that no other instances of this application are currently running. It is also possible that another service is already using this port. In that case you will have to edit the Configuration.xml file and modify the <Port>{0}</Port> line to choose another port. You have to restart this application for any of the changes to take effect.", ServiceConfiguration.Port);
     }
     catch (Exception exception)
     {
         GlobalHandler.HandleException(exception);
     }
 }