Skip to content
This repository was archived by the owner on Nov 24, 2018. It is now read-only.

Commit 6ff9131

Browse files
committed
Maintenance service config thingy
1 parent 8c210eb commit 6ff9131

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/main/java/net/olympiccode/vhackos/bot/core/misc/MaintenanceService.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package net.olympiccode.vhackos.bot.core.misc;
22

33
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;
47
import net.olympiccode.vhackos.bot.core.vHackOSBot;
58
import org.slf4j.Logger;
69
import org.slf4j.LoggerFactory;
@@ -34,17 +37,17 @@ public void setup() {
3437
int upAttempts = 0;
3538
@Override
3639
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) {
3841
miscAttempts++;
3942
LOG.info("Restarting MiscSerivce has it stopped due to an error (Attempt " + miscAttempts + ")");
4043
vHackOSBot.miscService.setup();
4144
}
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) {
4346
netAttempts++;
4447
LOG.info("Restarting NetworkingSerivce has it stopped due to an error (Attempt " + netAttempts + ")");
4548
vHackOSBot.networkingService.setup();
4649
}
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) {
4851
upAttempts++;
4952
LOG.info("Restarting UpdateSerivce has it stopped due to an error (Attempt " + upAttempts + ")");
5053
vHackOSBot.updateService.setup();

src/main/java/net/olympiccode/vhackos/bot/core/vHackOSBot.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class vHackOSBot {
4343
static Logger LOG = LoggerFactory.getLogger("vHackOSBot");
4444
ConfigFile config = new ConfigFile();
4545
AdvancedConfigFile advConfig = new AdvancedConfigFile();
46-
double curVersion = 1.9;
46+
double curVersion = 1.11;
4747
private long startTime = 0;
4848

4949
public static void main(String[] args) {

0 commit comments

Comments
 (0)