close_btn
로그인, 회원가입후 더 많은 혜택을 누리세요 로그인 회원가입 닫기

자바이름은 제 주관적인 이름입니다

 

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);
  }
 }
}

 

 

[출처] [서버방어프로젝트1] 너 스핵쓰냐? 잡아줄게 (비공개 카페)

번호 제목 글쓴이 날짜 조회 수
공지 소스자료는 직접 올려주세요 게임존 2017.06.06 550
309 재질에 의한 타격치.. 준희미니 2016.06.29 39
308 헤이스트 아이템 헤이스트효과구현 준희미니 2016.06.29 41
307 언데드계열 힐주기 준희미니 2016.06.29 27
306 경험치 중복 떨구기 및 문지방적용시 잊섬에서 경험치 적용안되는부분 수정.txt 준희미니 2016.06.29 49
305 고대인의 지혜및 기타지팡이 엠흡수.txt 준희미니 2016.06.29 67
304 리스창 케릭삭제부분.txt 준희미니 2016.06.29 38
303 마법공격시 보라돌이,유저공격시 카오적용.txt 준희미니 2016.06.29 41
302 cpu_100%.txt 준희미니 2016.06.29 107
301 특정지역 몬스터 아덴드랍율 높히기.txt 준희미니 2016.06.29 99
300 트리플에로우 카오적용.txt 준희미니 2016.06.29 49
299 점프팩 옵코...관련 준희미니 2016.06.29 177
298 세트 착용시 화려한 임팩 준희미니 2016.06.28 53
297 환영의 체인소드 저만의 짜집기 준희미니 2016.06.28 38
296 어스가디언 (수정) 준희미니 2016.06.28 23
295 허수아비 파티시 어택불가 준희미니 2016.06.28 27
294 이미 마법을 배우면 더이상 안배워지도록 준희미니 2016.06.28 82
» [서버방어프로젝트1] 너 스핵쓰냐? 잡아줄게 준희미니 2016.06.28 75
292 [일팩유저화이팅]하딘시스템 준희미니 2016.06.28 35
291 페이트님 혈맹버프를 실시간으로... 준희미니 2016.06.28 26
290 계급 및 혈맹 매칭 준희미니 2016.06.28 28
289 강제변신검 특화검 혹시나 필요하신분있을꺼같아서 준희미니 2016.06.28 59
288 npc 거리제한 해제 준희미니 2016.06.28 41
287 흑사버프 준희미니 2016.06.28 30
286 제브레퀴 라이브화 준희미니 2016.06.28 30
285 [에바] 3.80 옵코드 준희미니 2016.06.28 160
284 보스몹 유저 소환 준희미니 2016.06.28 98
283 성혈전용 던전이동주문서 만들어보자 준희미니 2016.06.28 45
282 전쟁.종전.항복 소스입니다 준희미니 2016.06.28 24
281 서먼 공속 막는 야매 준희미니 2016.06.28 35
280 환생물약(고전) 최강빅토리 2016.06.27 117
279 아덴 증가 로그 시스템 추가 최강빅토리 2016.06.27 57
278 몹 공격시 4대 용처럼 몹 주위로 강제 소환 되도록 하기 최강빅토리 2016.06.27 56
277 pvp 이긴사람에게 아이템 지급~ 최강빅토리 2016.06.27 65
276 지엠설정 아이피체크 외부화~ 최강빅토리 2016.06.27 64
275 기란마을 제이프퀘 본섭화 최강빅토리 2016.06.27 48
274 펫레이싱 본섭화 하기~ 최강빅토리 2016.06.27 57
273 엔피씨에게 호칭을 주자~ 최강빅토리 2016.06.27 40
272 유저 접속시 매니저창에 서버에 접속한 총인원을 표시 최강빅토리 2016.06.27 52
271 쉽게 올버프물약 만들어보자~ 최강빅토리 2016.06.27 190
270 아이템드랍 필드별제한 최강빅토리 2016.06.27 52
269 스핵5회감지시 좀비로변신하게~ 최강빅토리 2016.06.27 53
268 세트착용시 화려한임팩 최강빅토리 2016.06.27 61
267 붉은기사단의 물약 최강빅토리 2016.06.27 47
266 변신이벤트 외부화로 해봅시다~(2.7 Rev1484용)[Eva는 조금다름] 최강빅토리 2016.06.27 72
265 마방및 마법데미지 본x화 최강빅토리 2016.06.27 282
264 PK시 이긴사람이 진사람에게 깃털 뺏어오기 최강빅토리 2016.06.27 34
263 스냅퍼 용사/지혜 반지 준희미니 2016.06.27 40
262 투석기입니다용; 준희미니 2016.06.27 15
261 성장의 마법사^에킨스 준희미니 2016.06.27 30
260 한국옵 코 준희미니 2016.06.27 108