Skip to content

Commit 689a440

Browse files
committed
Initial commit
0 parents  commit 689a440

9 files changed

Lines changed: 955 additions & 0 deletions

File tree

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# HAProxyProtocolImplementor for Bukkit
2+
3+
This is a simple Plugin made with the help of [TinyProtocol](https://github.com/dmulloy2/ProtocolLib/tree/master/TinyProtocol/src/main/java/com/comphenix/tinyprotocol)
4+
that allows ha proxy messages to be decoded and handled. This means that source addresses will be replaced with
5+
given ips.
6+
7+
Also checkout **[NeoProtect](https://neoprotect.net/)** where you are able to use this plugin with.
8+
9+
Have fun with it :)

build.gradle

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
plugins {
2+
id 'java'
3+
id 'com.github.johnrengelman.shadow' version '7.1.2'
4+
}
5+
6+
group 'de.ytendx'
7+
version '1.0-SNAPSHOT'
8+
9+
repositories {
10+
mavenCentral()
11+
maven {
12+
name = 'spigotmc-repo'
13+
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
14+
}
15+
}
16+
17+
shadowJar {
18+
}
19+
tasks.assemble.dependsOn tasks.shadowJar
20+
21+
dependencies {
22+
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
23+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
24+
compileOnly 'org.bukkit:bukkit:1.8-R0.1-SNAPSHOT'
25+
implementation 'io.netty:netty-codec-haproxy:4.1.0.CR3'
26+
// https://mvnrepository.com/artifact/io.netty/netty-codec
27+
}
28+
29+
test {
30+
useJUnitPlatform()
31+
}

gradlew

Lines changed: 185 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 89 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
rootProject.name = 'HAProxyProtocolSpigot'
2+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package de.ytendx.haproxy;
2+
3+
import de.ytendx.haproxy.tinyprotocol.TinyProtocol;
4+
import org.bukkit.ChatColor;
5+
import org.bukkit.plugin.java.JavaPlugin;
6+
7+
public class HAProxySpigotImplementor extends JavaPlugin {
8+
9+
@Override
10+
public void onEnable() {
11+
getLogger().info("HAProxySpigotImplementor by ytendx using TinyProtocol is being activated....");
12+
13+
getLogger().info("----------------------------------------------------------------------------");
14+
getLogger().info("We recommend protecting your server with NeoProtect (https://neoprotect.net/)");
15+
getLogger().info("----------------------------------------------------------------------------");
16+
17+
new TinyProtocol(this);
18+
19+
this.getCommand("haproxyimplementor").setExecutor((sender, command, label, args) -> {
20+
sender.sendMessage(ChatColor.GRAY + "The server uses HAProxyImplementor made by "
21+
+ ChatColor.YELLOW + "ytendx " + ChatColor.GRAY + "for " + ChatColor.AQUA + "NeoProtect.net");
22+
return true;
23+
});
24+
25+
getLogger().info("HAProxySpigotImplementor was successfully activated!");
26+
}
27+
28+
@Override
29+
public void onDisable() {
30+
getLogger().info("HAProxySpigotImplementor is now deactivated!");
31+
}
32+
}

0 commit comments

Comments
 (0)