Commit Graph

480 Commits

Author SHA1 Message Date
KennyTV
204a81b0ea
Add 1.17 to legacy api package ProtocolVersion 2021-06-10 10:50:07 +02:00
KennyTV
48436e7caf
Go through the rest of the send usages 2021-06-01 23:27:33 +02:00
KennyTV
37fd69fa86
Make packet send methods use the current thread by default
Defaulting to submitting to the netty event loop caused issues more often than not - this also removes the `currentThread` flag and instead provides new scheduleSend methods so it is always obvious whether the packet is sent immediately.
2021-06-01 10:13:49 +02:00
KennyTV
703978e227
Don't require UserConnection holding class in stored objects 2021-05-26 21:35:28 +02:00
KennyTV
3a1e364d4a
Refactor entity tracking and meta handling
This essentially merges the two approaches to the metadata handling from ViaVersion and ViaBackwards and improves on both designs.

ViaVersion did not track every single entity, but only those needed (at least in theory) and can work with untracked entities' metadata. It had a very simple method overridden by metadata rewriter implementations, directly operating on the full metadata list and manually handling meta index changes as well as item/block/particle id changes.

ViaBackwards on the other hand had to track *every single* entity and threw warnings otherwise - while less prone to errors due to giving obvious warnings in the console, it unnecessarily tracks a lot of entities, and those warnings also annoys users when encountering virtual entity plugins (operating asynchronously and sending update packets while already untracked or not yet tracked). Dedicated MetaHandlers made id changes and filtering a lot easier to read and write. However, the actual metadata list handling and its distribution to handlers was not very well implemented and required a lot of list copying and creation as well as exception throws to cancel individual metadata entries.

This version has MetaFilters built with a Builder containing multiple helper functions, and the entity tracking is properly given its own map, hashed by a Protocol's class, to be easily and generically accessible from anywhere with only a Protocol class from the UserConnection, along with more optimized metadata list iteration. The entity tracking is largely unchanged, keeping ViaVersion's approach to not having to track *all* entities (and being able to handle null types in meta handlers).

