/** Initializes MCCom base classes. (Required for SQL) */ public static void initialize() { if (Settings.dbtype.equalsIgnoreCase("mysql")) { IOH.log("MySQL is enabled for Accounts.", IOH.INFO); accounting = new MySqlAccounting(); } else { IOH.log("YML is enabled for Accounts.", IOH.INFO); accounting = new Accounting(); } }
/** Loads accounts file */ public void load() { accounts = YamlConfiguration.loadConfiguration(accountsFile); accounts.options().header("=== MineConomy Accounts ===\n\n Do not edit!\n"); accountlist = new ArrayList<String>(); accountbalance = new Hashtable<String, Double>(); accountcurrency = new Hashtable<String, String>(); accountstatus = new Hashtable<String, String>(); if (!accountsFile.exists()) { IOH.log("Accounts file not found...", IOH.INFO); accounts.set("Accounts", ""); IOH.log("Accounts file created!", IOH.INFO); save(); } IOH.log("Loading Accounts file...", IOH.INFO); reload(); IOH.log("Accounts file loaded!", IOH.INFO); }
public static void load() { lang = YamlConfiguration.loadConfiguration(langFile); lang.options().header("=== MineConomy Language ===\n\n \n"); if (!langFile.exists()) { IOH.log("Language file not found...", IOH.INFO); lang.set("Lang", ""); lang.set("Lang.Tag", langtag); lang.set("Lang.Message.Welcome Message", welcomeMessage); lang.set("Lang.Message.Welcome Account Created", messageWelcomeAccountCreated); lang.set("Lang.Message.Account Balance", messageAccountBalance); lang.set("Lang.Message.Bank Balance", messageBankBalance); lang.set("Lang.Op.Update", warnOp); lang.set("Lang.Error.Permission.Have Account", errorPermissionHaveAccount); lang.set("Lang.Error.Permission.Generic", errorPermissionGeneric); lang.set("Lang.Error.Int", errorInt); lang.set("Lang.Error.Invalid Args", errorInvalidArgs); lang.set("Lang.Error.Command.Recognition", errorCommandRecognition); lang.set("Lang.Error.Currency Not Found", errorCurrencyNotFound); lang.set("Lang.Message.Currency Set", messageCurrencySet); lang.set("Lang.Message.Exp Check", messageExpCheck); lang.set("Lang.Message.Get Balance", messageGetBalance); lang.set("Lang.Message.Set Balance", messageSetBalance); lang.set("Lang.Error.Max Debt", errorMaxDebt); lang.set("Lang.Message.Give", messageGive); lang.set("Lang.Error.They Enough", errorTheyEnough); lang.set("Lang.Error.You Enough", errorYouEnough); lang.set("Lang.Message.Payed To", messagePayedTo); lang.set("Lang.Message.Payed From", messagePayedFrom); lang.set("Lang.Message.Took", messageTook); lang.set("Lang.Message.Empty", messageEmpty); lang.set("Lang.Message.Account Created", messageCreated); lang.set("Lang.Error.Account Exists", errorAccountExists); lang.set("Lang.Message.Account Deleted", messageDeleted); lang.set("Lang.Error.No Account", errorNoAccount); lang.set("Lang.Error.No Bank", errorNoBank); lang.set("Lang.Error.No Bank Account", errorNoBankAccount); lang.set("Lang.Message.Bank Created", messageBankCreated); lang.set("Lang.Error.Bank Exists", errorBankExists); lang.set("Lang.Message.Bank Deleted", messageBankDeleted); lang.set("Lang.Error.Money Format", errorMoneyFormat); lang.set("Lang.Error.Bank Account Exists", errorBankAccountExists); lang.set("Lang.Message.Bank Account Created", messageBankAccountCreated); lang.set("Lang.Message.Bank Account Deleted", messageBankAccountDeleted); lang.set("Lang.Message.Empty Bank Account", messageEmptyBankAccount); lang.set("Lang.Message.Bank Renamed", messageBankRenamed); lang.set("Lang.Message.Get Bank Account", messageGetBankAccount); lang.set("Lang.Message.Set Bank Account", messageSetBankAccount); lang.set("Lang.Message.Bank Account Renamed", messageBankAccountRenamed); lang.set("Lang.Message.Bank Account Deposit", messageBankAccountDeposit); lang.set("Lang.Message.Bank Account Withdraw", messageBankAccountWithdraw); lang.set("Lang.Message.Transaction Complete", messageTransactionComplete); lang.set("Lang.Error.No Physical Currency", errorNoPhysicalCurrency); lang.set("Lang.Error.Exp Enough", errorExpEnough); lang.set("Lang.Message.Help.Page 1", messageHelp1); lang.set("Lang.Message.Help.Page 2", messageHelp2); lang.set("Lang.Message.Help.Page 3", messageHelp3); IOH.log("Language file created!", IOH.INFO); save(); } IOH.log("Loading Language file...", IOH.INFO); reload(); IOH.log("Language file loaded!", IOH.INFO); }