Fix Channel Client Lookup - #345
Conversation
WalkthroughThis pull request refines the logic for portal usage and channel monitoring in the game server. In Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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: 1
🧹 Nitpick comments (1)
Maple2.Server.Game/Manager/Field/FieldManager/HomeFieldManager.cs (1)
31-33: Use null-conditional operator for safer portal spawningConsider using the null-conditional operator to make the code more robust against potential null references.
- foreach (PlotCube cubePortal in cubePortals) { - SpawnCubePortal(cubePortal); - } + foreach (PlotCube cubePortal in cubePortals) { + if (cubePortal != null) { + SpawnCubePortal(cubePortal); + } + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
Maple2.Server.Game/Manager/Field/FieldManager/FieldManager.cs(2 hunks)Maple2.Server.Game/Manager/Field/FieldManager/HomeFieldManager.cs(2 hunks)Maple2.Server.World/Containers/ChannelClientLookup.cs(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
🔇 Additional comments (5)
Maple2.Server.Game/Manager/Field/FieldManager/HomeFieldManager.cs (1)
35-41: Approve handling of life skill cubesGood implementation for adding field function interactions for life skill cubes. This properly handles special functionality for home fields based on housing categories.
Maple2.Server.World/Containers/ChannelClientLookup.cs (2)
182-184: Approve cancellation for inactive channels in productionGood addition of cancellation handling for inactive channels in non-debug builds. This helps free up resources by stopping monitoring tasks for channels that are no longer active.
194-196: Consistent cancellation handling for inactive channelsThe cancellation logic is consistently applied in both error handling paths, ensuring that monitoring resources are properly released when a channel becomes inactive.
Maple2.Server.Game/Manager/Field/FieldManager/FieldManager.cs (2)
123-123: Approve type-based condition for plot loadingGood use of type checking with
this is not HomeFieldManagerto ensure plots are only loaded for appropriate field types. This cleanly separates responsibilities between different field manager implementations.
412-412: Simplify portal migration processThe code now directly calls
session.MigrateOutOfInstanceinstead of using packet sending and handling, which streamlines the portal usage process and makes the code more maintainable.
Summary by CodeRabbit
New Features
Refactor