Commit Graph

799 Commits

Author SHA1 Message Date
TheMode
201b5500b9 Fix chunk loading
Signed-off-by: TheMode <themode@outlook.fr>
2022-01-10 16:51:21 +01:00
TheMode
d3b55700e2 Initial non-working 1.18 commit
Signed-off-by: TheMode <themode@outlook.fr>
2022-01-10 16:51:21 +01:00
TheMode
02de469cad Use relaxedOffer, copy packet list to prevent modifications
Signed-off-by: TheMode <themode@outlook.fr>
2021-11-21 14:34:24 +01:00
TheMode
8005d2bb3f Rollback worker thread count to be Runtime#availableProcessors()
Signed-off-by: TheMode <themode@outlook.fr>
2021-11-21 14:12:11 +01:00
TheMode
81553e2816 Separate worker construction from start
Signed-off-by: TheMode <themode@outlook.fr>
2021-11-21 12:51:13 +01:00
TheMode
fc3fbe83f0 Change queue for inbound packets
Signed-off-by: TheMode <themode@outlook.fr>
2021-11-20 11:56:35 +01:00
TheMode
767c743e01 Batch sendPackets list content in a single message
Signed-off-by: TheMode <themode@outlook.fr>
2021-11-17 23:12:54 +01:00
TheMode
750e9b5324 Add packet doc
Signed-off-by: TheMode <themode@outlook.fr>
2021-11-17 21:14:10 +01:00
TheMode
69e9b31fa4 Add few try-catches
Signed-off-by: TheMode <themode@outlook.fr>
2021-11-17 09:33:11 +01:00
TheMode
785bcb8b6d Fast exit if tick buffer can be reused
Signed-off-by: TheMode <themode@outlook.fr>
2021-11-17 09:20:36 +01:00
TheMode
cecaab762d Use a MpscGrowableArrayQueue
Signed-off-by: TheMode <themode@outlook.fr>
2021-11-17 09:20:04 +01:00
TheMode
6920a6e8a5 Use a CachedPacket to store default tags
Signed-off-by: TheMode <themode@outlook.fr>
2021-11-17 08:13:31 +01:00
TheMode
8b1856d5b7
Async packet write (#533) 2021-11-17 06:31:24 +01:00
TheMode
c5e947c76e Move CachedPacket and FramedPacket
Signed-off-by: TheMode <themode@outlook.fr>
2021-11-17 00:48:43 +01:00
TheMode
a4522e44ed Flush in worker threads
Signed-off-by: TheMode <themode@outlook.fr>
2021-11-16 21:53:33 +01:00
TheMode
dc6a520ab5
Add properties for grouped, cached & viewable packets (#524) 2021-11-10 22:34:21 +01:00
TheMode
ae08ac2987 Do not flush if channel is closed
Signed-off-by: TheMode <themode@outlook.fr>
2021-11-08 09:11:02 +01:00
TheMode
5e10876c2a Add max packet size property
Signed-off-by: TheMode <themode@outlook.fr>
2021-11-07 12:19:25 +01:00
TheMode
7a4086c889 Reduce default socket send buffer size
Signed-off-by: TheMode <themode@outlook.fr>
2021-11-05 06:26:41 +01:00
TheMode
acc711c640
Revert "Volatile encryption (#515)" (#516)
This reverts commit 0f15d4a273.
2021-11-03 09:17:23 +01:00
TheMode
0f15d4a273
Volatile encryption (#515) 2021-11-03 09:06:06 +01:00
TheMode
970d4d2d9c Allow buffer index/length to be specified
Signed-off-by: TheMode <themode@outlook.fr>
2021-11-02 03:08:36 +01:00
TheMode
b7ad2fef5c Send complete block nbt if no handler is present
Signed-off-by: TheMode <themode@outlook.fr>
2021-10-26 17:44:01 +02:00
TheMode
f86d91f9b8 Fix online mode
Signed-off-by: TheMode <themode@outlook.fr>
2021-10-26 00:44:16 +02:00
TheMode
23d59cb135 Returned framed buffers should be flipped
Signed-off-by: TheMode <themode@outlook.fr>
2021-10-26 00:05:03 +02:00
TheMode
00401bed25 Avoid allocation when writing framed packets
Signed-off-by: TheMode <themode@outlook.fr>
2021-10-25 23:55:20 +02:00
TheMode
1851ea7eca Move OOM try-catch
Signed-off-by: TheMode <themode@outlook.fr>
2021-10-25 10:08:25 +02:00
themode
13eade4e35 Workers should be minestom threads 2021-10-22 03:09:32 +02:00
TheMode
7891cc5bbe Use more instanceof pattern matching
Signed-off-by: TheMode <themode@outlook.fr>
2021-10-22 02:19:38 +02:00
TheMode
5030664ff9 Use more enhanced switches
Signed-off-by: TheMode <themode@outlook.fr>
2021-10-22 02:14:12 +02:00
TheMode
b308ce5baa
Update to Java 17 (#462) 2021-10-22 01:55:55 +02:00
TheMode
3685bf22b7 Improve CachedPacket
Signed-off-by: TheMode <themode@outlook.fr>
2021-10-19 12:41:34 +02:00
Corey Shupe
11d0f82b86
Make Mojang SessionServer Configurable (#499) 2021-10-19 10:11:04 +02:00
TheMode
06189ee783
Async flush (#492) 2021-10-16 19:55:24 +02:00
TheMode
21b751dbd1 Reduce default worker thread count
Signed-off-by: TheMode <themode@outlook.fr>
2021-10-13 12:37:54 +02:00
TheMode
bd4aa90753
Framed packet cleanup (#489) 2021-10-13 06:33:44 +02:00
TheMode
11806b9166 Ensure no packet corruption due to encryption. A proxy is still recommended for optimal performance
Signed-off-by: TheMode <themode@outlook.fr>
2021-10-06 21:14:08 +02:00
TheMode
2f1e4101d1 Add more try-catch to prevent the worker from returning
Signed-off-by: TheMode <themode@outlook.fr>
2021-10-06 18:47:40 +02:00
Matt Worzala
d89e5cf2ee
Hardcode heightmap value to dimension height. (#481) 2021-10-05 23:29:05 +02:00
TheMode
36bcf69728 Buffer collection cleaner
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-29 18:31:28 +02:00
TheMode
236683c986 No volatile read for compression/encryption
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-26 17:02:05 +02:00
TheMode
68107c9a90 Reuse the tick buffer when possible & avoid iteration
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-22 23:24:22 +02:00
TheMode
e97f1db184 Call Player#remove on server shutdown
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-21 19:30:36 +02:00
TheMode
2c4ea3c3c4 Serialize/Compress tag packet only once
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-20 19:34:43 +02:00
TheMode
8f3e8c5a13 Remove players during their next tick
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-20 19:30:52 +02:00
TheMode
17807f35da Add experimental PlayerConnection#sendFramedPacket
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-20 18:59:15 +02:00
TheMode
872a49d371 Use a bitset for light mask (thanks @Kebab11noel)
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-19 10:09:08 +02:00
TheMode
dda90a6dfe Improve chunk block getter
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-18 15:59:20 +02:00
TheMode
380f5a5a67 Remove faulty fast exit
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-16 19:50:57 +02:00
TheMode
4b5ec566bd Allow FramedPackets to be sent safely
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-16 19:37:30 +02:00
TheMode
2ecd10a4ec Cipher#update is copy-safe
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-15 03:47:48 +02:00
TheMode
7737d0e5b3 Cleanup MultiBlockChangePacket
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-14 08:14:14 +02:00
TheMode
983850171b Use cleaner to reuse connection buffers
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-14 02:22:58 +02:00
TheMode
e1a3c295a2 Add dedicated PooledBuffers class
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-13 22:12:07 +02:00
TheMode
ee95015ed3 Simplify packet reading
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-11 03:39:59 +02:00
TheMode
fd027ecfd7 Do not forget to put the buffer back in the pool queue
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-09 23:18:14 +02:00
TheMode
526108b896 Remove unnecessary allocation during encryption
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-09 23:15:57 +02:00
Moulberry
9e5fadaa0e Fix broken cursor with window items packet 2021-09-08 21:50:14 +08:00
TheMode
8f1e84ffdb Prevent framed packets from being corrupted
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-07 01:24:51 +02:00
TheMode
72987ac52f Save the server from crashing from OOM due to the client or server not being able to handle the network load
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-06 16:17:30 +02:00
TheMode
f3ee80d126 Create a separate method to init & start the socket server
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-05 22:03:51 +02:00
TheMode
7b8277b6be Do not flip the buffer inside #write(ByteBuffer)
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-04 23:56:27 +02:00
TheMode
885be567fa Avoid slice allocation
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-04 19:50:09 +02:00
TheMode
d21414c146 Handle prepared buffer being bigger than the pooled ones
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-04 19:30:18 +02:00
TheMode
f717279adc Independent socket send & receive buffer size
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-04 16:43:45 +02:00
TheMode
22b0c70500 Ensure that the read buffer can contain a single full packet
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-04 03:40:22 +02:00
TheMode
4f382c5684 Fix tick allocation
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-04 03:03:06 +02:00
TheMode
df92939ddd Use soft references for pooled buffers
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-04 02:20:03 +02:00
TheMode
3d5ae6fe94 Pool main connection buffer
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-03 13:54:38 +02:00
TheMode
d4e51f562c Remove threadlocal buffer cache in ChunkDataPacket
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-02 18:44:50 +02:00
TheMode
399eb860a7 Improve performance when slow clients are connected
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-02 15:44:36 +02:00
TheMode
463a46ccc0 Set socket size to max packet size
Signed-off-by: TheMode <themode@outlook.fr>
2021-09-01 18:21:51 +02:00
TheMode
f7cd0def20 Add dedicated CachedPacket for future network optimizations
Signed-off-by: TheMode <themode@outlook.fr>
2021-08-26 18:18:35 +02:00
TheMode
dc59f3fd23 Make auth requests async 2021-08-23 08:53:08 +02:00
TheMode
23c76bc799 Fix & cleanup OpenToLAN 2021-08-21 10:12:55 +02:00
TheMode
56f826a41e Cache block entities even without handler. Fix them from being invisible 2021-08-21 04:53:43 +02:00
TheMode
874c60fb6a Remove player on server shutdown 2021-08-19 23:17:25 +02:00
TheMode
62916239b5 Increase the default socket buffer size 2021-08-19 10:42:50 +02:00
TheMode
1c59186b61 Improve chunk packet reading 2021-08-19 00:11:24 +02:00
TheMode
5cf358ac3c Fix inventory events not giving the proper inventory/slot 2021-08-18 21:08:04 +02:00
TheMode
f26e6ef91f Annotation style 2021-08-18 00:43:09 +02:00
TheMode
dbf5ff6cd4 Add PlayerConnection#flush without guarantee 2021-08-17 23:23:41 +02:00
TheMode
460585ae9b Prevent the client from breaking due to weird command syntaxes 2021-08-17 21:39:26 +02:00
TheMode
c58eaa51d3 Fix test 2021-08-17 18:44:53 +02:00
TheMode
42afae9b68 Add warning for string reading + incorrectly configured ip forwarding 2021-08-17 06:10:36 +02:00
TheMode
6f2cf8e6a5 PlayerDiggingListener refactoring 2021-08-15 20:25:23 +02:00
TheMode
af50bbb440 Player#UNSAFE_init now set the instance 2021-08-15 00:52:07 +02:00
TheMode
d4f74abc64 Include original packet in FramedPacket for debugging/listening purpose 2021-08-13 19:58:14 +02:00
TheMode
322572c96d Rename to LocalCache 2021-08-13 01:13:58 +02:00
TheMode
78126fad6c Add experimental local buffer API. Remove allocation when writing chunk packets (should help with startup time) 2021-08-13 01:08:19 +02:00
TheMode
8ff4f9432c Init player before setting its instance 2021-08-11 16:15:56 +02:00
TheMode
13538c768c Less worker threads by default 2021-08-11 14:32:06 +02:00
TheMode
fd08cabb6a Change default tab implementation to show all online players 2021-08-11 14:18:04 +02:00
TheMode
18058bc3c8 Reduce ByteBuffer allocation 2021-08-09 23:54:45 +02:00
TheMode
e9e688b50a Add (and fix) packet reading warning 2021-08-09 15:09:08 +02:00
TheMode
10fce3c034 Use lambda for socket accept 2021-08-08 23:51:59 +02:00
TheMode
1b79d2e2e8 Cleanup 2021-08-08 23:03:01 +02:00
TheMode
3881102925 Make Worker a thread 2021-08-08 21:28:38 +02:00
TheMode
99a3ad88a1 Use lambda for socket selection 2021-08-08 21:14:53 +02:00
TheMode
1591df16aa Rename netty to socket wherever possible 2021-08-08 19:11:47 +02:00
TheMode
b56509718c Add encryption support 2021-08-08 19:02:36 +02:00
TheMode
a2e2461d22 Revert BinaryReader changes 2021-08-06 17:30:39 +02:00
TheMode
2a6f9a8bc8 Use BinaryBuffer for velocity forwarding 2021-08-06 16:35:01 +02:00
TheMode
f135edba0d Replace BinaryReader to BinaryBuffer 2021-08-06 16:30:52 +02:00
TheMode
455c21208e WIP BinaryBuffer 2021-08-06 14:21:11 +02:00
TheMode
aa2a6522dc Increase socket size, cache direct buffers 2021-08-05 15:42:16 +02:00
TheMode
7ba8189a28 Fix ghost players 2021-08-05 15:10:15 +02:00
TheMode
87f141ff50 Simplify packet writing 2021-08-05 03:09:45 +02:00
TheMode
a52d574049 Send light packet first 2021-08-05 02:34:48 +02:00
TheMode
eb43dc0cc0 Reuse flush method 2021-08-05 01:10:03 +02:00
TheMode
120b58db6a Fix ghost player, trim chunk/light packets 2021-08-04 21:02:59 +02:00
TheMode
538d641d4b Channel write cleanup 2021-08-04 20:34:27 +02:00
TheMode
0b23795fb0 Remove login log 2021-08-04 17:32:36 +02:00
TheMode
58f0f3ec89 Light cleanup 2021-08-04 14:47:19 +02:00
TheMode
7320d83175 Reduce exception spam 2021-08-04 12:52:49 +02:00
TheMode
0d91f9efc6 Close the main selector 2021-08-04 05:19:11 +02:00
TheMode
8895e49a52 Improve socket shutdown 2021-08-04 05:15:40 +02:00
TheMode
557d34c378 Reduce allocation count 2021-08-04 04:00:42 +02:00
TheMode
9bb50430d4 Fix memory leak, decrease socket size 2021-08-04 03:53:01 +02:00
TheMode
5adeed392b Flush packet sync
Signed-off-by: TheMode <themode@outlook.fr>
2021-08-04 00:48:35 +02:00
TheMode
66b567597a Fix connection crash
Signed-off-by: TheMode <themode@outlook.fr>
2021-08-04 00:37:17 +02:00
TheMode
548cee55e0 Fix compression
Signed-off-by: TheMode <themode@outlook.fr>
2021-08-03 21:16:24 +02:00
TheMode
65df72fa82 Remove write branching
Signed-off-by: TheMode <themode@outlook.fr>
2021-08-03 20:18:38 +02:00
TheMode
6db55ce91f Always flip
Signed-off-by: TheMode <themode@outlook.fr>
2021-08-03 20:02:27 +02:00
TheMode
fbf6479135 Fix item meta writing
Signed-off-by: TheMode <themode@outlook.fr>
2021-08-03 19:44:10 +02:00
TheMode
e4a3a3dbae Removed unused buffer + deflater
Signed-off-by: TheMode <themode@outlook.fr>
2021-08-03 17:05:21 +02:00
TheMode
b35954c05d Fix ping
Signed-off-by: TheMode <themode@outlook.fr>
2021-08-03 13:09:03 +02:00
TheMode
1c3bb5b0ff First NIO attempt
Signed-off-by: TheMode <themode@outlook.fr>
2021-08-03 12:57:13 +02:00
TheMode
24e4b8765e Remove resource gatherer, retrieve tags from our own data generator 2021-07-29 12:54:16 +02:00
TheMode
16e4b61eb7 Fix unused imports 2021-07-29 00:02:43 +02:00
TheMode
6a86e92999 Unload all chunks when changing instance 2021-07-28 16:36:21 +02:00
TheMode
13b7039721 Replace most enums 2021-07-28 14:29:28 +02:00
MrGazdag
d3cacb0f25
remove methods 2021-07-27 12:24:25 +02:00
MrGazdag
a20fb32ef5
fix documentation and add hasFlag 2021-07-27 12:11:30 +02:00
MrGazdag
a6c6944e56
Update PlayerAbilitiesPacket 2021-07-27 11:56:51 +02:00
TheMode
274a40ea27 Make EntityType an interface 2021-07-27 11:56:20 +02:00
TheMode
c549ec1663 Remove legacy registry methods 2021-07-27 09:55:01 +02:00
TheMode
d685a7b136 Make Material an interface 2021-07-27 09:40:57 +02:00
TheMode
b22d030a6f Ask for the flag directly in PlayerAbilitiesPacket 2021-07-27 07:44:06 +02:00
TheMode
de76ac5aad Add UpdateViewPositionPacket constructor 2021-07-27 07:00:04 +02:00
TheMode
5285665939 Remove longly deprecated chat package 2021-07-27 06:55:08 +02:00
TheMode
2cc92e5e3e Simplify login process 2021-07-26 15:49:03 +02:00
TheMode
25d645a5cb Remove legacy position objects 2021-07-25 06:30:49 +02:00
TheMode
ad964a0a39 Remove deprecated UpdateOption.java 2021-07-25 06:25:32 +02:00
TheMode
e04a5bc2d8 unused import 2021-07-24 14:38:43 +02:00
TheMode
7f5ea582c9 More packet constructors 2021-07-24 07:45:08 +02:00
TheMode
8734478126 More packet constructors
Signed-off-by: TheMode <themode@outlook.fr>
2021-07-23 08:15:25 +02:00
TheMode
9db4ac06cc Even more inline packets 2021-07-22 13:01:00 +02:00
TheMode
081266775c More inline packets 2021-07-22 12:50:38 +02:00
TheMode
ff9ca60a58 Add some inline packet constructors 2021-07-22 09:54:34 +02:00