mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2026-01-30 18:12:27 +01:00
diff --git a/bukkit/pom.xml b/bukkit/pom.xml
index 13e466e..2494a2b 100644
--- a/bukkit/pom.xml
+++ b/bukkit/pom.xml
@@ -186,7 +186,7 @@
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
- <version>4.8.0</version>
+ <version>5.0.0-SNAPSHOT</version>
<scope>provided</scope>
<exclusions>
<exclusion>
diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/VerifyResponseTask.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/VerifyResponseTask.java
index 5a2794d..2e60cd1 100644
--- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/VerifyResponseTask.java
+++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/VerifyResponseTask.java
@@ -28,7 +28,7 @@ package com.github.games647.fastlogin.bukkit.listener.protocollib;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.events.PacketContainer;
import com.comphenix.protocol.events.PacketEvent;
-import com.comphenix.protocol.injector.server.TemporaryPlayerFactory;
+import com.comphenix.protocol.injector.temporary.TemporaryPlayerFactory;
import com.comphenix.protocol.reflect.FieldUtils;
import com.comphenix.protocol.reflect.FuzzyReflection;
import com.comphenix.protocol.utility.MinecraftReflection;
@@ -37,18 +37,14 @@ import com.comphenix.protocol.wrappers.WrappedChatComponent;
import com.comphenix.protocol.wrappers.WrappedGameProfile;
import com.github.games647.craftapi.model.auth.Verification;
import com.github.games647.craftapi.model.skin.SkinProperty;
-import com.github.games647.craftapi.resolver.AbstractResolver;
import com.github.games647.craftapi.resolver.MojangResolver;
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import java.net.*;
-import java.nio.charset.StandardCharsets;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
import java.security.GeneralSecurityException;
import java.security.Key;
import java.security.KeyPair;
@@ -263,15 +259,11 @@ public class VerifyResponseTask implements Runnable {
private void kickPlayer(String reason) {
PacketContainer kickPacket = new PacketContainer(DISCONNECT);
kickPacket.getChatComponents().write(0, WrappedChatComponent.fromText(reason));
- try {
- //send kick packet at login state
- //the normal event.getPlayer.kickPlayer(String) method does only work at play state
- ProtocolLibrary.getProtocolManager().sendServerPacket(player, kickPacket);
- //tell the server that we want to close the connection
- player.kickPlayer("Disconnect");
- } catch (InvocationTargetException ex) {
- plugin.getLog().error("Error sending kick packet for: {}", player, ex);
- }
+ //send kick packet at login state
+ //the normal event.getPlayer.kickPlayer(String) method does only work at play state
+ ProtocolLibrary.getProtocolManager().sendServerPacket(player, kickPacket);
+ //tell the server that we want to close the connection
+ player.kickPlayer("Disconnect");
}
//fake a new login packet in order to let the server handle all the other stuff
@@ -287,14 +279,8 @@ public class VerifyResponseTask implements Runnable {
startPacket.getGameProfiles().write(0, fakeProfile);
}
- try {
- //we don't want to handle our own packets so ignore filters
- startPacket.setMeta(ProtocolLibListener.SOURCE_META_KEY, plugin.getName());
- ProtocolLibrary.getProtocolManager().recieveClientPacket(player, startPacket, true);
- } catch (InvocationTargetException | IllegalAccessException ex) {
- plugin.getLog().warn("Failed to fake a new start packet for: {}", username, ex);
- //cancel the event in order to prevent the server receiving an invalid packet
- kickPlayer(plugin.getCore().getMessage("error-kick"));
- }
+ //we don't want to handle our own packets so ignore filters
+ startPacket.setMeta(ProtocolLibListener.SOURCE_META_KEY, plugin.getName());
+ ProtocolLibrary.getProtocolManager().receiveClientPacket(player, startPacket, true);
}
}
356 lines
13 KiB
XML
356 lines
13 KiB
XML
<!--
|
|
|
|
SPDX-License-Identifier: MIT
|
|
|
|
The MIT License (MIT)
|
|
|
|
Copyright (c) 2015-2022 games647 and contributors
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
in the Software without restriction, including without limitation the rights
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
SOFTWARE.
|
|
|
|
-->
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
<modelVersion>4.0.0</modelVersion>
|
|
|
|
<parent>
|
|
<groupId>com.github.games647</groupId>
|
|
<artifactId>fastlogin</artifactId>
|
|
<version>1.12-SNAPSHOT</version>
|
|
<relativePath>../pom.xml</relativePath>
|
|
</parent>
|
|
|
|
<!--This has to be in lowercase because it's used by plugin.yml-->
|
|
<artifactId>fastlogin.bukkit</artifactId>
|
|
<packaging>jar</packaging>
|
|
|
|
<name>FastLoginBukkit</name>
|
|
|
|
<build>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-shade-plugin</artifactId>
|
|
<version>3.3.0</version>
|
|
<configuration>
|
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
|
<shadedArtifactAttached>false</shadedArtifactAttached>
|
|
<relocations>
|
|
<relocation>
|
|
<pattern>com.zaxxer.hikari</pattern>
|
|
<shadedPattern>fastlogin.hikari</shadedPattern>
|
|
</relocation>
|
|
<relocation>
|
|
<pattern>org.slf4j</pattern>
|
|
<shadedPattern>fastlogin.slf4j</shadedPattern>
|
|
</relocation>
|
|
<relocation>
|
|
<pattern>net.md_5.bungee.config</pattern>
|
|
<shadedPattern>fastlogin.config</shadedPattern>
|
|
</relocation>
|
|
<relocation>
|
|
<pattern>com.google.gson</pattern>
|
|
<shadedPattern>fastlogin.gson</shadedPattern>
|
|
</relocation>
|
|
<relocation>
|
|
<pattern>com.google.common</pattern>
|
|
<shadedPattern>fastlogin.guava</shadedPattern>
|
|
<excludes>
|
|
<exclude>com.google.common.collect.Multimap</exclude>
|
|
</excludes>
|
|
</relocation>
|
|
<relocation>
|
|
<pattern>io.papermc.lib</pattern>
|
|
<shadedPattern>fastlogin.paperlib</shadedPattern>
|
|
</relocation>
|
|
</relocations>
|
|
<!-- Rename the service file too to let SLF4J api find our own relocated jdk logger -->
|
|
<!-- Located in META-INF/services -->
|
|
<transformers>
|
|
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
|
|
</transformers>
|
|
<minimizeJar>true</minimizeJar>
|
|
<filters>
|
|
<filter>
|
|
<artifact>*:*</artifact>
|
|
<excludes>
|
|
<exclude>META-INF/MANIFEST.MF</exclude>
|
|
<exclude>**/module-info.class</exclude>
|
|
</excludes>
|
|
</filter>
|
|
</filters>
|
|
</configuration>
|
|
<executions>
|
|
<execution>
|
|
<phase>package</phase>
|
|
<goals>
|
|
<goal>shade</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
|
|
<repositories>
|
|
<!-- PaperSpigot API and PaperLib -->
|
|
<repository>
|
|
<id>papermc</id>
|
|
<url>https://papermc.io/repo/repository/maven-public/</url>
|
|
</repository>
|
|
|
|
<!-- ProtocolLib -->
|
|
<repository>
|
|
<id>dmulloy2-repo</id>
|
|
<url>https://repo.dmulloy2.net/repository/public/</url>
|
|
<snapshots>
|
|
<enabled>false</enabled>
|
|
</snapshots>
|
|
</repository>
|
|
|
|
<!-- AuthMe Reloaded, xAuth and LoginSecurity -->
|
|
<repository>
|
|
<id>codemc-releases</id>
|
|
<url>https://repo.codemc.io/repository/maven-public/</url>
|
|
<snapshots>
|
|
<enabled>false</enabled>
|
|
</snapshots>
|
|
</repository>
|
|
|
|
<!-- PlaceholderAPI -->
|
|
<repository>
|
|
<id>placeholderapi</id>
|
|
<url>https://repo.extendedclip.com/content/repositories/placeholderapi</url>
|
|
<snapshots>
|
|
<enabled>false</enabled>
|
|
</snapshots>
|
|
</repository>
|
|
|
|
<!-- GitHub automatic maven builds -->
|
|
<repository>
|
|
<id>jitpack.io</id>
|
|
<url>https://jitpack.io</url>
|
|
<snapshots>
|
|
<enabled>false</enabled>
|
|
</snapshots>
|
|
</repository>
|
|
</repositories>
|
|
|
|
<dependencies>
|
|
<!--Common plugin component-->
|
|
<dependency>
|
|
<groupId>com.github.games647</groupId>
|
|
<artifactId>fastlogin.core</artifactId>
|
|
<version>${project.version}</version>
|
|
</dependency>
|
|
|
|
<!-- PaperSpigot API for correcting user cache usage -->
|
|
<dependency>
|
|
<groupId>io.papermc.paper</groupId>
|
|
<artifactId>paper-api</artifactId>
|
|
<version>1.18-R0.1-SNAPSHOT</version>
|
|
<scope>provided</scope>
|
|
<!-- Use our own newer api version -->
|
|
<exclusions>
|
|
<exclusion>
|
|
<groupId>org.slf4j</groupId>
|
|
<artifactId>slf4j-api</artifactId>
|
|
</exclusion>
|
|
</exclusions>
|
|
</dependency>
|
|
|
|
<!-- PaperLib for checking if server uses PaperSpigot -->
|
|
<dependency>
|
|
<groupId>io.papermc</groupId>
|
|
<artifactId>paperlib</artifactId>
|
|
<version>1.0.7</version>
|
|
</dependency>
|
|
|
|
<!--Library for listening and sending Minecraft packets-->
|
|
<dependency>
|
|
<groupId>com.comphenix.protocol</groupId>
|
|
<artifactId>ProtocolLib</artifactId>
|
|
<version>5.0.0-SNAPSHOT</version>
|
|
<scope>provided</scope>
|
|
<exclusions>
|
|
<exclusion>
|
|
<groupId>*</groupId>
|
|
<artifactId>*</artifactId>
|
|
</exclusion>
|
|
</exclusions>
|
|
</dependency>
|
|
|
|
<!--Changing onlinemode on login process-->
|
|
<dependency>
|
|
<groupId>com.github.ProtocolSupport</groupId>
|
|
<artifactId>ProtocolSupport</artifactId>
|
|
<!--4.29.dev after commit about API improvements-->
|
|
<version>3a80c661fe</version>
|
|
<scope>provided</scope>
|
|
<exclusions>
|
|
<exclusion>
|
|
<groupId>*</groupId>
|
|
<artifactId>*</artifactId>
|
|
</exclusion>
|
|
</exclusions>
|
|
</dependency>
|
|
|
|
<!--Floodgate for Xbox Live Authentication-->
|
|
<dependency>
|
|
<groupId>org.geysermc.floodgate</groupId>
|
|
<artifactId>api</artifactId>
|
|
<version>2.2.0-SNAPSHOT</version>
|
|
<scope>provided</scope>
|
|
<exclusions>
|
|
<exclusion>
|
|
<groupId>io.netty</groupId>
|
|
<artifactId>*</artifactId>
|
|
</exclusion>
|
|
<exclusion>
|
|
<groupId>org.geysermc.cumulus</groupId>
|
|
<artifactId>*</artifactId>
|
|
</exclusion>
|
|
</exclusions>
|
|
</dependency>
|
|
|
|
<!-- Bedrock player bridge -->
|
|
<dependency>
|
|
<groupId>org.geysermc</groupId>
|
|
<artifactId>core</artifactId>
|
|
<version>${geyser.version}</version>
|
|
<scope>provided</scope>
|
|
<exclusions>
|
|
<exclusion>
|
|
<groupId>*</groupId>
|
|
<artifactId>*</artifactId>
|
|
</exclusion>
|
|
</exclusions>
|
|
</dependency>
|
|
|
|
<!-- We need the API, but it was excluded above -->
|
|
<dependency>
|
|
<groupId>org.geysermc</groupId>
|
|
<artifactId>geyser-api</artifactId>
|
|
<version>${geyser.version}</version>
|
|
<scope>provided</scope>
|
|
</dependency>
|
|
|
|
<!--Provide premium placeholders-->
|
|
<dependency>
|
|
<groupId>me.clip</groupId>
|
|
<artifactId>placeholderapi</artifactId>
|
|
<version>2.11.1</version>
|
|
<scope>provided</scope>
|
|
<optional>true</optional>
|
|
<exclusions>
|
|
<exclusion>
|
|
<groupId>*</groupId>
|
|
<artifactId>*</artifactId>
|
|
</exclusion>
|
|
</exclusions>
|
|
</dependency>
|
|
|
|
<!--Login Plugins-->
|
|
<dependency>
|
|
<groupId>fr.xephi</groupId>
|
|
<artifactId>authme</artifactId>
|
|
<version>5.4.0</version>
|
|
<scope>provided</scope>
|
|
<optional>true</optional>
|
|
<exclusions>
|
|
<exclusion>
|
|
<groupId>*</groupId>
|
|
<artifactId>*</artifactId>
|
|
</exclusion>
|
|
</exclusions>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>com.lenis0012.bukkit</groupId>
|
|
<artifactId>loginsecurity</artifactId>
|
|
<version>3.1</version>
|
|
<scope>provided</scope>
|
|
<optional>true</optional>
|
|
<exclusions>
|
|
<exclusion>
|
|
<groupId>*</groupId>
|
|
<artifactId>*</artifactId>
|
|
</exclusion>
|
|
</exclusions>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>com.github.games647</groupId>
|
|
<artifactId>LogIt</artifactId>
|
|
<version>9e3581db27</version>
|
|
<scope>provided</scope>
|
|
<optional>true</optional>
|
|
<exclusions>
|
|
<exclusion>
|
|
<groupId>*</groupId>
|
|
<artifactId>*</artifactId>
|
|
</exclusion>
|
|
</exclusions>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>de.luricos.bukkit</groupId>
|
|
<artifactId>xAuth</artifactId>
|
|
<version>2.6</version>
|
|
<scope>provided</scope>
|
|
<optional>true</optional>
|
|
<!--These artifacts produce conflicts on downloading-->
|
|
<exclusions>
|
|
<exclusion>
|
|
<groupId>*</groupId>
|
|
<artifactId>*</artifactId>
|
|
</exclusion>
|
|
</exclusions>
|
|
</dependency>
|
|
|
|
<!--No maven repository :(-->
|
|
<dependency>
|
|
<groupId>de.st_ddt.crazy</groupId>
|
|
<artifactId>CrazyCore</artifactId>
|
|
<version>10.7.7</version>
|
|
<optional>true</optional>
|
|
<scope>system</scope>
|
|
<systemPath>${project.basedir}/lib/CrazyCore v10.7.7.jar</systemPath>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>de.st_ddt.crazy</groupId>
|
|
<artifactId>CrazyLogin</artifactId>
|
|
<version>7.23</version>
|
|
<optional>true</optional>
|
|
<scope>system</scope>
|
|
<systemPath>${project.basedir}/lib/CrazyLogin v7.23.2.jar</systemPath>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>ultraauth</groupId>
|
|
<artifactId>ultraauth</artifactId>
|
|
<version>2.0.2</version>
|
|
<optional>true</optional>
|
|
<scope>system</scope>
|
|
<systemPath>${project.basedir}/lib/UltraAuth v2.1.2.jar</systemPath>
|
|
</dependency>
|
|
</dependencies>
|
|
</project>
|