Commit Graph

1503 Commits

Author SHA1 Message Date
Lixfel 19e51a2b12 Merge remote-tracking branch 'upstream/dev/3.0.0' 2024-12-06 11:14:27 +01:00
Owen 965db127a9 InvocationInfo API (#1467)
* Invocation Source API

Allows proxies to detect if a command is executed from an unsigned/signed/api source.

This is useful because it allows commands executed from the player manually or by clicking on a chat message to be controlled.

* Update api significantly to improve api coverage

* javadoc

* javadoc

* Update api/src/main/java/com/velocitypowered/api/event/command/CommandExecuteEvent.java

Co-authored-by: powercas_gamer <cas@mizule.dev>

* Update api/src/main/java/com/velocitypowered/api/event/command/CommandExecuteEvent.java

Co-authored-by: powercas_gamer <cas@mizule.dev>

* Fix rename

---------

Co-authored-by: powercas_gamer <cas@mizule.dev>
2024-12-04 09:36:45 -08:00
Aaron be5f0ace26 Minecraft 1.21.4 (#1457) 2024-12-03 15:07:26 +01:00
riku6460 a33f2d1af5 Fix callback command not working (#1464)
Broken in https://github.com/PaperMC/Velocity/commit/2016d1482f185daf4b92b6775fb4a8d2ef1e0da3#diff-1217e64751ab6522195a858620cceeb4f2d2b6506c36dd4e396726ad3e7ef0cb
2024-12-01 10:31:44 +00:00
Lixfel 65d3277319 Merge remote-tracking branch 'upstream/dev/3.0.0' 2024-11-30 09:25:25 +01:00
Andrey 9cfcfcf2ed Fix SystemChatPacket: Support reading packet properly in newer MC versions (#1461) 2024-11-19 17:49:17 +00:00
Lixfel d9d1319a3a Merge remote-tracking branch 'upstream/dev/3.0.0' into upstream
# Conflicts:
#	proxy/src/main/java/com/velocitypowered/proxy/protocol/StateRegistry.java
2024-11-10 18:32:48 +01:00
Timon cefa3b272e feat: expose list order in TabListEntry (#1451)
* feat: expose list order in TabListEntry

* fix: address comment (from github)

* fix: address another comment (from github)
2024-11-09 18:03:34 -05:00
Andrew Steinborn 08a42b3723 Replace home-made legacy hover event serializer with Adventure's implementation
This technically can break backwards compatibility, but this seems to be very unlikely to be the practice in reality. (The Velocity implementation probably wasn't correct, anyway.)
2024-10-27 15:13:22 -04:00
Aaron dc40e160d7 replace old velocitypowered.com links (#1399)
* replace old links

* content to 'PaperMC', cause its probably the best
2024-10-27 14:27:09 -04:00
Andrew Steinborn b135148dfc fix a typo 2024-10-27 13:54:08 -04:00
Michael 7a9227d517 Fix extra respawn packet byte on <1.21.2 (#1448) 2024-10-22 19:01:55 +02:00
Gero 05235da55d 1.21.2 (#1447)
* 24w33a

* 24w34a

* 24w38a

* 24w40a

* 1.21.2
2024-10-22 17:33:55 +02:00
Andrew Steinborn 2c8ce219f0 fix checkstyle, closes #1446 2024-10-20 20:20:42 -04:00
Jackson d4e89dbdda Ability to specify servers from the command line (#1445) 2024-10-20 20:09:55 -04:00
Isaac - The456 99aaf3ce4e expose raw vhost (#1423) 2024-10-07 10:41:17 +01:00
Stefano ef1f5009d3 Adjust HAProxy's existance to log when the proxy protocol is enabled … (#1436)
* Adjust HAProxy's existance to log when the proxy protocol is enabled during bind.

* Added additional warning message, instead of changing the main one. We can see what the preference would be.
2024-09-22 21:42:12 -04:00
Andrew Steinborn 2016d1482f Deprecate anonymous command registrations 2024-09-15 21:27:47 -04:00
Andrew Steinborn 4f227badc2 Reintroduce sync event execution to the Velocity event system
This required a not-insubstantial number of bug fixes, since the sync support had bit-rotted somewhat. This PR also corrects a number of bugs.

Finally. the per-plugin executor services are now used to execute all async event tasks.
2024-09-15 20:41:11 -04:00
Andrew Steinborn ffa78d2a92 Small clean-ups in event manager. 2024-09-15 17:00:15 -04:00
Andrew Steinborn 4eb02c8d38 Do not store the dimension registry for each connected server
This was unused and did little more than add unnecessary memory usage. The only time we need the dimension registry is during server switching - once that is done, we no longer need the registry.
2024-09-15 13:55:33 -04:00
Timon 78f6cfc26c feat: Require any ConsoleCommandSender for the shutdown command (#1428) 2024-09-14 12:18:23 +01:00
skbeh 2299b78ad3 fix: apply message in PlayerChatEvent when handling SessionPlayerChatPacket (#1411)
Fix 1.19.3+ unsigned chat not being changed by `PlayerChatEvent`.
2024-09-14 12:13:57 +01:00
powercas_gamer 6f6d55e9e6 [ci skip] make 'runShadow' workingDir use the 'run' directory (#1398) 2024-09-14 12:02:08 +01:00
Nostal Yuu 0cd069ecbf Fix exception while serializing JsonArray (#1426) 2024-09-11 12:40:25 -07:00
Andrew Steinborn 784806848d Do more speculative VarInt reading optimizations (#1418) 2024-09-05 00:00:34 -04:00
Andrew Steinborn 46f29480bd Delete now-unused MinecraftVarintLengthCompositeEncoder 2024-09-03 00:40:31 -04:00
Andrew Steinborn f034c0277d Have one MinecraftVarintLengthEncoder, not two
Applies more to the margins (such as login phase and server list ping), but every bit does help.
2024-09-03 00:33:57 -04:00
Andrew Steinborn 52ae735ea3 Change LoginInboundConnection queue type to something that is actually thread-safe 2024-09-02 20:47:01 -04:00
Andrew Steinborn 55f9509c6e Add a MinecraftVarintLengthCompositeEncoder for backend connections (#1419)
This is an optimization that has been in BungeeCord for some time, but it's an idea that makes a lot of sense: avoid a memory copy when we don't need to do one. The OS will hopefully be smart enough to use `writev()` or similar for this.
2024-09-02 02:25:04 -04:00
KoutaChan 67fb3b70a4 Increase readComponent string size limit to 262,143 for 1.13-1.20.2 (#1409) 2024-08-31 17:11:54 -04:00
Shane Freeder 6100e675af Switch to alt throw path for reading login message IDs (Fixes #1370)
There is little expectation that we should get a -ve number in here, but
it is sadly seen in the wild. We will use an alternative exception path rather
than returing a magic number to indicate an invalid value.

once primative classes arrive, this should probably be written to use those
for passing up the result.
2024-08-21 17:06:11 +01:00
Lixfel 5e3bbcd427 Fix command signature issues. 2024-08-20 08:03:18 +02:00
Lixfel a6c79db07b Remove filter checks to receive PluginMessages unfiltered. 2024-08-18 15:32:08 +02:00
Lixfel 6e33bc6c17 Merge remote-tracking branch 'refs/remotes/upstream/dev/3.0.0' 2024-08-18 15:28:10 +02:00
Max Lee 00ed2284ec Use the default Minecraft port instead of custom one (#1277) 2024-08-10 15:12:19 -04:00
powercas_gamer f6a47ae8b0 [ci skip] update docs url (#1393) 2024-07-24 18:25:41 -05:00
Patryk Twardosz 09f687e5d5 feat: Add server registered/unregistered events (#1386)
* feat: Add server registered/unregistered events

* Annotate new API with `@Beta`

* Migrate from classes to records

* Add null checks

* Fix code style indent

* Add links in documentation

* Fix docs indent

---------

Co-authored-by: powercas_gamer <cas@mizule.dev>
2024-07-24 18:13:21 -05:00
Shane Freeder 44b1e0c6f9 Print correct exception when hotspot dump fails 2024-07-22 15:42:42 +01:00
Jaime Costas a4476253ab End bundle session on server switch (#1385) 2024-07-19 20:34:46 +02:00
Gero d999ee2058 Fix PlayerConfigurationEvent only being called for initial configuration on 1.20.5+ 2024-07-14 16:29:30 +02:00
Andrew Steinborn ebc418f6cc Do not use classes from io.netty.util.internal
In this case, we don't even need a concurrency-friendly MPSC queue, since this code only ever gets run in the event loop associated to the channel, so a simple `ArrayDeque` is enough for our needs.
2024-07-13 21:50:27 -04:00
Rubén d5e7fa5b84 Add ServerResourcePackRemoveEvent (#1379)
* Add ServerResourcePackRemoveEvent

* Add nonnull check

* Fix indentation

* Fix import code style
2024-07-12 05:02:00 -05:00
Gero 6073f698e2 Add PlayerConfigurationEvent and PlayerEnteredConfigurationEvent (#1371)
* Configuring the player (i.e. sending resource packs) should now be done in the new PlayerConfigurationEvent.

* The new PlayerEnteredConfigurationEvent is called when a player acknowledged the switch to configuration state.

* The PlayerEnterConfigurationEvent is no longer called twice. It is now called when the backed wants to reconfigure the player.

* The PlayerFinishConfigurationEvent should no longer be used to configure the player (i.e. sending resource packs). This is because since 1.20.5 the backend server can't send keep alive packets between switching state anymore and the connection will thus time out.
2024-07-12 11:16:42 +02:00
Shane Freeder 82e81909d8 Add handling for KickPlayerRaw 2024-07-10 23:00:20 +01:00
Andrew Steinborn 5154f02910 Improved fix for #1372
Realized that the precondition that gets violated happens way too early, in `Maps.uniqueIndex()`.
2024-07-05 22:07:15 -04:00
Andrew Steinborn 6224adf70a Don't try to load a candidate plugin with the same ID more than once
Fixes #1372. Honestly, this was an oversight that I'm somewhat surprised that nobody caught until recently.
2024-07-05 22:01:31 -04:00
Gegy 4eae510fb7 Don't forward chat acknowledgement if the client didn't acknowledge any chat 2024-07-04 21:34:47 -07:00
Gegy c6bb15c69b Fix: only treat command as signed if it has signatures
The Vanilla client will send 'last seen' even if the message is not signed, so this is much stricter than it needs to be. This should allow commands without any signed arguments to be modified/consumed by the proxy.
2024-07-04 21:34:47 -07:00
Gegy 077968089e Fix: pass through last seen update in a few missing places
This is hardly useful in the case of signed player chat messages, as these fundamentally cannot be spoofed or modified - however, for any unsigned input (particularly commands without any signed arguments), 'last seen' updates are still required and should be passed through in a consistent state.
2024-07-04 21:34:47 -07:00