-
Notifications
You must be signed in to change notification settings - Fork 0
Align repository with DPC conventions #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
3
commits into
master
Choose a base branch
from
copilot/align-repo-with-dpc-conventions
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Copilot Instructions | ||
|
|
||
| This repository follows the DPC (Dans Plugins Community) conventions defined at | ||
| https://github.com/Dans-Plugins/dpc-conventions. Read those conventions before | ||
| making any changes. | ||
|
|
||
| ## Technology Stack | ||
|
|
||
| - Language: Java | ||
| - Build tool: Gradle (Groovy DSL) with Shadow plugin for fat JARs | ||
| - Target platform: Spigot / Paper (API version 1.17+) | ||
| - Test framework: Not yet configured (prefer JUnit 5; add dependencies in build.gradle before writing tests) | ||
| - Database: jOOQ with Flyway migrations; H2 by default, MariaDB supported | ||
|
|
||
| ## Project Structure | ||
|
|
||
| - `src/main/java/com/dansplugins/detectionsystem/` – Plugin source code | ||
| - `commands/` – Command executors (`AafCommand`, `AafAccountsCommand`, `AafIpsCommand`, `AafAltsCommand`) | ||
| - `listeners/` – Bukkit event listeners (e.g. `PlayerJoinListener`) | ||
| - `logins/` – Business logic and repository for login/IP tracking | ||
| - `notifications/` – Notification service integrations (Mailboxes, RPKit, message) | ||
| - `src/main/resources/` – `plugin.yml`, `config.yml`, and database migration scripts | ||
| - `src/test/java/` – (intended) unit test sources; create this directory when adding tests | ||
|
|
||
| ## Coding Conventions | ||
|
|
||
| - All user-facing messages are sent directly via `CommandSender.sendMessage()`; if a `lang/` directory is added in the future, use it for every user-facing string instead of hard-coding messages. | ||
| - Follow the existing package structure (`com.dansplugins.detectionsystem.*`) when adding new classes. | ||
| - Annotate every command executor and event listener with `@Override` where applicable. | ||
| - Database access goes through the repository layer (`LoginRepository`) and is exposed via the service layer (`LoginService`). | ||
|
|
||
| ## Contribution Workflow | ||
|
|
||
| - Branch from `develop` for all changes. | ||
| - Open a pull request against `develop`, not `main`. | ||
| - Reference the related GitHub issue in every pull request description. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| name: Build | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, develop ] | ||
| pull_request: | ||
| branches: [ main, develop ] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
|
|
||
| - name: Grant execute permission for gradlew | ||
| run: chmod +x gradlew | ||
|
|
||
| - name: Build with Gradle | ||
| run: ./gradlew clean build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| release: | ||
| types: [ created ] | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| build-and-attach: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
|
|
||
| - name: Grant execute permission for gradlew | ||
| run: chmod +x gradlew | ||
|
|
||
| - name: Build with Gradle | ||
| run: ./gradlew clean build | ||
|
|
||
| - name: Upload JAR to release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| files: build/libs/*-all.jar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to this project will be documented in this file. | ||
|
|
||
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). | ||
|
|
||
| ## [Unreleased] | ||
|
|
||
| ## [2.0.0] | ||
|
|
||
| ### Changed | ||
|
|
||
| - Rewrote the plugin for Spigot 1.17+ (v2 by Ren Binden). | ||
| - Migrated data layer to jOOQ with Flyway migrations. | ||
| - Added HikariCP connection pooling. | ||
| - Added support for MariaDB in addition to the embedded H2 database. | ||
| - Added integration with the Mailboxes and RPKit notification systems. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Commands Reference | ||
|
|
||
| ## AAF Commands | ||
|
|
||
| All commands are sub-commands of `/aaf`. | ||
|
|
||
| --- | ||
|
|
||
| ### /aaf accounts \<ip\> | ||
|
|
||
| **Description:** Lists all player accounts that have logged in from the specified IP address. | ||
| **Permission:** `aaf.accounts` | ||
| **Usage:** `/aaf accounts <ip>` | ||
| **Example:** `/aaf accounts 192.168.1.1` | ||
|
|
||
| --- | ||
|
|
||
| ### /aaf ips \<player\> | ||
|
|
||
| **Description:** Lists all IP addresses that the specified player has logged in from. | ||
| **Permission:** `aaf.ips` | ||
| **Usage:** `/aaf ips <player>` | ||
| **Example:** `/aaf ips Steve` | ||
|
|
||
| --- | ||
|
|
||
| ### /aaf alts \<player\> | ||
|
|
||
| **Description:** Lists the suspected alternate accounts of the specified player (i.e. accounts that share at least one IP address with the player). Banned players are highlighted in red. Each result is clickable and runs `/aaf ips` for that account. | ||
| **Permission:** `aaf.alts` | ||
| **Usage:** `/aaf alts <player>` | ||
| **Example:** `/aaf alts Steve` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| # Configuration Guide | ||
|
|
||
| All options are set in `plugins/AlternateAccountFinder/config.yml`. The file is created automatically on first run. | ||
|
|
||
| --- | ||
|
|
||
| ## database.url | ||
|
|
||
| **Type:** string | ||
| **Default:** `jdbc:h2:./plugins/AlternateAccountFinder/aaf;AUTO_SERVER=true;MODE=MYSQL;DATABASE_TO_UPPER=false` | ||
| **Description:** The JDBC connection URL for the plugin's data store. The default uses an embedded H2 database stored in the plugin's data folder. To use MariaDB/MySQL instead, replace this with a `jdbc:mariadb://` URL and set `database.dialect` to `MARIADB`. | ||
|
|
||
| **Example (H2 — default):** | ||
|
|
||
| ```yaml | ||
| database: | ||
| url: 'jdbc:h2:./plugins/AlternateAccountFinder/aaf;AUTO_SERVER=true;MODE=MYSQL;DATABASE_TO_UPPER=false' | ||
| ``` | ||
|
|
||
| **Example (MariaDB):** | ||
|
|
||
| ```yaml | ||
| database: | ||
| url: 'jdbc:mariadb://localhost:3306/aaf' | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## database.dialect | ||
|
|
||
| **Type:** string | ||
| **Default:** `H2` | ||
| **Description:** The SQL dialect that jOOQ uses when generating queries. Set to `H2` for the embedded database or `MARIADB` for MariaDB/MySQL. | ||
|
|
||
| **Example:** | ||
|
|
||
| ```yaml | ||
| database: | ||
| dialect: H2 | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## database.username | ||
|
|
||
| **Type:** string | ||
| **Default:** `sa` | ||
| **Description:** The username used to authenticate with the database. The default `sa` account is used for H2. Change this when connecting to an external database. | ||
|
|
||
| **Example:** | ||
|
|
||
| ```yaml | ||
| database: | ||
| username: 'aafuser' | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## database.password | ||
|
|
||
| **Type:** string | ||
| **Default:** `''` (empty) | ||
| **Description:** The password used to authenticate with the database. Leave empty for the default H2 setup. Set an appropriate password when connecting to an external database. | ||
|
|
||
| **Example:** | ||
|
|
||
| ```yaml | ||
| database: | ||
| password: 'supersecret' | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## notify-users | ||
|
|
||
| **Type:** list of UUIDs | ||
| **Default:** *(example UUIDs — replace with your own)* | ||
| **Description:** A list of player UUIDs that will receive in-game notifications when a player joins who has been detected as a potential alternate account. Remove all entries or leave the list empty to disable notifications. | ||
|
|
||
| **Example:** | ||
|
|
||
| ```yaml | ||
| notify-users: | ||
| - 0a9fa342-3139-49d7-8acb-fcf4d9c1f0ef | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| # Contributing | ||
|
|
||
| ## Thank You | ||
|
|
||
| Thank you for your interest in contributing to Alternate Account Finder! This guide will help you get started. | ||
|
|
||
| ## Links | ||
|
|
||
| - [Website](https://dansplugins.com) | ||
| - [Discord](https://discord.gg/xXtuAQ2) | ||
|
|
||
| ## Requirements | ||
|
|
||
| - A GitHub account | ||
| - Git installed on your local machine | ||
| - A Java IDE or text editor | ||
| - A basic understanding of Java | ||
|
|
||
| ## Getting Started | ||
|
|
||
| 1. [Sign up for GitHub](https://github.com/signup) if you don't have an account. | ||
| 2. Fork the repository by clicking **Fork** at the top right of the repo page. | ||
| 3. Clone your fork: `git clone https://github.com/<your-username>/AlternateAccountFinder.git` | ||
| 4. Open the project in your IDE. | ||
| 5. Build the plugin: `./gradlew build` | ||
| If you encounter errors, please open an issue. | ||
|
|
||
| ## Identifying What to Work On | ||
|
|
||
| ### Issues | ||
|
|
||
| Work items are tracked as [GitHub issues](https://github.com/Dans-Plugins/AlternateAccountFinder/issues). | ||
|
|
||
| ### Milestones | ||
|
|
||
| Issues are grouped into [milestones](https://github.com/Dans-Plugins/AlternateAccountFinder/milestones) representing upcoming releases. | ||
|
|
||
| ## Making Changes | ||
|
|
||
| 1. Make sure an issue exists for the work. If not, create one. | ||
| 2. Switch to `develop`: `git checkout develop` | ||
| 3. Create a branch: `git checkout -b <branch-name>` | ||
| 4. Make your changes. | ||
| 5. Test your changes. | ||
| 6. Commit: `git commit -m "Description of changes"` | ||
| 7. Push: `git push origin <branch-name>` | ||
| 8. Open a pull request against `develop`, link the related issue with `#<number>`. | ||
| 9. Address review feedback. | ||
|
|
||
| ### Language Files | ||
|
|
||
| Update `src/main/resources/lang/` for any user-facing string changes. | ||
|
|
||
| ## Testing | ||
|
|
||
| Run a verification build with: | ||
|
|
||
| Linux: `./gradlew clean build` | ||
| Windows: `.\gradlew.bat clean build` | ||
|
|
||
| For manual testing, start a local Spigot server: | ||
|
|
||
| ``` | ||
| docker compose up | ||
| ``` | ||
|
|
||
| ## Questions | ||
|
|
||
| Ask in the [Discord server](https://discord.gg/xXtuAQ2). | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section references
src/main/resources/lang/for user-facing strings, but that directory doesn't exist in the repo right now. Either update this guidance to match the current codebase (e.g., point at the current message/notification classes), or add thelang/directory and wire it up before documenting it here.