Make the profile loaded message optional

People will complain if we don’t
This commit is contained in:
TfT_02 2014-07-31 23:16:43 +02:00
parent e7ee31c291
commit 7d65b9422a
4 changed files with 9 additions and 8 deletions

View File

@ -232,6 +232,7 @@ public class Config extends AutoUpdateConfigLoader {
/* General Settings */ /* General Settings */
public String getLocale() { return config.getString("General.Locale", "en_us"); } public String getLocale() { return config.getString("General.Locale", "en_us"); }
public boolean getMOTDEnabled() { return config.getBoolean("General.MOTD_Enabled", true); } public boolean getMOTDEnabled() { return config.getBoolean("General.MOTD_Enabled", true); }
public boolean getShowProfileLoadedMessage() { return config.getBoolean("General.Show_Profile_Loaded", true); }
public boolean getDonateMessageEnabled() { return config.getBoolean("Commands.mcmmo.Donate_Message", true); } public boolean getDonateMessageEnabled() { return config.getBoolean("Commands.mcmmo.Donate_Message", true); }
public int getSaveInterval() { return config.getInt("General.Save_Interval", 10); } public int getSaveInterval() { return config.getInt("General.Save_Interval", 10); }
public boolean getStatsTrackingEnabled() { return config.getBoolean("General.Stats_Tracking", true); } public boolean getStatsTrackingEnabled() { return config.getBoolean("General.Stats_Tracking", true); }

View File

@ -46,13 +46,9 @@ public class PlayerProfileLoadingTask extends BukkitRunnable {
return; return;
} }
// Send the message that we're doing the recovery
if (attempt == 0) {
player.sendMessage(LocaleLoader.getString("Profile.Loading.Start"));
}
// Increment attempt counter and try // Increment attempt counter and try
attempt++; attempt++;
PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(player.getName(), player.getUniqueId(), true); PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(player.getName(), player.getUniqueId(), true);
// If successful, schedule the apply // If successful, schedule the apply
if (profile.isLoaded()) { if (profile.isLoaded()) {
@ -94,10 +90,13 @@ public class PlayerProfileLoadingTask extends BukkitRunnable {
McMMOPlayer mcMMOPlayer = new McMMOPlayer(player, profile); McMMOPlayer mcMMOPlayer = new McMMOPlayer(player, profile);
UserManager.track(mcMMOPlayer); UserManager.track(mcMMOPlayer);
player.sendMessage(LocaleLoader.getString("Profile.Loading.Success"));
mcMMOPlayer.actualizeRespawnATS(); mcMMOPlayer.actualizeRespawnATS();
ScoreboardManager.setupPlayer(player); ScoreboardManager.setupPlayer(player);
if (Config.getInstance().getShowProfileLoadedMessage()) {
player.sendMessage(LocaleLoader.getString("Profile.Loading.Success"));
}
if (Config.getInstance().getShowStatsAfterLogin()) { if (Config.getInstance().getShowStatsAfterLogin()) {
ScoreboardManager.enablePlayerStatsScoreboard(player); ScoreboardManager.enablePlayerStatsScoreboard(player);
new McScoreboardKeepTask(player).runTaskLater(mcMMO.p, 1 * Misc.TICK_CONVERSION_FACTOR); new McScoreboardKeepTask(player).runTaskLater(mcMMO.p, 1 * Misc.TICK_CONVERSION_FACTOR);

View File

@ -10,6 +10,8 @@
General: General:
Locale: en_US Locale: en_US
MOTD_Enabled: true MOTD_Enabled: true
# Send a message to the player when his profile was successfully loaded
Show_Profile_Loaded: false
# Amount of time (in minutes) to wait between saves of player information # Amount of time (in minutes) to wait between saves of player information
Save_Interval: 10 Save_Interval: 10
# Allow mcMMO to report on basic anonymous usage # Allow mcMMO to report on basic anonymous usage

View File

@ -960,7 +960,6 @@ Scoreboard.Misc.Cooldown=[[LIGHT_PURPLE]]Cooldown
Scoreboard.Misc.Overall=[[GOLD]]Overall Scoreboard.Misc.Overall=[[GOLD]]Overall
#DATABASE RECOVERY #DATABASE RECOVERY
Profile.Loading.Start=[[GREEN]]Notice: mcMMO is now loading your profile. Stats and skills will not function until loaded... Profile.Loading.Success=[[GREEN]]Your mcMMO profile has been loaded.
Profile.Loading.Success=[[GREEN]]Success! Your mcMMO data was loaded.
Profile.Loading.Failure=[[RED]]mcMMO still cannot load your data. You may want to [[AQUA]]contact the server owner.\n[[YELLOW]]You can still play on the server, but you will have [[BOLD]]no mcMMO levels[[YELLOW]] and any XP you get [[BOLD]]will not be saved[[YELLOW]]. Profile.Loading.Failure=[[RED]]mcMMO still cannot load your data. You may want to [[AQUA]]contact the server owner.\n[[YELLOW]]You can still play on the server, but you will have [[BOLD]]no mcMMO levels[[YELLOW]] and any XP you get [[BOLD]]will not be saved[[YELLOW]].
Profile.Loading.AdminFailureNotice=[[DARK_RED]][A][[RED]] mcMMO was unable to load the player data for [[YELLOW]]{0}[[RED]]. [[LIGHT_PURPLE]]Please inspect your database setup. Profile.Loading.AdminFailureNotice=[[DARK_RED]][A][[RED]] mcMMO was unable to load the player data for [[YELLOW]]{0}[[RED]]. [[LIGHT_PURPLE]]Please inspect your database setup.