사이트 로그인
2016.05.18 22:03
자바이름은 제 주관적인 이름입니다
l1j/server/model // 추가
자바 파일 ssibak.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 l1j.server.model;
import java.util.EnumMap;
import java.util.logging.Logger;
import l1j.configure.Config;
import l1j.server.datatables.ssibakLogTable;
import l1j.server.datatables.SprTable;
import l1j.server.model.instance.L1PcInstance;
import l1j.server.packets.server.S_Disconnect;
import l1j.server.packets.server.S_Paralysis;
import l1j.server.packets.server.S_SystemMessage;
// 어떤놈인지 한번잡아보자 한번해보자
public class ssibak {
private static Logger _log =
Logger.getLogger(ssibak.class.getName());
private final L1PcInstance _pc;
private int _injusticeCount;
private int _justiceCount;
private static final int INJUSTICE_COUNT_LIMIT = Config.INJUSTICE_COUNT;
private static final int JUSTICE_COUNT_LIMIT = Config.JUSTICE_COUNT;
// 이동과 공격 간격은 달라. 착각하면안되겟지?
// 일단 테스트니 나의임의로 5를 내려주어야징
private static final double CHECK_STRICTNESS =
(Config.CHECK_STRICTNESS - 5) / 100D;
private static final double HASTE_RATE = 0.75; // 속도 * 1.33
private static final double WAFFLE_RATE = 0.87; // 속도 * 1.15
private static final double STANDARD_RATE = 1.00;
private final EnumMap<ACT_TYPE, Long> _actTimers =
new EnumMap<ACT_TYPE, Long>(ACT_TYPE.class);
private final EnumMap<ACT_TYPE, Long> _checkTimers =
new EnumMap<ACT_TYPE, Long>(ACT_TYPE.class);
public static enum ACT_TYPE {
MOVE, ATTACK, SPELL_DIR, SPELL_NODIR
}
// 결과
public static final int R_OK = 0;
public static final int R_DETECTED = 1;
public static final int R_DISPOSED = 2;
public ssibak(L1PcInstance pc) {
_pc = pc;
_injusticeCount = 0;
_justiceCount = 0;
long now = System.currentTimeMillis();
for (ACT_TYPE each : ACT_TYPE.values()) {
_actTimers.put(each, now);
_checkTimers.put(each, now);
}
}
// 서버 폭격으로인한 잘못된 판단으로 프레임으로 추방할수도있다.
// 0 1 2
public int checkInterval(ACT_TYPE type) {
int result = R_OK;
long now = System.currentTimeMillis();
long interval = now - _actTimers.get(type);
int rightInterval = getRightInterval(type);
interval *= CHECK_STRICTNESS;
double rate = (double) interval / rightInterval;
if (0 < rate && rate < STANDARD_RATE) {
_injusticeCount++;
_justiceCount = 0;
if (_injusticeCount >= INJUSTICE_COUNT_LIMIT) {
doPunishment();
return R_DISPOSED;
}
result = R_DETECTED;
} else if (rate >= STANDARD_RATE) {
_justiceCount++;
if (_justiceCount >= JUSTICE_COUNT_LIMIT) {
_injusticeCount = 0;
_justiceCount = 0;
}
}
_actTimers.put(type, now);
return result;
}
// 네이놈 걸렷구나
private void doPunishment() {
int punishment_type = Math.abs(Config.PUNISHMENT_TYPE);
int punishment_time = Math.abs(Config.PUNISHMENT_TIME);
int punishment_mapid = Math.abs(Config.PUNISHMENT_MAP_ID);
if (!_pc.isGm()) {
int x = _pc.getX() ,y = _pc.getY() ,mapid = _pc.getMapId();// 위치확인
switch (punishment_type) {
case 0: // 꺼져버려 종료시키자
_pc.sendPackets(new S_SystemMessage(String.format(I18N_ssibak_DISCONNECT_THE_CONNECTION, punishment_time)));
// 너는 걸렷으니 게임을 종료시킬거야
try {
Thread.sleep(punishment_time * 1000);
} catch (Exception e) {
System.out.println(e.getLocalizedMessage());
}
_pc.saveInventory();
_pc.sendPackets(new S_Disconnect());
break;
case 1:// 못움직이게
_pc.sendPackets(new S_Paralysis(S_Paralysis.TYPE_BIND, true));
_pc.sendPackets(new S_SystemMessage(String.format(I18N_ssibak_STOP_THE_ACTION, punishment_time)));
// 너는 걸렷으니 게임을 종료시킬거야
try {
Thread.sleep(punishment_time * 1000);
} catch (Exception e) {
System.out.println(e.getLocalizedMessage());
}
_pc.sendPackets(new S_Paralysis(S_Paralysis.TYPE_BIND, false));
break;
case 2:// 조용히시키자
L1Teleport.teleport(_pc, 32737, 32796, (short) punishment_mapid, 5, false);
_pc.sendPackets(new S_SystemMessage(String.format(I18N_ssibak_MOVE_TO_THE_ISOLATION_MAP, punishment_time)));
// 걸렷으니 해당맵으로 강제로 보내버려 슝~
try {
Thread.sleep(punishment_time * 1000);
} catch (Exception e) {
System.out.println(e.getLocalizedMessage());
}
L1Teleport.teleport(_pc, x, y, (short) mapid, 5, false);
break;
}
} else {
// 나는 운영자이니깐 안되지요
if (Config.DEBUG_MODE) {
_pc.sendPackets(new S_SystemMessage("네이놈 잘걸렸다."));
_pc.sendPackets(new S_SystemMessage(I18N_ssibak_OVERSPEED_DETECTED));
//너걸렷다.
}
}
_injusticeCount = 0;
_justiceCount = 0;
if (Config.LOGGING_ssibak) {
ssibakLogTable logssibak = new ssibakLogTable();
logssibak.storeLogssibak(_pc);// 일단 어떤놈인지 기록을
}
}
//디도스나 서버폭격으로 프레임이나 패킷때문에 임의로 할수있으니 올바르게
// 공격 이동 등.
private int getRightInterval(ACT_TYPE type) {
int interval;
switch (type) {
case ATTACK:
interval = SprTable.getInstance().getAttackSpeed(_pc.getTempCharGfx(),
_pc.getCurrentWeapon() + 1);
break;
case MOVE:
interval = SprTable.getInstance().getMoveSpeed(_pc.getTempCharGfx(),
_pc.getCurrentWeapon());
break;
case SPELL_DIR:
interval = SprTable.getInstance().getDirSpellSpeed(_pc.getTempCharGfx());
break;
case SPELL_NODIR:
interval = SprTable.getInstance().getNodirSpellSpeed(_pc.getTempCharGfx());
break;
default:
return 0;
}
if (_pc.isHaste()) { //헤이
interval *= HASTE_RATE;
}
if (_pc.isSlow()) { //슬로우
interval /= HASTE_RATE;
}
if (_pc.isBrave()) { // 용기
interval *= HASTE_RATE;
}
if (_pc.isElfBrave()) { // 와퍼
interval *= WAFFLE_RATE;
}
if (type.equals(ACT_TYPE.MOVE) && _pc.isFastMovable()) { // 홀리 윈드 무빙
interval *= HASTE_RATE;
}
if (type.equals(ACT_TYPE.ATTACK) && _pc.isFastAttackable()) { // 블러드
interval *= HASTE_RATE * WAFFLE_RATE;
}
if (type.equals(ACT_TYPE.MOVE) && _pc.isRIBRAVE()) { // 유그드라
interval *= WAFFLE_RATE;
}
if (_pc.isThirdSpeed()) { // 3단
interval *= WAFFLE_RATE;
}
if (_pc.isWindShackle()) { // 윈드
interval /= 2;
}
if(_pc.getMapId() == 5143) { // 펫레이징부분
interval *= 0.1;
}
return interval;
}
}
//////////////////////////////////////////////////////////////////////////////
import l1j.server.datatables폴더
ssibakLogTable 자바 생성
/*
* 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 l1j.server.datatables;
import java.sql.PreparedStatement;
import java.util.logging.Level;
import java.util.logging.Logger;
import l1j.server.model.instance.L1PcInstance;
import l1j.server.utils.L1DatabaseFactory;
import l1j.server.utils.SqlUtil;
public class ssibakLogTable {
private static Logger _log = Logger.getLogger(ssibakTable.class.getName());
public void storessibak(L1PcInstance pc) {
java.sql.Connection con = null;
PreparedStatement pstm = null;
try {
con = L1DatabaseFactory.getInstance().getConnection();
pstm = con.prepareStatement("INSERT INTO ssibak_logs SET account_id=?, char_id=?, clan_id=?, map_id=?, loc_x=?, loc_y=?, datetime=SYSDATE()");
pstm.setInt(1, pc.getAccountId());
pstm.setInt(2, pc.getId());
pstm.setInt(3, pc.getClanId());
pstm.setInt(4, pc.getMapId());
pstm.setInt(5, pc.getX());
pstm.setInt(6, pc.getY());
pstm.execute();
} catch (Exception e) {
_log.log(Level.SEVERE, e.getLocalizedMessage(), e);
} finally {
SqlUtil.close(pstm);
SqlUtil.close(con);
}
}
}
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
공지 | 소스자료는 직접 올려주세요 | 게임존 | 2017.06.06 | 550 |
159 | 통합 쓰레드(Thread) 소스!! 알고리즘? | 김닉넴 | 2016.05.20 | 102 |
158 | 보스몹 멘트 띄우기 | 김닉넴 | 2016.05.19 | 120 |
157 | 로또복권 | 김닉넴 | 2016.05.19 | 80 |
156 | 불량 채팅 검출 | 김닉넴 | 2016.05.19 | 51 |
155 | 실시간 레벨제한 | 김닉넴 | 2016.05.19 | 59 |
154 | 여관 들어가기 | 김닉넴 | 2016.05.19 | 46 |
153 | 영자들끼리 대화 | 김닉넴 | 2016.05.19 | 96 |
152 | 영자 명령어 경치 복구 | 김닉넴 | 2016.05.19 | 39 |
151 | 오토루팅 | 김닉넴 | 2016.05.19 | 244 |
150 | 퀘스트템 자동 지급 소스 | 김닉넴 | 2016.05.19 | 115 |
149 | 초반 말하는 두루마리 지급 부분 본섭화 | 김닉넴 | 2016.05.19 | 59 |
148 | l1skilluse.handlecommands - null point 에러 | 야호 | 2016.05.19 | 47 |
147 | 기억창 소스 | 김닉넴 | 2016.05.18 | 127 |
146 | gm명령 메모리솔류션 | 김닉넴 | 2016.05.18 | 102 |
145 | 오림시스템 | 김닉넴 | 2016.05.18 | 80 |
» | 너스핵쓰냐?잡아본다 [2] | 김닉넴 | 2016.05.18 | 202 |
143 | 마을경비 입구가져오는몹 죽이는법 | 김닉넴 | 2016.05.18 | 58 |
142 | 던전 타이머 소스 | 김닉넴 | 2016.05.18 | 102 |
141 | 낚시터 드랍경로 [1] | 김닉넴 | 2016.05.18 | 88 |
140 | 허수아비렙제 | 김닉넴 | 2016.05.18 | 99 |
139 | 운영자 명령어 [혈전시작] 추가방법 | 김닉넴 | 2016.05.18 | 71 |
138 | 같은혈 용병로봇들이 상대방혈의 로봇들 치게 하는방법.[초코님 점팩 기준] | 김닉넴 | 2016.05.18 | 285 |
137 | 파티원 수 늘리기 | 김닉넴 | 2016.05.18 | 36 |
136 | [아이서버] 공성주기 변경 | 김닉넴 | 2016.05.18 | 60 |
135 | 환영의 체인소드 | 김닉넴 | 2016.05.18 | 29 |
134 | 커멘드로 영자권한 주기입니다 | 김닉넴 | 2016.05.18 | 97 |
133 | 특정아이템 획득시 전체공지 | 김닉넴 | 2016.05.18 | 105 |
132 | [아이서버] 혈전종료 명령어 | 김닉넴 | 2016.05.18 | 41 |
131 | linall 유저가접하면 알아서 인사하고~ 성주가 접하면 알아서 성주인사를~합니다~ | 김닉넴 | 2016.05.18 | 139 |
130 | 축아이템 만들기 [1] | 김닉넴 | 2016.05.18 | 182 |
129 | 1억수표 | 김닉넴 | 2016.05.18 | 102 |
128 |
잊섬 2시간 텀으로 열리게 컴파일 요청합니다
![]() | 아오이와소라 | 2016.05.17 | 186 |
127 | mr에 의한 데미지 경감 소스 [1] | LoseF | 2016.05.10 | 157 |
126 | 몬스터 피틱 and 엠틱 간단하게 쓰레드 최소화? | 로스트사가 | 2016.05.05 | 84 |
125 |
매니저창 구버전 하시는분들한테 좋을거 같아서 올립니다.
![]() | 로스트사가 | 2016.05.05 | 683 |
124 | 귓말 글자수 늘려보자 | 로스트사가 | 2016.05.04 | 41 |
123 | 에메랄드 아이콘 패킷 | 로스트사가 | 2016.05.03 | 88 |
122 | 마법 방어 인첸트 적용 | 로스트사가 | 2016.05.03 | 85 |
121 |
족보&나이
[1] ![]() | 로스트사가 | 2016.05.03 | 143 |
120 |
펫관련 본섭화와 밸런스
![]() | 로스트사가 | 2016.05.03 | 198 |
119 | [본섭화]수호탑근처가면투명해제 | 로스트사가 | 2016.05.03 | 46 |
118 | 변신 레벨에따른 공속변화 | 로스트사가 | 2016.04.30 | 495 |
117 | 5분마다 자도옹지 띄우기 | 이드1 | 2016.04.27 | 103 |
116 | 공성 먹자 군주 방지 [1] | 이드1 | 2016.04.27 | 124 |
115 | 몬스터잡은만큼 버프주기 | 이드1 | 2016.04.26 | 113 |
114 | [중복] 자세히 클래스변경물약 | 이드1 | 2016.04.26 | 85 |
113 | 유저커멘드 인벤템 보여주기 | 이드1 | 2016.04.26 | 125 |
112 | 인첸별 이펙 | 이드1 | 2016.04.26 | 157 |
111 | 특정맵 경험치증가 | 이드1 | 2016.04.26 | 95 |
110 | 특정아이템 뮨효과 | 이드1 | 2016.04.26 | 135 |
자바이름 간지네요 ^^ 감사합니다.