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

Commit

Permalink
Maintenance service config thingy
Browse files Browse the repository at this point in the history
  • Loading branch information
itsfolf committed Apr 1, 2018
1 parent 8c210eb commit 6ff9131
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package net.olympiccode.vhackos.bot.core.misc;

import net.olympiccode.vhackos.bot.core.BotService;
import net.olympiccode.vhackos.bot.core.config.ConfigValues;
import net.olympiccode.vhackos.bot.core.networking.NetworkingConfigValues;
import net.olympiccode.vhackos.bot.core.updating.UpdateConfigValues;
import net.olympiccode.vhackos.bot.core.vHackOSBot;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -34,17 +37,17 @@ public void setup() {
int upAttempts = 0;
@Override
public void runService() {
if (vHackOSBot.miscService.miscService.isTerminated() || vHackOSBot.miscService.miscService.isTerminated() && miscAttempts < 4) {
if (MiscConfigValues.enabled && (vHackOSBot.miscService.miscService.isTerminated() || vHackOSBot.miscService.miscService.isTerminated()) && miscAttempts < 4) {
miscAttempts++;
LOG.info("Restarting MiscSerivce has it stopped due to an error (Attempt " + miscAttempts + ")");
vHackOSBot.miscService.setup();
}
if (vHackOSBot.networkingService.getService().isTerminated() || vHackOSBot.networkingService.getService().isTerminated() && netAttempts < 4) {
if (NetworkingConfigValues.enabled && (vHackOSBot.networkingService.getService().isTerminated() || vHackOSBot.networkingService.getService().isTerminated()) && netAttempts < 4) {
netAttempts++;
LOG.info("Restarting NetworkingSerivce has it stopped due to an error (Attempt " + netAttempts + ")");
vHackOSBot.networkingService.setup();
}
if (vHackOSBot.updateService.getService().isTerminated() || vHackOSBot.updateService.getService().isTerminated() && upAttempts < 4) {
if (UpdateConfigValues.enabled && (vHackOSBot.updateService.getService().isTerminated() || vHackOSBot.updateService.getService().isTerminated()) && upAttempts < 4) {
upAttempts++;
LOG.info("Restarting UpdateSerivce has it stopped due to an error (Attempt " + upAttempts + ")");
vHackOSBot.updateService.setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class vHackOSBot {
static Logger LOG = LoggerFactory.getLogger("vHackOSBot");
ConfigFile config = new ConfigFile();
AdvancedConfigFile advConfig = new AdvancedConfigFile();
double curVersion = 1.9;
double curVersion = 1.11;
private long startTime = 0;

public static void main(String[] args) {
Expand Down

0 comments on commit 6ff9131

Please sign in to comment.