Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/copilot-instructions.md
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.
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
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
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
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
17 changes: 17 additions & 0 deletions CHANGELOG.md
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.
32 changes: 32 additions & 0 deletions COMMANDS.md
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`
85 changes: 85 additions & 0 deletions CONFIG.md
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
```
69 changes: 69 additions & 0 deletions CONTRIBUTING.md
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.
Copy link

Copilot AI Mar 22, 2026

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 the lang/ directory and wire it up before documenting it here.

Suggested change
Update `src/main/resources/lang/` for any user-facing string changes.
Update the appropriate message/notification classes or resource files for any user-facing string changes, keeping them centralized for easier localization.

Copilot uses AI. Check for mistakes.

## 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).
Loading
Loading