From 739207dfc5e69c48d29249bbebcadf716c28cb23 Mon Sep 17 00:00:00 2001
From: Jon Langseth <jon.langseth@hig.no>
Date: Tue, 8 May 2012 16:35:49 +0200
Subject: [PATCH] Removed debugging text. Seems to work OK, bumping version to
 1.5

---
 plugin.yml                            |  2 +-
 src/no/defcon/yavote/Votemanager.java | 46 +--------------------------
 src/no/defcon/yavote/YAVote.java      |  1 -
 3 files changed, 2 insertions(+), 47 deletions(-)

diff --git a/plugin.yml b/plugin.yml
index 0a3b638..20cd3c4 100644
--- a/plugin.yml
+++ b/plugin.yml
@@ -1,6 +1,6 @@
 name: YAVote
 main: no.defcon.yavote.YAVote
-version: 1.5-test3
+version: 1.5
 description: Yet Another Vote plugin for Bukkit
 website: http://minecraft.defcon.no/yavote
 authors:
diff --git a/src/no/defcon/yavote/Votemanager.java b/src/no/defcon/yavote/Votemanager.java
index 8690db3..bacbd92 100644
--- a/src/no/defcon/yavote/Votemanager.java
+++ b/src/no/defcon/yavote/Votemanager.java
@@ -64,7 +64,6 @@ public class Votemanager {
 
 		yesVoters.add(p.getName());
 
-		//if ( checkRatio( ) )
 		if ( ((float) yesVoters.size() / (float) plugin.getServer().getOnlinePlayers().length ) >= getRequired() )
 		{
 			applyVote( voteType );
@@ -107,38 +106,17 @@ public class Votemanager {
 		if ( ! voteRunning || (voteType == null ) )
 			return;
 
-		plugin.getLogger().info("Debugging removeVote() with player: " + player.getName() );
 		if ( yesVoters.contains(player.getName()) )
-		{
 			yesVoters.remove(player.getName());
-			plugin.getLogger().info("Debugging, removeVote() removed YES vote for " + player.getName() );
-		}
 
 		if ( noVoters.contains(player.getName()) )
-		{
 			noVoters.remove(player.getName());
-			plugin.getLogger().info("Debugging, removeVote() removed NO vote for " + player.getName() );
-		}
 
 		if ( yesVoters.size() + noVoters.size() == 0 )
-		{
-			plugin.getLogger().info("Debugging: No voters remaining in lists. Cancel vote.");
 			cancelVote();
-			return;
-		}
-
-		plugin.getLogger().info("Debugging: yesVoters.size()     = "  + yesVoters.size() );
-		plugin.getLogger().info("Debugging: getRequired()        = " + getRequired() );
-		plugin.getLogger().info("Debugging: getOnlinePlayers - 1 = " + (plugin.getServer().getOnlinePlayers().length - 1) );
-		plugin.getLogger().info("Debugging: ratio = " + ( (float) yesVoters.size() / (float) (plugin.getServer().getOnlinePlayers().length - 1) ) );
 
-		//if( checkRatio( ) )
-		if ( ((float) yesVoters.size() / (float) (plugin.getServer().getOnlinePlayers().length - 1) ) >= getRequired() )
-		{
-			plugin.getLogger().info("Debugging: after removing vote, ratio test returns TRUE, applying vote");
+		else if ( ((float) yesVoters.size() / (float) (plugin.getServer().getOnlinePlayers().length - 1) ) >= getRequired() )
 			applyVote( voteType );
-		}
-		plugin.getLogger().info("Returning from removeVote()");
 	}
 
 	public boolean addVote(Player player, boolean yes) 
@@ -154,7 +132,6 @@ public class Votemanager {
 		if (yes == true) yesVoters.add(player.getName());
 		else noVoters.add(player.getName());
 		
-		//if ( (yes == true) && checkRatio( ) )
 		if ( ( yes == true) && ( ((float) yesVoters.size() / (float) plugin.getServer().getOnlinePlayers().length ) >= getRequired() ) )
 		{
 			applyVote( voteType );
@@ -211,27 +188,6 @@ public class Votemanager {
 
 		return req;
 	}
-
-	/*
-	// Original approach...
-	private boolean checkRatio( )
-	{
-		float required = getRequired();
-		float ratio = (float) yesVoters.size() / (float) plugin.getServer().getOnlinePlayers().length;
-		if ( ratio >= required ) return true;
-		return false;
-	}
-
-	// Replacement code
-	private boolean checkRatio( )
-	{
-		if ( ((float) yesVoters.size() / (float) plugin.getServer().getOnlinePlayers().length ) >= getRequired() )
-			return true;
-		return false;
-	}
-
-	// But, trying to do it inline instead
-	*/
 	
 	private void clearState()
 	{
diff --git a/src/no/defcon/yavote/YAVote.java b/src/no/defcon/yavote/YAVote.java
index 98433ba..1e49702 100644
--- a/src/no/defcon/yavote/YAVote.java
+++ b/src/no/defcon/yavote/YAVote.java
@@ -64,7 +64,6 @@ public class YAVote extends JavaPlugin implements Listener {
 	@EventHandler
 	public void onLogout(PlayerQuitEvent event)
 	{
-		logger.info("Triggered onLogout() with " + getServer().getOnlinePlayers().length + " players online.");
 		manager.removeVote( event.getPlayer() );
 	}
 	
-- 
2.39.2