最新公告
★ 歡迎來到天堂私服123 | 天天更新最新私服資訊
天堂私服123|每日開服情報
首頁 › 文章看板 › ⚔️ 私服技巧 › 防止外掛特殊況狀使用喝水功能!
⚔️ 私服技巧

防止外掛特殊況狀使用喝水功能!

🧙
匿名

衝暈、麻痺、大地 後喝水連續三次以上就紀錄+斷線

C_ItemUse

L1PcInstance pc = client.getActiveChar();
if (pc.isGhost()) {
return;
}


//TODO 防外掛自動喝水
if (pc.hasSkillEffect(33) || pc.hasSkillEffect(87)
|| pc.hasSkillEffect(157)) { //木乃伊,衝暈,大地屏障
pc.checkUseItemInterval();
}
//end

複製代碼


L1ItemInstance l1iteminstance = pc.getInventory().getItem(itemObjid);

if (l1iteminstance.getItem().getUseType() == -1) { // none:使用できないアイテム

───────

L1PcInstance

找個地方加入

//TODO 防外掛自動喝水
private byte _UseItemCount = 0;

private long _oldUseItemTimeInMillis = 0L;

public void checkUseItemInterval() {

long nowUseItemTimeInMillis = System.currentTimeMillis();

if (_UseItemCount == 0) {
_UseItemCount++;
_oldUseItemTimeInMillis = nowUseItemTimeInMillis;
return;
}

long UseItemInterval = nowUseItemTimeInMillis - _oldUseItemTimeInMillis;

if (UseItemInterval > 2000) {
_UseItemCount = 0;
_oldUseItemTimeInMillis = 0;
} else {
if (_UseItemCount >= 3) { //連續喝三次以上
usePlugin("IP"
+ "(" + getNetConnection().getIp() + ")"
+"玩家"
+ ":【" + getName() + "】 "
+ "使用喝水外掛。"
+ "時間:" + "(" + new Timestamp(System.currentTimeMillis()) + ")。");
sendPackets(new S_Disconnect());
_UseItemCount = 0;
_oldUseItemTimeInMillis = 0;
return;
}
_UseItemCount++;
}
}

//記錄文件檔 by 阿傑
private static void usePlugin(String info) {
try {
BufferedWriter out = new BufferedWriter(new FileWriter("usePlugin.txt", true));
out.write(info + " ");
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}

//防外掛自動喝水 end

❤️ 0 💬 0 🔄 0 🔖 0
分享 f L 𝕏 已複製

💬 留言

還沒有留言,來搶頭香吧!

LINE 諮詢
比較:
開始比較
PlaySF

ui.pwa_install

ui.install_prompt