示例#1
0
 public void refreshCurrentView(final int newTab, final int newType) {
   currentViewingItems.clear();
   if (newTab == 1) {
     currentViewingItems = MTSStorage.getInstance().getBuyNow(newType);
   } else if (newTab == 4) {
     for (int i : cart) {
       if (newType == 0 || (GameConstants.getInventoryType(i).getType() == newType)) {
         currentViewingItems.add(i);
       }
     }
   }
 }
示例#2
0
 public void loadNotYetSold() throws SQLException {
   final PreparedStatement ps =
       DatabaseConnection.getConnection()
           .prepareStatement("SELECT * FROM mts_items WHERE characterid = ?");
   ps.setInt(1, characterId);
   final ResultSet rs = ps.executeQuery();
   int pId;
   while (rs.next()) {
     pId = rs.getInt("id");
     if (MTSStorage.getInstance().check(pId)) {
       notYetSold.add(pId);
     }
   }
   rs.close();
   ps.close();
 }
示例#3
0
 public void loadCart() throws SQLException {
   final PreparedStatement ps =
       DatabaseConnection.getConnection()
           .prepareStatement("SELECT * FROM mts_cart WHERE characterid = ?");
   ps.setInt(1, characterId);
   final ResultSet rs = ps.executeQuery();
   int iId;
   while (rs.next()) {
     iId = rs.getInt("itemid");
     if (iId < 0) {
       owedNX -= iId;
     } else if (MTSStorage.getInstance().check(iId)) {
       cart.add(iId);
     }
   }
   rs.close();
   ps.close();
 }