diff --git a/3dtank.com/play/static/js/unpacked/hornet_bundle.js b/3dtank.com/play/static/js/unpacked/hornet_bundle.js index 38a2f4d..bea0907 100644 --- a/3dtank.com/play/static/js/unpacked/hornet_bundle.js +++ b/3dtank.com/play/static/js/unpacked/hornet_bundle.js @@ -1624,6 +1624,9 @@ return lib.GetCameraInfo(gm); } var Project3D = lib.Project3D; + // 人机标记:同队内装备分数相同且 < 8000(lib.ScanBots 定期扫描 → IsBot 查询) + var ScanBots = lib.ScanBots, IsBot = lib.IsBot; + var LastBotScanAt = 0; // 人机扫描节流(约每 0.3 秒一次) // ===== 热点优化:相机基每帧只算一次(避免逐顶点重复三角函数 + 对象分配)===== var Cam = { @@ -2418,7 +2421,13 @@ var tankList = gm.q100_1.r11l(); var count = tankList.e1(); - var drawnCount = 0; + var drawnCount = 0, botDrawn = 0; + + // 人机扫描(装备分数不会每帧变,节流到约每 0.3 秒一次) + if (ScanBots && (Date.now() - LastBotScanAt > 300)) { + LastBotScanAt = Date.now(); + ScanBots(); + } for (var i = 0; i < count; i++) { var tank = tankList.g1(i); @@ -2517,6 +2526,24 @@ DrawTankMarker(ctx, pos, camInfo, screenW, screenH, color); } + // 人机标记:坦克上方写「人机」(同队装备分数相同且 < 8000) + if (typeof IsBot === 'function' && IsBot(tank)) { + var botPt = Project3D({ x: pos.x, y: pos.y, z: pos.z + 1300 }, + camInfo.pos, camInfo.yaw, camInfo.pitch, camInfo.fov, screenW, screenH); + if (botPt) { + ctx.save(); + ctx.font = 'bold 13px Consolas,monospace'; + ctx.textAlign = 'center'; + ctx.lineWidth = 3; + ctx.strokeStyle = 'rgba(0,0,0,0.85)'; + ctx.strokeText('人机', botPt.x, botPt.y); // 先描黑边,保证任何背景下都看得清 + ctx.fillStyle = '#ffd24a'; + ctx.fillText('人机', botPt.x, botPt.y); + ctx.restore(); + botDrawn++; + } + } + drawnCount++; } diff --git a/3dtank_bundle.js b/3dtank_bundle.js index 38a2f4d..bea0907 100644 --- a/3dtank_bundle.js +++ b/3dtank_bundle.js @@ -1624,6 +1624,9 @@ return lib.GetCameraInfo(gm); } var Project3D = lib.Project3D; + // 人机标记:同队内装备分数相同且 < 8000(lib.ScanBots 定期扫描 → IsBot 查询) + var ScanBots = lib.ScanBots, IsBot = lib.IsBot; + var LastBotScanAt = 0; // 人机扫描节流(约每 0.3 秒一次) // ===== 热点优化:相机基每帧只算一次(避免逐顶点重复三角函数 + 对象分配)===== var Cam = { @@ -2418,7 +2421,13 @@ var tankList = gm.q100_1.r11l(); var count = tankList.e1(); - var drawnCount = 0; + var drawnCount = 0, botDrawn = 0; + + // 人机扫描(装备分数不会每帧变,节流到约每 0.3 秒一次) + if (ScanBots && (Date.now() - LastBotScanAt > 300)) { + LastBotScanAt = Date.now(); + ScanBots(); + } for (var i = 0; i < count; i++) { var tank = tankList.g1(i); @@ -2517,6 +2526,24 @@ DrawTankMarker(ctx, pos, camInfo, screenW, screenH, color); } + // 人机标记:坦克上方写「人机」(同队装备分数相同且 < 8000) + if (typeof IsBot === 'function' && IsBot(tank)) { + var botPt = Project3D({ x: pos.x, y: pos.y, z: pos.z + 1300 }, + camInfo.pos, camInfo.yaw, camInfo.pitch, camInfo.fov, screenW, screenH); + if (botPt) { + ctx.save(); + ctx.font = 'bold 13px Consolas,monospace'; + ctx.textAlign = 'center'; + ctx.lineWidth = 3; + ctx.strokeStyle = 'rgba(0,0,0,0.85)'; + ctx.strokeText('人机', botPt.x, botPt.y); // 先描黑边,保证任何背景下都看得清 + ctx.fillStyle = '#ffd24a'; + ctx.fillText('人机', botPt.x, botPt.y); + ctx.restore(); + botDrawn++; + } + } + drawnCount++; } diff --git a/tools/hornet_3d_wireframe.js b/tools/hornet_3d_wireframe.js index 6d43b5c..ae368e6 100644 --- a/tools/hornet_3d_wireframe.js +++ b/tools/hornet_3d_wireframe.js @@ -106,7 +106,10 @@ } return lib.GetCameraInfo(gm); } - var Project3D = lib.Project3D; + var Project3D = lib.Project3D; + // 人机标记:同队内装备分数相同且 < 8000(lib.ScanBots 定期扫描 → IsBot 查询) + var ScanBots = lib.ScanBots, IsBot = lib.IsBot; + var LastBotScanAt = 0; // 人机扫描节流(约每 0.3 秒一次) // ===== 热点优化:相机基每帧只算一次(避免逐顶点重复三角函数 + 对象分配)===== var Cam = { @@ -901,7 +904,13 @@ var tankList = gm.q100_1.r11l(); var count = tankList.e1(); - var drawnCount = 0; + var drawnCount = 0, botDrawn = 0; + + // 人机扫描(装备分数不会每帧变,节流到约每 0.3 秒一次) + if (ScanBots && (Date.now() - LastBotScanAt > 300)) { + LastBotScanAt = Date.now(); + ScanBots(); + } for (var i = 0; i < count; i++) { var tank = tankList.g1(i); @@ -1000,6 +1009,24 @@ DrawTankMarker(ctx, pos, camInfo, screenW, screenH, color); } + // 人机标记:坦克上方写「人机」(同队装备分数相同且 < 8000) + if (typeof IsBot === 'function' && IsBot(tank)) { + var botPt = Project3D({ x: pos.x, y: pos.y, z: pos.z + 1300 }, + camInfo.pos, camInfo.yaw, camInfo.pitch, camInfo.fov, screenW, screenH); + if (botPt) { + ctx.save(); + ctx.font = 'bold 13px Consolas,monospace'; + ctx.textAlign = 'center'; + ctx.lineWidth = 3; + ctx.strokeStyle = 'rgba(0,0,0,0.85)'; + ctx.strokeText('人机', botPt.x, botPt.y); // 先描黑边,保证任何背景下都看得清 + ctx.fillStyle = '#ffd24a'; + ctx.fillText('人机', botPt.x, botPt.y); + ctx.restore(); + botDrawn++; + } + } + drawnCount++; }