From f7a5899dc031866ad7efc4f511ddc7189d14b1a3 Mon Sep 17 00:00:00 2001 From: nico Date: Thu, 5 Nov 2026 18:53:23 +0100 Subject: [PATCH] Fix ground graph re-entry and flight presentation Bound expanded ground access probes and recover failed graph entry with checked walking searches. Unify airborne idle animation, observer updates and post-dismount movement cleanup for normal and emergency landings. Add native registered-testbot flight controls, regression coverage and live reproduction fixtures. Record raid test setup and bound passive debugger variable printing after the observed diagnostic OOM. --- .../2026-11-05-flight-presentation.md | 42 +++ doc/clientless/2026-11-05-ground-reentry.md | 42 +++ doc/clientless/SESSION-RESUME.md | 266 ++++++++++++++++++ .../start-bounded-diagnostic.sh | 14 + .../2026-11-05-1900-raid-test/setup.py | 56 ++++ .../live-goldshire.lua | 89 ++++++ .../live-presentation.lua | 87 ++++++ .../testaria-profile.lua | 1 + .../2026-11-05-ground-reentry/live-ground.lua | 25 ++ .../live-search-final.lua | 25 ++ .../testaria-override.lua | 3 + doc/clientless/testbots.md | 4 +- .../World/ClientlessActionExecutorMgr.cpp | 33 ++- src/server/game/World/ClientlessFlightMgr.cpp | 127 ++++++--- src/server/game/World/ClientlessFlightMgr.h | 6 +- .../game/World/ClientlessTestBotMgr.cpp | 24 +- .../game/World/ClientlessTravelGraphMgr.cpp | 34 ++- tests/clientless/test_flight_departure.py | 2 +- tests/clientless/test_flight_handoff.py | 2 + tests/clientless/test_flight_presentation.py | 79 ++++++ tests/clientless/test_free_flight_planner.py | 17 +- .../clientless/test_ground_reentry_wander.py | 56 ++++ tests/clientless/test_group_flight_follow.py | 1 + tests/clientless/test_group_flight_mount.py | 11 +- tests/clientless/test_rescue_executor.py | 2 +- 25 files changed, 988 insertions(+), 60 deletions(-) create mode 100644 doc/clientless/2026-11-05-flight-presentation.md create mode 100644 doc/clientless/2026-11-05-ground-reentry.md create mode 100644 doc/clientless/checkpoints/2026-11-05-1812-instance-crash/start-bounded-diagnostic.sh create mode 100644 doc/clientless/checkpoints/2026-11-05-1900-raid-test/setup.py create mode 100644 doc/clientless/checkpoints/2026-11-05-flight-animation/live-goldshire.lua create mode 100644 doc/clientless/checkpoints/2026-11-05-flight-animation/live-presentation.lua create mode 100644 doc/clientless/checkpoints/2026-11-05-flight-animation/testaria-profile.lua create mode 100644 doc/clientless/checkpoints/2026-11-05-ground-reentry/live-ground.lua create mode 100644 doc/clientless/checkpoints/2026-11-05-ground-reentry/live-search-final.lua create mode 100644 doc/clientless/checkpoints/2026-11-05-ground-reentry/testaria-override.lua create mode 100644 tests/clientless/test_flight_presentation.py create mode 100644 tests/clientless/test_ground_reentry_wander.py diff --git a/doc/clientless/2026-11-05-flight-presentation.md b/doc/clientless/2026-11-05-flight-presentation.md new file mode 100644 index 0000000000..4984e8c568 --- /dev/null +++ b/doc/clientless/2026-11-05-flight-presentation.md @@ -0,0 +1,42 @@ +# Fluganimationen: Stillstand und Landung + +Der CPC-Flugcontroller setzt beim tatsächlichen Flugbeginn und bei Fortsetzung +nun einheitlich die Flug-Animationsstufe. Veraltete Schwimm-/Fallzustände werden +entfernt. Beim Halten wird zusätzlich das native PlayHoverAnim aktiviert; +Position und Mount bleiben erhalten. Beim Weiterfliegen wird die zusätzliche +Leerlaufanimation wieder aufgehoben. Eigenständige Hover-/Gravitationswirkungen +bleiben berücksichtigt. + +Alle echten Flugpausen verwenden denselben Übergang, einschließlich Formation, +Warten auf die Anführer-Landung, lokaler Neuplanung und Notlandesuche. Der +stationäre Bewegungszustand wird nach dem Spline-Stopp und danach höchstens +einmal pro Sekunde an Beobachter gemeldet. Normale Segmentübergänge behalten +ihre durchgehenden Splines. + +Normale und Notlandungen benutzen denselben Abschluss, weiterhin ausschließlich +nach bestätigter trockener Aufstandsfläche. Zuerst erfolgen nativer Spline-Stopp +und Aura-/Mount-Entfernung. Danach werden Flug-, Schwimm-, Fall- und alte +Bewegungsflags sowie Pitch/Fallzeit/Spline-Elevation bereinigt, die Bodenstufe +gesetzt und der abschließende Bewegungszustand an die Clients gesendet. Das +verhindert auch, dass ein durch Mount-Entfernung neu gesetztes FALLING stehenbleibt. + +Die registrierten Testbots erhalten zusätzliche Zustandsfelder und Zugriff auf +normale Flug-/Folgeflug-/Landungsaufrufe. Diese umgehen keine Profil-, Mount-, +Gebiets- oder Geometrieprüfung. Sie dienen wiederholbaren Tests ohne direkte +Manipulation von Bewegungsflags. + +14 Regressionstestdateien bestanden; die eigentlichen Zustandstransitionen +zusätzlich mit ASan/UBSan geprüft. Build-j10 und Installation bestanden; +Shutdown normal abgeschlossen. Live-Befunde und endgültiger Betriebszustand +stehen im Session-Checkpoint und unter checkpoints/2026-11-05-flight-animation. +Die tatsächliche Modelldarstellung im WoW-Client bleibt durch Ingame-Abnahme +zu bestätigen; serverseitige Flags und Animationsmeldungen sind separat prüfbar. + +## Live-Ergebnis + +Der abschließende Goldhain-Lauf mit registrierter Testaria bestand alle vier +Prüfungen: drei Sekunden Schweben ohne Positionsänderung, Fortsetzung mit +regulärer Fluganimation sowie saubere Landungen nach Folgeflug und normalem +Flug. Ein vorheriger Lauf bestätigte zusätzlich dieselben sauberen Zustände +nach einer echten Notlandung. Die Figur ist vollständig zurückgesetzt und +ausgeloggt; der normale Botbetrieb ist wiederhergestellt. diff --git a/doc/clientless/2026-11-05-ground-reentry.md b/doc/clientless/2026-11-05-ground-reentry.md new file mode 100644 index 0000000000..5172d9534e --- /dev/null +++ b/doc/clientless/2026-11-05-ground-reentry.md @@ -0,0 +1,42 @@ +# Boden-Wiedereinstieg in den TravelGraph + +Anlass: Brinunli (94, Allianz, Level 19) konnte die erlaubte Talrendis-Station +`taxi_167` in 624 Yards Entfernung nicht als Einstieg berücksichtigen. Die +500-Yard-Grenze ließ nur einen veralteten und einen fraktionsfremden Knoten zu. + +Die bereits für Flieger vorhandene Suche erweitert nun auch für Bodenbots den +Suchradius in 500-Yard-Schritten bis 10.000 Yards. Zusätzliche MMAP-Abfragen +sind auf vier pro Planung und ein Budget von 25 ms begrenzt und werden innerhalb derselben Planung +wiederverwendet. Eine einzelne bereits gestartete native Abfrage ist nicht +unterbrechbar. Ein vollständiger Zugangsweg darf bis 2.000 Yards lang sein; +unvollständige Wege werden nur bis zu ihrem tatsächlich geprüften Endpunkt +abgelaufen und danach neu geplant. Die lokale Bewegung bleibt in kurzen +Splines. Fraktions-, Gebiets- und Geometrieprüfungen bleiben aktiv. + +Wenn sich kein Einstieg planen lässt, werden bis zu sechs lokale Suchwege +versucht. Jeder braucht eine reale Bodenfläche, einen vollständigen sicheren +MMAP-Pfad und eine akzeptierte Bewegungsausführung. Nach dem Gehen wird vom +neuen Standort aus erneut geplant. Der Suchlauf gilt für initiale Fehler bei +`travel_to_node` und `travel_to_location` sowie erschöpfte stationäre Versuche. +Flug, Taxi, Transport, Fahrzeug, Fallen, Kampf und Teleport werden nicht durch +Bodensuchläufe unterbrochen. Es gibt keinen neuen Teleport-Fallback. + +Automatisierte Prüfungen: vollständiger Produktionsplaner für erweiterten +Bodeneinstieg, gesperrten Knoten, fehlenden und überlangen Pfad; +Produktions-Suchlauf für sichere Bewegung, Bodenhöhe, Gebiet, Zustandsschutz, +Ausführungsablehnung und begrenzte Versuche. Dazu bestehende Cache- und +Rescue-Regressionsprüfungen. Live- und Installationsstand siehe SESSION-RESUME. + +## Ergebnis + +Build, Installation und Startprüfung bestanden; normaler Betrieb mit allen +118 vorherigen Bots wiederhergestellt. Der abschließende registrierte +Testbot-Test bestätigt sechs reale Suchwege mit Neuplanung. Ein erfolgreicher +Grapheneinstieg oder die Ankunft an taxi_167 ist damit **nicht** bestätigt. +MMAP weist den direkten Zugang weiterhin ab; nach sechs Suchläufen endet die +Aktion. Testaria wurde vollständig zurückgesetzt und ausgeloggt. + +Beim zwischenzeitlichen Shutdown wurde ein weiterer Absturz in +Unit::RemoveDynObject (Spell::cancel während Grid-Cleanup) gesichert. Dump, +Stacktrace und passende ausführbare Datei sind erhalten; dieser Fehler ist +nicht behoben. Der Server wurde anschließend erfolgreich wieder gestartet. diff --git a/doc/clientless/SESSION-RESUME.md b/doc/clientless/SESSION-RESUME.md index d789717dac..e6f11eae32 100644 --- a/doc/clientless/SESSION-RESUME.md +++ b/doc/clientless/SESSION-RESUME.md @@ -1,3 +1,269 @@ +# 2026-11-05 – Gesamter offener Stand zum lokalen Commit freigegeben + +Nutzerauftrag: sämtliche Änderungen committen und sauberen Worktree herstellen. +Sammelcommit umfasst begrenzten Boden-Grapheneinstieg/Suchläufe, korrigierte +Flug-/Schwebe-/Landeanimationen, native Testbot-Flugsteuerung und Diagnosedaten, +Regressionstests, Live-Reproduktionen, Raidtest-Aufbau sowie den begrenzten +passiven GDB-Launcher. Frühere WIP-/Nicht-committen-Hinweise unten sind durch +diesen ausdrücklichen Commit-Auftrag überholt. Kein Push beauftragt. +Build, Installation und Live-Prüfungen sind bereits abgeschlossen; für den +Commit keine weiteren Codeänderungen und kein Serverneustart erforderlich. +Der Instanzbindungsabsturz und der frühere Shutdown-Absturz bleiben offen; +der Commit enthält deren Dokumentation/Diagnose, keine behauptete Behebung. + +--- + +# 2026-11-05 18:46 – Fluganimationen FERTIG installiert/live geprüft + +NutzerauftragFlugpausenundLuftschwimmennachDismountkorrigieren.Umgesetzt: +ClientlessFlightMgr zentraleSetAirbornePresentation/PublishMovement/ +CompleteLanding/MaintainAirbornePresentation,HoldFollowingfürallePausen: +AnimTierFly+SetPlayHoverAnim(true)imStillstand,keinPositionsjitter/keineFake- +Splines,saubereFortsetzungmitHoverAnimfalse.BewegungsheartbeatnachStoppund +max1/sIdle,auchSharedWait/EmergencyRetry/Neuplanung.NormaleSegmenthandoffs +bleibenohneStop. FlugstartsbereinigenstaleSWIM/FALL/SplineElevation. +BeideLandepfadeerstNACHvalidiertemDryTouchdown:nativerStop+MountAuraentfernen, +DANACHauchdarausneu gesetztesFALLINGsowieSwim/Moving/Flyingbereinigen, +Pitch/FallTime/SplineElevation0,GroundTier/korrekteHoverWirkungen,ObserverUpdate. +LegitimeHover/GravityWirkungenbleibenberücksichtigt.KeinGeometrie-/Routenfix. + +TestBotMgrstateumFlags/Tier/Hover/Mount/Fly/Swim/Fall/Watererweitert; +leasedregistrierteActorAPIflight(...,following?)/land_flight nutzt normaleCPC- +Prüfungen. TestBotProfilmussgeladenwerden(z.B.luareload),keineFreigabeumgangen. +Doku testbots.md+2026-11-05-flight-presentation.md.Neuertest_flight_presentation +kompiliertECHTEProduktionshelpermitASan/UBSan;alteExtraktionstestsanHelper- +Schnittstellenangepasst. ALLE14relevantenRegressionstestdateienPASS. + +Build-j10PASS(1bestehendeunusedloadedWarnungviano_bot_commands2453),InstallPASS, +ShutdownAltPID77330normalnachintegrierter60sGrace/FINALIZE0.KeinCrash. +JEWEILSvorgeschriebenLoaderconf+runtime0undsafeallbeimBuildstart,keinShutdown +bisBuildfertig.FinaleVersionboundedpassiveGDBPID79529,frischesREADY+Ports +8085/8087,Loader1wiederhergestellt.ALLEvorheronlinebestehendenBotswiederonline, +aktuell120onlineinclSpieler;11gezieltefehlendeLoginsnachTestangefordert. + +LIVE:RegistrierteTestaria149,temporärLv85/riding225/native32235/90267. +ErsterLaufwegenfehlendemgeladenemProfilabgewiesen(keinSchutzumgangen). +ZweiterLaufmitnativemProfilreload:Schweben3spositionsgleich,Weiterflug, +saubereNOTLandungPASS;zusätzlichernormalerZielversuchgeometrischabgewiesen. +FINALaufGoldhainfreierFläche mitrealemFolgeflug/normalemFlug: +flight_presentation_goldshire_20261105_184502 PASS4/0,in28.8s. +>=7PositionsgleicheHaltesamplesFlyTier3/Hover1/moving0;ResumeHover0/Moving1; +ZWEInormaleFLIGHT_LANDEDmitFLIGHT_PRESENTATION_GROUNDflags0/hover0, +unmounted/Fly0/Swim0/Fall0/Tier0,keinOperatorbewegeneingriffwährendFlug. +NotlandungshelperauchimzweitenLaufnativdurchlaufen+sauberabgeschlossen. +SICHTBAREModelldarstellungmussNutzerimWoWClientnochbestätigen;Serverzustände +undObserverPublikationseparatunit/livebelegt.KeineautomatischeBildabnahme. +TestariawiederLv10OriginalMap0(-8912,-138,80.9),offline,Ridingentfernt, +zusätzlichgelernte32235/90267offlineentfernt,tempProfilentfernt,Originalzustand +verifiziert.Artifacts checkpoints/2026-11-05-flight-animation/{result,actor-after, +live-final-result,population-after,before}.json undLogs/LiveLua. + +WIPkeinCommit/Pushbeauftragt;vorherigerBodenfix+RaidtestWIPbewahrt. +FrühererInstanzbindungscrashNICHTinAnimationstaskgefixt;passendealteExecutable +fürCore170530vorInstallgesichertuntercrash/worldserver-20261105-170530.executable. +KünftigeServerstartsweiterboundedGDBLauncher1812-instance-crashverwenden. + +--- + +# 2026-11-05 18:12 – Raidankunft bestätigt, neuer Instanzbindungscrash, Animationen offen + +NutzerbeobachtetPausenohneFlugleerlaufanimationundLuftschwimmennachDismount; +fragtoballeZielerreicht. READONLYbelegt:ALLE10desTests159..166+169/176 +Map671/Instance1gespeichert. NativeFLIGHT_LANDEDalle10zwischen18:09:50und +18:11:01(letzterBrynda),keinAnreisehängerimletztenStand. Reiseerfolg≠Bosskampf. +NativeKommandosantwortetennicht:PID70730warseit18:12:42imCrash/GDBgestoppt. +Coreworldserver-20261105-170530.corevollgesichert(~10.49GBlogisch),ausführlicher +Stackdruckbliebunvollständig.Kernel18:14:33OOMkillgdb70717(RSS6.5GB),danach +Worldserver+tmuxweg. GrundcrashISTNICHTOOM:ASSERTMap.cpp2779 +playerBind->save==mapSave. GezieltbegrenzterPostmortemBT/Actorbestätigt: +SpielerALLITESTER,Networksession,beimWorldportACKnachBastionMap671Instance1. +NochkeinevollständigeBindungsursache/nichtrepariert. NichtalsBotcrashbehaupten. +Belege checkpoints/2026-11-05-1812-instance-crash/{main-stack,crash-actor}.log. + +AutorisierteServerrecoveryohneBuild:Altprozesse/tmuxweggeprüft,neuerpassiver +GDBLaunchermitsetprintelements32/max-depth4(kompletterCore+alleThreadsstill), +PID77330nach12sfrischesREADYund8085/8087listeningbestätigt.Loaderconfig1 +bleibtaktiv,10RaidbotLoginzusätzlichangefordert. NACHRestartalle10onlineaber +Map0/Instance0,RecoveryaußerhalbInstanz;native176Phase2Raid/OutsideRecoveryRest. +KeineTP-/Planänderungdurchuns. AnkunftbestätigungbeziehtsichaufVORCrash. +StartlauncherfürkünftigeRestartsJETZT +checkpoints/2026-11-05-1812-instance-crash/start-bounded-diagnostic.sh verwenden, +vermeidetunbegrenztenrekursivenGDBVariablendruckundbeobachtetenOOM. + +AnimationsdiagnoseNURSource,bisherNICHTgefixt/keinBuild: HoldFollowing263 +setztFlyAnimTier+SMSG_MOVE_UPDATE,aberandereStop/Hold/FailPfadeundnormale +FlugsegmentstartssetzenüberwiegendnurFLYING/SetFly,keineeinheitlicheTier- +undStandmeldung. NormaleLandung~944/Notlandung~699entfernenFlying/Ascending/ +Descending,setGroundTierundRemoveMounted,bereinigenSWIMMINGnichtexplizit; +auchdieabschließendeObserverMovementSynchistnichtvereinheitlicht. +Luftschwimm-UrsacheNOCHNICHTamkonkretenLivebotbewiesen! Möglicherstaler +Clientzustand/Bewegungsflags;vorFixnativeFlags+AnimTier+Spline+Waterstate +aufnehmen,dannzentralAirborneHoldundTouchdownbereinigen/Observerpublizieren. +KeinevoreiligeBehauptungalleAnimationsproblemebereitsgelöst. +BisherigeGround-WIPundRaidtestprofile169Tank/Persistent169176bewahrt. + +--- + +# 2026-11-05 17:45 – 18:00/19:00 Zehner-Raidtest VORBEREITET + +NutzerbeauftragtklassischenTest18groupformationGildedRose/19raidBastion. +Roster159Renren,160Marndra,161Marnda,162Aruendas,163Winienwi,164Taliaarnora, +165Brynda,166Corric,169Bromdan,176Ashaelri. UrsprünglicherTank167Ragnorli +existiertnachregulärerRotationnichtmehr;Nutzerinformiert,BromdanalsErsatz. +Profil169RoleTank/Specialization1(Solo2bleibt),176Tank;161/162Heiler;Rest6DPS. +169+176persistent1gegenRotationgesichert,alleanderen8bereitsPersistent1. +OriginalprofilemitallenPersistentFlagsfürspätereRücksetzunggesichert! +169warvorherDamage/Spec2,persistent0;176vorherpersistent0. + +Alle10gezieltausgeloggt(NURTestgruppe),VorherSnapshotsPläne/Handoffs/Visits/ +Profile/Gruppen/Positionen. TagesplanHEUTE20261105:17restGildedRosezumWarten, +18groupformationGildedRose,19raidinstance_visit_at_6354_d0. 30ZeilenVOR +TeleportundnachLoginverifiziert. AlteHandoffs/VisitsnurTestgruppeentfernt, +offlineMap0instance0GildedRose(-8864.73,669.015,97.9031),TransportOffsetsund +TaxiPathgeleert.Dann10Login,nativeStop/interactionleavefüralteMitgliedschaften, +scheduleon.Alle10nativschedule1/rest/the_gilded_rosebis18bestätigt,alle10Raid- +Eligibilityown1/invitation1. 2Tanks2Heiler6DPS/alle85onlineStormwindgeprüft. +KeinekünstlicheGruppenfüllung;ab18normalerGruppenmanager,19autonomeAbreise. +Loadernurkurzconf+runtime0fürAufbau,danachoriginal1wiederhergestellt. +KeineCodeänderung/Build/RestartfürTest;vorherigeBodenfix-WIPbewahrt. +KEINEDauerbeobachtung/Nachtjob;NutzerbeobachtetundfordertAuswertungspäterselbst. +Belege checkpoints/2026-11-05-1900-raid-test/{manifest,result,verified-plans-final, +native-status,native-eligibility,offline-rose,before-*}.json/.log und setup.py. + +--- + +# 2026-11-05 – Boden-Wiedereinstieg/Suchlauf FERTIG installiert + +AktuellerNutzerauftragbevorzugtbewegteSuchläufevorStillstand.Umgesetzt: +Bodenbotsnehmenander500->10000Ringsucheteil;ZugangswegeMMAP-geprüftbis2000, +DeferredExecutoridentisch.LokaleSpline-/Gebiets-/Fraktionsschutzunverändert. +ZusätzlicheNativeStartprobenjenseits500aufmax4/Planungund25msbegrenzt; +einzelneNativeAbfrageistnichtunterbrechbar,beideSuchstufenverwendenCache. +InitialePlanungsfehlerbeiderTravelactionsundRetry-Endestartenmax6geprüfte +Bodensuchläufe;nachAnkunftneuePlanungauchbeierschöpftenstationärenRetries. +KeinTeleportfallbackhinzugefügt;Flug/Taxi/Transport/Vehicle/Combat/Teleport/ +Fallingbleiben geschützt. AlleÄnderungenWIP,keinCommit/Pushbeauftragt. + +SechsRegressionstestdateienPASS(free_flight_planner,ground_reentry_wander, +graph_probe_cache,rescue_graph,rescue_executor,adventure_navigation_rescue). +ErsteLiveVersionbewegteTestaria149zweimalundplanteDeferredGraphzugänge; +explizitesZieltaxi167nach180sNICHTerreicht(MMAPno-path/large-segment/Z). +FinaleBudgetversionLiveJob ground_search_retry_20261105_170739 PASS(1/0), +SECHSechteSuchwegeanBrinunliOriginalposition,dazwischenNeuplanungsversuche, +aberKEINnutzbarerGrapheneinstieg/Zielankunftnachgewiesen! Nachmax6endetAktion. +NichtalsvollständiggelösteReisezumTaxiknotenverkaufen. Einzwischenzeitlicher +Testloginliefwährend118erMassloginins30sLimit,danachsauberwiederholt. +TestariawiederLv10Originalposition(-8912,-138,80.9),offline;Overrideentfernt. +Brinunli94beimfinalenLoginvonbestehenderRecoveryautomatischinHauptstadt +zurückgesetzt,danachnativeBewegungaufGroundEdge1733beobachtet.Keinmanueller +RegularbotTeleport/Intentedit.HerkunftspositionmitregistriertemTestbotgeprüft. + +DreiBuilds-j10PASS/InstallPASS,jeweilsLoaderconf+runtime0/safeallamBuildstart, +ShutdownerstnachBuildende. FinaleVersionpassivGDB PID70730,frischesREADYund +Ports8085+8087bestätigt.Loader1wiederhergestellt,ALLE118vorherigenBotsonline, +Testariaoffline.Artifacts checkpoints/2026-11-05-ground-reentry/result.json. + +WICHTIG: BeimzweitenShutdown(AltPID70116)nachCLIENTLESS_SHUTDOWN_END/grace60s +SIGSEGVUnit::RemoveDynObject(spellId48210),invalidlistiterator,viaSpell::cancel +->SpellEvent::Abort->EventProcessor::KillAllEvents->CreatureCleanups/GridUnload. +EigenständigerShutdownfehler,KAUSALITÄTZURNEUENNAVIGATIONNICHTBELEGT; +nochNICHTrepariert! Dump+vollerStack+passendealteExecutablegesichertunter +server/debug/crash/worldserver-20261105-165742.{core,backtrace.log,executable}. +ErstnachGDB/Worldprozess/tmuxEndeinstalliert+neugestartet,Serverbetriebsbereit. + +--- + +# 2026-11-05 – Boden-Suchlauf LIVE, finale Kostenbegrenzung im Build + +ErsteVersion erfolgreich gebaut/installiert, normalerShutdown/GDBexitednormally, +PID70116 READY+8085/8087; Loaderwiederfreigegeben. RegistrierteTestaria149Lv19 +anBrinunliStart mitnativerTravelaction getestet: zwei echteSuchläufezuFuß, +dannDeferredGraphplanung undweitereprüfteFußbewegung. KEINTeleportwährendTest. +DaszusätzlicheZielkriteriumtaxi167innerhalb180sistNICHTerfüllt: MMAPweistdirekten +PfadzurtatsächlichenTaxistationmitno-path/large-segment/large-z-deltaab; +DeferredPfadeführtenu.a.zutaxi80/portal3654MMAP-Endpunkten, nichtZielankunft. +LiveJob ground_reentry_20261105_165815 failed(1PassBewegung/1FailZiel), +CleanupführtActoraufLv10/Originalpositionzurück, offline. Testoverrideentfernt. +KeineAnkunftbehaupten! Bewegung+Neuplanungwirksam;garantierterWiedereinstieg +beiunzugänglichenGraphankernnichtgegeben. +ErsteStartsuchewarzuaufwendig(24Startcalls~1.15s), daherjetztmax4NEUE +MMAP-Startprobenjenseits500YardsproPlanungund25msBudget(mind.eineeinzelne +nativeAbfragekannlängerdauern). Tier2nutztcacheohneZusatzkosten;auchvergrößerte +Recovery-startRadius-WerteumgehendasBudgetnicht. Testsplaner/cache/wanderPASS. +Build-budget-j10läuft;Loadererneut0conf+runtime,safeallvorBuildangefordert. +DanachShutdown/Install/Restartundfinaler60s-BewegungstestnochAUSSTEHEND. +UrsprünglicherBetriebszustandbefore.jsonaufbewahrt;nachletztemRestartalle +vorherOnlineBotswiederherstellen(nichtnurLoaderfreigeben,PoolloginbrauchtZeit). + +--- + +# 2026-11-05 – Boden-Wiedereinstieg/Suchlauf WIP + +Nutzer bevorzugt laufende, nach Grapheneinstieg suchende Bots gegenüber +Stillstand; adaptive Bodensuche autorisiert. Auf feature/clientless-player-core, +vorher nur bekannter Brinunli-Diagnosecheckpoint dirty. Implementiert: +PlanAdaptiveRoute erweitert auch Bodenbots in500erRingen bis10000, maximal24 +zusätzliche MMAP-Startproben jeSuchstufe, echte geprüfte Zugangswege bis2000 +Yards (Ausführung weiterhin kurze lokale Splines); unveränderteFraktions-/ +Gebietsprüfung. Deferred-Executor übernimmt dieselbe2000Pfadgrenze. +Beide initialen Planungsfehler starten vorhandenenSuchlaufzuFuß; zusätzlich +Recovery-Budget-Ende. Max6Suchläufe mit lokalerBodenhöhe, vollständiger sicherer +MMAP-Prüfung und echterExecution-Statuskontrolle; keineFlüge/Taxi/Transport/ +Combat/Teleport/Falling/Vehicle. Nach erfolgreichemSuchlauf wird neu geplant, +auchwennstationäreRetriesaufgebraucht. KeineTeleports hinzugefügt. +Tests free_flight_planner, ground_reentry_wander, graph_probe_cache, +rescue_graph, rescue_executor, adventure_navigation_rescue PASS. Alter +rescue_executor-Test extrahierte zusätzlich nachträglich eingefügte fremde +Methode; Schnittgrenze berichtigt. Build-j10läuft, Loader0conf+runtime und +safeall angefordert. KleinernachträglicherForwardProgress-Fix benötigt noch +inkrementellenBuild nachlaufendemLink; danach regulärShutdown/Install/Restart. +LiveTestmitregistrierterTestaria149Lv19vonBrinunliStartnachtaxi167 vorbereitet. +Artifacts checkpoints/2026-11-05-ground-reentry. NochNICHTinstalliert/Livegeprüft. + +--- + +# 2026-11-05 – Notlandung committed; Brinunli94 read-only diagnostiziert + +Nutzerauftrag zuerstcommit,dannBrinunliansehen. Commit a211580262 +„Add checked emergency landings and bounded search flights“,13Dateien inkl +Tests/Docs/LiveLua, keinPush, Arbeitsbaum danachsauber. Nun nurDiagnosecheckpoint +wiederWIP; keineCode-/Intent-/Positionsänderung, keinBuild/Restart. + +Brinunli94, Zwerg/JägerinLv19, Map1zone331 Eschental/Nachtweisenwald, +(2815.68,-3790.07,88.2077). NativeIntentEconomy,solo,keinTaxi/FreeFlight, +riding0/license0/FlightEnabled0. Action travel_to_location StatusCompleted, +„no useful travel progress available“. NavCalculated/Completefalse0points. +Ankunftsvertraglehntzurechtab (Distanz470bis1189Yards),alle30sanderesFallbackziel +(u.a.poi_tele_533,389,1313,810,1358,373,271,359)ohnerealenFortschritt. +NativeC820_LOCATION_PLAN_FAILED: „no reachable travel node or recorded ground +edge near current position“. Ursache liegt beim Einstieg, nicht bei allen Zielen. + +DBGraphnearby: +- taxi64 Dist130.924,coords2721.99,-3880.64,100.87: keinFlightmasterinnerhalb100! + NächsterKroumSpawn284519 ist390YardsvonNodeentfernt -> automatischeMask0, + Nodegeschlossen. AlterTalrendis-Punkt/nativunbesetzt. +- taxi683 Dist409.592,coords2988.13,-4161.36,101.27: Kroum36728/faction29, + Master5Yardsentfernt, Horde-only -> AllianzZwerginabgewiesen. +- taxi167 Dist624.280,coords3000.25,-3202.41,189.77: SuralaisFarwind22935 + Spawn270611faction80, Master5Yardsentfernt, Alliance-only -> gültigerEinstieg, + aberaußerhalb500Yards. ObFußpfadkomplett/zulässigistnochNICHTgeprüft! +- NächsteenabledGroundEdgePointsp941900..1903 erstab945.277Yards. Keine + aufgezeichneteBodenkanteim500Radius. +Masken durch tatsächlicheCreatureDB+FactionTemplate.dbc verifiziert: faction29 +Horde2, faction80Alliance1. NodeaccessalleNULL =Autoauflösung, nichtoffeneMaske. +Area20MinimumistNICHTGrund:19+defaultLevelGap5>=20erlaubtEschental. + +SourcePlanAdaptiveRoute filtertAllowsNodeVORlocalPathAnalyse undbegrenzt +GroundeinstiegeaufstartRadius500/PathLength500. 500erErweiterungbis10000wird +nurbeiFlightEnableddurchlaufen. DaherkeinMMAPPfad zum624entferntenNodeangefordert. +MakrofallbackändertZiel, löstaberfehlendenStartnicht. SinnvollernächsterFix: +separatebegrenzteMMAP-geprüfteErweiterungfürBodenbots undabschnittsweiseAnreise +zumzulässigenEinstieg, nichtdenHordeknotenfreigeben oderFlugerlaubniserfinden. +UserbisherNURDiagnoseangefragt, keinFiximplementiert. ServerPID65012online. +Belege checkpoints/2026-11-05-brinunli/{native-status.log,navigation.log}. + +--- + # 2026-11-05 – Notlandung/Suchflug FERTIG installiert und live geprüft Nutzerauftrag vollständig umgesetzt. Neue Geometrie/Suchlogik in diff --git a/doc/clientless/checkpoints/2026-11-05-1812-instance-crash/start-bounded-diagnostic.sh b/doc/clientless/checkpoints/2026-11-05-1812-instance-crash/start-bounded-diagnostic.sh new file mode 100644 index 0000000000..ac216e195e --- /dev/null +++ b/doc/clientless/checkpoints/2026-11-05-1812-instance-crash/start-bounded-diagnostic.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -e +umask 077 +ulimit -c unlimited +root=/home/wow_admin/wow_cata_server +stamp=$(date +%Y%m%d-%H%M%S) +crash_dir="$root/server/debug/crash" +exec gdb -q -nx -batch \ + -ex "set pagination off" -ex "set confirm off" -ex "set debuginfod enabled off" \ + -ex "set logging file $crash_dir/worldserver-$stamp.backtrace.log" \ + -ex 'set logging overwrite on' -ex 'set logging enabled on' \ + -ex 'set print elements 32' -ex 'set print max-depth 4' \ + -ex run -ex "generate-core-file $crash_dir/worldserver-$stamp.core" \ + -ex 'thread apply all bt full' --args ./worldserver diff --git a/doc/clientless/checkpoints/2026-11-05-1900-raid-test/setup.py b/doc/clientless/checkpoints/2026-11-05-1900-raid-test/setup.py new file mode 100644 index 0000000000..1b3f632380 --- /dev/null +++ b/doc/clientless/checkpoints/2026-11-05-1900-raid-test/setup.py @@ -0,0 +1,56 @@ +"""Reset only the authorized ten-bot raid test; preserve all pre-test state.""" +from pathlib import Path +import sys,json,re,time +sys.path.insert(0,'doc/clientless/checkpoints/2026-11-02-0600-group-test') +sys.path.insert(0,'doc/clientless/checkpoints/2026-11-02-elevated-flight') +import test_driver as d +import live_support as w +B=Path(__file__).resolve().parent +G=[159,160,161,162,163,164,165,166,169,176] +ids=','.join(map(str,G));today=int(d.now().strftime('%Y%m%d')) +assert today==20261105 and d.now().hour<18 + +def save(name,data): + p=B/(name+'.json');assert not p.exists(),f'Preserve existing checkpoint: {p}' + p.write_text(json.dumps(data,indent=2,ensure_ascii=False)) +conf=d.CONF.read_text();loader=re.search(r'^Clientless.Adventure.Loader.Enabled\s*=\s*(\d+)',conf,re.M)[1] +save('manifest',{'date':today,'requested_at':d.now().isoformat(),'formation_hour':18,'raid_hour':19,'meeting':'the_gilded_rose','raid':'instance_visit_at_6354_d0','guids':G,'tanks':[169,176],'healers':[161,162],'damage':[159,160,163,164,165,166],'replacement':{'removed_guid':167,'replacement_guid':169},'loader_before':loader,'observation':'user observes; no background observer'}) +save('before-profiles',d.query('Character',f'SELECT * FROM vcore_adventure_generated_bot WHERE character_guid IN ({ids})')) +save('before-characters',d.query('Character',f'SELECT guid,name,level,online,map,instance_id,zone,position_x,position_y,position_z,orientation,transguid,taxi_path,health FROM characters WHERE guid IN ({ids})')) +save('before-plans',d.query('World',f'SELECT * FROM vcore_adventure_day WHERE local_date={today} AND character_guid IN ({ids})')) +save('before-handoff',d.query('World',f'SELECT * FROM vcore_adventure_group_handoff WHERE character_guid IN ({ids})')) +save('before-visits',d.query('Character',f'SELECT * FROM vcore_adventure_instance_visit WHERE character_guid IN ({ids})')) +save('before-groups',d.query('Character',f'SELECT * FROM group_member WHERE memberGuid IN ({ids})')) +d.CONF.write_text(re.sub(r'^(Clientless.Adventure.Loader.Enabled\s*=\s*)\d+',r'\g<1>0',conf,flags=re.M)) +for c in ['reload config','clientless population reload']:d.command(c) +for g in G:d.command(f'clientless logout {g}') +for _ in range(50): + if not d.query('Character',f'SELECT guid FROM characters WHERE guid IN ({ids}) AND online=1'):break + time.sleep(1) +else:raise RuntimeError('Still online; no offline writes; loader paused') +profiles=json.loads((B/'before-profiles.json').read_text());profile=next(r['profile_lua']for r in profiles if r['character_guid']=='169') +changed=profile.replace('specialization = 2, solo_specialization', 'specialization = 1, solo_specialization',1).replace('role = "damage"','role = "tank"',1) +assert changed!=profile and 'role = "tank"'in changed +w.write('Character',f"UPDATE vcore_adventure_generated_bot SET profile_lua=UNHEX('{changed.encode().hex()}') WHERE character_guid=169; UPDATE vcore_adventure_generated_bot SET persistent=1 WHERE character_guid IN (169,176);") +values=','.join(f"({g},{today},{h},'{intent}','{loc}')"for g in G for h,intent,loc in [(17,'rest','the_gilded_rose'),(18,'groupformation','the_gilded_rose'),(19,'raid','instance_visit_at_6354_d0')]) +w.write('World',f'REPLACE INTO vcore_adventure_day (character_guid,local_date,hour_slot,intent,location_key) VALUES {values}; DELETE FROM vcore_adventure_group_handoff WHERE character_guid IN ({ids});') +plans=d.query('World',f'SELECT character_guid,hour_slot,intent,location_key FROM vcore_adventure_day WHERE local_date={today} AND character_guid IN ({ids}) AND hour_slot IN (17,18,19) ORDER BY character_guid,hour_slot') +assert len(plans)==30;save('verified-plans-before-teleport',plans) +w.write('Character',f"DELETE FROM vcore_adventure_instance_visit WHERE character_guid IN ({ids}); UPDATE characters SET map=0,instance_id=0,zone=1519,position_x=-8864.73,position_y=669.015,position_z=97.9031,orientation=0,transguid=0,trans_x=0,trans_y=0,trans_z=0,trans_o=0,taxi_path='' WHERE guid IN ({ids}) AND online=0;") +save('offline-rose',d.query('Character',f'SELECT guid,name,map,instance_id,position_x,position_y,position_z,taxi_path,transguid,online FROM characters WHERE guid IN ({ids})')) +for g in G:d.command(f'clientless login {g}') +for _ in range(60): + if len(d.query('Character',f'SELECT guid FROM characters WHERE guid IN ({ids}) AND online=1'))==10:break + time.sleep(1) +else:raise RuntimeError('Missing test-group logins; loader paused') +for g in G: + d.command(f'clientless adventure stop {g}') + d.command(f'clientless interaction {g} leave') +time.sleep(2) +for g in G:d.command(f'clientless adventure schedule {g} on') +s=d.CONF.read_text();d.CONF.write_text(re.sub(r'^(Clientless.Adventure.Loader.Enabled\s*=\s*)\d+',lambda m:m[1]+loader,s,flags=re.M)) +for c in ['reload config','clientless population reload']:d.command(c) +for g in G: + d.command(f'clientless adventure status {g}') + d.command(f'clientless adventure eligibility {g} raid instance_visit_at_6354_d0') +print('All ten reset, plans verified, offline Rose teleports verified, native group leave/schedule on requested; loader restored.',flush=True) diff --git a/doc/clientless/checkpoints/2026-11-05-flight-animation/live-goldshire.lua b/doc/clientless/checkpoints/2026-11-05-flight-animation/live-goldshire.lua new file mode 100644 index 0000000000..300e704d0c --- /dev/null +++ b/doc/clientless/checkpoints/2026-11-05-flight-animation/live-goldshire.lua @@ -0,0 +1,89 @@ +-- Registered test actor, real controller/mounts/splines; no direct flag setters. +local g=testbot.login(149) +local before=testbot.state(g) +testbot.record('before',before) +assert(testbot.teleport(g,0,-9468.76,64.3408,55.9908,0)) +testbot.await(function() return testbot.online(g) end,15000,'open field setup') +testbot.record('ready_for_profile',true) +testbot.wait(15000) +testbot.level(g,85) +assert(testbot.skill(g,762,225,225)) +testbot.learn(g,32235) +testbot.learn(g,90267) +local function mount() + testbot.cast(g,32235) + testbot.await(function() return testbot.has_aura(g,32235) end,10000,'native mount cast') +end +local function dry_ground(s) + return s.mounted==0 and s.flying==0 and s.swimming==0 and s.falling==0 and s.animation_tier==0 and s.hover_animation==0 +end +mount() +local origin=testbot.state(g) +local tx,ty,tz=origin.x,origin.y,origin.z+20 +local started,reason=testbot.flight(g,tx,ty,tz,true) +testbot.record('follow_start',{ok=started,reason=reason}) +local held=0 +local previous=nil +local resumed=false +local start=testbot.now_ms() +while started and testbot.now_ms()-start<40000 do + local s=testbot.state(g) + testbot.record('hover_sample',s) + if s.mounted==1 and s.flying==1 and s.moving==0 and s.animation_tier==3 and s.hover_animation==1 then + if previous then + local d=(s.x-previous.x)^2+(s.y-previous.y)^2+(s.z-previous.z)^2 + if d<0.0001 then held=held+1 else held=0 end + end + previous=s + if held>=6 then break end + else previous=nil;held=0 end + testbot.flight(g,tx,ty,tz,true) + testbot.wait(500) +end +testbot.check(held>=6,'stationary flight idle persists for three seconds without displacement') +-- Resume from hover; the native flight animation must replace idle. +local s=testbot.state(g) +local ok=testbot.flight(g,s.x+30,s.y,s.z,true) +local began=testbot.now_ms() +while ok and testbot.now_ms()-began<8000 do + local n=testbot.state(g) + testbot.record('resume_sample',n) + if n.moving==1 and n.flying==1 and n.animation_tier==3 and n.hover_animation==0 then resumed=true;break end + testbot.flight(g,s.x+30,s.y,s.z,true) + testbot.wait(200) +end +testbot.check(resumed,'hover resumes real flight with idle animation cleared') +local requested=testbot.land_flight(g) +testbot.record('landing_requested',requested) +local landed=false +local began=testbot.now_ms() +while testbot.now_ms()-began<40000 do + local n=testbot.state(g) + testbot.record('landing_sample',n) + if dry_ground(n) then landed=true;break end + testbot.wait(200) +end +testbot.check(landed,'normal touchdown: unmounted dry ground tier, no flight swim fall or hover state') +-- A second real free flight covers the ordinary non-following landing path. +if landed then + local n=testbot.state(g) + local ok,why=testbot.flight(g,-9441.18,65.05,56.18,false) + testbot.record('ordinary_start',{ok=ok,reason=why}) + local moving=false + local grounded=false + local began=testbot.now_ms() + while ok and testbot.now_ms()-began<60000 do + local a=testbot.state(g) + testbot.record('ordinary_sample',a) + if a.flying==1 and a.moving==1 then moving=true end + if moving and dry_ground(a) then grounded=true;break end + testbot.wait(300) + end + testbot.check(moving and grounded,'ordinary flight and touchdown use the same clean presentation') +end +assert(testbot.teleport(g,before.map,before.x,before.y,before.z,0)) +testbot.await(function() return testbot.online(g) end,15000,'cleanup transfer') +testbot.remove_aura(g,32235) +assert(testbot.skill(g,762,0,0)) +testbot.level(g,before.level) +testbot.record('restored',testbot.state(g)) diff --git a/doc/clientless/checkpoints/2026-11-05-flight-animation/live-presentation.lua b/doc/clientless/checkpoints/2026-11-05-flight-animation/live-presentation.lua new file mode 100644 index 0000000000..69270639a7 --- /dev/null +++ b/doc/clientless/checkpoints/2026-11-05-flight-animation/live-presentation.lua @@ -0,0 +1,87 @@ +-- Registered test actor, real controller/mounts/splines; no direct flag setters. +local g=testbot.login(149) +local before=testbot.state(g) +testbot.record('before',before) +testbot.record('ready_for_profile',true) +testbot.wait(15000) +testbot.level(g,85) +assert(testbot.skill(g,762,225,225)) +testbot.learn(g,32235) +testbot.learn(g,90267) +local function mount() + testbot.cast(g,32235) + testbot.await(function() return testbot.has_aura(g,32235) end,10000,'native mount cast') +end +local function dry_ground(s) + return s.mounted==0 and s.flying==0 and s.swimming==0 and s.falling==0 and s.animation_tier==0 and s.hover_animation==0 +end +mount() +local origin=testbot.state(g) +local tx,ty,tz=origin.x,origin.y,origin.z+20 +local started,reason=testbot.flight(g,tx,ty,tz,true) +testbot.record('follow_start',{ok=started,reason=reason}) +local held=0 +local previous=nil +local resumed=false +local start=testbot.now_ms() +while started and testbot.now_ms()-start<40000 do + local s=testbot.state(g) + testbot.record('hover_sample',s) + if s.mounted==1 and s.flying==1 and s.moving==0 and s.animation_tier==3 and s.hover_animation==1 then + if previous then + local d=(s.x-previous.x)^2+(s.y-previous.y)^2+(s.z-previous.z)^2 + if d<0.0001 then held=held+1 else held=0 end + end + previous=s + if held>=6 then break end + else previous=nil;held=0 end + testbot.flight(g,tx,ty,tz,true) + testbot.wait(500) +end +testbot.check(held>=6,'stationary flight idle persists for three seconds without displacement') +-- Resume from hover; the native flight animation must replace idle. +local s=testbot.state(g) +local ok=testbot.flight(g,s.x+30,s.y,s.z,true) +local began=testbot.now_ms() +while ok and testbot.now_ms()-began<8000 do + local n=testbot.state(g) + testbot.record('resume_sample',n) + if n.moving==1 and n.flying==1 and n.animation_tier==3 and n.hover_animation==0 then resumed=true;break end + testbot.flight(g,s.x+30,s.y,s.z,true) + testbot.wait(200) +end +testbot.check(resumed,'hover resumes real flight with idle animation cleared') +local requested=testbot.land_flight(g) +testbot.record('landing_requested',requested) +local landed=false +local began=testbot.now_ms() +while testbot.now_ms()-began<40000 do + local n=testbot.state(g) + testbot.record('landing_sample',n) + if dry_ground(n) then landed=true;break end + testbot.wait(200) +end +testbot.check(landed,'normal touchdown: unmounted dry ground tier, no flight swim fall or hover state') +-- A second real free flight covers the ordinary non-following landing path. +if landed then + local n=testbot.state(g) + local ok,why=testbot.flight(g,n.x+90,n.y,n.z,false) + testbot.record('ordinary_start',{ok=ok,reason=why}) + local moving=false + local grounded=false + local began=testbot.now_ms() + while ok and testbot.now_ms()-began<60000 do + local a=testbot.state(g) + testbot.record('ordinary_sample',a) + if a.flying==1 and a.moving==1 then moving=true end + if moving and dry_ground(a) then grounded=true;break end + testbot.wait(300) + end + testbot.check(moving and grounded,'ordinary flight and touchdown use the same clean presentation') +end +assert(testbot.teleport(g,before.map,before.x,before.y,before.z,0)) +testbot.await(function() return testbot.online(g) end,15000,'cleanup transfer') +testbot.remove_aura(g,32235) +assert(testbot.skill(g,762,0,0)) +testbot.level(g,before.level) +testbot.record('restored',testbot.state(g)) diff --git a/doc/clientless/checkpoints/2026-11-05-flight-animation/testaria-profile.lua b/doc/clientless/checkpoints/2026-11-05-flight-animation/testaria-profile.lua new file mode 100644 index 0000000000..822e9c5afd --- /dev/null +++ b/doc/clientless/checkpoints/2026-11-05-flight-animation/testaria-profile.lua @@ -0,0 +1 @@ +return { identity={name=character_name}, behavior={enabled=false,daily_schedule=false}, movement={can_ground_mount=false,can_free_fly=true,flight_mounts={[32235]=1}},professions={primary={}} } diff --git a/doc/clientless/checkpoints/2026-11-05-ground-reentry/live-ground.lua b/doc/clientless/checkpoints/2026-11-05-ground-reentry/live-ground.lua new file mode 100644 index 0000000000..f579e3ca1a --- /dev/null +++ b/doc/clientless/checkpoints/2026-11-05-ground-reentry/live-ground.lua @@ -0,0 +1,25 @@ +local g=testbot.login(149) +local before=testbot.state(g) +testbot.record('before',before) +testbot.level(g,19) +assert(testbot.teleport(g,1,2815.68,-3790.07,88.2077,0)) +testbot.await(function() return testbot.online(g) end,15000,'test setup transfer') +testbot.record('ready_for_executor',testbot.state(g)) +local start=testbot.now_ms() +local moved=false +local arrived=false +while testbot.now_ms()-start<180000 do + local s=testbot.state(g) + testbot.record('sample',s) + local dx,dy=s.x-2815.68,s.y+3790.07 + if dx*dx+dy*dy>100 then moved=true end + local gx,gy,gz=s.x-3000.25,s.y+3202.41,s.z-189.77 + if gx*gx+gy*gy+gz*gz<100 then arrived=true;break end + testbot.wait(2000) +end +testbot.check(moved,'physical movement from Brinunli starting position') +testbot.check(arrived,'reached allowed Alliance graph node taxi_167') +assert(testbot.teleport(g,before.map,before.x,before.y,before.z,0)) +testbot.await(function() return testbot.online(g) end,15000,'cleanup transfer') +testbot.level(g,before.level) +testbot.record('restored',testbot.state(g)) diff --git a/doc/clientless/checkpoints/2026-11-05-ground-reentry/live-search-final.lua b/doc/clientless/checkpoints/2026-11-05-ground-reentry/live-search-final.lua new file mode 100644 index 0000000000..5aeb58fee0 --- /dev/null +++ b/doc/clientless/checkpoints/2026-11-05-ground-reentry/live-search-final.lua @@ -0,0 +1,25 @@ +local g=testbot.login(149) +local before=testbot.state(g) +testbot.record('before',before) +testbot.level(g,19) +assert(testbot.teleport(g,1,2815.68,-3790.07,88.2077,0)) +testbot.await(function() return testbot.online(g) end,15000,'test setup transfer') +testbot.record('ready_for_executor',testbot.state(g)) +local start=testbot.now_ms() +local moved=false +local arrived=false +while testbot.now_ms()-start<60000 do + local s=testbot.state(g) + testbot.record('sample',s) + local dx,dy=s.x-2815.68,s.y+3790.07 + if dx*dx+dy*dy>100 then moved=true end + local gx,gy,gz=s.x-3000.25,s.y+3202.41,s.z-189.77 + if gx*gx+gy*gy+gz*gz<100 then arrived=true;break end + testbot.wait(2000) +end +testbot.check(moved,'physical movement from Brinunli starting position') +testbot.record('taxi_167_reached',arrived) +assert(testbot.teleport(g,before.map,before.x,before.y,before.z,0)) +testbot.await(function() return testbot.online(g) end,15000,'cleanup transfer') +testbot.level(g,before.level) +testbot.record('restored',testbot.state(g)) diff --git a/doc/clientless/checkpoints/2026-11-05-ground-reentry/testaria-override.lua b/doc/clientless/checkpoints/2026-11-05-ground-reentry/testaria-override.lua new file mode 100644 index 0000000000..3f6fd0cef3 --- /dev/null +++ b/doc/clientless/checkpoints/2026-11-05-ground-reentry/testaria-override.lua @@ -0,0 +1,3 @@ +assert(character_guid() == 149) +assert(queue_action('travel_to_node', {node='taxi_167', hard_destination='true'})) +log('LIVE_GROUND_REENTRY_TEST taxi_167') diff --git a/doc/clientless/testbots.md b/doc/clientless/testbots.md index 50da0f8c10..39bc1ba663 100644 --- a/doc/clientless/testbots.md +++ b/doc/clientless/testbots.md @@ -107,7 +107,7 @@ Zugehörigkeit zum aktuellen Lauf. Nach Teleports auf `online` warten. | `wait(ms)` | Coroutine abgeben,0..60000ms; blockiert den Server nicht | | `await(predicate,timeout_ms,label)` | Bedingung mit echter Laufzeitfrist prüfen | | `now_ms()` | Monotone Millisekunden seit Laufbeginn | -| `state(guid)` | Map,XYZ,Level,HP/Ressource,alive/combat/moving/transport (0/1) | +| `state(guid)` | Map,XYZ,Level,HP/Ressource,alive/combat/moving/transport sowie movement_flags, animation_tier, hover_animation, mounted/flying/swimming/falling/in_water (0/1) | | `teleport(guid,map,x,y,z,o)` | Administrativer nativer Teleport; bool | | `level(guid,level)` | Level1..85 samt Talentgrundinitialisierung | | `stat(guid,index,value)` | Grundwert0..4 über natives Stats-System setzen | @@ -118,6 +118,8 @@ Zugehörigkeit zum aktuellen Lauf. Nach Teleports auf `online` warten. | `equip(guid,slot,item)` | Vorbereitung: leeren Slot nativ ausrüsten; bool | | `item_count(guid,item)` | Aktuelle Inventaranzahl ohne Bank | | `move(guid,x,y,z)` | Native MMAP-/MovePoint-Bewegung ohne Gebietskatalog; bool | +| `flight(guid,x,y,z,following?)` | Nativer CPC-Flug, mit following=true bewegliches Flugziel einschließlich Halten; bool und Fehlertext. Normale Profil-/Mount-/Gebietsprüfung bleibt aktiv | +| `land_flight(guid)` | Folgenden Flug über die normale geprüfte Landung beenden; bool | | `stop(guid)` | Angriff und aktuelle Bewegung stoppen | | `creature(guid,spawn)` / `object(guid,spawn)` | Sichtbarer geladener Spawn; vollständige GUID als String oder nil | | `target_state(guid,target)` | Geladenes Unit-Ziel: HP,alive,Distanz,XYZ; sonst nil | diff --git a/src/server/game/World/ClientlessActionExecutorMgr.cpp b/src/server/game/World/ClientlessActionExecutorMgr.cpp index f64afd3cad..4f505ab6e5 100644 --- a/src/server/game/World/ClientlessActionExecutorMgr.cpp +++ b/src/server/game/World/ClientlessActionExecutorMgr.cpp @@ -681,6 +681,8 @@ bool ClientlessActionExecutorMgr::StartTravelToNode( if(sClientlessTravelGraphMgr->HasRescueNodes(player->GetMapId())) return RecoverTravel(player,characterGuid,record,0,"initial-plan-failed: "+error); + if (StartRecoveryWander(player, characterGuid, record, "initial-plan-failed: " + error)) + return true; record.Status.State=record.HardDestination?ClientlessActionExecutionState::Failed:ClientlessActionExecutionState::Completed; record.Status.Detail=record.HardDestination?error:"no useful travel progress available"; record.Active=false;return !record.HardDestination; @@ -885,6 +887,8 @@ bool ClientlessActionExecutorMgr::StartTravelToLocation( return true; if(sClientlessTravelGraphMgr->HasRescueNodes(player->GetMapId())) return RecoverTravel(player,characterGuid,record,0,"initial-plan-failed: "+error); + if (StartRecoveryWander(player, characterGuid, record, "initial-plan-failed: " + error)) + return true; record.Status.State=record.HardDestination?ClientlessActionExecutionState::Failed:ClientlessActionExecutionState::Completed; record.Status.Detail=record.HardDestination?error:"no useful travel progress available"; record.Active=false;return !record.HardDestination; @@ -1530,7 +1534,7 @@ bool ClientlessActionExecutorMgr::StartRouteStep( (entryNav.PathType & uint32(PATHFIND_INCOMPLETE)) != 0 && (entryNav.PathType & uint32(PATHFIND_NOPATH)) == 0 && entryNav.PointCount >= 2 && entryNav.PathLength >= 2.0f && - entryNav.PathLength <= 500.0f && entryNav.MaxSegmentLength <= 8.0f && + entryNav.PathLength <= 2000.0f && entryNav.MaxSegmentLength <= 8.0f && entryNav.MaxZDelta <= 5.0f && entryNav.FinalDistance + 1.0f < entryNav.DirectDistance; @@ -2208,7 +2212,9 @@ bool ClientlessActionExecutorMgr::StartRecoveryWander( Record& record, std::string const& reason) { - if (!player || !player->IsInWorld()) + if (!player || !player->IsInWorld() || !player->IsAlive() || + player->IsInCombat() || player->IsBeingTeleported() || player->GetTransport() || + player->GetVehicle() || player->IsInFlight() || player->IsFlying() || player->IsFalling()) return false; constexpr uint32 MaxWanderAttempts = 6; @@ -2232,14 +2238,25 @@ bool ClientlessActionExecutorMgr::StartRecoveryWander( player->GetPositionZ(), player->GetOrientation()); + // Sample local support, never the highest surface in the whole column. + float const floor = player->GetMap()->GetHeight(player->GetPhaseShift(), + target.GetPositionX(), target.GetPositionY(), player->GetPositionZ() + 10.0f, + true, 50.0f); + if (!std::isfinite(floor) || floor <= INVALID_HEIGHT) + continue; + target.Relocate(target.GetPositionX(), target.GetPositionY(), floor, target.GetOrientation()); + if (!sAdventureAreaMgr->AllowsPosition(player, player->GetMapId(), target)) + continue; + ClientlessPathDiagnostics nav; sClientlessTravelMgr->AnalyzePath(player, target, nav); - if (!nav.Calculated || !nav.Complete || nav.PointCount < 2 || - nav.FinalDistance > 3.0f || nav.PathLength > 180.0f) + if (!nav.Calculated || !nav.Complete || nav.Suspicious || nav.PointCount < 2 || + nav.FinalDistance > 3.0f || nav.PathLength < 2.0f || nav.PathLength > 180.0f || + nav.MaxSegmentLength > 8.0f || nav.MaxZDelta > 5.0f) continue; - if (!sClientlessTravelMgr->StartTravel(player, target)) + if (!StartGroundConnection(player, characterGuid, target)) continue; record.RecoveryWanderActive = true; @@ -2370,13 +2387,17 @@ bool ClientlessActionExecutorMgr::RecoverTravel( } bool const bridgeFailure = reason.rfind("local-bridge-", 0) == 0; - bool const forwardProgress = reason == "ground-continuation-replan"; + // A completed search walk changed our start position. Replan even after + // the stationary retry budget was spent; wander attempts remain bounded. + bool const forwardProgress = reason == "ground-continuation-replan" || + reason == "wander-ended-Arrived"; if (!bridgeFailure && !forwardProgress && record.RecoveryCount >= MaxRecoveries) { if (TryFallbackFlight(player, characterGuid, record)) return true; if (TryRescueTravel(player,characterGuid,record))return true; + if (StartRecoveryWander(player, characterGuid, record, reason))return true; record.Status.State = ClientlessActionExecutionState::Failed; record.Status.Detail = "travel recovery exhausted: " + reason; record.Active = false; diff --git a/src/server/game/World/ClientlessFlightMgr.cpp b/src/server/game/World/ClientlessFlightMgr.cpp index b86f7b0c58..6d691fbbdc 100644 --- a/src/server/game/World/ClientlessFlightMgr.cpp +++ b/src/server/game/World/ClientlessFlightMgr.cpp @@ -260,22 +260,82 @@ bool ClientlessFlightMgr::PrepareFollowingMount(Player* player) return result==SPELL_CAST_OK; } -void ClientlessFlightMgr::HoldFollowing(Player* player,Record& record) +void ClientlessFlightMgr::PublishMovement(Player* player) { - bool changed=record.Moving || !player->HasUnitMovementFlag(MOVEMENTFLAG_FLYING); - if(record.Moving)player->StopMoving(); - record.Moving=false; - player->AddUnitMovementFlag(MOVEMENTFLAG_FLYING); - if(player->GetByteValue(UNIT_FIELD_BYTES_1,UNIT_BYTES_1_OFFSET_ANIM_TIER)!=uint8(AnimTier::Fly)) - {player->SetAnimTier(AnimTier::Fly);changed=true;} - if(!changed)return; - // Clientless players have no client sending movement heartbeats after a - // spline stop. Publish the stationary flight flags to nearby clients. - player->m_movementInfo.guid=player->GetGUID(); + // Clientless players cannot supply the heartbeat that normally follows a + // spline stop, dismount or movement-flag acknowledgement. + player->m_movementInfo.guid = player->GetGUID(); player->m_movementInfo.pos.Relocate(player->GetPosition()); - player->m_movementInfo.time=GameTime::GetGameTimeMS(); - WorldPacket update(SMSG_MOVE_UPDATE);player->WriteMovementInfo(update); - player->SendMessageToSet(&update,true); + player->m_movementInfo.time = GameTime::GetGameTimeMS(); + WorldPacket update(SMSG_MOVE_UPDATE); + player->WriteMovementInfo(update); + player->SendMessageToSet(&update, true); +} + +bool ClientlessFlightMgr::SetAirbornePresentation(Player* player, bool holding) +{ + constexpr auto stale = MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FALLING | + MOVEMENTFLAG_FALLING_FAR | MOVEMENTFLAG_SPLINE_ELEVATION; + bool const hover = holding || player->IsHovering() || player->IsGravityDisabled(); + bool const changed = !player->HasUnitMovementFlag(MOVEMENTFLAG_FLYING) || + player->HasUnitMovementFlag(stale) || player->IsPlayingHoverAnim() != hover || + player->GetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER) != uint8(AnimTier::Fly); + player->RemoveUnitMovementFlag(stale); + player->AddUnitMovementFlag(MOVEMENTFLAG_FLYING); + if (player->GetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER) != uint8(AnimTier::Fly)) + player->SetAnimTier(AnimTier::Fly); + // Fly selects the flight animation tier; PlayHoverAnim selects its idle + // animation when stationary. Neither needs a fabricated moving spline. + player->SetPlayHoverAnim(hover); + if (changed) + PublishMovement(player); + return changed; +} + +void ClientlessFlightMgr::HoldFollowing(Player* player, Record& record) +{ + bool const stopped = record.Moving || player->IsSplineEnabled(); + bool const stale = player->HasUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING | MOVEMENTFLAG_MASK_TURNING) || + player->m_movementInfo.pitch != 0; + if (stopped) + player->StopMoving(); + record.Moving = false; + player->RemoveUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING | MOVEMENTFLAG_MASK_TURNING); + player->m_movementInfo.pitch = 0; + bool const changed = SetAirbornePresentation(player, true); + if (changed || stopped || stale || record.Elapsed >= record.HoldSyncAt) + { + if (!changed) PublishMovement(player); + record.HoldSyncAt = record.Elapsed + 1000; + } +} + +void ClientlessFlightMgr::MaintainAirbornePresentation(Player* player, Record& record) +{ + // Also covers shared-route waits and emergency retry delays. A mounted + // player still waiting on the ground must not acquire airborne flags. + if (!record.Moving && !player->IsSplineEnabled() && + player->HasUnitMovementFlag(MOVEMENTFLAG_FLYING)) + HoldFollowing(player, record); +} + +void ClientlessFlightMgr::CompleteLanding(Player* player) +{ + // Call only after native dry support and touchdown geometry were validated. + player->StopMoving(); + player->RemoveAurasByType(SPELL_AURA_MOUNTED); + // Removing flight permission can itself set FALLING. Clean the final state + // after native aura removal, before publishing the grounded heartbeat. + player->SetSwim(false); + player->RemoveUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING | MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING); + player->m_movementInfo.pitch = 0; + player->m_movementInfo.splineElevation = 0; + player->m_movementInfo.SetFallTime(0); + player->SetAnimTier(AnimTier::Ground); + player->SetPlayHoverAnim(player->IsHovering() || player->IsGravityDisabled()); + PublishMovement(player); + TC_LOG_INFO("server.adventurebot.navigation", "FLIGHT_PRESENTATION_GROUND guid=%u flags=0x%X hover=%u", + player->GetGUID().GetCounter(), player->m_movementInfo.GetMovementFlags(), player->IsPlayingHoverAnim() ? 1u : 0u); } bool ClientlessFlightMgr::Follow(Player* player,Position const& target,std::string& error) @@ -316,7 +376,7 @@ bool ClientlessFlightMgr::LandFollowing(Player* player) { record.Status.Landing.Relocate(player->GetPositionX(),player->GetPositionY(),solid,player->GetOrientation()); record.Status.Target=record.Status.Landing;record.Memory={};record.Following.reset();record.Status.Travelled=0; - player->StopMoving();record.Moving=false; + HoldFollowing(player, record); if(shared) { // This is a regroup landing, not arrival at the requested raid. @@ -353,7 +413,7 @@ bool ClientlessFlightMgr::AdvanceFollowing(Player* player,Record& record) if(record.Breadcrumbs.size()<4096)record.Breadcrumbs.push_back(*player); record.Segment.Relocate(best.X,best.Y,best.Z,player->GetOrientation()); Movement::MoveSplineInit move(player);move.MoveTo(best.X,best.Y,best.Z,false);move.SetFly();move.SetWalk(false);move.SetVelocity(player->GetSpeed(MOVE_FLIGHT)); - player->AddUnitMovementFlag(MOVEMENTFLAG_FLYING); + SetAirbornePresentation(player); if(move.Launch()<=0){record.Moving=false;return false;} record.Moving=true;record.SegmentElapsed=0;++record.Status.Segments;record.Status.Detail="following moving group flight target";return true; } @@ -569,7 +629,7 @@ bool ClientlessFlightMgr::Begin(Player * player, Position const & target, std::s FindReturnLanding(player,record); record.Status.MountSpell=existingMount;record.Status.State=ClientlessFlightState::Flying; record.Memory.Departed=player->GetPositionZ()-origin.Ground>record.Settings.Safety; - player->AddUnitMovementFlag(MOVEMENTFLAG_FLYING); + SetAirbornePresentation(player); TC_LOG_INFO("server.adventurebot.navigation","FLIGHT_RESUME_AIRBORNE guid=%u ground=%.3f z=%.3f",player->GetGUID().GetCounter(),origin.Ground,player->GetPositionZ()); Store(player->GetGUID().GetCounter(),std::move(record));return true; } @@ -681,7 +741,7 @@ bool ClientlessFlightMgr::AdvanceEmergency(Player* player,Record& record) if(record.Moving && player->IsSplineEnabled()) { if(!record.Progress.Stalled() && volume(current,PointOf(record.Segment)))return true; - player->StopMoving();record.Moving=false; + HoldFollowing(player, record); if(record.EmergencyLanding && record.RejectedLandings.size()<64)record.RejectedLandings.push_back(record.Start); record.EmergencyLanding=false;record.EmergencyReturning=false;record.EmergencyRoute.clear(); record.Emergency.Turn(current); @@ -696,8 +756,7 @@ bool ClientlessFlightMgr::AdvanceEmergency(Player* player,Record& record) auto support=EmergencySupport(player,record,current); if(support.Dry && std::fabs(current.Z-support.Z)<=0.7f && volume(current,current)) { - player->StopMoving();player->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING|MOVEMENTFLAG_ASCENDING|MOVEMENTFLAG_DESCENDING); - player->SetAnimTier(AnimTier::Ground);player->RemoveAurasByType(SPELL_AURA_MOUNTED); + CompleteLanding(player); record.Status.State=ClientlessFlightState::Failed;record.Status.Detail="safely landed after abort: "+record.AbortReason; record.Published->Complete=true; TC_LOG_INFO("server.adventurebot.navigation","FLIGHT_EMERGENCY_LANDED guid=%u position=(%.3f %.3f %.3f) searched=%u", @@ -752,7 +811,7 @@ bool ClientlessFlightMgr::AdvanceEmergency(Player* player,Record& record) if(!volume(current,target)) {record.EmergencyRoute.clear();record.EmergencyLanding=false;record.EmergencyReturning=false;return false;} record.Segment.Relocate(target.X,target.Y,target.Z,player->GetOrientation()); - player->AddUnitMovementFlag(MOVEMENTFLAG_FLYING); + SetAirbornePresentation(player); Movement::MoveSplineInit move(player);move.MoveTo(target.X,target.Y,target.Z,false);move.SetFly();move.SetWalk(false);move.SetVelocity(player->GetSpeed(MOVE_FLIGHT)); int32 duration=move.Launch(); if(duration<=0){record.EmergencyRetryAt=record.Elapsed+1000;return false;} @@ -865,8 +924,14 @@ void ClientlessFlightMgr::Fail(Player * player, Record & record, std::string con } record.Published->Aborted=true; record.Status.FollowingPlayer=false; - player->StopMoving(); - record.Moving = false; + if (record.Status.State == ClientlessFlightState::Flying && player->CanFly() && + player->IsAlive() && !player->IsBeingTeleported() && player->GetMapId() == record.Status.MapId) + HoldFollowing(player, record); + else + { + player->StopMoving(); + record.Moving = false; + } if (record.Status.State == ClientlessFlightState::Mounting) player->InterruptNonMeleeSpells(false); if(record.Status.State==ClientlessFlightState::Flying && player->CanFly() && player->IsAlive() && player->GetMapId()==record.Status.MapId) { @@ -941,10 +1006,7 @@ bool ClientlessFlightMgr::Advance(Player * player, Record & record, bool handoff Fail(player, record, "touchdown ground not confirmed"); return false; } - player->StopMoving(); - player->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING); - player->SetAnimTier(AnimTier::Ground); - player->RemoveAurasByType(SPELL_AURA_MOUNTED); + CompleteLanding(player); record.Status.State = record.Returning ? ClientlessFlightState::Failed : ClientlessFlightState::Arrived; record.Status.Detail = record.Returning ? "safely returned after abort: " + record.AbortReason : "landed on validated destination ground"; record.Published->Complete=true; @@ -1017,7 +1079,7 @@ bool ClientlessFlightMgr::Advance(Player * player, Record & record, bool handoff record.Segment.Relocate(next.Next.X, next.Next.Y, next.Next.Z, player->GetOrientation()); record.SegmentVerticalClimb=!record.Returning && Horizontal(current,next.Next)<1.0f && next.Next.Z>current.Z+2.0f; - player->AddUnitMovementFlag(MOVEMENTFLAG_FLYING); + SetAirbornePresentation(player); Movement::MoveSplineInit init(player); init.MoveTo(next.Next.X, next.Next.Y, next.Next.Z, false); init.SetFly(); @@ -1103,6 +1165,7 @@ void ClientlessFlightMgr::Update(uint32 diff) Fail(player, record, "flight permission lost or total timeout"); continue; } + MaintainAirbornePresentation(player, record); if(record.LandingRecovery) { record.Emergency.Visit(PointOf(*player),diff); @@ -1121,7 +1184,7 @@ void ClientlessFlightMgr::Update(uint32 diff) { ++record.DetachedRecoveryCount; if(ownerLost)record.ActionOwned=false; - player->StopMoving();record.Moving=false;record.SegmentElapsed=0; + HoldFollowing(player, record);record.SegmentElapsed=0; record.Start.Relocate(player);record.LastPosition.Relocate(player); record.Memory={};record.Breadcrumbs.clear(); record.Published=record.Published->Replace(PointOf(record.Status.Landing)); @@ -1157,8 +1220,7 @@ void ClientlessFlightMgr::Update(uint32 diff) continue; } ++record.StallRecoveries; - player->StopMoving(); - record.Moving = false; + HoldFollowing(player, record); // Keep the leader trail and destination. Re-evaluate the local // join/corridor; never replace the macro route or return yet. record.Join = {}; @@ -1182,8 +1244,7 @@ void ClientlessFlightMgr::Update(uint32 diff) // Recheck the remaining corridor as moving GO geometry changes. if (! Corridor(PointOf(* player), PointOf(record.Segment), PointOf(record.Returning ? record.Start : record.Status.Landing), record.Settings, sample, ray, true, record.SegmentUnderOverhang && !record.Returning)) { - player->StopMoving(); - record.Moving = false; + HoldFollowing(player, record); Advance(player, record); } else if (!record.Returning && !record.SegmentVerticalClimb && player->movespline->timeRemaining() <= 1500 && diff --git a/src/server/game/World/ClientlessFlightMgr.h b/src/server/game/World/ClientlessFlightMgr.h index 9b05e59fb0..781f202c81 100644 --- a/src/server/game/World/ClientlessFlightMgr.h +++ b/src/server/game/World/ClientlessFlightMgr.h @@ -55,7 +55,7 @@ class TC_GAME_API ClientlessFlightMgr Position Start, Segment, LastPosition; bool SegmentUnderOverhang = false; bool SegmentVerticalClimb = false; - uint32 Elapsed = 0, SegmentElapsed = 0, CheckTimer = 0; + uint32 Elapsed = 0, SegmentElapsed = 0, CheckTimer = 0, HoldSyncAt = 0; bool Moving = false, Returning = false; bool LandingRecovery = false; ClientlessEmergencyFlight::Search Emergency; @@ -92,6 +92,10 @@ class TC_GAME_API ClientlessFlightMgr std::unordered_map> _rejectedApproaches; bool FindReturnLanding(Player* player, Record& record); bool AdvanceFollowing(Player* player, Record& record); + bool SetAirbornePresentation(Player* player, bool holding = false); + void PublishMovement(Player* player); + void CompleteLanding(Player* player); + void MaintainAirbornePresentation(Player* player, Record& record); void HoldFollowing(Player* player, Record& record); void Fail(Player * player, Record & record, std::string const & reason); std::pair < uint32, uint32 > AreaZone(Player const * player, uint32 map, Position const & point) const; diff --git a/src/server/game/World/ClientlessTestBotMgr.cpp b/src/server/game/World/ClientlessTestBotMgr.cpp index 9e1f98f146..9ddd4ed563 100644 --- a/src/server/game/World/ClientlessTestBotMgr.cpp +++ b/src/server/game/World/ClientlessTestBotMgr.cpp @@ -2,6 +2,7 @@ #include "ClientlessCharacterFactory.h" #include "ClientlessPlayerMgr.h" #include "ClientlessTravelMgr.h" +#include "ClientlessFlightMgr.h" #include "Chat.h" #include "Base64.h" #include "Config.h" @@ -198,8 +199,29 @@ int Snapshot(lua_State* L) n("area",p->GetAreaId());n("zone",p->GetZoneId());lua_pushstring(L,p->GetLootGUID()?std::to_string(p->GetLootGUID().GetRawValue()).c_str():"");lua_setfield(L,-2,"loot_guid"); n("guid",p->GetGUID().GetCounter());n("level",p->getLevel());n("map",p->GetMapId());n("health",p->GetHealth());n("max_health",p->GetMaxHealth());n("power",p->GetPower(p->GetPowerType()));n("max_power",p->GetMaxPower(p->GetPowerType())); auto vehicle=p->GetVehicleCreatureBase();n("vehicle_entry",vehicle?vehicle->GetEntry():0);lua_pushstring(L,vehicle?std::to_string(vehicle->GetGUID().GetRawValue()).c_str():"");lua_setfield(L,-2,"vehicle_guid"); + n("movement_flags",p->m_movementInfo.GetMovementFlags()); + n("animation_tier",p->GetByteValue(UNIT_FIELD_BYTES_1,UNIT_BYTES_1_OFFSET_ANIM_TIER)); + n("hover_animation",p->IsPlayingHoverAnim());n("mounted",p->IsMounted()); + n("flying",p->IsFlying());n("swimming",p->HasUnitMovementFlag(MOVEMENTFLAG_SWIMMING)); + n("falling",p->IsFalling());n("in_water",p->IsInWater()); n("moving",p->IsSplineEnabled());n("alive",p->IsAlive());n("combat",p->IsInCombat());n("transport",bool(p->GetTransport()));f("x",p->GetPositionX());f("y",p->GetPositionY());f("z",p->GetPositionZ());return 1; } +// Registered, leased actors only: exercise the same flight controller used by +// AdventureBots without introducing test-only movement flags or fake splines. +int Flight(lua_State* L) +{ + auto p = Actor(L); + Position target(Coordinate(L,2), Coordinate(L,3), Coordinate(L,4), p->GetOrientation()); + bool const following = lua_toboolean(L,5); + std::string error; + bool const ok = following ? sClientlessFlightMgr->Follow(p,target,error) : + sClientlessFlightMgr->Start(p,target,error); + lua_pushboolean(L,ok);lua_pushstring(L,error.c_str());return 2; +} +int LandFlight(lua_State* L) +{ + lua_pushboolean(L,sClientlessFlightMgr->LandFollowing(Actor(L)));return 1; +} int Teleport(lua_State* L) { auto p=Actor(L);auto map=Number(L,2,0,65535);auto x=Coordinate(L,3),y=Coordinate(L,4),z=Coordinate(L,5),o=Coordinate(L,6); @@ -427,7 +449,7 @@ bool Start(std::string const& id,fs::path path,std::string& error) for(auto name:{"io","os","package","debug","dofile","loadfile","require","load","collectgarbage","coroutine","pcall","xpcall"}){lua_pushnil(L);lua_setglobal(L,name);} lua_newtable(L); for(auto const& fn:std::initializer_list>{ - {"npc_hello",NpcHello},{"menu",Menu},{"spellclick",SpellClick},{"exit_vehicle",ExitVehicle},{"request_cast",RequestCast},{"request_cast_at",RequestCastAt},{"use_item_at",UseItemAt},{"area_trigger",AreaTrigger},{"inventory",Inventory},{"stop",Stop},{"now_ms",Now},{"spawn",Spawn},{"online",Online},{"_create",Create},{"_create_result",CreateResult},{"wait",Wait},{"state",Snapshot},{"teleport",Teleport},{"level",Level},{"stats",Stats},{"stat",Stat},{"learn",Learn},{"item",Item},{"equip",Equip},{"clear_slot",ClearSlot},{"remove_item",RemoveItem},{"skill",Skill},{"has_aura",HasAura},{"remove_aura",RemoveAura},{"item_count",Count},{"quest",Quest},{"use",Use},{"hello",Hello},{"accept",Accept},{"abandon",Abandon},{"reward",Reward},{"gossip",Gossip},{"cast",Cast},{"move",Move},{"face",Face},{"attack",Attack},{"target_state",TargetState},{"objectives",Objectives},{"request_reward",RequestReward},{"loot",Loot},{"loot_item",LootItem},{"loot_release",LootRelease},{"use_item",UseItem},{"record",Record},{"check",Check}})Bind(L,r.get(),fn.first,fn.second); + {"npc_hello",NpcHello},{"menu",Menu},{"spellclick",SpellClick},{"exit_vehicle",ExitVehicle},{"request_cast",RequestCast},{"request_cast_at",RequestCastAt},{"use_item_at",UseItemAt},{"area_trigger",AreaTrigger},{"inventory",Inventory},{"stop",Stop},{"now_ms",Now},{"spawn",Spawn},{"online",Online},{"_create",Create},{"_create_result",CreateResult},{"wait",Wait},{"state",Snapshot},{"flight",Flight},{"land_flight",LandFlight},{"teleport",Teleport},{"level",Level},{"stats",Stats},{"stat",Stat},{"learn",Learn},{"item",Item},{"equip",Equip},{"clear_slot",ClearSlot},{"remove_item",RemoveItem},{"skill",Skill},{"has_aura",HasAura},{"remove_aura",RemoveAura},{"item_count",Count},{"quest",Quest},{"use",Use},{"hello",Hello},{"accept",Accept},{"abandon",Abandon},{"reward",Reward},{"gossip",Gossip},{"cast",Cast},{"move",Move},{"face",Face},{"attack",Attack},{"target_state",TargetState},{"objectives",Objectives},{"request_reward",RequestReward},{"loot",Loot},{"loot_item",LootItem},{"loot_release",LootRelease},{"use_item",UseItem},{"record",Record},{"check",Check}})Bind(L,r.get(),fn.first,fn.second); Bind(L,r.get(),"nearest_creature",Nearest);Bind(L,r.get(),"nearest_object",Nearest,1); Bind(L,r.get(),"creature",Find);Bind(L,r.get(),"object",Find,1);lua_setglobal(L,"testbot"); char const* helpers=R"lua( diff --git a/src/server/game/World/ClientlessTravelGraphMgr.cpp b/src/server/game/World/ClientlessTravelGraphMgr.cpp index ee1f4b719b..22f62da1d4 100644 --- a/src/server/game/World/ClientlessTravelGraphMgr.cpp +++ b/src/server/game/World/ClientlessTravelGraphMgr.cpp @@ -657,14 +657,24 @@ bool ClientlessTravelGraphMgr::PlanAdaptiveRoute( std::map startProbes; std::map, float> flightEstimates; std::uint64_t expandedStartFlightCalls=0; - auto analyzeStart=[&](Position const& target,ClientlessPathDiagnostics& result) + uint32 expandedGroundCalls = 0; + std::uint64_t expandedGroundUs = 0; + auto analyzeStart=[&](Position const& target,ClientlessPathDiagnostics& result, + bool expandedGround = false) -> bool { auto key=ClientlessGraphProbeCache::MakeKey(player->GetMapId(),player->GetInstanceId(),player->GetPositionX(),player->GetPositionY(),player->GetPositionZ(),target.GetPositionX(),target.GetPositionY(),target.GetPositionZ()); - auto found=startProbes.find(key);if(found!=startProbes.end()){result=found->second;return;} + auto found=startProbes.find(key);if(found!=startProbes.end()){result=found->second;return true;} + // Stop adding speculative MMAP work after four calls or 25 ms. One + // native call cannot be interrupted; cached tier-two probes remain free. + if (expandedGround && (expandedGroundCalls >= 4 || expandedGroundUs >= 25000)) + return false; auto begin=std::chrono::steady_clock::now();++trace.StartCalls; sClientlessTravelMgr->AnalyzePath(const_cast(player),target,result); - trace.StartUs+=std::chrono::duration_cast(std::chrono::steady_clock::now()-begin).count(); + auto const elapsed = std::chrono::duration_cast(std::chrono::steady_clock::now()-begin).count(); + trace.StartUs += elapsed; + if (expandedGround) { ++expandedGroundCalls; expandedGroundUs += elapsed; } startProbes.emplace(key,result); + return true; }; sClientlessFlightMgr->BeginPlanning(player); struct FlightPlanningScope @@ -904,11 +914,15 @@ bool ClientlessTravelGraphMgr::PlanAdaptiveRoute( Position entryTarget; entryTarget.Relocate(node.X, node.Y, node.Z, node.O); ClientlessPathDiagnostics entryNav; - bool const groundCandidate=localDistance<=startRadius; - if(groundCandidate)analyzeStart(entryTarget,entryNav); + // Long access walks use native MMAP paths, executed in the usual + // short splines. Bound expensive speculative probes per search tier. + bool const groundCandidate = (localDistance <= startRadius || expanded) && + analyzeStart(entryTarget, entryNav, localDistance > 500.0f); + if (!groundCandidate && !flightEnabled) + continue; bool const reachable = groundCandidate && entryNav.Calculated && entryNav.Complete && entryNav.FinalDistance <= 1.5f && entryNav.MaxSegmentLength <= 8.0f && - entryNav.MaxZDelta <= 5.0f && entryNav.PathLength <= 500.0f; + entryNav.MaxZDelta <= 5.0f && entryNav.PathLength <= 2000.0f; ClientlessTravelNode departure; departure.Key="flight_departure"; departure.MapId=player->GetMapId();departure.X=player->GetPositionX();departure.Y=player->GetPositionY();departure.Z=player->GetPositionZ(); @@ -933,7 +947,7 @@ bool ClientlessTravelGraphMgr::PlanAdaptiveRoute( (entryNav.PathType & uint32(PATHFIND_INCOMPLETE)) != 0 && (entryNav.PathType & uint32(PATHFIND_NOPATH)) == 0 && entryNav.PointCount >= 2 && entryNav.PathLength >= 2.0f && - entryNav.PathLength <= 500.0f && entryNav.MaxSegmentLength <= 8.0f && + entryNav.PathLength <= 2000.0f && entryNav.MaxSegmentLength <= 8.0f && entryNav.MaxZDelta <= 5.0f && entryNav.FinalDistance + 1.0f < entryNav.DirectDistance; if (!reachable && !(allowDeferred && partial)) @@ -1090,9 +1104,9 @@ bool ClientlessTravelGraphMgr::PlanAdaptiveRoute( "VIRTUAL_EDGE_CANDIDATES map=%u tested=%u accepted=%u", player->GetMapId(), validated, accepted); - // Keep nearby recorded ground entries ahead of long flight-only entries. - // A ground-only bot never widens its local navigation limit. - if(!startCount && !accepted && flightEnabled) + // Keep nearby recorded ground entries ahead of expanded access walks/flights. + // Ground-only bots also search successive 500-yard rings up to 10,000 yards. + if(!startCount && !accepted) { for(float inner=startRadius;inner<10000.0f && !startCount;) { diff --git a/tests/clientless/test_flight_departure.py b/tests/clientless/test_flight_departure.py index 28ccb68410..3fe4c49089 100644 --- a/tests/clientless/test_flight_departure.py +++ b/tests/clientless/test_flight_departure.py @@ -13,7 +13,7 @@ a=s.index(' float support=',s.index('bool ClientlessFlightMgr::Begin('));b=s. preparation=s[a:b] a=s.index(' if(!existingMount)\n');b=s.index(' record.Status.State = ClientlessFlightState::Mounting;',a) dismount=s[a:b] -a=s.index(' auto floor = sample(current.X, current.Y);');b=s.index(' player->StopMoving();',a) +a=s.index(' auto floor = sample(current.X, current.Y);');b=s.index(' CompleteLanding(player);',a) touchdown=s[a:b] a=s.index(' FindReturnLanding(player,record);');b=s.index(' record.Status.MountSpell=existingMount;',a) return_anchor=s[a:b] diff --git a/tests/clientless/test_flight_handoff.py b/tests/clientless/test_flight_handoff.py index 483c3d5624..eca70eb066 100644 --- a/tests/clientless/test_flight_handoff.py +++ b/tests/clientless/test_flight_handoff.py @@ -72,6 +72,8 @@ public: bool FindReturnLanding(Player*,Record&){return false;} bool LandFollowing(Player*){return true;}bool AdvanceFollowing(Player*,Record&){return true;} bool AdvanceEmergency(Player*,Record&){return true;} + void HoldFollowing(Player*p,Record&r){if(r.Moving)p->StopMoving();r.Moving=false;} + void MaintainAirbornePresentation(Player*,Record&){} void Update(uint32 diff); }; '''.replace('Settings Settings;', 'ClientlessFlightPath::Settings Settings;').replace('Memory Memory;', 'ClientlessFlightPath::Memory Memory;') diff --git a/tests/clientless/test_flight_presentation.py b/tests/clientless/test_flight_presentation.py new file mode 100644 index 0000000000..c2f12fc9be --- /dev/null +++ b/tests/clientless/test_flight_presentation.py @@ -0,0 +1,79 @@ +"""Exercise production flight/hold/touchdown transitions and observer snapshots.""" +from pathlib import Path +import subprocess +import tempfile +root=Path(__file__).resolve().parents[2] +s=(root/'src/server/game/World/ClientlessFlightMgr.cpp').read_text() +a=s.index('void ClientlessFlightMgr::PublishMovement(') +b=s.index('bool ClientlessFlightMgr::Follow(',a) +code=r''' +#include +#include +#include +using uint32=uint32_t;using uint8=uint8_t; +constexpr uint32 MOVEMENTFLAG_FLYING=1,MOVEMENTFLAG_SWIMMING=2,MOVEMENTFLAG_FALLING=4,MOVEMENTFLAG_FALLING_FAR=8, + MOVEMENTFLAG_SPLINE_ELEVATION=16,MOVEMENTFLAG_FORWARD=32,MOVEMENTFLAG_ASCENDING=64,MOVEMENTFLAG_DESCENDING=128, + MOVEMENTFLAG_MASK_MOVING=4|8|16|32|64|128,MOVEMENTFLAG_MASK_TURNING=256,CAN_FLY=512,WATERWALKING=1024; +constexpr int UNIT_FIELD_BYTES_1=0,UNIT_BYTES_1_OFFSET_ANIM_TIER=0,SMSG_MOVE_UPDATE=42,SPELL_AURA_MOUNTED=7; +enum class AnimTier:uint8{Ground=0,Fly=3}; +#define TC_LOG_INFO(...) ((void)0) +struct Guid{unsigned GetCounter()const{return 149;}}; +struct Position{float x=1,y=2,z=80;void Relocate(Position const*p){*this=*p;}}; +struct Info{Guid guid;Position pos;unsigned time=0,flags=0,fallTime=999;float pitch=1,splineElevation=7; + void SetFallTime(unsigned n){fallTime=n;}unsigned GetMovementFlags()const{return flags;}}; +struct WorldPacket{explicit WorldPacket(int){} Info info;unsigned tier=0;bool hover=false,mounted=false;}; +namespace GameTime{unsigned GetGameTimeMS(){return 123456;}} +struct Player{ + Info m_movementInfo;Position position;unsigned tier=0,stops=0,swimStops=0;bool hover=false,gravity=false,levitating=false,spline=false,mounted=true; + std::vectorupdates; + Guid GetGUID(){return {};}Position const*GetPosition(){return &position;} + bool HasUnitMovementFlag(unsigned mask){return (m_movementInfo.flags&mask)!=0;} + void RemoveUnitMovementFlag(unsigned mask){m_movementInfo.flags&=~mask;}void AddUnitMovementFlag(unsigned mask){m_movementInfo.flags|=mask;} + bool IsHovering(){return levitating;}bool IsGravityDisabled(){return gravity;}bool IsPlayingHoverAnim(){return hover;} + unsigned GetByteValue(int,int){return tier;}void SetAnimTier(AnimTier t){tier=unsigned(t);}void SetPlayHoverAnim(bool v){hover=v;} + bool IsSplineEnabled(){return spline;}void StopMoving(){++stops;spline=false;RemoveUnitMovementFlag(MOVEMENTFLAG_FORWARD);} + void RemoveAurasByType(int){mounted=false;RemoveUnitMovementFlag(CAN_FLY);AddUnitMovementFlag(MOVEMENTFLAG_FALLING);} + void SetSwim(bool b){assert(!b);if(HasUnitMovementFlag(MOVEMENTFLAG_SWIMMING))++swimStops;RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING);} + void WriteMovementInfo(WorldPacket&p){p.info=m_movementInfo;p.tier=tier;p.hover=hover;p.mounted=mounted;} + void SendMessageToSet(WorldPacket*p,bool){updates.push_back(*p);} +}; +struct Record{bool Moving=false;unsigned Elapsed=0,HoldSyncAt=0;}; +struct ClientlessFlightMgr{ + void PublishMovement(Player*);bool SetAirbornePresentation(Player*,bool=false); + void HoldFollowing(Player*,Record&);void MaintainAirbornePresentation(Player*,Record&);void CompleteLanding(Player*); +}; +''' + s[a:b] + r''' +int main(){ClientlessFlightMgr m;Player p;Record r; + p.m_movementInfo.flags=CAN_FLY|WATERWALKING|MOVEMENTFLAG_SWIMMING|MOVEMENTFLAG_FALLING|MOVEMENTFLAG_SPLINE_ELEVATION; + assert(m.SetAirbornePresentation(&p));assert(p.tier==3&&!p.hover&&p.HasUnitMovementFlag(MOVEMENTFLAG_FLYING)); + assert(!p.HasUnitMovementFlag(MOVEMENTFLAG_SWIMMING|MOVEMENTFLAG_FALLING|MOVEMENTFLAG_SPLINE_ELEVATION)); + assert(p.updates.size()==1&&p.updates.back().info.flags==(CAN_FLY|WATERWALKING|MOVEMENTFLAG_FLYING)); + assert(!m.SetAirbornePresentation(&p));assert(p.updates.size()==1); + p.spline=true;r.Moving=true;p.AddUnitMovementFlag(MOVEMENTFLAG_FORWARD|MOVEMENTFLAG_ASCENDING|MOVEMENTFLAG_MASK_TURNING); + m.HoldFollowing(&p,r);assert(!r.Moving&&!p.spline&&p.stops==1&&p.hover&&p.tier==3); + assert(!p.HasUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING|MOVEMENTFLAG_MASK_TURNING)); + assert(p.position.x==1&&p.position.y==2&&p.position.z==80); // hover never moves or remounts + assert(p.updates.back().hover&&p.updates.back().info.pos.z==80); + auto n=p.updates.size();r.Elapsed=200;m.MaintainAirbornePresentation(&p,r);assert(p.updates.size()==n); + r.Elapsed=1000;m.MaintainAirbornePresentation(&p,r);assert(p.updates.size()==n+1); + assert(m.SetAirbornePresentation(&p));assert(!p.hover&&p.tier==3); // resume normal flight + p.AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING|MOVEMENTFLAG_FALLING_FAR);m.CompleteLanding(&p); + assert(!p.mounted&&!p.hover&&p.tier==0&&p.m_movementInfo.flags==WATERWALKING&&p.swimStops==1); + assert(p.m_movementInfo.pitch==0&&p.m_movementInfo.splineElevation==0&&p.m_movementInfo.fallTime==0); + assert(!p.updates.back().mounted&&!p.updates.back().hover&&p.updates.back().tier==0&&p.updates.back().info.flags==WATERWALKING); + assert(p.position.z==80); // touchdown geometry belongs to caller; no invented landing/teleport + Player ground;Record gr;ground.m_movementInfo.flags=CAN_FLY;m.MaintainAirbornePresentation(&ground,gr); + assert(ground.tier==0&&ground.updates.empty()&&!ground.HasUnitMovementFlag(MOVEMENTFLAG_FLYING)); + Player levitate;levitate.levitating=true;m.SetAirbornePresentation(&levitate);m.CompleteLanding(&levitate);assert(levitate.hover); +} +''' +# Verify both real touchdown paths and all free-flight launch types use the transitions. +assert s.count('CompleteLanding(player);')==2 +for begin,end in [('AdvanceFollowing','Begin'),('AdvanceEmergency','RetryDeparture'),('Advance','Update')]: + a=s.index('bool ClientlessFlightMgr::'+begin+'(');b=s.index('bool ClientlessFlightMgr::'+end+'(',a)if end!='Update'else s.index('void ClientlessFlightMgr::Update(',a) + assert 'SetAirbornePresentation(player);'in s[a:b] +with tempfile.TemporaryDirectory()as d: + p=Path(d);(p/'test.cpp').write_text(code) + subprocess.run(['c++','-std=c++17','-fsanitize=address,undefined','-fno-omit-frame-pointer',str(p/'test.cpp'),'-o',str(p/'test')],check=True) + subprocess.run([str(p/'test')],check=True) +print('Flight presentation: moving/idle flight, bounded observer heartbeat, native dismount/fall cleanup, dry ground state and legitimate hover preservation passed') diff --git a/tests/clientless/test_free_flight_planner.py b/tests/clientless/test_free_flight_planner.py index 133b0d5a4e..8467f09911 100644 --- a/tests/clientless/test_free_flight_planner.py +++ b/tests/clientless/test_free_flight_planner.py @@ -32,7 +32,7 @@ struct Position { float x=0,y=0,z=0;float GetPositionX()const{return x;}float Ge struct Player { float x=0,y=0,z=0; bool IsInWorld() const{return true;} uint32 GetMapId()const{return 0;} uint32 GetInstanceId()const{return 0;} float GetPositionX()const{return x;} float GetPositionY()const{return y;} float GetPositionZ()const{return z;} }; float dist(Position a,Position b){return std::sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y)+(a.z-b.z)*(a.z-b.z));} struct ClientlessPathDiagnostics {bool Calculated=true, Complete=true,Suspicious=false; uint32 PathType=1,PointCount=2; float DirectDistance=0,PathLength=0,MaxSegmentLength=0,MaxZDelta=0,FinalDistance=0; std::string Reason;}; -struct Travel {bool complete=true;void AnalyzePath(Player* p,Position b,ClientlessPathDiagnostics& n){Position a;a.Relocate(p->x,p->y,p->z);n.PathLength=n.DirectDistance=dist(a,b);n.Complete=complete;}} travel; +struct Travel {unsigned calls=0;bool complete=true;void AnalyzePath(Player* p,Position b,ClientlessPathDiagnostics& n){++calls;Position a;a.Relocate(p->x,p->y,p->z);n.PathLength=n.DirectDistance=dist(a,b);n.Complete=complete;}} travel; auto sClientlessTravelMgr=&travel; struct Flight { float rejectBelow=-1e9;float closedFromX=1e9;bool rejectNearbyTargets=false;bool enabled=false;float minimumX=-10000;float forbiddenTargetX=1e9; @@ -258,8 +258,21 @@ ClientlessTravelGraphMgr expanded;node(expanded,"R",952);node(expanded,"G",12000 edge(expanded,"R","G",501,100,false,"taxi"); route.clear();assert(expanded.PlanAdaptiveRoute(&start,"G",500,200,route,done,endKey,why)&&done); assert(route.front().NodeKey=="flight_departure"&&route[1].NodeKey=="R"&&route[1].EdgeType=="free_flight"); -// Ground-only bots retain the original radius. +// Ground-only bots widen their search but still require a real MMAP path. flight.enabled=false;route.clear();assert(!expanded.PlanAdaptiveRoute(&start,"G",500,200,route,done,endKey,why)); +travel.complete=true;route.clear();assert(expanded.PlanAdaptiveRoute(&start,"G",500,200,route,done,endKey,why)&&done); +assert(route.front().NodeKey=="R"&&route.front().EdgeType!="free_flight"); +access.blocked.insert("R");route.clear();assert(!expanded.PlanAdaptiveRoute(&start,"G",500,200,route,done,endKey,why));access.blocked.clear(); +// Excessively long complete access paths are not accepted as local walks. +ClientlessTravelGraphMgr longWalk;node(longWalk,"R",2500);node(longWalk,"G",12000); +edge(longWalk,"R","G",502,100,false,"taxi"); +route.clear();assert(!longWalk.PlanAdaptiveRoute(&start,"G",500,200,route,done,endKey,why)); +travel.complete=false; +// Failed expanded starts share one bounded native probe budget across both tiers. +ClientlessTravelGraphMgr capped;node(capped,"G",12000); +for(unsigned i=0;i<20;++i){std::string k="R"+std::to_string(i);node(capped,k,750+i*10);edge(capped,k,"G",600+i,100,false,"taxi");} +travel.calls=0;route.clear();assert(!capped.PlanAdaptiveRoute(&start,"G",500,200,route,done,endKey,why));assert(travel.calls<=4); +travel.calls=0;route.clear();assert(!capped.PlanAdaptiveRoute(&start,"G",4000,200,route,done,endKey,why));assert(travel.calls<=4); flight.enabled=true; // The exact 10,000-yard boundary is included; farther nodes are not seeded. ClientlessTravelGraphMgr boundary;node(boundary,"R",10000);node(boundary,"G",12000); diff --git a/tests/clientless/test_ground_reentry_wander.py b/tests/clientless/test_ground_reentry_wander.py new file mode 100644 index 0000000000..78e946a73b --- /dev/null +++ b/tests/clientless/test_ground_reentry_wander.py @@ -0,0 +1,56 @@ +"""Run the production ground-search fallback with native movement/access doubles.""" +from pathlib import Path +import subprocess +import tempfile +root = Path(__file__).resolve().parents[2] +s = (root/'src/server/game/World/ClientlessActionExecutorMgr.cpp').read_text() +a = s.index('bool ClientlessActionExecutorMgr::StartRecoveryWander(') +b = s.index('bool ClientlessActionExecutorMgr::TryRescueTravel(', a) +code = r''' +#include +#include +#include +using uint32=unsigned; +constexpr float INVALID_HEIGHT=-100000; +#define TC_LOG_WARN(...) ((void)0) +struct Position {float x=0,y=0,z=0,o=0;void Relocate(float a,float b,float c,float d){x=a;y=b;z=c;o=d;} + float GetPositionX()const{return x;}float GetPositionY()const{return y;}float GetPositionZ()const{return z;}float GetOrientation()const{return o;}}; +struct Map {float floor=3;float GetHeight(int,float,float,float,bool,float){return floor;}}map; +struct Player {bool world=true,alive=true,combat=false,teleport=false,transport=false,vehicle=false,taxi=false,flying=false,falling=false; + bool IsInWorld(){return world;}bool IsAlive(){return alive;}bool IsInCombat(){return combat;}bool IsBeingTeleported(){return teleport;} + bool GetTransport(){return transport;}bool GetVehicle(){return vehicle;}bool IsInFlight(){return taxi;}bool IsFlying(){return flying;}bool IsFalling(){return falling;} + float GetPositionX(){return 0;}float GetPositionY(){return 0;}float GetPositionZ(){return 0;}float GetOrientation(){return 0;} + Map* GetMap(){return ↦}int GetPhaseShift(){return 0;}unsigned GetMapId(){return 0;}std::string GetName(){return "actor";}}; +struct ClientlessPathDiagnostics {bool Calculated=true,Complete=true,Suspicious=false;unsigned PointCount=2;float FinalDistance=0,PathLength=50,MaxSegmentLength=2,MaxZDelta=1;}; +struct Travel {ClientlessPathDiagnostics nav;unsigned calls=0;void AnalyzePath(Player*,Position const&,ClientlessPathDiagnostics& n){++calls;n=nav;}}travel; +auto sClientlessTravelMgr=&travel; +struct Areas {bool allowed=true;bool AllowsPosition(Player*,unsigned,Position const&){return allowed;}}areas;auto sAdventureAreaMgr=&areas; +bool starts=true;unsigned moves=0;Position last; +bool StartGroundConnection(Player*,unsigned,Position const&p){++moves;last=p;return starts;} +enum class ClientlessActionExecutionState {Moving}; +struct ClientlessActionExecutorMgr {struct Record {unsigned RecoveryWanderAttempts=0;bool RecoveryWanderActive=false,Active=false; + struct {ClientlessActionExecutionState State;std::string Detail;}Status;}; + bool StartRecoveryWander(Player*,unsigned,Record&,std::string const&);}; +''' + s[a:b] + r''' +int main(){ClientlessActionExecutorMgr m;Player p;ClientlessActionExecutorMgr::Record r; + assert(m.StartRecoveryWander(&p,94,r,"no start"));assert(r.Active&&r.RecoveryWanderActive&&moves==1&&last.z==3); + for(unsigned i=1;i<6;++i)assert(m.StartRecoveryWander(&p,94,r,"retry"));assert(!m.StartRecoveryWander(&p,94,r,"bounded")); + for(bool* flag:{&p.combat,&p.teleport,&p.transport,&p.vehicle,&p.taxi,&p.flying,&p.falling}){r={};*flag=true;auto n=travel.calls;assert(!m.StartRecoveryWander(&p,94,r,"unsafe"));assert(travel.calls==n);*flag=false;} + r={};areas.allowed=false;assert(!m.StartRecoveryWander(&p,94,r,"area"));areas.allowed=true; + r={};map.floor=INVALID_HEIGHT;assert(!m.StartRecoveryWander(&p,94,r,"no support"));map.floor=3; + r={};travel.nav.Complete=false;assert(!m.StartRecoveryWander(&p,94,r,"no path"));travel.nav={}; + r={};travel.nav.Suspicious=true;assert(!m.StartRecoveryWander(&p,94,r,"unsafe path"));travel.nav={}; + r={};starts=false;assert(!m.StartRecoveryWander(&p,94,r,"execution rejected")); +} +''' +# Both public travel entry points must activate this fallback, not complete in place. +for begin,end in [('StartTravelToNode','StartTravelToLocation'),('StartTravelToLocation','StartFinalLocalLeg')]: + body=s[s.index('bool ClientlessActionExecutorMgr::'+begin+'('):s.index('bool ClientlessActionExecutorMgr::'+end+'(')] + assert 'StartRecoveryWander(player, characterGuid, record, "initial-plan-failed: " + error)' in body +# Successful movement must permit replanning even after stationary retries ran out. +assert 'reason == "wander-ended-Arrived"' in s +with tempfile.TemporaryDirectory() as d: + p=Path(d);(p/'test.cpp').write_text(code) + subprocess.run(['c++','-std=c++17',str(p/'test.cpp'),'-o',str(p/'test')],check=True) + subprocess.run([str(p/'test')],check=True) +print('Ground re-entry wander: native path/area/support and execution checks, transit guards, bounded retries passed') diff --git a/tests/clientless/test_group_flight_follow.py b/tests/clientless/test_group_flight_follow.py index 4ba9269cd6..ad39d9729c 100644 --- a/tests/clientless/test_group_flight_follow.py +++ b/tests/clientless/test_group_flight_follow.py @@ -37,6 +37,7 @@ struct ClientlessFlightMgr{ Surface Sample(Player*,Record&,float,float){return {map.floor,ceiling,valid};} bool Begin(Player*,Position const&,std::string&,bool following){assert(following);++beginnings;return true;} void Fail(Player*,Record&r,std::string const&){++failures;r.Status.State=ClientlessFlightState::Failed;} + bool SetAirbornePresentation(Player*){return false;} void HoldFollowing(Player*p,Record&r){if(r.Moving)p->StopMoving();r.Moving=false;}bool Follow(Player*,Position const&,std::string&);bool LandFollowing(Player*);bool AdvanceFollowing(Player*,Record&); }; ''' diff --git a/tests/clientless/test_group_flight_mount.py b/tests/clientless/test_group_flight_mount.py index 54e78be69a..a34a5f7218 100644 --- a/tests/clientless/test_group_flight_mount.py +++ b/tests/clientless/test_group_flight_mount.py @@ -16,6 +16,7 @@ code=r''' using uint32=unsigned;using uint8=unsigned char; #define TC_LOG_WARN(...) ((void)0) constexpr int CLASS_DRUID=11,SPELL_AURA_MOD_SHAPESHIFT=2,MAP_COMMON=0,UNIT_STATE_CASTING=1,MOUNT_CAPABILITY_FLAG_FLYING=1,SPELL_AURA_MOUNTED=1,SPELL_CAST_OK=0; +constexpr int MOVEMENTFLAG_SWIMMING=2,MOVEMENTFLAG_FALLING=4,MOVEMENTFLAG_FALLING_FAR=8,MOVEMENTFLAG_SPLINE_ELEVATION=16,MOVEMENTFLAG_MASK_MOVING=4|8|16|32,MOVEMENTFLAG_MASK_TURNING=64; constexpr int MOVEMENTFLAG_FLYING=1,UNIT_FIELD_BYTES_1=1,UNIT_BYTES_1_OFFSET_ANIM_TIER=1,SMSG_MOVE_UPDATE=1; enum class AnimTier:uint8{Ground=0,Fly=3}; struct Position{void Relocate(Position const&){}}; @@ -28,7 +29,9 @@ struct Player{ unsigned klass=1,form=0;unsigned getClass(){return klass;}bool HasAuraType(int){return form!=0;}bool GetVehicle(){return false;} unsigned flags=0,tier=0,stops=0,updates=0,animations=0,removals=0,casts=0;int castResult=SPELL_CAST_OK; struct Capability{unsigned Flags=MOUNT_CAPABILITY_FLAG_FLYING;}capability; - struct{Guid guid;Position pos;unsigned time=0;}m_movementInfo; + struct{Guid guid;Position pos;unsigned time=0;float pitch=0;}m_movementInfo; + bool hover=false;bool IsHovering(){return false;}bool IsGravityDisabled(){return false;}bool IsPlayingHoverAnim(){return hover;}void SetPlayHoverAnim(bool b){hover=b;}bool IsSplineEnabled(){return false;} + void RemoveUnitMovementFlag(unsigned mask){flags&=~mask;} bool IsAlive(){return alive;}bool IsInCombat(){return combat;}bool IsBeingTeleported(){return teleport;}bool GetTransport(){return transport;}bool IsInFlight(){return taxi;} bool IsFalling(){return falling;}bool IsInWater(){return water;}bool IsOutdoors(){return outdoors;}Map*GetMap(){return ↦}bool IsMounted(){return mounted;}bool CanFly(){return fly;}bool IsFlying(){return fly;} bool HasUnitState(int){return casting;}unsigned GetZoneId(){return 1519;}Guid GetGUID(){return {};} @@ -47,10 +50,10 @@ struct Lua{Profile*GetAdventureProfile(unsigned){return &profile;}void DismountG struct Travel{unsigned cancels=0;void CancelTravel(unsigned){++cancels;}}travel;auto sClientlessTravelMgr=&travel; struct SpellMgr{void*GetSpellInfo(unsigned){return nullptr;}}spells;auto sSpellMgr=&spells; unsigned FlightType(void*){return 1;}unsigned urand(unsigned low,unsigned){return low;} -struct ClientlessFlightMgr{struct Record{bool Moving=false;};bool enabled=true; - bool Enabled(Player*){return enabled;}bool PrepareFollowingMount(Player*);void HoldFollowing(Player*,Record&); +struct ClientlessFlightMgr{struct Record{bool Moving=false;unsigned Elapsed=0,HoldSyncAt=0;};bool enabled=true; + bool Enabled(Player*){return enabled;}bool PrepareFollowingMount(Player*);bool SetAirbornePresentation(Player*,bool=false);void PublishMovement(Player*);void HoldFollowing(Player*,Record&); }; -'''+'\n'.join(v for v in (root/'src/server/game/World/ClientlessMountPreparation.h').read_text().splitlines() if not v.startswith('#'))+method('bool ClientlessFlightMgr::PrepareFollowingMount(')+method('void ClientlessFlightMgr::HoldFollowing(')+r''' +'''+'\n'.join(v for v in (root/'src/server/game/World/ClientlessMountPreparation.h').read_text().splitlines() if not v.startswith('#'))+method('bool ClientlessFlightMgr::PrepareFollowingMount(')+method('void ClientlessFlightMgr::PublishMovement(')+method('bool ClientlessFlightMgr::SetAirbornePresentation(')+method('void ClientlessFlightMgr::HoldFollowing(')+r''' int main(){ ClientlessFlightMgr m;Player p; assert(m.PrepareFollowingMount(&p)&&p.casts==1&&p.removals==1&&travel.cancels==1); diff --git a/tests/clientless/test_rescue_executor.py b/tests/clientless/test_rescue_executor.py index 89aadbdc32..d23ed2ebd6 100644 --- a/tests/clientless/test_rescue_executor.py +++ b/tests/clientless/test_rescue_executor.py @@ -3,7 +3,7 @@ from pathlib import Path import subprocess,tempfile root=Path(__file__).resolve().parents[2] s=(root/'src/server/game/World/ClientlessActionExecutorMgr.cpp').read_text() -a=s.index('bool ClientlessActionExecutorMgr::TryRescueTravel(');b=s.index('bool ClientlessActionExecutorMgr::RecoverTravel(',a) +a=s.index('bool ClientlessActionExecutorMgr::TryRescueTravel(');b=s.index('bool ClientlessActionExecutorMgr::TryRouteApproachFlight(',a) code=r''' #include #include