From 8da39376233e6b84a8ffbc0eceef5cfb98d02236 Mon Sep 17 00:00:00 2001 From: HojouFotytu Date: Mon, 18 Feb 2019 22:26:59 +0900 Subject: [PATCH 1/5] Update CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 6da784e..3eec688 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe ## Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at @Legedric. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at @Hojou. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. @@ -43,4 +43,4 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ \ No newline at end of file +[version]: http://contributor-covenant.org/version/1/4/ From ef02a897aa519890d19e59d06fb80d2d75ee7c0d Mon Sep 17 00:00:00 2001 From: JackTerok Date: Mon, 18 Feb 2019 19:05:54 +0100 Subject: [PATCH 2/5] Added Clearer Log Message --- Core/Main/PTMagic.cs | 69 ++++++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/Core/Main/PTMagic.cs b/Core/Main/PTMagic.cs index f66faad..3a129c4 100644 --- a/Core/Main/PTMagic.cs +++ b/Core/Main/PTMagic.cs @@ -646,42 +646,49 @@ namespace Core.Main // Check if the program is enabled if (this.PTMagicConfiguration.GeneralSettings.Application.IsEnabled) { - if (this.PTMagicConfiguration.GeneralSettings.Application.TestMode) this.Log.DoLogInfo("TESTMODE ENABLED - No files will be changed!"); + try + { + if (this.PTMagicConfiguration.GeneralSettings.Application.TestMode) this.Log.DoLogInfo("TESTMODE ENABLED - No files will be changed!"); - // Check for PT Directory - DirectoryInfo ptRoot = new DirectoryInfo(this.PTMagicConfiguration.GeneralSettings.Application.ProfitTrailerPath); - if (ptRoot.Exists) - { - this.Log.DoLogInfo("Profit Trailer directory found"); - result = RunProfitTrailerSettingsAPIChecks(); + // Check for PT Directory + DirectoryInfo ptRoot = new DirectoryInfo(this.PTMagicConfiguration.GeneralSettings.Application.ProfitTrailerPath); + if (ptRoot.Exists) + { + this.Log.DoLogInfo("Profit Trailer directory found"); + result = RunProfitTrailerSettingsAPIChecks(); + } + else + { + this.Log.DoLogError("Profit Trailer directory not found (" + this.PTMagicConfiguration.GeneralSettings.Application.ProfitTrailerPath + ")"); + result = false; + } + + // Check for CoinMarketCap API Key + if (!this.PTMagicConfiguration.GeneralSettings.Application.CoinMarketCapAPIKey.Equals("")) + { + this.Log.DoLogInfo("CoinMarketCap API KEY found"); + } + else + { + this.Log.DoLogInfo("No CoinMarketCap API KEY specified! You can't use CoinMarketCap in your settings.analyzer.json"); + } + + // Check for CurrencyConverterApi Key + if (!this.PTMagicConfiguration.GeneralSettings.Application.FreeCurrencyConverterAPIKey.Equals("")) + { + this.Log.DoLogInfo("FreeCurrencyConverterApi KEY found"); + } + else + { + this.Log.DoLogInfo("No FreeCurrencyConverterApi KEY specified! You can't use non USD Currencies!"); + } } - else + catch (System.NullReferenceException ex) { - this.Log.DoLogError("Profit Trailer directory not found (" + this.PTMagicConfiguration.GeneralSettings.Application.ProfitTrailerPath + ")"); - result = false; + this.Log.DoLogError("PTM failed to read the Config File. That means something in the File is either missing or incorrect. If this happend after an update please take a look at the release notes at: https://github.com/PTMagicians/PTMagic/releases"); } - // Check for CoinMarketCap API Key - if (!this.PTMagicConfiguration.GeneralSettings.Application.CoinMarketCapAPIKey.Equals("")) - { - this.Log.DoLogInfo("CoinMarketCap API KEY found"); - } - else - { - this.Log.DoLogInfo("No CoinMarketCap API KEY specified! You can't use CoinMarketCap in your settings.analyzer.json"); - } - - // Check for CurrencyConverterApi Key - if (!this.PTMagicConfiguration.GeneralSettings.Application.FreeCurrencyConverterAPIKey.Equals("")) - { - this.Log.DoLogInfo("FreeCurrencyConverterApi KEY found"); - } - else - { - this.Log.DoLogInfo("No FreeCurrencyConverterApi KEY specified! You can't use non USD Currencies!"); - } } - else { this.Log.DoLogWarn("PTMagic disabled, shutting down..."); @@ -802,7 +809,7 @@ namespace Core.Main if (PTMagicConfiguration.GeneralSettings.Application.IsEnabled) { - + // Validate settings this.ValidateSettings(); From 439af14ce5f9a8864318c41d8f20387da6f9492d Mon Sep 17 00:00:00 2001 From: Nathaniel Nation Date: Mon, 18 Feb 2019 15:57:04 -0500 Subject: [PATCH 3/5] Update _Development/README.md Include the need for appsettings.json in the monitor folder --- _Development/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/_Development/README.md b/_Development/README.md index c284956..62c98af 100644 --- a/_Development/README.md +++ b/_Development/README.md @@ -11,4 +11,6 @@ However, you should be carefull to not mess up your files when you commit using ## Setup PT Magic for development 1. Copy settings.analyzer.json and settings.general.json from /_Development/DevSettings to /PTMagic 2. Setup a Profit Trailer instance for development (for example in _Development/LocalProfitTrailer) -3. Adjust the necessary values in settings.general.json to your needs \ No newline at end of file +3. Adjust the necessary values in settings.general.json to your needs +4. Copy appsettings.json from /_Development/DevSettings/Monitor to /PTMagic/Monitor +5. In the appsettings.json file, set the value for PTMagicBasePath development /PTMagic path \ No newline at end of file From d7ce2ca976c8557236e6d6006639eb33016c3bb7 Mon Sep 17 00:00:00 2001 From: HojouFotytu Date: Thu, 21 Feb 2019 22:45:49 +0900 Subject: [PATCH 4/5] Revert "Update _Development/README.md" --- _Development/README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/_Development/README.md b/_Development/README.md index 62c98af..c284956 100644 --- a/_Development/README.md +++ b/_Development/README.md @@ -11,6 +11,4 @@ However, you should be carefull to not mess up your files when you commit using ## Setup PT Magic for development 1. Copy settings.analyzer.json and settings.general.json from /_Development/DevSettings to /PTMagic 2. Setup a Profit Trailer instance for development (for example in _Development/LocalProfitTrailer) -3. Adjust the necessary values in settings.general.json to your needs -4. Copy appsettings.json from /_Development/DevSettings/Monitor to /PTMagic/Monitor -5. In the appsettings.json file, set the value for PTMagicBasePath development /PTMagic path \ No newline at end of file +3. Adjust the necessary values in settings.general.json to your needs \ No newline at end of file From ceaddc21e2172b66328be4cfe679011dc0604564 Mon Sep 17 00:00:00 2001 From: HojouFotytu Date: Thu, 21 Feb 2019 22:47:50 +0900 Subject: [PATCH 5/5] Revert "Added Clearer Log Message" --- Core/Main/PTMagic.cs | 69 ++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 38 deletions(-) diff --git a/Core/Main/PTMagic.cs b/Core/Main/PTMagic.cs index 3a129c4..f66faad 100644 --- a/Core/Main/PTMagic.cs +++ b/Core/Main/PTMagic.cs @@ -646,49 +646,42 @@ namespace Core.Main // Check if the program is enabled if (this.PTMagicConfiguration.GeneralSettings.Application.IsEnabled) { - try + if (this.PTMagicConfiguration.GeneralSettings.Application.TestMode) this.Log.DoLogInfo("TESTMODE ENABLED - No files will be changed!"); + + // Check for PT Directory + DirectoryInfo ptRoot = new DirectoryInfo(this.PTMagicConfiguration.GeneralSettings.Application.ProfitTrailerPath); + if (ptRoot.Exists) { - if (this.PTMagicConfiguration.GeneralSettings.Application.TestMode) this.Log.DoLogInfo("TESTMODE ENABLED - No files will be changed!"); - - // Check for PT Directory - DirectoryInfo ptRoot = new DirectoryInfo(this.PTMagicConfiguration.GeneralSettings.Application.ProfitTrailerPath); - if (ptRoot.Exists) - { - this.Log.DoLogInfo("Profit Trailer directory found"); - result = RunProfitTrailerSettingsAPIChecks(); - } - else - { - this.Log.DoLogError("Profit Trailer directory not found (" + this.PTMagicConfiguration.GeneralSettings.Application.ProfitTrailerPath + ")"); - result = false; - } - - // Check for CoinMarketCap API Key - if (!this.PTMagicConfiguration.GeneralSettings.Application.CoinMarketCapAPIKey.Equals("")) - { - this.Log.DoLogInfo("CoinMarketCap API KEY found"); - } - else - { - this.Log.DoLogInfo("No CoinMarketCap API KEY specified! You can't use CoinMarketCap in your settings.analyzer.json"); - } - - // Check for CurrencyConverterApi Key - if (!this.PTMagicConfiguration.GeneralSettings.Application.FreeCurrencyConverterAPIKey.Equals("")) - { - this.Log.DoLogInfo("FreeCurrencyConverterApi KEY found"); - } - else - { - this.Log.DoLogInfo("No FreeCurrencyConverterApi KEY specified! You can't use non USD Currencies!"); - } + this.Log.DoLogInfo("Profit Trailer directory found"); + result = RunProfitTrailerSettingsAPIChecks(); } - catch (System.NullReferenceException ex) + else { - this.Log.DoLogError("PTM failed to read the Config File. That means something in the File is either missing or incorrect. If this happend after an update please take a look at the release notes at: https://github.com/PTMagicians/PTMagic/releases"); + this.Log.DoLogError("Profit Trailer directory not found (" + this.PTMagicConfiguration.GeneralSettings.Application.ProfitTrailerPath + ")"); + result = false; } + // Check for CoinMarketCap API Key + if (!this.PTMagicConfiguration.GeneralSettings.Application.CoinMarketCapAPIKey.Equals("")) + { + this.Log.DoLogInfo("CoinMarketCap API KEY found"); + } + else + { + this.Log.DoLogInfo("No CoinMarketCap API KEY specified! You can't use CoinMarketCap in your settings.analyzer.json"); + } + + // Check for CurrencyConverterApi Key + if (!this.PTMagicConfiguration.GeneralSettings.Application.FreeCurrencyConverterAPIKey.Equals("")) + { + this.Log.DoLogInfo("FreeCurrencyConverterApi KEY found"); + } + else + { + this.Log.DoLogInfo("No FreeCurrencyConverterApi KEY specified! You can't use non USD Currencies!"); + } } + else { this.Log.DoLogWarn("PTMagic disabled, shutting down..."); @@ -809,7 +802,7 @@ namespace Core.Main if (PTMagicConfiguration.GeneralSettings.Application.IsEnabled) { - + // Validate settings this.ValidateSettings();