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


Java RequestException类代码示例

本文整理汇总了Java中lilypad.client.connect.api.request.RequestException的典型用法代码示例。如果您正苦于以下问题:Java RequestException类的具体用法?Java RequestException怎么用?Java RequestException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: LilyPadWrapper

import lilypad.client.connect.api.request.RequestException; //导入依赖的package包/类
public LilyPadWrapper(@Nonnull Connect connect) {
    this.connect = connect;

    messenger = new AbstractMessenger(
            (channel, message) -> {
                try {
                    connect.request(new MessageRequest(Collections.emptyList(), channel, message));
                } catch (RequestException | UnsupportedEncodingException e) {
                    e.printStackTrace();
                }
            },
            channel -> {
                if (listening.getAndSet(true)) {
                    return;
                }
                try {
                    connect.registerEvents(this);
                } catch (Exception e) {
                    listening.set(false);
                }
            },
            channel -> {}
    );
}
 
开发者ID:lucko,项目名称:helper,代码行数:25,代码来源:LilyPadWrapper.java

示例2: exec

import lilypad.client.connect.api.request.RequestException; //导入依赖的package包/类
@Override
public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException {
	String username, password, key;
	if (args.length == 1) {
		ConnectSettings settings = CHLilyPadStatic.getConnect(t).getSettings();
		username = settings.getUsername();
		password = settings.getPassword();
		key = args[0].val();
	} else {
		username = args[0].val();
		password = args[1].val();
		key = args[2].val();
	}
	try {
		return CHLilyPadStatic.evaluate(CHLilyPadStatic.getConnect(t).request(new AuthenticateRequest(username, password, key)).awaitUninterruptibly(), t);
	} catch (RequestException ex) {
		throw new ConfigRuntimeException(ex.getMessage(), Exceptions.ExceptionType.PluginInternalException, t);
	}
}
 
开发者ID:King-Fisher,项目名称:CHLilyPad,代码行数:20,代码来源:LilyPadFunctions.java

示例3: redirectPlayer

import lilypad.client.connect.api.request.RequestException; //导入依赖的package包/类
@Override
public void redirectPlayer(@Nonnull String serverId, @Nonnull String playerUsername) {
    try {
        connect.request(new RedirectRequest(serverId, playerUsername));
    } catch (RequestException e) {
        e.printStackTrace();
    }
}
 
开发者ID:lucko,项目名称:helper,代码行数:9,代码来源:LilyPadWrapper.java

示例4: resendLocalPlayers

import lilypad.client.connect.api.request.RequestException; //导入依赖的package包/类
public void resendLocalPlayers() throws RequestException {		
	this.localPlayersLock.lock();
	try {
		for(String player : this.localPlayers) {
			this.connect.request(new NotifyPlayerRequest(true, player));
		}
	} finally {
		this.localPlayersLock.unlock();
	}
}
 
开发者ID:LilyPad,项目名称:JLilyPad,代码行数:11,代码来源:ConnectPlayerCallback.java

示例5: notifyPlayerLeave

import lilypad.client.connect.api.request.RequestException; //导入依赖的package包/类
public void notifyPlayerLeave(String player) {
	this.localPlayersLock.lock();
	try {
		this.localPlayers.remove(player);
	} finally {
		this.localPlayersLock.unlock();
	}
	try {
		this.connect.request(new NotifyPlayerRequest(false, player));
	} catch(RequestException exception) {
		// ignore
	}
}
 
开发者ID:LilyPad,项目名称:JLilyPad,代码行数:14,代码来源:ConnectPlayerCallback.java

示例6: queryPlayers

import lilypad.client.connect.api.request.RequestException; //导入依赖的package包/类
public boolean queryPlayers() throws RequestException, InterruptedException {
	GetPlayersResult result = this.connect.request(new GetPlayersRequest(false)).await(10000L);
	if(result == null) {
		return false;
	}
	this.playerCount = result.getCurrentPlayers();
	this.playerMaximum = result.getMaximumPlayers();
	return true;
}
 
开发者ID:LilyPad,项目名称:JLilyPad,代码行数:10,代码来源:ConnectPlayerCallback.java


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