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

People are not getting teleported to spawn if the game's finished. #53

Closed colinnijhout closed 4 years ago

colinnijhout commented 6 years ago

As you can see, the title says it all. I tried multiple times to recreate the arena but people won't get teleported to spawn if the player dies. Instead of being teleported they just stay at the same place where they died and just getting their normal inventory back. They're not invincible and can be killed, they'll still lose their normal items they had before the game started.

Info:

I hope you can fix this, because it's really annoying. Thanks!

Regrads, Colin (ThisIsOllie)

colinnijhout commented 6 years ago

By the way, the player is able to get back to the spawn, but only by /spawn or /sg leave.

tmoyer commented 4 years ago

I know this issue is over 2 years old, but I'm having the same problem. It seems like it cancels the kill event because it doesn't update any placeholders such as kills and for a second you're teleported, but then you're teleported back like when an event is cancelled.

Any idea what's wrong?

tmoyer commented 4 years ago

BTW, I'm using: Survival Games version 0.7.5 (actually using latest jar Remyk1 posted to issue https://github.com/ThunderGemios10/Survival-Games/issues/83) Minecraft/Spigot 1.12.2 WorldEdit 6.1.9

Remyk1 commented 4 years ago

Any errors in console?

tmoyer commented 4 years ago

Yes, right before it resets everything when the game ends it outputs these errors:

