ThunderGemios10 / Survival-Games

Survival Games plugin for Spigot - UPDATED for 1.13+
https://www.spigotmc.org/resources/survival-games.17740/
GNU General Public License v3.0
25 stars 22 forks source link

Errors when leaving game and resetting spawns. #18

Closed Skegnas closed 4 years ago

Skegnas commented 8 years ago

(Not sure if these should be in separate posts, first time using github)

I have tested this on a server with the latest spigot build, latest versions of worldedit and Survival Games (0.6.3.2) only and on Java 8.

First of all, great plugin I'm glad to see someone carried this on. The first bug is two errors when doing /sg leave, an IndexOutOfBoundsException and NullPointerException (see below).

{Player name} issued server command: /sg leave [16:26:53] [Server thread/INFO]: [SurvivalGames] ??????????????????????? [16:26:53] [Server thread/WARN]: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 [16:26:53] [Server thread/WARN]: at java.util.ArrayList.rangeCheck(Unknown Source) [16:26:53] [Server thread/WARN]: at java.util.ArrayList.get(Unknown Source) [16:26:53] [Server thread/WARN]: at org.mcsg.survivalgames.Game.playerWin(Game.java:662) [16:26:53] [Server thread/WARN]: at org.mcsg.survivalgames.Game.killPlayer(Game.java:633) [16:26:53] [Server thread/WARN]: at org.mcsg.survivalgames.Game.removePlayer(Game.java:525) [16:26:53] [Server thread/WARN]: at org.mcsg.survivalgames.GameManager.removePlayer(GameManager.java:199) [16:26:53] [Server thread/WARN]: at org.mcsg.survivalgames.commands.Leave.onCommand(Leave.java:17) [16:26:53] [Server thread/WARN]: at org.mcsg.survivalgames.CommandHandler.onCommand(CommandHandler.java:155) [16:26:53] [Server thread/WARN]: at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) [16:26:53] [Server thread/WARN]: at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:140) [16:26:53] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_10_R1.CraftServer.dispatchCommand(CraftServer.java:625) [16:26:53] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.PlayerConnection.handleCommand(PlayerConnection.java:1296) [16:26:53] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.PlayerConnection.a(PlayerConnection.java:1156) [16:26:53] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.PacketPlayInChat.a(SourceFile:37) [16:26:53] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.PacketPlayInChat.a(SourceFile:9) [16:26:53] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.PlayerConnectionUtils$1.run(SourceFile:13) [16:26:53] [Server thread/WARN]: at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [16:26:53] [Server thread/WARN]: at java.util.concurrent.FutureTask.run(Unknown Source) [16:26:53] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.SystemUtils.a(SourceFile:45) [16:26:53] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.MinecraftServer.D(MinecraftServer.java:690) [16:26:53] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.DedicatedServer.D(DedicatedServer.java:360) [16:26:53] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.MinecraftServer.C(MinecraftServer.java:646) [16:26:53] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.MinecraftServer.run(MinecraftServer.java:550) [16:26:53] [Server thread/WARN]: at java.lang.Thread.run(Unknown Source) [16:26:53] [Server thread/INFO]: [SurvivalGames] ID1 [16:26:53] [Server thread/INFO]: [SurvivalGames] false [16:26:53] [Server thread/INFO]: [SurvivalGames] 0 [16:26:53] [Server thread/INFO]: [SurvivalGames] [] [16:26:53] [Server thread/INFO]: [SurvivalGames] {Insert my player name here, didn't fancy putting that}

[16:26:53] [Server thread/WARN]: at org.mcsg.survivalgames.Game.killPlayer(Game.java:646) [16:26:53] [Server thread/WARN]: at org.mcsg.survivalgames.Game.removePlayer(Game.java:525) [16:26:53] [Server thread/WARN]: at org.mcsg.survivalgames.GameManager.removePlayer(GameManager.java:199) [16:26:53] [Server thread/WARN]: at org.mcsg.survivalgames.commands.Leave.onCommand(Leave.java:17) [16:26:53] [Server thread/WARN]: at org.mcsg.survivalgames.CommandHandler.onCommand(CommandHandler.java:155) [16:26:53] [Server thread/WARN]: at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) [16:26:53] [Server thread/WARN]: at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:140) [16:26:53] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_10_R1.CraftServer.dispatchCommand(CraftServer.java:625) [16:26:53] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.PlayerConnection.handleCommand(PlayerConnection.java:1296) [16:26:53] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.PlayerConnection.a(PlayerConnection.java:1156) [16:26:53] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.PacketPlayInChat.a(SourceFile:37) [16:26:53] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.PacketPlayInChat.a(SourceFile:9) [16:26:53] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.PlayerConnectionUtils$1.run(SourceFile:13) [16:26:53] [Server thread/WARN]: at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [16:26:53] [Server thread/WARN]: at java.util.concurrent.FutureTask.run(Unknown Source) [16:26:53] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.SystemUtils.a(SourceFile:45) [16:26:53] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.MinecraftServer.D(MinecraftServer.java:690) [16:26:53] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.DedicatedServer.D(DedicatedServer.java:360) [16:26:53] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.MinecraftServer.C(MinecraftServer.java:646) [16:26:53] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.MinecraftServer.run(MinecraftServer.java:550) [16:26:53] [Server thread/WARN]: at java.lang.Thread.run(Unknown Source)

