Projects >> Ultrabans >>0121e81de019cd24060288374c47d43d89b46ffb

Chunk
Conflicting content
 * 
		}
<<<<<<< HEAD
/* COPYRIGHT (c) 2013 Deathmarine (Joshua McCurry)
 * This file is part of Ultrabans.
 * Ultrabans is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Ultrabans is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with Ultrabans.  If not, see .
 */
package com.modcrafting.ultrabans.commands;

import java.util.ArrayList;
import java.util.List;

import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import com.modcrafting.ultrabans.Ultrabans;
import com.modcrafting.ultrabans.util.InfoBan;
import com.modcrafting.ultrabans.util.BanType;
import com.modcrafting.ultrabans.util.Formatting;

public class Unban extends CommandHandler {
	public Unban(Ultrabans instance) {
		super(instance);
	}

	public String command(CommandSender sender, Command command, String[] args) {
		if (args.length < 1)
			return lang.getString("Ban.Arguments");
		boolean broadcast = true;
		String admin = Ultrabans.DEFAULT_ADMIN;
		String reason;
		if (sender instanceof Player)
			admin = sender.getName();
		String name = Formatting.expandName(args[0]);
		if (args.length > 1) {
			if (args[1].equalsIgnoreCase("-s")){
				if(	sender.hasPermission(command.getPermission() + ".silent"))
					broadcast = false;
				reason = Formatting.combineSplit(2, args);	
			} else if (args[1].equalsIgnoreCase("-a")){
				if(sender.hasPermission(command.getPermission() + ".anon"))
					admin = Ultrabans.DEFAULT_ADMIN;
				reason = Formatting.combineSplit(2, args);	
			} else {
				reason = Formatting.combineSplit(1, args);
			}
		}
		OfflinePlayer of = plugin.getServer().getOfflinePlayer(name);
		if(of!=null){
			if(of.isBanned()) 
				of.setBanned(false);
			name = of.getName();
		}
		int count = 0;
		String ip = plugin.getUBDatabase().getAddress(name);
		if(ip != null && plugin.cacheIP.containsKey(ip)){
			count++;
			plugin.cacheIP.remove(ip);
			if(plugin.getLog())
				plugin.getLogger().info("Removed IP ban!");
		}
		
		if(Formatting.validIP(name)){
			if(plugin.cacheIP.containsKey(name)){
				for(InfoBan info : plugin.cacheIP.get(name)){
					name = info.getName();
					reason = info.getReason();
					admin = info.getAdmin();
					plugin.getUBDatabase().removeFromBanlist(name);
					plugin.getUBDatabase().addPlayer(name, "Unbanned: " + reason, admin, 0, 5);
					plugin.getLogger().info(admin + " unbanned player " + name + ".");	
					//TODO:
					String bcmsg = lang.getString("Unban.MsgToBroadcast", "%victim% was unbanned by %admin%!");
					bcmsg = bcmsg.replace(Ultrabans.ADMIN, admin);
					bcmsg = bcmsg.replace(Ultrabans.VICTIM, name);
					plugin.getServer().broadcastMessage(bcmsg);					
				}
				return null;
			}else{
				//TODO: Unban failed for that IP
				return "Failed IP";
			}
		}

		List list = new ArrayList();
		if(plugin.cache.containsKey(name.toLowerCase())){
			for(InfoBan info : plugin.cache.get(name.toLowerCase())){
				switch(BanType.fromID(info.getType())){
					case BAN:
					case IPBAN:
					case TEMPBAN:
					case TEMPIPBAN:{
						list.add(info);
						count++;
						break;
					}
					case PERMA:{
						String perma = config.getString("Messages.Unban.PermaBanned");
						perma = perma.replace(Ultrabans.VICTIM, name);
						if(plugin.getLog())
							plugin.getLogger().info(perma);
						return perma;
					}
					case INFO:
					case JAIL:
					case KICK:
					case MUTE:
					case TEMPJAIL:
					case UNBAN:
					case WARN:
					default:
						break;
				}
			}
		}
		if(count!=0){
			List lt = plugin.cache.get(name.toLowerCase());
			for(InfoBan info: list){
				if(config.getBoolean("UnbansLog.Enable", true)){
					reason = info.getReason();
					if(config.getBoolean("UnbansLog.LogReason",true) && reason != null){
						plugin.getUBDatabase().addPlayer(name, "Unbanned: "+reason, admin, 0, 5);
					}else{
						plugin.getUBDatabase().addPlayer(name, "Unbanned", admin, 0, 5);
					}
				}
				lt.remove(info);
			}
			plugin.getUBDatabase().removeFromBanlist(name);
			plugin.cache.put(name.toLowerCase(), lt);
			String bcmsg = ChatColor.translateAlternateColorCodes('&', lang.getString("Unban.MsgToBroadcast"));
			if(bcmsg.contains(Ultrabans.ADMIN)) 
				bcmsg = bcmsg.replace(Ultrabans.ADMIN, admin);
			if(bcmsg.contains(Ultrabans.VICTIM)) 
				bcmsg = bcmsg.replace(Ultrabans.VICTIM, name);
			if(broadcast){
				plugin.getServer().broadcastMessage(bcmsg);
			}else{
				sender.sendMessage(ChatColor.ITALIC + "Silent: " + bcmsg);
			}
			if(plugin.getLog())
				plugin.getLogger().info(ChatColor.stripColor(bcmsg));
			return null;
		}
		String failed = config.getString("Messages.Unban.Failed", "%victim% is already unbanned!");
		failed = failed.replace(Ultrabans.VICTIM, name);
		return failed;
	}
}
=======
/* COPYRIGHT (c) 2013 Deathmarine (Joshua McCurry)
 * This file is part of Ultrabans.
 * Ultrabans is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Ultrabans is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Ultrabans.  If not, see .
 */
