Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game doesn't end when a player leaves. Ending it manually results in errors. #68

Closed
Amunak opened this issue Jan 3, 2015 · 2 comments
Closed

Comments

@Amunak
Copy link
Contributor

Amunak commented Jan 3, 2015

So today one of the players crashed or something. When only one team was left, the game didn't end (because technically the one disconnected player was still alive). That wouldn't be too bad if the game could be ended manually, but running /uh finish didn't help (since there still was one team) and I also couldn't remove the team with disconnected player (there was a java error) or just make the DC'd player leave his team (because he was offline).

Java error I got when I tried to remove the team with DC'd player:

[22:18:32 INFO]: Amunak issued server command: /uh team remove cerna
[22:18:32 WARN]: java.lang.reflect.InvocationTargetException
[22:18:32 WARN]:    at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source)
[22:18:32 WARN]:    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[22:18:32 WARN]:    at java.lang.reflect.Method.invoke(Method.java:606)
[22:18:32 WARN]:    at me.azenet.UHPlugin.UHPluginCommand.onCommand(UHPluginCommand.java:201)
[22:18:32 WARN]:    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
[22:18:32 WARN]:    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:180)
[22:18:32 WARN]:    at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchCommand(CraftServer.java:740)
[22:18:32 WARN]:    at net.minecraft.server.v1_7_R4.PlayerConnection.handleCommand(PlayerConnection.java:957)
[22:18:32 WARN]:    at net.minecraft.server.v1_7_R4.PlayerConnection.a(PlayerConnection.java:818)
[22:18:32 WARN]:    at net.minecraft.server.v1_7_R4.PacketPlayInChat.a(PacketPlayInChat.java:28)
[22:18:32 WARN]:    at net.minecraft.server.v1_7_R4.PacketPlayInChat.handle(PacketPlayInChat.java:47)
[22:18:32 WARN]:    at net.minecraft.server.v1_7_R4.NetworkManager.a(NetworkManager.java:157)
[22:18:32 WARN]:    at net.minecraft.server.v1_7_R4.ServerConnection.c(SourceFile:134)
[22:18:32 WARN]:    at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:667)
[22:18:32 WARN]:    at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:258)
[22:18:32 WARN]:    at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:558)
[22:18:32 WARN]:    at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:469)
[22:18:32 WARN]:    at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628)
[22:18:32 WARN]: Caused by: java.lang.NullPointerException
[22:18:32 WARN]:    at me.azenet.UHPlugin.UHTeam.deleteTeam(UHTeam.java:195)
[22:18:32 WARN]:    at me.azenet.UHPlugin.UHTeamManager.removeTeam(UHTeamManager.java:91)
[22:18:32 WARN]:    at me.azenet.UHPlugin.UHTeamManager.removeTeam(UHTeamManager.java:114)
[22:18:32 WARN]:    at me.azenet.UHPlugin.UHPluginCommand.doTeam(UHPluginCommand.java:852)
[22:18:32 WARN]:    ... 18 more

Suggested fix: Allow the removal of any team, even when their players are offline. Allow to remove players from their teams even when they are disconnected. Give the /uh finish a 'force' option that will make it ignore teams that have disconnected players.

I wouldn't make it automatic though since sometimes someone accidentally disconnects even when they are alive, and if it was a last player in one of two last teams it would end the game. Or you could, say, count three minutes (or just a configurable amount of time) after someone disconnects and then when checking for winners ignore players that have been disconnected for that long.

@AmauryCarrade
Copy link
Member

Hi.

Thanks you for this bug report :) .

First thing to say, there is already a command to mark a player (even offline) as dead: /uh kill <name>. I added this command specifically for this use.

Give the /uh finish a force option that will make it ignore teams that have disconnected players.

This is a good idea :) . I'll implement that.

Allow the removal of any team, even when their players are offline.

It's a bug, I'll fix that :) .

Or you could, say, count three minutes (or just a configurable amount of time) after someone disconnects and then when checking for winners ignore players that have been disconnected for that long.

I will probably implement that in the future (not in the next release, this said), the idea is good :) .

@AmauryCarrade
Copy link
Member

Give the /uh finish a force option that will make it ignore teams that have disconnected players.

This is a good idea :) . I'll implement that.

Not implemented – use /uh kill <player> to mark as dead players disconnected.

I'll now close this issue and open another one to take into account the last suggestion (not in the same milestone).

@AmauryCarrade AmauryCarrade removed their assignment Nov 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants