Repository navigation
feat(mate): catching, listing, saving and logging out with pets match the live game - #2513
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…apture failed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y sends Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and shows the new pet's bar Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rs' bars Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d resolve again Every class's Capture skill carries a non-zero UpgradeSkill without being an upgrade, so the resolver cancelled every capture cast. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he character Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThis change adds pet capture outcomes, mate adoption and persistence, and pet roster packets. It also updates mate spawning and despawning during map changes and disconnects, and adds tests for these flows. ChangesPet lifecycle
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant CaptureService
participant MateService
participant MateExtensions
participant MapInstance
CaptureService->>MateService: Persist and adopt captured mate
CaptureService->>MateExtensions: Spawn team-member mate
MateExtensions->>MapInstance: Add mate entity and send spawn packet
Suggested reviewers: Merge Risk: 🔵 Low · up to
|
What
Catching a pet, the pet window, the party panel, saving pets and logging out now behave as a packet trace of the live game shows. Two older bugs that blocked capture entirely are fixed along the way.
Capture
A caught pet joins at once. Before, nothing happened until a relog. The server now sends:
ctland theCaptureSuccessfulmessage;su … 15) and effect 197;out.With no pet out, the new pet also:
condandpst.A new pet's loyalty is 3000. Every fresh catch in the trace shows 3000; it used to be 1000.
A failed roll sends
CaptureFailedand the fail animation (su … 16).The level and half-health refusals send
CaptureToHighLevelandCaptureTooMuchLife, followed bycancel 0 <castId> -1. That is the form the live game uses for a refused cast. Without it the client waits for the cast forever and the character cannot act. A Capture aimed at something that is not a monster is cancelled the same way.The monster is claimed as soon as the roll succeeds. Two players catching the same monster at once no longer both get a pet.
Capture resolves again for every class.
SkillResolveronly took skills withUpgradeSkill == 0. Every class's Capture skill (209, 235, 236, 237) carries a non-zero value without being an upgrade, so every capture cast was cancelled. The resolver still prefers the base skill, and now falls back to an owned non-upgrade (type ≠ 2) skill with the same cast id.Pet window
npinfoanswers withp_clearand the fullsc_p/sc_nlist. The handler was bound to the server-sideNpInfoPackettwin. The deserializer always hands out the client type, so the handler never ran. A test now pushesnpinfo 0through the realDeserializer.sc_p_ctsgets no reply, as in the trace.Party panel
pinitthe player receives lists their pets that are out, after any group members:2|<id>|1|<level>|<name>|-1|<vnum>|0|0|0|0. All nine send sites use one builder.pinit 0. It used to carry a self entry.pstfollows it.Saving and logging out
MateService.SaveAsynchad no caller.How
MateService.Adoptbuilds a live mate from a freshly written row. Loading uses the same builder.Mate.SpawnAsyncandMate.DespawnAsyncare now the one path on and off a map. Map change, capture and disconnect all use them.PlayerComponentBundle.GenerateMateRosteris thep_clearandscburst, used at login, innpinfoand on capture.ICharacterEntity.GeneratePinitis the combined party panel.Known gap
The pet window shows its rows without pictures.
ScpPacketserialises 33 fields, while the live client'ssc_phas 40:This predates the PR, since the login burst already sent the short form. The fix belongs in NosCore.Packets, together with typing
ptctl's move list for the follow-up that lets the client drive pet movement.Testing
dotnet test NosCore.sln: 1241 passed.Tests cover each behaviour above:
Live, on a local server:
The two capture blockers above were found during this check.
manual-test-plan.mdhas a new "Pets" section.🤖 Generated with Claude Code
Summary by CodeRabbit