11.02 08:03:46 [Server] WARN com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 44,109,556 milliseconds ago.  The last packet sent successfully to the server was 44,109,590 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
11.02 08:03:46 [Server] WARN at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
11.02 08:03:46 [Server] WARN at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
11.02 08:03:46 [Server] WARN at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
11.02 08:03:46 [Server] WARN at java.lang.reflect.Constructor.newInstance(Unknown Source)
11.02 08:03:46 [Server] WARN at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
11.02 08:03:46 [Server] WARN at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:990)
11.02 08:03:46 [Server] WARN at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3746)
11.02 08:03:46 [Server] WARN at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2509)
11.02 08:03:46 [Server] WARN at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
11.02 08:03:46 [Server] WARN at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2484)
11.02 08:03:46 [Server] WARN at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
11.02 08:03:46 [Server] WARN at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1966)
11.02 08:03:46 [Server] WARN at com.thundergemios10.survivalgames.stats.StatsManager.saveGame(StatsManager.java:129)
11.02 08:03:46 [Server] WARN at com.thundergemios10.survivalgames.Game.playerWin(Game.java:757)
11.02 08:03:46 [Server] WARN at com.thundergemios10.survivalgames.Game.killPlayer(Game.java:702)
11.02 08:03:46 [Server] WARN at com.thundergemios10.survivalgames.events.DeathEvent.onPlayerDieEvent(DeathEvent.java:59)
11.02 08:03:46 [Server] WARN at sun.reflect.GeneratedMethodAccessor230.invoke(Unknown Source)
11.02 08:03:46 [Server] WARN at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
11.02 08:03:46 [Server] WARN at java.lang.reflect.Method.invoke(Unknown Source)
11.02 08:03:46 [Server] WARN at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302)
11.02 08:03:46 [Server] WARN at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
11.02 08:03:46 [Server] WARN at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:500)
11.02 08:03:46 [Server] WARN at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:485)
11.02 08:03:46 [Server] WARN at org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.callEvent(CraftEventFactory.java:93)
11.02 08:03:46 [Server] WARN at org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.callEntityDamageEvent(CraftEventFactory.java:580)
11.02 08:03:46 [Server] WARN at org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.handleEntityDamageEvent(CraftEventFactory.java:483)
11.02 08:03:46 [Server] WARN at org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.handleLivingEntityDamageEvent(CraftEventFactory.java:612)
11.02 08:03:46 [Server] WARN at net.minecraft.server.v1_12_R1.EntityLiving.damageEntity0(EntityLiving.java:1346)
11.02 08:03:46 [Server] WARN at net.minecraft.server.v1_12_R1.EntityHuman.damageEntity0(EntityHuman.java:846)
11.02 08:03:46 [Server] WARN at net.minecraft.server.v1_12_R1.EntityLiving.damageEntity(EntityLiving.java:860)
11.02 08:03:46 [Server] WARN at net.minecraft.server.v1_12_R1.EntityHuman.damageEntity(EntityHuman.java:759)
11.02 08:03:46 [Server] WARN at net.minecraft.server.v1_12_R1.EntityPlayer.damageEntity(EntityPlayer.java:586)
11.02 08:03:46 [Server] WARN at net.minecraft.server.v1_12_R1.EntityHuman.attack(EntityHuman.java:1005)
11.02 08:03:46 [Server] WARN at net.minecraft.server.v1_12_R1.EntityPlayer.attack(EntityPlayer.java:1311)
11.02 08:03:46 [Server] WARN at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1625)
11.02 08:03:46 [Server] WARN at net.minecraft.server.v1_12_R1.PacketPlayInUseEntity.a(SourceFile:69)
11.02 08:03:46 [Server] WARN at net.minecraft.server.v1_12_R1.PacketPlayInUseEntity.a(SourceFile:13)
11.02 08:03:46 [Server] WARN at net.minecraft.server.v1_12_R1.PlayerConnectionUtils$1.run(SourceFile:13)
11.02 08:03:46 [Server] WARN at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
11.02 08:03:46 [Server] WARN at java.util.concurrent.FutureTask.run(Unknown Source)
11.02 08:03:46 [Server] WARN at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46)
11.02 08:03:46 [Server] WARN at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:748)
11.02 08:03:46 [Server] WARN at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406)
11.02 08:03:46 [Server] WARN at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679)
11.02 08:03:46 [Server] WARN at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577)
11.02 08:03:46 [Server] WARN at java.lang.Thread.run(Unknown Source)
11.02 08:03:46 [Server] WARN Caused by: java.net.SocketException: Broken pipe (Write failed)
11.02 08:03:46 [Server] WARN at java.net.SocketOutputStream.socketWrite0(Native Method)
11.02 08:03:46 [Server] WARN at java.net.SocketOutputStream.socketWrite(Unknown Source)
11.02 08:03:46 [Server] WARN at java.net.SocketOutputStream.write(Unknown Source)
11.02 08:03:46 [Server] WARN at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
11.02 08:03:46 [Server] WARN at java.io.BufferedOutputStream.flush(Unknown Source)
11.02 08:03:46 [Server] WARN at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3728)
11.02 08:03:46 [Server] WARN ... 39 more
tmoyer commented 4 years ago

And a different MySQL error shows up in console after a battle in a different arena:

