Compare commits
84 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1c25908a04 | |||
| 84a8137955 | |||
| 038d4c1850 | |||
| 0ffe2c2fc9 | |||
| 401933038d | |||
| 5cf88f308a | |||
| 29df796c48 | |||
| 79af85667e | |||
| 57237f6dfa | |||
| fc86e3ef78 | |||
| 846b7f67e5 | |||
| ffe3f5d24a | |||
| 2db1a15c72 | |||
| 95342ae054 | |||
| 6800356f10 | |||
| 95b5d88197 | |||
| 9f6f55d8e8 | |||
| d1ebcfeef0 | |||
| 5305bf0bfd | |||
| 78c5ab5d8a | |||
| 836c568fef | |||
| 7cbd1ebae7 | |||
| a35a277b32 | |||
| 971f0f7683 | |||
| d2718c1934 | |||
| 0cdd2b20d6 | |||
| 66b2bf8436 | |||
| cf01767ad3 | |||
| fdefdb88cc | |||
| 4bcc992b7f | |||
| 35aba2207b | |||
| ce2ee9e0fb | |||
| 9093ad2d9f | |||
| 08ed6504f2 | |||
| 9f70748b55 | |||
| 3f6a7ce48f | |||
| ed320196fe | |||
| 62f27f8231 | |||
| c3485903c5 | |||
| 5f3089b61b | |||
| e8f42ab669 | |||
| e3ff584bf4 | |||
| a9116a2f28 | |||
| ddd8c44396 | |||
| 6edcfa993e | |||
| e63764e2cf | |||
| 63540088c9 | |||
| 8e760e504e | |||
| bf3553df68 | |||
| 44e4937d16 | |||
| 280bb2bdcc | |||
| c0da109dea | |||
| b455d0a200 | |||
| 2f9d11e1d5 | |||
| ab85429b4c | |||
| 145dbd46f0 | |||
| 8e451b0642 | |||
| b12070a517 | |||
| 3950b3034c | |||
| 47ae657c80 | |||
| 87ef1ab8ed | |||
| a6bd4f59cb | |||
| ac610ad552 | |||
| d9204afdc9 | |||
| 69abbc308a | |||
| 06f2b0c49e | |||
| 47b0e6e744 | |||
| 4533f52016 | |||
| ae36036874 | |||
| 6f19a5442f | |||
| 3019e33945 | |||
| 7e49e26735 | |||
| b014da245d | |||
| 912e607144 | |||
| af71f9f5fe | |||
| 53d4206271 | |||
| 110fc7266d | |||
| b1bee0967c | |||
| e9481db633 | |||
| 82f29af1ae | |||
| 7e5d9ed1e8 | |||
| 55152a62c4 | |||
| 1b12d1b7d5 | |||
| 527f7f21c7 |
@@ -1 +1 @@
|
|||||||
blank_issues_enabled: false
|
blank_issues_enabled: false
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
|
|
||||||
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
|
|
||||||
|
|
||||||
name: Maven Package
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [created]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: Set up JDK 11
|
|
||||||
uses: actions/setup-java@v3
|
|
||||||
with:
|
|
||||||
java-version: '11'
|
|
||||||
distribution: 'temurin'
|
|
||||||
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
|
|
||||||
settings-path: ${{ github.workspace }} # location for the settings.xml file
|
|
||||||
|
|
||||||
- name: Build with Maven
|
|
||||||
run: mvn -B package --file pom.xml
|
|
||||||
|
|
||||||
- name: Publish to GitHub Packages Apache Maven
|
|
||||||
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
@@ -20,5 +20,4 @@ jobs:
|
|||||||
java-version: ${{ matrix.jdkversion }}
|
java-version: ${{ matrix.jdkversion }}
|
||||||
cache: 'maven'
|
cache: 'maven'
|
||||||
- name: 使用Maven构建
|
- name: 使用Maven构建
|
||||||
run: mvn -V -B clean package --file pom.xml
|
run: mvn -V -B clean package --file pom.xml
|
||||||
|
|
||||||
+1
-1
@@ -24,7 +24,7 @@ hs_err_pid*
|
|||||||
|
|
||||||
# Include the project's code style settings file
|
# Include the project's code style settings file
|
||||||
!.idea/codeStyleSettings.xml
|
!.idea/codeStyleSettings.xml
|
||||||
/target/class/
|
|
||||||
# File-based project format:
|
# File-based project format:
|
||||||
*.ipr
|
*.ipr
|
||||||
*.iws
|
*.iws
|
||||||
|
|||||||
Generated
+3
@@ -0,0 +1,3 @@
|
|||||||
|
# 默认忽略的文件
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
@@ -1,144 +1,17 @@
|
|||||||
# AuthMeReReloaded
|
# AuthMeReReloaded
|
||||||
**"A Fork of Authme that contains many bug fixes!"**
|
**"A fork of the best authentication plugin for the Bukkit modding API!"**
|
||||||
**请前往Releases下载最新版本**
|
|
||||||
<img src="wallpaper.png?raw=true" alt="AuthMeLogo"/>
|
|
||||||
|
|
||||||
| Type | Badges |
|

