Example #1
0
  public HashMap<String, RunsafeInventory> getKits() {
    HashMap<String, RunsafeInventory> kits = new HashMap<String, RunsafeInventory>(0);

    for (IRow row : database.query("SELECT `ID`, `inventory` FROM `toolbox_kits`")) {
      RunsafeInventory inventory = server.createInventory(null, 36);
      inventory.unserialize(row.String("inventory"));
      kits.put(row.String("ID"), inventory);
    }

    return kits;
  }
Example #2
0
 public void saveKit(String name, RunsafeInventory kit) {
   String inventory = kit.serialize();
   database.execute(
       "INSERT INTO `toolbox_kits` (`ID`, `inventory`) VALUES(?, ?) ON DUPLICATE KEY UPDATE `inventory` = ?",
       name,
       inventory,
       inventory);
 }