Skip to content

Commit 78ab296

Browse files
Merge branch 'libdeflate' into feat/modern-forwarding-legacy
2 parents 3646bc1 + 5c41262 commit 78ab296

600 files changed

Lines changed: 35980 additions & 7248 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ body:
4242
<summary>Example</summary>
4343
4444
```
45-
[17:44:10 INFO]: Velocity 3.3.0-SNAPSHOT (git-9d25d309-b400)
46-
[17:44:10 INFO]: Copyright 2018-2023 Velocity Contributors. Velocity is licensed under the terms of the GNU General Public License v3.
45+
[17:44:10 INFO]: Velocity 3.4.0-SNAPSHOT (git-6e80f577-b534)
46+
[17:44:10 INFO]: Copyright 2018-2026 Velocity Contributors. Velocity is licensed under the terms of the GNU General Public License v3.
4747
[17:44:10 INFO]: PaperMC - GitHub
4848
```
4949
</details>
@@ -66,4 +66,4 @@ body:
6666
2. You searched for and ensured there isn't already an open issue regarding this.
6767
6868
If you think you have a bug, but are not sure, feel free to ask in the `#velocity-help` channel on our
69-
[Discord](https://discord.gg/papermc).
69+
[Discord](https://discord.gg/papermc).

.github/ISSUE_TEMPLATE/feature-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ body:
4545
3. The feature you're requesting has to be implemented on Velocity and not on the backend server.
4646
4747
If you are unsure whether your problem can already be fixed in another way, feel free to ask in the `#velocity-help` channel on our
48-
[Discord](https://discord.gg/papermc).
48+
[Discord](https://discord.gg/papermc).

.github/workflows/gradle.yml

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
# For more information see: https://docs.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
33

44
name: Java CI with Gradle
5-
on: [push, pull_request]
5+
on:
6+
push:
7+
branches:
8+
- libdeflate
69

710
jobs:
811
build:
@@ -21,3 +24,41 @@ jobs:
2124
distribution: 'zulu'
2225
- name: Build with Gradle
2326
run: ./gradlew build
27+
28+
- name: Generate Release Tag
29+
id: release_tag
30+
run: |
31+
# Fetch all tags from remote
32+
git fetch --tags
33+
34+
# Get the latest build number from existing releases
35+
LATEST_BUILD=0
36+
37+
# Check if there are existing build tags and find the highest number
38+
if git tag | grep -E "^build-[0-9]+$" > /dev/null; then
39+
LATEST_BUILD=$(git tag | grep -E "^build-[0-9]+$" | sed 's/build-//' | sort -n | tail -1)
40+
fi
41+
42+
# Debug output
43+
echo "All tags:"
44+
git tag
45+
echo "Build tags found:"
46+
git tag | grep -E "^build-[0-9]+$" || echo "No build tags found"
47+
echo "Latest build number found: $LATEST_BUILD"
48+
49+
# Increment the build number
50+
NEW_BUILD=$((LATEST_BUILD + 1))
51+
52+
echo "tag=build-$NEW_BUILD" >> $GITHUB_OUTPUT
53+
echo "Generated tag: build-$NEW_BUILD"
54+
echo "Previous highest build: $LATEST_BUILD"
55+
echo "New build number: $NEW_BUILD"
56+
57+
- name: Upload Velocity
58+
uses: marvinpinto/action-automatic-releases@master
59+
with:
60+
title: "Velocity-CTD"
61+
automatic_release_tag: "${{ steps.release_tag.outputs.tag }}"
62+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
63+
files: "*/build/libs/*.jar"
64+
prerelease: false

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,4 @@ native/mbedtls
9696
native/zlib-ng
9797
native/zlib-cf
9898
native/libdeflate
99-
native/src/main/resources/linux_x86_64/velocity-cipher.so
99+
native/src/main/resources/linux_x86_64/velocity-cipher.so

README.md

Lines changed: 129 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
# Velocity
1+
# Velocity-CTD
22

3-
[![Build Status](https://img.shields.io/github/actions/workflow/status/PaperMC/Velocity/gradle.yml)](https://papermc.io/downloads/velocity)
4-
[![Join our Discord](https://img.shields.io/discord/289587909051416579.svg?logo=discord&label=)](https://discord.gg/papermc)
3+
[![Join my Discord](https://media3.giphy.com/media/v1.Y2lkPTc5MGI3NjExdG5sdGgwazRwYjh4djdsdXJwcHR5ajZrNGE2NDBvcTUzdXltbHp1cCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/fGIwpaCrtkFdHVksSu/giphy.gif)](https://discord.gg/beer)
54

65
A Minecraft server proxy with unparalleled server support, scalability,
76
and flexibility.
87

9-
Velocity is licensed under the GPLv3 license.
8+
Velocity-CTD is licensed under the GPLv3 license.
9+
10+
## Purpose
11+
12+
Velocity-CTD was created to replace poorly made plugins or
13+
plugins that simply cannot be better as a result of API limitations,
14+
lack of support/maintainability, infrequent bumping of integral
15+
dependencies, useful performance improvements, and more.
1016

1117
## Goals
1218

@@ -18,19 +24,133 @@ Velocity is licensed under the GPLv3 license.
1824
* First-class support for Paper, Sponge, Fabric and Forge. (Other implementations
1925
may work, but we make every endeavor to support these server implementations
2026
specifically.)
21-
27+
* Features that deliver an "all-in-one" experience with various features that
28+
we believe every network wants and needs.
29+
30+
## Additional Features/Removals
31+
32+
* Utilization of newer dependencies for virtually any dependency that can
33+
easily and fairly be upgraded to maintain the highest level of performance.
34+
* Implementation of full-fledged Redis database support to fully replace
35+
plugins like RedisBungee in attempts to maintain a stabler Redis experience.
36+
* Implementation of a highly dynamic and efficient queue system that is
37+
simplified in nature and intended to stably maintain thousands of players.
38+
* Implementation of a non-invasive multi-forwarding system that allows you
39+
to use a different forwarding method for specific servers on the backend.
40+
* Configurable `/alert` command sends messages across your entire network.
41+
* Configurable `/alertraw` command to send non-prefixed messages across your
42+
entire network.
43+
* Configurable `/find` command that locates yourself and other users.
44+
* `/hub` with `/lobby` alias that sends you to the/a fallback server,
45+
which synchronizes with the activation and deactivation of dynamic fallbacks.
46+
* Configurable `/ping` command that displays your and other users' ping.
47+
* Configurable `/plist` command that displays the total users on your proxy
48+
or from a defined proxy scope.
49+
* The `/send` supports sending users from `{SERVER_FROM}` to `{SERVER_TO}`.
50+
* Configurable `/transfer` command that allows you to move a player, "current" players,
51+
a specific server, or all players from one proxy to another.
52+
* Configurable `/velocity sudo` command to force users to execute a command on the
53+
proxy or even server level.
54+
* Configurable `/velocity uptime` command to view how long your proxy has been online for.
55+
* Implementation of configurable `/server {SERVER}` access for tab completion and
56+
command execution.
57+
* Choice implementation that allows you to fully strip, reload, and remove commands
58+
present in regular Velocity and require/force deactivation of commands for
59+
plugin overrides.
60+
* Configurable value to disable translation for header and footer for Velocity to
61+
improve performance in plugins like TAB that do not need it.
62+
* Configurable minimum version value that allows users to block users on versions
63+
older than your desired minimum server version (synchronizes with outdated pinger).
64+
* Fallback servers allow users to be sent to the least or most populated server,
65+
which will cycle for even distribution.
66+
* Configurable server brand and server pinger message (outdated and fallback).
67+
* Configurable removal of unsigned message kick/disconnection events for plugins
68+
with improper compatibility.
69+
* Configurable deactivation of Forge inbound handshakes for servers that do not
70+
run Forge or NeoForge as their server software.
71+
* Other miscellaneous optimizations and tweaks that will only continue to be
72+
implemented as this fork matures.
73+
* Preliminary MiniMessage support to permit full configurability of all Velocity
74+
messages, alongside `/velocity reload`able translations, alongside `/velocity reload`able
75+
server additions/removals inside the `velocity.toml`.
76+
* Removal of all language files except `messages.properties` to preserve
77+
maintainability. PRs (Pull Requests) are welcome to reimplement all language files
78+
with our changes.
79+
* And much, much more... Try it out and see what we have to offer for yourself!
80+
81+
## Velocity-CTD Permissions
82+
* `velocity.command.alert` [/alert] (Allows you to display public alerts
83+
to all users on the proxy or proxies, depending on your setup).
84+
* `velocity.command.alertraw` [/alertraw] (Allows you to display public non-formatted
85+
alerts to all users on the proxy or proxies, depending on your setup).
86+
* `velocity.command.find` [/find] (Allows you to find the specific server a user is
87+
actively connected to on the network).
88+
* `velocity.command.hub` [/hub & /lobby] (Allows you to be sent to the hub/lobby or
89+
your fallback server(s), depending on your setup).
90+
* `velocity.command.ping` [/ping] (Returns your latency of the proxy you are currently
91+
connected to and not the latency of the backend server).
92+
* `velocity.command.plist` [/plist] (Returns the total users on your proxy
93+
or from a defined proxy scope).
94+
* `velocity.command.sudo` [/velocity sudo] (Allows you to run a message or a command
95+
for a player).
96+
* `velocity.command.transfer` [/transfer] (Allows you to transfer a player, "current" players,
97+
a specific server, or all players from one proxy to another.)
98+
* `velocity.command.uptime` [/velocity uptime] (Displays how long the proxy has been
99+
online for, from immediate runtime).
100+
101+
## Velocity-CTD Queue Commands
102+
* `/server` [Default Aliases: `/queue` & `/joinqueue`]
103+
* `/leavequeue` [Default Alias: `/dequeue`]
104+
105+
## Administrative Commands
106+
* `/queueadmin add {PLAYER} {SERVER}`
107+
* `/queueadmin addall {SERVER_FROM} {SERVER_TO}`
108+
* `/queueadmin list`
109+
* `/queueadmin listqueues`
110+
* `/queueadmin pause {SERVER}`
111+
* `/queueadmin remove {PLAYER} {SERVER}` (Not including server name
112+
removes the user from all queues if multiple queuing is enabled).
113+
* `/queueadmin removeall {SERVER}`
114+
* `/queueadmin unpause {SERVER}`
115+
116+
## Velocity-CTD Queue Permissions
117+
* `velocity.queue.bypass` or `velocity.queue.bypass.{SERVER}` (Allows you to bypass the queue for all
118+
servers or a specific server).
119+
* `velocity.queue.leave` (Allows you to leave the queue you are in or all queues you are in).
120+
* `velocity.queue.priority.{ALL/SERVER}.{WEIGHT}` (Sets the position you are in for the/a queue).
121+
* `velocity.queue.timeout.{SECONDS}` (Specifies the amount of time a user has before they
122+
are unqueued from a server when disconnecting; if you reach the position where
123+
you can be sent and are offline, your queue position will reset, regardless of
124+
your specified timeout).
125+
126+
## Velocity-CTD Queue Administrative Permissions
127+
* `velocity.queue.admin.add` (Allows you to add a player to a queue).
128+
* `velocity.queue.admin.addall` (Allows you to add all players from a specific server to a queue).
129+
* `velocity.queue.admin.list` (Allows you to view the list of people queued for a specific server or all servers).
130+
* `velocity.queue.admin.listqueues` (Allows you to view all possible queues and number of people queued).
131+
* `velocity.queue.admin.pause` (Allows you to pause any specific server from queuing).
132+
* `velocity.queue.admin.remove` (Allows you to remove a player from any specific queue).
133+
* `velocity.queue.admin.removeall` (Allows you to remove a player from all queues).
134+
* `velocity.queue.admin.unpause` (Allows you to unpause any specific server for queuing).
135+
136+
## Special Notes
137+
To proficiently review the stability and performance of your proxy in addition to spark,
138+
consider utilizing JProfiler to enhance your experience and report any ongoing issues.
139+
140+
[![JProfiler](https://github.com/user-attachments/assets/d4f6a94b-8da2-484a-85c8-537a4d19d188)](https://www.ej-technologies.com/jprofiler)
141+
22142
## Building
23143

24144
Velocity is built with [Gradle](https://gradle.org). We recommend using the
25145
wrapper script (`./gradlew`) as our CI builds using it.
26146

27147
It is sufficient to run `./gradlew build` to run the full build cycle.
28148

149+
You can find new releases of Velocity-CTD in our [releases](https://github.com/GemstoneGG/Velocity-CTD/releases) tab,
150+
where our latest updates will be compiled and ready for use.
151+
29152
## Running
30153

31154
Once you've built Velocity, you can copy and run the `-all` JAR from
32-
`proxy/build/libs`. Velocity will generate a default configuration file
155+
`proxy/build/libs`. Velocity will generate a default configuration file,
33156
and you can configure it from there.
34-
35-
Alternatively, you can get the proxy JAR from the [downloads](https://papermc.io/downloads/velocity)
36-
page.

api/LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Copyright 2018 Velocity Contributors
1+
Copyright 2018-2026 Velocity Contributors
22

33
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:
44

55
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
66

7-
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.
7+
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.

api/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ dependencies {
2323
api(libs.gson)
2424
api(libs.guava)
2525

26-
// DEPRECATED: Will be removed in Velocity Polymer
26+
// DEPRECATED: Will be removed in Velocity Polymer,
27+
// assuming Velocity Polymer EVER releases!
2728
api("io.hotmoka:toml4j:0.7.3")
2829

2930
api(platform(libs.adventure.bom))
@@ -68,7 +69,6 @@ tasks {
6869
"https://jd.advntr.dev/api/${libs.adventure.bom.get().version}/",
6970
"https://jd.advntr.dev/text-minimessage/${libs.adventure.bom.get().version}/",
7071
"https://jd.advntr.dev/key/${libs.adventure.bom.get().version}/",
71-
"https://www.javadocs.dev/com.github.ben-manes.caffeine/caffeine/${libs.caffeine.get().version}/",
7272
)
7373

7474
o.tags(

api/src/ap/java/com/velocitypowered/api/plugin/ap/PluginAnnotationProcessor.java

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2023 Velocity Contributors
2+
* Copyright (C) 2018-2026 Velocity Contributors
33
*
44
* The Velocity API is licensed under the terms of the MIT License. For more details,
55
* reference the LICENSE file in the api top-level directory.
@@ -45,23 +45,58 @@ public class PluginAnnotationProcessor extends AbstractProcessor {
4545
public PluginAnnotationProcessor() {
4646
}
4747

48+
/**
49+
* The annotation processing environment.
50+
*
51+
* <p>Used to access utilities for messaging, file generation, and element inspection.</p>
52+
*/
4853
private ProcessingEnvironment environment;
54+
55+
/**
56+
* The fully qualified name of the plugin class discovered during processing.
57+
*
58+
* <p>Only one class annotated with {@link Plugin} is supported. If multiple are present,
59+
* a warning is issued and only the first is used.</p>
60+
*/
4961
private String pluginClassFound;
62+
63+
/**
64+
* Tracks whether a warning has already been issued for multiple {@link Plugin} annotations.
65+
*/
5066
private boolean warnedAboutMultiplePlugins;
5167

68+
/**
69+
* Initializes the annotation processor with the provided processing environment.
70+
*
71+
* @param processingEnv the annotation processing environment
72+
*/
5273
@Override
53-
public synchronized void init(ProcessingEnvironment processingEnv) {
74+
public synchronized void init(final ProcessingEnvironment processingEnv) {
5475
this.environment = processingEnv;
5576
}
5677

78+
/**
79+
* Returns the latest source version supported by this annotation processor.
80+
*
81+
* @return the latest supported source version
82+
*/
5783
@Override
5884
public SourceVersion getSupportedSourceVersion() {
5985
return SourceVersion.latestSupported();
6086
}
6187

88+
/**
89+
* Processes the {@link Plugin} annotation to generate the {@code velocity-plugin.json} metadata file.
90+
*
91+
* <p>If multiple plugin classes are found, a warning is issued and only the first is used.</p>
92+
*
93+
* @param annotations the annotation types requested to be processed
94+
* @param roundEnv the environment for information about the current and prior round
95+
* @return {@code true} if the annotations are claimed by this processor, {@code false} otherwise
96+
*/
6297
@Override
63-
public synchronized boolean process(Set<? extends TypeElement> annotations,
64-
RoundEnvironment roundEnv) {
98+
public synchronized boolean process(final Set<? extends TypeElement> annotations,
99+
final RoundEnvironment roundEnv) {
65100
if (roundEnv.processingOver()) {
66101
return false;
67102
}
@@ -84,6 +119,7 @@ public synchronized boolean process(Set<? extends TypeElement> annotations,
84119
+ " for your plugin's main class.");
85120
warnedAboutMultiplePlugins = true;
86121
}
122+
87123
return false;
88124
}
89125

@@ -99,7 +135,7 @@ public synchronized boolean process(Set<? extends TypeElement> annotations,
99135
for (Dependency dependency : plugin.dependencies()) {
100136
if (!SerializedPluginDescription.ID_PATTERN.matcher(dependency.id()).matches()) {
101137
environment.getMessager().printMessage(Diagnostic.Kind.ERROR,
102-
"Invalid dependency ID '" + dependency.id() + "' for plugin " + qualifiedName
138+
"Invalid dependency ID '" + dependency.id() + "' for plugin " + qualifiedName
103139
+ ". IDs must start alphabetically, have lowercase alphanumeric characters, and "
104140
+ "can contain dashes or underscores.");
105141
return false;

0 commit comments

Comments
 (0)