|
||||||
|-------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| **General:** |   |
|
|
||||||
| **代码质量:** | [](https://codeclimate.com/github/AuthMe/AuthMeReloaded) [](https://coveralls.io/github/AuthMe-Team/AuthMeReloaded?branch=master) |
|
|
||||||
| **Jenkins CI:** | [](https://ci.codemc.org/) [](https://ci.codemc.org/job/AuthMe/job/AuthMeReloaded)  |
|
|
||||||
| **Other CIs:** | [](https://www.travis-ci.com/AuthMe/AuthMeReloaded) |
|
|
||||||
|
|
||||||
## Description
|
**Detailed Changes:**
|
||||||
|
1. Improved mail sending logic & support more emails
|
||||||
Prevent username stealing on your server!<br>
|
2. Shutdown mail sending(When server is closed, email you)
|
||||||
Use it to secure your Offline mode server or to increase your Online mode server's protection!
|
3. Old bug fixes
|
||||||
|
4. Anti Ghost Player(Doubled login bug)
|
||||||
AuthMeReloaded disallows players who aren't authenticated to do actions like placing blocks, moving,<br>
|
5. Use the best performance method by server brand
|
||||||
typing commands or using the inventory. It can also kick players with uncommonly long or short player names or kick players from banned countries.
|
6. Bedrock Compatibility(Floodgate needed)
|
||||||
|
7. Update checker
|
||||||
With the Session Login feature you don't have to execute the authentication command every time you connect to the server!
|
8. Integrated GUI Captcha feature(Bedrock compatibility & ProtocolLib needed)(70% Asynchronous)
|
||||||
Each command and every feature can be enabled or disabled from our well structured configuration file.
|
9. Improved listeners
|
||||||
|
10. Player login logic improvement to reduce lag
|
||||||
You can also create your own translation file and, if you want, you can share it with us! :)
|
11. More......
|
||||||
|
|
||||||
#### Features:
|
|
||||||
<ul>
|
|
||||||
<li><strong>E-Mail Recovery System!</strong></li>
|
|
||||||
<li>Username spoofing protection.</li>
|
|
||||||
<li>Countries Whitelist/Blacklist! <a href="https://dev.maxmind.com/geoip/legacy/codes/iso3166/">(country codes)</a></li>
|
|
||||||
<li><strong>Built-in AntiBot System!</strong></li>
|
|
||||||
<li><strong>ForceLogin Feature: Admins can login with all account via console command!</strong></li>
|
|
||||||
<li><strong>Avoid the "Logged in from another location" message!</strong></li>
|
|
||||||
<li>Two-factor (2FA) support!</li>
|
|
||||||
<li>Session Login!</li>
|
|
||||||
<li>Editable translations and messages!</li>
|
|
||||||
<li><strong>MySQL and SQLite Backend support!</strong></li>
|
|
||||||
<li>Supported password encryption algorithms: SHA256, ARGON2, BCRYPT, PBKDF2, <a href="https://github.com/CypherX/xAuth/wiki/Password-Hashing">xAuth</a></li>
|
|
||||||
<li>Supported alternative registration methods:<br>
|
|
||||||
<ul>
|
|
||||||
<li>PHPBB, VBulletin: PHPBB - MD5VB</li>
|
|
||||||
<li>Xenforo: XFBCRYPT</li>
|
|
||||||
<li>MyBB: MYBB</li>
|
|
||||||
<li>IPB3: IPB3</li>
|
|
||||||
<li>IPB4: IPB4</li>
|
|
||||||
<li>PhpFusion: PHPFUSION</li>
|
|
||||||
<li>Joomla: JOOMLA</li>
|
|
||||||
<li>WBB3: WBB3*</li>
|
|
||||||
<li>SHA512: SALTEDSHA512</li>
|
|
||||||
<li>DoubleSaltedMD5: SALTED2MD5</li>
|
|
||||||
<li>WordPress: WORDPRESS</li>
|
|
||||||
<li><a href="https://github.com/AuthMe/AuthMeReloaded/blob/master/docs/hash_algorithms.md">List of all supported hashes</a></li>
|
|
||||||
</ul></li>
|
|
||||||
<li>Custom MySQL tables/columns names (useful with forum databases)</li>
|
|
||||||
<li><strong>Cached database queries!</strong></li>
|
|
||||||
<li><strong>Fully compatible with Citizens2, CombatTag, CombatTagPlus!</strong></li>
|
|
||||||
<li>Compatible with Minecraft mods like <strong>BuildCraft or RedstoneCraft</strong></li>
|
|
||||||
<li>Restricted users (associate a username with an IP)</li>
|
|
||||||
<li>Protect player's inventory until correct authentication (requires ProtocolLib)</li>
|
|
||||||
<li>Saves the quit location of the player</li>
|
|
||||||
<li>Automatic database backup</li>
|
|
||||||
<li>Available languages: <a href="https://github.com/AuthMe/AuthMeReloaded/blob/master/docs/translations.md">translations</a></li>
|
|
||||||
<li>Built-in Deprecated FlatFile (auths.db) to SQL (authme.sql) converter!</li>
|
|
||||||
<li><strong>Import your old database from other plugins like Rakamak, xAuth, CrazyLogin, RoyalAuth and vAuth!</strong></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
#### Configuration
|
|
||||||
[How to configure AuthMe](https://github.com/AuthMe/AuthMeReloaded/blob/master/docs/config.md)
|
|
||||||
#### Commands
|
|
||||||
[Command list and usage](https://github.com/AuthMe/AuthMeReloaded/blob/master/docs/commands.md)
|
|
||||||
#### Permissions
|
|
||||||
- authme.player.* - for all user commands
|
|
||||||
- authme.admin.* - for all admin commands
|
|
||||||
- [List of all permission nodes](http://github.com/AuthMe/AuthMeReloaded/blob/master/docs/permission_nodes.md)
|
|
||||||
|
|
||||||
#### How To
|
|
||||||
- [How to use the converter](https://github.com/AuthMe/AuthMeReloaded/wiki/Converters)
|
|
||||||
- [How to import database from xAuth](https://dev.bukkit.org/projects/authme-reloaded/pages/how-to-import-database-from-xauth)
|
|
||||||
- [Website integration](https://github.com/AuthMe/AuthMeReloaded/tree/master/samples/website_integration)
|
|
||||||
- [How to convert from Rakamak](https://dev.bukkit.org/projects/authme-reloaded/pages/how-to-import-database-from-rakamak)
|
|
||||||
- Convert between database types (e.g. SQLite to MySQL): /authme converter
|
|
||||||
|
|
||||||
|
|
||||||
## Links and Contacts
|
|
||||||
|
|
||||||
- **Support:**
|
|
||||||
- [GitHub issue tracker](https://github.com/AuthMe/AuthMeReloaded/issues)
|
|
||||||
- [Discord](https://discord.gg/Vn9eCyE)
|
|
||||||
- [BukkitDev page](https://dev.bukkit.org/projects/authme-reloaded)
|
|
||||||
- [Spigot page](https://www.spigotmc.org/resources/authmereloaded.6269/)
|
|
||||||
|
|
||||||
- **Dev resources:**
|
|
||||||
- <a href="https://ci.codemc.org/job/AuthMe/job/AuthMeReloaded/javadoc/">JavaDocs</a>
|
|
||||||
- <a href="http://repo.codemc.org/repository/maven-public/">Maven Repository</a>
|
|
||||||
```xml
|
|
||||||
<repositories>
|
|
||||||
<repository>
|
|
||||||
<id>codemc-repo</id>
|
|
||||||
<url>https://repo.codemc.org/repository/maven-public/</url>
|
|
||||||
</repository>
|
|
||||||
</repositories>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>fr.xephi</groupId>
|
|
||||||
<artifactId>authme</artifactId>
|
|
||||||
<version>5.6.0-SNAPSHOT</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
```
|
|
||||||
|
|
||||||
- **Statistics:**
|
|
||||||

|
|
||||||
|
|
||||||
## Requirements
|
|
||||||
|
|
||||||
##### Compiling requirements:
|
|
||||||
>- JDK 11 (JDK 17 is recommended)
|
|
||||||
>- Maven
|
|
||||||
>- Git/Github (Optional)
|
|
||||||
|
|
||||||
##### How to compile the project:
|
|
||||||
>- Clone the project with Git/GitHub
|
|
||||||
>- Execute command "mvn clean package"
|
|
||||||
|
|
||||||
##### Running requirements:
|
|
||||||
>- Java 8 (Java 17 is recommended)
|
|
||||||
>- Paper or Spigot (1.8.X and up)<br>
|
|
||||||
(In case you use Thermos, Cauldron or similar, you have to update the SpecialSource library to support Java 8 plugins.
|
|
||||||
HowTo: https://github.com/games647/FastLogin/issues/111#issuecomment-272331347)
|
|
||||||
>- ProtocolLib (optional, required by some features)
|
|
||||||
|
|
||||||
## Credits
|
|
||||||
|
|
||||||
##### Contributors:
|
|
||||||
Team members: <a href="https://github.com/AuthMe/AuthMeReloaded/wiki/Development-team">developers</a>, <a href="https://github.com/AuthMe/AuthMeReloaded/wiki/Translators">translators</a>
|
|
||||||
|
|
||||||
Credits for the old version of the plugin: d4rkwarriors, fabe1337, Whoami2 and pomo4ka
|
|
||||||
|
|
||||||
Thanks also to: AS1LV3RN1NJA, Hoeze and eprimex
|
|
||||||
|
|
||||||
##### GeoIP License:
|
|
||||||
This product uses data from the GeoLite API created by MaxMind, available at https://www.maxmind.com
|
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
|
|
||||||
<groupId>fr.xephi</groupId>
|
<groupId>fr.xephi</groupId>
|
||||||
<artifactId>authme</artifactId>
|
<artifactId>authme</artifactId>
|
||||||
<version>5.6.0-SNAPSHOT</version>
|
<version>5.6.0-FORK</version>
|
||||||
|
|
||||||
<name>AuthMeReloaded</name>
|
<name>AuthMeReReloaded</name>
|
||||||
<description>The first authentication plugin for the Bukkit API!</description>
|
<description>Fork of the first authentication plugin for the Bukkit API!</description>
|
||||||
<inceptionYear>2013</inceptionYear>
|
<inceptionYear>2013</inceptionYear>
|
||||||
<url>https://github.com/AuthMe/AuthMeReloaded</url>
|
<url>https://github.com/AuthMe/AuthMeReloaded</url>
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
<maven.minimumVersion>3.6.3</maven.minimumVersion>
|
<maven.minimumVersion>3.6.3</maven.minimumVersion>
|
||||||
|
|
||||||
<!-- Dependencies versions -->
|
<!-- Dependencies versions -->
|
||||||
<spigot.version>1.19.2-R0.1-SNAPSHOT</spigot.version>
|
<spigot.version>1.20.1-R0.1-SNAPSHOT</spigot.version>
|
||||||
|
|
||||||
<!-- Versioning properties -->
|
<!-- Versioning properties -->
|
||||||
<project.outputName>AuthMe</project.outputName>
|
<project.outputName>AuthMe</project.outputName>
|
||||||
@@ -324,7 +324,7 @@
|
|||||||
<goal>shade</goal>
|
<goal>shade</goal>
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<finalName>${project.finalNameBase}-legacy</finalName>
|
<finalName>${project.finalNameBase}-Spigot-Universal</finalName>
|
||||||
<relocations>
|
<relocations>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>com.google.common</pattern>
|
<pattern>com.google.common</pattern>
|
||||||
@@ -706,7 +706,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.mysql</groupId>
|
<groupId>com.mysql</groupId>
|
||||||
<artifactId>mysql-connector-j</artifactId>
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
<version>8.0.32</version>
|
<version>8.0.33</version>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -757,7 +757,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.guava</groupId>
|
<groupId>com.google.guava</groupId>
|
||||||
<artifactId>guava</artifactId>
|
<artifactId>guava</artifactId>
|
||||||
<version>31.0.1-jre</version>
|
<version>31.1-jre</version>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
@@ -770,7 +770,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.code.gson</groupId>
|
<groupId>com.google.code.gson</groupId>
|
||||||
<artifactId>gson</artifactId>
|
<artifactId>gson</artifactId>
|
||||||
<version>2.8.9</version>
|
<version>2.10.1</version>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
@@ -780,7 +780,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>ch.jalu</groupId>
|
<groupId>ch.jalu</groupId>
|
||||||
<artifactId>configme</artifactId>
|
<artifactId>configme</artifactId>
|
||||||
<version>1.3.0</version>
|
<version>1.3.1</version>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
@@ -794,7 +794,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bstats</groupId>
|
<groupId>org.bstats</groupId>
|
||||||
<artifactId>bstats-bukkit</artifactId>
|
<artifactId>bstats-bukkit</artifactId>
|
||||||
<version>3.0.0</version>
|
<version>3.0.1</version>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
@@ -802,7 +802,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.comphenix.protocol</groupId>
|
<groupId>com.comphenix.protocol</groupId>
|
||||||
<artifactId>ProtocolLib</artifactId>
|
<artifactId>ProtocolLib</artifactId>
|
||||||
<version>4.8.0</version>
|
<version>5.1.0</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
@@ -945,7 +945,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.essentialsx</groupId>
|
<groupId>net.essentialsx</groupId>
|
||||||
<artifactId>EssentialsX</artifactId>
|
<artifactId>EssentialsX</artifactId>
|
||||||
<version>2.19.7</version>
|
<version>2.20.1</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
@@ -1068,7 +1068,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.xerial</groupId>
|
<groupId>org.xerial</groupId>
|
||||||
<artifactId>sqlite-jdbc</artifactId>
|
<artifactId>sqlite-jdbc</artifactId>
|
||||||
<version>3.39.3.0</version>
|
<version>3.40.1.0</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -9,6 +9,11 @@ import fr.xephi.authme.initialization.DataFolder;
|
|||||||
import fr.xephi.authme.initialization.DataSourceProvider;
|
import fr.xephi.authme.initialization.DataSourceProvider;
|
||||||
import fr.xephi.authme.initialization.OnShutdownPlayerSaver;
|
import fr.xephi.authme.initialization.OnShutdownPlayerSaver;
|
||||||
import fr.xephi.authme.initialization.OnStartupTasks;
|
import fr.xephi.authme.initialization.OnStartupTasks;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
|
||||||
import fr.xephi.authme.initialization.SettingsProvider;
|
import fr.xephi.authme.initialization.SettingsProvider;
|
||||||
import fr.xephi.authme.initialization.TaskCloser;
|
import fr.xephi.authme.initialization.TaskCloser;
|
||||||
import fr.xephi.authme.listener.BlockListener;
|
import fr.xephi.authme.listener.BlockListener;
|
||||||
@@ -17,6 +22,8 @@ import fr.xephi.authme.listener.PlayerListener;
|
|||||||
import fr.xephi.authme.listener.PlayerListener111;
|
import fr.xephi.authme.listener.PlayerListener111;
|
||||||
import fr.xephi.authme.listener.PlayerListener19;
|
import fr.xephi.authme.listener.PlayerListener19;
|
||||||
import fr.xephi.authme.listener.PlayerListener19Spigot;
|
import fr.xephi.authme.listener.PlayerListener19Spigot;
|
||||||
|
import fr.xephi.authme.listener.DoubleLoginFixListener;
|
||||||
|
import fr.xephi.authme.listener.GuiCaptchaHandler;
|
||||||
import fr.xephi.authme.listener.ServerListener;
|
import fr.xephi.authme.listener.ServerListener;
|
||||||
import fr.xephi.authme.mail.EmailService;
|
import fr.xephi.authme.mail.EmailService;
|
||||||
import fr.xephi.authme.output.ConsoleLoggerFactory;
|
import fr.xephi.authme.output.ConsoleLoggerFactory;
|
||||||
@@ -33,19 +40,23 @@ import fr.xephi.authme.settings.properties.SecuritySettings;
|
|||||||
import fr.xephi.authme.task.CleanupTask;
|
import fr.xephi.authme.task.CleanupTask;
|
||||||
import fr.xephi.authme.task.purge.PurgeService;
|
import fr.xephi.authme.task.purge.PurgeService;
|
||||||
import fr.xephi.authme.util.ExceptionUtils;
|
import fr.xephi.authme.util.ExceptionUtils;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.scheduler.BukkitScheduler;
|
import org.bukkit.scheduler.BukkitScheduler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.io.File;
|
import javax.inject.Inject;
|
||||||
|
import java.net.URL;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Objects;
|
import java.util.Scanner;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import static fr.xephi.authme.service.BukkitService.TICKS_PER_MINUTE;
|
import static fr.xephi.authme.service.BukkitService.TICKS_PER_MINUTE;
|
||||||
import static fr.xephi.authme.util.Utils.isClassLoaded;
|
import static fr.xephi.authme.util.Utils.isClassLoaded;
|
||||||
@@ -61,25 +72,27 @@ public class AuthMe extends JavaPlugin {
|
|||||||
private static final int CLEANUP_INTERVAL = 5 * TICKS_PER_MINUTE;
|
private static final int CLEANUP_INTERVAL = 5 * TICKS_PER_MINUTE;
|
||||||
|
|
||||||
// Version and build number values
|
// Version and build number values
|
||||||
private static String pluginVersion = "5.6.0";
|
private static String pluginVersion = "5.6.0-Fork";
|
||||||
private static String pluginBuildNumber = "Custom";
|
private static final String pluginBuild = "b";
|
||||||
|
private static String pluginBuildNumber = "23";
|
||||||
|
protected final Boolean SHAEnabled = false;
|
||||||
// Private instances
|
// Private instances
|
||||||
private EmailService emailService;
|
private EmailService emailService;
|
||||||
private CommandHandler commandHandler;
|
private CommandHandler commandHandler;
|
||||||
private Settings settings;
|
@Inject
|
||||||
|
public static Settings settings;
|
||||||
private DataSource database;
|
private DataSource database;
|
||||||
private BukkitService bukkitService;
|
private BukkitService bukkitService;
|
||||||
private Injector injector;
|
private Injector injector;
|
||||||
private BackupService backupService;
|
private BackupService backupService;
|
||||||
private ConsoleLogger logger;
|
public static ConsoleLogger logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*/
|
*/
|
||||||
public AuthMe() {
|
public AuthMe() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the plugin's name.
|
* Get the plugin's name.
|
||||||
*
|
*
|
||||||
@@ -107,6 +120,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
return pluginBuildNumber;
|
return pluginBuildNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method called when the server enables the plugin.
|
* Method called when the server enables the plugin.
|
||||||
*/
|
*/
|
||||||
@@ -118,6 +132,8 @@ public class AuthMe extends JavaPlugin {
|
|||||||
// Set the Logger instance and log file path
|
// Set the Logger instance and log file path
|
||||||
ConsoleLogger.initialize(getLogger(), new File(getDataFolder(), LOG_FILENAME));
|
ConsoleLogger.initialize(getLogger(), new File(getDataFolder(), LOG_FILENAME));
|
||||||
logger = ConsoleLoggerFactory.get(AuthMe.class);
|
logger = ConsoleLoggerFactory.get(AuthMe.class);
|
||||||
|
logger.info("You are running an unofficial fork version of AuthMe!");
|
||||||
|
|
||||||
|
|
||||||
// Check server version
|
// Check server version
|
||||||
if (!isClassLoaded("org.spigotmc.event.player.PlayerSpawnLocationEvent")
|
if (!isClassLoaded("org.spigotmc.event.player.PlayerSpawnLocationEvent")
|
||||||
@@ -146,7 +162,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
th.printStackTrace();
|
th.printStackTrace();
|
||||||
} else {
|
} else {
|
||||||
logger.logException("File '" + yamlParseException.getFile() + "' contains invalid YAML. "
|
logger.logException("File '" + yamlParseException.getFile() + "' contains invalid YAML. "
|
||||||
+ "Please run its contents through https://yamllint.com", yamlParseException);
|
+ "Please run its contents through http://yamllint.com", yamlParseException);
|
||||||
}
|
}
|
||||||
stopOrUnload();
|
stopOrUnload();
|
||||||
return;
|
return;
|
||||||
@@ -158,26 +174,65 @@ public class AuthMe extends JavaPlugin {
|
|||||||
// Schedule clean up task
|
// Schedule clean up task
|
||||||
CleanupTask cleanupTask = injector.getSingleton(CleanupTask.class);
|
CleanupTask cleanupTask = injector.getSingleton(CleanupTask.class);
|
||||||
cleanupTask.runTaskTimerAsynchronously(this, CLEANUP_INTERVAL, CLEANUP_INTERVAL);
|
cleanupTask.runTaskTimerAsynchronously(this, CLEANUP_INTERVAL, CLEANUP_INTERVAL);
|
||||||
|
|
||||||
// Do a backup on start
|
// Do a backup on start
|
||||||
backupService.doBackup(BackupService.BackupCause.START);
|
backupService.doBackup(BackupService.BackupCause.START);
|
||||||
|
|
||||||
// Set up Metrics
|
// Set up Metrics
|
||||||
OnStartupTasks.sendMetrics(this, settings);
|
OnStartupTasks.sendMetrics(this, settings);
|
||||||
|
if(settings.getProperty(SecuritySettings.SHOW_STARTUP_BANNER)) {
|
||||||
|
String loadColorConfig = settings.getProperty(SecuritySettings.STARTUP_BANNER_COLOR);
|
||||||
|
if (loadColorConfig.startsWith("§")) {
|
||||||
|
logger.info("\n" + loadColorConfig + " ___ __ __ __ ___ \n" +
|
||||||
|
loadColorConfig + " / | __ __/ /_/ /_ / |/ /__ \n" +
|
||||||
|
loadColorConfig + " / /| |/ / / / __/ __ \\/ /|_/ / _ \\\n" +
|
||||||
|
loadColorConfig + " / ___ / /_/ / /_/ / / / / / / __/\n" +
|
||||||
|
loadColorConfig + "/_/ |_\\__,_/\\__/_/ /_/_/ /_/\\___/ \n" +
|
||||||
|
loadColorConfig + " ");
|
||||||
|
}else {
|
||||||
|
logger.info("\n"+" ___ __ __ __ ___ \n" +
|
||||||
|
" / | __ __/ /_/ /_ / |/ /__ \n" +
|
||||||
|
" / /| |/ / / / __/ __ \\/ /|_/ / _ \\\n" +
|
||||||
|
" / ___ / /_/ / /_/ / / / / / / __/\n" +
|
||||||
|
"/_/ |_\\__,_/\\__/_/ /_/_/ /_/\\___/ \n" +
|
||||||
|
" ");
|
||||||
|
}
|
||||||
|
}
|
||||||
// Successful message
|
// Successful message
|
||||||
logger.info("AuthMeReloaded successfully enabled!");
|
//detect server brand with classloader
|
||||||
|
checkServerType();
|
||||||
|
logger.info("AuthMeReReloaded is enabled successfully!");
|
||||||
// Purge on start if enabled
|
// Purge on start if enabled
|
||||||
PurgeService purgeService = injector.getSingleton(PurgeService.class);
|
PurgeService purgeService = injector.getSingleton(PurgeService.class);
|
||||||
purgeService.runAutoPurge();
|
purgeService.runAutoPurge();
|
||||||
}
|
// 注册玩家加入事件监听
|
||||||
|
// if (settings.getProperty(SecuritySettings.ANTI_GHOST_PLAYERS) || settings.getProperty(SecuritySettings.SMART_ASYNC_TELEPORT)/* || settings.getProperty(SecuritySettings.GUI_CAPTCHA)*/) {
|
||||||
|
if (settings.getProperty(SecuritySettings.ANTI_GHOST_PLAYERS)) {
|
||||||
|
getServer().getPluginManager().registerEvents(new DoubleLoginFixListener((Plugin) this), this);
|
||||||
|
}
|
||||||
|
if (settings.getProperty(SecuritySettings.GUI_CAPTCHA) && getServer().getPluginManager().isPluginEnabled("ProtocolLib")) {
|
||||||
|
getServer().getPluginManager().registerEvents(new GuiCaptchaHandler((Plugin) this), this);
|
||||||
|
logger.info("(Alpha4)GUICaptcha Feature is enabled successfully!");
|
||||||
|
logger.info("These features are still in development, if you encountered any problem, please report.");
|
||||||
|
} else if (settings.getProperty(SecuritySettings.GUI_CAPTCHA) && !getServer().getPluginManager().isPluginEnabled("ProtocolLib")) {
|
||||||
|
logger.warning("ProtocolLib is not loaded, we can't enable GUI Captcha.");
|
||||||
|
}
|
||||||
|
logger.info("GitHub: https://github.com/HaHaWTH/AuthMeReReloaded/");
|
||||||
|
|
||||||
|
if (settings.getProperty(SecuritySettings.CHECK_FOR_UPDATES)) {
|
||||||
|
checkForUpdates();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SHAEnabled){
|
||||||
|
//shaChecker();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public File pluginfile = getFile();
|
||||||
/**
|
/**
|
||||||
* Load the version and build number of the plugin from the description file.
|
* Load the version and build number of the plugin from the description file.
|
||||||
*
|
*
|
||||||
* @param versionRaw the version as given by the plugin description file
|
* @param versionRaw the version as given by the plugin description file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private static void loadPluginInfo(String versionRaw) {
|
private static void loadPluginInfo(String versionRaw) {
|
||||||
int index = versionRaw.lastIndexOf("-");
|
int index = versionRaw.lastIndexOf("-");
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
@@ -305,7 +360,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
onShutdownPlayerSaver.saveAllPlayers();
|
onShutdownPlayerSaver.saveAllPlayers();
|
||||||
}
|
}
|
||||||
if (settings.getProperty(EmailSettings.SHUTDOWN_MAIL)){
|
if (settings.getProperty(EmailSettings.SHUTDOWN_MAIL)){
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy'年'MM'月'dd'日' HH:mm:ss");
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy'.'MM'.'dd'.' HH:mm:ss");
|
||||||
Date date = new Date(System.currentTimeMillis());
|
Date date = new Date(System.currentTimeMillis());
|
||||||
emailService.sendShutDown(settings.getProperty(EmailSettings.SHUTDOWN_MAIL_ADDRESS),dateFormat.format(date));
|
emailService.sendShutDown(settings.getProperty(EmailSettings.SHUTDOWN_MAIL_ADDRESS),dateFormat.format(date));
|
||||||
}
|
}
|
||||||
@@ -320,9 +375,124 @@ public class AuthMe extends JavaPlugin {
|
|||||||
|
|
||||||
// Disabled correctly
|
// Disabled correctly
|
||||||
Consumer<String> infoLogMethod = logger == null ? getLogger()::info : logger::info;
|
Consumer<String> infoLogMethod = logger == null ? getLogger()::info : logger::info;
|
||||||
infoLogMethod.accept("AuthMe " + this.getDescription().getVersion() + " disabled!");
|
infoLogMethod.accept("AuthMe " + this.getDescription().getVersion() + " is unloaded successfully!");
|
||||||
ConsoleLogger.closeFileWriter();
|
ConsoleLogger.closeFileWriter();
|
||||||
}
|
}
|
||||||
|
private static final String owner = "HaHaWTH";
|
||||||
|
private static final String owner_gitee = "Shixuehan114514";
|
||||||
|
private static final String repo = "AuthMeReReloaded";
|
||||||
|
private void checkForUpdates() {
|
||||||
|
logger.info("Checking for updates...");
|
||||||
|
Bukkit.getScheduler().runTaskAsynchronously(this, () -> {
|
||||||
|
try {
|
||||||
|
// 从南通集线器获取最新版本号
|
||||||
|
|
||||||
|
URL url = new URL("https://api.github.com/repos/" + owner + "/" + repo + "/releases/latest");
|
||||||
|
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||||
|
conn.setConnectTimeout(10000); // 设置连接超时为10秒
|
||||||
|
conn.setReadTimeout(10000); // 设置读取超时为10秒
|
||||||
|
Scanner scanner = new Scanner(conn.getInputStream());
|
||||||
|
String response = scanner.useDelimiter("\\Z").next();
|
||||||
|
scanner.close();
|
||||||
|
|
||||||
|
// 处理JSON响应
|
||||||
|
String latestVersion = response.substring(response.indexOf("tag_name") + 11);
|
||||||
|
latestVersion = latestVersion.substring(0, latestVersion.indexOf("\""));
|
||||||
|
if ((pluginBuild + pluginBuildNumber).equals(latestVersion)) {
|
||||||
|
getLogger().log(Level.INFO,"You are running the latest version.");
|
||||||
|
}
|
||||||
|
if (!(pluginBuild + pluginBuildNumber).equals(latestVersion)) {
|
||||||
|
// Display update message
|
||||||
|
String message = "New version available! Latest:" + latestVersion + " Current:" + pluginBuild + pluginBuildNumber;
|
||||||
|
getLogger().log(Level.INFO, message);
|
||||||
|
getLogger().log(Level.INFO,"Download from here:github.com/HaHaWTH/AuthMeReReloaded/releases/latest");
|
||||||
|
}
|
||||||
|
}catch (IOException e) {
|
||||||
|
getLogger().log(Level.WARNING,"Error occurred while checking updates from GitHub. Reason: " + e.getMessage());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkServerType() {
|
||||||
|
if (isClassLoaded("com.destroystokyo.paper.PaperConfig")) {
|
||||||
|
logger.info("AuthMeReReloaded is running on Paper");
|
||||||
|
}else if (isClassLoaded("catserver.server.CatServerConfig")) {
|
||||||
|
logger.info("AuthMeReReloaded is running on CatServer");
|
||||||
|
} else if (isClassLoaded("org.spigotmc.SpigotConfig")) {
|
||||||
|
logger.info("AuthMeReReloaded is running on Spigot");
|
||||||
|
} else if (isClassLoaded("org.bukkit.craftbukkit.CraftServer")) {
|
||||||
|
logger.info("AuthMeReReloaded is running on Bukkit");
|
||||||
|
} else {
|
||||||
|
logger.info("AuthMeReReloaded is running on Unknown*");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 其他方法和事件处理
|
||||||
|
|
||||||
|
|
||||||
|
// 其他方法和事件处理
|
||||||
|
private static final String SHA_URL = "https://raw.githubusercontent.com/"+ owner +"/"+ repo + "/master/"+pluginBuild +pluginBuildNumber+ ".sha";
|
||||||
|
private static final String ALGORITHM = "SHA-256";
|
||||||
|
private static final String PROXY_URL = "https://ghproxy.com/";
|
||||||
|
private static final String SHA_URL_GITEE = "https://gitee.com/"+ owner_gitee +"/"+ repo + "/raw/master/"+pluginBuild+pluginBuildNumber+ ".sha";
|
||||||
|
|
||||||
|
// public void shaChecker() {
|
||||||
|
// // 请求SHA文件
|
||||||
|
//
|
||||||
|
// String actualSha;
|
||||||
|
// try {
|
||||||
|
// URL url;
|
||||||
|
// if(settings.getProperty(SecuritySettings.SHA_CHECK_METHOD).equals("github")) {
|
||||||
|
// url = new URL(SHA_URL);
|
||||||
|
// logger.info("正在检查文件完整性...(GitHub)");
|
||||||
|
// } else if(settings.getProperty(SecuritySettings.SHA_CHECK_METHOD).equals("ghproxy")) {
|
||||||
|
// url = new URL(PROXY_URL + SHA_URL);
|
||||||
|
// logger.info("正在检查文件完整性...(GhProxy)");
|
||||||
|
// } else if (settings.getProperty(SecuritySettings.SHA_CHECK_METHOD).equals("gitee")) {
|
||||||
|
// url = new URL(SHA_URL_GITEE);
|
||||||
|
// logger.info("正在检查文件完整性...(Gitee)");
|
||||||
|
// }else {
|
||||||
|
// logger.warning("未知的SHA检查方法,将从GitHub获取SHA文件");
|
||||||
|
// url = new URL(SHA_URL);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||||
|
// conn.setConnectTimeout(10000);
|
||||||
|
// conn.setReadTimeout(9000);
|
||||||
|
// conn.setRequestMethod("GET");
|
||||||
|
// InputStream stream = conn.getInputStream();
|
||||||
|
// ByteArrayOutputStream result = new ByteArrayOutputStream();
|
||||||
|
// byte[] buffer = new byte[1024];
|
||||||
|
// int length;
|
||||||
|
// while ((length = stream.read(buffer)) != -1) {
|
||||||
|
// result.write(buffer, 0, length);
|
||||||
|
// }
|
||||||
|
// String expectedSha = result.toString().trim();
|
||||||
|
// // 计算插件文件的SHA值
|
||||||
|
// MessageDigest md = MessageDigest.getInstance(ALGORITHM);
|
||||||
|
// byte[] fileBytes = Files.readAllBytes(pluginfile.toPath());
|
||||||
|
// byte[] hashBytes = md.digest(fileBytes);
|
||||||
|
// StringBuilder sb = new StringBuilder();
|
||||||
|
// for (byte b : hashBytes) {
|
||||||
|
// sb.append(String.format("%02x", b));
|
||||||
|
// }
|
||||||
|
// actualSha = sb.toString();
|
||||||
|
//
|
||||||
|
// // 比较SHA值并加载插件
|
||||||
|
// if (expectedSha.equals(actualSha)) {
|
||||||
|
// logger.info("SHA联网安全校验完毕");
|
||||||
|
// } else {
|
||||||
|
// // SHA值不匹配,插件可能被篡改
|
||||||
|
// logger.warning("SHA值不匹配,插件被篡改");
|
||||||
|
// stopOrUnload();
|
||||||
|
// }
|
||||||
|
// }catch (NoSuchAlgorithmException | IOException e){
|
||||||
|
// logger.warning("SHA校验失败,请尝试切换校验API");
|
||||||
|
// logger.warning("您当前请求的API为:" + settings.getProperty(SecuritySettings.SHA_CHECK_METHOD));
|
||||||
|
// stopOrUnload();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle Bukkit commands.
|
* Handle Bukkit commands.
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ public final class ConsoleLogger {
|
|||||||
public void fine(String message) {
|
public void fine(String message) {
|
||||||
if (logLevel.includes(LogLevel.FINE)) {
|
if (logLevel.includes(LogLevel.FINE)) {
|
||||||
logger.info(message);
|
logger.info(message);
|
||||||
writeLog("[FINE] " + message);
|
writeLog("[INFO:FINE] " + message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,7 +215,7 @@ public final class ConsoleLogger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void logAndWriteWithDebugPrefix(String message) {
|
private void logAndWriteWithDebugPrefix(String message) {
|
||||||
String debugMessage = "[DEBUG] " + message;
|
String debugMessage = "[INFO:DEBUG] " + message;
|
||||||
logger.info(debugMessage);
|
logger.info(debugMessage);
|
||||||
writeLog(debugMessage);
|
writeLog(debugMessage);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ public abstract class PlayerCommand implements ExecutableCommand {
|
|||||||
} else {
|
} else {
|
||||||
String alternative = getAlternativeCommand();
|
String alternative = getAlternativeCommand();
|
||||||
if (alternative != null) {
|
if (alternative != null) {
|
||||||
sender.sendMessage("Player only! Please use " + alternative + " instead.");
|
sender.sendMessage("此命令仅限玩家使用!请使用 " + alternative + " .");
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage("This command is only for players.");
|
sender.sendMessage("此命令只能被玩家执行.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
package fr.xephi.authme.command.executable.authme;
|
package fr.xephi.authme.command.executable.authme;
|
||||||
|
|
||||||
|
import fr.xephi.authme.ConsoleLogger;
|
||||||
import fr.xephi.authme.command.PlayerCommand;
|
import fr.xephi.authme.command.PlayerCommand;
|
||||||
|
import fr.xephi.authme.settings.Settings;
|
||||||
import fr.xephi.authme.settings.SpawnLoader;
|
import fr.xephi.authme.settings.SpawnLoader;
|
||||||
|
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||||
|
import fr.xephi.authme.util.TeleportUtils;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import fr.xephi.authme.AuthMe;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -11,16 +15,22 @@ import java.util.List;
|
|||||||
* Teleports the player to the first spawn.
|
* Teleports the player to the first spawn.
|
||||||
*/
|
*/
|
||||||
public class FirstSpawnCommand extends PlayerCommand {
|
public class FirstSpawnCommand extends PlayerCommand {
|
||||||
|
@Inject
|
||||||
|
private Settings settings;
|
||||||
@Inject
|
@Inject
|
||||||
private SpawnLoader spawnLoader;
|
private SpawnLoader spawnLoader;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void runCommand(Player player, List<String> arguments) {
|
public void runCommand(Player player, List<String> arguments) {
|
||||||
if (spawnLoader.getFirstSpawn() == null) {
|
if (spawnLoader.getFirstSpawn() == null) {
|
||||||
player.sendMessage("[AuthMe] First spawn has failed, please try to define the first spawn");
|
player.sendMessage("[AuthMe] First spawn has failed, please try to define the first spawn");
|
||||||
} else {
|
} else {
|
||||||
player.teleport(spawnLoader.getFirstSpawn());
|
//String name= player.getName();
|
||||||
|
if(settings.getProperty(SecuritySettings.SMART_ASYNC_TELEPORT)) {
|
||||||
|
TeleportUtils.teleport(player, spawnLoader.getFirstSpawn());
|
||||||
|
} else {
|
||||||
|
player.teleport(spawnLoader.getFirstSpawn());
|
||||||
|
}
|
||||||
|
//player.teleport(spawnLoader.getFirstSpawn());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -42,6 +42,12 @@ public class ChangePasswordCommand extends PlayerCommand {
|
|||||||
commonService.send(player, MessageKey.NOT_LOGGED_IN);
|
commonService.send(player, MessageKey.NOT_LOGGED_IN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// Check if the user has been verified or not
|
||||||
|
if (codeManager.isVerificationRequired(player)) {
|
||||||
|
codeManager.codeExistOrGenerateNew(name);
|
||||||
|
commonService.send(player, MessageKey.VERIFICATION_CODE_REQUIRED);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
String oldPassword = arguments.get(0);
|
String oldPassword = arguments.get(0);
|
||||||
String newPassword = arguments.get(1);
|
String newPassword = arguments.get(1);
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class OnStartupTasks {
|
|||||||
* @param settings the settings
|
* @param settings the settings
|
||||||
*/
|
*/
|
||||||
public static void sendMetrics(AuthMe plugin, Settings settings) {
|
public static void sendMetrics(AuthMe plugin, Settings settings) {
|
||||||
final Metrics metrics = new Metrics(plugin, 164);
|
final Metrics metrics = new Metrics(plugin, 18479);
|
||||||
|
|
||||||
metrics.addCustomChart(new SimplePie("messages_language",
|
metrics.addCustomChart(new SimplePie("messages_language",
|
||||||
() -> settings.getProperty(PluginSettings.MESSAGES_LANGUAGE)));
|
() -> settings.getProperty(PluginSettings.MESSAGES_LANGUAGE)));
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package fr.xephi.authme.listener;
|
||||||
|
//Prevent Ghost Players
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
public class DoubleLoginFixListener implements Listener {
|
||||||
|
private final Plugin plugin;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public DoubleLoginFixListener(Plugin plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
|
||||||
|
}
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
|
Collection<? extends Player> PlayerList = Bukkit.getServer().getOnlinePlayers();
|
||||||
|
HashSet<String> PlayerSet = new HashSet<String>();
|
||||||
|
for (Player ep : PlayerList) {
|
||||||
|
if (PlayerSet.contains(ep.getName().toLowerCase())) {
|
||||||
|
ep.kickPlayer("You have been disconnected due to doubled login.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
PlayerSet.add(ep.getName().toLowerCase());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,253 @@
|
|||||||
|
package fr.xephi.authme.listener;
|
||||||
|
import com.comphenix.protocol.PacketType;
|
||||||
|
import com.comphenix.protocol.ProtocolLibrary;
|
||||||
|
import com.comphenix.protocol.events.ListenerPriority;
|
||||||
|
import com.comphenix.protocol.events.PacketAdapter;
|
||||||
|
import com.comphenix.protocol.events.PacketEvent;
|
||||||
|
import fr.xephi.authme.AuthMe;
|
||||||
|
import fr.xephi.authme.api.v3.AuthMeApi;
|
||||||
|
import fr.xephi.authme.settings.properties.HooksSettings;
|
||||||
|
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
||||||
|
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
import org.bukkit.inventory.Inventory;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Random;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import static org.bukkit.Bukkit.getLogger;
|
||||||
|
import static org.bukkit.Bukkit.getServer;
|
||||||
|
public class GuiCaptchaHandler implements Listener {
|
||||||
|
//define AuthMeApi
|
||||||
|
private final AuthMeApi authmeApi = AuthMeApi.getInstance();
|
||||||
|
private final Plugin plugin;
|
||||||
|
|
||||||
|
|
||||||
|
//define timesLeft
|
||||||
|
public int timesLeft = 3;
|
||||||
|
//Use ConcurrentHashMap to store player and their close reason
|
||||||
|
/* We used many async tasks so there is concurrent**/
|
||||||
|
protected static ConcurrentHashMap<Player, String> closeReasonMap = new ConcurrentHashMap<>();
|
||||||
|
//define randomStringSet
|
||||||
|
String randomSet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz!@#%&*()_+";
|
||||||
|
String randomString = "";
|
||||||
|
Random randomItemSet = new Random();
|
||||||
|
Random howManyRandom = new Random();
|
||||||
|
|
||||||
|
|
||||||
|
int howLongIsRandomString = (howManyRandom.nextInt(3) + 1);
|
||||||
|
|
||||||
|
public GuiCaptchaHandler(Plugin plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onInventoryClick(InventoryClickEvent event) {
|
||||||
|
if (event.getWhoClicked() instanceof Player) {
|
||||||
|
Player player = (Player) event.getWhoClicked();
|
||||||
|
// 获取点击事件的容器
|
||||||
|
if (!authmeApi.isRegistered(player.getName()) && !closeReasonMap.containsKey(player)) {
|
||||||
|
if (AuthMe.settings.getProperty(HooksSettings.HOOK_FLOODGATE_PLAYER) && AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_BE_COMPATIBILITY) && org.geysermc.floodgate.api.FloodgateApi.getInstance().isFloodgateId(event.getWhoClicked().getUniqueId()) && (getServer().getPluginManager().isPluginEnabled("floodgate") || getServer().getPluginManager().getPlugin("floodgate") != null)) {
|
||||||
|
if (!closeReasonMap.containsKey(player)) {
|
||||||
|
closeReasonMap.put(player,"verified");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Objects.requireNonNull(event.getCurrentItem()).getType().equals(Material.REDSTONE_BLOCK)) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
closeReasonMap.put(player, "verified");
|
||||||
|
player.closeInventory();
|
||||||
|
player.sendMessage("§a验证完成");
|
||||||
|
} else {
|
||||||
|
player.sendMessage("§c验证失败,你还有" + timesLeft + "§c次机会");
|
||||||
|
timesLeft--;
|
||||||
|
}
|
||||||
|
//force to string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
|
||||||
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
|
randomString = "";
|
||||||
|
Player playerunreg = event.getPlayer();
|
||||||
|
String name = playerunreg.getName();
|
||||||
|
if (!authmeApi.isRegistered(name)) {
|
||||||
|
if (AuthMe.settings.getProperty(HooksSettings.HOOK_FLOODGATE_PLAYER) && AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_BE_COMPATIBILITY) && org.geysermc.floodgate.api.FloodgateApi.getInstance().isFloodgateId(event.getPlayer().getUniqueId()) && (getServer().getPluginManager().isPluginEnabled("floodgate") || getServer().getPluginManager().getPlugin("floodgate") != null)) {
|
||||||
|
closeReasonMap.put(playerunreg, "verified");
|
||||||
|
playerunreg.sendMessage("§a基岩版自动验证完成");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Bukkit.getScheduler().runTaskAsynchronously(this.plugin, () -> {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
howLongIsRandomString = (howManyRandom.nextInt(3) + 1);
|
||||||
|
for (int i = 0; i < howLongIsRandomString; i++) {
|
||||||
|
//生成随机索引号
|
||||||
|
int index = randomItemSet.nextInt(randomSet.length());
|
||||||
|
|
||||||
|
// 从字符串中获取由索引 index 指定的字符
|
||||||
|
char randomChar = randomSet.charAt(index);
|
||||||
|
|
||||||
|
// 将字符追加到字符串生成器
|
||||||
|
sb.append(randomChar);
|
||||||
|
}
|
||||||
|
|
||||||
|
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
||||||
|
randomString = sb.toString();
|
||||||
|
Random random_blockpos = new Random();
|
||||||
|
AtomicInteger random_num = new AtomicInteger(random_blockpos.nextInt(26));
|
||||||
|
Inventory menu = Bukkit.createInventory(null, 27, randomString + "请验证你是真人");
|
||||||
|
ItemStack item = new ItemStack(Material.REDSTONE_BLOCK);
|
||||||
|
ItemMeta meta = item.getItemMeta();
|
||||||
|
try {
|
||||||
|
if (meta != null) {
|
||||||
|
meta.setDisplayName("§a我是真人");
|
||||||
|
item.setItemMeta(meta);
|
||||||
|
}
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
getLogger().log(Level.WARNING, "Unexpected error occurred while setting item meta.");
|
||||||
|
}
|
||||||
|
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
||||||
|
menu.setItem(random_num.get(), item);
|
||||||
|
});
|
||||||
|
menu.setItem(random_num.get(), item);
|
||||||
|
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
||||||
|
playerunreg.openInventory(menu);
|
||||||
|
});
|
||||||
|
if (AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT) > 0) {
|
||||||
|
long timeOut = AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT);
|
||||||
|
if (AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT) > AuthMe.settings.getProperty(RestrictionSettings.TIMEOUT)) {
|
||||||
|
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
||||||
|
Bukkit.getLogger().warning("AuthMe detected that your GUI captcha timeout seconds(" + AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT) + ") is bigger than the Login timeout seconds(" +
|
||||||
|
AuthMe.settings.getProperty(RestrictionSettings.TIMEOUT) + "). To prevent issues, we will let the GUI captcha follow the Login timeout seconds, please check and modify your config.");
|
||||||
|
});
|
||||||
|
timeOut = AuthMe.settings.getProperty(RestrictionSettings.TIMEOUT);
|
||||||
|
}
|
||||||
|
long finalTimeOut = timeOut;
|
||||||
|
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
||||||
|
Bukkit.getScheduler().runTaskLater(this.plugin, () -> {
|
||||||
|
if (!closeReasonMap.containsKey(playerunreg) && !authmeApi.isRegistered(playerunreg.getName())) {
|
||||||
|
playerunreg.kickPlayer("§c验证超时");
|
||||||
|
timesLeft = 3; // Reset the attempt counter
|
||||||
|
}
|
||||||
|
}, finalTimeOut * 20L);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
||||||
|
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this.plugin, ListenerPriority.HIGHEST, PacketType.Play.Client.CLOSE_WINDOW) {
|
||||||
|
@Override
|
||||||
|
public void onPacketReceiving(PacketEvent event) {
|
||||||
|
if (event.getPlayer() == playerunreg && !closeReasonMap.containsKey(playerunreg) && !authmeApi.isRegistered(playerunreg.getName())) {
|
||||||
|
if (timesLeft <= 0) {
|
||||||
|
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
||||||
|
playerunreg.kickPlayer("§c请先完成人机验证!");
|
||||||
|
});
|
||||||
|
timesLeft = 3;
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
timesLeft--;
|
||||||
|
playerunreg.sendMessage("§c请先完成验证!,你还有" + timesLeft + "次机会");
|
||||||
|
|
||||||
|
}
|
||||||
|
event.setCancelled(true);
|
||||||
|
random_num.set(random_blockpos.nextInt(26));
|
||||||
|
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||||
|
Bukkit.getScheduler().runTask(plugin, () -> {
|
||||||
|
menu.clear();
|
||||||
|
menu.setItem(random_num.get(), item);
|
||||||
|
});
|
||||||
|
|
||||||
|
Bukkit.getScheduler().runTask(plugin, () -> {
|
||||||
|
playerunreg.openInventory(menu);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
||||||
|
|
||||||
|
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this.plugin, ListenerPriority.HIGHEST, PacketType.Play.Client.CHAT) {
|
||||||
|
@Override
|
||||||
|
public void onPacketReceiving(PacketEvent event) {
|
||||||
|
if (event.getPlayer() == playerunreg && !closeReasonMap.containsKey(playerunreg) && !authmeApi.isRegistered(playerunreg.getName())) {
|
||||||
|
playerunreg.sendMessage("§c请先完成验证!");
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void deletePlayerData(UUID playerUUID) {
|
||||||
|
// 获取服务器的存储文件夹路径
|
||||||
|
File serverFolder = Bukkit.getServer().getWorldContainer();
|
||||||
|
String worldFolderName = AuthMe.settings.getProperty(SecuritySettings.DELETE_PLAYER_DATA_WORLD);
|
||||||
|
// 构建playerdata文件夹路径
|
||||||
|
File playerDataFolder = new File(serverFolder, File.separator+worldFolderName+File.separator+"playerdata");
|
||||||
|
|
||||||
|
// 构建玩家数据文件路径
|
||||||
|
File playerDataFile = new File(playerDataFolder, File.separator+playerUUID + ".dat");
|
||||||
|
|
||||||
|
// 删除玩家数据文件
|
||||||
|
if (playerDataFile.exists()) {
|
||||||
|
playerDataFile.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void deletePlayerStats(UUID playerUUID) {
|
||||||
|
// 获取服务器的存储文件夹路径
|
||||||
|
File serverFolder = Bukkit.getServer().getWorldContainer();
|
||||||
|
String worldFolderName = AuthMe.settings.getProperty(SecuritySettings.DELETE_PLAYER_DATA_WORLD);
|
||||||
|
// 构建stats文件夹路径
|
||||||
|
File statsFolder = new File(serverFolder, File.separator+worldFolderName+File.separator+"stats");
|
||||||
|
// 构建玩家统计数据文件路径
|
||||||
|
File statsFile = new File(statsFolder, File.separator+playerUUID + ".json");
|
||||||
|
// 删除玩家统计数据文件
|
||||||
|
|
||||||
|
if (statsFile.exists()) {
|
||||||
|
statsFile.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
String name = player.getName();
|
||||||
|
UUID playerUUID = event.getPlayer().getUniqueId();
|
||||||
|
if (!authmeApi.isRegistered(name)) {
|
||||||
|
if(AuthMe.settings.getProperty(SecuritySettings.DELETE_UNVERIFIED_PLAYER_DATA) && !closeReasonMap.containsKey(player)){
|
||||||
|
Bukkit.getScheduler().runTaskLater(this.plugin,() -> {
|
||||||
|
deletePlayerData(playerUUID);
|
||||||
|
deletePlayerStats(playerUUID);
|
||||||
|
},100L);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
closeReasonMap.remove(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,11 +1,14 @@
|
|||||||
package fr.xephi.authme.listener;
|
package fr.xephi.authme.listener;
|
||||||
|
|
||||||
|
import fr.xephi.authme.AuthMe;
|
||||||
|
import fr.xephi.authme.api.v3.AuthMeApi;
|
||||||
import fr.xephi.authme.data.auth.PlayerCache;
|
import fr.xephi.authme.data.auth.PlayerCache;
|
||||||
import fr.xephi.authme.datasource.DataSource;
|
import fr.xephi.authme.datasource.DataSource;
|
||||||
import fr.xephi.authme.initialization.SettingsDependent;
|
import fr.xephi.authme.initialization.SettingsDependent;
|
||||||
import fr.xephi.authme.service.ValidationService;
|
import fr.xephi.authme.service.ValidationService;
|
||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
import fr.xephi.authme.settings.properties.RegistrationSettings;
|
import fr.xephi.authme.settings.properties.RegistrationSettings;
|
||||||
|
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||||
import fr.xephi.authme.util.PlayerUtils;
|
import fr.xephi.authme.util.PlayerUtils;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@@ -18,13 +21,13 @@ import javax.inject.Inject;
|
|||||||
* Service class for the AuthMe listeners to determine whether an event should be canceled.
|
* Service class for the AuthMe listeners to determine whether an event should be canceled.
|
||||||
*/
|
*/
|
||||||
class ListenerService implements SettingsDependent {
|
class ListenerService implements SettingsDependent {
|
||||||
|
private final AuthMeApi authmeApi = AuthMeApi.getInstance();
|
||||||
private final DataSource dataSource;
|
private final DataSource dataSource;
|
||||||
private final PlayerCache playerCache;
|
private final PlayerCache playerCache;
|
||||||
private final ValidationService validationService;
|
private final ValidationService validationService;
|
||||||
|
|
||||||
private boolean isRegistrationForced;
|
private boolean isRegistrationForced;
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ListenerService(Settings settings, DataSource dataSource, PlayerCache playerCache,
|
ListenerService(Settings settings, DataSource dataSource, PlayerCache playerCache,
|
||||||
ValidationService validationService) {
|
ValidationService validationService) {
|
||||||
@@ -76,9 +79,18 @@ class ListenerService implements SettingsDependent {
|
|||||||
* @param player the player to verify
|
* @param player the player to verify
|
||||||
* @return true if the associated event should be canceled, false otherwise
|
* @return true if the associated event should be canceled, false otherwise
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public boolean shouldCancelEvent(Player player) {
|
public boolean shouldCancelEvent(Player player) {
|
||||||
|
|
||||||
return player != null && !checkAuth(player.getName()) && !PlayerUtils.isNpc(player);
|
return player != null && !checkAuth(player.getName()) && !PlayerUtils.isNpc(player);
|
||||||
}
|
}
|
||||||
|
public boolean shouldCancelInvEvent(Player player) {
|
||||||
|
try {
|
||||||
|
return !AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA) || authmeApi.isRegistered(player.getName()) || GuiCaptchaHandler.closeReasonMap.containsKey(player)/* || !player.getOpenInventory().getTitle().equals("请验证你是真人")*/;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reload(Settings settings) {
|
public void reload(Settings settings) {
|
||||||
@@ -93,7 +105,7 @@ class ListenerService implements SettingsDependent {
|
|||||||
* @return true if the player may play, false otherwise
|
* @return true if the player may play, false otherwise
|
||||||
*/
|
*/
|
||||||
private boolean checkAuth(String name) {
|
private boolean checkAuth(String name) {
|
||||||
if (validationService.isUnrestricted(name) || playerCache.isAuthenticated(name)) {
|
if (validationService.isUnrestricted(name) || playerCache.isAuthenticated(name)){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!isRegistrationForced && !dataSource.isAuthAvailable(name)) {
|
if (!isRegistrationForced && !dataSource.isAuthAvailable(name)) {
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package fr.xephi.authme.listener;
|
package fr.xephi.authme.listener;
|
||||||
|
|
||||||
|
import fr.xephi.authme.AuthMe;
|
||||||
|
import fr.xephi.authme.api.v3.AuthMeApi;
|
||||||
import fr.xephi.authme.data.QuickCommandsProtectionManager;
|
import fr.xephi.authme.data.QuickCommandsProtectionManager;
|
||||||
import fr.xephi.authme.data.auth.PlayerAuth;
|
import fr.xephi.authme.data.auth.PlayerAuth;
|
||||||
import fr.xephi.authme.datasource.DataSource;
|
import fr.xephi.authme.datasource.DataSource;
|
||||||
@@ -18,6 +20,8 @@ import fr.xephi.authme.settings.SpawnLoader;
|
|||||||
import fr.xephi.authme.settings.properties.HooksSettings;
|
import fr.xephi.authme.settings.properties.HooksSettings;
|
||||||
import fr.xephi.authme.settings.properties.RegistrationSettings;
|
import fr.xephi.authme.settings.properties.RegistrationSettings;
|
||||||
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
||||||
|
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||||
|
import fr.xephi.authme.util.TeleportUtils;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@@ -53,6 +57,8 @@ import org.bukkit.event.player.PlayerShearEntityEvent;
|
|||||||
import org.bukkit.event.player.PlayerSwapHandItemsEvent;
|
import org.bukkit.event.player.PlayerSwapHandItemsEvent;
|
||||||
import org.bukkit.inventory.InventoryView;
|
import org.bukkit.inventory.InventoryView;
|
||||||
|
|
||||||
|
import static org.bukkit.Bukkit.getServer;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -63,7 +69,11 @@ import static fr.xephi.authme.settings.properties.RestrictionSettings.ALLOW_UNAU
|
|||||||
/**
|
/**
|
||||||
* Listener class for player events.
|
* Listener class for player events.
|
||||||
*/
|
*/
|
||||||
public class PlayerListener implements Listener {
|
public class PlayerListener implements Listener{
|
||||||
|
private final AuthMeApi authmeApi = AuthMeApi.getInstance();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private Settings settings;
|
private Settings settings;
|
||||||
@@ -93,9 +103,12 @@ public class PlayerListener implements Listener {
|
|||||||
private PermissionsManager permissionsManager;
|
private PermissionsManager permissionsManager;
|
||||||
@Inject
|
@Inject
|
||||||
private QuickCommandsProtectionManager quickCommandsProtectionManager;
|
private QuickCommandsProtectionManager quickCommandsProtectionManager;
|
||||||
|
|
||||||
|
|
||||||
// Lowest priority to apply fast protection checks
|
// Lowest priority to apply fast protection checks
|
||||||
@EventHandler(priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void onAsyncPlayerPreLoginEventLowest(AsyncPlayerPreLoginEvent event) {
|
public void onAsyncPlayerPreLoginEventLowest(AsyncPlayerPreLoginEvent event) {
|
||||||
|
|
||||||
if (event.getLoginResult() != AsyncPlayerPreLoginEvent.Result.ALLOWED) {
|
if (event.getLoginResult() != AsyncPlayerPreLoginEvent.Result.ALLOWED) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -111,9 +124,10 @@ public class PlayerListener implements Listener {
|
|||||||
if (validationService.isUnrestricted(name)) {
|
if (validationService.isUnrestricted(name)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (settings.getProperty(HooksSettings.HOOK_FLOODGATE_PLAYER)) {
|
||||||
if (settings.getProperty(RestrictionSettings.HOOK_FLOODGATE_PLAYER) && org.geysermc.floodgate.api.FloodgateApi.getInstance().isFloodgateId(event.getUniqueId())){
|
if (getServer().getPluginManager().getPlugin("floodgate") != null) {
|
||||||
return;
|
if (org.geysermc.floodgate.api.FloodgateApi.getInstance().isFloodgateId(event.getUniqueId())) return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Non-blocking checks
|
// Non-blocking checks
|
||||||
try {
|
try {
|
||||||
@@ -121,8 +135,8 @@ public class PlayerListener implements Listener {
|
|||||||
} catch (FailedVerificationException e) {
|
} catch (FailedVerificationException e) {
|
||||||
event.setKickMessage(messages.retrieveSingle(name, e.getReason(), e.getArgs()));
|
event.setKickMessage(messages.retrieveSingle(name, e.getReason(), e.getArgs()));
|
||||||
event.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_OTHER);
|
event.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_OTHER);
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -184,7 +198,7 @@ public class PlayerListener implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.NORMAL)
|
@EventHandler(priority = EventPriority.NORMAL)
|
||||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
|
final AuthMeApi authmeApi = AuthMeApi.getInstance();
|
||||||
if (!PlayerListener19Spigot.isPlayerSpawnLocationEventCalled()) {
|
if (!PlayerListener19Spigot.isPlayerSpawnLocationEventCalled()) {
|
||||||
teleportationService.teleportOnJoin(player);
|
teleportationService.teleportOnJoin(player);
|
||||||
}
|
}
|
||||||
@@ -194,12 +208,15 @@ public class PlayerListener implements Listener {
|
|||||||
management.performJoin(player);
|
management.performJoin(player);
|
||||||
|
|
||||||
teleportationService.teleportNewPlayerToFirstSpawn(player);
|
teleportationService.teleportNewPlayerToFirstSpawn(player);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH) // HIGH as EssentialsX listens at HIGHEST
|
@EventHandler(priority = EventPriority.HIGH) // HIGH as EssentialsX listens at HIGHEST
|
||||||
public void onJoinMessage(PlayerJoinEvent event) {
|
public void onJoinMessage(PlayerJoinEvent event) {
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
|
|
||||||
|
|
||||||
// Note: join message can be null, despite api documentation says not
|
// Note: join message can be null, despite api documentation says not
|
||||||
if (settings.getProperty(RegistrationSettings.REMOVE_JOIN_MESSAGE)) {
|
if (settings.getProperty(RegistrationSettings.REMOVE_JOIN_MESSAGE)) {
|
||||||
event.setJoinMessage(null);
|
event.setJoinMessage(null);
|
||||||
@@ -334,12 +351,12 @@ public class PlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Limit player X and Z movements to 1 block
|
* Limit player X and Z movements
|
||||||
* Deny player Y+ movements (allows falling)
|
* Deny player Y+ movements (allows falling)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (from.getBlockX() == to.getBlockX()
|
if (from.getX() == to.getX()
|
||||||
&& from.getBlockZ() == to.getBlockZ()
|
&& from.getZ() == to.getZ()
|
||||||
&& from.getY() - to.getY() >= 0) {
|
&& from.getY() - to.getY() >= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -362,9 +379,17 @@ public class PlayerListener implements Listener {
|
|||||||
Location spawn = spawnLoader.getSpawnLocation(player);
|
Location spawn = spawnLoader.getSpawnLocation(player);
|
||||||
if (spawn != null && spawn.getWorld() != null) {
|
if (spawn != null && spawn.getWorld() != null) {
|
||||||
if (!player.getWorld().equals(spawn.getWorld())) {
|
if (!player.getWorld().equals(spawn.getWorld())) {
|
||||||
player.teleport(spawn);
|
if(settings.getProperty(SecuritySettings.SMART_ASYNC_TELEPORT)) {
|
||||||
|
TeleportUtils.teleport(player,spawn);
|
||||||
|
} else {
|
||||||
|
player.teleport(spawn);
|
||||||
|
}
|
||||||
} else if (spawn.distance(player.getLocation()) > settings.getProperty(ALLOWED_MOVEMENT_RADIUS)) {
|
} else if (spawn.distance(player.getLocation()) > settings.getProperty(ALLOWED_MOVEMENT_RADIUS)) {
|
||||||
player.teleport(spawn);
|
if(settings.getProperty(SecuritySettings.SMART_ASYNC_TELEPORT)) {
|
||||||
|
TeleportUtils.teleport(player,spawn);
|
||||||
|
} else {
|
||||||
|
player.teleport(spawn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -488,15 +513,16 @@ public class PlayerListener implements Listener {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Set<String> whitelist = settings.getProperty(RestrictionSettings.UNRESTRICTED_INVENTORIES);
|
Set<String> whitelist = settings.getProperty(RestrictionSettings.UNRESTRICTED_INVENTORIES);
|
||||||
|
//append a string for String whitelist
|
||||||
return whitelist.contains(ChatColor.stripColor(inventory.getTitle()).toLowerCase(Locale.ROOT));
|
return whitelist.contains(ChatColor.stripColor(inventory.getTitle()).toLowerCase(Locale.ROOT));
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST)
|
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST)
|
||||||
public void onPlayerInventoryOpen(InventoryOpenEvent event) {
|
public void onPlayerInventoryOpen(InventoryOpenEvent event) {
|
||||||
final HumanEntity player = event.getPlayer();
|
final HumanEntity player = event.getPlayer();
|
||||||
|
Player ply = (Player) event.getPlayer();
|
||||||
if (listenerService.shouldCancelEvent(player)
|
if (listenerService.shouldCancelEvent(player)
|
||||||
&& !isInventoryWhitelisted(event.getView())) {
|
&& !isInventoryWhitelisted(event.getView()) && listenerService.shouldCancelInvEvent(ply)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -114,10 +114,6 @@ class InventoryPacketAdapter extends PacketAdapter {
|
|||||||
itemListModifier.write(0, Arrays.asList(blankInventory));
|
itemListModifier.write(0, Arrays.asList(blankInventory));
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
protocolManager.sendServerPacket(player, inventoryPacket, false);
|
||||||
protocolManager.sendServerPacket(player, inventoryPacket, false);
|
|
||||||
} catch (InvocationTargetException invocationExc) {
|
|
||||||
logger.logException("Error during sending blank inventory", invocationExc);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ package fr.xephi.authme.message;
|
|||||||
* Keys for translatable messages managed by {@link Messages}.
|
* Keys for translatable messages managed by {@link Messages}.
|
||||||
*/
|
*/
|
||||||
public enum MessageKey {
|
public enum MessageKey {
|
||||||
|
|
||||||
/** In order to use this command you must be authenticated! */
|
/** In order to use this command you must be authenticated! */
|
||||||
DENIED_COMMAND("error.denied_command"),
|
DENIED_COMMAND("error.denied_command"),
|
||||||
|
|
||||||
@@ -80,6 +79,9 @@ public enum MessageKey {
|
|||||||
/** The chosen password isn't safe, please choose another one... */
|
/** The chosen password isn't safe, please choose another one... */
|
||||||
PASSWORD_UNSAFE_ERROR("password.unsafe_password"),
|
PASSWORD_UNSAFE_ERROR("password.unsafe_password"),
|
||||||
|
|
||||||
|
/** Your chosen password is not secure. It was used %pwned_count times already! Please use a stronger password... */
|
||||||
|
PASSWORD_PWNED_ERROR("password.pwned_password", "%pwned_count"),
|
||||||
|
|
||||||
/** Your password contains illegal characters. Allowed chars: %valid_chars */
|
/** Your password contains illegal characters. Allowed chars: %valid_chars */
|
||||||
PASSWORD_CHARACTERS_ERROR("password.forbidden_characters", "%valid_chars"),
|
PASSWORD_CHARACTERS_ERROR("password.forbidden_characters", "%valid_chars"),
|
||||||
|
|
||||||
|
|||||||
@@ -42,18 +42,21 @@ import java.util.zip.GZIPInputStream;
|
|||||||
|
|
||||||
public class GeoIpService {
|
public class GeoIpService {
|
||||||
|
|
||||||
private static final String LICENSE =
|
//private static final String LICENSE =
|
||||||
"[LICENSE] This product includes GeoLite2 data created by MaxMind, available at https://www.maxmind.com";
|
//"[LICENSE] This product includes GeoLite2 data created by MaxMind, available at https://www.maxmind.com";
|
||||||
|
|
||||||
private static final String DATABASE_NAME = "GeoLite2-Country";
|
private static final String DATABASE_NAME = "GeoLite2-Country";
|
||||||
private static final String DATABASE_FILE = DATABASE_NAME + ".mmdb";
|
private static final String DATABASE_FILE = DATABASE_NAME + ".mmdb";
|
||||||
|
|
||||||
|
|
||||||
private final ConsoleLogger logger = ConsoleLoggerFactory.get(GeoIpService.class);
|
private final ConsoleLogger logger = ConsoleLoggerFactory.get(GeoIpService.class);
|
||||||
private final Path dataFile;
|
private final Path dataFile;
|
||||||
|
|
||||||
private GeoIp2Provider databaseReader;
|
private GeoIp2Provider databaseReader;
|
||||||
private volatile boolean downloading;
|
private volatile boolean downloading;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
GeoIpService(@DataFolder File dataFolder) {
|
GeoIpService(@DataFolder File dataFolder){
|
||||||
this.dataFile = dataFolder.toPath().resolve(DATABASE_FILE);
|
this.dataFile = dataFolder.toPath().resolve(DATABASE_FILE);
|
||||||
|
|
||||||
// Fires download of recent data or the initialization of the look up service
|
// Fires download of recent data or the initialization of the look up service
|
||||||
@@ -86,27 +89,63 @@ public class GeoIpService {
|
|||||||
if (Files.exists(dataFile)) {
|
if (Files.exists(dataFile)) {
|
||||||
try {
|
try {
|
||||||
startReading();
|
startReading();
|
||||||
// don't fire the update task - we are up to date
|
|
||||||
return true;
|
return true;
|
||||||
} catch (IOException ioEx) {
|
} catch (IOException ioEx) {
|
||||||
logger.logException("Failed to load GeoLiteAPI database", ioEx);
|
logger.logException("Failed to load GeoLiteAPI database", ioEx);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// File is outdated or doesn't exist - let's try to download the data file!
|
// File is outdated or doesn't exist - let's try to download the data file!
|
||||||
// use bukkit's cached threads
|
// use bukkit's cached threads
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
private void startReading() throws IOException {
|
private void startReading() throws IOException {
|
||||||
databaseReader = new Reader(dataFile.toFile(), FileMode.MEMORY, new CHMCache());
|
databaseReader = new Reader(dataFile.toFile(), FileMode.MEMORY, new CHMCache());
|
||||||
logger.info(LICENSE);
|
|
||||||
|
|
||||||
// clear downloading flag, because we now have working reader instance
|
// clear downloading flag, because we now have working reader instance
|
||||||
downloading = false;
|
downloading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Downloads the archive to the destination file if it's newer than the locally version.
|
||||||
|
*
|
||||||
|
* @param lastModified modification timestamp of the already present file
|
||||||
|
* @param destination save file
|
||||||
|
* @return null if no updates were found, the MD5 hash of the downloaded archive if successful
|
||||||
|
* @throws IOException if failed during downloading and writing to destination file
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Downloads the archive to the destination file if it's newer than the locally version.
|
||||||
|
*
|
||||||
|
* @param destination save file
|
||||||
|
* @return null if no updates were found, the MD5 hash of the downloaded archive if successful
|
||||||
|
* @throws IOException if failed during downloading and writing to destination file
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verify if the expected checksum is equal to the checksum of the given file.
|
||||||
|
*
|
||||||
|
* @param function the checksum function like MD5, SHA256 used to generate the checksum from the file
|
||||||
|
* @param file the file we want to calculate the checksum from
|
||||||
|
* @param expectedChecksum the expected checksum
|
||||||
|
* @throws IOException on I/O error reading the file or the checksum verification failed
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extract the database from gzipped data. Existing outputFile will be replaced if it already exists.
|
||||||
|
*
|
||||||
|
* @param inputFile gzipped database input file
|
||||||
|
* @param outputFile destination file for the database
|
||||||
|
* @throws IOException on I/O error reading the archive, or writing the output
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the country code of the given IP address.
|
* Get the country code of the given IP address.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import fr.xephi.authme.message.MessageKey;
|
|||||||
import fr.xephi.authme.output.ConsoleLoggerFactory;
|
import fr.xephi.authme.output.ConsoleLoggerFactory;
|
||||||
import fr.xephi.authme.permission.PermissionsManager;
|
import fr.xephi.authme.permission.PermissionsManager;
|
||||||
import fr.xephi.authme.permission.PlayerStatePermission;
|
import fr.xephi.authme.permission.PlayerStatePermission;
|
||||||
|
import fr.xephi.authme.security.HashUtils;
|
||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
import fr.xephi.authme.settings.properties.EmailSettings;
|
import fr.xephi.authme.settings.properties.EmailSettings;
|
||||||
import fr.xephi.authme.settings.properties.ProtectionSettings;
|
import fr.xephi.authme.settings.properties.ProtectionSettings;
|
||||||
@@ -21,6 +22,11 @@ import fr.xephi.authme.util.Utils;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.ProtocolException;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.Arrays;
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
@@ -28,6 +34,7 @@ import java.util.Collection;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.TimeoutException;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import static fr.xephi.authme.util.StringUtils.isInsideString;
|
import static fr.xephi.authme.util.StringUtils.isInsideString;
|
||||||
@@ -84,7 +91,15 @@ public class ValidationService implements Reloadable {
|
|||||||
return new ValidationResult(MessageKey.INVALID_PASSWORD_LENGTH);
|
return new ValidationResult(MessageKey.INVALID_PASSWORD_LENGTH);
|
||||||
} else if (settings.getProperty(SecuritySettings.UNSAFE_PASSWORDS).contains(passLow)) {
|
} else if (settings.getProperty(SecuritySettings.UNSAFE_PASSWORDS).contains(passLow)) {
|
||||||
return new ValidationResult(MessageKey.PASSWORD_UNSAFE_ERROR);
|
return new ValidationResult(MessageKey.PASSWORD_UNSAFE_ERROR);
|
||||||
|
} else if (settings.getProperty(SecuritySettings.HAVE_I_BEEN_PWNED_CHECK)) {
|
||||||
|
HaveIBeenPwnedResults results = validatePasswordHaveIBeenPwned(password);
|
||||||
|
if (results != null
|
||||||
|
&& results.isPwned()
|
||||||
|
&& results.getPwnCount() > settings.getProperty(SecuritySettings.HAVE_I_BEEN_PWNED_LIMIT)) {
|
||||||
|
return new ValidationResult(MessageKey.PASSWORD_PWNED_ERROR, String.valueOf(results.getPwnCount()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return new ValidationResult();
|
return new ValidationResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,6 +240,47 @@ public class ValidationService implements Reloadable {
|
|||||||
}
|
}
|
||||||
return restrictions;
|
return restrictions;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Check haveibeenpwned.com for the given password.
|
||||||
|
*
|
||||||
|
* @param password password to check for
|
||||||
|
* @return Results of the check
|
||||||
|
*/
|
||||||
|
public HaveIBeenPwnedResults validatePasswordHaveIBeenPwned(String password) {
|
||||||
|
String hash = HashUtils.sha1(password);
|
||||||
|
|
||||||
|
String hashPrefix = hash.substring(0, 5);
|
||||||
|
|
||||||
|
try {
|
||||||
|
String url = String.format("https://api.pwnedpasswords.com/range/%s", hashPrefix);
|
||||||
|
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
|
||||||
|
connection.setRequestMethod("GET");
|
||||||
|
connection.setRequestProperty("User-Agent", "AuthMeReloaded");
|
||||||
|
connection.setConnectTimeout(5000);
|
||||||
|
connection.setReadTimeout(5000);
|
||||||
|
connection.setDoInput(true);
|
||||||
|
StringBuilder outStr = new StringBuilder();
|
||||||
|
|
||||||
|
try (DataInputStream input = new DataInputStream(connection.getInputStream())) {
|
||||||
|
for (int c = input.read(); c != -1; c = input.read())
|
||||||
|
outStr.append((char) c);
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] hashes = outStr.toString().split("\n");
|
||||||
|
for (String hashSuffix : hashes) {
|
||||||
|
String[] hashSuffixParts = hashSuffix.trim().split(":");
|
||||||
|
if (hashSuffixParts[0].equalsIgnoreCase(hash.substring(5))) {
|
||||||
|
return new HaveIBeenPwnedResults(true, Integer.parseInt(hashSuffixParts[1]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new HaveIBeenPwnedResults(false, 0);
|
||||||
|
} catch (java.io.IOException e) {
|
||||||
|
logger.warning("验证密码时出现错误,这可能是由于网络问题,如果无法解决,请关闭HaveIBeenPwned检查");
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static final class ValidationResult {
|
public static final class ValidationResult {
|
||||||
private final MessageKey messageKey;
|
private final MessageKey messageKey;
|
||||||
@@ -266,4 +322,22 @@ public class ValidationService implements Reloadable {
|
|||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static final class HaveIBeenPwnedResults {
|
||||||
|
private final boolean isPwned;
|
||||||
|
private final int pwnCount;
|
||||||
|
|
||||||
|
public HaveIBeenPwnedResults(boolean isPwned, int pwnCount) {
|
||||||
|
this.isPwned = isPwned;
|
||||||
|
this.pwnCount = pwnCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPwned() {
|
||||||
|
return isPwned;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPwnCount() {
|
||||||
|
return pwnCount;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,11 @@ public final class HooksSettings implements SettingsHolder {
|
|||||||
public static final Property<Boolean> BUNGEECORD =
|
public static final Property<Boolean> BUNGEECORD =
|
||||||
newProperty("Hooks.bungeecord", false);
|
newProperty("Hooks.bungeecord", false);
|
||||||
|
|
||||||
|
@Comment("Allow FloodGatePlayer Join Without checkIsValidName()")
|
||||||
|
public static final Property<Boolean> HOOK_FLOODGATE_PLAYER =
|
||||||
|
newProperty("Hooks.floodgate", false);
|
||||||
|
|
||||||
|
|
||||||
@Comment("Send player to this BungeeCord server after register/login")
|
@Comment("Send player to this BungeeCord server after register/login")
|
||||||
public static final Property<String> BUNGEECORD_SERVER =
|
public static final Property<String> BUNGEECORD_SERVER =
|
||||||
newProperty("Hooks.sendPlayerTo", "");
|
newProperty("Hooks.sendPlayerTo", "");
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public final class RegistrationSettings implements SettingsHolder {
|
|||||||
"Send every X seconds a message to a player to",
|
"Send every X seconds a message to a player to",
|
||||||
"remind him that he has to login/register"})
|
"remind him that he has to login/register"})
|
||||||
public static final Property<Integer> MESSAGE_INTERVAL =
|
public static final Property<Integer> MESSAGE_INTERVAL =
|
||||||
newProperty("settings.registration.messageInterval", 600);
|
newProperty("settings.registration.messageInterval", 5);
|
||||||
|
|
||||||
@Comment({
|
@Comment({
|
||||||
"Only registered and logged in players can play.",
|
"Only registered and logged in players can play.",
|
||||||
@@ -33,7 +33,7 @@ public final class RegistrationSettings implements SettingsHolder {
|
|||||||
"More info at https://github.com/AuthMe/AuthMeReloaded/wiki/Registration"
|
"More info at https://github.com/AuthMe/AuthMeReloaded/wiki/Registration"
|
||||||
})
|
})
|
||||||
public static final Property<RegistrationType> REGISTRATION_TYPE =
|
public static final Property<RegistrationType> REGISTRATION_TYPE =
|
||||||
newProperty(RegistrationType.class, "settings.registration.type", RegistrationType.EMAIL);
|
newProperty(RegistrationType.class, "settings.registration.type", RegistrationType.PASSWORD);
|
||||||
|
|
||||||
@Comment({
|
@Comment({
|
||||||
"Second argument the /register command should take: ",
|
"Second argument the /register command should take: ",
|
||||||
@@ -44,7 +44,7 @@ public final class RegistrationSettings implements SettingsHolder {
|
|||||||
})
|
})
|
||||||
public static final Property<RegisterSecondaryArgument> REGISTER_SECOND_ARGUMENT =
|
public static final Property<RegisterSecondaryArgument> REGISTER_SECOND_ARGUMENT =
|
||||||
newProperty(RegisterSecondaryArgument.class, "settings.registration.secondArg",
|
newProperty(RegisterSecondaryArgument.class, "settings.registration.secondArg",
|
||||||
RegisterSecondaryArgument.NONE);
|
RegisterSecondaryArgument.CONFIRMATION);
|
||||||
|
|
||||||
@Comment({
|
@Comment({
|
||||||
"Do we force kick a player after a successful registration?",
|
"Do we force kick a player after a successful registration?",
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import ch.jalu.configme.Comment;
|
|||||||
import ch.jalu.configme.SettingsHolder;
|
import ch.jalu.configme.SettingsHolder;
|
||||||
import ch.jalu.configme.properties.Property;
|
import ch.jalu.configme.properties.Property;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -113,21 +115,19 @@ public final class RestrictionSettings implements SettingsHolder {
|
|||||||
|
|
||||||
@Comment("Can unregistered players walk around?")
|
@Comment("Can unregistered players walk around?")
|
||||||
public static final Property<Boolean> ALLOW_UNAUTHED_MOVEMENT =
|
public static final Property<Boolean> ALLOW_UNAUTHED_MOVEMENT =
|
||||||
newProperty("settings.restrictions.allowMovement", true);
|
newProperty("settings.restrictions.allowMovement", false);
|
||||||
|
|
||||||
@Comment({
|
@Comment({
|
||||||
"After how many seconds should players who fail to login or register",
|
"After how many seconds should players who fail to login or register",
|
||||||
"be kicked? Set to 0 to disable."})
|
"be kicked? Set to 0 to disable."})
|
||||||
public static final Property<Integer> TIMEOUT =
|
public static final Property<Integer> TIMEOUT =
|
||||||
newProperty("settings.restrictions.timeout", 0);
|
newProperty("settings.restrictions.timeout", 120);
|
||||||
|
|
||||||
@Comment("Regex pattern of allowed characters in the player name.")
|
@Comment("Regex pattern of allowed characters in the player name.")
|
||||||
public static final Property<String> ALLOWED_NICKNAME_CHARACTERS =
|
public static final Property<String> ALLOWED_NICKNAME_CHARACTERS =
|
||||||
newProperty("settings.restrictions.allowedNicknameCharacters", "[a-zA-Z0-9_]*");
|
newProperty("settings.restrictions.allowedNicknameCharacters", "[a-zA-Z0-9_]*");
|
||||||
|
|
||||||
@Comment("Allow FloodGatePlayer Join Without checkIsValidName()")
|
|
||||||
public static final Property<Boolean> HOOK_FLOODGATE_PLAYER =
|
|
||||||
newProperty("settings.restrictions.hookFloodGatePlayer", false);
|
|
||||||
@Comment({
|
@Comment({
|
||||||
"How far can unregistered players walk?",
|
"How far can unregistered players walk?",
|
||||||
"Set to 0 for unlimited radius"
|
"Set to 0 for unlimited radius"
|
||||||
@@ -163,7 +163,7 @@ public final class RestrictionSettings implements SettingsHolder {
|
|||||||
|
|
||||||
@Comment("AuthMe will NEVER teleport players if set to true!")
|
@Comment("AuthMe will NEVER teleport players if set to true!")
|
||||||
public static final Property<Boolean> NO_TELEPORT =
|
public static final Property<Boolean> NO_TELEPORT =
|
||||||
newProperty("settings.restrictions.noTeleport", true);
|
newProperty("settings.restrictions.noTeleport", false);
|
||||||
|
|
||||||
@Comment({
|
@Comment({
|
||||||
"Regex syntax for allowed chars in passwords. The default [!-~] allows all visible ASCII",
|
"Regex syntax for allowed chars in passwords. The default [!-~] allows all visible ASCII",
|
||||||
@@ -175,7 +175,7 @@ public final class RestrictionSettings implements SettingsHolder {
|
|||||||
|
|
||||||
@Comment("Regex syntax for allowed chars in email.")
|
@Comment("Regex syntax for allowed chars in email.")
|
||||||
public static final Property<String> ALLOWED_EMAIL_REGEX =
|
public static final Property<String> ALLOWED_EMAIL_REGEX =
|
||||||
newProperty("settings.restrictions.allowedEmailCharacters", "^[A-Za-z0-9]{4,15}@(outlook|163|gmail|icloud).com$");
|
newProperty("settings.restrictions.allowedEmailCharacters", "^[A-Za-z0-9_]{4,15}@(qq|outlook|163|gmail|icloud)\\.com$");
|
||||||
|
|
||||||
|
|
||||||
@Comment("Force survival gamemode when player joins?")
|
@Comment("Force survival gamemode when player joins?")
|
||||||
@@ -194,6 +194,7 @@ public final class RestrictionSettings implements SettingsHolder {
|
|||||||
public static final Property<Set<String>> UNRESTRICTED_NAMES =
|
public static final Property<Set<String>> UNRESTRICTED_NAMES =
|
||||||
newLowercaseStringSetProperty("settings.unrestrictions.UnrestrictedName");
|
newLowercaseStringSetProperty("settings.unrestrictions.UnrestrictedName");
|
||||||
|
|
||||||
|
|
||||||
@Comment({
|
@Comment({
|
||||||
"Below you can list all inventories names that AuthMe will ignore",
|
"Below you can list all inventories names that AuthMe will ignore",
|
||||||
"for registration or login. Configure it at your own risk!!",
|
"for registration or login. Configure it at your own risk!!",
|
||||||
@@ -206,7 +207,9 @@ public final class RestrictionSettings implements SettingsHolder {
|
|||||||
public static final Property<Set<String>> UNRESTRICTED_INVENTORIES =
|
public static final Property<Set<String>> UNRESTRICTED_INVENTORIES =
|
||||||
newLowercaseStringSetProperty("settings.unrestrictions.UnrestrictedInventories");
|
newLowercaseStringSetProperty("settings.unrestrictions.UnrestrictedInventories");
|
||||||
|
|
||||||
|
|
||||||
private RestrictionSettings() {
|
private RestrictionSettings() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ package fr.xephi.authme.settings.properties;
|
|||||||
|
|
||||||
import ch.jalu.configme.Comment;
|
import ch.jalu.configme.Comment;
|
||||||
import ch.jalu.configme.SettingsHolder;
|
import ch.jalu.configme.SettingsHolder;
|
||||||
|
|
||||||
import ch.jalu.configme.properties.Property;
|
import ch.jalu.configme.properties.Property;
|
||||||
import fr.xephi.authme.security.HashAlgorithm;
|
import fr.xephi.authme.security.HashAlgorithm;
|
||||||
import fr.xephi.authme.settings.EnumSetProperty;
|
import fr.xephi.authme.settings.EnumSetProperty;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import static ch.jalu.configme.properties.PropertyInitializer.newLowercaseStringSetProperty;
|
import static ch.jalu.configme.properties.PropertyInitializer.newLowercaseStringSetProperty;
|
||||||
@@ -17,16 +17,76 @@ public final class SecuritySettings implements SettingsHolder {
|
|||||||
"Take care with this, if you set this to false,",
|
"Take care with this, if you set this to false,",
|
||||||
"AuthMe will automatically disable and the server won't be protected!"})
|
"AuthMe will automatically disable and the server won't be protected!"})
|
||||||
public static final Property<Boolean> STOP_SERVER_ON_PROBLEM =
|
public static final Property<Boolean> STOP_SERVER_ON_PROBLEM =
|
||||||
newProperty("Security.SQLProblem.stopServer", true);
|
newProperty("Security.SQLProblem.stopServer", false);
|
||||||
|
|
||||||
|
@Comment("Enable the new feature to prevent ghost players?")
|
||||||
|
public static final Property<Boolean> ANTI_GHOST_PLAYERS = newProperty("3rdPartyFeature.fixes.antiGhostPlayer", false);
|
||||||
|
|
||||||
|
@Comment({"Choose the best teleport method by server brand?",
|
||||||
|
"(Enable this if you are using Paper)"})
|
||||||
|
public static final Property<Boolean> SMART_ASYNC_TELEPORT = newProperty("3rdPartyFeature.optimizes.smartAsyncTeleport",false);
|
||||||
|
|
||||||
|
@Comment("Send a GUI captcha to unregistered players?(Requires ProtocolLib)")
|
||||||
|
public static final Property<Boolean> GUI_CAPTCHA = newProperty("3rdPartyFeature.captcha.guiCaptcha",false);
|
||||||
|
|
||||||
|
@Comment({"Should we kick the players when they don't finish the GUI captcha in seconds?",
|
||||||
|
"(less than or equals 0 is disabled)"})
|
||||||
|
public static final Property<Integer> GUI_CAPTCHA_TIMEOUT = newProperty("3rdPartyFeature.captcha.timeOut",0);
|
||||||
|
|
||||||
|
@Comment({"Should we ignore floodgate players when sending GUI captcha?",
|
||||||
|
"(Requires floodgate and hookFloodgate: true)"})
|
||||||
|
public static final Property<Boolean> GUI_CAPTCHA_BE_COMPATIBILITY = newProperty("3rdPartyFeature.captcha.ignoreBedrock",false);
|
||||||
|
|
||||||
|
@Comment("Should we delete player data and stats when they didn't finish the captcha?")
|
||||||
|
public static final Property<Boolean> DELETE_UNVERIFIED_PLAYER_DATA = newProperty("3rdPartyFeature.captcha.purgePlayerData",false);
|
||||||
|
|
||||||
|
@Comment("Which world's player data should be deleted?(Enter the world *FOLDER* name where your players first logged in)")
|
||||||
|
public static final Property<String> DELETE_PLAYER_DATA_WORLD = newProperty("3rdPartyFeature.captcha.purgeWorldFolderName","world");
|
||||||
|
|
||||||
|
// @Comment({"Should we kick the players when they failed captcha too many times?",
|
||||||
|
// "(Minimum value is 1)(Default: 3)"})
|
||||||
|
// public static final Property<Integer> GUI_CAPTCHA_MAX_TRY = newProperty("3rdPartyFeature.captcha.maxTryTimes",3);
|
||||||
|
|
||||||
|
|
||||||
|
//@Comment({"Using which API to get hash data?",
|
||||||
|
//"Available options: github, gitee, ghproxy (if your server is in China, please use gitee or ghproxy.)"})
|
||||||
|
//public static final Property<String> SHA_CHECK_METHOD = newProperty("Plugin.hashing.hashApi","github");
|
||||||
|
|
||||||
|
//@Comment("Should we use the local cache sometimes instead of requesting API?")
|
||||||
|
//public static final Property<Boolean> USE_LOCAL_CACHE = newProperty("Plugin.hashing.useLocalCache",false);
|
||||||
|
|
||||||
|
//@Comment("DON'T TOUCH!!!")
|
||||||
|
//public static final Property<String> SHA_CHECK_CACHE = newProperty("Plugin.hashing.hashCached","");
|
||||||
|
|
||||||
@Comment("Copy AuthMe log output in a separate file as well?")
|
@Comment("Copy AuthMe log output in a separate file as well?")
|
||||||
public static final Property<Boolean> USE_LOGGING =
|
public static final Property<Boolean> USE_LOGGING =
|
||||||
newProperty("Security.console.logConsole", true);
|
newProperty("Security.console.logConsole", true);
|
||||||
|
|
||||||
|
@Comment({"Query haveibeenpwned.com with a hashed version of the password.",
|
||||||
|
"This is used to check whether it is safe."})
|
||||||
|
public static final Property<Boolean> HAVE_I_BEEN_PWNED_CHECK =
|
||||||
|
newProperty("Security.account.haveIBeenPwned.check", false);
|
||||||
|
|
||||||
|
@Comment({"If the password is used more than this number of times, it is considered unsafe."})
|
||||||
|
public static final Property<Integer> HAVE_I_BEEN_PWNED_LIMIT =
|
||||||
|
newProperty("Security.account.haveIBeenPwned.limit", 0);
|
||||||
|
|
||||||
@Comment("Enable captcha when a player uses wrong password too many times")
|
@Comment("Enable captcha when a player uses wrong password too many times")
|
||||||
public static final Property<Boolean> ENABLE_LOGIN_FAILURE_CAPTCHA =
|
public static final Property<Boolean> ENABLE_LOGIN_FAILURE_CAPTCHA =
|
||||||
newProperty("Security.captcha.useCaptcha", false);
|
newProperty("Security.captcha.useCaptcha", false);
|
||||||
|
|
||||||
|
@Comment("Check for updates on enabled from GitHub?")
|
||||||
|
public static final Property<Boolean> CHECK_FOR_UPDATES =
|
||||||
|
newProperty("Plugin.updates.checkForUpdates", true);
|
||||||
|
|
||||||
|
@Comment("Should we show the AuthMe banner on startup?")
|
||||||
|
public static final Property<Boolean> SHOW_STARTUP_BANNER =
|
||||||
|
newProperty("Plugin.banners.showBanners", true);
|
||||||
|
|
||||||
|
@Comment("Change the banner colors here (Default: §r)")
|
||||||
|
public static final Property<String> STARTUP_BANNER_COLOR =
|
||||||
|
newProperty("Plugin.banners.bannerColor", "§r");
|
||||||
|
|
||||||
@Comment("Max allowed tries before a captcha is required")
|
@Comment("Max allowed tries before a captcha is required")
|
||||||
public static final Property<Integer> MAX_LOGIN_TRIES_BEFORE_CAPTCHA =
|
public static final Property<Integer> MAX_LOGIN_TRIES_BEFORE_CAPTCHA =
|
||||||
newProperty("Security.captcha.maxLoginTry", 8);
|
newProperty("Security.captcha.maxLoginTry", 8);
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package fr.xephi.authme.util;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
//
|
||||||
|
//public class TeleportUtils {
|
||||||
|
// public static void teleport(Player player, Location location) {
|
||||||
|
// try {
|
||||||
|
// Class<?> paperClass = Class.forName("com.destroystokyo.paper.PaperConfig");
|
||||||
|
// // Paper API is loaded, use teleportAsync
|
||||||
|
// Method teleportAsyncMethod = player.getClass().getMethod("teleportAsync", Location.class);
|
||||||
|
// teleportAsyncMethod.setAccessible(true);
|
||||||
|
// teleportAsyncMethod.invoke(player, location);
|
||||||
|
// } catch (ClassNotFoundException | InvocationTargetException | NoSuchMethodException | IllegalAccessException e) {
|
||||||
|
// // Paper API is not loaded, use normal teleport
|
||||||
|
// player.teleport(location);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
public class TeleportUtils {
|
||||||
|
private static Method teleportAsyncMethod;
|
||||||
|
|
||||||
|
static {
|
||||||
|
try {//Detect Paper class
|
||||||
|
Class<?> paperClass = Class.forName("com.destroystokyo.paper.PaperConfig");
|
||||||
|
teleportAsyncMethod = Player.class.getMethod("teleportAsync", Location.class);
|
||||||
|
// if detected,use teleportAsync()
|
||||||
|
} catch (ClassNotFoundException | NoSuchMethodException e) {
|
||||||
|
teleportAsyncMethod = null;
|
||||||
|
//if not, set method to null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void teleport(Player player, Location location) {
|
||||||
|
if (teleportAsyncMethod != null) {
|
||||||
|
try {
|
||||||
|
teleportAsyncMethod.setAccessible(true);
|
||||||
|
teleportAsyncMethod.invoke(player, location);
|
||||||
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||||
|
player.teleport(location);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
player.teleport(location);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -41,10 +41,7 @@
|
|||||||
# executor: CONSOLE
|
# executor: CONSOLE
|
||||||
# ifNumberOfAccountsAtLeast: 5
|
# ifNumberOfAccountsAtLeast: 5
|
||||||
# Commands to run for players logging in whose 'last login date' was empty
|
# Commands to run for players logging in whose 'last login date' was empty
|
||||||
onFirstLogin:
|
onFirstLogin: {}
|
||||||
broadcast:
|
|
||||||
command: 'cmi broadcast &b欢迎 &r%p &7( %ip ) &b光临服务器,请大家多多关照!'
|
|
||||||
executor: CONSOLE
|
|
||||||
onJoin: {}
|
onJoin: {}
|
||||||
onLogin: {}
|
onLogin: {}
|
||||||
# These commands are called whenever a logged in player uses /logout or quits.
|
# These commands are called whenever a logged in player uses /logout or quits.
|
||||||
|
|||||||
@@ -102,8 +102,8 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p style="color:#b0adc5;">© 2023 IrisCraft. All rights reserved.</p>
|
<p style="color:#b0adc5;">© 2023 HomoCraft. All rights reserved.</p>
|
||||||
<a href="https://www.mcbbs.net/thread-1263385-1-1.html" target="_blank" style="text-decoration: none; font-size: 16px">iriscraft.work</a>
|
<a href="1919810.com" target="_blank" style="text-decoration: none; font-size: 16px">homomc.cc</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ password:
|
|||||||
unsafe_password: '&cThe chosen password isn''t safe, please choose another one...'
|
unsafe_password: '&cThe chosen password isn''t safe, please choose another one...'
|
||||||
forbidden_characters: '&4Your password contains illegal characters. Allowed chars: %valid_chars'
|
forbidden_characters: '&4Your password contains illegal characters. Allowed chars: %valid_chars'
|
||||||
wrong_length: '&cYour password is too short or too long! Please try with another one!'
|
wrong_length: '&cYour password is too short or too long! Please try with another one!'
|
||||||
|
pwned_password: '&cYour chosen password is not secure. It was used %pwned_count times already! Please use a strong password...'
|
||||||
|
|
||||||
# Login
|
# Login
|
||||||
login:
|
login:
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
registration:
|
registration:
|
||||||
disabled: '&c注册已被禁止'
|
disabled: '&c注册已被禁止'
|
||||||
name_taken: '&c此用户已经在此服务器注册过'
|
name_taken: '&c此用户已经在此服务器注册过'
|
||||||
register_request: '&7请输入“/register <邮箱>”以注册'
|
register_request: '&b请输入“&a/reg <密码> <重复密码>&b”以注册'
|
||||||
command_usage: '&c正确用法:“/register <邮箱>”'
|
command_usage: '&c正确用法:“/reg <密码> <重复密码>”'
|
||||||
reg_only: '&c只允许注册过的玩家进服!'
|
reg_only: '&c只允许注册过的玩家进服!'
|
||||||
success: '&a*** 已成功注册 ***'
|
success: '&a*** 已成功注册 ***'
|
||||||
|
|
||||||
@@ -19,13 +19,14 @@ password:
|
|||||||
unsafe_password: '&c您不能使用安全性过低的密码。 '
|
unsafe_password: '&c您不能使用安全性过低的密码。 '
|
||||||
forbidden_characters: '&4您的密码包含了非法字符.可使用的字符: %valid_chars'
|
forbidden_characters: '&4您的密码包含了非法字符.可使用的字符: %valid_chars'
|
||||||
wrong_length: '&4您的密码没有达到要求!'
|
wrong_length: '&4您的密码没有达到要求!'
|
||||||
|
pwned_password: '&c你使用的密码并不安全。它已经被使用了 %pwned_count 次! 请使用一个更强大的密码...'
|
||||||
|
|
||||||
# Login
|
# Login
|
||||||
login:
|
login:
|
||||||
command_usage: '&c正确用法:“/login <密码>”'
|
command_usage: '&c正确用法:“/l <密码>”'
|
||||||
wrong_password: '&c*** 密码错误 ***'
|
wrong_password: '&c*** 密码错误 ***'
|
||||||
success: '&a*** 已成功登录 ***'
|
success: '&a*** 已成功登录 ***'
|
||||||
login_request: '&c请输入“/login <密码>”以登录'
|
login_request: '&c请输入“/l <密码>”以登录'
|
||||||
timeout_error: '给您登录的时间已经过了'
|
timeout_error: '给您登录的时间已经过了'
|
||||||
|
|
||||||
# Errors
|
# Errors
|
||||||
|
|||||||
@@ -108,8 +108,8 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p style="color:#b0adc5;">© 2023 IrisCraft. All rights reserved.</p>
|
<p style="color:#b0adc5;">© 2023 HomoCraft. All rights reserved.</p>
|
||||||
<a href="https://www.mcbbs.net/thread-1263385-1-1.html" target="_blank" style="text-decoration: none; font-size: 16px">iriscraft.work</a>
|
<a href="1919810.com" target="_blank" style="text-decoration: none; font-size: 16px">homomc.cc</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
name: ${pluginDescription.name}
|
name: ${pluginDescription.name}
|
||||||
authors: [${pluginDescription.authors}]
|
authors: [${pluginDescription.authors}]
|
||||||
website: ${project.url}
|
website: http://github.com/HaHaWTH/AuthMeReReloaded/
|
||||||
description: ${project.description}
|
description: A fork of AuthMeReloaded that contains bug fixes
|
||||||
main: ${pluginDescription.main}
|
main: ${pluginDescription.main}
|
||||||
version: ${pluginDescription.version}
|
version: 5.6.0-FORK-b23
|
||||||
api-version: 1.13
|
api-version: 1.13
|
||||||
softdepend:
|
softdepend:
|
||||||
- Vault
|
- Vault
|
||||||
@@ -28,7 +28,6 @@ commands:
|
|||||||
usage: /login <password>
|
usage: /login <password>
|
||||||
aliases:
|
aliases:
|
||||||
- l
|
- l
|
||||||
- log
|
|
||||||
logout:
|
logout:
|
||||||
description: Logout command
|
description: Logout command
|
||||||
usage: /logout
|
usage: /logout
|
||||||
|
|||||||
@@ -101,8 +101,8 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p style="color:#b0adc5;">© 2023 IrisCraft. All rights reserved.</p>
|
<p style="color:#b0adc5;">© 2023 HomoCraft. All rights reserved.</p>
|
||||||
<a href="https://www.mcbbs.net/thread-1263385-1-1.html" target="_blank" style="text-decoration: none; font-size: 16px">iriscraft.work</a>
|
<a href="191980.com" target="_blank" style="text-decoration: none; font-size: 16px">homomc.cc</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -99,8 +99,8 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p style="color:#b0adc5;">© 2023 IrisCraft. All rights reserved.</p>
|
<p style="color:#b0adc5;">© 2023 HomoCraft. All rights reserved.</p>
|
||||||
<a href="https://www.mcbbs.net/thread-1263385-1-1.html" target="_blank" style="text-decoration: none; font-size: 16px">iriscraft.work</a>
|
<a href="1919810.com" target="_blank" style="text-decoration: none; font-size: 16px">homomc.cc</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -101,8 +101,8 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p style="color:#b0adc5;">© 2023 IrisCraft. All rights reserved.</p>
|
<p style="color:#b0adc5;">© 2023 HomoCraft. All rights reserved.</p>
|
||||||
<a href="https://www.mcbbs.net/thread-1263385-1-1.html" target="_blank" style="text-decoration: none; font-size: 16px">iriscraft.work</a>
|
<a href="1919810.com" target="_blank" style="text-decoration: none; font-size: 16px">homomc.cc</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
Reference in New Issue
Block a user