mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-31 19:24:47 +02:00
Squash previous commits
* Add SodionAuth * Add Comment * add SodionAuth Co-authored-by: logos <1102280066@qq.com>
This commit is contained in:
@@ -81,6 +81,7 @@ Possible values: `Premium`, `Cracked`, `Unknown`
|
|||||||
* [CrazyLogin](https://dev.bukkit.org/bukkit-plugins/crazylogin/)
|
* [CrazyLogin](https://dev.bukkit.org/bukkit-plugins/crazylogin/)
|
||||||
* [LoginSecurity](https://dev.bukkit.org/bukkit-plugins/loginsecurity/)
|
* [LoginSecurity](https://dev.bukkit.org/bukkit-plugins/loginsecurity/)
|
||||||
* [UltraAuth](https://dev.bukkit.org/bukkit-plugins/ultraauth-aa/)
|
* [UltraAuth](https://dev.bukkit.org/bukkit-plugins/ultraauth-aa/)
|
||||||
|
* [SodionAuth](https://github.com/Mohist-Community/SodionAuth)
|
||||||
|
|
||||||
### BungeeCord/Waterfall
|
### BungeeCord/Waterfall
|
||||||
|
|
||||||
|
BIN
bukkit/lib/SodionAuth-Bukkit-2.0-API-only.jar
Normal file
BIN
bukkit/lib/SodionAuth-Bukkit-2.0-API-only.jar
Normal file
Binary file not shown.
@@ -233,5 +233,14 @@
|
|||||||
<scope>system</scope>
|
<scope>system</scope>
|
||||||
<systemPath>${project.basedir}/lib/UltraAuth v2.1.2.jar</systemPath>
|
<systemPath>${project.basedir}/lib/UltraAuth v2.1.2.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>red.mohist.sodionauth</groupId>
|
||||||
|
<artifactId>SodionAuth-Bukkit</artifactId>
|
||||||
|
<version>2.0-SNAPSHOT</version>
|
||||||
|
<optional>true</optional>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${project.basedir}/lib/SodionAuth-Bukkit-2.0-API-only.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
@@ -0,0 +1,49 @@
|
|||||||
|
package com.github.games647.fastlogin.bukkit.hook;
|
||||||
|
|
||||||
|
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||||
|
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import red.mohist.sodionauth.bukkit.implementation.BukkitPlayer;
|
||||||
|
import red.mohist.sodionauth.core.SodionAuthApi;
|
||||||
|
import red.mohist.sodionauth.core.exception.AuthenticatedException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GitHub: https://github.com/Mohist-Community/SodionAuth
|
||||||
|
* <p>
|
||||||
|
* Project page:
|
||||||
|
* <p>
|
||||||
|
* Bukkit: Unknown
|
||||||
|
* <p>
|
||||||
|
* Spigot: Unknown
|
||||||
|
*/
|
||||||
|
public class SodionAuthHook implements AuthPlugin<Player> {
|
||||||
|
|
||||||
|
private final FastLoginBukkit plugin;
|
||||||
|
|
||||||
|
public SodionAuthHook(FastLoginBukkit plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean forceLogin(Player player) {
|
||||||
|
try {
|
||||||
|
SodionAuthApi.login(new BukkitPlayer(player));
|
||||||
|
} catch (AuthenticatedException e) {
|
||||||
|
plugin.getLog().warn(ALREADY_AUTHENTICATED, player);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean forceRegister(Player player, String password) {
|
||||||
|
plugin.getLog().warn("AutoRegister is not implemented by SodionAuth yet.");
|
||||||
|
plugin.getLog().warn("Disable it to prevent further issue!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isRegistered(String playerName) {
|
||||||
|
return SodionAuthApi.isRegister(playerName);
|
||||||
|
}
|
||||||
|
}
|
@@ -7,6 +7,7 @@ import com.github.games647.fastlogin.bukkit.hook.LogItHook;
|
|||||||
import com.github.games647.fastlogin.bukkit.hook.LoginSecurityHook;
|
import com.github.games647.fastlogin.bukkit.hook.LoginSecurityHook;
|
||||||
import com.github.games647.fastlogin.bukkit.hook.UltraAuthHook;
|
import com.github.games647.fastlogin.bukkit.hook.UltraAuthHook;
|
||||||
import com.github.games647.fastlogin.bukkit.hook.xAuthHook;
|
import com.github.games647.fastlogin.bukkit.hook.xAuthHook;
|
||||||
|
import com.github.games647.fastlogin.bukkit.hook.SodionAuthHook;
|
||||||
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
@@ -70,8 +71,8 @@ public class DelayedAuthHook implements Runnable {
|
|||||||
try {
|
try {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
List<Class<? extends AuthPlugin<Player>>> hooks = Arrays.asList(AuthMeHook.class,
|
List<Class<? extends AuthPlugin<Player>>> hooks = Arrays.asList(AuthMeHook.class,
|
||||||
CrazyLoginHook.class, LogItHook.class, LoginSecurityHook.class, UltraAuthHook.class,
|
CrazyLoginHook.class, LogItHook.class, LoginSecurityHook.class,
|
||||||
xAuthHook.class);
|
SodionAuthHook.class, UltraAuthHook.class, xAuthHook.class);
|
||||||
|
|
||||||
for (Class<? extends AuthPlugin<Player>> clazz : hooks) {
|
for (Class<? extends AuthPlugin<Player>> clazz : hooks) {
|
||||||
String pluginName = clazz.getSimpleName().replace("Hook", "");
|
String pluginName = clazz.getSimpleName().replace("Hook", "");
|
||||||
|
Reference in New Issue
Block a user