Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

Commit

Permalink
[-] Set Stats and Skills features to maintenance mode
Browse files Browse the repository at this point in the history
  • Loading branch information
hykilpikonna committed Apr 2, 2019
1 parent 141ebd9 commit a6d21a5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/main/java/cc/moecraft/icq/plugins/osubot/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public class Main extends IcqPlugin
{
public static final String CONTACT_INFO = "qq:565656";

// Stats和Skills维护
public static boolean disableStatsSkills;

@Getter
private static OsuBrowserManager browserManager;

Expand All @@ -53,6 +56,7 @@ public void onEnable()
getConfig().getString("IRC.Username"),
getConfig().getString("IRC.Password"));

disableStatsSkills = getConfig().getBoolean("Misc.DisableStatSkills");
init(getLogger());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public File render(OPABeatmapData beatmapData, OWAUserData userData, OPAUserRece
loadHtml(html);
sleep(1000);
setRunning(false);
return render(0, 0, 1142, 142); //TODO: change dis
return render(0, 0, 1142, 142); //TODO: change this
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public CommandSkills()
@Override
public String runOsu(EventMessage event, User user, String command, ArrayList<String> args) throws Exception
{
if (Main.disableStatsSkills) return "";

long startTime = System.currentTimeMillis();

String username = getDatabasedUsername(args, 0, user);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@
import cc.moecraft.icq.plugins.osubot.Main;
import cc.moecraft.icq.plugins.osubot.browser.browsers.StatsBrowser;
import cc.moecraft.icq.plugins.osubot.commands.OsuCommandBase;
import cc.moecraft.icq.plugins.osubot.osu.exceptions.UserNotFoundException;
import cc.moecraft.icq.plugins.osubot.osu.webapi.OWAUserData;
import cc.moecraft.icq.plugins.osubot.osu.webapi.OWAUtils;
import cc.moecraft.icq.user.User;
import cc.moecraft.utils.ArrayUtils;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;

/**
Expand All @@ -33,6 +30,8 @@ public CommandStats()
@Override
public String runOsu(EventMessage event, User user, String command, ArrayList<String> args) throws Exception
{
if (Main.disableStatsSkills) return "";

long startTime = System.currentTimeMillis();

String username = getDatabasedUsername(args, 0, user);
Expand All @@ -56,6 +55,6 @@ public String help(String command)
@Override
public CommandProperties properties()
{
return new CommandProperties("stats", "me", "home", "stat");
return new CommandProperties("stats", "home", "stat");
}
}
3 changes: 3 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Encoding:
Force: true
Encoding: utf-8

Misc:
DisableWebAPI: false

#-----------------------------------------------#
# Database section is deprecated. #
# You'll have to configure your database in #
Expand Down

0 comments on commit a6d21a5

Please sign in to comment.