package com.modcrafting.ultrabans.commands;

import java.util.ArrayList;
import java.util.List;

import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import com.modcrafting.ultrabans.Ultrabans;
import com.modcrafting.ultrabans.util.BanInfo;
import com.modcrafting.ultrabans.util.BanType;
import com.modcrafting.ultrabans.util.Formatting;

public class Unban extends CommandHandler {
	public Unban(Ultrabans instance) {
		super(instance);
	}

	public String command(CommandSender sender, Command command, String[] args) {
		if (args.length < 1)
			return lang.getString("Unban.Arguments");
		boolean broadcast = true;
		String admin = Ultrabans.DEFAULT_ADMIN;
		String reason;
		if (sender instanceof Player)
			admin = sender.getName();
		String name = Formatting.expandName(args[0]);
		if (args.length > 1) {
			if (args[1].equalsIgnoreCase("-s")){
				if(	sender.hasPermission(command.getPermission() + ".silent"))
					broadcast = false;
				reason = Formatting.combineSplit(2, args);	
			} else if (args[1].equalsIgnoreCase("-a")){
				if(sender.hasPermission(command.getPermission() + ".anon"))
					admin = Ultrabans.DEFAULT_ADMIN;
				reason = Formatting.combineSplit(2, args);	
			} else {
				reason = Formatting.combineSplit(1, args);
			}
		}
		OfflinePlayer of = plugin.getServer().getOfflinePlayer(name);
		if(of!=null){
			if(of.isBanned()) 
				of.setBanned(false);
			name = of.getName();
		}
		int count = 0;
		String ip = plugin.getUBDatabase().getAddress(name);
		if(ip != null && plugin.cacheIP.containsKey(ip)){
			count++;
			plugin.cacheIP.remove(ip);
			if(plugin.getLog())
				plugin.getLogger().info("Removed IP ban!");
		}
		
		if(Formatting.validIP(name)){
			if(plugin.cacheIP.containsKey(name)){
				for(BanInfo info : plugin.cacheIP.get(name)){
					name = info.getName();
					reason = info.getReason();
					admin = info.getAdmin();
					plugin.getUBDatabase().removeFromBanlist(name);
					plugin.getUBDatabase().addPlayer(name, "Unbanned: " + reason, admin, 0, 5);
					plugin.getLogger().info(admin + " unbanned player " + name + ".");	
					//TODO:
					String bcmsg = lang.getString("Unban.MsgToBroadcast", "%victim% was unbanned by %admin%!");
					bcmsg = bcmsg.replace(Ultrabans.ADMIN, admin);
					bcmsg = bcmsg.replace(Ultrabans.VICTIM, name);
					plugin.getServer().broadcastMessage(bcmsg);					
				}
				return null;
			}else{
				//TODO: Unban failed for that IP
				return "Failed IP";
			}
		}

		List list = new ArrayList();
		if(plugin.cache.containsKey(name.toLowerCase())){
			for(BanInfo info : plugin.cache.get(name.toLowerCase())){
				switch(BanType.fromID(info.getType())){
					case BAN:
					case IPBAN:
					case TEMPBAN:
					case TEMPIPBAN:{
						list.add(info);
						count++;
						break;
					}
					case PERMA:{
						String perma = config.getString("Messages.Unban.PermaBanned");
						perma = perma.replace(Ultrabans.VICTIM, name);
						if(plugin.getLog())
							plugin.getLogger().info(perma);
						return perma;
					}
					case INFO:
					case JAIL:
					case KICK:
					case MUTE:
					case TEMPJAIL:
					case UNBAN:
					case WARN:
					default:
						break;
				}
			}
		if(count!=0){
			List lt = plugin.cache.get(name.toLowerCase());
			for(BanInfo info: list){
				if(config.getBoolean("UnbansLog.Enable", true)){
					reason = info.getReason();
					if(config.getBoolean("UnbansLog.LogReason",true) && reason != null){
						plugin.getUBDatabase().addPlayer(name, "Unbanned: "+reason, admin, 0, 5);
					}else{
						plugin.getUBDatabase().addPlayer(name, "Unbanned", admin, 0, 5);
					}
				}
				lt.remove(info);
			}
			plugin.getUBDatabase().removeFromBanlist(name);
			plugin.cache.put(name.toLowerCase(), lt);
			String bcmsg = ChatColor.translateAlternateColorCodes('&', lang.getString("Unban.MsgToBroadcast"));
			if(bcmsg.contains(Ultrabans.ADMIN)) 
				bcmsg = bcmsg.replace(Ultrabans.ADMIN, admin);
			if(bcmsg.contains(Ultrabans.VICTIM)) 
				bcmsg = bcmsg.replace(Ultrabans.VICTIM, name);
			if(broadcast){
				plugin.getServer().broadcastMessage(bcmsg);
			}else{
				sender.sendMessage(ChatColor.ITALIC + "Silent: " + bcmsg);
			}
			if(plugin.getLog())
				plugin.getLogger().info(ChatColor.stripColor(bcmsg));
			return null;
		}
		String failed = config.getString("Messages.Unban.Failed", "%victim% is already unbanned!");
		failed = failed.replace(Ultrabans.VICTIM, name);
		return failed;
	}
}
>>>>>>> c10d8fb1cac1ef67ec559f7f7fe93bf88cc83c91
Solution content
					}else{
/* COPYRIGHT (c) 2015 Deathmarine
 * This file is part of Ultrabans.
 * Ultrabans is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Ultrabans is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Ultrabans.  If not, see .
 */
package com.modcrafting.ultrabans.commands;

import java.util.ArrayList;
import java.util.List;

import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import com.modcrafting.ultrabans.Ultrabans;
import com.modcrafting.ultrabans.util.BanInfo;
import com.modcrafting.ultrabans.util.BanType;
import com.modcrafting.ultrabans.util.Formatting;

public class Unban extends CommandHandler {
	public Unban(Ultrabans instance) {
		super(instance);
	}

	public String command(CommandSender sender, Command command, String[] args) {
		if (args.length < 1)
			return lang.getString("Unban.Arguments");
		boolean broadcast = true;
		String admin = Ultrabans.DEFAULT_ADMIN;
		String reason;
		if (sender instanceof Player)
			admin = sender.getName();
		String name = Formatting.expandName(args[0]);
		if (args.length > 1) {
			if (args[1].equalsIgnoreCase("-s")){
				if(	sender.hasPermission(command.getPermission() + ".silent"))
					broadcast = false;
				reason = Formatting.combineSplit(2, args);	
			} else if (args[1].equalsIgnoreCase("-a")){
				if(sender.hasPermission(command.getPermission() + ".anon"))
					admin = Ultrabans.DEFAULT_ADMIN;
				reason = Formatting.combineSplit(2, args);	
			} else {
				reason = Formatting.combineSplit(1, args);
			}
		}
		OfflinePlayer of = plugin.getServer().getOfflinePlayer(name);
		if(of!=null){
			if(of.isBanned()) 
				of.setBanned(false);
			name = of.getName();
		}
		int count = 0;
		String ip = plugin.getUBDatabase().getAddress(name);
		if(ip != null && plugin.cacheIP.containsKey(ip)){
			count++;
			plugin.cacheIP.remove(ip);
			if(plugin.getLog())
				plugin.getLogger().info("Removed IP ban!");
		}
		
		if(Formatting.validIP(name)){
			if(plugin.cacheIP.containsKey(name)){
				for(BanInfo info : plugin.cacheIP.get(name)){
					name = info.getName();
					reason = info.getReason();
					admin = info.getAdmin();
					plugin.getUBDatabase().removeFromBanlist(name);
					plugin.getUBDatabase().addPlayer(name, "Unbanned: " + reason, admin, 0, 5);
					plugin.getLogger().info(admin + " unbanned player " + name + ".");	
					//TODO:
					String bcmsg = lang.getString("Unban.MsgToBroadcast", "%victim% was unbanned by %admin%!");
					bcmsg = bcmsg.replace(Ultrabans.ADMIN, admin);
					bcmsg = bcmsg.replace(Ultrabans.VICTIM, name);
					plugin.getServer().broadcastMessage(bcmsg);					
				}
				return null;
			}else{
				//TODO: Unban failed for that IP
				return "Failed IP";
			}
		}

		List list = new ArrayList();
		if(plugin.cache.containsKey(name.toLowerCase())){
			for(BanInfo info : plugin.cache.get(name.toLowerCase())){
				switch(BanType.fromID(info.getType())){
					case BAN:
					case IPBAN:
					case TEMPBAN:
					case TEMPIPBAN:{
						list.add(info);
						count++;
						break;
					}
					case PERMA:{
						String perma = config.getString("Messages.Unban.PermaBanned");
						perma = perma.replace(Ultrabans.VICTIM, name);
						if(plugin.getLog())
							plugin.getLogger().info(perma);
						return perma;
					}
					case INFO:
					case JAIL:
					case KICK:
					case MUTE:
					case TEMPJAIL:
					case UNBAN:
					case WARN:
					default:
						break;
				}
			}
		}
		if(count!=0){
			List lt = plugin.cache.get(name.toLowerCase());
			for(BanInfo info: list){
				if(config.getBoolean("UnbansLog.Enable", true)){
					reason = info.getReason();
					if(config.getBoolean("UnbansLog.LogReason",true) && reason != null){
						plugin.getUBDatabase().addPlayer(name, "Unbanned: "+reason, admin, 0, 5);
						plugin.getUBDatabase().addPlayer(name, "Unbanned", admin, 0, 5);
					}
				}
				lt.remove(info);
			}
			plugin.getUBDatabase().removeFromBanlist(name);
			plugin.cache.put(name.toLowerCase(), lt);
			String bcmsg = ChatColor.translateAlternateColorCodes('&', lang.getString("Unban.MsgToBroadcast"));
			if(bcmsg.contains(Ultrabans.ADMIN)) 
				bcmsg = bcmsg.replace(Ultrabans.ADMIN, admin);
			if(bcmsg.contains(Ultrabans.VICTIM)) 
				bcmsg = bcmsg.replace(Ultrabans.VICTIM, name);
			if(broadcast){
				plugin.getServer().broadcastMessage(bcmsg);
			}else{
				sender.sendMessage(ChatColor.ITALIC + "Silent: " + bcmsg);
			}
			if(plugin.getLog())
				plugin.getLogger().info(ChatColor.stripColor(bcmsg));
			return null;
		}
		String failed = config.getString("Messages.Unban.Failed", "%victim% is already unbanned!");
		failed = failed.replace(Ultrabans.VICTIM, name);
		return failed;
	}
}
File
Unban.java
Developer's decision
Manual
Kind of conflict
Class declaration
Comment
Import
Package declaration
Chunk
Conflicting content
<<<<<<< HEAD
/* COPYRIGHT (c) 2015 Deathmarine
 * This file is part of Ultrabans.
 * Ultrabans is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Ultrabans is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Ultrabans.  If not, see .
 */
package com.modcrafting.ultrabans.db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
import java.util.logging.Level;

import org.bukkit.configuration.file.YamlConfiguration;

import com.modcrafting.ultrabans.Ultrabans;

public class SQL extends Database {
	private String database;
	private String username;
	private String password;

	public SQL(Ultrabans instance) {
		super(instance);
		YamlConfiguration config = (YamlConfiguration) plugin.getConfig();
		database = config.getString("MySQL.Database",
				"jdbc:mysql://localhost:3306/minecraft");
		username = config.getString("MySQL.User", "root");
		password = config.getString("MySQL.Password", "root");
		bantable = config.getString("MySQL.Table", "banlist");
		iptable = config.getString("MySQL.IPTable", "iptable");
		aliastable = config.getString("MySQL.AliasTable", "aliastable");
	}

	public Connection getSQLConnection() {
		try {
			if (connection != null && !connection.isClosed()) {
				return connection;
			}
			Properties info = new Properties();
			info.put("autoReconnect", "true");
			info.put("user", username);
			info.put("password", password);
			info.put("useUnicode", "true");
			info.put("characterEncoding", "utf8");
			connection = DriverManager.getConnection(database, info);
			return connection;
		} catch (SQLException ex) {
			plugin.getLogger().log(Level.SEVERE,
					"Unable to retreive connection", ex);
		}
		return null;
	}

	public String SQLCreateBansTable = "CREATE TABLE IF NOT EXISTS %table% ("
			+ "`uuid` varchar(36) NOT NULL,"
			+ "`reason` text NOT NULL,"
			+ "`admin` varchar(32) NOT NULL,"
			+ "`time` bigint(20) NOT NULL,"
			+ "`temptime` bigint(20) NOT NULL,"
			+ "`id` int(11) NOT NULL AUTO_INCREMENT,"
			+ "`type` int(1) NOT NULL DEFAULT '0',"
			+ "PRIMARY KEY (`id`) USING BTREE"
			+ ") ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;";

	public String SQLCreateIPTable = "CREATE TABLE IF NOT EXISTS %table% ("
			+ "`ip` varchar(45) NOT NULL," 
			+ "`uuid` varchar(36) NOT NULL,"
			+ "PRIMARY KEY (`ip`)"
			+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;";

	public String SQLCreateAliasTable = "CREATE TABLE IF NOT EXISTS %table% ("
			+ "`name` varchar(32) NOT NULL," 
			+ "`uuid` varchar(36) NOT NULL,"
			+ "PRIMARY KEY (`name`)"
			+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;";

	public void load() {
		connection = getSQLConnection();
		try {
			Statement s = connection.createStatement();
	}
			s.executeUpdate(SQLCreateBansTable.replaceAll("%table%",bantable));
			s.executeUpdate(SQLCreateIPTable.replaceAll("%table%", iptable));
			s.executeUpdate(SQLCreateAliasTable.replaceAll("%table%", aliastable));
			s.close();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		initialize();
	}
=======
/* COPYRIGHT (c) 2013 Deathmarine (Joshua McCurry)
 * This file is part of Ultrabans.
 * Ultrabans is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Ultrabans is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Ultrabans.  If not, see .
 */
package com.modcrafting.ultrabans.db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Properties;
import java.util.logging.Level;
import org.bukkit.configuration.file.YamlConfiguration;
import com.modcrafting.ultrabans.Ultrabans;

public class SQL extends Database{
	private String database;
	private String username;
	private String password;
	public SQL(Ultrabans instance){
		super(instance);
		YamlConfiguration config = (YamlConfiguration) plugin.getConfig();
		database = config.getString("MySQL.Database","jdbc:mysql://localhost:3306/minecraft");
		username = config.getString("MySQL.User","root");
		password = config.getString("MySQL.Password","root");
		bantable = config.getString("MySQL.Table","banlist");
		iptable = config.getString("MySQL.IPTable","banlistip");
	}
	
	public Connection getSQLConnection() {
		try {
			if(connection!=null&&!connection.isClosed()){
				return connection;
			}
			Properties info = new Properties();
			info.put("autoReconnect", "true");
			info.put("user", username);
			info.put("password", password);
			info.put("useUnicode", "true");
			info.put("characterEncoding", "utf8");
			connection = DriverManager.getConnection(database,info);
			return connection;
		} catch (SQLException ex) {
			plugin.getLogger().log(Level.SEVERE, "Unable to retreive connection", ex);
		}
		return null;	
	}

	public String SQLCreateBansTable = "CREATE TABLE IF NOT EXISTS %table% (" +
			"`name` varchar(32) NOT NULL," +
			"`reason` text NOT NULL," + 
			"`admin` varchar(32) NOT NULL," + 
			"`time` bigint(20) NOT NULL," + 
			"`temptime` bigint(20) NOT NULL," + 
			"`id` int(11) NOT NULL AUTO_INCREMENT," + 
			"`type` int(1) NOT NULL DEFAULT '0'," + 
			"PRIMARY KEY (`id`) USING BTREE" + 
			") ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;";
	public String SQLCreateBanipTable = "CREATE TABLE IF NOT EXISTS %table% (" +
			"`name` varchar(32) NOT NULL," + 
			"`lastip` tinytext NOT NULL," + 
			"PRIMARY KEY (`name`)" + 
			") ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;";
	
	public void load() {
		connection = getSQLConnection();
		try {
			PreparedStatement s = connection.prepareStatement(SQLCreateBansTable.replaceAll("%table%",bantable));
			s.execute();
			s = connection.prepareStatement(SQLCreateBanipTable.replaceAll("%table%",iptable));
			s.execute();
			s.close();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		initialize();
>>>>>>> c10d8fb1cac1ef67ec559f7f7fe93bf88cc83c91
}
Solution content
			+ "`temptime` bigint(20) NOT NULL,"
/* COPYRIGHT (c) 2015 Deathmarine
 * This file is part of Ultrabans.
 * Ultrabans is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Ultrabans is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Ultrabans.  If not, see .
 */
package com.modcrafting.ultrabans.db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
import java.util.logging.Level;

import org.bukkit.configuration.file.YamlConfiguration;

import com.modcrafting.ultrabans.Ultrabans;

public class SQL extends Database {
	private String database;
	private String username;
	private String password;

	public SQL(Ultrabans instance) {
		super(instance);
		YamlConfiguration config = (YamlConfiguration) plugin.getConfig();
		database = config.getString("MySQL.Database",
				"jdbc:mysql://localhost:3306/minecraft");
		username = config.getString("MySQL.User", "root");
		password = config.getString("MySQL.Password", "root");
		bantable = config.getString("MySQL.Table", "banlist");
		iptable = config.getString("MySQL.IPTable", "iptable");
		aliastable = config.getString("MySQL.AliasTable", "aliastable");
	}

	public Connection getSQLConnection() {
		try {
			if (connection != null && !connection.isClosed()) {
				return connection;
			}
			Properties info = new Properties();
			info.put("autoReconnect", "true");
			info.put("user", username);
			info.put("password", password);
			info.put("useUnicode", "true");
			info.put("characterEncoding", "utf8");
			connection = DriverManager.getConnection(database, info);
			return connection;
		} catch (SQLException ex) {
			plugin.getLogger().log(Level.SEVERE,
					"Unable to retreive connection", ex);
		}
		return null;
	}

	public String SQLCreateBansTable = "CREATE TABLE IF NOT EXISTS %table% ("
			+ "`uuid` varchar(36) NOT NULL,"
			+ "`reason` text NOT NULL,"
			+ "`admin` varchar(32) NOT NULL,"
			+ "`time` bigint(20) NOT NULL,"
			+ "`id` int(11) NOT NULL AUTO_INCREMENT,"
			+ "`type` int(1) NOT NULL DEFAULT '0',"
			+ "PRIMARY KEY (`id`) USING BTREE"
			+ ") ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;";

	public String SQLCreateIPTable = "CREATE TABLE IF NOT EXISTS %table% ("
			+ "`ip` varchar(45) NOT NULL," 
			+ "`uuid` varchar(36) NOT NULL,"
			+ "PRIMARY KEY (`ip`)"
			+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;";

	public String SQLCreateAliasTable = "CREATE TABLE IF NOT EXISTS %table% ("
			+ "`name` varchar(32) NOT NULL," 
			+ "`uuid` varchar(36) NOT NULL,"
			+ "PRIMARY KEY (`name`)"
			+ ") ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;";

	public void load() {
		connection = getSQLConnection();
		try {
			Statement s = connection.createStatement();
			s.executeUpdate(SQLCreateBansTable.replaceAll("%table%",bantable));
			s.executeUpdate(SQLCreateIPTable.replaceAll("%table%", iptable));
			s.executeUpdate(SQLCreateAliasTable.replaceAll("%table%", aliastable));
			s.close();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		initialize();
	}
}
File
SQL.java
Developer's decision
Combination
Kind of conflict
Attribute
Comment
Import
Method declaration
Package declaration