13
0
geforkt von Mirrors/Velocity
Commit graph

294 Commits

Autor SHA1 Nachricht Datum
Andrew Steinborn
c021eb2020 Don't output ProtocolVersion toString() in decode errors
This information is extremely technical in nature and the data is already
available for developer use by examining StateRegistry.
2018-09-04 00:50:24 -04:00
Andrew Steinborn
c5dcfb1ba6 Prettier, conciser, and more useful ProtocolVersion#toString() 2018-09-03 23:45:11 -04:00
Andrew Steinborn
c30cc66461 Test logic when exception is thrown in thread 2018-09-03 23:30:18 -04:00
Andrew Steinborn
3b5d20e62d Include git revision and build number 2018-09-03 21:02:11 -04:00
Andrew Steinborn
01be081bda Update link to Velocity repo 2018-09-03 15:01:18 -04:00
Andrew Steinborn
c520e04ac8 [BREAKING] PluginMessageEvent instead 2018-09-02 20:50:24 -04:00
Andrew Steinborn
db1b19dcd6 Remove unused scoreboard API 2018-09-02 18:07:31 -04:00
Andrew Steinborn
ff0f83b375 Add getBoundAddress() for NuVotifier 2018-09-02 16:34:25 -04:00
Andrew Steinborn
3791283860 Gracefully handle offline-mode login attempts on online-mode. 2018-09-01 14:18:30 -04:00
Andrew Steinborn
d3a14721bc Fix typo that forced modern forwarding on. 2018-08-31 15:26:44 -04:00
Leymooo
57ccb6eec2 Allow using a '\n' in config. Create a method to generate a random string. 2018-08-31 20:36:10 +03:00
Leymooo
b201d82a31 cleanup 2018-08-31 16:50:53 +03:00
Leymooo
d743c8b5a1 Merge branch 'master' of https://github.com/astei/velocity into config 2018-08-31 16:38:28 +03:00
Leymooo
182c117dc5 Shutdown logger to flush queue before call a System#exit 2018-08-30 14:34:30 +03:00
Leymooo
a9c4d1d88b Make the velocity generate a default config 2018-08-29 16:07:49 +03:00
Andrew Steinborn
b7725a7764 More sane shutdown code. 2018-08-28 21:27:03 -04:00
Andrew Steinborn
5773fe240b Use a HashSet here as it is more appropriate for the situation. 2018-08-28 21:24:49 -04:00
Leymooo
7e215e3c4f CfgKey -> ConfigKey 2018-08-28 16:00:05 +03:00
Leymooo
64fadc436b Refactor VelocityConfiguration to better support for config upgrades 2018-08-28 15:59:55 +03:00
Leymooo
2c7dfaaaf9 Allow config upgrading. Add annotations with reflection 2018-08-27 20:03:51 +03:00
Andrew Steinborn
6f8dae3a7e Removed all references to the static VelocityServer instance. 2018-08-27 00:45:00 -04:00
Andrew Steinborn
fead4783af Another misc cleanup for bossbars. 2018-08-27 00:25:39 -04:00
Andrew Steinborn
c2fa5d3ff1 Make sure to deny 1.12.2 and below clients in "modern" IP forwarding. 2018-08-27 00:25:30 -04:00
Andrew Steinborn
b5ebb4541f Clean ups around the codebase. 2018-08-27 00:24:58 -04:00
Andrew Steinborn
c7469ec13c Removed all entity ID rewriting logic.
This was all a no-op anyway, and should the need for this arise again,
it is trivial to re-add. However, Velocity does not need this, and
probably will never need it. Let's have the complexity go away.
2018-08-26 23:58:35 -04:00
Andrew Steinborn
f27b7e4e2f Fix improper packet mapping for chat messages.
This fixes the statistics display on the client.
2018-08-26 23:47:23 -04:00
Andrew Steinborn
db3f2b86e1 Remove unused client settings field from ConnectedPlayer 2018-08-26 23:23:13 -04:00
Andrew Steinborn
8e0ca2033e Explicitly cover unexpected disconnects during login 2018-08-26 22:43:18 -04:00
Andrew Steinborn
d482dc7f4f Clean this up 2018-08-26 19:44:15 -04:00
Andrew Steinborn
79f4abcf90 Expand /server command.
The command now supports displaying the server you are currently on and
takes full advantage of the JSON-based text component system to prettify
its output.
2018-08-26 19:41:18 -04:00
Andrew Steinborn
01c1002249 Make sure to schedule on the thread pool and not on the scheduler. 2018-08-26 18:43:55 -04:00
Andrew Steinborn
1e178cfe2a Properly block connecting to Velocity with legacy forwarding.
I also took the opportunity to improve the disconnect handling for
Disconnect messages from the server.
2018-08-26 18:18:02 -04:00
Andrew Steinborn
44c4221e19 Add /end alias for /shutdown. 2018-08-26 18:02:55 -04:00
Andrew Steinborn
ef556afbf3 Rewrote scheduler to use ScheduledExecutorService for delay/repeat tasks 2018-08-26 17:56:43 -04:00
Andrew Steinborn
ffd6217170 Broaden a catch clause so Java Errors while loading plugins don't halt the proxy. 2018-08-26 14:40:07 -04:00
Andrew Steinborn
27288685ff Register 1.13+ channels on legacy clients too.
Prior to this commit, Velocity registered 1.13 and "legacy" channels
differently. This commit unifies both for legacy clients to make
compatibility easier. It also fixes a related issue in the new LuckPerms
port to Velocity.
2018-08-26 14:39:31 -04:00
Andrew Steinborn
f273c046ec Add javadoc and reorganize the player settings stuff. 2018-08-25 12:54:30 -04:00
Andrew Steinborn
86461c2b60
Merge branch 'master' into ping 2018-08-25 12:45:07 -04:00
Andrew Steinborn
78a2bd313a
Merge pull request #57 from Leymooo/client-settings
Add PlayerSettings API
2018-08-25 12:44:35 -04:00
Andrew Steinborn
2b3503e2df Fix compile. 2018-08-25 11:02:20 -04:00
Leymooo
09153ae620 oops 2018-08-25 18:02:19 +03:00
Leymooo
1b4c537c81 Add PlayerSettings API 2018-08-25 15:52:05 +03:00
Leymooo
bf2dff7693 add method to get player ping 2018-08-25 14:44:44 +03:00
Andrew Steinborn
a37a0d6665 Merge branch 'master' into native-crypto
# Conflicts:
#	native/src/main/java/com/velocitypowered/natives/util/Natives.java
2018-08-25 01:12:26 -04:00
Andrew Steinborn
7ee56d9f5f Massively improved Javadoc coverage to prepare for Javadoc site. 2018-08-25 00:29:22 -04:00
Andrew Steinborn
6ccf16cee4
Merge pull request #52 from Leymooo/header-footer
Add Header and Footer. Resolves #50
2018-08-24 21:46:03 -04:00
Leymooo
d65e4ed296 add method to clear header and footer 2018-08-25 04:45:10 +03:00
Leymooo
1f8c8dcd94 Add Header and Footer. Resolves #50 2018-08-25 04:37:07 +03:00
Andrew Steinborn
bc2f3a7288 Clean up ConnectedPlayer initialization. 2018-08-24 21:30:58 -04:00
Andrew Steinborn
afb6e69388 Improve Javadoc and the GameProfileRequestEvent. 2018-08-24 21:09:56 -04:00
Slava Maspanov
a3c4522ca0 Allow to enable online mode for player connection (#51) 2018-08-24 20:55:15 -04:00
Andrew Steinborn
e6e3ccaa95 Fix minor bug with shutdown messages. 2018-08-23 21:57:10 -04:00
Andrew Steinborn
91265b12a3 Fix repeat 2018-08-23 21:51:15 -04:00
Andrew Steinborn
8fd026e025 Totally removed all uses of jsr305. Fixes #38 2018-08-22 21:46:17 -04:00
Andrew Steinborn
27760f5a97 Limit scope of "attempted server connections" to just initial log ons. 2018-08-22 21:10:14 -04:00
Andrew Steinborn
2d21c01f8a Fix boss bar handling on Minecraft 1.13+. 2018-08-22 21:08:47 -04:00
Andrew Steinborn
ccb904eeb1 Update for Minecraft 1.13.1 support 2018-08-22 20:53:53 -04:00
Andrew Steinborn
d9c35a680a Plugins can get plugin messages now. 2018-08-22 18:59:10 -04:00
Andrew Steinborn
c36f417b1e Add support for sending plugin messages over the wire 2018-08-22 00:53:02 -04:00
Andrew Steinborn
8352f7fa70 Add disconnect API call 2018-08-22 00:47:29 -04:00
Andrew Steinborn
55041aa1b1 Add basic implementation. 2018-08-21 23:03:09 -04:00
Andrew Steinborn
7b84da2fa7 Cleaning up some stuff in the proxy implementation. 2018-08-21 22:29:01 -04:00
Andrew Steinborn
2d0c826ec9 Introduce ServerConnection interface
This will become very useful for plugin messaging support.
2018-08-21 21:51:31 -04:00
Andrew Steinborn
9c4e43e1b0
Merge pull request #44 from Minecrell/meta-cleanup
Various improvements to plugin metadata
2018-08-21 17:34:41 -04:00
Minecrell
c43c6cbea2 Add plugin description 2018-08-21 23:13:25 +02:00
Jadon Fowler
65de126934
Fallback to next server on connection error
Closes #11

Co-authored-by: Dylan Keir <jinjaproductionz@gmail.com>
Signed-off-by: Jadon Fowler <jadonflower@gmail.com>
2018-08-21 11:45:07 -07:00
Minecrell
830b1d4798 Various improvements to plugin metadata
- Add plugin (display) name and plugin URL
 - Make everything except plugin ID optional (instead of empty string)
 - Exclude empty properties from generated velocity-plugin.json
 - Make plugin author list immutable
 - Other (minor) cleanup and refactoring
2018-08-21 20:37:10 +02:00
kashike
c4fdac9591 allow more than one author 2018-08-21 09:09:48 -07:00
Andrew Steinborn
a028467e66
Plugin API (#34)
The Velocity API has had a lot of community input (special thanks to @hugmanrique who started the work, @lucko who contributed permissions support, and @Minecrell for providing initial feedback and an initial version of ServerListPlus).

While the API is far from complete, there is enough available for people to start doing useful stuff with Velocity.
2018-08-20 19:30:32 -04:00
Leymooo
381b2033d5 Rename packetDecoding field to onlyEncode 2018-08-17 02:02:22 +03:00
Leymooo
9469065b3c Fix PacketMapping toString/equals/hashCode, do not handle Chat and TabCompleteResponse packets from backend 2018-08-15 20:52:50 +03:00
Andrew Steinborn
718f615d3f Simplify and improve the startup timer. 2018-08-13 07:23:49 -04:00
MatrixTunnel
dbe207d0c2 Add startup time to log messages 2018-08-13 00:44:55 -07:00
Andrew Steinborn
671df77c1f Forward the keep-alive packet directly onto the client.
This improves anti-cheat compatibility.
2018-08-12 08:06:50 -04:00
Andrew Steinborn
5787709ed3
Merge pull request #32 from Leymooo/no-scoreboards
Don't handle scoreboards from backend server
2018-08-12 07:31:11 -04:00
Leymooo
6a2b945ed6 Do not handle scoreboards from backend
Changes in StateRegistry will allow to us skip packets decode which we don't want handle in BackendPlaySessionHandler for a specific versions
Also do not handle respawn packet
2018-08-12 13:35:13 +03:00
kashike
6a3a5a0458 minor shuffle to log messages 2018-08-12 01:36:37 -07:00
Andrew Steinborn
21e72556c9 Correctly handle rapid disconnects. Fixes #31 2018-08-11 06:46:40 -04:00
Andrew Steinborn
8068f72729 Fix up player info forwarding. 2018-08-11 00:22:24 -04:00
Andrew Steinborn
95bd152fee More protocol sanity. 2018-08-10 23:44:52 -04:00
Andrew Steinborn
8bf3b99b10 Make sure the client has time to respond to the player info packet.
Apparently, Minecraft 1.13 can take a little too long to respond to
Velocity's player info forwarding packet. This especially noticeable in
offline mode: by the time the client does respond, Velocity has already
completed the login process and tried connecting to the server (it is
very quick under offline mode).

Noticed by Leymooo.
2018-08-10 23:40:51 -04:00
Andrew Steinborn
7130942032
Merge pull request #28 from MatrixTunnel/feature/ratelime-config
Add login ratelimit configuration
2018-08-10 21:57:58 -04:00
MatrixTunnel
6e4f90dfae Add ratelimit tests 2018-08-10 18:57:10 -07:00
kashike
e9959f81fb use fastutil's Object2IntOpenHashMap 2018-08-10 18:35:54 -07:00
Andrew Steinborn
8998bc7c8f Presize the maps.
TODO: Replace that ugly autoboxed primitive without excessively blowing
up the size of the JAR
2018-08-10 20:56:22 -04:00
MatrixTunnel
479592c009 Fix invalid compression values not stopping proxy 2018-08-10 11:13:53 -07:00
MatrixTunnel
d752edc92d Add login ratelimit configuration 2018-08-10 11:08:55 -07:00
Andrew Steinborn
9af6829688 Fix sending commands to remote server. 2018-08-10 03:05:59 -04:00
Andrew Steinborn
0834bec997 Merge branch 'tab-complete' 2018-08-09 10:15:22 -04:00
Andrew Steinborn
b78ddf7b85 Fix scoreboard teams on Minecraft 1.8. 2018-08-09 10:15:19 -04:00
Andrew Steinborn
2e1de306fb Complete tab-complete support back to Minecraft 1.8. 2018-08-09 10:14:44 -04:00
Andrew Steinborn
9a36bd6cae Merge branch 'master' into tab-complete 2018-08-09 09:47:30 -04:00
Andrew Steinborn
1f0a4a8228 Add support for HMACed player forwarding data.
This provides a small degree of security but also makes Velocity "secure
by default", especially on shared hosts.
2018-08-09 05:24:47 -04:00
Andrew Steinborn
254508a5cf Add connection attempt rate-limiting. 2018-08-09 03:23:27 -04:00
Andrew Steinborn
db8b7c807c Add kqueue transport support 2018-08-08 10:10:11 -04:00
Andrew Steinborn
512b1c2403 Remove erroneously added getter 2018-08-08 09:45:38 -04:00
Andrew Steinborn
a261823302 Add favicon support 2018-08-08 04:44:27 -04:00
Andrew Steinborn
54f9de04dc Add MC tab complete (incomplete, only 1.12.2 works) 2018-08-07 11:53:13 -04:00
Andrew Steinborn
bb601dca4b Add console tab complete, shutdown command, gracefully kick players. 2018-08-07 11:02:35 -04:00
Andrew Steinborn
beb947cc3e
Merge pull request #26 from Minecrell/tca
Add TerminalConsoleAppender for console prompts
2018-08-07 10:38:00 -04:00
Andrew Steinborn
a88d27af76 Ignore repeated shutdown requests. 2018-08-07 10:37:38 -04:00
Minecrell
a044ed72de Add TerminalConsoleAppender for console prompts 2018-08-07 16:32:32 +02:00
Andrew Steinborn
a7a227ed05 Add shutdown flag. 2018-08-07 10:14:34 -04:00
Andrew Steinborn
05693425bf Add a basic command handling framework inspired by Bukkit/BungeeCord.
This doesn't yet support tab complete, that will come later. Additionally,
a /server command (using your configuration) and /velocity (shows basic
copyright information about the proxy) have been added.
2018-08-07 09:34:31 -04:00
Andrew Steinborn
09eff5a2fb GS4 clients generally don't understand MC color codes (or JSON chat). 2018-08-07 07:56:28 -04:00
Andrew Steinborn
b5fcc1b34a Fix GS4 issues. 2018-08-07 07:51:09 -04:00
Andrew Steinborn
3e0df79c98 Fix GS4 "can't bind to null" error. 2018-08-07 07:34:41 -04:00
Mark Vainomaa
fe79c66171 GS4 Query handler (#20) 2018-08-07 07:32:22 -04:00
Andrew Steinborn
b983cdb7b3 Fix some spirous "connection closed" errors. 2018-08-07 07:18:54 -04:00
Andrew Steinborn
a2b4291b36 Use Guava immutable integer arrays. 2018-08-07 07:18:21 -04:00
Andrew Steinborn
abbdf70d5e [Experimental] Remove PacketWrapper objects
In both Velocity and BungeeCord, the most commonly created object is an
object that encapsulates a Minecraft packet and a its associated byte
data.

At first, I considered trying to recycle these objects, but then I
discovered that this object has no reason to exist, and actually somewhat
complicates the implementation. Thus, this commit removes these objects,
making Velocity more more GC-friendly by not allocating frequently-created
objects.

This is still an experimental change, but it's a fairly safe one to make.
2018-08-07 04:28:07 -04:00
Andrew Steinborn
fdf5f27da6 Improve server list ping, especially for legacy MC versions. 2018-08-07 01:02:39 -04:00
MatrixTunnel
ac378a8efa Update version strings + add constant 2018-08-06 16:06:57 -07:00
Andrew Steinborn
6a5c40ecdf
Merge pull request #16 from Desetude/feature/1.8
Add 1.8 support
2018-08-06 18:41:37 -04:00
Mark Vainomaa
9ca1707df3
Fix unregisterConnection using non-lowercase username
Fixes #18
2018-08-06 19:06:25 +03:00
Desetude
b4f1d64cb0 Add 1.8 support 2018-08-06 09:21:01 +01:00
Andrew Steinborn
48822fe55c Better case-insensitivity. 2018-08-05 17:14:39 -04:00
Andrew Steinborn
a778825152 Add server registration API. 2018-08-05 17:10:18 -04:00
Andrew Steinborn
23a6488a39 Add default config again. Closes #12 2018-08-05 16:12:16 -04:00
Andrew Steinborn
4e64b04464 Avoid duplicate logins. 2018-08-05 01:30:40 -04:00
Andrew Steinborn
22d1398f73 Extend the API with a ProxyServer type. 2018-08-05 01:26:07 -04:00
Andrew Steinborn
8aa1fe524e Native cryptography support using mbed TLS 2018-08-04 23:46:41 -04:00
Andrew Steinborn
06a6493605 Cleaned up connection code. 2018-08-04 03:18:57 -04:00
Andrew Steinborn
0ba85fe83f Introduce a fluent connection request API. 2018-08-04 03:13:17 -04:00
Andrew Steinborn
fbdaae5ac7 Actually, this would be a better name... 2018-08-04 01:45:18 -04:00
Andrew Steinborn
9bcdc413d7 ProxiedPlayer interface 2018-08-04 01:40:37 -04:00
Andrew Steinborn
9438d087e2 Refactor cipher logic. 2018-08-04 00:09:25 -04:00
Andrew Steinborn
6f3397f76f Adjustments. 2018-08-03 17:49:35 -04:00
Andrew Steinborn
68ded7ca7f Allow tweaking compression. 2018-08-03 16:56:19 -04:00
Andrew Steinborn
0191b74840 Remove another memory copy with compression.
I considered using composite byte buffers but they would have added GC
overhead and would've been incompatible with any native code we added
unless special care was taken.
2018-08-03 05:21:35 -04:00
Andrew Steinborn
44932cfddb Nuke some debug output. 2018-08-03 02:27:18 -04:00
Andrew Steinborn
7eea1a3ac6 Introduce a connection pool for Mojang's session servers.
This has the potential to cut the time that players spend at the
"logging in..." (or "encrypting..." for 1.13+) screen by a fair
amount (gains of 200+ ms were noted for my own home connection).

While this sounds minor, I really do like to aim for all the details
and this is one of them.
2018-08-03 02:25:57 -04:00
Andrew Steinborn
0c481d828d Remove PluginMessage slicing for now.
This was causing leak issues and needs to be reimplemented. If anyone's
willing to undertake the work, I will gladly accept the PR!
2018-08-03 02:23:58 -04:00
Andrew Steinborn
d38c7467d9 Various Netty changes.
- Potentially fixed a reference count leak with plugin messages.
- Cleaned up plugin message handling.
- Optimized the pipeline for better throughput by eliminating copying
  in the varint encoder and reduced object churn elsewhere.
2018-08-03 00:48:19 -04:00
Andrew Steinborn
68d315d1d3 Improvements for natives. 2018-08-02 23:52:21 -04:00
Andrew Steinborn
12ad629d4d If the channel becomes inactive, the connection's closed, too. 2018-08-02 22:10:55 -04:00
Andrew Steinborn
4bc4a1ec6a Use singular plurals, clean up some stuff. 2018-08-02 14:07:32 -04:00
Andrew Steinborn
2e59138428 Cleaned up native code. 2018-08-02 00:43:38 -04:00
Andrew Steinborn
9815837472 Fix directory structure 2018-08-01 22:27:40 -04:00
Andrew Steinborn
fb4e6fd8f1 JNI native zlib compression 🔥 2018-08-01 22:22:09 -04:00
Andrew Steinborn
22dd4bbb99 Split natives. Add proper disposal for natives. 2018-08-01 00:20:51 -04:00
Andrew Steinborn
284a2a67a2 Remove unused entity remapper. 2018-08-01 00:20:51 -04:00
Andrew Steinborn
8b1e1f20cf A little more documentation. 2018-07-31 16:22:21 -04:00
Andrew Steinborn
bbf861d3bc Convert into a multi-module project.
For now, the API module only contains a few assorted utilities. More
will be added later.
2018-07-31 16:12:41 -04:00