Skip to content

Conversation

@glinesbdev
Copy link
Contributor

@glinesbdev glinesbdev commented Jan 14, 2026

Summary by CodeRabbit

  • New Features
    • Added a player command "statpoint" to allocate attribute points in-game.
    • Extended the skill-point command to accept a rank option when adding skill points.

✏️ Tip: You can customize this high-level summary in your review settings.

# Changes

## `Maple2\Maple2.Server.Game\PacketHandlers\QuestHandler.cs`

* Added `HandleGoToDungeon` within `Handle` logic.
Creates a command for adding attribute points to the player.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 14, 2026

Walkthrough

Added a new enum value Command = 5 to AttributePointSource and introduced a statpoint player command handler that calls session.Config.AddStatPoint(...) with the new enum value; SkillPointCommand was extended to accept a rank parameter and forward it to AddSkillPoint.

Changes

Cohort / File(s) Summary
Enum Extension
Maple2.Model/Enum/AttributePointSource.cs
Added Command = 5 to public enum AttributePointSource.
Player Commands
Maple2.Server.Game/Commands/PlayerCommand.cs
Added nested AttributePointCommand implementing the statpoint command which parses an integer points and calls session.Config.AddStatPoint(AttributePointSource.Command, points) with success/error exit codes. Extended SkillPointCommand to accept a rank parameter (clamped to 0 or 1) and pass it into AddSkillPoint.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

I’m a rabbit in the code so spry,
A Command enum hops by and by,
"statpoint" lands with a cheerful thump,
Points get added — hop, hop, jump! 🐰

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a new 'statpoint' player command that allows granting attribute points via the AttributePointSource.Command enum value.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 22dcb84 and 67d8710.

📒 Files selected for processing (2)
  • Maple2.Model/Enum/AttributePointSource.cs
  • Maple2.Server.Game/Commands/PlayerCommand.cs
🚧 Files skipped from review as they are similar to previous changes (1)
  • Maple2.Model/Enum/AttributePointSource.cs
🧰 Additional context used
🧬 Code graph analysis (1)
Maple2.Server.Game/Commands/PlayerCommand.cs (2)
Maple2.Server.Game/Session/GameSession.cs (3)
  • GameSession (37-884)
  • GameSession (114-124)
  • GameSession (744-744)
Maple2.Server.Game/Manager/ConfigManager.cs (1)
  • AddStatPoint (287-290)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build
  • GitHub Check: format
  • GitHub Check: build
🔇 Additional comments (2)
Maple2.Server.Game/Commands/PlayerCommand.cs (2)

21-21: LGTM!

The new AttributePointCommand is registered correctly alongside other player management commands.


366-387: LGTM!

The implementation cleanly follows the established pattern used by other commands in this file (e.g., ExpCommand, SkillPointCommand). The error handling is consistent, and the command integrates well with the existing ConfigManager.AddStatPoint API.

One observation: the points argument accepts any integer including negative values. Based on the AddStatPoint implementation (statAttributes.Sources[source] += amount), negative values would subtract points. If this is intentional for admin flexibility, no change needed. If only adding points should be allowed, consider adding validation.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@AngeloTadeucci AngeloTadeucci merged commit 1882c32 into MS2Community:master Jan 14, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants