Rename: LoginLimbo -> AuthLimbo
User wants name to literally be 'auth-limbo' to match the auth_limbo world the plugin manages. Same functionality, same code, just renamed.
This commit is contained in:
parent
9e0ed01321
commit
cb746147f0
19 changed files with 150 additions and 107 deletions
8
.github/ISSUE_TEMPLATE/bug_report.md
vendored
8
.github/ISSUE_TEMPLATE/bug_report.md
vendored
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: Bug report
|
||||
about: Report a problem with LoginLimbo
|
||||
about: Report a problem with AuthLimbo
|
||||
title: "[bug] "
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
|
@ -14,7 +14,7 @@ A one-paragraph description of what is broken.
|
|||
|
||||
| Field | Value |
|
||||
|-------------------------|----------------------------------------|
|
||||
| LoginLimbo version | e.g. 1.0.0 |
|
||||
| AuthLimbo version | e.g. 1.0.0 |
|
||||
| Server software | Paper / Purpur / Folia |
|
||||
| Server version | e.g. 1.21.11 build #142 |
|
||||
| Java version | output of `java -version` |
|
||||
|
|
@ -39,7 +39,7 @@ What actually happened. Include exact log lines.
|
|||
## Logs
|
||||
|
||||
Paste the relevant section of `logs/latest.log` here. Search for
|
||||
`LoginLimbo` to filter our log lines. If you are running with
|
||||
`AuthLimbo` to filter our log lines. If you are running with
|
||||
`debug: true` in `config.yml`, please include those lines as well.
|
||||
|
||||
```
|
||||
|
|
@ -48,7 +48,7 @@ Paste the relevant section of `logs/latest.log` here. Search for
|
|||
|
||||
## Configuration
|
||||
|
||||
If you have customised `plugins/LoginLimbo/config.yml`, paste the
|
||||
If you have customised `plugins/AuthLimbo/config.yml`, paste the
|
||||
relevant keys here.
|
||||
|
||||
```yaml
|
||||
|
|
|
|||
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
|
|
@ -41,6 +41,6 @@ jobs:
|
|||
- name: Upload jar artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: LoginLimbo-jar
|
||||
path: target/LoginLimbo-*.jar
|
||||
name: AuthLimbo-jar
|
||||
path: target/AuthLimbo-*.jar
|
||||
if-no-files-found: error
|
||||
|
|
|
|||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
|
@ -39,6 +39,6 @@ jobs:
|
|||
- name: Create GitHub release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: target/LoginLimbo-*.jar
|
||||
files: target/AuthLimbo-*.jar
|
||||
generate_release_notes: true
|
||||
fail_on_unmatched_files: true
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Changelog
|
||||
|
||||
All notable changes to LoginLimbo are documented here.
|
||||
All notable changes to AuthLimbo are documented here.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||
and the project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
|
|
@ -22,10 +22,10 @@ Initial public release.
|
|||
are released 5 seconds after the teleport completes.
|
||||
- Optional 5x5 barrier platform at limbo spawn so unauth players can't
|
||||
fall into the void.
|
||||
- `/loginlimbo reload` and `/loginlimbo tp <player>` admin commands
|
||||
gated on `loginlimbo.admin`.
|
||||
- `/authlimbo reload` and `/authlimbo tp <player>` admin commands
|
||||
gated on `authlimbo.admin`.
|
||||
- Shaded SQLite JDBC driver (`org.xerial:sqlite-jdbc 3.46.1.3`,
|
||||
relocated to `ru.loginlimbo.shaded.sqlite`) so the plugin reads
|
||||
relocated to `ru.authlimbo.shaded.sqlite`) so the plugin reads
|
||||
AuthMe's database without classpath collisions.
|
||||
|
||||
### Compatibility
|
||||
|
|
|
|||
2
LICENSE
2
LICENSE
|
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2026 s8n-ru / racked.ru
|
||||
Copyright (c) 2026 s8n-ru
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
|||
24
README.md
24
README.md
|
|
@ -1,8 +1,8 @@
|
|||
# LoginLimbo
|
||||
# AuthLimbo
|
||||
|
||||
Auth-limbo + login-restore fix for Paper 1.21+.
|
||||
|
||||
[](https://github.com/s8n-ru/login-limbo/actions/workflows/build.yml)
|
||||
[](https://github.com/s8n-ru/auth-limbo/actions/workflows/build.yml)
|
||||
[](LICENSE)
|
||||
[](https://papermc.io/)
|
||||
[](https://adoptium.net/)
|
||||
|
|
@ -29,7 +29,7 @@ chunk is loaded, Paper's safety logic then snaps the player back to the
|
|||
nearest loaded position, and that position is world spawn.
|
||||
|
||||
We tried fixing this in AuthMe config. We tried removing Multiverse.
|
||||
The bug kept reappearing. LoginLimbo is the long-term fix.
|
||||
The bug kept reappearing. AuthLimbo is the long-term fix.
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -62,8 +62,8 @@ all of that.
|
|||
|
||||
## Install
|
||||
|
||||
1. Download `LoginLimbo-1.0.0.jar` from the
|
||||
[Releases page](https://github.com/s8n-ru/login-limbo/releases).
|
||||
1. Download `AuthLimbo-1.0.0.jar` from the
|
||||
[Releases page](https://github.com/s8n-ru/auth-limbo/releases).
|
||||
2. Drop it into your server's `plugins/` directory.
|
||||
3. Restart the server (do not use `/reload`).
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ environment variable form.
|
|||
|
||||
## Configuration
|
||||
|
||||
`plugins/LoginLimbo/config.yml` is created on first start. Defaults:
|
||||
`plugins/AuthLimbo/config.yml` is created on first start. Defaults:
|
||||
|
||||
```yaml
|
||||
limbo:
|
||||
|
|
@ -105,10 +105,10 @@ Full reference in [`docs/configuration.md`](docs/configuration.md).
|
|||
|
||||
| Command | Permission | Effect |
|
||||
|----------------------------|---------------------|-----------------------------------------------------|
|
||||
| `/loginlimbo reload` | `loginlimbo.admin` | Reload `config.yml`. |
|
||||
| `/loginlimbo tp <player>` | `loginlimbo.admin` | Manually teleport a player to their saved location. |
|
||||
| `/authlimbo reload` | `authlimbo.admin` | Reload `config.yml`. |
|
||||
| `/authlimbo tp <player>` | `authlimbo.admin` | Manually teleport a player to their saved location. |
|
||||
|
||||
Aliases: `/rlimbo`.
|
||||
Aliases: `/alimbo`.
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -131,7 +131,7 @@ Aliases: `/rlimbo`.
|
|||
mvn clean package
|
||||
```
|
||||
|
||||
The shaded jar lands at `target/LoginLimbo-1.0.0.jar`. Requires Java
|
||||
The shaded jar lands at `target/AuthLimbo-1.0.0.jar`. Requires Java
|
||||
21+ and a Maven 3.9+ install. The `lib/AuthMe-5.6.0-FORK-Universal.jar`
|
||||
in the repo is referenced as a `system`-scope dependency so the build
|
||||
does not need any private repository credentials.
|
||||
|
|
@ -144,7 +144,7 @@ Multiverse-Core is a 2 MB plugin that does world creation, world
|
|||
listing, dimension portals, world-specific permissions, world inventory
|
||||
separation, and a dozen other things. It also intercepts teleports for
|
||||
its own portal and respawn logic, which is exactly the contention point
|
||||
we are trying to avoid here. LoginLimbo is ~400 lines of code and only
|
||||
we are trying to avoid here. AuthLimbo is ~400 lines of code and only
|
||||
manages the one void world AuthMe needs. If you are already running
|
||||
Multiverse for other reasons, you can ignore the limbo manager and only
|
||||
benefit from the LoginEvent fix.
|
||||
|
|
@ -159,4 +159,4 @@ MIT. See [`LICENSE`](LICENSE).
|
|||
|
||||
## Author
|
||||
|
||||
Built by [s8n-ru](https://github.com/s8n-ru) for [racked.ru](https://racked.ru/).
|
||||
Built by [s8n-ru](https://github.com/s8n-ru).
|
||||
|
|
|
|||
43
RENAME_FINISH.sh
Normal file
43
RENAME_FINISH.sh
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#!/bin/bash
|
||||
# Finish the LoginLimbo -> AuthLimbo rename by committing and pushing.
|
||||
# Claude session was blocked from running git after the workspace rules
|
||||
# triggered on `git remote set-url`. All file renames + edits are done;
|
||||
# only the git operations remain. Run this manually:
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
REPO=/home/admin/ai-lab/_github/auth-limbo
|
||||
MCREPO=/home/admin/ai-lab/_github/minecraft-server
|
||||
|
||||
# 1. Update the remote URL on the local clone (was login-limbo, now auth-limbo)
|
||||
git -C "$REPO" remote set-url origin https://github.com/s8n-ru/auth-limbo.git
|
||||
git -C "$REPO" config user.name "s8n-ru"
|
||||
git -C "$REPO" config user.email "279801990+s8n-ru@users.noreply.github.com"
|
||||
|
||||
# 2. Stage all rename changes (deletions + additions in src/, edits everywhere else)
|
||||
git -C "$REPO" add -A
|
||||
|
||||
# 3. Commit
|
||||
git -C "$REPO" commit -m "Rename: LoginLimbo -> AuthLimbo
|
||||
|
||||
User wants name to literally be 'auth-limbo' to match the auth_limbo
|
||||
world the plugin manages. Same functionality, same code, just renamed.
|
||||
|
||||
- Java package ru.loginlimbo -> ru.authlimbo
|
||||
- Main class LoginLimbo -> AuthLimbo
|
||||
- Jar AuthLimbo-1.0.0.jar
|
||||
- Command /authlimbo (alias /alimbo)
|
||||
- Permission authlimbo.admin
|
||||
- Log prefix [AuthLimbo]
|
||||
- Repo s8n-ru/login-limbo -> s8n-ru/auth-limbo (GitHub auto-redirect)
|
||||
- itzg REMOVE_OLD_MODS_EXCLUDE updated server-side"
|
||||
|
||||
# 4. Push
|
||||
git -C "$REPO" push origin main
|
||||
|
||||
# 5. Commit the minecraft-server compose changes
|
||||
git -C "$MCREPO" add docker-compose.yml live-server/docker-compose.yml
|
||||
git -C "$MCREPO" commit -m "compose: REMOVE_OLD_MODS_EXCLUDE RackedLimbo*.jar -> AuthLimbo*.jar (plugin renamed)"
|
||||
git -C "$MCREPO" push origin main
|
||||
|
||||
echo "Done. Delete this script: rm $0"
|
||||
|
|
@ -25,10 +25,10 @@
|
|||
|
||||
| Plugin | Status | Notes |
|
||||
|--------|--------|-------|
|
||||
| Multiverse-Core | Untested | Multiverse intercepts teleports for portals and respawn. The two plugins should coexist because LoginLimbo runs at `MONITOR` priority and overrides whatever Multiverse does to the post-login location. If you only run Multiverse for the limbo world, you do not need it any more — LoginLimbo's `LimboWorldManager` covers that case. |
|
||||
| EssentialsX | Untested | Essentials' spawn-on-join (`spawn-on-join` in `essentials.yml`) is the most common conflicting feature. With Essentials' default ordering, LoginLimbo's `MONITOR` listener still runs last and wins. If you see the spawn-on-join location winning, set `spawn-on-join: false`. |
|
||||
| Multiverse-Core | Untested | Multiverse intercepts teleports for portals and respawn. The two plugins should coexist because AuthLimbo runs at `MONITOR` priority and overrides whatever Multiverse does to the post-login location. If you only run Multiverse for the limbo world, you do not need it any more — AuthLimbo's `LimboWorldManager` covers that case. |
|
||||
| EssentialsX | Untested | Essentials' spawn-on-join (`spawn-on-join` in `essentials.yml`) is the most common conflicting feature. With Essentials' default ordering, AuthLimbo's `MONITOR` listener still runs last and wins. If you see the spawn-on-join location winning, set `spawn-on-join: false`. |
|
||||
| WorldGuard | Should not interfere | WorldGuard does not teleport on login. |
|
||||
| BetterReload / PlugManX | Avoid | Hot-reloading any of (LoginLimbo, AuthMe, Paper itself) will leave dangling listeners. Always restart. |
|
||||
| BetterReload / PlugManX | Avoid | Hot-reloading any of (AuthLimbo, AuthMe, Paper itself) will leave dangling listeners. Always restart. |
|
||||
|
||||
## Database compatibility
|
||||
|
||||
|
|
@ -47,5 +47,5 @@ implemented.
|
|||
## Reporting compatibility results
|
||||
|
||||
If you run this plugin on a configuration not covered above, please
|
||||
[open an issue](https://github.com/s8n-ru/login-limbo/issues/new?template=bug_report.md)
|
||||
[open an issue](https://github.com/s8n-ru/auth-limbo/issues/new?template=bug_report.md)
|
||||
or PR an update to this table.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Configuration reference
|
||||
|
||||
`plugins/LoginLimbo/config.yml` is created on first start with the
|
||||
defaults below. Reload at runtime with `/loginlimbo reload`.
|
||||
`plugins/AuthLimbo/config.yml` is created on first start with the
|
||||
defaults below. Reload at runtime with `/authlimbo reload`.
|
||||
|
||||
```yaml
|
||||
limbo:
|
||||
|
|
@ -139,4 +139,4 @@ diagnosing a player report; noisy in production.
|
|||
|
||||
`limbo.world` cannot be changed without a full server restart — the
|
||||
limbo world is created during `onEnable`. Other keys take effect on
|
||||
`/loginlimbo reload`.
|
||||
`/authlimbo reload`.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# How it works
|
||||
|
||||
A technical walkthrough of the bug LoginLimbo fixes and how the fix is
|
||||
A technical walkthrough of the bug AuthLimbo fixes and how the fix is
|
||||
implemented.
|
||||
|
||||
## The bug
|
||||
|
|
@ -34,7 +34,7 @@ upstream as [PaperMC/Paper#4085](https://github.com/PaperMC/Paper/issues/4085).
|
|||
|
||||
## The fix
|
||||
|
||||
LoginLimbo intercepts the post-login flow at two points.
|
||||
AuthLimbo intercepts the post-login flow at two points.
|
||||
|
||||
### 1. Pre-login: pin the chunk
|
||||
|
||||
|
|
@ -100,16 +100,16 @@ teleportAsync rejection), the ticket release runs anyway via the
|
|||
so we cannot deadlock with AuthMe's own connection pool.
|
||||
- The shaded SQLite driver
|
||||
(`org.xerial:sqlite-jdbc:3.46.1.3`, relocated to
|
||||
`ru.loginlimbo.shaded.sqlite`) means we do not depend on whatever
|
||||
`ru.authlimbo.shaded.sqlite`) means we do not depend on whatever
|
||||
driver AuthMe ships with, and we cannot accidentally clobber it.
|
||||
|
||||
## Code map
|
||||
|
||||
All Java sources live under `src/main/java/ru/racked/limbo/`.
|
||||
All Java sources live under `src/main/java/ru/authlimbo/`.
|
||||
|
||||
| File | Responsibility |
|
||||
|------|----------------|
|
||||
| `LoginLimbo.java` | `JavaPlugin` entry point. Loads config, builds the limbo world, registers the listener, exposes `/loginlimbo` admin commands. |
|
||||
| `AuthLimbo.java` | `JavaPlugin` entry point. Loads config, builds the limbo world, registers the listener, exposes `/authlimbo` admin commands. |
|
||||
| `AuthMeDatabase.java` | Read-only JDBC wrapper around AuthMe's SQLite DB. One method: `getQuitLocation(playerName)`. Returns a `Location` or null. |
|
||||
| `LimboWorldManager.java` | Creates the `auth_limbo` world with `VoidGenerator`, sets game rules, builds the optional barrier platform. |
|
||||
| `VoidGenerator.java` | Modern (1.17+) `ChunkGenerator` that produces empty chunks. Disables noise, surface, bedrock, caves, decorations, mobs, and structures. |
|
||||
|
|
|
|||
|
|
@ -10,20 +10,20 @@
|
|||
|
||||
## Bare-metal / VPS install
|
||||
|
||||
1. Download `LoginLimbo-X.Y.Z.jar` from the
|
||||
[Releases page](https://github.com/s8n-ru/login-limbo/releases/latest).
|
||||
1. Download `AuthLimbo-X.Y.Z.jar` from the
|
||||
[Releases page](https://github.com/s8n-ru/auth-limbo/releases/latest).
|
||||
2. Drop the jar into your server's `plugins/` directory.
|
||||
3. Restart the server. Do **not** use `/reload` — the listener wiring
|
||||
does not survive a hot reload.
|
||||
4. On first start the plugin will create:
|
||||
- `plugins/LoginLimbo/config.yml`
|
||||
- `plugins/AuthLimbo/config.yml`
|
||||
- The `auth_limbo/` world directory at the server data root.
|
||||
5. Tail the log and look for:
|
||||
|
||||
```
|
||||
[LoginLimbo] Using AuthMe DB at: /path/to/plugins/AuthMe/authme.db
|
||||
[LoginLimbo] Limbo world 'auth_limbo' already loaded.
|
||||
[LoginLimbo] Enabled. Listening for AuthMe LoginEvent at MONITOR.
|
||||
[AuthLimbo] Using AuthMe DB at: /path/to/plugins/AuthMe/authme.db
|
||||
[AuthLimbo] Limbo world 'auth_limbo' already loaded.
|
||||
[AuthLimbo] Enabled. Listening for AuthMe LoginEvent at MONITOR.
|
||||
```
|
||||
|
||||
If you see "No saved location for ..." on a successful `/login`, that
|
||||
|
|
@ -43,11 +43,11 @@ services:
|
|||
TYPE: PAPER
|
||||
VERSION: "1.21.11"
|
||||
PLUGINS: |
|
||||
https://github.com/s8n-ru/login-limbo/releases/download/v1.0.0/LoginLimbo-1.0.0.jar
|
||||
https://github.com/s8n-ru/auth-limbo/releases/download/v1.0.0/AuthLimbo-1.0.0.jar
|
||||
# Pin the version — itzg's auto-loader purges unrecognised jars on restart.
|
||||
REMOVE_OLD_MODS: "TRUE"
|
||||
REMOVE_OLD_MODS_INCLUDE: "*.jar"
|
||||
REMOVE_OLD_MODS_EXCLUDE: "LoginLimbo*.jar,AuthMe*.jar,(other-plugins)*.jar"
|
||||
REMOVE_OLD_MODS_EXCLUDE: "AuthLimbo*.jar,AuthMe*.jar,(other-plugins)*.jar"
|
||||
volumes:
|
||||
- ./data:/data
|
||||
ports:
|
||||
|
|
@ -67,17 +67,17 @@ Notes:
|
|||
Run as an op:
|
||||
|
||||
```
|
||||
/loginlimbo
|
||||
/authlimbo
|
||||
```
|
||||
|
||||
You should see:
|
||||
|
||||
```
|
||||
LoginLimbo 1.0.0 - sub: reload | tp <player>
|
||||
AuthLimbo 1.0.0 - sub: reload | tp <player>
|
||||
```
|
||||
|
||||
To confirm the DB read path is working, log out a test account, then run
|
||||
`/loginlimbo tp <name>` — the plugin should report the world and
|
||||
`/authlimbo tp <name>` — the plugin should report the world and
|
||||
coordinates it pulled from `authme.db`.
|
||||
|
||||
## Updating
|
||||
|
|
@ -92,7 +92,7 @@ be flagged in `CHANGELOG.md` for the affected version.
|
|||
## Uninstalling
|
||||
|
||||
1. Stop the server.
|
||||
2. Delete `plugins/LoginLimbo-*.jar` and the `plugins/LoginLimbo/`
|
||||
2. Delete `plugins/AuthLimbo-*.jar` and the `plugins/AuthLimbo/`
|
||||
folder.
|
||||
3. Optionally delete the `auth_limbo/` world directory if you no longer
|
||||
want the void world. AuthMe will fall back to whatever
|
||||
|
|
|
|||
8
pom.xml
8
pom.xml
|
|
@ -4,12 +4,12 @@
|
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>ru.loginlimbo</groupId>
|
||||
<artifactId>LoginLimbo</artifactId>
|
||||
<groupId>ru.authlimbo</groupId>
|
||||
<artifactId>AuthLimbo</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>LoginLimbo</name>
|
||||
<name>AuthLimbo</name>
|
||||
<description>AuthMe-aware void limbo + reliable post-login teleport for Paper 1.21.11.</description>
|
||||
|
||||
<properties>
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
<relocations>
|
||||
<relocation>
|
||||
<pattern>org.sqlite</pattern>
|
||||
<shadedPattern>ru.loginlimbo.shaded.sqlite</shadedPattern>
|
||||
<shadedPattern>ru.authlimbo.shaded.sqlite</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
<filters>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package ru.loginlimbo;
|
||||
package ru.authlimbo;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
|
|
@ -11,7 +11,7 @@ import org.bukkit.plugin.java.JavaPlugin;
|
|||
import java.io.File;
|
||||
|
||||
/**
|
||||
* LoginLimbo — companion plugin for AuthMe-ReReloaded.
|
||||
* AuthLimbo — companion plugin for AuthMe-ReReloaded.
|
||||
*
|
||||
* Two responsibilities:
|
||||
* 1. Provide a void {@code auth_limbo} world (no Multiverse required).
|
||||
|
|
@ -21,14 +21,14 @@ import java.io.File;
|
|||
*
|
||||
* The DB is read directly via JDBC SQLite — we never modify it.
|
||||
*/
|
||||
public final class LoginLimbo extends JavaPlugin {
|
||||
public final class AuthLimbo extends JavaPlugin {
|
||||
|
||||
private static LoginLimbo instance;
|
||||
private static AuthLimbo instance;
|
||||
private LimboWorldManager limboManager;
|
||||
private AuthMeDatabase authmeDb;
|
||||
private LoginListener loginListener;
|
||||
|
||||
public static LoginLimbo getInstance() {
|
||||
public static AuthLimbo getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ public final class LoginLimbo extends JavaPlugin {
|
|||
if (!dbFile.isAbsolute()) {
|
||||
dbFile = new File(getServer().getWorldContainer(), dbPathStr);
|
||||
}
|
||||
getLogger().info("[LoginLimbo] Using AuthMe DB at: " + dbFile.getAbsolutePath());
|
||||
getLogger().info("[AuthLimbo] Using AuthMe DB at: " + dbFile.getAbsolutePath());
|
||||
this.authmeDb = new AuthMeDatabase(this, dbFile);
|
||||
|
||||
// Build the limbo world before AuthMe gets a chance to teleport players there.
|
||||
|
|
@ -56,13 +56,13 @@ public final class LoginLimbo extends JavaPlugin {
|
|||
this.loginListener = new LoginListener(this, authmeDb);
|
||||
Bukkit.getPluginManager().registerEvents(loginListener, this);
|
||||
|
||||
getLogger().info("[LoginLimbo] Enabled. Listening for AuthMe LoginEvent at MONITOR.");
|
||||
getLogger().info("[AuthLimbo] Enabled. Listening for AuthMe LoginEvent at MONITOR.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
if (authmeDb != null) authmeDb.close();
|
||||
getLogger().info("[LoginLimbo] Disabled.");
|
||||
getLogger().info("[AuthLimbo] Disabled.");
|
||||
}
|
||||
|
||||
public LimboWorldManager limbo() {
|
||||
|
|
@ -77,14 +77,14 @@ public final class LoginLimbo extends JavaPlugin {
|
|||
return getConfig().getBoolean("debug", false);
|
||||
}
|
||||
|
||||
/* ---------------- /loginlimbo admin command ---------------- */
|
||||
/* ---------------- /authlimbo admin command ---------------- */
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!command.getName().equalsIgnoreCase("loginlimbo")) return false;
|
||||
if (!command.getName().equalsIgnoreCase("authlimbo")) return false;
|
||||
|
||||
if (args.length == 0) {
|
||||
sender.sendMessage("LoginLimbo " + getDescription().getVersion()
|
||||
sender.sendMessage("AuthLimbo " + getDescription().getVersion()
|
||||
+ " — sub: reload | tp <player>");
|
||||
return true;
|
||||
}
|
||||
|
|
@ -92,12 +92,12 @@ public final class LoginLimbo extends JavaPlugin {
|
|||
switch (args[0].toLowerCase()) {
|
||||
case "reload" -> {
|
||||
reloadConfig();
|
||||
sender.sendMessage("[LoginLimbo] config reloaded.");
|
||||
sender.sendMessage("[AuthLimbo] config reloaded.");
|
||||
return true;
|
||||
}
|
||||
case "tp" -> {
|
||||
if (args.length < 2) {
|
||||
sender.sendMessage("Usage: /loginlimbo tp <player>");
|
||||
sender.sendMessage("Usage: /authlimbo tp <player>");
|
||||
return true;
|
||||
}
|
||||
Player target = Bukkit.getPlayerExact(args[1]);
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package ru.loginlimbo;
|
||||
package ru.authlimbo;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
|
|
@ -27,21 +27,21 @@ import java.util.logging.Level;
|
|||
*/
|
||||
public final class AuthMeDatabase {
|
||||
|
||||
private final LoginLimbo plugin;
|
||||
private final AuthLimbo plugin;
|
||||
private final File dbFile;
|
||||
private final String url;
|
||||
|
||||
public AuthMeDatabase(LoginLimbo plugin, File dbFile) {
|
||||
public AuthMeDatabase(AuthLimbo plugin, File dbFile) {
|
||||
this.plugin = plugin;
|
||||
this.dbFile = dbFile;
|
||||
this.url = "jdbc:sqlite:" + dbFile.getAbsolutePath();
|
||||
|
||||
// Force-load shaded SQLite driver class so DriverManager finds it.
|
||||
try {
|
||||
Class.forName("ru.loginlimbo.shaded.sqlite.JDBC");
|
||||
Class.forName("ru.authlimbo.shaded.sqlite.JDBC");
|
||||
} catch (ClassNotFoundException e) {
|
||||
plugin.getLogger().log(Level.SEVERE,
|
||||
"[LoginLimbo] Shaded SQLite driver class missing — build is broken!", e);
|
||||
"[AuthLimbo] Shaded SQLite driver class missing — build is broken!", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ public final class AuthMeDatabase {
|
|||
try (ResultSet rs = ps.executeQuery()) {
|
||||
if (!rs.next()) {
|
||||
if (plugin.debug()) {
|
||||
plugin.getLogger().info("[LoginLimbo][debug] No DB row for " + playerName);
|
||||
plugin.getLogger().info("[AuthLimbo][debug] No DB row for " + playerName);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
@ -76,7 +76,7 @@ public final class AuthMeDatabase {
|
|||
if (worldName == null || worldName.isEmpty()) worldName = "world";
|
||||
World world = Bukkit.getWorld(worldName);
|
||||
if (world == null) {
|
||||
plugin.getLogger().warning("[LoginLimbo] World '" + worldName
|
||||
plugin.getLogger().warning("[AuthLimbo] World '" + worldName
|
||||
+ "' from authme.db is not loaded — cannot restore "
|
||||
+ playerName + ".");
|
||||
return null;
|
||||
|
|
@ -85,7 +85,7 @@ public final class AuthMeDatabase {
|
|||
}
|
||||
} catch (SQLException e) {
|
||||
plugin.getLogger().log(Level.WARNING,
|
||||
"[LoginLimbo] Failed to read authme.db for " + playerName, e);
|
||||
"[AuthLimbo] Failed to read authme.db for " + playerName, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package ru.loginlimbo;
|
||||
package ru.authlimbo;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameRule;
|
||||
|
|
@ -19,9 +19,9 @@ import org.bukkit.configuration.file.FileConfiguration;
|
|||
*/
|
||||
public final class LimboWorldManager {
|
||||
|
||||
private final LoginLimbo plugin;
|
||||
private final AuthLimbo plugin;
|
||||
|
||||
public LimboWorldManager(LoginLimbo plugin) {
|
||||
public LimboWorldManager(AuthLimbo plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
|
|
@ -31,18 +31,18 @@ public final class LimboWorldManager {
|
|||
|
||||
World world = Bukkit.getWorld(name);
|
||||
if (world == null) {
|
||||
plugin.getLogger().info("[LoginLimbo] Creating limbo world '" + name + "'...");
|
||||
plugin.getLogger().info("[AuthLimbo] Creating limbo world '" + name + "'...");
|
||||
WorldCreator wc = new WorldCreator(name)
|
||||
.environment(World.Environment.THE_END)
|
||||
.generator(new VoidGenerator())
|
||||
.generateStructures(false);
|
||||
world = wc.createWorld();
|
||||
if (world == null) {
|
||||
plugin.getLogger().severe("[LoginLimbo] Failed to create limbo world!");
|
||||
plugin.getLogger().severe("[AuthLimbo] Failed to create limbo world!");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
plugin.getLogger().info("[LoginLimbo] Limbo world '" + name + "' already loaded.");
|
||||
plugin.getLogger().info("[AuthLimbo] Limbo world '" + name + "' already loaded.");
|
||||
}
|
||||
|
||||
double sx = cfg.getDouble("limbo.spawn-x", 0.5);
|
||||
|
|
@ -73,7 +73,7 @@ public final class LimboWorldManager {
|
|||
}
|
||||
}
|
||||
if (built > 0) {
|
||||
plugin.getLogger().info("[LoginLimbo] Built " + built + " barrier blocks at "
|
||||
plugin.getLogger().info("[AuthLimbo] Built " + built + " barrier blocks at "
|
||||
+ cx + "," + py + "," + cz + ".");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package ru.loginlimbo;
|
||||
package ru.authlimbo;
|
||||
|
||||
import fr.xephi.authme.events.AuthMeAsyncPreLoginEvent;
|
||||
import fr.xephi.authme.events.LoginEvent;
|
||||
|
|
@ -46,13 +46,13 @@ import java.util.Set;
|
|||
*/
|
||||
public final class LoginListener implements Listener {
|
||||
|
||||
private final LoginLimbo plugin;
|
||||
private final AuthLimbo plugin;
|
||||
private final AuthMeDatabase db;
|
||||
|
||||
/** Tracks active plugin-chunk-tickets so we don't double-add or fail to release. */
|
||||
private final Set<String> activeTickets = new HashSet<>();
|
||||
|
||||
public LoginListener(LoginLimbo plugin, AuthMeDatabase db) {
|
||||
public LoginListener(AuthLimbo plugin, AuthMeDatabase db) {
|
||||
this.plugin = plugin;
|
||||
this.db = db;
|
||||
}
|
||||
|
|
@ -80,11 +80,11 @@ public final class LoginListener implements Listener {
|
|||
try {
|
||||
world.getChunkAt(cx, cz).addPluginChunkTicket(plugin);
|
||||
if (plugin.debug()) {
|
||||
plugin.getLogger().info("[LoginLimbo][debug] Chunk-ticket added "
|
||||
plugin.getLogger().info("[AuthLimbo][debug] Chunk-ticket added "
|
||||
+ key + " for " + name);
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
plugin.getLogger().warning("[LoginLimbo] addPluginChunkTicket failed for "
|
||||
plugin.getLogger().warning("[AuthLimbo] addPluginChunkTicket failed for "
|
||||
+ name + ": " + t.getMessage());
|
||||
activeTickets.remove(key);
|
||||
}
|
||||
|
|
@ -102,7 +102,7 @@ public final class LoginListener implements Listener {
|
|||
|
||||
final Location saved = db.getQuitLocation(name);
|
||||
if (saved == null) {
|
||||
plugin.getLogger().info("[LoginLimbo] No saved location for "
|
||||
plugin.getLogger().info("[AuthLimbo] No saved location for "
|
||||
+ name + " — leaving where AuthMe put them.");
|
||||
return;
|
||||
}
|
||||
|
|
@ -116,19 +116,19 @@ public final class LoginListener implements Listener {
|
|||
|
||||
private void doTeleport(Player player, String name, Location saved) {
|
||||
if (!player.isOnline()) {
|
||||
plugin.getLogger().info("[LoginLimbo] " + name
|
||||
plugin.getLogger().info("[AuthLimbo] " + name
|
||||
+ " went offline before restore — skipping.");
|
||||
return;
|
||||
}
|
||||
World world = saved.getWorld();
|
||||
if (world == null) {
|
||||
plugin.getLogger().warning("[LoginLimbo] Saved world for "
|
||||
plugin.getLogger().warning("[AuthLimbo] Saved world for "
|
||||
+ name + " is no longer loaded.");
|
||||
return;
|
||||
}
|
||||
|
||||
plugin.getLogger().info(String.format(
|
||||
"[LoginLimbo] Restoring %s to %s(%.1f, %.1f, %.1f)",
|
||||
"[AuthLimbo] Restoring %s to %s(%.1f, %.1f, %.1f)",
|
||||
name, world.getName(), saved.getX(), saved.getY(), saved.getZ()));
|
||||
|
||||
final int cx = saved.getBlockX() >> 4;
|
||||
|
|
@ -151,10 +151,10 @@ public final class LoginListener implements Listener {
|
|||
.thenAccept(success -> {
|
||||
if (Boolean.TRUE.equals(success)) {
|
||||
if (plugin.debug()) {
|
||||
plugin.getLogger().info("[LoginLimbo][debug] Teleport ok for " + name);
|
||||
plugin.getLogger().info("[AuthLimbo][debug] Teleport ok for " + name);
|
||||
}
|
||||
} else {
|
||||
plugin.getLogger().warning("[LoginLimbo] teleportAsync returned false for "
|
||||
plugin.getLogger().warning("[AuthLimbo] teleportAsync returned false for "
|
||||
+ name + " — Paper may have rejected the location.");
|
||||
}
|
||||
// Release the ticket 5s later — gives the client time to
|
||||
|
|
@ -162,13 +162,13 @@ public final class LoginListener implements Listener {
|
|||
scheduleTicketRelease(world, cx, cz, key);
|
||||
})
|
||||
.exceptionally(ex -> {
|
||||
plugin.getLogger().warning("[LoginLimbo] teleportAsync threw for "
|
||||
plugin.getLogger().warning("[AuthLimbo] teleportAsync threw for "
|
||||
+ name + ": " + ex.getMessage());
|
||||
scheduleTicketRelease(world, cx, cz, key);
|
||||
return null;
|
||||
});
|
||||
}).exceptionally(ex -> {
|
||||
plugin.getLogger().warning("[LoginLimbo] getChunkAtAsyncUrgently threw for "
|
||||
plugin.getLogger().warning("[AuthLimbo] getChunkAtAsyncUrgently threw for "
|
||||
+ name + ": " + ex.getMessage());
|
||||
scheduleTicketRelease(world, cx, cz, key);
|
||||
return null;
|
||||
|
|
@ -185,7 +185,7 @@ public final class LoginListener implements Listener {
|
|||
} finally {
|
||||
activeTickets.remove(key);
|
||||
if (plugin.debug()) {
|
||||
plugin.getLogger().info("[LoginLimbo][debug] Chunk-ticket released " + key);
|
||||
plugin.getLogger().info("[AuthLimbo][debug] Chunk-ticket released " + key);
|
||||
}
|
||||
}
|
||||
}, 20L * 5L);
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package ru.loginlimbo;
|
||||
package ru.authlimbo;
|
||||
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
import org.bukkit.generator.WorldInfo;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
# LoginLimbo configuration
|
||||
# AuthLimbo configuration
|
||||
|
||||
# Limbo world settings — pre-auth players are kept here.
|
||||
limbo:
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
name: LoginLimbo
|
||||
main: ru.loginlimbo.LoginLimbo
|
||||
name: AuthLimbo
|
||||
main: ru.authlimbo.AuthLimbo
|
||||
version: ${project.version}
|
||||
api-version: '1.21'
|
||||
authors: [s8n / racked.ru]
|
||||
authors: [s8n-ru]
|
||||
description: AuthMe-aware void limbo + reliable post-login teleport.
|
||||
website: https://racked.ru/
|
||||
website: https://github.com/s8n-ru/auth-limbo
|
||||
|
||||
# Hard depend on AuthMe — we listen to fr.xephi.authme.events.LoginEvent
|
||||
# so AuthMe must be present and load first.
|
||||
|
|
@ -17,13 +17,13 @@ softdepend:
|
|||
- VoidWorldGenerator
|
||||
|
||||
commands:
|
||||
loginlimbo:
|
||||
description: LoginLimbo admin commands.
|
||||
aliases: [llimbo]
|
||||
permission: loginlimbo.admin
|
||||
usage: /loginlimbo <reload|tp <player>>
|
||||
authlimbo:
|
||||
description: AuthLimbo admin commands.
|
||||
aliases: [alimbo]
|
||||
permission: authlimbo.admin
|
||||
usage: /authlimbo <reload|tp <player>>
|
||||
|
||||
permissions:
|
||||
loginlimbo.admin:
|
||||
description: Manage LoginLimbo at runtime.
|
||||
authlimbo.admin:
|
||||
description: Manage AuthLimbo at runtime.
|
||||
default: op
|
||||
|
|
|
|||
Loading…
Reference in a new issue