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
» [서버방어프로젝트1] 너 스핵쓰냐? 잡아줄게 준희미니 2016.06.29 157
408 일팩유저화이팅]하딘시스템 준희미니 2016.06.29 46
407 페이트님 혈맹버프를 실시간으로... 준희미니 2016.06.29 43
406 /계급 및 혈맹 매칭.(소스아님 팁) 준희미니 2016.06.29 51
405 강제변신검 특화검 혹시나 필요하신분있을꺼같아서..ㅎ 준희미니 2016.06.29 85
404 매칭 혈맹해산후에도 깃발먹통안되게 준희미니 2016.06.29 20
403 npc 거리제한 해제; 준희미니 2016.06.29 81
402 카배 남들도보이게? 준희미니 2016.06.29 45
401 흑사버프 준희미니 2016.06.29 44
400 텔레포트시 드래곤의 진주 재부여 준희미니 2016.06.29 68
399 라이브에서는 어바시,힐,똥물,게일,데스힐,데스포션된다네용 준희미니 2016.06.29 43
398 힘,콘 스탯 초과시 칼질 안되는것 수정 준희미니 2016.06.29 76
397 세이룬 준희미니 2016.06.29 28
396 세트 착용시 화려한 임팩 준희미니 2016.06.29 89
395 환영의 체인소드 저만의 짜집기 준희미니 2016.06.29 34
394 가웨인 나비 정리 허접 준희미니 2016.06.29 26
393 어스가디언 (수정) 준희미니 2016.06.29 33
392 룸티스 붉은귀걸이 확률데미지감소부분 야매버젼 준희미니 2016.06.29 68
391 먹통 웨폰스킬테이블(디비) 작동시키기 준희미니 2016.06.29 136
390 무인 낚시 만들기 준희미니 2016.06.29 126
389 간단한 반지 정보.! 준희미니 2016.06.29 84
388 허수아비 파티시 어택불가 준희미니 2016.06.29 29
387 이미 마법을 배우면 더이상 안배워지도록 준희미니 2016.06.29 75
386 2013.10.30 메세지 파일 입니다 file 준희미니 2016.06.29 35
385 HALLOWEENEVENT2013 file 준희미니 2016.06.29 88
384 [본섭화] 공성선포시 혈맹원이 공성존 안에있다면 마을로 베르 준희미니 2016.06.29 34
383 글말 리뉴얼 짜집기 준희미니 2016.06.29 74
382 붉은사자의 투지 file 준희미니 2016.06.29 81
381 붉은기사의 하사품 준희미니 2016.06.29 57
380 마법인형 그렘린 추가하쟈 file 준희미니 2016.06.29 72
379 아이스 스파이크 오류 수정 버전 file 준희미니 2016.06.29 64
378 기르 공략소스 and 음성 수정버전 준희미니 2016.06.29 63
377 droplist 인첸템드랍 추가 준희미니 2016.06.29 91
376 대만 3.80옵코드 준희미니 2016.06.29 131
375 대만 3.80 서버버전 준희미니 2016.06.29 110
374 대만 3.80c KeyPacket 부분 준희미니 2016.06.29 51
373 마안 사용 (라이브화) 준희미니 2016.06.29 69
372 대만 3.80c 대만 S_Unknown1 쪽이요 준희미니 2016.06.29 44
371 3.80c 텔레포트 팅기는부분 준희미니 2016.06.29 35
370 상점 NPC의 세금을 어떻게 성으로 보낼까요? 준희미니 2016.06.29 72
369 디스펠 주문서 준희미니 2016.06.29 45
368 명령어 .아데나 부분 수정한거 ㅋ;;; 욕하지들마삼 준희미니 2016.06.29 79
367 3.80 경험치변경시 상점창뜨는부분 준희미니 2016.06.29 41
366 룸티스 귀걸이 완전체 (이전꺼 버그잇음요 ㅠㅠ) 준희미니 2016.06.29 128
365 변신 막대 추가? 준희미니 2016.06.29 43
364 제브레퀴 라이브화 준희미니 2016.06.29 51
363 황금장화 획득시 화면내 다른 유저에게 획득메시지 보이게 라이브화 준희미니 2016.06.29 32
362 스냅퍼 반지 중복착용 방지 [1] 준희미니 2016.06.29 57
361 이계 번개소환막대??ㅋ 준희미니 2016.06.29 62
360 요청 크로우 류 카배 미반사 준희미니 2016.06.29 24