The second is an error when issuing the /sg resetspawns command without a number for the arena (i.e. just /sg resetspawns I realise this isn't how it's meant to be used :-P), this is an ArrayIndexOutOfBoundsException.

{Player name} issued server command: /sg resetspawns [16:30:15] [Server thread/WARN]: java.lang.ArrayIndexOutOfBoundsException: 0 [16:30:15] [Server thread/WARN]: at org.mcsg.survivalgames.commands.ResetSpawns.onCommand(ResetSpawns.java:20) [16:30:15] [Server thread/WARN]: at org.mcsg.survivalgames.CommandHandler.onCommand(CommandHandler.java:155) [16:30:15] [Server thread/WARN]: at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) [16:30:15] [Server thread/WARN]: at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:140) [16:30:15] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_10_R1.CraftServer.dispatchCommand(CraftServer.java:625) [16:30:15] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.PlayerConnection.handleCommand(PlayerConnection.java:1296) [16:30:15] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.PlayerConnection.a(PlayerConnection.java:1156) [16:30:15] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.PacketPlayInChat.a(SourceFile:37) [16:30:15] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.PacketPlayInChat.a(SourceFile:9) [16:30:15] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.PlayerConnectionUtils$1.run(SourceFile:13) [16:30:15] [Server thread/WARN]: at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [16:30:15] [Server thread/WARN]: at java.util.concurrent.FutureTask.run(Unknown Source) [16:30:15] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.SystemUtils.a(SourceFile:45) [16:30:15] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.MinecraftServer.D(MinecraftServer.java:690) [16:30:15] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.DedicatedServer.D(DedicatedServer.java:360) [16:30:15] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.MinecraftServer.C(MinecraftServer.java:646) [16:30:15] [Server thread/WARN]: at net.minecraft.server.v1_10_R1.MinecraftServer.run(MinecraftServer.java:550) [16:30:15] [Server thread/WARN]: at java.lang.Thread.run(Unknown Source)

Also a suggestion for the resetspawns command, could a message acknowledging it working be added please, I am but a simple creature that gets confused when I see nothing obvious happening.

ThunderGemios10 commented 8 years ago

Ok, Just one question. Does the command work?

Skegnas commented 8 years ago

Both commands work. Resetspawns won't do anything if you don't define the arena obviously and also if you haven't disabled the arena, but I imagine that's how it's meant to be.

ThunderGemios10 commented 8 years ago

@Skegnas So commands do work, It's just that it's being handled not properly...

Ok, Thanks for your info, But since the commands do work. This will be a low-priority to be fixed.

Remyk1 commented 4 years ago

I fixed the ArrayIndexOutOfBoundsException in resetspawns in commit 21c36fd7047e1c9541c63f1760157f41dc762a79. For the /sg leave command i can't seem to reproduce this bug in the newest version so i'll just close this issue for now.