Skip to content

Commit

Permalink
添加debug模式
Browse files Browse the repository at this point in the history
  • Loading branch information
R-Josef committed Feb 25, 2021
1 parent 6751bd2 commit 483cb39
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>moe.feo</groupId>
<artifactId>BBSToper</artifactId>
<version>3.6.3</version>
<version>3.6.4</version>
<repositories>
<repository>
<id>spigot-repo</id>
Expand Down
3 changes: 3 additions & 0 deletions resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#请定期检查这些网址以获取可用的更新
#Copyright © 2018-2020 R_Josef 版权所有

#DEBUG模式
debug: false

#数据库设置
database:
#表名前缀, 在sqlite和mysql都有效
Expand Down
2 changes: 1 addition & 1 deletion resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: BBSToper
main: moe.feo.bbstoper.BBSToper
version: 3.6.3
version: 3.6.4
author: Fengshuai(R_Josef)
website: https://www.mcbbs.net/thread-789082-1-1.html
softdepend: [PlaceholderAPI]
Expand Down
4 changes: 3 additions & 1 deletion src/moe/feo/bbstoper/Crawler.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public void resolveWebData() {
try {
doc = Jsoup.connect(url).get();
} catch (IOException e) {
//e.printStackTrace(); // 这里经常会因为网络连接不顺畅而报错
if (Option.DEBUG.getBoolean()) {
e.printStackTrace(); // 这里经常会因为网络连接不顺畅而报错
}
BBSToper.getInstance().getLogger().warning(Message.FAILEDGETWEB.getString());
return;// 没抓到网页就不要继续了,会空指针
}
Expand Down
16 changes: 8 additions & 8 deletions src/moe/feo/bbstoper/Option.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
import org.bukkit.configuration.file.YamlConfiguration;

public enum Option {
DATABASE_TYPE("database.type"), DATABASE_PREFIX("database.prefix"), DATABASE_TIMINGRECONNECT("timingreconnect"),
DATABASE_MYSQL_IP("database.mysql.ip"), DATABASE_MYSQL_PORT("database.mysql.port"),
DATABASE_MYSQL_DATABASE("database.mysql.database"), DATABASE_MYSQL_USER("database.mysql.user"),
DATABASE_MYSQL_PASSWORD("database.mysql.password"), DATABASE_MYSQL_SSL("database.mysql.ssl"),
DATABASE_SQLITE_FOLDER("database.sqlite.folder"), DATABASE_SQLITE_DATABASE("database.sqlite.database"),
MCBBS_URL("mcbbs.url"), MCBBS_PAGESIZE("mcbbs.pagesize"), MCBBS_CHANGEIDCOOLDOWN("mcbbs.changeidcooldown"),
MCBBS_JOINMESSAGE("mcbbs.joinmessage"), GUI_TOPPLAYERS("gui.topplayers"),
GUI_DISPLAYHEADSKIN("gui.displayheadskin"), GUI_USECHATGETID("gui.usechatgetid"),
DEBUG("debug"), DATABASE_TYPE("database.type"), DATABASE_PREFIX("database.prefix"),
DATABASE_TIMINGRECONNECT("timingreconnect"), DATABASE_MYSQL_IP("database.mysql.ip"),
DATABASE_MYSQL_PORT("database.mysql.port"), DATABASE_MYSQL_DATABASE("database.mysql.database"),
DATABASE_MYSQL_USER("database.mysql.user"), DATABASE_MYSQL_PASSWORD("database.mysql.password"),
DATABASE_MYSQL_SSL("database.mysql.ssl"), DATABASE_SQLITE_FOLDER("database.sqlite.folder"),
DATABASE_SQLITE_DATABASE("database.sqlite.database"), MCBBS_URL("mcbbs.url"), MCBBS_PAGESIZE("mcbbs.pagesize"),
MCBBS_CHANGEIDCOOLDOWN("mcbbs.changeidcooldown"), MCBBS_JOINMESSAGE("mcbbs.joinmessage"),
GUI_TOPPLAYERS("gui.topplayers"), GUI_DISPLAYHEADSKIN("gui.displayheadskin"), GUI_USECHATGETID("gui.usechatgetid"),
GUI_CANCELKEYWORDS("gui.cancelkeywords"), REWARD_AUTO("reward.auto"), REWARD_PERIOD("reward.period"),
REWARD_INTERVAL("reward.interval"), REWARD_TIMES("reward.times"), REWARD_COMMANDS("reward.commands"),
REWARD_INCENTIVEREWARD_ENABLE("reward.incentivereward.enable"),
Expand Down

0 comments on commit 483cb39

Please sign in to comment.