summaryrefslogtreecommitdiffstats
path: root/src/bones.cpp
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-10-28 12:24:10 +0100
committersalmonik <salmonik@tuta.io>2026-10-28 12:24:10 +0100
commit16546e5818408f35adc60c2d937cf4541ff7840a (patch)
tree19c405c2c226e69f082d9465f9325c67bb1d0d92 /src/bones.cpp
parentItem ESP: recover CPhysicsProp model names from the server (diff)
downloadhl2h-16546e5818408f35adc60c2d937cf4541ff7840a.tar.gz
hl2h-16546e5818408f35adc60c2d937cf4541ff7840a.zip
Logging: per-session file and debug-gated verbose logs
- Open /tmp/hl2hake.log once in the library constructor with "w" so each session starts clean, use line buffering, flush each line, and close it via atexit. No more fopen/fclose per message. - Add logd() for verbose diagnostics, enabled only with HL2H_DEBUG=1. - Move ESP/NPC scans, item-prop/item-classification logs, aimbot/silent-aim/ melee/triggerbot/spread details, jumpbug tracking, bone dumps, netvar dumps, cmd-modified and ground-trace noise to logd(). - Keep logf() for lifecycle, config, warnings/errors, GUI open/close, item category/tagging summaries and item-crate detections so crate debugging works without the ESP stream. - Supply crates now respect the max-distance slider (user change), with the stale comment and CONTEXT updated. - Document HL2H_DEBUG=1 in play.sh and CONTEXT.
Diffstat (limited to 'src/bones.cpp')
-rw-r--r--src/bones.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/bones.cpp b/src/bones.cpp
index 787af1b..0df13f2 100644
--- a/src/bones.cpp
+++ b/src/bones.cpp
@@ -265,22 +265,22 @@ static void build_core_mask(BoneEntry *e) {
265 265
266static void dump_hitboxes(const BoneEntry *e) { 266static void dump_hitboxes(const BoneEntry *e) {
267 const StudioHdr *h = e->hdr; 267 const StudioHdr *h = e->hdr;
268 logf("hitbox dump: idx=%d sets=%d setidx=%d", e->idx, h->numhitboxsets, 268 logd("hitbox dump: idx=%d sets=%d setidx=%d", e->idx, h->numhitboxsets,
269 h->hitboxsetindex); 269 h->hitboxsetindex);
270 const HitboxSet *s = hitbox_set0(h); 270 const HitboxSet *s = hitbox_set0(h);
271 if (!s) { 271 if (!s) {
272 logf("hitbox dump: no usable hitbox set"); 272 logd("hitbox dump: no usable hitbox set");
273 return; 273 return;
274 } 274 }
275 const Hitbox *hb = hitboxes(s); 275 const Hitbox *hb = hitboxes(s);
276 logf("hitbox dump: set0 n=%d hitboxindex=%d", s->numhitboxes, 276 logd("hitbox dump: set0 n=%d hitboxindex=%d", s->numhitboxes,
277 s->hitboxindex); 277 s->hitboxindex);
278 int n = s->numhitboxes < 24 ? s->numhitboxes : 24; 278 int n = s->numhitboxes < 24 ? s->numhitboxes : 24;
279 for (int i = 0; i < n; i++) { 279 for (int i = 0; i < n; i++) {
280 const char *bn = (hb[i].bone >= 0 && hb[i].bone < e->count) 280 const char *bn = (hb[i].bone >= 0 && hb[i].bone < e->count)
281 ? bone_name_raw(h, hb[i].bone) 281 ? bone_name_raw(h, hb[i].bone)
282 : nullptr; 282 : nullptr;
283 logf(" hb %d name='%s' bone=%d(%s) bb=(%.1f %.1f %.1f)-(%.1f %.1f %.1f)", 283 logd(" hb %d name='%s' bone=%d(%s) bb=(%.1f %.1f %.1f)-(%.1f %.1f %.1f)",
284 i, hitbox_name(hb[i]), hb[i].bone, bn ? bn : "?", hb[i].bbmin.x, 284 i, hitbox_name(hb[i]), hb[i].bone, bn ? bn : "?", hb[i].bbmin.x,
285 hb[i].bbmin.y, hb[i].bbmin.z, hb[i].bbmax.x, hb[i].bbmax.y, 285 hb[i].bbmin.y, hb[i].bbmin.z, hb[i].bbmax.x, hb[i].bbmax.y,
286 hb[i].bbmax.z); 286 hb[i].bbmax.z);
@@ -370,7 +370,7 @@ bool bones_update(int idx, void *ent) {
370 e->stamp = now; 370 e->stamp = now;
371 if (g_logged < 4) { 371 if (g_logged < 4) {
372 g_logged++; 372 g_logged++;
373 logf("bones: idx=%d count=%d invalid=%d bone0=%s", idx, e->count, 373 logd("bones: idx=%d count=%d invalid=%d bone0=%s", idx, e->count,
374 invalid_bones, 374 invalid_bones,
375 bone_name_raw(hdr, 0) ? bone_name_raw(hdr, 0) : "?"); 375 bone_name_raw(hdr, 0) ? bone_name_raw(hdr, 0) : "?");
376 } 376 }