11.02 08:10:12 [Server] WARN java.sql.SQLException: Illegal operation on empty result set.
11.02 08:10:12 [Server] WARN at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
11.02 08:10:12 [Server] WARN at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:898)
11.02 08:10:12 [Server] WARN at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:887)
11.02 08:10:12 [Server] WARN at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:861)
11.02 08:10:12 [Server] WARN at com.mysql.jdbc.ResultSetImpl.checkRowPos(ResultSetImpl.java:790)
11.02 08:10:12 [Server] WARN at com.mysql.jdbc.ResultSetImpl.getInt(ResultSetImpl.java:2475)
11.02 08:10:12 [Server] WARN at com.thundergemios10.survivalgames.stats.StatsManager.saveGame(StatsManager.java:131)
11.02 08:10:12 [Server] WARN at com.thundergemios10.survivalgames.Game.playerWin(Game.java:757)
11.02 08:10:12 [Server] WARN at com.thundergemios10.survivalgames.Game.killPlayer(Game.java:702)
11.02 08:10:12 [Server] WARN at com.thundergemios10.survivalgames.events.DeathEvent.onPlayerDieEvent(DeathEvent.java:59)
11.02 08:10:12 [Server] WARN at sun.reflect.GeneratedMethodAccessor293.invoke(Unknown Source)
11.02 08:10:12 [Server] WARN at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
11.02 08:10:12 [Server] WARN at java.lang.reflect.Method.invoke(Unknown Source)
11.02 08:10:12 [Server] WARN at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302)
11.02 08:10:12 [Server] WARN at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
11.02 08:10:12 [Server] WARN at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:500)
11.02 08:10:12 [Server] WARN at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:485)
11.02 08:10:12 [Server] WARN at org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.callEvent(CraftEventFactory.java:93)
11.02 08:10:12 [Server] WARN at org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.handleEntityDamageEvent(CraftEventFactory.java:485)
11.02 08:10:12 [Server] WARN at org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.handleLivingEntityDamageEvent(CraftEventFactory.java:612)
11.02 08:10:12 [Server] WARN at net.minecraft.server.v1_12_R1.EntityLiving.damageEntity0(EntityLiving.java:1346)
11.02 08:10:12 [Server] WARN at net.minecraft.server.v1_12_R1.EntityHuman.damageEntity0(EntityHuman.java:846)
11.02 08:10:12 [Server] WARN at net.minecraft.server.v1_12_R1.EntityLiving.damageEntity(EntityLiving.java:868)
11.02 08:10:12 [Server] WARN at net.minecraft.server.v1_12_R1.EntityHuman.damageEntity(EntityHuman.java:759)
11.02 08:10:12 [Server] WARN at net.minecraft.server.v1_12_R1.EntityPlayer.damageEntity(EntityPlayer.java:586)
11.02 08:10:12 [Server] WARN at net.minecraft.server.v1_12_R1.EntityLiving.ac(EntityLiving.java:1454)
11.02 08:10:12 [Server] WARN at net.minecraft.server.v1_12_R1.Entity.Y(Entity.java:453)
11.02 08:10:12 [Server] WARN at net.minecraft.server.v1_12_R1.EntityLiving.Y(EntityLiving.java:204)
11.02 08:10:12 [Server] WARN at net.minecraft.server.v1_12_R1.Entity.B_(Entity.java:321)
11.02 08:10:12 [Server] WARN at net.minecraft.server.v1_12_R1.EntityLiving.B_(EntityLiving.java:1873)
11.02 08:10:12 [Server] WARN at net.minecraft.server.v1_12_R1.EntityHuman.B_(EntityHuman.java:145)
11.02 08:10:12 [Server] WARN at net.minecraft.server.v1_12_R1.EntityPlayer.playerTick(EntityPlayer.java:313)
11.02 08:10:12 [Server] WARN at net.minecraft.server.v1_12_R1.PlayerConnection.e(PlayerConnection.java:140)
11.02 08:10:12 [Server] WARN at com.denizenscript.denizen.nms.v1_12.impl.packets.handlers.AbstractListenerPlayInImpl.e(AbstractListenerPlayInImpl.java:60)
11.02 08:10:12 [Server] WARN at net.minecraft.server.v1_12_R1.NetworkManager.a(NetworkManager.java:233)
11.02 08:10:12 [Server] WARN at net.minecraft.server.v1_12_R1.ServerConnection.c(ServerConnection.java:140)
11.02 08:10:12 [Server] WARN at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:845)
11.02 08:10:12 [Server] WARN at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406)
11.02 08:10:12 [Server] WARN at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679)
11.02 08:10:12 [Server] WARN at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577)
11.02 08:10:12 [Server] WARN at java.lang.Thread.run(Unknown Source)
Remyk1 commented 4 years ago

If you don't have a database make sure to disable stats. Otherwise make sure your database settings are correct.

tmoyer commented 4 years ago

I do have a database and settings were correct. I could see data stored in the database. I have now disabled stats because I'm not certain we need stats. We need it to tell Spigot that someone gets a kill.

tmoyer commented 4 years ago

I just tested again without stats and there are no errors that I can see, but it also didn't work. Here are log messages around the kill event:

