TCPShield / RealIP

The Spigot, Bungee and Velocity plugin that parses client IP addresses passed from the TCPShield network.
https://tcpshield.com
MIT License
145 stars 52 forks source link

TCPShield v2.5 #38

Closed paulzhng closed 2 years ago

paulzhng commented 3 years ago

This PR adds support for Geyser, Fabric and Paper without ProtocolLib and removes the illegal access message in some cases.

Geyser

Geyser support only targets Floodgate 2.0 (still in beta). Huge, huge thanks to the whole GeyserMC team and specifically Tim203 for their incredible support on this journey.

Native Paper

Native paper support depends on a PR only merged recently so it only supports Paper 1.16 build #503 or higher.

Illegal Access

The illegal access message is removed in cases where it isn't needed. The final field is now queried lazily (when it's needed).

Fabric

see #40

paulzhng commented 3 years ago

Pending until Floodgate 2.0 is released

Prof-Bloodstone commented 3 years ago

Hey, I know this will be fixed when you officially release it, but for other folks who might decide to run this before it's released (for example because of dropped dependency on ProtocolLib on Paper):.

  1. The paper-api dependency version doesn't exist anymore, should just pin yourself to latest snapshot.
  2. You are missing repositories for floodgate - they are available at https://repo.opencollab.dev/maven-{releases,snapshots}
  3. The floodgate dependency has wrong group and package - should be org.geysermc.floodgate:spigot

Patch which takes it all together and makes it compileable on current floodgate snapshot:

diff --git a/build.gradle b/build.gradle
index be900c4..423b3ac 100644
--- a/build.gradle
+++ b/build.gradle
@@ -44,6 +44,12 @@ repositories {
     maven {
         url = 'https://maven.fabricmc.net/'
     }
+    maven {
+        url = 'https://repo.opencollab.dev/maven-snapshots'
+    }
+    maven {
+        url = 'https://repo.opencollab.dev/maven-releases'
+    }
     flatDir {
         dirs '/libs'
     }
@@ -55,7 +61,7 @@ dependencies {
     compileOnly group: 'com.comphenix.protocol', name: 'ProtocolLib', version: '4.4.0'

     // Paper
-    compileOnly group: 'com.destroystokyo.paper', name: 'paper-api', version: '1.16.5-R0.1-20210227.144841-85'
+    compileOnly group: 'com.destroystokyo.paper', name: 'paper-api', version: '1.16.5-R0.1-SNAPSHOT'

     // BungeeCord
     compileOnly group: 'net.md-5', name: 'bungeecord-api', version: '1.14-SNAPSHOT'
@@ -72,7 +78,7 @@ dependencies {
     testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.7.0-M1'
     testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.7.0-M1'

-    compileOnly 'org.geyser:floodgate-spigot:2.0'
+    compileOnly 'org.geysermc.floodgate:spigot:2.0-SNAPSHOT'
 }

 test {
@@ -167,4 +173,4 @@ void updateJson() {
     }
 }

-build.dependsOn updateVersion
\ No newline at end of file
+build.dependsOn updateVersion
Camotoy commented 2 years ago

Floodgate can just reference the API module api; using the Spigot dependency is unnecessary here.