add reconnect delay to each bot option (optional)
This commit is contained in:
@@ -69,6 +69,7 @@ public class Bot {
|
||||
this.port = botOption.port;
|
||||
|
||||
this.options = botOption;
|
||||
if (options.reconnectDelay == -1) options.reconnectDelay = config.reconnectDelay;
|
||||
|
||||
this.allBots = allBots;
|
||||
|
||||
@@ -172,7 +173,7 @@ public class Bot {
|
||||
public void disconnected(DisconnectedEvent disconnectedEvent) {
|
||||
loggedIn = false;
|
||||
|
||||
int reconnectDelay = config.reconnectDelay();
|
||||
int reconnectDelay = options.reconnectDelay();
|
||||
|
||||
final String stringMessage = ComponentUtilities.stringify(disconnectedEvent.getReason());
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ public class Configuration {
|
||||
|
||||
@Getter public Map<String, String> consolePrefixes;
|
||||
|
||||
@Getter public int reconnectDelay = 7000;
|
||||
@Getter public int reconnectDelay = 2000;
|
||||
|
||||
@Getter public Map<String, String> keys;
|
||||
|
||||
@@ -83,5 +83,6 @@ public class Configuration {
|
||||
@Getter @Setter public boolean useCore = true;
|
||||
@Getter @Setter public boolean useChat = false;
|
||||
@Getter public boolean hasEssentials = true;
|
||||
@Getter public int reconnectDelay = -1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user