Skip to content

Trophy Rankings, Ranking Packets, & WIP Mentoring - #440

Merged
AngeloTadeucci merged 6 commits into
masterfrom
mentor2
May 8, 2025
Merged

Trophy Rankings, Ranking Packets, & WIP Mentoring#440
AngeloTadeucci merged 6 commits into
masterfrom
mentor2

Conversation

@Zintixx

@Zintixx Zintixx commented May 7, 2025

Copy link
Copy Markdown
Collaborator
  • Implements trophy ranking.
    • The system in place right now that fetches ranking data is not ideal. Rather, it should be logs stored in the db, updated once a day (if current season. if old seasons, never update)
  • Ranking packets decoded on Web server. Will just need to implement them all once said system is in place
  • Some progress on mentoring system. Pushing it now because I can foresee this getting big.

Summary by CodeRabbit

  • New Features

    • Introduced a mentoring system with mentor/mentee roles, manager, commands, and related packets.
    • Added in-game ranking support with trophy and personal ranking queries and new API endpoints.
    • Implemented new web API endpoints for rankings and mentee list retrieval.
    • Added seasonal data tables and extended quest metadata to support mentoring missions.
    • Expanded system shop to include mentor and mentee shops.
    • Enhanced protobuf messages and player info structures to include mentor roles.
  • Improvements

    • Updated quest and event handling for mentoring and returning user scenarios.
    • Improved packet serialization with Unicode string length prefix methods.
    • Refined ranking packet formats and added comprehensive ranking types.
    • Updated constants and enums for clarity and extended functionality.
    • Made character ID lookup case-insensitive.
    • Enhanced packet serialization for mentor roles and timestamps.
  • Bug Fixes

    • Fixed mentor role serialization to write correct values.
  • Refactor

    • Reorganized namespaces for UGC controllers in the web server.
  • Chores

    • Updated dependencies and project structure for better maintainability.

@coderabbitai

coderabbitai Bot commented May 7, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This update introduces extensive mentoring and ranking features across the Maple2 server and model layers. It adds new properties and enums for mentor roles, implements mentor and ranking packet handlers, expands protobuf definitions, and updates serialization logic. Several new classes, methods, and constants support mentoring missions, ranking retrieval, and system shop interactions. The changes also restructure some namespaces and add new data tables for seasonal content.

Changes

