|
1 | 1 | package net.olympiccode.vhackos.bot.core.misc;
|
2 | 2 |
|
3 | 3 | import net.olympiccode.vhackos.bot.core.BotService;
|
| 4 | +import net.olympiccode.vhackos.bot.core.config.ConfigValues; |
| 5 | +import net.olympiccode.vhackos.bot.core.networking.NetworkingConfigValues; |
| 6 | +import net.olympiccode.vhackos.bot.core.updating.UpdateConfigValues; |
4 | 7 | import net.olympiccode.vhackos.bot.core.vHackOSBot;
|
5 | 8 | import org.slf4j.Logger;
|
6 | 9 | import org.slf4j.LoggerFactory;
|
@@ -34,17 +37,17 @@ public void setup() {
|
34 | 37 | int upAttempts = 0;
|
35 | 38 | @Override
|
36 | 39 | public void runService() {
|
37 |
| - if (vHackOSBot.miscService.miscService.isTerminated() || vHackOSBot.miscService.miscService.isTerminated() && miscAttempts < 4) { |
| 40 | + if (MiscConfigValues.enabled && (vHackOSBot.miscService.miscService.isTerminated() || vHackOSBot.miscService.miscService.isTerminated()) && miscAttempts < 4) { |
38 | 41 | miscAttempts++;
|
39 | 42 | LOG.info("Restarting MiscSerivce has it stopped due to an error (Attempt " + miscAttempts + ")");
|
40 | 43 | vHackOSBot.miscService.setup();
|
41 | 44 | }
|
42 |
| - if (vHackOSBot.networkingService.getService().isTerminated() || vHackOSBot.networkingService.getService().isTerminated() && netAttempts < 4) { |
| 45 | + if (NetworkingConfigValues.enabled && (vHackOSBot.networkingService.getService().isTerminated() || vHackOSBot.networkingService.getService().isTerminated()) && netAttempts < 4) { |
43 | 46 | netAttempts++;
|
44 | 47 | LOG.info("Restarting NetworkingSerivce has it stopped due to an error (Attempt " + netAttempts + ")");
|
45 | 48 | vHackOSBot.networkingService.setup();
|
46 | 49 | }
|
47 |
| - if (vHackOSBot.updateService.getService().isTerminated() || vHackOSBot.updateService.getService().isTerminated() && upAttempts < 4) { |
| 50 | + if (UpdateConfigValues.enabled && (vHackOSBot.updateService.getService().isTerminated() || vHackOSBot.updateService.getService().isTerminated()) && upAttempts < 4) { |
48 | 51 | upAttempts++;
|
49 | 52 | LOG.info("Restarting UpdateSerivce has it stopped due to an error (Attempt " + upAttempts + ")");
|
50 | 53 | vHackOSBot.updateService.setup();
|
|
0 commit comments