Construct PlayerProfiles in the database manager

- New method, DatabaseManager.loadPlayerProfile(String playerName)
 - PlayerProfile no longer has magic numbers that were mapped from two different sets of magic numbers, they have migrated to the DatabaseManagers where they belong
 - Will now be possible to convert SQL -> flatfile, once command is added
This commit is contained in:
riking
2013-06-08 18:56:56 -07:00
parent 98b98256b7
commit 58e8fd4691
14 changed files with 415 additions and 314 deletions

View File

@ -10,6 +10,7 @@ import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.util.StringUtil;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SkillType;
@ -68,7 +69,7 @@ public abstract class ExperienceCommand implements TabExecutor {
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
if (mcMMOPlayer == null) {
profile = new PlayerProfile(args[0], false);
profile = mcMMO.getDatabaseManager().loadPlayerProfile(args[0], false);
if (CommandUtils.unloadedProfile(sender, profile)) {
return true;