창고템 볼수 있게 해주는 유저 커맨드
프리서버 오픈소스 리니지 창고템 볼수 있게 해주는 유저 커맨드
유저 커맨드에 추가
} else if (cmd.equalsIgnoreCase("창고")) {
search_ware(pc, param) ;
// .창고
private void search_ware( L1PcInstance pc, String param ) {
try {
StringTokenizer tok = new StringTokenizer(param) ;
String name = tok.nextToken() ;
search_ware2(pc, name) ;
} catch (Exception e) {
pc.sendPackets(new S_SystemMessage(".창고 케릭아이디를 적어주시기 바랍니다")) ;
}
}
private void search_ware2( L1PcInstance pc, String param ) {
try {
String accountname = null ; // account_name
String S_objid = null ; // objid
String S_itemname = null ; // 아이템
String S_count = null ; // 수량
String S_enchanlvl = null ; // 인첸
int count1 = 0 ;
int count3 = 0 ;
java.sql.Connection accountObjid = null ;
accountObjid = L1DatabaseFactory.getInstance().getConnection() ;
PreparedStatement Query_objid = null ;
Query_objid = accountObjid
.prepareStatement("select objid,account_name from characters where char_name = '"+ param + "'") ;
ResultSet rs0 = Query_objid.executeQuery() ;
while (rs0.next()) {
S_objid = rs0.getString(1) ;
accountname = rs0.getString(2) ;
pc.sendPackets(new S_SystemMessage("캐릭명:" + param + " 계정:"
+ accountname + " objic:" + S_objid)) ;
count1++ ;
}
// account 계정명으로 창고를 검색
java.sql.Connection personWarehouse = null ;
personWarehouse = L1DatabaseFactory.getInstance().getConnection() ;
PreparedStatement Query_personWarehouse = null ;
Query_personWarehouse = personWarehouse
.prepareStatement("select item_name,count,enchantlvl from character_warehouse where account_name = '"+ accountname+ "' ORDER BY 'enchantlvl' DESC, 'item_name' LIMIT 300") ;
ResultSet rs2 = Query_personWarehouse.executeQuery() ;
pc.sendPackets(new S_SystemMessage("--------------------<<개인창고>>--------------------")) ;
while (rs2.next()) {
S_itemname = rs2.getString(1) ; // 아이템 이름
S_count = rs2.getString(2) ; // 수량
S_enchanlvl = rs2.getString(3) ; // 인첸레벨
pc.sendPackets(new S_SystemMessage("+" + S_enchanlvl +" "+ S_itemname + "["
+ S_count + "]")) ;
count3++ ;
}
rs0.close() ;
rs2.close() ;
Query_objid.close() ;
Query_personWarehouse.close() ;
pc.sendPackets(new S_SystemMessage("<<개인창고>>:" + count3 + "개의 아이템 검색을 완료 하였습니다.")) ;
} catch (Exception e) {}
}
출처 : 린프리

찰떡01 님의 최근 댓글
ㄳ 2023 06.17 ㄱㅅ 2020 12.19 클라 공유 부탁드립니다. 2020 12.19 ㄱㅅ 2020 11.26 ㄱㅅ 2020 11.05