11.02 09:11:42 [Server] INFO [Debug] ChestReplaceEvent: -3,65,0
11.02 09:11:42 [Server] INFO [Debug] Look again, slot 5 is already occupied!
11.02 09:11:42 [Server] INFO [Debug] Look again, slot 21 is already occupied!
11.02 09:11:45 [Server] INFO [Debug] ChestReplaceEvent: -2,66,0
11.02 09:11:45 [Server] INFO [Debug] Look again, slot 1 is already occupied!
11.02 09:11:45 [Server] INFO [Debug] ChestReplaceEvent: 0,65,3
11.02 09:11:45 [Server] INFO [Debug] Look again, slot 8 is already occupied!
11.02 09:11:45 [Server] INFO [Debug] Look again, slot 8 is already occupied!
11.02 09:11:45 [Server] INFO [Debug] Look again, slot 14 is already occupied!
11.02 09:11:48 [Server] INFO [Debug] ChestReplaceEvent: 0,66,2
11.02 09:11:50 [Server] INFO [Debug] ChestReplaceEvent: 0,66,-2
11.02 09:11:51 [Server] INFO [Debug] ChestReplaceEvent: 0,67,1
11.02 09:11:53 [Server] INFO [Debug] ChestReplaceEvent: 0,65,-3
11.02 09:11:54 [Server] INFO [Debug] ChestReplaceEvent: -1,67,0
11.02 09:11:54 [Server] INFO [Debug] Look again, slot 21 is already occupied!
11.02 09:11:56 [Server] INFO [Debug] ChestReplaceEvent: 0,68,0
11.02 09:11:56 [Server] INFO [Debug] Look again, slot 7 is already occupied!
11.02 09:11:57 [Server] INFO [Debug] ChestReplaceEvent: 0,67,-1
11.02 09:11:57 [Server] INFO [Debug] Look again, slot 0 is already occupied!
11.02 09:12:03 [Server] INFO [Debug] ChestReplaceEvent: 1,65,15
11.02 09:12:03 [Server] INFO [Debug] Look again, slot 17 is already occupied!
11.02 09:12:12 [Server] INFO [Debug] ChestReplaceEvent: -13,69,11
11.02 09:12:12 [Server] INFO [Debug] Look again, slot 22 is already occupied!
11.02 09:12:18 [Server] INFO [Debug] ChestReplaceEvent: -19,66,0
11.02 09:12:18 [Server] INFO [Debug] Look again, slot 16 is already occupied!
11.02 09:12:21 [Server] INFO [Debug] ChestReplaceEvent: -10,65,-6
11.02 09:12:21 [Server] INFO [Debug] Look again, slot 13 is already occupied!
11.02 09:12:25 [Server] INFO [Debug] ChestReplaceEvent: -4,65,-16
11.02 09:12:25 [Server] INFO [Debug] Look again, slot 20 is already occupied!
11.02 09:12:32 [Server] INFO [Debug] ChestReplaceEvent: -17,70,3
11.02 09:12:33 [Server] WARN SkyTester moved wrongly!
11.02 09:12:34 [Server] INFO [PintPVP]: SkyBoi killed SkyTester to win the Survival Games on arena 1
11.02 09:12:34 [Server] INFO Arena 1 reset. Rolled back 45 blocks in 1 iterations (100 blocks per iteration Total time spent rolling back was 7ms)
11.02 09:12:34 [Server] INFO [Debug] Resetting saved chests content for game 1
Remyk1 commented 4 years ago

Ok i added a bit more debuging to this one. Survival-Games.zip

tmoyer commented 4 years ago

This is the extra logging that comes up.

11.02 10:31:39 [Server] INFO [Debug] game.killPlayer() was called playerNamehooperhooperleft:false
11.02 10:31:39 [Server] INFO [Debug] game.killPlayer() cleared player inventory
11.02 10:31:39 [Server] INFO [Debug] teleported player to loby.  game.killPlayer(). lobbyLoc: Location{world=CraftWorld{name=hub},x=-3.0,y=87.0,z=-36.0,pitch=6.0,yaw=-6.0}
11.02 10:31:39 [Server] INFO [PintPVP]: SkyBoi killed hooperhooper to win the Survival Games on arena 2
Remyk1 commented 4 years ago

