發現滿多人喜歡販賣所有道具
另外用了個資料表shop_sell_price之類的
但是卻因為價錢沒設定好
被玩家買了便宜 賣商店又高於買的價錢 達到洗錢的效果
偵測小方法
物件:ShopTable
搜尋loadShopAllSell
在int price = rs.getInt("sell_price");以下if(price >= 1) {以上貼上下面的程式碼
//修正販賣價錢錯誤問題
if (price >= 1) {
Connection conI = null;
PreparedStatement pstmI = null;
ResultSet rsI = null;
try {
conI = L1DatabaseFactory.getInstance().getConnection();
pstmI = conI.prepareStatement("SELECT * FROM shop WHERE item_id='"+ itemId+"'");
rsI = pstmI.executeQuery();
while (rsI.next()) {
if (rsI.getInt("selling_price") >= 1 && price > rsI.getInt("selling_price")) {
System.out.println("NpcId="+rsI.getInt("npc_id")+", ItemID="+itemId+", PriceError!!!");
price = -1;
}
}
rsI.close();
} catch (SQLException e) {
_log.log(Level.SEVERE, e.getLocalizedMessage(), e);
} finally {
SQLUtil.close(rsI, pstmI, conI);
}
}
|