PageRenderTime 146ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/Essentials/src/com/earth2me/essentials/Essentials.java

https://github.com/BodyshotzVG/Essentials
Java | 686 lines | 592 code | 69 blank | 25 comment | 78 complexity | 0d820c8063944d412a37ca3ac8d4f095 MD5 | raw file
  1. /*
  2. * Essentials - a bukkit plugin
  3. * Copyright (C) 2011 Essentials Team
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. package com.earth2me.essentials;
  19. import com.earth2me.essentials.api.Economy;
  20. import com.earth2me.essentials.commands.EssentialsCommand;
  21. import java.io.*;
  22. import java.util.*;
  23. import java.util.logging.*;
  24. import org.bukkit.*;
  25. import org.bukkit.command.Command;
  26. import org.bukkit.command.CommandSender;
  27. import com.earth2me.essentials.commands.IEssentialsCommand;
  28. import com.earth2me.essentials.commands.NoChargeException;
  29. import com.earth2me.essentials.commands.NotEnoughArgumentsException;
  30. import com.earth2me.essentials.perm.PermissionsHandler;
  31. import com.earth2me.essentials.register.payment.Methods;
  32. import com.earth2me.essentials.signs.SignBlockListener;
  33. import com.earth2me.essentials.signs.SignEntityListener;
  34. import com.earth2me.essentials.signs.SignPlayerListener;
  35. import java.math.BigInteger;
  36. import java.util.regex.Matcher;
  37. import java.util.regex.Pattern;
  38. import org.bukkit.command.PluginCommand;
  39. import org.bukkit.entity.Player;
  40. import org.bukkit.event.Event.Priority;
  41. import org.bukkit.event.Event.Type;
  42. import org.bukkit.plugin.*;
  43. import org.bukkit.plugin.java.*;
  44. import org.bukkit.scheduler.BukkitScheduler;
  45. public class Essentials extends JavaPlugin implements IEssentials
  46. {
  47. public static final int BUKKIT_VERSION = 1060;
  48. private static final Logger LOGGER = Logger.getLogger("Minecraft");
  49. private transient ISettings settings;
  50. private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this);
  51. private transient Spawn spawn;
  52. private transient Jail jail;
  53. private transient Warps warps;
  54. private transient Worth worth;
  55. private transient List<IConf> confList;
  56. private transient Backup backup;
  57. private transient ItemDb itemDb;
  58. private transient EssentialsUpdateTimer updateTimer;
  59. private transient final Methods paymentMethod = new Methods();
  60. private transient final static boolean enableErrorLogging = false;
  61. private transient final EssentialsErrorHandler errorHandler = new EssentialsErrorHandler();
  62. private transient PermissionsHandler permissionsHandler;
  63. private transient UserMap userMap;
  64. @Override
  65. public ISettings getSettings()
  66. {
  67. return settings;
  68. }
  69. public void setupForTesting(final Server server) throws IOException, InvalidDescriptionException
  70. {
  71. final File dataFolder = File.createTempFile("essentialstest", "");
  72. if (!dataFolder.delete())
  73. {
  74. throw new IOException();
  75. }
  76. if (!dataFolder.mkdir())
  77. {
  78. throw new IOException();
  79. }
  80. LOGGER.log(Level.INFO, Util.i18n("usingTempFolderForTesting"));
  81. LOGGER.log(Level.INFO, dataFolder.toString());
  82. this.initialize(null, server, new PluginDescriptionFile(new FileReader(new File("src" + File.separator + "plugin.yml"))), dataFolder, null, null);
  83. settings = new Settings(this);
  84. userMap = new UserMap(this);
  85. permissionsHandler = new PermissionsHandler(this, false);
  86. Economy.setEss(this);
  87. }
  88. @Override
  89. public void onEnable()
  90. {
  91. final String[] javaversion = System.getProperty("java.version").split("\\.", 3);
  92. if (javaversion == null || javaversion.length < 2 || Integer.parseInt(javaversion[1]) < 6)
  93. {
  94. LOGGER.log(Level.SEVERE, "Java version not supported! Please install Java 1.6. You have " + System.getProperty("java.version"));
  95. }
  96. if (enableErrorLogging)
  97. {
  98. LOGGER.addHandler(errorHandler);
  99. }
  100. final EssentialsUpgrade upgrade = new EssentialsUpgrade(this);
  101. upgrade.beforeSettings();
  102. confList = new ArrayList<IConf>();
  103. settings = new Settings(this);
  104. confList.add(settings);
  105. upgrade.afterSettings();
  106. Util.updateLocale(settings.getLocale(), this);
  107. userMap = new UserMap(this);
  108. confList.add(userMap);
  109. spawn = new Spawn(getServer(), this.getDataFolder());
  110. confList.add(spawn);
  111. warps = new Warps(getServer(), this.getDataFolder());
  112. confList.add(warps);
  113. worth = new Worth(this.getDataFolder());
  114. confList.add(worth);
  115. itemDb = new ItemDb(this);
  116. confList.add(itemDb);
  117. reload();
  118. backup = new Backup(this);
  119. final PluginManager pm = getServer().getPluginManager();
  120. for (Plugin plugin : pm.getPlugins())
  121. {
  122. if (plugin.getDescription().getName().startsWith("Essentials")
  123. && !plugin.getDescription().getVersion().equals(this.getDescription().getVersion()))
  124. {
  125. LOGGER.log(Level.WARNING, Util.format("versionMismatch", plugin.getDescription().getName()));
  126. }
  127. }
  128. final Matcher versionMatch = Pattern.compile("git-Bukkit-([0-9]+).([0-9]+).([0-9]+)-[0-9]+-[0-9a-z]+-b([0-9]+)jnks.*").matcher(getServer().getVersion());
  129. if (versionMatch.matches())
  130. {
  131. final int versionNumber = Integer.parseInt(versionMatch.group(4));
  132. if (versionNumber < BUKKIT_VERSION)
  133. {
  134. LOGGER.log(Level.WARNING, Util.i18n("notRecommendedBukkit"));
  135. }
  136. }
  137. else
  138. {
  139. LOGGER.log(Level.INFO, Util.i18n("bukkitFormatChanged"));
  140. }
  141. permissionsHandler = new PermissionsHandler(this, settings.useBukkitPermissions());
  142. final EssentialsPluginListener serverListener = new EssentialsPluginListener(this);
  143. pm.registerEvent(Type.PLUGIN_ENABLE, serverListener, Priority.Low, this);
  144. pm.registerEvent(Type.PLUGIN_DISABLE, serverListener, Priority.Low, this);
  145. confList.add(serverListener);
  146. final EssentialsPlayerListener playerListener = new EssentialsPlayerListener(this);
  147. pm.registerEvent(Type.PLAYER_JOIN, playerListener, Priority.Monitor, this);
  148. pm.registerEvent(Type.PLAYER_QUIT, playerListener, Priority.Monitor, this);
  149. pm.registerEvent(Type.PLAYER_CHAT, playerListener, Priority.Lowest, this);
  150. pm.registerEvent(Type.PLAYER_COMMAND_PREPROCESS, playerListener, Priority.Lowest, this);
  151. pm.registerEvent(Type.PLAYER_MOVE, playerListener, Priority.High, this);
  152. pm.registerEvent(Type.PLAYER_LOGIN, playerListener, Priority.High, this);
  153. pm.registerEvent(Type.PLAYER_TELEPORT, playerListener, Priority.High, this);
  154. pm.registerEvent(Type.PLAYER_INTERACT, playerListener, Priority.High, this);
  155. pm.registerEvent(Type.PLAYER_EGG_THROW, playerListener, Priority.High, this);
  156. pm.registerEvent(Type.PLAYER_BUCKET_EMPTY, playerListener, Priority.High, this);
  157. pm.registerEvent(Type.PLAYER_ANIMATION, playerListener, Priority.High, this);
  158. final EssentialsBlockListener blockListener = new EssentialsBlockListener(this);
  159. pm.registerEvent(Type.BLOCK_PLACE, blockListener, Priority.Lowest, this);
  160. final SignBlockListener signBlockListener = new SignBlockListener(this);
  161. pm.registerEvent(Type.SIGN_CHANGE, signBlockListener, Priority.Highest, this);
  162. pm.registerEvent(Type.BLOCK_PLACE, signBlockListener, Priority.Low, this);
  163. pm.registerEvent(Type.BLOCK_BREAK, signBlockListener, Priority.Highest, this);
  164. pm.registerEvent(Type.BLOCK_IGNITE, signBlockListener, Priority.Low, this);
  165. pm.registerEvent(Type.BLOCK_BURN, signBlockListener, Priority.Low, this);
  166. pm.registerEvent(Type.BLOCK_PISTON_EXTEND, signBlockListener, Priority.Low, this);
  167. pm.registerEvent(Type.BLOCK_PISTON_RETRACT, signBlockListener, Priority.Low, this);
  168. final SignPlayerListener signPlayerListener = new SignPlayerListener(this);
  169. pm.registerEvent(Type.PLAYER_INTERACT, signPlayerListener, Priority.Low, this);
  170. final SignEntityListener signEntityListener = new SignEntityListener(this);
  171. pm.registerEvent(Type.ENTITY_EXPLODE, signEntityListener, Priority.Low, this);
  172. final EssentialsEntityListener entityListener = new EssentialsEntityListener(this);
  173. pm.registerEvent(Type.ENTITY_DAMAGE, entityListener, Priority.Lowest, this);
  174. pm.registerEvent(Type.ENTITY_COMBUST, entityListener, Priority.Lowest, this);
  175. pm.registerEvent(Type.ENTITY_DEATH, entityListener, Priority.Lowest, this);
  176. jail = new Jail(this);
  177. final JailPlayerListener jailPlayerListener = new JailPlayerListener(this);
  178. confList.add(jail);
  179. pm.registerEvent(Type.BLOCK_BREAK, jail, Priority.Low, this);
  180. pm.registerEvent(Type.BLOCK_DAMAGE, jail, Priority.Low, this);
  181. pm.registerEvent(Type.BLOCK_PLACE, jail, Priority.Low, this);
  182. pm.registerEvent(Type.PLAYER_INTERACT, jailPlayerListener, Priority.Low, this);
  183. pm.registerEvent(Type.PLAYER_RESPAWN, jailPlayerListener, Priority.High, this);
  184. pm.registerEvent(Type.PLAYER_TELEPORT, jailPlayerListener, Priority.High, this);
  185. pm.registerEvent(Type.PLAYER_JOIN, jailPlayerListener, Priority.High, this);
  186. if (settings.isNetherEnabled() && getServer().getWorlds().size() < 2)
  187. {
  188. getServer().createWorld(settings.getNetherName(), World.Environment.NETHER);
  189. }
  190. pm.registerEvent(Type.ENTITY_EXPLODE, tntListener, Priority.High, this);
  191. final EssentialsTimer timer = new EssentialsTimer(this);
  192. getScheduler().scheduleSyncRepeatingTask(this, timer, 1, 100);
  193. Economy.setEss(this);
  194. if (getSettings().isUpdateEnabled())
  195. {
  196. updateTimer = new EssentialsUpdateTimer(this);
  197. getScheduler().scheduleAsyncRepeatingTask(this, updateTimer, 20 * 60 * 10, 20 * 3600 * 6);
  198. }
  199. LOGGER.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), Util.joinList(this.getDescription().getAuthors())));
  200. }
  201. @Override
  202. public void onDisable()
  203. {
  204. Trade.closeLog();
  205. LOGGER.removeHandler(errorHandler);
  206. }
  207. @Override
  208. public void reload()
  209. {
  210. Trade.closeLog();
  211. for (IConf iConf : confList)
  212. {
  213. iConf.reloadConfig();
  214. }
  215. Util.updateLocale(settings.getLocale(), this);
  216. // for motd
  217. getConfiguration().load();
  218. }
  219. @Override
  220. public String[] getMotd(final CommandSender sender, final String def)
  221. {
  222. return getLines(sender, "motd", def);
  223. }
  224. @Override
  225. public String[] getLines(final CommandSender sender, final String node, final String def)
  226. {
  227. List<String> lines = (List<String>)getConfiguration().getProperty(node);
  228. if (lines == null)
  229. {
  230. return new String[0];
  231. }
  232. String[] retval = new String[lines.size()];
  233. if (lines.isEmpty() || lines.get(0) == null)
  234. {
  235. try
  236. {
  237. lines = new ArrayList<String>();
  238. // "[]" in YaML indicates empty array, so respect that
  239. if (!getConfiguration().getString(node, def).equals("[]"))
  240. {
  241. lines.add(getConfiguration().getString(node, def));
  242. retval = new String[lines.size()];
  243. }
  244. }
  245. catch (Throwable ex2)
  246. {
  247. LOGGER.log(Level.WARNING, Util.format("corruptNodeInConfig", node));
  248. return new String[0];
  249. }
  250. }
  251. // if still empty, call it a day
  252. if (lines == null || lines.isEmpty() || lines.get(0) == null)
  253. {
  254. return new String[0];
  255. }
  256. for (int i = 0; i < lines.size(); i++)
  257. {
  258. String m = lines.get(i);
  259. if (m == null)
  260. {
  261. continue;
  262. }
  263. m = m.replace('&', '§').replace("§§", "&");
  264. if (sender instanceof User || sender instanceof Player)
  265. {
  266. User user = getUser(sender);
  267. m = m.replace("{PLAYER}", user.getDisplayName());
  268. m = m.replace("{IP}", user.getAddress().toString());
  269. m = m.replace("{BALANCE}", Double.toString(user.getMoney()));
  270. m = m.replace("{MAILS}", Integer.toString(user.getMails().size()));
  271. m = m.replace("{WORLD}", user.getLocation().getWorld().getName());
  272. }
  273. int playerHidden = 0;
  274. for (Player p : getServer().getOnlinePlayers())
  275. {
  276. if (getUser(p).isHidden())
  277. {
  278. playerHidden++;
  279. }
  280. }
  281. m = m.replace("{ONLINE}", Integer.toString(getServer().getOnlinePlayers().length - playerHidden));
  282. m = m.replace("{UNIQUE}", Integer.toString(userMap.getUniqueUsers()));
  283. if (m.matches(".*\\{PLAYERLIST\\}.*"))
  284. {
  285. StringBuilder online = new StringBuilder();
  286. for (Player p : getServer().getOnlinePlayers())
  287. {
  288. if (getUser(p).isHidden())
  289. {
  290. continue;
  291. }
  292. if (online.length() > 0)
  293. {
  294. online.append(", ");
  295. }
  296. online.append(p.getDisplayName());
  297. }
  298. m = m.replace("{PLAYERLIST}", online.toString());
  299. }
  300. if (sender instanceof Player)
  301. {
  302. try
  303. {
  304. Class User = getClassLoader().loadClass("bukkit.Vandolis.User");
  305. Object vuser = User.getConstructor(User.class).newInstance((Player)sender);
  306. m = m.replace("{RED:BALANCE}", User.getMethod("getMoney").invoke(vuser).toString());
  307. m = m.replace("{RED:BUYS}", User.getMethod("getNumTransactionsBuy").invoke(vuser).toString());
  308. m = m.replace("{RED:SELLS}", User.getMethod("getNumTransactionsSell").invoke(vuser).toString());
  309. }
  310. catch (Throwable ex)
  311. {
  312. m = m.replace("{RED:BALANCE}", "N/A");
  313. m = m.replace("{RED:BUYS}", "N/A");
  314. m = m.replace("{RED:SELLS}", "N/A");
  315. }
  316. }
  317. retval[i] = m + " ";
  318. }
  319. return retval;
  320. }
  321. @Override
  322. public boolean onCommand(final CommandSender sender, final Command command, final String commandLabel, final String[] args)
  323. {
  324. return onCommandEssentials(sender, command, commandLabel, args, Essentials.class.getClassLoader(), "com.earth2me.essentials.commands.Command", "essentials.");
  325. }
  326. @Override
  327. public boolean onCommandEssentials(final CommandSender sender, final Command command, final String commandLabel, final String[] args, final ClassLoader classLoader, final String commandPath, final String permissionPrefix)
  328. {
  329. // Allow plugins to override the command via onCommand
  330. if (!getSettings().isCommandOverridden(command.getName()) && !commandLabel.startsWith("e"))
  331. {
  332. for (Plugin p : getServer().getPluginManager().getPlugins())
  333. {
  334. if (p.getDescription().getMain().contains("com.earth2me.essentials"))
  335. {
  336. continue;
  337. }
  338. final PluginDescriptionFile desc = p.getDescription();
  339. if (desc == null)
  340. {
  341. continue;
  342. }
  343. if (desc.getName() == null)
  344. {
  345. continue;
  346. }
  347. final PluginCommand pc = getServer().getPluginCommand(desc.getName() + ":" + commandLabel);
  348. if (pc != null)
  349. {
  350. return pc.execute(sender, commandLabel, args);
  351. }
  352. }
  353. }
  354. try
  355. {
  356. User user = null;
  357. if (sender instanceof Player)
  358. {
  359. user = getUser(sender);
  360. LOGGER.log(Level.INFO, String.format("[PLAYER_COMMAND] %s: /%s %s ", ((Player)sender).getName(), commandLabel, EssentialsCommand.getFinalArg(args, 0)));
  361. }
  362. // New mail notification
  363. if (user != null && !getSettings().isCommandDisabled("mail") && !commandLabel.equals("mail") && user.isAuthorized("essentials.mail"))
  364. {
  365. final List<String> mail = user.getMails();
  366. if (mail != null && !mail.isEmpty())
  367. {
  368. user.sendMessage(Util.format("youHaveNewMail", mail.size()));
  369. }
  370. }
  371. // Check for disabled commands
  372. if (getSettings().isCommandDisabled(commandLabel))
  373. {
  374. return true;
  375. }
  376. IEssentialsCommand cmd;
  377. try
  378. {
  379. cmd = (IEssentialsCommand)classLoader.loadClass(commandPath + command.getName()).newInstance();
  380. cmd.setEssentials(this);
  381. }
  382. catch (Exception ex)
  383. {
  384. sender.sendMessage(Util.format("commandNotLoaded", commandLabel));
  385. LOGGER.log(Level.SEVERE, Util.format("commandNotLoaded", commandLabel), ex);
  386. return true;
  387. }
  388. // Check authorization
  389. if (user != null && !user.isAuthorized(cmd, permissionPrefix))
  390. {
  391. LOGGER.log(Level.WARNING, Util.format("deniedAccessCommand", user.getName()));
  392. user.sendMessage(Util.i18n("noAccessCommand"));
  393. return true;
  394. }
  395. // Run the command
  396. try
  397. {
  398. if (user == null)
  399. {
  400. cmd.run(getServer(), sender, commandLabel, command, args);
  401. }
  402. else
  403. {
  404. cmd.run(getServer(), user, commandLabel, command, args);
  405. }
  406. return true;
  407. }
  408. catch (NoChargeException ex)
  409. {
  410. return true;
  411. }
  412. catch (NotEnoughArgumentsException ex)
  413. {
  414. sender.sendMessage(command.getDescription());
  415. sender.sendMessage(command.getUsage().replaceAll("<command>", commandLabel));
  416. return true;
  417. }
  418. catch (Throwable ex)
  419. {
  420. showError(sender, ex, commandLabel);
  421. return true;
  422. }
  423. }
  424. catch (Throwable ex)
  425. {
  426. LOGGER.log(Level.SEVERE, Util.format("commandFailed", commandLabel), ex);
  427. return true;
  428. }
  429. }
  430. @Override
  431. public void showError(final CommandSender sender, final Throwable exception, final String commandLabel)
  432. {
  433. sender.sendMessage(Util.format("errorWithMessage", exception.getMessage()));
  434. final LogRecord logRecord = new LogRecord(Level.WARNING, Util.format("errorCallingCommand", commandLabel));
  435. logRecord.setThrown(exception);
  436. if (getSettings().isDebug())
  437. {
  438. LOGGER.log(logRecord);
  439. }
  440. else
  441. {
  442. if (enableErrorLogging)
  443. {
  444. errorHandler.publish(logRecord);
  445. errorHandler.flush();
  446. }
  447. }
  448. }
  449. @Override
  450. public BukkitScheduler getScheduler()
  451. {
  452. return this.getServer().getScheduler();
  453. }
  454. @Override
  455. public Jail getJail()
  456. {
  457. return jail;
  458. }
  459. @Override
  460. public Warps getWarps()
  461. {
  462. return warps;
  463. }
  464. @Override
  465. public Worth getWorth()
  466. {
  467. return worth;
  468. }
  469. @Override
  470. public Backup getBackup()
  471. {
  472. return backup;
  473. }
  474. @Override
  475. public Spawn getSpawn()
  476. {
  477. return spawn;
  478. }
  479. @Override
  480. public User getUser(final Object base)
  481. {
  482. if (base instanceof Player)
  483. {
  484. return getUser((Player)base);
  485. }
  486. if (base instanceof String)
  487. {
  488. try
  489. {
  490. return userMap.getUser((String)base);
  491. }
  492. catch (NullPointerException ex)
  493. {
  494. return null;
  495. }
  496. }
  497. return null;
  498. }
  499. private <T extends Player> User getUser(final T base)
  500. {
  501. if (base == null)
  502. {
  503. return null;
  504. }
  505. if (base instanceof User)
  506. {
  507. return (User)base;
  508. }
  509. try
  510. {
  511. return userMap.getUser(base.getName()).update(base);
  512. }
  513. catch (NullPointerException ex)
  514. {
  515. return new User(base, this);
  516. }
  517. }
  518. @Override
  519. public User getOfflineUser(final String name)
  520. {
  521. try
  522. {
  523. return userMap.getUser(name);
  524. }
  525. catch (NullPointerException ex)
  526. {
  527. return null;
  528. }
  529. }
  530. @Override
  531. public World getWorld(final String name)
  532. {
  533. if (name.matches("[0-9]+"))
  534. {
  535. final int worldId = Integer.parseInt(name);
  536. if (worldId < getServer().getWorlds().size())
  537. {
  538. return getServer().getWorlds().get(worldId);
  539. }
  540. }
  541. return getServer().getWorld(name);
  542. }
  543. @Override
  544. public void addReloadListener(final IConf listener)
  545. {
  546. confList.add(listener);
  547. }
  548. @Override
  549. public Methods getPaymentMethod()
  550. {
  551. return paymentMethod;
  552. }
  553. @Override
  554. public int broadcastMessage(final IUser sender, final String message)
  555. {
  556. if (sender == null) {
  557. return getServer().broadcastMessage(message);
  558. }
  559. if (sender.isHidden()) {
  560. return 0;
  561. }
  562. final Player[] players = getServer().getOnlinePlayers();
  563. for (Player player : players)
  564. {
  565. final User user = getUser(player);
  566. if (!user.isIgnoredPlayer(sender.getName()))
  567. {
  568. player.sendMessage(message);
  569. }
  570. }
  571. return players.length;
  572. }
  573. public Map<BigInteger, String> getErrors()
  574. {
  575. return errorHandler.getErrors();
  576. }
  577. @Override
  578. public int scheduleAsyncDelayedTask(final Runnable run)
  579. {
  580. return this.getScheduler().scheduleAsyncDelayedTask(this, run);
  581. }
  582. @Override
  583. public int scheduleSyncDelayedTask(final Runnable run)
  584. {
  585. return this.getScheduler().scheduleSyncDelayedTask(this, run);
  586. }
  587. @Override
  588. public int scheduleSyncDelayedTask(final Runnable run, final long delay)
  589. {
  590. return this.getScheduler().scheduleSyncDelayedTask(this, run, delay);
  591. }
  592. @Override
  593. public int scheduleSyncRepeatingTask(final Runnable run, final long delay, final long period)
  594. {
  595. return this.getScheduler().scheduleSyncRepeatingTask(this, run, delay, period);
  596. }
  597. @Override
  598. public TNTExplodeListener getTNTListener()
  599. {
  600. return tntListener;
  601. }
  602. @Override
  603. public PermissionsHandler getPermissionsHandler()
  604. {
  605. return permissionsHandler;
  606. }
  607. @Override
  608. public ItemDb getItemDb()
  609. {
  610. return itemDb;
  611. }
  612. @Override
  613. public UserMap getUserMap()
  614. {
  615. return userMap;
  616. }
  617. }