스피드핵 방지 소스
프리서버 오픈소스 리니지 스피드핵 방지 소스
public void speed_save()
{
try
{
if (System.currentTimeMillis() - this.test3 > 2000L)
test_reset();
if ((getGfxId().getTempCharGfx() != this.test1) || (getCurrentWeapon() + 1 != this.test2))
{
this.test1 = getGfxId().getTempCharGfx();
this.test2 = (getCurrentWeapon() + 1);
test_reset();
}
this.test_step += 1L;
if (this.test_step > 3L)
{
long l = System.currentTimeMillis() - this.test3;
if (this._speedtest.containsKey(Long.valueOf(l)))
this._speedtest.put(Integer.valueOf((int)l), Integer.valueOf(((Integer)this._speedtest.get(Long.valueOf(l))).intValue() + 1));
else
this._speedtest.put(Integer.valueOf((int)l), Integer.valueOf(1));
}
if (this.test_step == 20L)
{
int i = 0;
int j = 0;
Object localObject1 = this._speedtest.keySet().iterator();
Object localObject2;
while (((Iterator)localObject1).hasNext())
{
localObject2 = (Integer)((Iterator)localObject1).next();
if (((Integer)this._speedtest.get(localObject2)).intValue() > j)
{
i = ((Integer)localObject2).intValue();
j = ((Integer)this._speedtest.get(localObject2)).intValue();
}
}
if (UserSpeedControlTable.getInstance().getAttackSpeed(getGfxId().getTempCharGfx(), getCurrentWeapon() + 1) != 0)
{
if (UserSpeedControlTable.getInstance().getAttackSpeed(getGfxId().getTempCharGfx(), getCurrentWeapon() + 1) > i)
{
sendPackets(new S_SystemMessage("속도 측정 재기록 : " + i + "입니다.(polyid=" + getGfxId().getTempCharGfx() + ", type" + (getCurrentWeapon() + 1) + ")"));
localObject1 = null;
localObject2 = null;
try
{
localObject1 = L1DatabaseFactory.getInstance().getConnection();
localObject2 = ((Connection)localObject1).prepareStatement("UPDATE user_speed_control SET speed=? WHERE poly_id=? and action_type=?");
((PreparedStatement)localObject2).setInt(1, i);
((PreparedStatement)localObject2).setInt(2, getGfxId().getTempCharGfx());
((PreparedStatement)localObject2).setInt(3, getCurrentWeapon() + 1);
((PreparedStatement)localObject2).execute();
}
catch (SQLException localSQLException1)
{
}
finally
{
SQLUtil.close((Statement)localObject2);
SQLUtil.close((Connection)localObject1);
}
}
else
{
sendPackets(new S_SystemMessage("속도 재측정 결과 : " + i + "입니다. 이전 보다 느리거나 같아 기록되지 않았습니다.(polyid=" + getGfxId().getTempCharGfx() + ", type" + (getCurrentWeapon() + 1) + ")"));
test_reset();
return;
}
}
else
{
sendPackets(new S_SystemMessage("속도측정기록 : " + i + "입니다.(polyid=" + getGfxId().getTempCharGfx() + ", type" + (getCurrentWeapon() + 1) + ")"));
localObject1 = null;
localObject2 = null;
try
{
localObject1 = L1DatabaseFactory.getInstance().getConnection();
localObject2 = ((Connection)localObject1).prepareStatement("INSERT INTO user_speed_control SET poly_id = ?, action_type = ?, speed = ?");
((PreparedStatement)localObject2).setInt(1, getGfxId().getTempCharGfx());
((PreparedStatement)localObject2).setInt(2, getCurrentWeapon() + 1);
((PreparedStatement)localObject2).setInt(3, i);
((PreparedStatement)localObject2).execute();
}
catch (SQLException localSQLException2)
{
}
finally
{
SQLUtil.close((Statement)localObject2);
SQLUtil.close((Connection)localObject1);
}
}
UserSpeedControlTable.getInstance().putAttackSpeed(getGfxId().getTempCharGfx(), getCurrentWeapon() + 1, i);
test_reset();
}
this.test3 = System.currentTimeMillis();
}
catch (Exception localException)
{
localException.printStackTrace();
}
}
public void test_reset()
{
this.test_step = 0L;
this.test_speed = 0L;
this._speedtest.clear();
}
public void addSpeedHackCount(int paramInt)
{
this._speedhackCount += paramInt;
if (this._speedhackCount < 0)
this._speedhackCount = 0;
if ((this._speedhackCount == 4) || (this._speedhackCount == 8))
L1Teleport.teleport(this, getX(), getY(), getMapId(), getMoveState().getHeading(), false);
if (this._speedhackCount == 12)
sendPackets(new S_Disconnect());
}
}
출처 린프리

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