feat: 添加重试失败后继续重试

Signed-off-by: 502647092 <admin@yumc.pw>
vbauth
502647092 2016-09-28 13:55:37 +08:00
parent 76e73b5c25
commit 43b8d43254
4 changed files with 9 additions and 2 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>pw.yumc</groupId> <groupId>pw.yumc</groupId>
<artifactId>MiaoLobby</artifactId> <artifactId>MiaoLobby</artifactId>
<version>1.0</version> <version>1.2</version>
<build> <build>
<finalName>${project.name}</finalName> <finalName>${project.name}</finalName>
<resources> <resources>

View File

@ -19,4 +19,5 @@ public class Config extends InjectConfig {
public String Unavailable; public String Unavailable;
public Boolean AuthMeAutoTP; public Boolean AuthMeAutoTP;
public Integer AutoTPDelay; public Integer AutoTPDelay;
public Boolean ReTry;
} }

View File

@ -70,6 +70,10 @@ public class MiaoLobby extends JavaPlugin implements CommandExecutor {
@Override @Override
public void run() { public void run() {
if (servers.isEmpty()) { if (servers.isEmpty()) {
if (config.ReTry) {
servers.addAll(config.Servers);
return;
}
C.ActionBar.send(player, config.Unavailable); C.ActionBar.send(player, config.Unavailable);
player.sendMessage(config.Unavailable); player.sendMessage(config.Unavailable);
} else if (player.isOnline()) { } else if (player.isOnline()) {

View File

@ -1,5 +1,5 @@
#配置文件版本 请勿修改 #配置文件版本 请勿修改
Version: 1.1 Version: 1.2
#数据库信息 #数据库信息
Servers: Servers:
@ -11,6 +11,8 @@ WaitTime: 35
AuthMeAutoTP: true AuthMeAutoTP: true
#自动登录延时(单位: 秒) #自动登录延时(单位: 秒)
AutoTPDelay: 10 AutoTPDelay: 10
#尝试完毕后是否继续重试
ReTry: true
#传送提示 #传送提示
Message: '&a请稍候 正在传送至服务器 %s ...' Message: '&a请稍候 正在传送至服务器 %s ...'
TimeOut: '&c传送超时 正在切换到服务器 %s ...' TimeOut: '&c传送超时 正在切换到服务器 %s ...'