And it stil doesn't teleport you?

tmoyer commented 4 years ago

Yeah. It also doesn't count as a kill in all of my installed plugins.

Remyk1 commented 4 years ago

Added more debugging. Survival-Games.zip

tmoyer commented 4 years ago

Here's what it says now:

11.02 18:13:09 [Server] INFO [Debug] game.killPlayer() was called playerName Ferb_bot left: false
11.02 18:13:09 [Server] INFO [Debug] game.killPlayer() cleared player inventory
11.02 18:13:09 [Server] INFO [Debug] TeleportEvent should isCancelled before: false
11.02 18:13:09 [Server] INFO [Debug] TeleportEvent isCancelled after: false all plugins with this event registerd: [{ name: WorldGuard Priority: LOW }, { name: NOPE Priority: NORMAL }, { name: OldCombatMechanics Priority: NORMAL }, { name: CombatTagPlus Priority: NORMAL }, { name: CombatTagPlus Priority: NORMAL }, { name: QuickBoard Priority: NORMAL }, { name: Citizens Priority: NORMAL }, { name: SurvivalGames Priority: NORMAL }, { name: SuperVanish Priority: HIGH }, { name: Multiverse-Core Priority: HIGHEST }]
11.02 18:13:09 [Server] INFO [Debug] teleported player to loby.  game.killPlayer(). wasTeleported: true lobbyLoc: Location{world=CraftWorld{name=hub},x=-3.0,y=87.0,z=-36.0,pitch=6.0,yaw=-6.0}
11.02 18:13:09 [Server] INFO [Debug] TeleportEvent should isCancelled before: false
11.02 18:13:09 [Server] INFO [Debug] TeleportEvent isCancelled after: false all plugins with this event registerd: [{ name: WorldGuard Priority: LOW }, { name: NOPE Priority: NORMAL }, { name: OldCombatMechanics Priority: NORMAL }, { name: CombatTagPlus Priority: NORMAL }, { name: CombatTagPlus Priority: NORMAL }, { name: QuickBoard Priority: NORMAL }, { name: Citizens Priority: NORMAL }, { name: SurvivalGames Priority: NORMAL }, { name: SuperVanish Priority: HIGH }, { name: Multiverse-Core Priority: HIGHEST }]
11.02 18:13:09 [Server] INFO [PintPVP]: SkyBoi killed Ferb_bot to win the Survival Games on arena 1
11.02 18:13:09 [Server] INFO Arena 1 reset. Rolled back 52 blocks in 1 iterations (100 blocks per iteration Total time spent rolling back was 7ms)
tmoyer commented 4 years ago

Just found something interesting. The bedwars plugin also has this problem, leading me to believe it may not be this plugin.

Remyk1 commented 4 years ago

Yes i seems quite unlikely that it is is this plugin but lets find out which plugin is the culprit. either try removing all other plugins from this list one by one all plugins with this event registerd: [{ name: WorldGuard Priority: LOW }, { name: NOPE Priority: NORMAL }, { name: OldCombatMechanics Priority: NORMAL }, { name: CombatTagPlus Priority: NORMAL }, { name: CombatTagPlus Priority: NORMAL }, { name: QuickBoard Priority: NORMAL }, { name: Citizens Priority: NORMAL }, { name: SurvivalGames Priority: NORMAL }, { name: SuperVanish Priority: HIGH }, { name: Multiverse-Core Priority: HIGHEST }]

or try to narrow it down with more debugg info (checks whether event is cancelled from multiple priorities) Survival-Games.zip

tmoyer commented 4 years ago

Thank you so much! I was able to find and replace the culprit, CombatTagPlus with CombatLogX.

Remyk1 commented 4 years ago

You're welcome