Skip to content

Commit

Permalink
Revert via merge
Browse files Browse the repository at this point in the history
  • Loading branch information
rfresh2 committed Aug 20, 2023
1 parent 685a7f5 commit 5f23ae9
Show file tree
Hide file tree
Showing 23 changed files with 11 additions and 1,045 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/act-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
java-version: '20.0.2'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
# native-image-musl: true
native-image-musl: true

- name: Set ACT Runner Env Variables
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/native-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
java-version: '20.0.2'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
# native-image-musl: true
native-image-musl: true

- name: Echo Versions and Paths
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/native-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
java-version: '20.0.2'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
# native-image-musl: true
native-image-musl: true

- name: Echo Versions and Paths
run: |
Expand Down
15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,6 @@ ZenithProxy has 3 release channels:
* `accountOwnerRoleId` -> a discord role ID that allows managing sensitive configuration like the whitelist
* `chatRelay.channelId` -> The channel ID where the MC server chat relay will be sent and received from.

### ViaVersion

[ViaVersion](https://github.com/ViaVersion/ViaVersion) is a software library that allows clients with differing Minecraft versions to connect to servers.

The conversion is not perfect, so expect issues. For example, a 1.12.2 client cannot view or explore the increased world heights introduced in 1.18

ZenithProxy has ViaVersion built-in, but it must be manually configured in the `config.json`:
* `viaversion.enabled` -> set to `true` to use ZenithProxy's ViaVersion
* `viaversion.protocolVersion` -> the [MC protocol version](https://wiki.vg/Protocol_version_numbers#Versions_after_the_Netty_rewrite) of the server you are connecting to.

**Do not enable ViaVersion if the server already has ViaVersion installed (e.g. 2b2t).**
**Certain Anti-Cheats will behave significantly different if ViaVersion is on the server vs the client (ZenithProxy).**

You must use the `git` or `java` release channels to use ZenithProxy's ViaVersion. Further compatibility testing will be completed at a later time.

## Run

* `./launch.sh` (Linux) or `.\launch.bat` (Windows)
Expand Down
15 changes: 3 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ repositories {
name = "paper"
url "https://papermc.io/repo/repository/maven-public/"
}
maven {
"ViaVersion"
url "https://repo.viaversion.com"
}
mavenLocal()
}

Expand Down Expand Up @@ -203,7 +199,7 @@ dependencies {
shade("com.discord4j:discord4j-core:3.3.0-M2") {
exclude group: 'io.netty'
}
shade("com.github.rfresh2:MCProtocolLib:8452a4e1d") {
shade("com.github.rfresh2:MCProtocolLib:f9755d5768") {
exclude group: 'io.netty.incubator'
exclude group: 'io.netty'
}
Expand All @@ -230,10 +226,6 @@ dependencies {
shade 'com.nukkitx.fastutil:fastutil-object-int-maps:8.5.3'
shade 'com.nukkitx.fastutil:fastutil-long-object-maps:8.5.3'

shade "com.viaversion:viaversion:4.7.0"
shade "com.viaversion:viaversion-api:4.7.0"
shade "com.viaversion:viabackwards:4.7.0"

shade 'org.jline:jline:3.23.0'
shade 'org.jline:jline-terminal-jansi:3.23.0'
testImplementation "org.junit.jupiter:junit-jupiter:5.10.0"
Expand Down Expand Up @@ -423,11 +415,10 @@ graalvmNative {
"--report-unsupported-elements-at-runtime",
"-H:+ReportExceptionStackTraces",
"-H:DeadlockWatchdogInterval=30",
"-H:IncludeLocales=en",
// "-H:DashboardDump=imageDashboardDump",
// "-H:+DashboardAll",
// "--static",
// "--libc=musl",
"--static",
"--libc=musl",
"-R:MaxHeapSize=150m",
// "--pgo-instrument",
"-march=x86-64-v3",
Expand Down
15 changes: 1 addition & 14 deletions src/main/java/com/zenith/Proxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
import com.zenith.network.server.handler.ProxyServerLoginHandler;
import com.zenith.util.Config;
import com.zenith.util.Wait;
import com.zenith.via.MCProxyViaServerProxy;
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import lombok.Getter;
import lombok.Setter;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -298,16 +294,7 @@ public synchronized void connect() {
this.client.setFlag(BuiltinFlags.ATTEMPT_SRV_RESOLVE, false);
}
this.client.setFlag(BuiltinFlags.PRINT_DEBUG, true);
if (CONFIG.client.viaversion.enabled) {
ChannelInitializer<Channel> originalChannelInitializer = this.client.buildChannelInitializer();
final MCProxyViaServerProxy viaProxy = new MCProxyViaServerProxy();
viaProxy.init();
ChannelInitializer<Channel> viaChannelInitializer = viaProxy.inject(originalChannelInitializer);
Bootstrap bootstrap = this.client.buildBootstrap(viaChannelInitializer);
this.client.connect(true, bootstrap);
} else {
this.client.connect(true);
}
this.client.connect(true);
}

public boolean isConnected() {
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/com/zenith/util/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ public static final class Client {
public Extra extra = new Extra();
public Server server = new Server();
public boolean autoConnect = false; // auto-connect proxy on process start
public ViaVersion viaversion = new ViaVersion();

public static final class ViaVersion {
public boolean enabled = false;
public int protocolVersion = 762; // 1.19.4
}

public static final class Extra {
public AntiAFK antiafk = new AntiAFK();
Expand Down
28 changes: 0 additions & 28 deletions src/main/java/com/zenith/via/MCProxyProtocolDetectorService.java

This file was deleted.

185 changes: 0 additions & 185 deletions src/main/java/com/zenith/via/MCProxyViaServerProxy.java

This file was deleted.

This file was deleted.

Loading

0 comments on commit 5f23ae9

Please sign in to comment.