Commit Graph

32 Commits

Author SHA1 Message Date
Nassim Jahnke bd2c4c8a16
Update license headers 2024-01-01 12:39:45 +01:00
Nassim Jahnke 84a054aac1
Give PacketValue a generic type 2023-10-20 12:31:16 +10:00
Nassim Jahnke fdfc528a9a
Cleanup and renames around types 2023-10-19 09:28:21 +10:00
Nassim Jahnke b1b0874c0f Some cosmetic code changes and typo fixes 2023-10-08 20:54:04 +10:00
Nassim Jahnke 3997ea70f7
Fixup state splitting 2023-09-25 18:59:15 +10:00
Nassim Jahnke 854696abff
Add separate client and server protocol state 2023-09-25 16:44:41 +10:00
Nassim Jahnke b67e3c30fd
Move packet construction of schedule send methods to event loop as well
Fixes #3306
2023-04-26 12:18:08 +02:00
Nassim Jahnke e298a7efac
Fix protocol detection on some versions of Spigot
Fixes #3263
2023-03-17 18:36:48 +01:00
Nassim Jahnke 2e59a51734
Add PacketValue toString 2023-03-17 13:26:13 +01:00
Nassim Jahnke 51d4e11b5f
Minimize/optimize mapping data files 2023-03-04 00:08:08 +01:00
Nassim Jahnke 7161377794
Add PacketWrapper#setCancelled(boolean) 2023-02-28 21:49:08 +01:00
Nassim Jahnke cb2165eb93
Greatly reduce the number of (anonymous) inner classes
Reduces code complexity, and much more importantly, reduces the number of classes loaded at runtime by *hundreds*
2023-02-12 11:46:48 +01:00
Nassim Jahnke de5b7bf828
Allow registration of simple packet handlers over extending an abstract class 2023-02-12 10:54:47 +01:00
Nassim Jahnke 4fb95581ce
Update copyright headers 2023-01-12 12:45:53 +01:00
Nassim Jahnke 4067107b52
Improve exception handling 2023-01-06 20:51:21 +01:00
Nassim Jahnke 90feac8c83
Update DebugHandler 2022-05-20 14:10:23 +02:00
Nassim Jahnke d5a568b3fc
Update copyright header 2022-01-09 22:36:07 +01:00
Nassim Jahnke d159047dc0
Add more debugging options 2021-11-21 11:43:55 +01:00
Nassim Jahnke 32a84f24ef
Nicer getters in Pair and Triple 2021-09-14 11:13:39 +02:00
kennytv b81109f512
Semi force packet types in PacketWrapper at creation and transformation 2021-07-31 15:08:45 +02:00
kennytv 874dbafe26
More packet sending API
Allows for easy packet sending from a specific version to or from any client version supported by Via.
For example, you can send packets in the 1.17.1 format to both client and server, and it will be transformed accordingly if executed on another server version or sent to a different client version.
2021-07-30 12:26:15 +02:00
KennyTV 7b1f9c199a
Produce less overhead in packet handler registering
Instead of creating a void type reader for every single PacketHandler registered, this just directly uses the consumer-like PacketHandler.

The distinction between ValueCreator and the normal PacketHandler was unnecessary given you could also just read something in a ValueCreator instance, effectively just being a consumer of a PacketWrapper instance.
2021-06-02 22:00:20 +02:00
KennyTV eaa58affd1
Minor changes 2021-06-01 22:52:05 +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 3618914ce9
Add method to get Protocol by supported versions, some cleanup 2021-05-29 22:21:29 +02:00
KennyTV 1538ff5201
Expand unsupported software checks 2021-05-14 16:59:12 +02:00
creeper123123321 f17fb833a0
add internal getInputBuffer() (#2472) 2021-05-14 11:19:02 +02:00
KennyTV af0cf1d3f2
Rename PacketType methods
Just in case a packet with some magic id is going to be added, since the enum ordinal and name methods cannot be overridden
2021-05-02 11:14:38 +02:00
KennyTV 44e928d53c
Update copyright scopes 2021-04-30 19:05:07 +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 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 30d122e7fa
Create some fancy interfaces 2021-04-26 23:01:55 +02:00