#!/usr/bin/env bash # ========================================================================= # #142 CROUCH in MULTIPLAYER -- solo works, so MP is the variable. # # crouch142.sh proved a madcat crouches and rises cleanly SOLO: both presses # reached DuckRequest, zero REQUEST DROPPED, SQUAT then RISE fired. The # reporters were in MP, and the wording matters: # Oracle: "the crouch button did not toggle to DISPLAY crouched ... no state # change ... the light next to it always flashes when pressed, but # state does not change. Remains in stand mode." # # Three things that could produce that with the mech itself working: # (a) MP-only refusal -- some gate differs on a networked master # (b) replication -- master squats, PEER never poses it # (c) indicator -- mech squats, but the button LAMP / state readout # never latches, so the pilot sees "stand" # # Same chassis as the passing solo run, so MP is the only changed variable. # A presses crouch twice; B observes. Read all three layers. # ========================================================================= set -x . /c/git/bt411/scratchpad/night6/bench_common.sh cd /c/git/bt411/content || exit 1 bt_assert_player_env taskkill //F //IM btl4.exe > /dev/null 2>&1 sleep 2 rm -f cm_a.log cm_b.log cm_relay.log bt_expert_egg MP.EGG CM.EGG sed -i "s/^map=.*/map=grass/; s/^time=.*/time=day/; s/^vehicle=.*/vehicle=madcat/" CM.EGG ( export BT_DUCK_LOG=1 BT_GAIT_LOG=1 BT_MP_LOG=1 bt_launch cm_b.log CM.EGG 0x0C -net 1601 ) sleep 2 ( export BT_BTNTEST=0x13,900,960 BT_BTNTEST2=0x13,1800,1860 export BT_DUCK_LOG=1 BT_GAIT_LOG=1 BT_MP_LOG=1 BT_KEY_NOFOCUS=1 bt_launch cm_a.log CM.EGG 0x03 -net 1501 ) sleep 5 python ../tools/btconsole.py CM.EGG 127.0.0.1:1501 127.0.0.1:1601 > cm_relay.log 2>&1 & RELAY=$! sleep 240 kill $RELAY 2>/dev/null sleep 3 bt_kill_ours; sleep 2; taskkill //F //IM btl4.exe > /dev/null 2>&1; sleep 3 AID=$(grep -aoE "MY mech entityID=[0-9]+:[0-9]+" cm_a.log | head -1 | cut -d= -f2) echo "=================== #142 CROUCH in MP (A=${AID:-?}) ===================" echo "--- (a) did A's press reach the handler, and was it dropped? ---" grep -a "btntest" cm_a.log | head -4 echo -n "DuckRequests : "; grep -ac "DuckRequest" cm_a.log echo -n "REQUEST DROPPED: "; grep -ac "REQUEST DROPPED" cm_a.log grep -a "REQUEST DROPPED" cm_a.log | head -3 echo echo "--- (b) did A's own mech actually change posture? ---" grep -aE "\[duck\] (SQUAT|RISE|squat clip)" cm_a.log | head -6 echo -n "SQUAT/RISE on A: "; grep -acE "\[duck\] (SQUAT|RISE)" cm_a.log echo echo "--- (c) did the PEER pose the squat? (legState ships in the type-3 record) ---" echo -n "B duck lines for A: "; grep -ac "\[duck\]" cm_b.log grep -a "\[duck\]" cm_b.log | head -4 echo -n "B legState-2/3 sightings: "; grep -aoE "legState=[23]" cm_b.log | wc -l echo echo "--- (d) the INDICATOR: does anything latch a crouched state? ---" grep -aiE "lamp.*0x13|stability|duckState" cm_a.log | head -6