找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 73|回复: 10

下次更新预告

[复制链接]

70

主题

639

回帖

1万

积分

传说

请勿打扰

积分
14906
发表于 2025-7-18 22:10:22 | 显示全部楼层 |阅读模式
Xss(如果可以)
管理员传送
发言修复
生于自在,活的自在
回复

使用道具 举报

68

主题

158

回帖

2961

积分

咸鱼

积分
2961
发表于 昨天 19:10 | 显示全部楼层
文件已更新

经过测试,无bug(修复xss和语音问题 修改的是3513行和1508行的)

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
回复

使用道具 举报

48

主题

128

回帖

2944

积分

咸鱼

积分
2944
发表于 2025-7-18 22:18:40 | 显示全部楼层
本帖最后由 wegaieagu32q3r 于 2025-7-18 22:20 编辑

建议在有时间时可以试试给后端加反作弊,前端加0.2秒位置更新
回复

使用道具 举报

48

主题

128

回帖

2944

积分

咸鱼

积分
2944
发表于 2025-7-18 22:23:07 | 显示全部楼层
后端模块,不完善仅供参考
使用语言:js
  1. //反作弊
  2. const { json } = require('../json');
  3. const channel = require('./Channel');
  4. const { tools } = require('../tool');
  5. let serverTime = Date.now();

  6. class anti {
  7.     constructor(p) {
  8.         this.player = p;
  9.         this.jump_num = 0;
  10.         this.throw_num = 0;
  11.         this.pos_num = 0;
  12.         this.开挂次数 = 0;
  13.         this.检测阈值 = 3;
  14.         this.异常移动 = false;
  15.         this.old_x = Math.random();
  16.         this.old_y = Math.random();
  17.         this.x = 0;
  18.         this.y = 0;
  19.         this.tick = 0;
  20.         this.old_move_time = 0;
  21.         this.random = { x: this.old_x, y: this.old_y };
  22.         this.无效数据 = false;
  23.         this.old_Animation = '';
  24.         this.timer = setInterval(() => {
  25.             this.tick = 0;
  26.         }, 1000);
  27.     }

  28.     clear() {
  29.         clearInterval(this.timer);
  30.         this.timer = null;
  31.     }

  32.     jump(p) {
  33.         this.jump_num++;
  34.         if (this.jump_num > 50 && this.pos_num == 0) {
  35.             p.send('$alert', {
  36.                 t: '请勿多次连跳!'
  37.             })
  38.             p.kick();
  39.             return;
  40.         }
  41.         if (this.y < this.old_y - 3) {
  42.             this.kick(p);
  43.             return;
  44.         }
  45.     }

  46.     pos(p) {
  47.         this.jump_num != 0 && this.pos_num++;
  48.         if (this.jump_num == 1 && this.pos_num == 1) {
  49.             this.jump_num--;
  50.             this.pos_num--;
  51.         }
  52.     }

  53.     pick(p) {
  54.         this.throw_num++;
  55.         if (this.throw_num > 3) {
  56.             this.kick(p);
  57.         }
  58.         setTimeout(() => {
  59.             this.throw_num = 0;
  60.         }, 1000);
  61.     }

  62.     throw(p, t) {
  63.         this.throw_num++;
  64.         if (this.throw_num > 3) {
  65.             this.kick(p);
  66.         }
  67.         setTimeout(() => {
  68.             this.throw_num = 0;
  69.         }, 500);
  70.         if (t.x >= this.x - 120
  71.             && t.x < this.x
  72.             && t.y <= this.y + 90
  73.             && t.y >= this.y - 90
  74.         ) {
  75.             return;
  76.         } else {
  77.             if (t.x <= this.x + 120
  78.                 && t.x > this.x
  79.                 && t.y <= this.y + 90
  80.                 && t.y >= this.y - 90) {
  81.                 return;
  82.             } else {
  83.                 this.kick(p);
  84.             }
  85.         }
  86.     }

  87.     move(p) {
  88.         this.move_num++;
  89.         if (this.old_move_time == 0) {
  90.             this.old_move_time = serverTime;
  91.             return;
  92.         } else if (this.old_move_time < serverTime) {
  93.             let v = Math.abs(this.x - this.old_x) / ((serverTime - this.old_move_time) / 1000);
  94.             if (v > 140) {
  95.                 if (this.jump_num == 0) {
  96.                     if (v > 500) this.kick(p);
  97.                     this.异常移动 = true;
  98.                     this.无效数据 = true;
  99.                 }
  100.             } else {
  101.                 this.异常移动 = false;
  102.                 this.无效数据 = false;
  103.             }
  104.         }
  105.         this.old_move_time = serverTime;
  106.     }

  107.     update(d, p, t = {}) {
  108.         if (p.l_cheat) {
  109.             serverTime = Date.now();
  110.             this.无效数据 = false;
  111.             if (!this) {
  112.                 this.kick(p);
  113.                 return;
  114.             }
  115.             if (this.old_x == this.random.x && this.old_y == this.random.y) {
  116.                 this.old_x = Number(d.v.x);
  117.                 this.old_y = Number(d.v.y);
  118.                 this.old_Animation = d.v.t;
  119.                 return;
  120.             } else {
  121.                 this.x = Number(d.v.x);
  122.                 this.y = Number(d.v.y);
  123.             }
  124.             if (isNaN(this.old_x) || isNaN(this.x) || isNaN(this.old_y) || isNaN(this.y)) {
  125.                 this.kick(p);
  126.             }
  127.             if (this.异常移动) {
  128.                 channel.move({ k: 'move', v: { t: 'throw', uuid: p.uuid, dir: 0, target: 0, x: this.old_x, y: this.old_y } }, p);
  129.             }
  130.             switch (d.v.t) {
  131.                 case 'jump':
  132.                     this.jump(p)
  133.                     break;
  134.                 case 'pos':
  135.                     this.pos(p)
  136.                     break;
  137.                 case 'pick':
  138.                     this.pick(p)
  139.                     break;
  140.                 case 'throw':
  141.                     this.throw(p, t)
  142.                     break;
  143.                 default:
  144.                     if ((this.old_Animation == 'moveRight' || this.old_Animation == 'moveLeft') && d.v.t == 'stop') {
  145.                         this.move(p);
  146.                     }
  147.                     break;
  148.             }
  149.             !this.无效数据 && channel.move(d, p);
  150.             d.v.t != 'jump' && this.tick++;
  151.             if (this.tick > 50) {
  152.                 this.kick(p);
  153.                 return;
  154.             }
  155.             this.old_x = this.x;
  156.             this.old_y = this.y;
  157.             this.old_Animation = d.v.t;
  158.         } else {
  159.             channel.move(d, p);
  160.         }
  161.     }

  162.     kick(p) {
  163.         this.开挂次数++;
  164.         this.无效数据 = true;
  165.         if (this.开挂次数 >= this.检测阈值) {
  166.             p.send('$alert', {
  167.                 t: '数据异常,有问题请找管理员'
  168.             })
  169.             //json.banplayer(p.name, { username: '反作弊' });
  170.             //p.kick();
  171.             //tools.log('反作弊' + ' 封禁了 ' + p.name);
  172.         } else {
  173.             p.send('$broad', {
  174.                 text: '反作弊提示,请文明游戏!'
  175.             })
  176.         }
  177.     }
  178. }

  179. module.exports = anti;
复制代码
回复

使用道具 举报

77

主题

105

回帖

4万

积分

神隐

积分
44550
发表于 2025-7-19 08:56:59 | 显示全部楼层
wegaieagu32q3r 发表于 2025-7-18 22:23
后端模块,不完善仅供参考
使用语言:js

给我后路断了?

点评

他这个代码好像不能让你瞬移  发表于 2025-7-19 09:30
回复

使用道具 举报

33

主题

162

回帖

8219

积分

猫猫帝

积分
8219
发表于 2025-7-19 09:57:28 来自手机 | 显示全部楼层
注:三叶有可以让玩家输入tp指令可以瞬移的脚本

点评

我已经实现了  发表于 2025-7-19 10:37
回复

使用道具 举报

72

主题

811

回帖

2万

积分

传说

“拿下”

积分
20588
发表于 昨天 20:59 | 显示全部楼层
我想问个问题,卡比怎么办,比如我,影子,不会自动识别开挂吧?(´・_・`)

点评

控制延迟>800ms就差不多  发表于 昨天 22:46
延迟高会断开连接  发表于 昨天 22:45
“那现在,为了保全自己,我也没得选……”
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|WTFBBS

GMT+8, 2025-7-27 16:51 , Processed in 0.113917 second(s), 24 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表