private bool SetupGameInstallation() { try { string gamePath = m_commandLineArgs.gamePath; if (gamePath.Length > 0) { if (!GameInstallationInfo.IsValidGamePath(gamePath)) return false; m_gameInstallationInfo = new GameInstallationInfo(gamePath); } else { m_gameInstallationInfo = new GameInstallationInfo(); } } catch (Exception ex) { LogManager.ErrorLog.WriteLine(ex); } if (m_gameInstallationInfo != null) return true; else return false; }
//private bool SetupServerService() //{ // try // { // _serverHost = CreateServiceHost( typeof( ServerService ), typeof( IServerServiceContract ), "Server/", "ServerService" ); // _serverHost.Open( ); // } // catch (CommunicationException ex) // { // ApplicationLog.BaseLog.Error("An exception occurred: " + ex.Message); // _serverHost.Abort( ); // return false; // } // catch ( TimeoutException ex ) // { // ApplicationLog.BaseLog.Error( "An exception occurred: " + ex.Message ); // _serverHost.Abort( ); // return false; // } // return true; //} //private bool SetupMainService() //{ // try // { // _baseHost = CreateServiceHost( typeof ( InternalService ), typeof ( IInternalServiceContract ), "", "InternalService" ); // _baseHost.Open( ); // } // catch ( CommunicationException ex ) // { // ApplicationLog.BaseLog.Error( "An exception occurred: " + ex.Message ); // _baseHost.Abort( ); // return false; // } // catch ( TimeoutException ex ) // { // ApplicationLog.BaseLog.Error( "An exception occurred: " + ex.Message ); // _baseHost.Abort( ); // return false; // } // return true; //} //private bool SetupWebService() //{ //Uri webServiceAddress = new Uri( "http://localhost:" + WCFPort + "/SEServerExtender/Web/" ); //_webHost = new WebServiceHost( typeof( WebService ), webServiceAddress ); //try //{ // //WebHttpBinding binding = new WebHttpBinding(WebHttpSecurityMode.TransportCredentialOnly); // //binding.Security.Mode = WebHttpSecurityMode.TransportCredentialOnly; // //binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows; // //ServiceEndpoint endpoint = _webHost.AddServiceEndpoint(typeof(IWebServiceContract), binding, "WebService"); // //_webHost.Credentials.UserNameAuthentication.UserNamePasswordValidationMode = UserNamePasswordValidationMode.Custom; // //_webHost.Credentials.UserNameAuthentication.CustomUserNamePasswordValidator = new UserNameValidator(); // //EnableCorsBehavior ecb = new EnableCorsBehavior(); // //_webHost.Description.Behaviors.Add( ecb ); // //_webHost.Open( ); //} //catch (CommunicationException ex) //{ // ApplicationLog.BaseLog.Error( "An exception occurred: {0}", ex.Message); // //_webHost.Abort( ); // return false; //} //return true; //} private bool SetupGameInstallation( ) { try { string gamePath = _commandLineArgs.GamePath; if ( gamePath.Length > 0 ) { if ( !GameInstallationInfo.IsValidGamePath( gamePath ) ) { ApplicationLog.BaseLog.Fatal( "{0} is not a valid game path.", gamePath ); return false; } _gameInstallationInfo = new GameInstallationInfo( gamePath ); } else { _gameInstallationInfo = new GameInstallationInfo( ); } } catch ( Exception ex ) { ApplicationLog.BaseLog.Error( ex ); } if ( _gameInstallationInfo != null ) return true; else return false; }