Fix nurturing - #514
Conversation
- Fix: #502
WalkthroughThe changes update nurturing data handling and furniture interaction logic in both the database and server layers. They adjust how nurturing objects are identified and retrieved, refine the timing and scope of interaction registration for plot cubes, and update mail binding persistence logic. These modifications target improved stability and accuracy for growing furniture features. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Server
participant GameStorage
participant Database
Client->>Server: Place growing furniture (e.g., Kittywampus's Playground)
Server->>GameStorage: Request nurturing data (using Interact.ObjectCode)
GameStorage->>Database: Find nurturing record by characterId and interactObjectCode
Database-->>GameStorage: Return nurturing record or null
GameStorage-->>Server: Return nurturing data
Server->>Server: Register field function interaction for cube (if Interact exists)
Server-->>Client: Confirm placement and enable interaction
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes were found. Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
Maple2.Database/Storage/Game/GameStorage.Mail.cs (1)
53-53: Verify transaction behavior with explicit SaveChanges() calls.The addition of explicit
Context.SaveChanges()calls within the transaction ensures data persistence at specific points. However, this pattern of multiple SaveChanges() within a single transaction could affect performance and transaction semantics.Please verify that:
- The explicit SaveChanges() calls don't interfere with the transaction rollback capabilities
- The performance impact is acceptable for the expected volume of mail binding operations
- The intermediate persistence is actually required for correctness
Consider whether the mail removal and re-addition logic could be simplified to a single update operation instead:
#!/bin/bash # Verify if there are other similar patterns in the codebase rg -A 5 -B 5 "SaveChanges.*BeginTransaction|BeginTransaction.*SaveChanges" --type csAlso applies to: 60-60
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
Maple2.Database/Storage/Game/GameStorage.Mail.cs(1 hunks)Maple2.Database/Storage/Game/GameStorage.Map.cs(1 hunks)Maple2.Database/Storage/Game/GameStorage.Nurturing.cs(1 hunks)Maple2.Server.Game/Manager/Field/FieldManager/FieldManager.cs(1 hunks)Maple2.Server.Game/Manager/Field/FieldManager/HomeFieldManager.cs(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: build
- GitHub Check: build
- GitHub Check: format
🔇 Additional comments (4)
Maple2.Database/Storage/Game/GameStorage.Map.cs (1)
237-238: LGTM! Consistent refactor to use interact object codes.The change correctly shifts from using
cube.ItemIdtocube.Interact!.ObjectCodefor nurturing data retrieval, which aligns with the parameter rename inGameStorage.Nurturing.cs. The null-forgiving operator usage is safe given the condition check.Maple2.Server.Game/Manager/Field/FieldManager/HomeFieldManager.cs (1)
32-36: LGTM! Improved interaction handling coverage.The addition of field function interaction registration for all plot cubes with interactions (not just portals) ensures comprehensive interaction setup during home field initialization. This complements the existing portal-specific logic appropriately.
Maple2.Server.Game/Manager/Field/FieldManager/FieldManager.cs (1)
142-146: LGTM! Improved initialization timing.Moving the field function interaction registration to occur immediately after loading plots (rather than after portal spawning) ensures that plot cube interactions are available earlier in the field initialization sequence. This timing improvement makes logical sense.
Maple2.Database/Storage/Game/GameStorage.Nurturing.cs (1)
10-11: LGTM! Consistent parameter rename for clarity.The parameter rename from
itemIdtointeractObjectCodecorrectly reflects the actual data being passed and aligns with the corresponding changes inGameStorage.Map.cswhere nurturing retrieval now uses interact object codes.
Summary by CodeRabbit