mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-16 08:52:42 +00:00
H3 soak close-out: drop dead handleHarvestCmd / handleStandaloneHarvest
H3 retired the manual !forage/!mine/!scavenge/!fish/!essence/!commune
verbs from the command dispatcher in e05da91; the underlying handlers
were left parked behind an operator-gated 2-week soak. The expedition
sim has since exercised the auto-harvest path 15k+ times per sweep
across every class, level, and zone — vastly more coverage than the
soak would have collected in production. Pull the dead handlers now.
Removed:
- handleHarvestCmd (dnd_expedition_harvest.go, ~175 lines)
- handleStandaloneHarvest (dnd_zone_harvest.go, ~80 lines)
- dnd_zone_harvest_test.go (three tests against the deleted handler;
the autopilot's standalone-storage path is what runs in prod and is
covered by the cmd/expedition-sim sweep + adv2 scenario test)
The deprecation DM in adventure.go ("Harvest is automatic now — just
walk.") stays for now — muscle memory takes longer than two weeks to
fade and the redirect costs 7 lines.
adv2 scenario test rewired to drive autoHarvestRoom directly.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package plugin
|
||||
|
||||
import (
|
||||
"math/rand/v2"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -331,22 +330,19 @@ func TestAdv2Scenario_HarvestForestShadows(t *testing.T) {
|
||||
t.Error("expected at least one harvest node seeded")
|
||||
}
|
||||
|
||||
// Try each harvest action a couple of times and watch for crashes.
|
||||
// Outcomes are RNG-driven; we mainly want no panics + coherent state.
|
||||
rng := rand.New(rand.NewPCG(7, 13))
|
||||
_ = rng
|
||||
for _, action := range []HarvestAction{HarvestForage, HarvestMine} {
|
||||
for i := 0; i < 3; i++ {
|
||||
if err := p.handleHarvestCmd(MessageContext{Sender: uid}, action); err != nil {
|
||||
t.Fatalf("handleHarvestCmd(%s) attempt %d: %v", action, i, err)
|
||||
}
|
||||
fresh, _ := getExpedition(exp.ID)
|
||||
if fresh == nil {
|
||||
t.Logf("expedition ended during harvest %s #%d", action, i)
|
||||
break
|
||||
}
|
||||
t.Logf("after %s #%d: supplies=%v threat=%d", action, i, fresh.Supplies.Current, fresh.ThreatLevel)
|
||||
// Drive the auto-harvest pass (post-H3 there is no manual command
|
||||
// surface). Outcomes are RNG-driven; we mainly want no panics +
|
||||
// coherent state.
|
||||
for i := 0; i < 3; i++ {
|
||||
if _, err := p.autoHarvestRoom(uid, run, c, exp); err != nil {
|
||||
t.Fatalf("autoHarvestRoom attempt %d: %v", i, err)
|
||||
}
|
||||
fresh, _ := getExpedition(exp.ID)
|
||||
if fresh == nil {
|
||||
t.Logf("expedition ended during auto-harvest #%d", i)
|
||||
break
|
||||
}
|
||||
t.Logf("after auto-harvest #%d: supplies=%v threat=%d", i, fresh.Supplies.Current, fresh.ThreatLevel)
|
||||
}
|
||||
|
||||
// !resources output path (no-op SendDM but should not error).
|
||||
|
||||
Reference in New Issue
Block a user