• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ServerDisableException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: onFirst

import fr.evercraft.everapi.exception.ServerDisableException; //导入依赖的package包/类
protected void onFirst() throws PluginDisableException, ServerDisableException {
	TypeSerializers.getDefaultSerializers().registerType(TypeToken.of(EMessageBuilder.class), new EMessageBuilderSerializer(this));
	TypeSerializers.getDefaultSerializers().registerType(TypeToken.of(EFormat.class), new EFormatSerializer());
	
	this.threadAsync = this.getGame().getScheduler().createAsyncExecutor(this);
	this.threadSync = this.getGame().getScheduler().createSyncExecutor(this);
	
	this.chat = new EChat(this);
	this.configs = new EAConfig(this);
	
	this.messages = new EAMessage(this);
	this.server = new EServer(this);
	this.managerUtils = new ManagerUtils(this);
	this.service = new ManagerService(this);
	new ManagerRegister(this);
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:17,代码来源:EverAPI.java


示例2: getConnection

import fr.evercraft.everapi.exception.ServerDisableException; //导入依赖的package包/类
public Connection getConnection() throws ServerDisableException {
Connection connection = null;
int cpt = 1;
while(cpt <= MAX_TRY && connection == null) {
	Chronometer chronometer = new Chronometer();
	try {
		connection = this.sql.getDataSource(this.url).getConnection();
		this.plugin.getELogger().debug("SQL : Connection in " + chronometer.getMilliseconds() + " ms");
	} catch (Exception e) {
		this.plugin.getELogger().warn("SQL : Error in connection " + cpt + " : " + e.getMessage());
	}
	cpt++;
}

if (connection == null) {
	this.enable = false;
	throw new ServerDisableException(this.plugin, "Unable to connect to the database : (plugin='" + this.plugin.getName() + ")");
}

return connection;
  }
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:22,代码来源:EDataBase.java


示例3: processExecute

import fr.evercraft.everapi.exception.ServerDisableException; //导入依赖的package包/类
private CommandResult processExecute(final CommandSource source, final String argument) throws CommandException, PluginDisableException, ServerDisableException, EMessageException {
	Chronometer chronometer = new Chronometer();
	
	List<String> arguments = this.getArg(argument);
	if (source instanceof Player) {
		this.processPlayer((Player) source, argument, arguments);
	} else {
		this.execute(source, arguments)
			.exceptionally(e -> {
				EAMessages.COMMAND_ERROR.sender()
					.prefix(this.plugin.getMessages().getPrefix())
					.sendTo(source);
				this.plugin.getELogger().warn("CompletableFuture : " + e.getMessage());
				e.printStackTrace();
				return false;
			})
			.thenAcceptAsync(result -> this.sources.remove(source.getIdentifier()), 
				this.plugin.getGame().getScheduler().createSyncExecutor(this.plugin));
	}
	
	this.plugin.getELogger().debug("The command '" + this.getName() + "' with arguments '" + argument + "' was to execute in " +  chronometer.getMilliseconds().toString() + " ms");
       return CommandResult.success();
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:24,代码来源:ECommand.java


示例4: processPlayer

import fr.evercraft.everapi.exception.ServerDisableException; //导入依赖的package包/类
private void processPlayer(final Player source, final String arg, final List<String> args) throws CommandException, PluginDisableException, ServerDisableException, EMessageException {
	EPlayer player = this.plugin.getEServer().getEPlayer(source);
	if (player.isDead()) {
		EAMessages.COMMAND_ERROR_PLAYER_DEAD.sender()
			.prefix(this.plugin.getMessages().getPrefix())
			.sendTo(source);
	}
	
	if (!this.plugin.getGame().getEventManager().post(ESpongeEventFactory.createCommandEventSend(player, this.getName(), arg, args, Cause.source(this.plugin).build()))) {
		this.execute(player, args)
			.exceptionally(e -> {
				EAMessages.COMMAND_ERROR.sender()
					.prefix(this.plugin.getMessages().getPrefix())
					.sendTo(source);
				this.plugin.getELogger().warn("CompletableFuture : " + e.getMessage());
				e.printStackTrace();
				return false;
			})
			.thenAcceptAsync(result -> {
				this.sources.remove(player.getIdentifier());
				this.plugin.getGame().getEventManager().post(ESpongeEventFactory.createCommandEventResult(player, this.getName(), arg, args, result, Cause.source(this.plugin).build()));
			}, this.plugin.getThreadSync());
	}
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:25,代码来源:ECommand.java


示例5: commandDeleteWarpConfirmation

import fr.evercraft.everapi.exception.ServerDisableException; //导入依赖的package包/类
private CompletableFuture<Boolean> commandDeleteWarpConfirmation(final EPlayer player, final String warp_name) throws ServerDisableException {
	String name = EChat.fixLength(warp_name, this.plugin.getEverAPI().getConfigs().getMaxCaractere());
	
	Optional<Transform<World>> warp = this.plugin.getWarp().get(name);
	// Le serveur n'a pas de warp qui porte ce nom
	if (!warp.isPresent()) {
		EEMessages.DELWARP_INCONNU.sender()
			.replace("{warp}", name)
			.sendTo(player);
		return CompletableFuture.completedFuture(false);
	}
	
	// Le warp n'a pas été supprimer
	if (!this.plugin.getWarp().remove(name)) {
		EEMessages.DELWARP_CANCEL.sender()
			.replace("{warp}", name)
			.sendTo(player);
		return CompletableFuture.completedFuture(false);
	}
	
	EEMessages.DELWARP_DELETE.sender()
		.replace("{warp}", () -> this.getButtonWarp(name, warp.get()))
		.sendTo(player);
	return CompletableFuture.completedFuture(true);
}
 
开发者ID:EverCraft,项目名称:EverEssentials,代码行数:26,代码来源:EEWarpDel.java


示例6: execute

import fr.evercraft.everapi.exception.ServerDisableException; //导入依赖的package包/类
@Override
public CompletableFuture<Boolean> execute(final CommandSource source, final List<String> args) throws CommandException, ServerDisableException {
	if (args.size() == 1) {
		// Si la source est un joueur
		if (source instanceof EPlayer) {
			return this.commandSetWarp((EPlayer) source, args.get(0)); 
		// La source n'est pas un joueur
		} else {
			EAMessages.COMMAND_ERROR_FOR_PLAYER.sender()
				.prefix(EEMessages.PREFIX)
				.sendTo(source);
		}
	// Nombre d'argument incorrect
	} else {
		source.sendMessage(this.help(source));
	}
	return CompletableFuture.completedFuture(false);
}
 
开发者ID:EverCraft,项目名称:EverEssentials,代码行数:19,代码来源:EEWarpSet.java


示例7: init

import fr.evercraft.everapi.exception.ServerDisableException; //导入依赖的package包/类
public boolean init() throws ServerDisableException {
	this.table_account = "account";
	String account = 	"CREATE TABLE IF NOT EXISTS {table} (" +
						"`identifier` varchar(36) NOT NULL," +
						"`currency` varchar(36) NOT NULL," +
						"`balance` DECIMAL NOT NULL," +
						"PRIMARY KEY (`identifier`, `currency`));";
	initTable(this.getTableAccount(), account);
	
	this.table_log = "log";
	String log = 		"CREATE TABLE IF NOT EXISTS {table} (" +
						"`id` MEDIUMINT NOT NULL AUTO_INCREMENT," +
						"`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP," +
						"`identifier` varchar(36) NOT NULL," +
						"`currency` varchar(36) NOT NULL," +
						"`before` DECIMAL NOT NULL," +
						"`after` DECIMAL NOT NULL," +
						"`transaction` varchar(50) NOT NULL," +
						"`to` varchar(36)," +
						"`cause` varchar(255) NOT NULL," +
						"PRIMARY KEY (`id`));";
	initTable(this.getTableLog(), log);
	
	return true;
}
 
开发者ID:EverCraft,项目名称:EverEconomy,代码行数:26,代码来源:EEDataBase.java


示例8: onReload

import fr.evercraft.everapi.exception.ServerDisableException; //导入依赖的package包/类
@Override
protected void onReload() throws PluginDisableException, ServerDisableException {
	super.onReload();
	
	this.service.reload();
	this.managerUtils.reload();
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:8,代码来源:EverAPI.java


示例9: testConnection

import fr.evercraft.everapi.exception.ServerDisableException; //导入依赖的package包/类
public boolean testConnection() {
  	boolean valide = false;
  	try {
  		valide = init();
} catch (ServerDisableException e) {
	this.plugin.getELogger().warn("SQL : Error in initialize : " + e.getMessage());
}
  	return valide;
  }
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:10,代码来源:EDataBase.java


示例10: setupEverAPI

import fr.evercraft.everapi.exception.ServerDisableException; //导入依赖的package包/类
/**
 * Initialise le plugin EverAPI
 * @return True si le plugin EverAPI est activé
 * @throws ServerDisableException 
 */
protected void setupEverAPI() throws ServerDisableException {
	Optional<PluginContainer> plugin = this.game.getPluginManager().getPlugin("everapi");
	if (plugin.isPresent()) {
		Optional<?> everapi = plugin.get().getInstance();
		if (everapi.isPresent() && everapi.get() instanceof EverAPI) {
			this.everapi = (EverAPI) everapi.get();
		} else {
			throw new ServerDisableException(this, "Le plugin EverAPI n'est pas activé");
		}
	} else {
		throw new ServerDisableException(this, "Le plugin EverAPI n'est pas sur le serveur");
	}
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:19,代码来源:EPlugin.java


示例11: onReload

import fr.evercraft.everapi.exception.ServerDisableException; //导入依赖的package包/类
@Override
protected void onReload() throws PluginDisableException, ServerDisableException {
	this.scheduler.stop();
	
	super.onReload();
	this.databases.reload();
	
	this.essentials.reload();
	this.warp.reload();
	this.spawn.reload();
	
	this.scheduler.reload();
	
	this.scheduler.start();
}
 
开发者ID:EverCraft,项目名称:EverEssentials,代码行数:16,代码来源:EverEssentials.java


示例12: execute

import fr.evercraft.everapi.exception.ServerDisableException; //导入依赖的package包/类
@Override
public CompletableFuture<Boolean> execute(final CommandSource source, final List<String> args) throws CommandException, ServerDisableException {
	// Si on ne connait pas le joueur
	if (args.size() == 1) {
		return this.commandDeleteWarp((EPlayer) source, args.get(0));
	} else if (args.size() == 2 && args.get(1).equalsIgnoreCase("confirmation")) {
		return this.commandDeleteWarpConfirmation((EPlayer) source, args.get(0));
	// Nombre d'argument incorrect
	} else {
		source.sendMessage(this.help(source));
	}
	
	return CompletableFuture.completedFuture(false);
}
 
开发者ID:EverCraft,项目名称:EverEssentials,代码行数:15,代码来源:EEWarpDel.java


示例13: commandSetWarp

import fr.evercraft.everapi.exception.ServerDisableException; //导入依赖的package包/类
private CompletableFuture<Boolean> commandSetWarp(final EPlayer player, final String warp_name) throws ServerDisableException {
	String name = EChat.fixLength(warp_name, this.plugin.getEverAPI().getConfigs().getMaxCaractere());
	
	Optional<Transform<World>> warp = this.plugin.getWarp().get(name);
	if (warp.isPresent()) {
		if (this.plugin.getWarp().update(name, player.getTransform())) {
			EEMessages.SETWARP_REPLACE.sender()
				.replace("{warp}", () -> this.getButtonWarp(name, player.getLocation()))
				.sendTo(player);
			return CompletableFuture.completedFuture(true);
		} else {
			EEMessages.SETWARP_REPLACE_CANCEL.sender()
				.replace("{warp}", name)
				.sendTo(player);
		}
	} else {
		if (this.plugin.getWarp().add(name, player.getTransform())) {
			EEMessages.SETWARP_NEW.sender()
				.replace("{warp}", () -> this.getButtonWarp(name, player.getLocation()))
				.sendTo(player);
			return CompletableFuture.completedFuture(true);
		} else {
			EEMessages.SETWARP_NEW_CANCEL.sender()
				.replace("{warp}", name)
				.sendTo(player);
		}
	}
	return CompletableFuture.completedFuture(false);
}
 
开发者ID:EverCraft,项目名称:EverEssentials,代码行数:30,代码来源:EEWarpSet.java


示例14: execute

import fr.evercraft.everapi.exception.ServerDisableException; //导入依赖的package包/类
@Override
public CompletableFuture<Boolean> execute(final CommandSource source, final List<String> args) throws CommandException, ServerDisableException {
	// Si on ne connait pas le joueur
	if (args.size() == 1) {
		return this.execute((EPlayer) source, args.get(0), false);
	} else if (args.size() == 2 && args.get(1).equalsIgnoreCase("confirmation")) {
		return this.execute((EPlayer) source, args.get(0), true);
	// Nombre d'argument incorrect
	} else {
		source.sendMessage(this.help(source));
	}
	return CompletableFuture.completedFuture(false);
}
 
开发者ID:EverCraft,项目名称:EverEssentials,代码行数:14,代码来源:EESpawnDel.java


示例15: init

import fr.evercraft.everapi.exception.ServerDisableException; //导入依赖的package包/类
public boolean init() throws ServerDisableException {
	String profils ="CREATE TABLE IF NOT EXISTS {table} (" +
						"`uuid` varchar(36) NOT NULL," +
						"`collection` varchar(36)," +
						"`name` varchar(36)," +
						"PRIMARY KEY (`uuid`, `collection`, `name`));";
	initTable(this.getTableUsersProfiles(), profils);
	
	String permissions ="CREATE TABLE IF NOT EXISTS {table} (" +
						"`uuid` varchar(36) NOT NULL," +
						"`collection` varchar(36)," +
						"`world` varchar(36)," +
						"`permission` varchar(100) NOT NULL," +
						"`boolean` BOOLEAN NOT NULL," +
						"PRIMARY KEY (`uuid`, `collection`, `world`, `permission`));";
	initTable(this.getTableUsersPermissions(), permissions);
	
	String groups =		"CREATE TABLE IF NOT EXISTS {table} (" +
						"`uuid` varchar(36) NOT NULL," +
						"`collection` varchar(36)," +
						"`world` varchar(36)," +
						"`group` varchar(36) NOT NULL," +
						"`priority` INT NOT NULL AUTO_INCREMENT," +
						"PRIMARY KEY (`uuid`, `collection`, `world`, `group`, `priority`));";
	initTable(this.getTableUsersGroups(), groups);
	
	String spawns = 	"CREATE TABLE IF NOT EXISTS {table} (" +
						"`uuid` varchar(36) NOT NULL," +
						"`collection` varchar(36)," +
						"`world` varchar(36) NOT NULL," +
						"`option` varchar(50) NOT NULL," +
						"`value` varchar(100) NOT NULL," +
						"PRIMARY KEY (`uuid`, `collection`, `world`, `option`));";
	initTable(this.getTableUsersOptions(), spawns);		
	return true;
}
 
开发者ID:EverCraft,项目名称:EverPermissions,代码行数:37,代码来源:EPDataBases.java


示例16: onPreEnable

import fr.evercraft.everapi.exception.ServerDisableException; //导入依赖的package包/类
@Override
protected void onPreEnable() throws PluginDisableException, ServerDisableException {
	this.config = new EPConfig(this);
	this.messages = new EPMessage(this);
	
	this.database = new EPDataBases(this);
	
	this.service = new EPPermissionService(this);
	this.service.load();
	this.getGame().getServiceManager().setProvider(this, PermissionService.class, this.service);
}
 
开发者ID:EverCraft,项目名称:EverPermissions,代码行数:12,代码来源:EverPermissions.java


示例17: onReload

import fr.evercraft.everapi.exception.ServerDisableException; //导入依赖的package包/类
@Override
protected void onReload() throws PluginDisableException, ServerDisableException{
	super.onReload();
	
	this.databases.reload();

	// Economy
	this.service.reload();
	
	if (!this.getEverAPI().getManagerService().getEconomy().isPresent()){
		throw new PluginDisableException("Il n'y a pas de système d'économie !");
	}
}
 
开发者ID:EverCraft,项目名称:EverEconomy,代码行数:14,代码来源:EverEconomy.java


示例18: onReload

import fr.evercraft.everapi.exception.ServerDisableException; //导入依赖的package包/类
protected void onReload() throws PluginDisableException, ServerDisableException {
	super.onReload();
	
	this.database.reload();
	this.ban_service.reload();
	this.jail_service.reload();
}
 
开发者ID:EverCraft,项目名称:EverSanctions,代码行数:8,代码来源:EverSanctions.java


示例19: onReload

import fr.evercraft.everapi.exception.ServerDisableException; //导入依赖的package包/类
protected void onReload() throws PluginDisableException, ServerDisableException {
	super.onReload();
}
 
开发者ID:EverCraft,项目名称:EverKits,代码行数:4,代码来源:EverKits.java


示例20: onReload

import fr.evercraft.everapi.exception.ServerDisableException; //导入依赖的package包/类
protected void onReload() throws PluginDisableException, ServerDisableException {
	this.reloadConfigurations();
	this.reloadCommands();
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:5,代码来源:EPlugin.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CLICommandCacheAdmin类代码示例发布时间:2022-05-22
下一篇:
Java GvrActivity类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap