https://github.com/xxdark/passthrough
Reduce proxy CPU usage by passing packets through
https://github.com/xxdark/passthrough
bungeecord minecraft papermc waterfall
Last synced: about 2 months ago
JSON representation
Reduce proxy CPU usage by passing packets through
- Host: GitHub
- URL: https://github.com/xxdark/passthrough
- Owner: xxDark
- License: mit
- Created: 2021-09-15T22:13:15.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-17T18:45:47.000Z (over 3 years ago)
- Last Synced: 2025-01-17T12:26:00.727Z (3 months ago)
- Topics: bungeecord, minecraft, papermc, waterfall
- Language: Java
- Homepage:
- Size: 67.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
PassThrough
===========
**DISCLAIMER**: this plugin is useless unless you are using compression.What is this?
-------------The plugin allows proxies to pass packets through: they will not be handled by the proxy, and forwarded directly to the
player. The goal is to reduce CPU usage on proxies that could've been spent on packet decompression/compression.---
Building:
---------Requires JDK **16** to build.
Clone Paper and BungeeCord,
For Paper, run `./gradlew publishToMavenLocal`
For BungeeCord, run `./mvn install`
Finally, run `./gradlew build` to build this plugin.---
Tuning:
---------By default, the plugin does not filter any packets.
You must decide by yourself which packets you want to keep from being proceed by the proxy.
Plugin exposes it's API via Bukkit services,
see `dev.xdark.passthrough.PacketPassThroughApi` for more info.---
Example:
---------```Java
import dev.xdark.passthrough.PacketPassThroughApi;
import net.minecraft.network.protocol.game.ClientboundDisconnectPacket;
import net.minecraft.network.protocol.game.ClientboundLoginPacket;
import net.minecraft.network.protocol.login.ClientboundGameProfilePacket;
import org.bukkit.plugin.java.JavaPlugin;public final class MyFilterPlugin extends JavaPlugin {
@Override
public void onEnable() {
PacketPassThroughApi api =
getServer().getServicesManager().getRegistration(PacketPassThroughApi.class).getProvider();
api.addPassThrough(
this,
packet ->
// Filter any packet except these that are required for login/disconnect
!(packet instanceof ClientboundGameProfilePacket)
&& !(packet instanceof ClientboundLoginPacket)
&& !(packet instanceof ClientboundDisconnectPacket));
}
}
```---
WARNING
=======The compression on both proxy and the server **MUST** be set to the same value, otherwise things will **NOT** work
properly.---