혈맹창고내역
에쓰 패킷박스
/** 혈맹 창고 사용 목록 */
public static final int CLAN_WAREHOUSE_LIST = 117;
public S_PacketBox(L1PcInstance pc, int subCode) {
case CLAN_WAREHOUSE_LIST:
int count = 0;
Connection con = null;
PreparedStatement pstm = null;
PreparedStatement pstm2 = null;
PreparedStatement pstm3 = null;
ResultSet rs = null;
ResultSet rs3 = null;
try {
con = L1DatabaseFactory.getInstance().getConnection();
pstm = con.prepareStatement("SELECT id, time FROM clan_warehouse_log WHERE clan_name='" + pc.getClanname() + "'");
rs = pstm.executeQuery();
while (rs.next()) {
if (System.currentTimeMillis() - rs.getTimestamp(2).getTime() > 4320000) {// 3일
pstm2 = con.prepareStatement("DELETE FROM clan_warehouse_log WHERE id='" + rs.getInt(1) + "'");
pstm2.execute();
} else
count++;
}
writeD(count);
pstm3 = con.prepareStatement("SELECT name, item_name, item_count, type, time FROM clan_warehouse_log WHERE clan_name='"
+ pc.getClanname() + "'");
rs3 = pstm3.executeQuery();
while (rs3.next()) {
writeS(rs3.getString(1));
writeC(rs3.getInt(4));// 0:맡김 1:찾음
writeS(rs3.getString(2));
writeD(rs3.getInt(3));
writeD((int) (System.currentTimeMillis() - rs3.getTimestamp(5).getTime()) / 60000);// 경과시간 분
}
} catch (SQLException e) {
} finally {
SQLUtil.close(rs, pstm, con);
SQLUtil.close(pstm2);
SQLUtil.close(rs3);
SQLUtil.close(pstm3);
}
break;
씨 엔피시액션자바
} else if (npcid == 50527 || npcid == 50505 || npcid == 50519
|| npcid == 50545 || npcid == 50531 || npcid == 50529
|| npcid == 50516 || npcid == 50538 || npcid == 50518
|| npcid == 50509 || npcid == 50536 || npcid == 50520
|| npcid == 50543 || npcid == 50526 || npcid == 50512
|| npcid == 50510 || npcid == 50504 || npcid == 50525
|| npcid == 50534 || npcid == 50540 || npcid == 50515
|| npcid == 50513 || npcid == 50528 || npcid == 50533
|| npcid == 50542 || npcid == 50511 || npcid == 50501
|| npcid == 50503 || npcid == 50508 || npcid == 50514
|| npcid == 50532 || npcid == 50544 || npcid == 50524
|| npcid == 50535 || npcid == 50521 || npcid == 50517
|| npcid == 50537 || npcid == 50539 || npcid == 50507
|| npcid == 50530 || npcid == 50502 || npcid == 50506
|| npcid == 50522 || npcid == 50541 || npcid == 50523
|| npcid == 50620 || npcid == 50623 || npcid == 50619
|| npcid == 50621 || npcid == 50622 || npcid == 50624
|| npcid == 50617 || npcid == 50614 || npcid == 50618
|| npcid == 50616 || npcid == 50615 || npcid == 50626
|| npcid == 50627 || npcid == 50628 || npcid == 50629
|| npcid == 50630 || npcid == 50631) {
String sellHouseMessage = sellHouse(pc, objid, npcid);
if (sellHouseMessage != null) {
htmlid = sellHouseMessage;
}
} else {
pc.sendPackets(new S_ShopBuyList(objid, pc));
}
} else if (s.equalsIgnoreCase("history")) {
if (pc.getClanid() == 0) {
pc.sendPackets(new S_ChatPacket(pc,"혈맹창고를 사용하려면 혈맹이 있어야 합니다."));
return;
}
if (isTwoLogin(pc)){
return;
}
if (pc.getClan() != null) {
if (!(pc.getClanRank() == L1Clan.CLAN_RANK_PROBATION || pc.getClanRank() == L1Clan.CLAN_RANK_PUBLIC)) {
pc.sendPackets(new S_PacketBox(pc, S_PacketBox.CLAN_WAREHOUSE_LIST));
} else{
pc.sendPackets(new S_ServerMessage(728));
}
}
씨 Result자바 거나 에바팩은 샵뭐시기 창고관련자바로
혈맹관련 맡기기쯤에
UpdateLog(pc.getName(), pc.getClanname(), item.getName(), count, 0); //크란 맡기기
혈맹관련 찾기쯤에
UpdateLog(pc.getName(), pc.getClanname(), item.getName(), count, 1); //크란 찾기
메소드는 아래쪽에
private static void UpdateLog(String name, String clanname, String itemname, int count, int type) {//적당히 추가
Connection con = null;
PreparedStatement pstm = null;
Timestamp time = new Timestamp(System.currentTimeMillis());
try {
con = L1DatabaseFactory.getInstance().getConnection();
pstm = con.prepareStatement("INSERT INTO clan_warehouse_log SET name=?, clan_name=?, item_name=?, item_count=?, type=?, time=?");
pstm.setString(1, name);
pstm.setString(2, clanname);
pstm.setString(3, itemname);
pstm.setInt(4, count);
pstm.setInt(5, type);
pstm.setTimestamp(6, time);
pstm.execute();
} catch (SQLException e) {
} finally {
SQLUtil.close(pstm);
SQLUtil.close(con);
}
}
끝인가? 첨부파일받으시고 나비켓에 배치하시기바랍니다.

오징어소녀 님의 최근 댓글
db 부분에서 추가 하시면 됩니다 2016 04.18