Update changelog & minor formatting fixes

This commit is contained in:
TfT_02 2013-10-06 10:25:28 +02:00
parent 96b54387fe
commit 3f9c98d72e
5 changed files with 16 additions and 9 deletions

View File

@ -8,6 +8,7 @@ Key:
- Removal - Removal
Version 1.4.07-dev Version 1.4.07-dev
+ Added SQL Database can now recover from a dropped connection without losing data. (Thanks Riking!)
+ Added Carrot on a Stick and Flint & Steel to repair.vanilla.yml + Added Carrot on a Stick and Flint & Steel to repair.vanilla.yml
+ Added horses to the "Shake" ability + Added horses to the "Shake" ability
+ Added ability to summon horses via "Call of the Wild" using apples + Added ability to summon horses via "Call of the Wild" using apples

View File

@ -122,7 +122,8 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
try { try {
lastPlayed = Long.parseLong(character[37]) * Misc.TIME_CONVERSION_FACTOR; lastPlayed = Long.parseLong(character[37]) * Misc.TIME_CONVERSION_FACTOR;
} }
catch (NumberFormatException e) {} catch (NumberFormatException e) {
}
if (lastPlayed == 0) { if (lastPlayed == 0) {
OfflinePlayer player = Bukkit.getOfflinePlayer(name); OfflinePlayer player = Bukkit.getOfflinePlayer(name);
lastPlayed = player.getLastPlayed(); lastPlayed = player.getLastPlayed();
@ -406,7 +407,8 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
in.close(); in.close();
} }
} }
catch (IOException ignored) {} catch (IOException e) {
}
} }
} }

View File

@ -12,7 +12,6 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
import java.util.logging.Level;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;
@ -23,8 +22,8 @@ import com.gmail.nossr50.datatypes.database.PlayerStat;
import com.gmail.nossr50.datatypes.player.PlayerProfile; import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.AbilityType; import com.gmail.nossr50.datatypes.skills.AbilityType;
import com.gmail.nossr50.datatypes.skills.SkillType; import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.runnables.database.SQLReconnectTask;
import com.gmail.nossr50.runnables.database.SQLDatabaseKeepaliveTask; import com.gmail.nossr50.runnables.database.SQLDatabaseKeepaliveTask;
import com.gmail.nossr50.runnables.database.SQLReconnectTask;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
public final class SQLDatabaseManager implements DatabaseManager { public final class SQLDatabaseManager implements DatabaseManager {
@ -95,7 +94,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
"WHERE ((" + currentTime + " - lastlogin * " + Misc.TIME_CONVERSION_FACTOR + ") > " + PURGE_TIME + ")"); "WHERE ((" + currentTime + " - lastlogin * " + Misc.TIME_CONVERSION_FACTOR + ") > " + PURGE_TIME + ")");
processPurge(usernames); processPurge(usernames);
mcMMO.p.getLogger().info("Purged " + usernames.size() + " users from the database.");; mcMMO.p.getLogger().info("Purged " + usernames.size() + " users from the database.");
} }
public boolean removeUser(String playerName) { public boolean removeUser(String playerName) {
@ -380,7 +379,8 @@ public final class SQLDatabaseManager implements DatabaseManager {
result.close(); result.close();
return ret; return ret;
} }
catch (SQLException e) {} catch (SQLException e) {
}
} }
result.close(); result.close();
} }
@ -467,13 +467,15 @@ public final class SQLDatabaseManager implements DatabaseManager {
if (statement != null) { if (statement != null) {
try { try {
statement.close(); statement.close();
} catch (SQLException e) { }
catch (SQLException e) {
// Ignore // Ignore
} }
} }
} }
} }
/** /**
* Check connection status and re-establish if dead or stale. * Check connection status and re-establish if dead or stale.
* *
@ -584,7 +586,8 @@ public final class SQLDatabaseManager implements DatabaseManager {
if (stmt != null) { if (stmt != null) {
try { try {
stmt.close(); stmt.close();
} catch (SQLException e) { }
catch (SQLException e) {
// Ignore // Ignore
} }
} }

View File

@ -178,6 +178,7 @@ public class McMMOPlayer {
private class ApplySuccessfulProfile extends BukkitRunnable { private class ApplySuccessfulProfile extends BukkitRunnable {
private final PlayerProfile profile; private final PlayerProfile profile;
private ApplySuccessfulProfile(PlayerProfile profile) { private ApplySuccessfulProfile(PlayerProfile profile) {
this.profile = profile; this.profile = profile;
} }

View File

@ -10,7 +10,7 @@ import com.gmail.nossr50.database.SQLDatabaseManager;
* This task is in charge of sending a MySQL ping over the MySQL connection * This task is in charge of sending a MySQL ping over the MySQL connection
* every hour to prevent the connection from timing out and losing players' * every hour to prevent the connection from timing out and losing players'
* data when they join. * data when they join.
* <p> * <p/>
* A WeakReference is used to keep the database instance, because * A WeakReference is used to keep the database instance, because
* {@link com.gmail.nossr50.commands.database.ConvertDatabaseCommand database * {@link com.gmail.nossr50.commands.database.ConvertDatabaseCommand database
* conversion} may create a SQLDatabaseManager that will be thrown out. If a * conversion} may create a SQLDatabaseManager that will be thrown out. If a