本文整理汇总了Java中com.github.theholywaffle.teamspeak3.api.reconnect.ReconnectStrategy类的典型用法代码示例。如果您正苦于以下问题:Java ReconnectStrategy类的具体用法?Java ReconnectStrategy怎么用?Java ReconnectStrategy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ReconnectStrategy类属于com.github.theholywaffle.teamspeak3.api.reconnect包,在下文中一共展示了ReconnectStrategy类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import com.github.theholywaffle.teamspeak3.api.reconnect.ReconnectStrategy; //导入依赖的package包/类
void initialize() {
this.config.setConnectionHandler(new SprummlbotConnectionHandler());
this.config.setReconnectStrategy(ReconnectStrategy.exponentialBackoff());
// Pre-connect initialization
switch (Vars.DEBUG) {
case 1:
config.setDebugLevel(Level.WARNING);
break;
case 2:
config.setDebugLevel(Level.ALL);
break;
default:
config.setDebugLevel(Level.OFF);
break;
}
if (Vars.DYNBANNER_ENABLED) {
try {
System.out.println("[Dynamic Banner] Initializing Dynamic Banner...");
if (!Vars.DYNBANNER_FILE.exists())
Exceptions.handle(new FileNotFoundException("Banner file doesnt exist"),
"Banner File doesn't exist", true);
Vars.DYNBANNER = new DynamicBanner(Vars.DYNBANNER_FILE, Vars.DYNBANNER_COLOR,
Vars.DYNBANNER_FONT);
} catch (IOException e) {
Exceptions.handle(e, "Error while initializing Dynamic Banner");
}
}
query = new TS3Query(config);
query.connect();
//Post connect initialization
Events.start();
}
示例2: setReconnectStrategy
import com.github.theholywaffle.teamspeak3.api.reconnect.ReconnectStrategy; //导入依赖的package包/类
public TS3Config setReconnectStrategy(ReconnectStrategy reconnectStrategy) {
if (reconnectStrategy == null) throw new NullPointerException("reconnectStrategy cannot be null!");
this.reconnectStrategy = reconnectStrategy;
return this;
}
示例3: getReconnectStrategy
import com.github.theholywaffle.teamspeak3.api.reconnect.ReconnectStrategy; //导入依赖的package包/类
ReconnectStrategy getReconnectStrategy() {
return reconnectStrategy;
}
示例4: setReconnectStrategy
import com.github.theholywaffle.teamspeak3.api.reconnect.ReconnectStrategy; //导入依赖的package包/类
public TS3Config setReconnectStrategy(ReconnectStrategy reconnectStrategy) {
if (reconnectStrategy == null) throw new IllegalArgumentException("reconnectStrategy cannot be null!");
this.reconnectStrategy = reconnectStrategy;
return this;
}