How minevn/dotman works
Overall System and Major Components
• Plugin Core Module: Represent the entry point (e.g., DotMan.kt) that boots the plugin and registers listeners/commands.
• Event Listener: DotManListener.kt handles server events (likely related to player donations or updates).
• Command Handlers: Group the different commands (AdminCmd, MainCmd, TopNapCmd) that receive and process user input.
• Configuration Handling: Show the config classes (FileConfig.kt, Language.kt, MainConfig.kt, Milestones, etc.) and how they load YAML configuration files (config.yml, messages.yml, mocnap.yml, and interface files in the /menu folder).
• GUI Components: Include the GUI classes (e.g., CardPriceUI, CardTypeUI) and resources for in-game menus.
• Donation/Payment Processing: Illustrate the card module that includes classes like Card, CardPrice, CardResult, CardType, and CardWaiting to manage donation card processing.
• Database Abstraction Layer: Separate the Data Access Objects (DAO) interfaces (e.g., ConfigDAO, LogDAO, PlayerDataDAO, etc.) and their implementations for different database types (H2 and MySQL). This separation emphasizes the use of the DAO pattern to abstract data storage.
• Provider Integration: Indicate the providers package and its types (GameBankCP, TheSieuTocCP) which interface with external recharge services.
• Utility Components: Capture utility classes (e.g., FormatUtils, Utils, TopUtils) that help with formatting and processing operations.
• Discord Integration: Include Discord configuration and integration (Discord.kt) for notifications or external communications.
Relationships and Interactions
• The Core Module initializes the plugin, registers commands, listeners, and loads configurations.
• Commands (such as /napthe and /topnap) when invoked, trigger corresponding command handler modules which interact with both database (recording donation histories and player data) and GUI components (for interactive menus).
• Config classes load parameters from the YAML files located in the resources folder; these configurations feed into GUI components and business logic.
• The plugin abstractly deals with external provider APIs via dedicated provider classes; these interactions are encapsulated behind the provider interfaces.
• The DAO layer interacts with the underlying SQL databases in two flavors (H2 for lightweight setups and MySQL for more robust setups), with clear migration scripts provided in the resources.
• Utility classes support the business logic in formatting data or managing layouts (especially for ranking or top donation computations).
Architectural Patterns and Design Principles
• Modularization: The project structure separates concerns well, with distinct packages for commands, configuration, database access, providers, and UI.
• DAO Pattern: Use of interfaces for data access wrapped by implementations for H2 and MySQL clearly shows an abstraction over the persistence layer.
• MVC-Like Separation: Although not a web application, the division between commands (input), configuration/data (model), and GUI (view) loosely follows a separation of concerns.
• Plugin Event-Driven Model: Leveraging listeners and event registrations typical for Minecraft plugin architecture.
• Dependency Injection (manual/through modular structure): Components likely reference and depend on each other in a controlled manner (e.g., configuration injected into command processing).
Specific Technologies and Frameworks
• Kotlin & Java: The primary languages for development.
• Gradle: Build tool as indicated by build.gradle.kts scripts.
• Minecraft Server APIs: The project makes use of the Bukkit/Spigot API for plugin integration.
• External Dependencies: Relies on PlayerPoints and PlaceholderAPI for additional server functionalities.
• External Service Integration: Providers for various mobile card APIs (gamebank, thesieutoc, etc.).