All of this is by no means absolutely perfect, but is much less prone to errors than both previous systems and takes a lot less effort to actually write. A last possible change would be to use a primitive int to object map that is built to be concurrency save for the EntityTracker, tho that would have to be chosen carefully.
2021-05-25 15:37:07 +02:00
Juan Cruz Linsalata
096415cf8e
Don't inject if inactive (#2461) 2021-05-02 15:52:07 +02:00
KennyTV
ab93e0877c
Rename platform task implementations 2021-04-29 17:46:29 +02:00
KennyTV
96b5051c75
Use primitive long in task methods 2021-04-29 17:31:16 +02:00
KennyTV
cad358322d
Rename outgoing->clientbound, incoming->serverbound
Via can both be used on servers and clients, making a direction like "incoming" ambiguous
2021-04-28 16:30:34 +02:00
KennyTV
a2b3906c9e
Move bossbar to new legacy package, since it only works on <1.9
The newly created LegacyViaAPI is safe to use, but should hold methods that cannot be universally used on every version
2021-04-28 11:10:16 +02:00
KennyTV
cadb5ec64c
Rename abstract Protocol to AbstractProtocol
This prevents confusion around the previously equally named interface and abstract class
2021-04-27 18:21:51 +02:00
KennyTV
f1c8d271b1
Reformat imports
The package rename wasn't done through refactoring but through simple replaces to not make git choke on diffs
2021-04-27 13:42:36 +02:00
KennyTV
318c49cf30
More interfaces, keep ProtocolRegistry.SERVER_PROTOCOL legacy api 2021-04-27 13:25:18 +02:00
KennyTV
d4bc31d11e
Always create ProtocolInfo, store mappings as int[] 2021-04-27 10:29:30 +02:00
KennyTV
30d122e7fa
Create some fancy interfaces 2021-04-26 23:01:55 +02:00
KennyTV
49d386063d
Add ProtocolVersion to legacy api 2021-04-26 21:45:27 +02:00
KennyTV
deec4b521e
Move some packages and classes around 2021-04-26 21:27:59 +02:00
KennyTV
a25a5634de
Change package/imports in classes and build configs 2021-04-26 20:52:34 +02:00
KennyTV
a3b1ce817e
Repackage to com.viaversion
This process will be split into multiple commits for git not to choke on.
2021-04-26 20:46:30 +02:00
Juan Cruz Linsalata
f18e2b3875
Cancel Bungee packet encoding when closed (#2448) 2021-04-24 18:30:08 +02:00
KennyTV
d40ce9fc4a
Minor optimizations in pipeline filling 2021-04-21 11:58:19 +02:00
Mariell Hoversholm
2c884dc241
Feat (Bungee): Use only unsafe field modifications (#2440) 2021-04-17 09:59:24 +02:00
KennyTV
d0882cf02c
Update GsonUtil, more javadoc 2021-04-16 23:05:31 +02:00
Jason
87d54f1103
Clean up build scripts using new Gradle features (#2436)
* Make use of `TYPESAFE_PROJECT_ACCESSORS` and `VERSION_CATALOGS` Gradle feature previews to clean up build scripts

* Bump setup-java action to v2, specify AdoptOpenJDK distribution
2021-04-14 14:16:48 +02:00
Mariell Hoversholm
458279d111
Fix (Bungee): Java 16 compatibility (#2433)
This has been tested on the following:
 - AdoptOpenJDK Java 1.8.0_282
 - GraalVM CE 21.0.0 OpenJDK 11.0.10
 - AdoptOpenJDK Java 15.0.2
 - AdoptOpenJDK Java 16 (also tested with BungeeCord b1556)
 - Amazon Corretto OpenJDK 16.0.0.36.1

... with Waterfall b406 on Linux 5.10.28.
2021-04-13 11:42:32 +02:00
KennyTV
7300a69817
Use Paper method to get server protocol version if possible 2021-04-12 20:11:13 +02:00
KennyTV
070c7f5808
Move to checker qual nullability annotations 2021-04-02 14:15:30 +02:00
KennyTV
a63f2ab6fe
Improve server version API 2021-03-26 12:51:38 +01:00
KennyTV
d918fd27b6
Reduce boxing in protocol path getting
More of its implementation should probably be cleaned up later
2021-03-25 22:34:30 +01:00
KennyTV
63356207a3
ProtocolRegistry -> ProtocolManager interface 2021-03-24 15:30:03 +01:00
KennyTV
0ab2c626aa
Split parts of common into api; We are now GPL, api is MIT
This does not affect any previous states of this project; only future modifications as well as the project as a whole will be under the GNU General Public License from now on. The newly introduced api directory, partly split from common, is an exception to this, still being licensed under the MIT license.

See the README for details.
2021-03-24 14:02:37 +01:00
jmp
024c36c584
Switch to indra, attempt to fix shading and universal jar 2021-02-25 09:19:14 +01:00
KennyTV
ef6c347194
*cries in elephant* 2021-02-25 09:19:14 +01:00
KennyTV
c0dabfe097
*cries in elephant* 2021-02-25 09:18:51 +01:00
KennyTV
0a41d36220
21w08a (aka the great splittening) 2021-02-24 23:38:28 +01:00
KennyTV
37004d8c4f
21w07a 2021-02-17 18:55:43 +01:00
KennyTV
e7b489f66e
This is actually 21w06a 2021-02-11 09:30:30 +01:00
KennyTV
4ff98256f6
21w06a 2021-02-10 19:09:33 +01:00
KennyTV
59e05e3096
21w05b 2021-02-04 19:11:24 +01:00
KennyTV
554fbb49c5
21w05a 2021-02-03 19:30:28 +01:00
KennyTV
c8c54786fc
21w03a 2021-01-20 17:59:34 +01:00
KennyTV
4cc8a3f092
Return -1 in getPlayerVersion if the player is not connected 2021-01-17 13:59:26 +01:00
KennyTV
6622b7dcff
20w51a 2020-12-16 18:57:16 +01:00
KennyTV
4355f8987f
Merge branch 'master' into dev
# Conflicts:
#	bukkit-legacy/pom.xml
#	bukkit/pom.xml
#	bungee/pom.xml
#	common/pom.xml
#	fabric/pom.xml
#	jar/pom.xml
#	pom.xml
#	sponge-legacy/pom.xml
#	sponge/pom.xml
#	velocity/pom.xml
2020-12-15 11:16:57 +01:00
Myles
c0fb81946e Snapshot 2020-12-12 13:16:13 +00:00
Myles
6c440513ba 3.2.1 2020-12-12 13:07:59 +00:00
KennyTV
8a11b577eb
Current WIP 20w49a 2020-12-02 21:57:32 +01:00
KennyTV
c671a6deed
20w48a (probably) 2020-11-25 17:15:43 +01:00
terrarier2111
6a12f8139c
Added missing import 2020-11-21 19:26:10 +01:00
terrarier2111
0b256d15b2
Created a local variable for ProxiedPlayers 2020-11-15 21:15:42 +01:00
KennyTV
67fda72bdd
20w46a 2020-11-11 19:13:31 +01:00
KennyTV
0d3f729679
20w45a
Missing: Diff mappings
2020-11-11 16:54:18 +01:00
KennyTV
91f3d0fdb7
Bump version to 3.2.1-SNAPSHOT 2020-11-03 09:49:46 +01:00
KennyTV
b3e8ad9164
3.2.0 Release, 1.16.4 2020-11-02 19:40:04 +01:00
creeper123123321
4813cc3077
inject into velocity backend (currently broken)
Add client-side mode for UserConnection

remove unused code

fix duplicate method on rebase
2020-10-28 19:51:01 +01:00
KennyTV
1a4c34afcf
1.16.4-rc1 2020-10-27 18:34:59 +01:00
KennyTV
9a24129e49
1.16.4-pre2 2020-10-22 17:43:38 +02:00
KennyTV
7d96efc645
Minor ProtocolVersion refactor 2020-10-16 18:21:45 +02:00
KennyTV
5eccc2e3cd
Merge branch 'master' into dev 2020-10-12 10:18:50 +02:00
KennyTV
0015682fe4
Add warning on startup for 1.8 users 2020-10-12 09:51:33 +02:00
KennyTV
6371b77b94
Prepare hackery for 1.16.4 2020-10-07 12:32:52 +02:00
terrarier2111
9a6b0664e3
Update BungeePlugin.java (#2080) 2020-09-12 17:43:09 +02:00
KennyTV
d36def89e1 Abstract mapping loading 2020-09-04 11:04:44 +02:00
creeper123123321
53d22dcff7 back to snapshot 2020-08-11 13:48:26 -03:00
KennyTV
6060954f87
3.1.0 Release - 1.16.2 support 2020-08-11 12:44:41 +02:00
KennyTV
da77c32a0d
1.16.2-rc2 2020-08-10 14:53:32 +02:00
KennyTV
7c8b56b3cb
1.16.2-rc1 2020-08-07 17:35:48 +02:00
KennyTV
f6fec5b93b
1.16.2-pre3 (almost)
The Nether does not have its custom fog, no idea why yet
2020-08-06 20:21:54 +02:00
KennyTV
cf7d49aec5
1.16.2-pre2 2020-08-05 18:19:00 +02:00
KennyTV
49211240a3
1.16.2-Pre1 2020-07-29 17:22:04 +02:00
KennyTV
48f8412440
20w30a 2020-07-22 21:47:18 +02:00
KennyTV
2c9ce50312
Bump version to 3.1.0- 2020-07-22 09:17:28 +02:00
KennyTV
37f5948b0a
20w29a 2020-07-15 17:44:24 +02:00
KennyTV
7171802b78
20w28a 2020-07-08 21:01:18 +02:00
KennyTV
4f392ba361
Suffix snapshot version again
(Now accepted by ViaFabric)
2020-07-02 15:57:52 +02:00
KennyTV
1ec2551fcc
Change version back to 3.0.2-SNAPSHOT
Spam is over, I promise
2020-07-01 20:42:07 +02:00
KennyTV
3ddd289b49
20w27a
TODO: Yoink recipe rewriter from ViaBackwards
2020-07-01 19:44:11 +02:00
KennyTV
3ba2191829
Fix late Bungee connection cancelling 2020-06-30 13:51:06 +02:00
Myles
3ee94415a9 Back to snapshot 2020-06-24 13:34:17 +01:00
Myles
1a7ce908b8 Release 2020-06-24 13:16:45 +01:00
Myles
42029770a2 Back to snapshot 2020-06-23 14:40:22 +01:00
Myles
cf00b9ee7c 3.0.0 2020-06-23 14:07:27 +01:00
KennyTV
029f399a14
Rename ViaCodecException to CancelCodecException 2020-06-10 08:58:40 +02:00
KennyTV
7588609c56
Fix cancelexception printing 2020-06-09 21:29:19 +02:00
KennyTV
aa59ed112a
Fixup docs, remove ConcurrentList 2020-06-09 17:53:31 +02:00
KennyTV
529da10615
Move ProtocolInfo into its own field 2020-06-07 12:19:36 +02:00
creeper123123321
a8a1e9448e
Netty handler tidy 2020-06-07 10:41:29 +02:00
Myles
a60340f330 Workaround for missing Protocol1_9to1_8 2020-05-30 21:31:28 +01:00
KennyTV
762c66ff42
Farewell, lombok! 2020-04-23 21:07:12 +02:00
KennyTV
53b8c2328e
Uncache UserConnection on channel close, fix memory leak 2020-04-23 20:24:16 +02:00
Myles
f82b52b017 Fix disconnect / sendMessage on Bungee 2020-04-20 09:56:34 +01:00
creeper123123321
dd5cbb0e4c Merge branch 'abstraction' of https://github.com/ViaVersion/ViaVersion into portedplayerschange 2020-04-15 11:39:13 -03:00
creeper123123321
17881b342a javadoc, remove ViaAPIs getPortedPlayers, fix ViaManager.getPortedPlayers name, rename to ViaAPI#isInjected 2020-04-15 11:35:09 -03:00
KennyTV
8f08a32c5a
Bai bai to more lombok usage once more 2020-04-13 20:58:24 +02:00
creeper123123321
ee7eaecdb3 move field 2020-04-13 08:51:04 -03:00
creeper123123321
a105c5cb11 Make getPortedPlayers() private, update bungee-api, remove some lombok usage, create ViaConnectionManager 2020-04-12 16:47:32 -03:00
creeper123123321
ca78bf9851 Remove portedPlayers field, let platform handle players 2020-04-12 15:37:08 -03:00
KennyTV
081781f223 Some cleanup 2020-04-03 19:32:31 +02:00
KennyTV
e658304405 Asynchronously load mappings (until needed), create optional mappings cache for VB 2020-04-03 19:32:30 +02:00
KennyTV
dd73ba4f72 Remove some lombok usage from the api package 2020-03-10 13:22:22 +01:00