Inder00 / OpenSourceSectors

This is a plugin for Minecraft Server (Spigot API) introduces a sector system which connects a single world across multiple servers.
GNU General Public License v3.0
21 stars 2 forks source link

Rewrite networking to netty #15

Closed Inder00 closed 2 years ago

Inder00 commented 2 years ago

TODO:

Password authentication has been dropped, S2S communication should be bound on internal network.

One of task from https://github.com/Inder00/OpenSourceSectors/pull/14

Inder00 commented 2 years ago

Testing it out...

Inder00 commented 2 years ago
java.lang.NullPointerException: Cannot invoke "io.rsocket.netty.channel.Channel.remoteAddress()" because the return value of "pl.inder00.opensource.sectors.protocol.ISectorClient.getChannel()" is null
        at pl.inder00.opensource.sectors.spigot.protocol.DefaultMasterServerListener.onClientException(DefaultMasterServerListener.java:41) ~[Sectors-Spigot_v1.0.2-da300272646433917beb174896b8d2d921699d4c.jar:?]
        at pl.inder00.opensource.sectors.protocol.impl.DefaultSectorClient.connect(DefaultSectorClient.java:136) ~[Sectors-Spigot_v1.0.2-da300272646433917beb174896b8d2d921699d4c.jar:?]
        at pl.inder00.opensource.sectors.spigot.Sectors.onEnable(Sectors.java:94) [Sectors-Spigot_v1.0.2-da300272646433917beb174896b8d2d921699d4c.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) [server.jar:git-Spigot-21fe707-e1ebe52]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) [server.jar:git-Spigot-21fe707-e1ebe52]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [server.jar:git-Spigot-21fe707-e1ebe52]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:357) [server.jar:git-Spigot-21fe707-e1ebe52]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:317) [server.jar:git-Spigot-21fe707-e1ebe52]
        at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:414) [server.jar:git-Spigot-21fe707-e1ebe52]
        at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:378) [server.jar:git-Spigot-21fe707-e1ebe52]
        at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:333) [server.jar:git-Spigot-21fe707-e1ebe52]
        at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:263) [server.jar:git-Spigot-21fe707-e1ebe52]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [server.jar:git-Spigot-21fe707-e1ebe52]
        at java.base/java.lang.Thread.run(Thread.java:833) [?:?]

https://github.com/Inder00/OpenSourceSectors/actions/runs/1589902983

Inder00 commented 2 years ago
00:48:19 [SEVERE] [OpenSourceSectors] Failed to register "spawn" sector (Cannot invoke "pl.inder00.opensource.sectors.protocol.listeners.ISectorClientListener.onClientCreated(pl.inder00.opensource.sectors.protocol.ISectorClient)" because "this.clientListener" is null).
00:48:19 [SEVERE] [OpenSourceSectors] Failed to register "s1" sector (Cannot invoke "pl.inder00.opensource.sectors.protocol.listeners.ISectorClientListener.onClientCreated(pl.inder00.opensource.sectors.protocol.ISectorClient)" because "this.clientListener" is null).
00:48:19 [INFO] Closing pending connections
00:48:19 [SEVERE] [OpenSourceSectors] Failed to register "s2" sector (Cannot invoke "pl.inder00.opensource.sectors.protocol.listeners.ISectorClientListener.onClientCreated(pl.inder00.opensource.sectors.protocol.ISectorClient)" because "this.clientListener" is null).
00:48:19 [INFO] Disconnecting 0 connections
00:48:19 [SEVERE] [OpenSourceSectors] Failed to register "s3" sector (Cannot invoke "pl.inder00.opensource.sectors.protocol.listeners.ISectorClientListener.onClientCreated(pl.inder00.opensource.sectors.protocol.ISectorClient)" because "this.clientListener" is null).
00:48:19 [SEVERE] [OpenSourceSectors] Failed to register "s4" sector (Cannot invoke "pl.inder00.opensource.sectors.protocol.listeners.ISectorClientListener.onClientCreated(pl.inder00.opensource.sectors.protocol.ISectorClient)" because "this.clientListener" is null).
[00:48:20 ERROR]: [OpenSourceSectors] Connection to master server occurred an error.
io.rsocket.netty.handler.codec.DecoderException: pl.inder00.opensource.sectors.protocol.exceptions.InvalidProtobufMessageException: Invalid protobuf message (1834374793)
        at io.rsocket.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:477) ~[Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276) ~[Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at java.base/java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: pl.inder00.opensource.sectors.protocol.exceptions.InvalidProtobufMessageException: Invalid protobuf message (1834374793)
        at pl.inder00.opensource.sectors.protocol.pipelines.ProtobufDecoder.decode(ProtobufDecoder.java:47) ~[Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:507) ~[Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:446) ~[Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        ... 26 more
[00:48:20 INFO]: Done (31,109s)! For help, type "help" or "?"
[00:48:23 ERROR]: [OpenSourceSectors] Connection to master server occurred an error.
java.net.SocketException: Connection reset
        at java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(SocketChannelImpl.java:394) ~[?:?]
        at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:426) ~[?:?]
        at io.rsocket.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253) ~[Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132) ~[Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350) ~[Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at io.rsocket.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [Sectors-Spigot_v1.0.2-69588641cc0f3ab5cddcf621ca322eb3f2eba5ee.jar:?]
        at java.base/java.lang.Thread.run(Thread.java:833) [?:?]

https://github.com/Inder00/OpenSourceSectors/actions/runs/1589931563

Inder00 commented 2 years ago
[01:00:43 ERROR]: [OpenSourceSectors] Connection to master server occurred an error.
pl.inder00.opensource.libs.netty.handler.codec.DecoderException: pl.inder00.opensource.sectors.protocol.exceptions.InvalidProtobufMessageException: Invalid protobuf message (375307352)
        at pl.inder00.opensource.libs.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:477) ~[Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276) ~[Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at java.base/java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: pl.inder00.opensource.sectors.protocol.exceptions.InvalidProtobufMessageException: Invalid protobuf message (375307352)
        at pl.inder00.opensource.sectors.protocol.pipelines.ProtobufDecoder.decode(ProtobufDecoder.java:47) ~[Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:507) ~[Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        at pl.inder00.opensource.libs.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:446) ~[Sectors-Spigot_v1.0.2-1219980d081ba316d97ccfab2740b68114ca6283.jar:?]
        ... 26 more

https://github.com/Inder00/OpenSourceSectors/actions/runs/1589966172

Inder00 commented 2 years ago

Fully working netty implementation