File(s) / Group Change Summary
Maple2.Database/Model/Character.cs, Maple2.Model/Game/User/Character.cs, Maple2.Model/Game/User/IPlayerInfo.cs, Maple2.Model/Game/User/PlayerInfo.cs Added MentorRole property/field to character and player info models and interfaces; updated conversion and serialization logic to include mentor role.
Maple2.Database/Model/Ranking/TrophyRankInfo.cs, Maple2.Model/Enum/GameRankingType.cs Introduced TrophyRankInfo record for ranking data; added GameRankingType enum covering various ranking types.
Maple2.Database/Storage/Game/GameStorage.User.cs, Maple2.Database/Storage/Game/GameStorage.Web.cs Modified character ID lookup to be case-insensitive; added methods for trophy ranking and mentor list retrieval.
Maple2.File.Ingest/Maple2.File.Ingest.csproj, Maple2.File.Ingest/Mapper/ItemMapper.cs, Maple2.File.Ingest/Mapper/QuestMapper.cs Upgraded parser package version; clarified type arguments; added mentoring mission property to quest metadata.
Maple2.File.Ingest/Mapper/ServerTableMapper.cs, Maple2.Model/Metadata/ServerTable/GameEventTable.cs Extended event parsing to support new user/return user/active user event types; updated event data records.
Maple2.File.Ingest/Mapper/TableMapper.cs, Maple2.Model/Common/TableNames.cs, Maple2.Model/Metadata/Table/SeasonDataTable.cs, Maple2.Model/Metadata/TableMetadata.cs Added support for parsing and serializing a new SeasonDataTable for seasonal content.
Maple2.Model/Enum/Mentoring.cs Renamed enum members for clarity (RegistedMenteeMentee, RegistedMentorMentor).
Maple2.Model/Game/Event/GameEvent.cs Ensured correct serialization of SeasonId in return user events.
Maple2.Model/Metadata/Constants.cs Added constants for mentor/mentee NPCs and max mentees; removed some NPC ID constants.
Maple2.Model/Metadata/QuestMetadata.cs Added mentoring mission property and record to quest metadata.
Maple2.Server.Core/Sync/PlayerInfoUpdateExtensions.cs, Maple2.Server.Game/Util/Sync/PlayerInfoStorage.cs, Maple2.Server.World/Service/WorldService.Sync.cs Updated player info update logic to handle MentorRole.
Maple2.Server.Core/proto/common.proto, Maple2.Server.Core/proto/sync.proto Added mentor request message; included mentor role in player update/response messages.
Maple2.Server.Game/Manager/MentoringManager.cs Introduced new class to manage mentoring state, role updates, and related packet sending.
Maple2.Server.Game/Manager/QuestManager.cs Added time-based gating for mentoring missions; simplified quest expiration logic.
Maple2.Server.Game/PacketHandlers/MentorHandler.cs Expanded mentor commands and handlers; reorganized packet sending for mentor features.
Maple2.Server.Game/PacketHandlers/QuestHandler.cs Added EpicRestart command to quest handler.
Maple2.Server.Game/PacketHandlers/SystemShopHandler.cs, Maple2.Server.Game/Packets/SystemShopPacket.cs Added mentor/mentee shop commands and handlers; updated constants for shop NPCs.
Maple2.Server.Game/Packets/FieldPacket.cs Updated serialization for mentor role and timestamp in character data.
Maple2.Server.Game/Packets/InGameRankPacket.cs Added static class for in-game rank packet serialization.
Maple2.Server.Game/Packets/MentorPacket.cs Enhanced mentor packet serialization; clarified method names and data written.
Maple2.Server.Game/Session/GameSession.cs Added mentoring manager property; sent mentor-related packets on server entry.
Maple2.Server.Web/Controllers/Ugc/*.cs Changed namespaces for UGC controllers to .Ugc.
Maple2.Server.Web/Controllers/WebController.cs Added ranking/info endpoints, UGC upload handlers, and ranking/mentee list helpers.
Maple2.Server.Web/Maple2.Server.Web.csproj Added explicit "Model" folder to project structure.
Maple2.Server.Web/Packet/InGameRankPacket.cs, Maple2.Server.Web/Packet/MentorPacket.cs Added packet builders for ranking and mentee list data.
Maple2.Server.Web/Program.cs Registered additional database modules in dependency injection.
Maple2.Tools/Extensions/PacketExtensions.cs Added extension methods for length-prefixed Unicode string serialization.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant GameSession
    participant MentoringManager
    participant Database

    Client->>GameSession: Mentor command (e.g., AssignMentee)
    GameSession->>MentoringManager: UpdateRole(Mentee)
    MentoringManager->>Database: Query for ReturnUser event
    Database-->>MentoringManager: Return event metadata
    MentoringManager->>GameSession: Send MentorPacket.UpdateRole
    MentoringManager->>GameSession: Load mentoring state (send packets)
    GameSession-->>Client: Mentor state packets
Loading
sequenceDiagram
    participant WebClient
    participant WebController
    participant GameStorage
    participant Database

    WebClient->>WebController: POST irrq.aspx (Ranking request)
    WebController->>GameStorage: GetTrophyRankings()
    GameStorage->>Database: Query characters/achievements
    Database-->>GameStorage: Character & achievement data
    GameStorage-->>WebController: TrophyRankInfo list
    WebController->>WebClient: Compressed ranking packet
Loading

Possibly related PRs

  • AngeloTadeucci/Maple2#348: Both PRs modify PlayerInfoUpdateExtensions to update player info fields (MentorRole in this PR, guild fields in the related PR).
  • AngeloTadeucci/Maple2#291: Both PRs update the Maple2.File.Parser.Tadeucci package version in the ingest project file, relating to dependency management.

Suggested reviewers

  • AngeloTadeucci

Poem

In the fields where mentors roam,
Rabbits cheer for seeds now sown—
Rankings rise and mentees grow,
New packets hop, and data flows.
With every quest and mentor role,
This patch brings carrots for every soul!
🥕✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between daffb4a and 8b7566f.

📒 Files selected for processing (2)
  • Maple2.File.Ingest/Mapper/ItemMapper.cs (2 hunks)
  • Maple2.Server.Game/PacketHandlers/BeautyHandler.cs (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Maple2.File.Ingest/Mapper/ItemMapper.cs
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: build
🔇 Additional comments (4)
Maple2.Server.Game/PacketHandlers/BeautyHandler.cs (4)

204-204: Clean method signature update

The ModifyBeauty method call has been updated to match the new signature without the BeautyShopCategory parameter, which simplifies the interface.


224-230: Good clarification with comment and early return

The added comment clearly explains that this block handles cap rotation/positioning, which is important context. The early return after broadcasting updates for hat appearances properly separates this special case from the rest of the appearance handling logic.


243-243: Method signature update consistent with earlier changes

The call to ModifyBeauty has been updated here as well to match the new method signature without the category parameter.


565-580: Well-implemented type-based deserialization logic

The refactored ModifyBeauty method now intelligently determines the appropriate appearance class to deserialize based on the item's type flags instead of relying on a separate category parameter. This is a more robust approach that:

  1. Simplifies the method signature
  2. Makes the code more maintainable
  3. Reduces the potential for errors from mismatched category parameters
  4. Follows the principle of having code rely on intrinsic properties rather than external categorization

The conditional checks for IsHair, IsDecal, and IsHat are clear and easy to follow.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 16

🧹 Nitpick comments (19)
Maple2.Database/Model/Ranking/TrophyRankInfo.cs (1)

5-5: Add XML documentation to explain record purpose and properties

This record is clear and concise but lacks documentation to explain its purpose and the meaning of each property. Consider adding XML documentation comments to help other developers understand how this record is used in the trophy ranking system.

+/// <summary>
+/// Represents trophy ranking information for a character
+/// </summary>
+/// <param name="Rank">The character's position in the ranking</param>
+/// <param name="CharacterId">Unique identifier for the character</param>
+/// <param name="Name">Character's display name</param>
+/// <param name="Profile">Character's profile information</param>
+/// <param name="Trophy">Achievement information for the trophy</param>
public record TrophyRankInfo(int Rank, long CharacterId, string Name, string Profile, AchievementInfo Trophy);
Maple2.Tools/Extensions/PacketExtensions.cs (1)

147-157: Consider adding a maximum string length check

Without an upper limit on string length, very large strings could potentially be written to packets, which might lead to memory issues or become a vector for denial of service attacks if processing untrusted input.

public static T WriteUnicodeStringWithLength<T>(this T writer, string value = "") where T : IByteWriter {
    if (string.IsNullOrEmpty(value)) {
        writer.WriteInt(0);
        return writer;
    }

+   // Optional: Consider implementing a maximum length check
+   const int MaxStringLength = 8192; // Example maximum length in characters
+   if (value.Length > MaxStringLength) {
+       throw new ArgumentException($"String exceeds maximum length of {MaxStringLength} characters");
+   }

    byte[] stringBytes = Encoding.Unicode.GetBytes(value);
    writer.WriteInt(stringBytes.Length);
    writer.WriteBytes(stringBytes);
    return writer;
}
Maple2.Server.Game/Session/GameSession.cs (1)

334-335: Consider documenting mentoring packet purposes.

The two mentoring packets are sent after user enters server, but the Unknown12() method name is not descriptive of its purpose.

Consider renaming the Unknown12() method to better reflect its purpose, or add a comment explaining what it does:

- Send(MentorPacket.Unknown12());
+ Send(MentorPacket.InitializeMentorSystem()); // Or another appropriate name

Alternatively, add a comment explaining the packet's purpose above this line.

Maple2.Server.Game/Packets/InGameRankPacket.cs (1)

7-17: Add documentation for the InGameRankPacket parameters.

The packet writes hardcoded values (31, 120, 60) without explanation of their meaning or purpose.

Consider adding XML documentation to explain the purpose of this method and what the hardcoded values represent:

+ /// <summary>
+ /// Creates a packet to initialize the in-game ranking system.
+ /// </summary>
+ /// <returns>A ByteWriter containing the initialization packet for in-game ranking.</returns>
+ /// <remarks>
+ /// The packet contains:
+ /// - Byte 31: [purpose of this value]
+ /// - Int 120: [purpose of this value, e.g. update interval in seconds]
+ /// - Int 60: [purpose of this value, e.g. cache duration in seconds]
+ /// </remarks>
public static ByteWriter Load() {
    var pWriter = Packet.Of(SendOp.InGameRank);
    pWriter.WriteByte(31);
    pWriter.WriteInt(120);
    pWriter.WriteInt(60);

    return pWriter;
}
Maple2.Database/Model/Character.cs (1)

25-25: Consider initializing the MentorRole property with a default value.

The new MentorRole property is added without an explicit default value. While it will default to the first enum value (likely None), it would be clearer to initialize it explicitly, especially if new characters should start with a specific role.

-    public MentorRole MentorRole { get; set; }
+    public MentorRole MentorRole { get; set; } = MentorRole.None;
Maple2.Server.Core/proto/sync.proto (1)

107-108: Consider making mentor_role field optionality consistent.

The mentor_role field is optional in PlayerUpdateRequest but not marked as optional in PlayerInfoResponse. Consider making this consistent unless there's a specific reason for this difference.

-  int32 mentor_role = 23;
+  optional int32 mentor_role = 23;
Maple2.Model/Enum/GameRankingType.cs (2)

5-39: Consider adding documentation to enum values.

The GameRankingType enum has many values with specific meanings. Consider adding XML documentation comments to explain what each ranking type represents and how they're used.

Example:

+/// <summary>
+/// Represents the different types of rankings in the game.
+/// </summary>
 public enum GameRankingType {
+    /// <summary>
+    /// Personal guild trophy rankings.
+    /// </summary>
     PersonalGuildTrophy = 12,
     // Add similar comments for other enum values
🧰 Tools
🪛 GitHub Actions: Format

[error] 22-22: dotnet format whitespace error: Fix whitespace formatting. Insert '\s'.


5-39: Consider grouping related enum values with regions or comments.

The enum values follow a logical grouping pattern (trophies, dark descent, PvP, etc.). Consider adding region directives or comment headers to make these groupings more explicit.

Example:

 public enum GameRankingType {
+    // Trophy Rankings
     PersonalGuildTrophy = 12,
     GuildTrophy = 14,
     PersonalTrophy = 22,
     Trophy = 24,
+    
+    // Dark Descent Rankings
     DarkDescentPersonal = 31,
     // ... and so on
🧰 Tools
🪛 GitHub Actions: Format

[error] 22-22: dotnet format whitespace error: Fix whitespace formatting. Insert '\s'.

Maple2.File.Ingest/Mapper/ServerTableMapper.cs (1)

1044-1052: New game event type: ReturnUserCandidate

This implementation parses four values to properly handle returning user candidates, including season identifiers, minimum level requirements, and a relevant date.

However, the property name UnknownDate is not descriptive enough to understand its purpose.

Consider renaming this property to something more descriptive based on its actual purpose in the game logic.

Maple2.Server.Game/Packets/MentorPacket.cs (3)

140-147: Updated LoginPoints method with meaningful values

The renamed method now writes specific point values and timestamps instead of empty placeholders, making it functionally complete for the mentoring system.

Consider making the hardcoded points value (100) configurable rather than hardcoded.

-        pWriter.WriteInt(100); // points received
+        pWriter.WriteInt(Configuration.MentorSystem.LoginPointsAmount); // points received

149-157: Updated DailyPoints method with meaningful values

The renamed method now writes specific point values and timestamps, including a reset timestamp 2 days in the future.

The hardcoded values (1000, 0, +2 days) should ideally be configurable parameters rather than embedded in the code.

Consider extracting these values to configuration constants for better maintainability and flexibility.


162-166: Updated Unknown12 and Unknown16 methods

These methods have been updated to write specific parameters, with Unknown16 now explicitly setting a boolean flag and integer value.

The methods still have unclear names that don't indicate their purpose.

Consider renaming these methods to better reflect their actual purpose in the mentoring system, similar to how you renamed LoginPoints and DailyPoints.

Also applies to: 199-206

Maple2.Model/Metadata/ServerTable/GameEventTable.cs (1)

101-129: Added new game event record types for user tracking and rewards

Four new record types have been added to support different user scenarios:

  • NewUser: For tracking newly created characters
  • ReturnUserCandidate: For identifying potential returning users
  • ActiveUser: For tracking active users and providing mail rewards
  • ReturnUserYearRound: For handling year-round return user events with cooldown periods

These new types properly extend the GameEventData base record with appropriate properties.

The ReturnUserCandidate record contains a property named UnknownDate which lacks clarity.

Rename the UnknownDate property to something more descriptive based on its actual purpose in the game mechanics.

Maple2.Server.Game/PacketHandlers/MentorHandler.cs (1)

44-56: Added dedicated handler methods for mentor commands

New methods HandleReward, HandleAssignMentee, and HandleMentorList have been implemented to handle the respective commands, each with appropriate packet responses.

In HandleMentorList, there's an unused variable:

-        int unknown = packet.ReadInt(); // 0
+        // Read but not used, possibly for future features
+        int version = packet.ReadInt(); // 0
Maple2.Database/Storage/Game/GameStorage.Web.cs (1)

108-122: Randomised mentor list can duplicate accounts

OrderBy(_ => Random.Shared.Next()) shuffles correctly, but Random.Shared is process-wide.
If this method is called concurrently the same RNG instance is shared, producing identical sequences for simultaneous requests.
For a fair rotation create a local Random:

var rng = new Random();
return filteredCharacterIds
       .OrderBy(_ => rng.Next())
       .Take(50)
       .ToList();

Also prefer DateTime.UtcNow instead of DateTime.Now to avoid TZ issues for servers hosted outside player locale.

Maple2.Server.Web/Packet/InGameRankPacket.cs (2)

14-26: Timestamp should use UTC / be parameterised

All packet methods write DateTime.Now which depends on server locale and cannot be reproduced by clients in different time-zones.
Either:

  1. Switch to DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss"), or
  2. Pass the timestamp in as an argument so the caller can apply its own policy.

40-58: Repeated boilerplate – extract helper to reduce duplication

Each packet writer begins with identical 5 lines (ranking type, mode, timestamp, count).
A small private helper would collapse ~150 duplicated LOC and make future changes (e.g. timestamp format) one-shot.

private static ByteWriter Start(GameRankingType type, int mode = 0, int count = 1)
{
    var w = new ByteWriter();
    w.Write(type);
    w.WriteInt(mode);
    w.WriteUnicodeStringWithLength(DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss"));
    w.WriteInt(count);
    return w;
}
Maple2.Server.Web/Controllers/WebController.cs (2)

288-295: C# 12 target-typed new [] initializer may break older toolchains

List<TrophyRankInfo> rankInfos = []; compiles only with the C# 12 feature flag (<LangVersion>preview</LangVersion> or .NET 8 SDK).
If the project still targets LTS tooling (C# 11/.NET 7) replace with new() for broader compatibility.


327-333: ByteWriter buffer is copied twice – avoid extra allocation

ZlibCompress writes the whole writer.Buffer which is already sized to writer.Length.
An overload taking (byte[] buffer, int length) would avoid writing trailing zeroes (if any) and skip an extra allocation.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between abcaf06 and a396998.

⛔ Files ignored due to path filters (3)
  • Maple2.Server.World/Migrations/20250506175402_Mentor.Designer.cs is excluded by !Maple2.Server.World/Migrations/*
  • Maple2.Server.World/Migrations/20250506175402_Mentor.cs is excluded by !Maple2.Server.World/Migrations/*
  • Maple2.Server.World/Migrations/Ms2ContextModelSnapshot.cs is excluded by !Maple2.Server.World/Migrations/*
📒 Files selected for processing (48)
  • Maple2.Database/Model/Character.cs (3 hunks)
  • Maple2.Database/Model/Ranking/TrophyRankInfo.cs (1 hunks)
  • Maple2.Database/Storage/Game/GameStorage.User.cs (2 hunks)
  • Maple2.Database/Storage/Game/GameStorage.Web.cs (1 hunks)
  • Maple2.File.Ingest/Maple2.File.Ingest.csproj (1 hunks)
  • Maple2.File.Ingest/Mapper/ItemMapper.cs (2 hunks)
  • Maple2.File.Ingest/Mapper/QuestMapper.cs (1 hunks)
  • Maple2.File.Ingest/Mapper/ServerTableMapper.cs (1 hunks)
  • Maple2.File.Ingest/Mapper/TableMapper.cs (3 hunks)
  • Maple2.Model/Common/TableNames.cs (1 hunks)
  • Maple2.Model/Enum/GameRankingType.cs (1 hunks)
  • Maple2.Model/Enum/Mentoring.cs (1 hunks)
  • Maple2.Model/Game/Event/GameEvent.cs (1 hunks)
  • Maple2.Model/Game/User/Character.cs (1 hunks)
  • Maple2.Model/Game/User/IPlayerInfo.cs (1 hunks)
  • Maple2.Model/Game/User/PlayerInfo.cs (6 hunks)
  • Maple2.Model/Metadata/Constants.cs (2 hunks)
  • Maple2.Model/Metadata/QuestMetadata.cs (2 hunks)
  • Maple2.Model/Metadata/ServerTable/GameEventTable.cs (4 hunks)
  • Maple2.Model/Metadata/Table/SeasonDataTable.cs (1 hunks)
  • Maple2.Model/Metadata/TableMetadata.cs (1 hunks)
  • Maple2.Server.Core/Sync/PlayerInfoUpdateExtensions.cs (3 hunks)
  • Maple2.Server.Core/proto/common.proto (1 hunks)
  • Maple2.Server.Core/proto/sync.proto (2 hunks)
  • Maple2.Server.Game/Manager/MentoringManager.cs (1 hunks)
  • Maple2.Server.Game/Manager/QuestManager.cs (2 hunks)
  • Maple2.Server.Game/PacketHandlers/MentorHandler.cs (2 hunks)
  • Maple2.Server.Game/PacketHandlers/QuestHandler.cs (1 hunks)
  • Maple2.Server.Game/PacketHandlers/SystemShopHandler.cs (3 hunks)
  • Maple2.Server.Game/Packets/FieldPacket.cs (1 hunks)
  • Maple2.Server.Game/Packets/InGameRankPacket.cs (1 hunks)
  • Maple2.Server.Game/Packets/MentorPacket.cs (6 hunks)
  • Maple2.Server.Game/Packets/SystemShopPacket.cs (2 hunks)
  • Maple2.Server.Game/Session/GameSession.cs (3 hunks)
  • Maple2.Server.Game/Util/Sync/PlayerInfoStorage.cs (1 hunks)
  • Maple2.Server.Web/Controllers/Ugc/BannerController.cs (1 hunks)
  • Maple2.Server.Web/Controllers/Ugc/BlueprintController.cs (1 hunks)
  • Maple2.Server.Web/Controllers/Ugc/GuildController.cs (1 hunks)
  • Maple2.Server.Web/Controllers/Ugc/ItemController.cs (1 hunks)
  • Maple2.Server.Web/Controllers/Ugc/ItemIconController.cs (1 hunks)
  • Maple2.Server.Web/Controllers/Ugc/ProfileController.cs (1 hunks)
  • Maple2.Server.Web/Controllers/WebController.cs (3 hunks)
  • Maple2.Server.Web/Maple2.Server.Web.csproj (1 hunks)
  • Maple2.Server.Web/Packet/InGameRankPacket.cs (1 hunks)
  • Maple2.Server.Web/Packet/MentorPacket.cs (1 hunks)
  • Maple2.Server.Web/Program.cs (1 hunks)
  • Maple2.Server.World/Service/WorldService.Sync.cs (1 hunks)
  • Maple2.Tools/Extensions/PacketExtensions.cs (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (6)
Maple2.Model/Metadata/TableMetadata.cs (1)
Maple2.File.Ingest/Mapper/TableMapper.cs (1)
  • SeasonDataTable (1741-1774)
Maple2.Server.Web/Program.cs (3)
Maple2.Server.Core/Modules/WebDbModule.cs (2)
  • WebDbModule (10-49)
  • WebDbModule (15-31)
Maple2.Server.Core/Modules/DataDbModule.cs (2)
  • DataDbModule (10-58)
  • DataDbModule (13-29)
Maple2.Server.Core/Modules/GameDbModule.cs (2)
  • GameDbModule (10-49)
  • GameDbModule (15-31)
Maple2.Server.Game/Manager/QuestManager.cs (2)
Maple2.Database/Model/Quest.cs (1)
  • Quest (11-65)
Maple2.Model/Game/Quest/Quest.cs (2)
  • Quest (9-47)
  • Quest (20-23)
Maple2.Model/Game/Event/GameEvent.cs (1)
Maple2.Server.Core/Helpers/DebugByteWriter.cs (1)
  • WriteInt (70-73)
Maple2.Tools/Extensions/PacketExtensions.cs (3)
Maple2.Tools/Extensions/ClassSerializationExtensions.cs (1)
  • T (13-16)
Maple2.Tools/Extensions/StructSerializationExtensions.cs (1)
  • T (19-28)
Maple2.Server.Core/Helpers/DebugByteWriter.cs (1)
  • WriteInt (70-73)
Maple2.Server.Web/Packet/InGameRankPacket.cs (6)
Maple2.Server.Core/Packets/Packet.cs (1)
  • Packet (9-25)
Maple2.Server.Game/Packets/InGameRankPacket.cs (2)
  • InGameRankPacket (7-17)
  • ByteWriter (9-16)
Maple2.Database/Storage/Game/GameStorage.Web.cs (4)
  • IList (61-101)
  • IList (104-123)
  • TrophyRankInfo (14-50)
  • TrophyRankInfo (52-59)
Maple2.Database/Model/Character.cs (1)
  • Profile (150-155)
Maple2.Database/Storage/Game/GameStorage.Achievement.cs (1)
  • AchievementInfo (30-46)
Maple2.Model/ModelExtensions.cs (1)
  • JobCode (11-13)
🪛 GitHub Actions: Format
Maple2.Server.Game/Manager/QuestManager.cs

[error] 194-194: dotnet format whitespace error: Fix whitespace formatting. Delete 1 characters.

Maple2.File.Ingest/Mapper/TableMapper.cs

[error] 1769-1769: dotnet format whitespace error: Fix whitespace formatting. Insert '\s'.

Maple2.Model/Enum/GameRankingType.cs

[error] 22-22: dotnet format whitespace error: Fix whitespace formatting. Insert '\s'.

Maple2.Server.Game/PacketHandlers/MentorHandler.cs

[error] 59-59: dotnet format whitespace error: Fix whitespace formatting. Replace 10 characters with '\r\n\s\s\s\s\s\s\s\s'.


[error] 61-61: dotnet format whitespace error: Fix whitespace formatting. Insert '\s\s'.


[error] 62-62: dotnet format whitespace error: Fix whitespace formatting. Insert '\s\s'.


[error] 63-63: dotnet format whitespace error: Fix whitespace formatting. Insert '\s\s\s'.


[error] 64-64: dotnet format whitespace error: Fix whitespace formatting. Insert '\s\s\s'.


[error] 65-65: dotnet format whitespace error: Fix whitespace formatting. Insert '\s\s\s'.


[error] 66-66: dotnet format whitespace error: Fix whitespace formatting. Insert '\s\s'.


[error] 66-66: dotnet format whitespace error: Fix whitespace formatting. Replace 10 characters with '\r\n\s\s\s\s\s\s\s\s'.


[error] 67-67: dotnet format whitespace error: Fix whitespace formatting. Replace 10 characters with '\r\n\s\s\s\s\s\s\s\s'.


[error] 68-68: dotnet format whitespace error: Fix whitespace formatting. Replace 6 characters with '\r\n\s\s\s\s'.

Maple2.Server.Game/Manager/MentoringManager.cs

[error] 34-34: dotnet format whitespace error: Fix whitespace formatting. Insert '\s\s'.


[error] 34-34: dotnet format whitespace error: Fix whitespace formatting. Replace 12 characters with '\r\n\r\n\s\s\s\s\s\s\s\s'.


[error] 36-36: dotnet format whitespace error: Fix whitespace formatting. Replace 10 characters with '\r\n\s\s\s\s\s\s\s\s'.


[error] 37-37: dotnet format whitespace error: Fix whitespace formatting. Replace 6 characters with '\r\n\s\s\s\s'.

Maple2.Server.Web/Packet/InGameRankPacket.cs

[error] 133-133: dotnet format whitespace error: Fix whitespace formatting. Insert '\s'.

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: build
🔇 Additional comments (67)
Maple2.File.Ingest/Maple2.File.Ingest.csproj (1)

22-22:

Details

❓ Verification inconclusive

Verify compatibility with updated Parser package

The Maple2.File.Parser.Tadeucci package has been updated to version 2.2.9, which supports new features for the trophy ranking and mentoring systems. Ensure all code that depends on this package has been updated to handle any potential breaking changes or new APIs.


🏁 Script executed:

#!/bin/bash
# Check for any usage of Parser.Tadeucci that might be affected by the update

# Look for usages of the parser package in the codebase
echo "Searching for classes using Parser.Tadeucci..."
rg -l "Parser\.Tadeucci" --type csharp

# Specifically look for any code that might parse season data
echo -e "\nSearching for season data parsing..."
rg "Season(Data)?" --type csharp -A 2 -B 2

Length of output: 12997


Verify Parser.Tadeucci v2.2.9 compatibility in ingestion mappings

I didn’t find any direct references to Maple2.File.Parser.Tadeucci in the code (the RG search returned no matches), but we do call its APIs via the parser object in several mappers. Please confirm the following after upgrading to 2.2.9:

  • TableMapper (Maple2.File.Ingest/Mapper/TableMapper.cs):
    – All parser.ParseSeasonData*() methods (Arcade, BossColosseum, DarkStream, GuildPvp, MapleSurvival, MapleSurvivalSquad, Pvp, UgcMapCommendation, WorldChampion) still exist and have the same signatures.
  • QuestMapper (Maple2.File.Ingest/Mapper/QuestMapper.cs):
    – The data.mentoringMission.mentoringSeason property remains correctly named and typed for the new mentoring-mission API.
  • Trophy-ranking features: if v2.2.9 introduced new enums or fields for ranking/mentoring, ensure Maple2.Model/Enum/GameRankingType and related mapping logic are updated accordingly.
  • Run a full build and all ingestion/integration tests to catch any signature or serialization changes.
Maple2.Server.Web/Maple2.Server.Web.csproj (1)

35-37:

Details

❌ Incorrect review comment

Ensure Model folder content is included in build

The addition of an empty Model folder to the project structure suggests it will contain new model classes for the mentoring and ranking systems. If models have been created but not included in the project structure, they may not be compiled correctly.


🏁 Script executed:

#!/bin/bash
# Check for any model files in the Model directory that might not be included in the project

# Look for any files in the Model folder
echo "Checking for files in Model directory:"
find "Maple2.Server.Web/Model" -type f 2>/dev/null || echo "No files found in Model directory"

# Check for any model classes in the codebase that might be related to mentoring or ranking systems
echo -e "\nLooking for model classes related to mentoring/ranking:"
rg -l "class.*Mentor|class.*Rank" --type csharp "Maple2.Server.Web/"

Length of output: 484


🏁 Script executed:

#!/bin/bash
# Display the beginning of the project file to determine SDK style and implicit include settings
head -n 30 Maple2.Server.Web/Maple2.Server.Web.csproj

Length of output: 1431


Ignore the empty <Folder> entry—SDK-style projects auto-include all .cs files

The project uses the .NET SDK’s default globbing (there’s no <EnableDefaultCompileItems> override), so any C# files you add under Maple2.Server.Web/Model will be picked up automatically. Currently that folder is empty, hence nothing is missing from the build. You can safely remove the empty <Folder Include="Model\" /> if it isn’t needed.

Likely an incorrect or invalid review comment.

Maple2.Server.Web/Controllers/Ugc/BannerController.cs (1)

6-6: Apply file-scoped namespace for UGC controllers
The namespace has been updated to Maple2.Server.Web.Controllers.Ugc, correctly reflecting the new folder structure and grouping all UGC-related controllers.

Maple2.Server.Web/Controllers/Ugc/ProfileController.cs (1)

6-6: Apply file-scoped namespace for UGC controllers
The namespace has been updated to Maple2.Server.Web.Controllers.Ugc, correctly reflecting the new folder structure and grouping all UGC-related controllers.

Maple2.Server.Web/Controllers/Ugc/ItemController.cs (1)

6-6: Apply file-scoped namespace for UGC controllers
The namespace has been updated to Maple2.Server.Web.Controllers.Ugc, correctly reflecting the new folder structure and grouping all UGC-related controllers.

Maple2.Server.Web/Controllers/Ugc/GuildController.cs (1)

6-6: Apply file-scoped namespace for UGC controllers
The namespace has been updated to Maple2.Server.Web.Controllers.Ugc, correctly reflecting the new folder structure and grouping all UGC-related controllers.

Maple2.Server.Web/Controllers/Ugc/ItemIconController.cs (1)

6-6: Apply file-scoped namespace for UGC controllers
The namespace has been updated to Maple2.Server.Web.Controllers.Ugc, correctly reflecting the new folder structure and grouping all UGC-related controllers.

Maple2.Model/Game/User/Character.cs (1)

56-56: LGTM: MentorRole field properly added

The MentorRole field has been correctly added to the Character class alongside other character state fields. This change aligns with the mentoring system integration across the codebase.

Maple2.Server.Game/Util/Sync/PlayerInfoStorage.cs (1)

48-49: LGTM: MentorRole properly synchronized from response

The changes correctly extract and cast the mentor role and death state fields from the PlayerInfoResponse. The synchronization ensures that the CharacterInfo object is properly populated with these fields from the server response.

Maple2.Server.Web/Controllers/Ugc/BlueprintController.cs (1)

1-1: LGTM: Namespace organization improved

Moving the BlueprintController to the Maple2.Server.Web.Controllers.Ugc namespace improves code organization by grouping related UGC controllers together. The unused System namespace has also been correctly removed.

Also applies to: 6-6

Maple2.Server.Web/Program.cs (1)

56-59: Enhanced database module registration for extended functionality.

The update to comment from "Database" to "Database modules" accurately reflects the expanded scope, with the addition of both DataDbModule and GameDbModule alongside the existing WebDbModule. This change supports the trophy ranking and mentoring features being implemented in this PR.

Maple2.Model/Common/TableNames.cs (1)

42-42: Addition of SEASON_DATA constant aligns with ranking feature implementation.

The new constant for season data XML files follows the established naming pattern and uses the wildcard convention consistently with other table names. This addition properly supports the seasonal trophy ranking system described in the PR objectives.

Maple2.Model/Game/User/IPlayerInfo.cs (1)

22-22: Appropriate extension of player model to support mentoring system.

Adding the MentorRole property to the IPlayerInfo interface ensures all player implementations can track mentoring status, which is essential for the mentoring system being introduced. The property is well-placed among other player attributes.

Maple2.Model/Enum/Mentoring.cs (1)

8-11: Improved enum naming for clarity while preserving values.

Renaming from verbose RegistedMentee to concise Mentee (and similar for Mentor) improves code readability while maintaining the original byte values. This ensures that existing data remains compatible while making the code more maintainable.

Maple2.Model/Metadata/QuestMetadata.cs (2)

18-18: Addition of mentoring mission support looks good.

This change adds a new nullable property for quest mentoring missions, extending the metadata to support the mentoring system mentioned in the PR objectives.


89-91: Well-structured record for mentoring mission data.

The new record contains the essential properties for mentoring missions: opening day timing and season identifier. This implementation properly supports the mentoring system mentioned in the PR objectives.

Maple2.File.Ingest/Mapper/ItemMapper.cs (2)

9-9: Good use of alias to simplify references.

Creating an alias for the Slot type improves code readability by avoiding fully qualified names.


34-34: Improved type safety with explicit generic parameter.

Adding the explicit <ItemData> generic parameter to the Parse call improves type safety and makes the code intent clearer.

Maple2.Server.Game/Manager/QuestManager.cs (2)

192-197: Good implementation of mentoring mission timing.

This code correctly implements the time-gating mechanism for mentoring missions, preventing them from progressing until the configured number of days have passed since the start time. This aligns with the mentoring system mentioned in the PR objectives.

🧰 Tools
🪛 GitHub Actions: Format

[error] 194-194: dotnet format whitespace error: Fix whitespace formatting. Delete 1 characters.


422-422: Simplified quest removal.

The quest removal logic has been simplified to unconditionally remove the quest when it expires. Make sure this doesn't affect any special handling that might have been needed for quests with event tags.

Maple2.Server.Core/proto/common.proto (1)

353-362: Well-structured mentor request message.

The new MentorRequest protobuf message has a clean design that:

  1. Includes the requester_id for authentication/tracking
  2. Uses a nested Invite message with receiver_id for the invitation recipient
  3. Employs the oneof pattern for extensibility to support additional request types in the future

This implementation aligns with the mentoring system mentioned in the PR objectives.

Maple2.Server.Game/Session/GameSession.cs (2)

111-111: Integration of mentoring system with the game session.

This addition introduces a new property for managing mentoring functionality, consistent with other game systems.


186-186: Mentoring manager initialization follows established pattern.

The MentoringManager is correctly instantiated following the same pattern as other managers in this method.

Maple2.File.Ingest/Mapper/QuestMapper.cs (1)

83-86: Quest metadata extended with mentoring mission support.

The addition of mentoring mission data to quest metadata properly connects the mentoring system with the quest system.

Maple2.Server.World/Service/WorldService.Sync.cs (1)

117-117: Mentor role included in player info synchronization.

The addition of the MentorRole field in the PlayerInfoResponse ensures that mentor role information is properly synchronized across the system.

Maple2.Model/Metadata/TableMetadata.cs (1)

85-85: Added serialization support for the new SeasonDataTable type.

This change properly registers the SeasonDataTable class with the JSON polymorphic type system using the "seasondata" discriminator, ensuring correct deserialization of season data objects from JSON.

Maple2.Server.Game/Packets/SystemShopPacket.cs (2)

11-12: Added new Mentee and Mentor commands to the SystemShop enum.

These additions support the new mentoring system functionality mentioned in the PR objectives.


32-46: Implemented packet writers for the new Mentee and Mentor shop commands.

The implementations follow the established pattern of existing methods in this file, maintaining consistency in the codebase. These methods create packets that allow the client to request mentor/mentee shop data from the server.

Maple2.Database/Storage/Game/GameStorage.User.cs (2)

95-95: Improved character name lookup with case-insensitive comparison.

This change ensures that character lookups work regardless of case differences, which is a good usability improvement. This supports features in the PR like mentoring and rankings where character identification is critical.


451-451: Initialized Channel property to -1 for new characters.

This ensures new characters have a consistent initial state for the Channel property, preventing potential null reference issues if the property is accessed before being explicitly set.

Maple2.Database/Model/Character.cs (3)

79-79: LGTM! MentorRole properly synchronized in Character conversion.

The MentorRole is correctly assigned when converting from the game model to the database model.


110-110: LGTM! MentorRole properly synchronized in reverse conversion.

The MentorRole is correctly assigned when converting from the database model back to the game model.


122-142:

Details

❌ Incorrect review comment

Verify database persistence configuration for MentorRole.

The Configure method doesn't include explicit configuration for the MentorRole property. Verify that it's properly persisted in the database with the correct column mapping and any necessary conversions.


🏁 Script executed:

#!/bin/bash
# Check if there are any conversion methods or configurations for enum properties
rg "HasConversion|HasJsonConversion" --type cs "Maple2.Database/Extensions/"

Length of output: 343


#!/bin/bash
# Locate MentorRole property in the Character model
rg "MentorRole" -n Maple2.Database/Model/Character.cs

# Find the MentorRole enum declaration
rg "enum MentorRole" -n Maple2.Database

#!/bin/bash
# Locate the MentorRole property declaration in the Character model
rg -n "MentorRole" Maple2.Database/Model/Character.cs

# Find the enum declaration for MentorRole anywhere in the repo
rg -n "enum MentorRole" -n .

🏁 Script executed:

#!/bin/bash
# Locate MentorRole property in Character model
rg -n "MentorRole" Maple2.Database/Model/Character.cs

# Find the enum declaration for MentorRole anywhere in the repo
rg -n "enum MentorRole" -n .

Length of output: 294


Enum mapping for MentorRole is handled by convention
EF Core natively supports enum properties (including byte‐backed enums) and will map MentorRole to a column of the appropriate integer type by default. No explicit builder.Property(…) or conversion is required for this property.

Likely an incorrect or invalid review comment.

Maple2.Server.Core/Sync/PlayerInfoUpdateExtensions.cs (3)

25-27: LGTM! MentorRole update handling added correctly.

The MentorRole is properly handled in the Update method, consistent with the pattern used for other properties.


90-90: LGTM! MentorRole correctly synchronized between player info instances.

The MentorRole property is properly copied from one IPlayerInfo instance to another.


146-146: LGTM! MentorRole correctly set in request fields.

The MentorRole is properly cast to an integer and assigned to the request, consistent with other enum properties.

Maple2.Server.Core/proto/sync.proto (2)

69-70: Ensure all clients are updated when changing protobuf field tags.

Adding the new mentor_role field with tag 23 and shifting async to tag 24 could cause backward compatibility issues if any clients are using the old version of the protocol. They might interpret the mentor_role field as the async field.

Verify that all clients will be updated simultaneously with this change, or consider adding the new field with a new tag (e.g., 25) instead of reusing tag 23.


72-73:

Details

❓ Verification inconclusive

Assess impact of moving the async field tag.

The async field has been moved from tag 23 to tag 24. While this is generally not recommended in Protocol Buffers for backward compatibility reasons, it might be acceptable if all clients are updated together.


🏁 Script executed:

#!/bin/bash
# Search for usages of the PlayerUpdateRequest.async field to assess impact
rg "async" --type cs -C 5 | grep -i "playerupdaterequest"

Length of output: 160


Backward compatibility risk for async field tag change

Moving the async field from tag 23 to tag 24 is a breaking change in Protobuf. Although our server code doesn’t reference request.Async anywhere (no usages found in PlayerInfoLookup.cs), any clients or persisted data relying on the old tag will fail to deserialize correctly.

• File: Maple2.Server.Core/proto/sync.proto (lines 72–73)

 bool async = 23;  // old
-bool async = 24;  // new

• Recommendations:

  • If you must renumber, reserve the old tag (23) to prevent reuse.
  • Coordinate a simultaneous update of all client code and serialized data.
  • Regenerate Protobuf stubs everywhere and perform integration tests to verify RPC calls still succeed.

Please confirm that all clients and stored data are updated together or revert to using a new field number instead of reassigning.

Maple2.Server.Game/Packets/FieldPacket.cs (1)

338-338: Correctly implemented MentorRole serialization.

The change clearly integrates the mentor role by writing the enum value in the character data packet, which aligns with the overall mentoring functionality being added across the codebase.

Maple2.Server.Web/Packet/MentorPacket.cs (1)

10-27: Well-structured mentee list packet serialization.

The implementation follows established patterns for packet serialization and correctly includes all necessary player information for mentees.

Maple2.File.Ingest/Mapper/TableMapper.cs (1)

1741-1773: Well-implemented SeasonDataTable parsing with DateTime conversion.

The seasonal data parsing implementation correctly reads multiple season data types and properly converts string timestamps into DateTime objects.

🧰 Tools
🪛 GitHub Actions: Format

[error] 1769-1769: dotnet format whitespace error: Fix whitespace formatting. Insert '\s'.

Maple2.Server.Game/Manager/MentoringManager.cs (2)

15-28: Good implementation of the MentoringManager class structure.

The class is properly designed with a reference to the GameSession and provides access to the player's mentor role. The constructor and Dispose method follow best practices.


40-52: Robust implementation of mentor role update with quest integration.

The UpdateRole method correctly identifies users returning to the game and starts any quests associated with their return. It also properly updates the client with the new role information.

Maple2.Model/Metadata/Constants.cs (2)

106-106: Implementation of MaxMentees constant supports mentoring system.

The new constant specifying a maximum of 3 mentees is appropriately placed and will support the mentoring system features being implemented. This matches the constant values mentioned in the PR description.


949-954: New system shop NPC constants properly defined for integration with handlers.

These NPC ID constants are well-structured and appropriately named to support the mentioned trophy ranking and mentoring systems. The constants will be used to identify specific NPCs for shop interactions.

Maple2.Server.Game/PacketHandlers/SystemShopHandler.cs (6)

17-18: Addition of new command enum values appropriately extends shop functionality.

The Mentee and Mentor enum values are logically added to the existing Command enum to support the new mentoring system.


31-36: New switch cases properly direct to appropriate handlers.

The implementation follows the established pattern for handling shop commands, ensuring consistent behavior across the system.


50-54: Updated constant references for Arena shop handling.

The code now uses the new SystemShopNPCIDHonorToken constant instead of the removed PvpArenaNpcId, maintaining functionality while improving constant naming consistency.


64-68: Updated constant references for Fishing shop handling.

Similarly, the code now uses the new SystemShopNPCIDFishing constant instead of the removed FishingNpcId, maintaining functionality while improving naming consistency.


72-85: Mentee shop handler follows established pattern.

The implementation properly checks for shop opening/closing state, retrieves NPC metadata, loads the shop with the correct ID, and sends the appropriate packet to the client.


87-100: Mentor shop handler follows established pattern.

The implementation properly checks for shop opening/closing state, retrieves NPC metadata, loads the shop with the correct ID, and sends the appropriate packet to the client.

Maple2.Model/Game/User/PlayerInfo.cs (6)

36-37: Added MentorRole and explicit Channel assignment to Player conversion.

The implicit conversion properly includes the MentorRole from the player character and ensures the Channel property is explicitly set rather than relying on default initialization.


46-47: Proper initialization of MentorRole and Channel in constructor.

These additions ensure that the MentorRole and Channel properties are properly propagated when creating a new PlayerInfo from a CharacterInfo.


101-101: MentorRole serialization added to WriteTo method.

The MentorRole is now properly serialized when writing player information to binary packets, ensuring it's transmitted to clients.


142-142: Added MentorRole property to CharacterInfo class.

This properly extends the CharacterInfo class to include mentoring role information, ensuring it's available throughout the inheritance hierarchy.


169-169: MentorRole properly copied in CharacterInfo copy constructor.

This ensures the MentorRole value is preserved when copying a CharacterInfo object, maintaining data consistency.


186-186: MentorRole set in implicit conversion from Player to CharacterInfo.

This ensures the MentorRole is properly set when converting from a Player object to a CharacterInfo object.

Maple2.Model/Metadata/Table/SeasonDataTable.cs (1)

1-17: New SeasonDataTable record structure for seasonal data management.

This well-structured record implements the Table abstraction and provides dictionaries for various season types. The Entry record clearly defines the season data structure with appropriate fields for season timing and grading. This supports the trophy ranking system mentioned in the PR.

Maple2.File.Ingest/Mapper/ServerTableMapper.cs (2)

1022-1032: Support for both date-based and days-based inactivity tracking

This change enhances the flexibility of the ReturnUser event by supporting two formats for inactivity tracking:

  1. A datetime string in "yyyy-MM-dd-HH-mm" format
  2. A simple integer representing days of inactivity

The implementation properly initializes both fields and renames Season to the more descriptive SeasonId.


1034-1043: New game event type: NewUser

The added support for the NewUser event type enables tracking of new player creation dates and associating them with seasons, which is essential for the mentoring system implementation.

Maple2.Server.Game/Packets/MentorPacket.cs (2)

21-22: Improved enum naming for clarity

Renaming Unknown10 and Unknown11 to LoginPoints and DailyPoints improves code readability and maintainability by providing clear semantics about their purpose.


29-36: New Init method for player mentor role initialization

The new Init method creates a packet containing essential player information needed for the mentoring system, including mentor role, object ID, and character ID. This provides a clean entry point for initializing mentor-related information.

Maple2.Model/Metadata/ServerTable/GameEventTable.cs (3)

93-99: Updated ReturnUser record with improved fields

The ReturnUser record has been enhanced with:

  • Renamed Season to the more descriptive SeasonId
  • Added DateInactiveSince to track when a user became inactive
  • Added DaysInactive to support simple day-based inactivity tracking

This provides more flexibility in handling different types of returning user scenarios.


249-257: Added DailyLoginReward record type

The new DailyLoginReward record type supports sending daily mail rewards to users who log in each day, documented with appropriate XML comments.


272-275: Updated JSON serialization for new record types

The polymorphic JSON serialization configuration has been properly updated to include all the new record types, ensuring they can be correctly serialized and deserialized.

Also applies to: 290-290

Maple2.Server.Game/PacketHandlers/MentorHandler.cs (2)

16-24: Updated Command enum with specific mentor actions

The Command enum has been enhanced with renamed and added values that better describe the mentor-related actions: MentorList, AssignMentee, AcceptMentor, and DeclineMentor.


29-41: Enhanced packet handling with new command cases

The Handle method has been updated to handle the new commands with dedicated methods, improving the organization of the code.

Comment thread Maple2.Tools/Extensions/PacketExtensions.cs Outdated
Comment thread Maple2.Server.Game/PacketHandlers/QuestHandler.cs
Comment thread Maple2.Server.Game/Manager/QuestManager.cs
Comment thread Maple2.Model/Game/Event/GameEvent.cs
Comment thread Maple2.Database/Model/Character.cs
Comment thread Maple2.Server.Game/PacketHandlers/MentorHandler.cs
Comment thread Maple2.Database/Storage/Game/GameStorage.Web.cs
Comment thread Maple2.Database/Storage/Game/GameStorage.Web.cs
Comment thread Maple2.Server.Web/Packet/InGameRankPacket.cs
Comment thread Maple2.Server.Web/Controllers/WebController.cs Outdated
Comment thread Maple2.Server.Web/Controllers/WebController.cs Outdated
Comment thread Maple2.File.Ingest/Mapper/ServerTableMapper.cs Outdated
@Zintixx
Zintixx marked this pull request as draft May 7, 2025 20:37
@Zintixx
Zintixx marked this pull request as ready for review May 7, 2025 23:17
@AngeloTadeucci
AngeloTadeucci merged commit 97a6529 into master May 8, 2025
@AngeloTadeucci
AngeloTadeucci deleted the mentor2 branch May 8, 2025 07:23
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