Esempio n. 1
0
	private void handleQuit(PlayerEvent e) {
		SpleefPlayer player = HeavySpleef.getInstance().getSpleefPlayer(e.getPlayer());

		if (player == null)
			return;
		if (!QueuesManager.hasQueue(player))
			return;

		// Remove the player from the queue if he quits
		QueuesManager.removeFromQueue(player);
	}
Esempio n. 2
0
	private void handleQuit(PlayerEvent e) {
		SpleefPlayer player = HeavySpleef.getInstance().getSpleefPlayer(e.getPlayer());

		QueuesManager.removeFromQueue(player);

		if (!player.isActive()) {
			return;
		}

		Game game = player.getGame();
		game.leave(player, LoseCause.QUIT);
	}
Esempio n. 3
0
	@EventHandler
	public void onCommand(PlayerCommandPreprocessEvent e) {
		SpleefPlayer player = HeavySpleef.getInstance().getSpleefPlayer(e.getPlayer());

		if (player == null)
			return;
		if (!QueuesManager.hasQueue(player))
			return;
		if (HeavySpleef.getSystemConfig().getQueuesSection().isAllowCommands())
			return;

		if (e.getMessage().equalsIgnoreCase("/spleef leave") || e.getMessage().equalsIgnoreCase("/spl leave"))
			return;

		e.setCancelled(true);
		player.sendMessage(I18N._("noCommandsInQueue"));
	}