forked from TuxCoding/FastLogin
@ -0,0 +1,50 @@
|
|||||||
|
package com.github.games647.fastlogin.bukkit.event;
|
||||||
|
|
||||||
|
import com.github.games647.fastlogin.core.StoredProfile;
|
||||||
|
import com.github.games647.fastlogin.core.shared.LoginSession;
|
||||||
|
import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent;
|
||||||
|
import org.bukkit.event.Cancellable;
|
||||||
|
import org.bukkit.event.Event;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
|
public class BukkitFastLoginAutoLoginEvent extends Event implements FastLoginAutoLoginEvent, Cancellable {
|
||||||
|
|
||||||
|
private static final HandlerList handlers = new HandlerList();
|
||||||
|
private final LoginSession session;
|
||||||
|
private final StoredProfile profile;
|
||||||
|
private boolean cancelled;
|
||||||
|
|
||||||
|
public BukkitFastLoginAutoLoginEvent(LoginSession session, StoredProfile profile) {
|
||||||
|
this.session = session;
|
||||||
|
this.profile = profile;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LoginSession getSession() {
|
||||||
|
return session;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StoredProfile getProfile() {
|
||||||
|
return profile;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCancelled() {
|
||||||
|
return cancelled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setCancelled(boolean cancelled) {
|
||||||
|
this.cancelled = cancelled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HandlerList getHandlers() {
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package com.github.games647.fastlogin.bukkit.event;
|
||||||
|
|
||||||
|
import com.github.games647.fastlogin.core.StoredProfile;
|
||||||
|
import com.github.games647.fastlogin.core.shared.LoginSource;
|
||||||
|
import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent;
|
||||||
|
import org.bukkit.event.Event;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
|
public class BukkitFastLoginPreLoginEvent extends Event implements FastLoginPreLoginEvent {
|
||||||
|
|
||||||
|
private static final HandlerList handlers = new HandlerList();
|
||||||
|
private final String username;
|
||||||
|
private final LoginSource source;
|
||||||
|
private final StoredProfile profile;
|
||||||
|
|
||||||
|
public BukkitFastLoginPreLoginEvent(String username, LoginSource source, StoredProfile profile) {
|
||||||
|
super(true);
|
||||||
|
this.username = username;
|
||||||
|
this.source = source;
|
||||||
|
this.profile = profile;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUsername() {
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LoginSource getSource() {
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StoredProfile getProfile() {
|
||||||
|
return profile;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HandlerList getHandlers() {
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
}
|
@ -4,12 +4,14 @@ import com.comphenix.protocol.ProtocolLibrary;
|
|||||||
import com.comphenix.protocol.events.PacketEvent;
|
import com.comphenix.protocol.events.PacketEvent;
|
||||||
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
||||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||||
|
import com.github.games647.fastlogin.bukkit.event.BukkitFastLoginPreLoginEvent;
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
import com.github.games647.fastlogin.core.StoredProfile;
|
||||||
import com.github.games647.fastlogin.core.shared.JoinManagement;
|
import com.github.games647.fastlogin.core.shared.JoinManagement;
|
||||||
|
|
||||||
import java.security.PublicKey;
|
import java.security.PublicKey;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@ -46,6 +48,13 @@ public class NameCheckTask extends JoinManagement<Player, CommandSender, Protoco
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FastLoginPreLoginEvent callFastLoginPreLoginEvent(String username, ProtocolLibLoginSource source, StoredProfile profile) {
|
||||||
|
BukkitFastLoginPreLoginEvent event = new BukkitFastLoginPreLoginEvent(username, source, profile);
|
||||||
|
plugin.getServer().getPluginManager().callEvent(event);
|
||||||
|
return event;
|
||||||
|
}
|
||||||
|
|
||||||
//Minecraft server implementation
|
//Minecraft server implementation
|
||||||
//https://github.com/bergerkiller/CraftSource/blob/master/net.minecraft.server/LoginListener.java#L161
|
//https://github.com/bergerkiller/CraftSource/blob/master/net.minecraft.server/LoginListener.java#L161
|
||||||
@Override
|
@Override
|
||||||
|
@ -3,12 +3,14 @@ package com.github.games647.fastlogin.bukkit.listener.protocolsupport;
|
|||||||
import com.github.games647.craftapi.UUIDAdapter;
|
import com.github.games647.craftapi.UUIDAdapter;
|
||||||
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
||||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||||
|
import com.github.games647.fastlogin.bukkit.event.BukkitFastLoginPreLoginEvent;
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
import com.github.games647.fastlogin.core.StoredProfile;
|
||||||
import com.github.games647.fastlogin.core.shared.JoinManagement;
|
import com.github.games647.fastlogin.core.shared.JoinManagement;
|
||||||
|
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -65,6 +67,13 @@ public class ProtocolSupportListener extends JoinManagement<Player, CommandSende
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FastLoginPreLoginEvent callFastLoginPreLoginEvent(String username, ProtocolLoginSource source, StoredProfile profile) {
|
||||||
|
BukkitFastLoginPreLoginEvent event = new BukkitFastLoginPreLoginEvent(username, source, profile);
|
||||||
|
plugin.getServer().getPluginManager().callEvent(event);
|
||||||
|
return event;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void requestPremiumLogin(ProtocolLoginSource source, StoredProfile profile, String username
|
public void requestPremiumLogin(ProtocolLoginSource source, StoredProfile profile, String username
|
||||||
, boolean registered) {
|
, boolean registered) {
|
||||||
|
@ -2,7 +2,9 @@ package com.github.games647.fastlogin.bukkit.task;
|
|||||||
|
|
||||||
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
||||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||||
|
import com.github.games647.fastlogin.bukkit.event.BukkitFastLoginAutoLoginEvent;
|
||||||
import com.github.games647.fastlogin.core.PremiumStatus;
|
import com.github.games647.fastlogin.core.PremiumStatus;
|
||||||
|
import com.github.games647.fastlogin.core.StoredProfile;
|
||||||
import com.github.games647.fastlogin.core.message.SuccessMessage;
|
import com.github.games647.fastlogin.core.message.SuccessMessage;
|
||||||
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
||||||
import com.github.games647.fastlogin.core.shared.ForceLoginManagement;
|
import com.github.games647.fastlogin.core.shared.ForceLoginManagement;
|
||||||
@ -10,6 +12,7 @@ import com.github.games647.fastlogin.core.shared.LoginSession;
|
|||||||
|
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
|
|
||||||
|
import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -43,6 +46,13 @@ public class ForceLoginTask extends ForceLoginManagement<Player, CommandSender,
|
|||||||
plugin.getPremiumPlayers().put(player.getUniqueId(), status);
|
plugin.getPremiumPlayers().put(player.getUniqueId(), status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FastLoginAutoLoginEvent callFastLoginAutoLoginEvent(LoginSession session, StoredProfile profile) {
|
||||||
|
BukkitFastLoginAutoLoginEvent event = new BukkitFastLoginAutoLoginEvent(session, profile);
|
||||||
|
core.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||||
|
return event;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onForceActionSuccess(LoginSession session) {
|
public void onForceActionSuccess(LoginSession session) {
|
||||||
if (core.getPlugin().isBungeeEnabled()) {
|
if (core.getPlugin().isBungeeEnabled()) {
|
||||||
|
BIN
bungee/lib/BungeeAuth-1.4.jar
Normal file
BIN
bungee/lib/BungeeAuth-1.4.jar
Normal file
Binary file not shown.
@ -56,10 +56,12 @@
|
|||||||
</build>
|
</build>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
|
<!-- Offline
|
||||||
<repository>
|
<repository>
|
||||||
<id>vik1395-repo</id>
|
<id>vik1395-repo</id>
|
||||||
<url>https://vik1395.github.io/repo.vik1395.me/repositories</url>
|
<url>https://vik1395.github.io/repo.vik1395.me/repositories</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
-->
|
||||||
|
|
||||||
<repository>
|
<repository>
|
||||||
<id>codemc-repo</id>
|
<id>codemc-repo</id>
|
||||||
@ -88,13 +90,16 @@
|
|||||||
<groupId>me.vik1395</groupId>
|
<groupId>me.vik1395</groupId>
|
||||||
<artifactId>BungeeAuth</artifactId>
|
<artifactId>BungeeAuth</artifactId>
|
||||||
<version>1.4</version>
|
<version>1.4</version>
|
||||||
<scope>provided</scope>
|
<scope>system</scope>
|
||||||
|
<systemPath>${project.basedir}/lib/BungeeAuth-1.4.jar</systemPath>
|
||||||
|
<!--
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>*</groupId>
|
<groupId>*</groupId>
|
||||||
<artifactId>*</artifactId>
|
<artifactId>*</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
|
-->
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
@ -0,0 +1,39 @@
|
|||||||
|
package com.github.games647.fastlogin.bungee.event;
|
||||||
|
|
||||||
|
import com.github.games647.fastlogin.core.StoredProfile;
|
||||||
|
import com.github.games647.fastlogin.core.shared.LoginSession;
|
||||||
|
import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent;
|
||||||
|
import net.md_5.bungee.api.plugin.Cancellable;
|
||||||
|
import net.md_5.bungee.api.plugin.Event;
|
||||||
|
|
||||||
|
public class BungeeFastLoginAutoLoginEvent extends Event implements FastLoginAutoLoginEvent, Cancellable {
|
||||||
|
|
||||||
|
private final LoginSession session;
|
||||||
|
private final StoredProfile profile;
|
||||||
|
private boolean cancelled;
|
||||||
|
|
||||||
|
public BungeeFastLoginAutoLoginEvent(LoginSession session, StoredProfile profile) {
|
||||||
|
this.session = session;
|
||||||
|
this.profile = profile;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LoginSession getSession() {
|
||||||
|
return session;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StoredProfile getProfile() {
|
||||||
|
return profile;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCancelled() {
|
||||||
|
return cancelled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setCancelled(boolean cancelled) {
|
||||||
|
this.cancelled = cancelled;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.github.games647.fastlogin.bungee.event;
|
||||||
|
|
||||||
|
import com.github.games647.fastlogin.core.StoredProfile;
|
||||||
|
import com.github.games647.fastlogin.core.shared.LoginSource;
|
||||||
|
import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent;
|
||||||
|
import net.md_5.bungee.api.plugin.Event;
|
||||||
|
|
||||||
|
public class BungeeFastLoginPreLoginEvent extends Event implements FastLoginPreLoginEvent {
|
||||||
|
|
||||||
|
private final String username;
|
||||||
|
private final LoginSource source;
|
||||||
|
private final StoredProfile profile;
|
||||||
|
|
||||||
|
public BungeeFastLoginPreLoginEvent(String username, LoginSource source, StoredProfile profile) {
|
||||||
|
this.username = username;
|
||||||
|
this.source = source;
|
||||||
|
this.profile = profile;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUsername() {
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LoginSource getSource() {
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StoredProfile getProfile() {
|
||||||
|
return profile;
|
||||||
|
}
|
||||||
|
}
|
@ -3,9 +3,11 @@ package com.github.games647.fastlogin.bungee.task;
|
|||||||
import com.github.games647.fastlogin.bungee.BungeeLoginSession;
|
import com.github.games647.fastlogin.bungee.BungeeLoginSession;
|
||||||
import com.github.games647.fastlogin.bungee.BungeeLoginSource;
|
import com.github.games647.fastlogin.bungee.BungeeLoginSource;
|
||||||
import com.github.games647.fastlogin.bungee.FastLoginBungee;
|
import com.github.games647.fastlogin.bungee.FastLoginBungee;
|
||||||
|
import com.github.games647.fastlogin.bungee.event.BungeeFastLoginPreLoginEvent;
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
import com.github.games647.fastlogin.core.StoredProfile;
|
||||||
import com.github.games647.fastlogin.core.shared.JoinManagement;
|
import com.github.games647.fastlogin.core.shared.JoinManagement;
|
||||||
|
|
||||||
|
import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent;
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.connection.PendingConnection;
|
import net.md_5.bungee.api.connection.PendingConnection;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
@ -41,6 +43,13 @@ public class AsyncPremiumCheck extends JoinManagement<ProxiedPlayer, CommandSend
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FastLoginPreLoginEvent callFastLoginPreLoginEvent(String username, BungeeLoginSource source,
|
||||||
|
StoredProfile profile) {
|
||||||
|
return plugin.getProxy().getPluginManager()
|
||||||
|
.callEvent(new BungeeFastLoginPreLoginEvent(username, source, profile));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void requestPremiumLogin(BungeeLoginSource source, StoredProfile profile,
|
public void requestPremiumLogin(BungeeLoginSource source, StoredProfile profile,
|
||||||
String username, boolean registered) {
|
String username, boolean registered) {
|
||||||
|
@ -2,6 +2,8 @@ package com.github.games647.fastlogin.bungee.task;
|
|||||||
|
|
||||||
import com.github.games647.fastlogin.bungee.BungeeLoginSession;
|
import com.github.games647.fastlogin.bungee.BungeeLoginSession;
|
||||||
import com.github.games647.fastlogin.bungee.FastLoginBungee;
|
import com.github.games647.fastlogin.bungee.FastLoginBungee;
|
||||||
|
import com.github.games647.fastlogin.bungee.event.BungeeFastLoginAutoLoginEvent;
|
||||||
|
import com.github.games647.fastlogin.core.StoredProfile;
|
||||||
import com.github.games647.fastlogin.core.message.ChannelMessage;
|
import com.github.games647.fastlogin.core.message.ChannelMessage;
|
||||||
import com.github.games647.fastlogin.core.message.LoginActionMessage;
|
import com.github.games647.fastlogin.core.message.LoginActionMessage;
|
||||||
import com.github.games647.fastlogin.core.message.LoginActionMessage.Type;
|
import com.github.games647.fastlogin.core.message.LoginActionMessage.Type;
|
||||||
@ -11,6 +13,7 @@ import com.github.games647.fastlogin.core.shared.LoginSession;
|
|||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent;
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
@ -51,6 +54,12 @@ public class ForceLoginTask
|
|||||||
return super.forceLogin(player);
|
return super.forceLogin(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FastLoginAutoLoginEvent callFastLoginAutoLoginEvent(LoginSession session, StoredProfile profile) {
|
||||||
|
return core.getPlugin().getProxy().getPluginManager()
|
||||||
|
.callEvent(new BungeeFastLoginAutoLoginEvent(session, profile));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean forceRegister(ProxiedPlayer player) {
|
public boolean forceRegister(ProxiedPlayer player) {
|
||||||
return session.isAlreadyLogged() || super.forceRegister(player);
|
return session.isAlreadyLogged() || super.forceRegister(player);
|
||||||
|
@ -142,7 +142,7 @@ public class FastLoginCore<P extends C, C, T extends PlatformPlugin<C>> {
|
|||||||
public void sendLocaleMessage(String key, C receiver) {
|
public void sendLocaleMessage(String key, C receiver) {
|
||||||
String message = localeMessages.get(key);
|
String message = localeMessages.get(key);
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
plugin.sendMessage(receiver, message);
|
plugin.sendMultiLineMessage(receiver, message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ package com.github.games647.fastlogin.core.shared;
|
|||||||
import com.github.games647.fastlogin.core.AuthStorage;
|
import com.github.games647.fastlogin.core.AuthStorage;
|
||||||
import com.github.games647.fastlogin.core.StoredProfile;
|
import com.github.games647.fastlogin.core.StoredProfile;
|
||||||
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
||||||
|
import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent;
|
||||||
|
|
||||||
public abstract class ForceLoginManagement<P extends C, C, L extends LoginSession, T extends PlatformPlugin<C>>
|
public abstract class ForceLoginManagement<P extends C, C, L extends LoginSession, T extends PlatformPlugin<C>>
|
||||||
implements Runnable {
|
implements Runnable {
|
||||||
@ -40,7 +41,7 @@ public abstract class ForceLoginManagement<P extends C, C, L extends LoginSessio
|
|||||||
|| (core.getConfig().get("auto-register-unknown", false)
|
|| (core.getConfig().get("auto-register-unknown", false)
|
||||||
&& !authPlugin.isRegistered(playerName))) {
|
&& !authPlugin.isRegistered(playerName))) {
|
||||||
success = forceRegister(player);
|
success = forceRegister(player);
|
||||||
} else {
|
} else if (!callFastLoginAutoLoginEvent(session, playerProfile).isCancelled()) {
|
||||||
success = forceLogin(player);
|
success = forceLogin(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -93,6 +94,8 @@ public abstract class ForceLoginManagement<P extends C, C, L extends LoginSessio
|
|||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public abstract FastLoginAutoLoginEvent callFastLoginAutoLoginEvent(LoginSession session, StoredProfile profile);
|
||||||
|
|
||||||
public abstract void onForceActionSuccess(LoginSession session);
|
public abstract void onForceActionSuccess(LoginSession session);
|
||||||
|
|
||||||
public abstract String getName(P player);
|
public abstract String getName(P player);
|
||||||
|
@ -7,6 +7,7 @@ import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
|||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent;
|
||||||
import net.md_5.bungee.config.Configuration;
|
import net.md_5.bungee.config.Configuration;
|
||||||
|
|
||||||
public abstract class JoinManagement<P extends C, C, S extends LoginSource> {
|
public abstract class JoinManagement<P extends C, C, S extends LoginSource> {
|
||||||
@ -25,6 +26,8 @@ public abstract class JoinManagement<P extends C, C, S extends LoginSource> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
callFastLoginPreLoginEvent(username, source, profile);
|
||||||
|
|
||||||
Configuration config = core.getConfig();
|
Configuration config = core.getConfig();
|
||||||
|
|
||||||
String ip = source.getAddress().getAddress().getHostAddress();
|
String ip = source.getAddress().getAddress().getHostAddress();
|
||||||
@ -101,6 +104,8 @@ public abstract class JoinManagement<P extends C, C, S extends LoginSource> {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public abstract FastLoginPreLoginEvent callFastLoginPreLoginEvent(String username, S source, StoredProfile profile);
|
||||||
|
|
||||||
public abstract void requestPremiumLogin(S source, StoredProfile profile, String username, boolean registered);
|
public abstract void requestPremiumLogin(S source, StoredProfile profile, String username, boolean registered);
|
||||||
|
|
||||||
public abstract void startCrackedSession(S source, StoredProfile profile, String username);
|
public abstract void startCrackedSession(S source, StoredProfile profile, String username);
|
||||||
|
@ -15,6 +15,12 @@ public interface PlatformPlugin<C> {
|
|||||||
|
|
||||||
void sendMessage(C receiver, String message);
|
void sendMessage(C receiver, String message);
|
||||||
|
|
||||||
|
default void sendMultiLineMessage(C receiver, String message) {
|
||||||
|
for (String line : message.split("%nl%")) {
|
||||||
|
sendMessage(receiver, line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
default ThreadFactory getThreadFactory() {
|
default ThreadFactory getThreadFactory() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
package com.github.games647.fastlogin.core.shared.event;
|
||||||
|
|
||||||
|
import com.github.games647.fastlogin.core.StoredProfile;
|
||||||
|
import com.github.games647.fastlogin.core.shared.LoginSession;
|
||||||
|
|
||||||
|
public interface FastLoginAutoLoginEvent extends FastLoginCancellableEvent {
|
||||||
|
LoginSession getSession();
|
||||||
|
StoredProfile getProfile();
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package com.github.games647.fastlogin.core.shared.event;
|
||||||
|
|
||||||
|
public interface FastLoginCancellableEvent {
|
||||||
|
|
||||||
|
boolean isCancelled();
|
||||||
|
void setCancelled(boolean cancelled);
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.github.games647.fastlogin.core.shared.event;
|
||||||
|
|
||||||
|
import com.github.games647.fastlogin.core.StoredProfile;
|
||||||
|
import com.github.games647.fastlogin.core.shared.LoginSource;
|
||||||
|
|
||||||
|
public interface FastLoginPreLoginEvent {
|
||||||
|
|
||||||
|
String getUsername();
|
||||||
|
LoginSource getSource();
|
||||||
|
StoredProfile getProfile();
|
||||||
|
}
|
Reference in New Issue
Block a user