Closed byzp closed 1 year ago
疑似这个数组越界的问题还没有解决掉,我可能还要回去清查一下
具体是什么情况,请再提供详细信息,我这边没法复现出来 另外,房主没办法转让是.give指令没有实现所导致的(说白了就是忘了做),房主离开时权限可以切换到下一个玩家上(至少目前我测试没问题)
(以下都是在arm架构设备上取得的数据) java8环境下(在程序userland中编译并运行): a@localhost:~/m$ java -cp libs/*:Rukkit.jar cn.rukkit.RukkitLauncher 2022-09-29 17:30:20.728 [main] INFO cn.rukkit.Rukkit - Loading server config... 2022-09-29 17:30:20.803 [main] INFO cn.rukkit.Rukkit - Loading default round config... 2022-09-29 17:30:20.810 [main] INFO cn.rukkit.Rukkit - setting up language... 2022-09-29 17:30:20.810 [main] INFO cn.rukkit.Rukkit - Current Language: en_US 2022-09-29 17:30:20.812 [main] INFO cn.rukkit.Rukkit - init::ThreadManager 2022-09-29 17:30:20.813 [main] INFO cn.rukkit.Rukkit - init::ModManager 2022-09-29 17:30:20.879 [main] INFO cn.rukkit.game.mod.ModLoader - /home/a/m/mods 2022-09-29 17:30:20.880 [main] INFO cn.rukkit.Rukkit - init::CommandManager 2022-09-29 17:30:20.881 [main] INFO cn.rukkit.Rukkit - init::GameServer 2022-09-29 17:30:20.883 [main] INFO cn.rukkit.Rukkit - init::ConnectionManager 2022-09-29 17:30:20.924 [main] INFO cn.rukkit.Rukkit - init::PluginManager 2022-09-29 17:30:20.925 [main] INFO cn.rukkit.plugin.PluginManager - Loading plugin: base-plugin v1.0.0 2022-09-29 17:30:20.926 [main] INFO cn.rukkit.plugin.internal.BasePlugin - BasePlugin::Load 2022-09-29 17:30:20.932 [main] INFO cn.rukkit.plugin.PluginManager - Loading plugin: command-plugin v1.0.0 2022-09-29 17:30:20.932 [main] INFO cn.rukkit.plugin.internal.CommandPlugin - CommandPlugin::onLoad() 2022-09-29 17:30:20.945 [main] INFO cn.rukkit.plugin.PluginManager - Loading plugin: ???? v1.0.0 2022-09-29 17:30:20.945 [main] INFO cn.rukkit.plugin.internal.TestPlugin - TestPlugin is loading... 2022-09-29 17:30:20.950 [main] INFO cn.rukkit.plugin.PluginManager - Loading plugin: server-command-plugin v1.0.0 2022-09-29 17:30:20.950 [main] INFO cn.rukkit.plugin.internal.ServerCommandPlugin - ServerCommandPlugin::onLoad... 2022-09-29 17:30:20.954 [main] INFO cn.rukkit.plugin.PluginManager - Plugin loader started 2022-09-29 17:30:20.955 [main] INFO cn.rukkit.plugin.PluginManager - Load complete! 2022-09-29 17:30:20.956 [main] INFO cn.rukkit.game.SaveManager - SaveManager::init 2022-09-29 17:30:20.957 [main] INFO cn.rukkit.Rukkit - start::game server on port:55555 2022-09-29 17:30:20.999 [Thread-2] INFO cn.rukkit.network.GameServer - Done! (272ms) 2022-09-29 17:30:21.058 [nioEventLoopGroup-2-1] ERROR cn.rukkit.network.GameServer - [id: 0x95980032] REGISTERED 2022-09-29 17:30:21.060 [nioEventLoopGroup-2-1] ERROR cn.rukkit.network.GameServer - [id: 0x95980032] BIND(0.0.0.0/0.0.0.0:55555) 2022-09-29 17:30:21.064 [nioEventLoopGroup-2-1] ERROR cn.rukkit.network.GameServer - [id: 0x95980032, L:/0.0.0.0:55555] ACTIVE --------------------第一个玩家加入 2022-09-29 17:30:51.264 [nioEventLoopGroup-2-1] ERROR cn.rukkit.network.GameServer - [id: 0x95980032, L:/0.0.0.0:55555] READ: [id: 0x2951742d, L:/192.168.1.102:55555 - R:/192.168.1.102:37326] 2022-09-29 17:30:51.266 [nioEventLoopGroup-2-1] ERROR cn.rukkit.network.GameServer - [id: 0x95980032, L:/0.0.0.0:55555] READ COMPLETE 2022-09-29 17:30:51.345 [nioEventLoopGroup-3-1] INFO cn.rukkit.network.ConnectionHandler - New connection established:/192.168.1.102:37326 2022-09-29 17:30:51.379 [nioEventLoopGroup-3-1] INFO cn.rukkit.network.ConnectionHandler - Got Player(package=com.corrodinggames.rtt, version=151, name=abc, uuid=44C2E9F317D8D5ABA36FB0C0E5231CCC206CEFCFE116631373F85742F69FE836, verify=c:114514m:99627420:7436487041:1145142:14886820003:1425144:-13845925:2745146:-1447347808t1:743648704d:572570 --------------------第二个玩家加入 2022-09-29 17:30:54.592 [nioEventLoopGroup-2-1] ERROR cn.rukkit.network.GameServer - [id: 0x95980032, L:/0.0.0.0:55555] READ: [id: 0x902500d1, L:/192.168.1.102:55555 - R:/192.168.1.101:50120] 2022-09-29 17:30:54.594 [nioEventLoopGroup-2-1] ERROR cn.rukkit.network.GameServer - [id: 0x95980032, L:/0.0.0.0:55555] READ COMPLETE 2022-09-29 17:30:54.602 [nioEventLoopGroup-3-2] INFO cn.rukkit.network.ConnectionHandler - New connection established:/192.168.1.101:50120 2022-09-29 17:30:54.623 [nioEventLoopGroup-3-2] INFO cn.rukkit.network.ConnectionHandler - Got Player(package=com.corrodinggames.rtv, version=151, name=Unnamed731, uuid=5B81C84C274D4373C37169FA7C828EFBA266FDEB814D7335F3111648667C4198, verify=c:114514m:99627420:7436487041:1145142:14886820003:1425144:-13845925:2745146:-1447347808t1:743648704d:572570 --------------------第一个玩家离开 2022-09-29 17:31:01.398 [nioEventLoopGroup-3-1] WARN cn.rukkit.network.ConnectionHandler - Exception happened java.io.IOException: Connection reset by peer at sun.nio.ch.FileDispatcherImpl.read0(Native Method) at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) at sun.nio.ch.IOUtil.read(IOUtil.java:192) at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379) at io.netty.buffer.UnpooledUnsafeDirectByteBuf.setBytes(UnpooledUnsafeDirectByteBuf.java:368) at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:892) at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:243) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:119) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:646) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:581) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:498) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:460) at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:131) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:750) 这时第二个玩家有房主特有的中括号,但没有权限
java17环境下(releases下载的0.8.2版本,在程序termux中运行):
/sdcard/zzx $ java -cp libs/*:Rukkit-0.8.2-dev.jar cn.rukkit.RukkitLauncher
2022-09-29 17:42:44.671 [main] INFO cn.rukkit.Rukkit - Loading server config...
2022-09-29 17:42:44.729 [main] DEBUG cn.rukkit.Rukkit - Found Config file.Reading...
2022-09-29 17:42:44.790 [main] INFO cn.rukkit.Rukkit - Loading default round config...
2022-09-29 17:42:44.790 [main] DEBUG cn.rukkit.Rukkit - Found Config file.Reading...
2022-09-29 17:42:44.797 [main] INFO cn.rukkit.Rukkit - setting up language...
2022-09-29 17:42:44.798 [main] INFO cn.rukkit.Rukkit - Current Language: en
2022-09-29 17:42:44.800 [main] INFO cn.rukkit.Rukkit - init::ThreadManager
2022-09-29 17:42:44.802 [main] INFO cn.rukkit.Rukkit - init::ModManager
2022-09-29 17:42:44.880 [main] INFO cn.rukkit.game.mod.ModLoader - /storage/emulated/0/zzx/mods
2022-09-29 17:42:44.882 [main] INFO cn.rukkit.Rukkit - init::CommandManager
2022-09-29 17:42:44.883 [main] INFO cn.rukkit.Rukkit - init::GameServer
2022-09-29 17:42:44.885 [main] INFO cn.rukkit.Rukkit - init::ConnectionManager
2022-09-29 17:42:44.915 [main] DEBUG io.netty.util.internal.PlatformDependent0 - -Dio.netty.noUnsafe: false
2022-09-29 17:42:44.916 [main] DEBUG io.netty.util.internal.PlatformDependent0 - Java version: 17
2022-09-29 17:42:44.918 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.theUnsafe: available
2022-09-29 17:42:44.918 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.copyMemory: available
2022-09-29 17:42:44.919 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Buffer.address: available
2022-09-29 17:42:44.922 [main] DEBUG io.netty.util.internal.PlatformDependent0 - direct buffer constructor: unavailable
java.lang.UnsupportedOperationException: Reflective setAccessible(true) disabled
at io.netty.util.internal.ReflectionUtil.trySetAccessible(ReflectionUtil.java:31)
at io.netty.util.internal.PlatformDependent0$4.run(PlatformDependent0.java:220)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
at io.netty.util.internal.PlatformDependent0.
termux中用gradle7.5.1,java17编译,运行后: .../zzx/m $ java -cp libs/*:Rukkit.jar cn.rukkit.RukkitLauncher 2022-09-29 17:57:05.845 [main] INFO cn.rukkit.Rukkit - Loading server config... 2022-09-29 17:57:05.943 [main] INFO cn.rukkit.Rukkit - Loading default round config... 2022-09-29 17:57:05.951 [main] INFO cn.rukkit.Rukkit - setting up language... Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1 at cn.rukkit.Rukkit.startServer(Rukkit.java:231) at cn.rukkit.RukkitLauncher.main(RukkitLauncher.java:54)
这个问题应该是没有调整serverInfo导致的问题,此时玩家2是有权限的,但是只能通过指令操作,这个bug已经在新版本里面修复了
ubuntu server 20.04 openjdk-17-jre-headless 启动命令是java -cp libs/*:Rukkit.jar cn.rukkit.RukkitLauncher 程序是刚刚编译的
………… 2022-07-29 21:12:40.082 [Thread-1] INFO cn.rukkit.network.GameServer - Done! (481ms) 2022-07-29 21:12:40.160 [nioEventLoopGroup-2-1] ERROR cn.rukkit.network.GameServer - [id: 0x9731226e] REGISTERED 2022-07-29 21:12:40.162 [nioEventLoopGroup-2-1] ERROR cn.rukkit.network.GameServer - [id: 0x9731226e] BIND(0.0.0.0/0.0.0.0:65535) 2022-07-29 21:12:40.167 [nioEventLoopGroup-2-1] ERROR cn.rukkit.network.GameServer - [id: 0x9731226e, L:/[0:0:0:0:0:0:0:0]:65535] ACTIVE 2022-07-29 21:12:47.776 [nioEventLoopGroup-2-1] ERROR cn.rukkit.network.GameServer - [id: 0x9731226e, L:/[0:0:0:0:0:0:0:0]:65535] READ: [id: 0xa5146738, L:/xxx.xxx.xxx.xxx:65535 - R:/xxx.xxx.xxx.xxx:1616] 2022-07-29 21:12:47.781 [nioEventLoopGroup-2-1] ERROR cn.rukkit.network.GameServer - [id: 0x9731226e, L:/[0:0:0:0:0:0:0:0]:65535] READ COMPLETE 2022-07-29 21:12:47.804 [nioEventLoopGroup-3-1] INFO cn.rukkit.network.ConnectionHandler - New connection established:/xxx.xxx.xxx.xxx:1616 2022-07-29 21:12:47.828 [nioEventLoopGroup-3-1] INFO cn.rukkit.network.ConnectionHandler - Got Player(package=com.corrodinggames.rtt, version=151, name=xxx, uuid=239C36A3507CB2051486FA4A734B375CF9139FF85B1FB82401BCD578B9606B53, verify=c:114514m:99627420:7436487041:1145142:14886820003:1425144:-13845925:2745146:-1447347808t1:743648704d:572570 2022-07-29 21:12:49.828 [nioEventLoopGroup-3-1] WARN cn.rukkit.network.ConnectionHandler - Exception happened java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 20 at cn.rukkit.game.PlayerManager.remove(PlayerManager.java:82) at cn.rukkit.game.PlayerManager.remove(PlayerManager.java:67) at cn.rukkit.network.ConnectionManager.discard(ConnectionManager.java:87) at cn.rukkit.network.ConnectionHandler.channelInactive(ConnectionHandler.java:63) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:240) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:226) at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:219) at io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:379) at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:344) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:240) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:226) at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:219) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1299) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:240) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:226) at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:903) at io.netty.channel.AbstractChannel$AbstractUnsafe$8.run(AbstractChannel.java:768) at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:399) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:464) at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:131) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:833) 2022-07-29 21:12:57.092 [nioEventLoopGroup-2-1] ERROR cn.rukkit.network.GameServer - [id: 0x9731226e, L:/[0:0:0:0:0:0:0:0]:65535] READ: [id: 0x89d12c1c, L:/xxx.xxx.xxx.xxx:65535 - R:/xxx.xxx.xxx.xxx:1652] 2022-07-29 21:12:57.096 [nioEventLoopGroup-2-1] ERROR cn.rukkit.network.GameServer - [id: 0x9731226e, L:/[0:0:0:0:0:0:0:0]:65535] READ COMPLETE 2022-07-29 21:12:57.113 [nioEventLoopGroup-3-2] INFO cn.rukkit.network.ConnectionHandler - New connection established:/xxx.xxx.xxx.xxx:1652 2022-07-29 21:12:57.134 [nioEventLoopGroup-3-2] INFO cn.rukkit.network.ConnectionHandler - Got Player(package=com.corrodinggames.rtu, version=151, name=Unnamed583, uuid=F2B2D4F147D4CED6A55AAF199C33B4053B09A414C16B5083ED0B17045E48B05E, verify=c:114514m:99627420:7436487041:1145142:14886820003:1425144:-13845925:2745146:-1447347808t1:743648704d:572570 2022-07-29 21:13:01.939 [nioEventLoopGroup-2-1] ERROR cn.rukkit.network.GameServer - [id: 0x9731226e, L:/[0:0:0:0:0:0:0:0]:65535] READ: [id: 0x2a99e7ea, L:/xxx.xxx.xxx.xxx:65535 - R:/xxx.xxx.xxx.xxx:1677] 2022-07-29 21:13:01.939 [nioEventLoopGroup-2-1] ERROR cn.rukkit.network.GameServer - [id: 0x9731226e, L:/[0:0:0:0:0:0:0:0]:65535] READ COMPLETE 2022-07-29 21:13:01.949 [nioEventLoopGroup-3-1] INFO cn.rukkit.network.ConnectionHandler - New connection established:/xxx.xxx.xxx.xxx:1677 2022-07-29 21:13:01.974 [nioEventLoopGroup-3-1] INFO cn.rukkit.network.ConnectionHandler - Got Player(package=com.corrodinggames.rtt, version=151, name=abc, uuid=239C36A3507CB2051486FA4A734B375CF9139FF85B1FB82401BCD578B9606B53, verify=c:114514m:99627420:7436487041:1145142:14886820003:1425144:-13845925:2745146:-1447347808t1:743648704d:572570 2022-07-29 21:13:09.153 [nioEventLoopGroup-3-2] WARN cn.rukkit.network.ConnectionHandler - Exception happened 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.netty.buffer.UnpooledUnsafeDirectByteBuf.setBytes(UnpooledUnsafeDirectByteBuf.java:368) at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:892) at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:243) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:119) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:646) at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:546) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:500) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:460) at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:131) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:833)