일본팩에서 해상전 추출 통으로~ 마지막
L1DoorGfx.java 이자바도 통으로..
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package jp.l1j.server.templates;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import jp.l1j.server.utils.L1DatabaseFactory;
import jp.l1j.server.utils.SqlUtil;
public class L1DoorGfx {
private static Logger _log = Logger.getLogger(L1DoorGfx.class.getName());
private final int _gfxId;
private final int _direction;
private final int _rightEdgeOffset;
private final int _leftEdgeOffset;
public L1DoorGfx(int gfxId, int direction, int rightEdgeOffset,
int leftEdgeOffset) {
_gfxId = gfxId;
_direction = direction;
_rightEdgeOffset = rightEdgeOffset;
_leftEdgeOffset = leftEdgeOffset;
}
public int getGfxId() {
return _gfxId;
}
public int getDirection() {
return _direction;
}
public int getRightEdgeOffset() {
return _rightEdgeOffset;
}
public int getLeftEdgeOffset() {
return _leftEdgeOffset;
}
/**
* door_gfxsテーブルから指定されたgfxidを主キーとする行を返します。<br>
* このメソッドは常に最新のデータをテーブルから返します。
*
* @param gfxId
* @return
*/
public static L1DoorGfx findByGfxId(int gfxId) {
Connection con = null;
PreparedStatement pstm = null;
ResultSet rs = null;
try {
con = L1DatabaseFactory.getInstance().getConnection();
pstm = con
.prepareStatement("SELECT * FROM door_gfxs WHERE gfx_id = ?");
pstm.setInt(1, gfxId);
rs = pstm.executeQuery();
if (!rs.next()) {
return null;
}
int id = rs.getInt("gfx_id");
int dir = rs.getInt("direction");
int rEdge = rs.getInt("right_edge_offset");
int lEdge = rs.getInt("left_edge_offset");
return new L1DoorGfx(id, dir, rEdge, lEdge);
} catch (SQLException e) {
_log.log(Level.SEVERE, e.getLocalizedMessage(), e);
} finally {
SqlUtil.close(rs);
SqlUtil.close(pstm);
SqlUtil.close(con);
}
return null;
}
}
좀더 많은 자료라 공유되길 바라면서..
뭐 에바자료는아니지만 그래도 공부하실분은 공부하실거라 믿고 올려요~
나머지 추가자바는 첨부파일로 올릴게요~^^
[출처] 일본팩에서 해상전 추출 통으로~ 마지막 (비공개 카페)

준희미니 님의 최근 댓글
rt 2021 05.25 ㄳ 2021 05.11 ㄳ 2021 05.11 rt 2021 05.09 rt 2021 04.25