当前位置: 首页>>代码示例>>Java>>正文


Java FloodRate类代码示例

本文整理汇总了Java中com.github.theholywaffle.teamspeak3.TS3Query.FloodRate的典型用法代码示例。如果您正苦于以下问题:Java FloodRate类的具体用法?Java FloodRate怎么用?Java FloodRate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FloodRate类属于com.github.theholywaffle.teamspeak3.TS3Query包,在下文中一共展示了FloodRate类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setFloodRate

import com.github.theholywaffle.teamspeak3.TS3Query.FloodRate; //导入依赖的package包/类
public TS3Config setFloodRate(FloodRate rate) {
	if (rate == null) throw new NullPointerException("rate cannot be null!");
	this.floodRate = rate;
	return this;
}
 
开发者ID:DiscowZombie,项目名称:UltimateTs,代码行数:6,代码来源:TS3Config.java

示例2: getFloodRate

import com.github.theholywaffle.teamspeak3.TS3Query.FloodRate; //导入依赖的package包/类
FloodRate getFloodRate() {
	return floodRate;
}
 
开发者ID:DiscowZombie,项目名称:UltimateTs,代码行数:4,代码来源:TS3Config.java

示例3: setFloodRate

import com.github.theholywaffle.teamspeak3.TS3Query.FloodRate; //导入依赖的package包/类
public TS3Config setFloodRate(FloodRate rate) {
	if (rate == null) throw new IllegalArgumentException("rate cannot be null!");
	this.floodRate = rate;
	return this;
}
 
开发者ID:TheHolyWaffle,项目名称:TeamSpeak-3-Java-API,代码行数:6,代码来源:TS3Config.java

示例4: QueryConnection

import com.github.theholywaffle.teamspeak3.TS3Query.FloodRate; //导入依赖的package包/类
/**
 * <p>
 * Creates new {@link QueryConnection} with specified creditnals and specified ip and nickname. To connect to query
 * server use {@link #connect()} method.
 * </p>
 * <p>
 * You can pass IP address of target server in format <code>AAA.BBB.CCC.DDD</code> or with port
 * <code>AAA.BBB.CCC.DDD:PORT</code>.
 * </p>
 * <p>
 * You should not use anti-flooding mechanism and rather add IP address from which will Bot connect to Teamspeak
 * server to server query whilelist.
 * </p>
 * <p>
 * It is reccomended to register events only in channels, where you really need to recieve events, auto-registering
 * all channels can be really slow on server with many channels.
 * </p>
 * 
 * @param creditnals
 *            {@link QueryCreditnals} creditnals used to authenticate
 * @param ip
 *            ip of query server in format <code>a.b.c.d</code> or <code>a.b.c.d:xyz</code>
 * @param nickname
 *            nickname to use when on server
 * @param preventFlood
 *            whether to use mechanism that should prevent query from disconecting because of flooding server
 *            (recommended <code>false</code>; server must has ip on query whilelist)
 * @param autoSubscribe
 *            whether the query should <b>register channel and channel chat events in all channels on server</b>
 *            (<b>on servers with many channels this can be slow</b>, and can slow down whole Bot; use only when
 *            really needed - spying channels or other stuff)
 */
public QueryConnection(@Nonnull final QueryCreditnals creditnals,
        @Nonnull final String ip, @Nonnull final String nickname,
        final boolean preventFlood, final boolean autoSubscribe) {
    
    this.config = new TS3Config();
    if (ip.contains(":")) {
        String[] parts = ip.split(Pattern.quote(":"));
        this.config.setHost(parts[0]);
        this.port = Integer.parseInt(parts[1]);
        this.config.setQueryPort(this.port);
    }
    else {
        this.config.setHost(ip);
    }
    if (preventFlood) {
        this.config.setFloodRate(FloodRate.DEFAULT);
    }
    else {
        this.config.setFloodRate(FloodRate.UNLIMITED);
    }
    this.autoSubscribe = autoSubscribe;
    this.config.setLoginCredentials(creditnals.getUsername(),
            creditnals.getPassword());
    this.config.setDebugLevel(Level.OFF);
    this.nickname = nickname;
}
 
开发者ID:dobrakmato,项目名称:Sergius,代码行数:59,代码来源:QueryConnection.java


注:本文中的com.github.theholywaffle.teamspeak3.TS3Query.FloodRate类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。