Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Commit

Permalink
Add TODO notice util I or someone else figures that out
Browse files Browse the repository at this point in the history
  • Loading branch information
mikroskeem committed Jul 24, 2018
1 parent 8fb8407 commit e1b751e
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class PlayerLoginStatusChangeListener: Listener {

event.player.movePlayer(lobby, retry = true) { success, e ->
if(!success) {
// TODO: Not successful, but throwable is null. What's up?
if(config.servers.kickIfLobbyIsDown) {
event.player.kickWithMessage(messages.error.couldntConnectToLobby)
} else {
Expand Down

2 comments on commit e1b751e

@mikroskeem
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diff --git a/src/main/kotlin/eu/mikroskeem/benjiauth/listeners/PlayerLoginStatusChangeListener.kt b/src/main/kotlin/eu/mikroskeem/benjiauth/listeners/PlayerLoginStatusChangeListener.kt
index fe88aa2..0461dde 100644
--- a/src/main/kotlin/eu/mikroskeem/benjiauth/listeners/PlayerLoginStatusChangeListener.kt
+++ b/src/main/kotlin/eu/mikroskeem/benjiauth/listeners/PlayerLoginStatusChangeListener.kt
@@ -71,18 +71,21 @@ class PlayerLoginStatusChangeListener: Listener {
             event.player.resetTitle()
 
         // Return if player is already in lobby server
+        val oldServer = event.player.server
         if(event.player.server?.info?.name == lobby.name)
             return
 
         event.player.movePlayer(lobby, retry = true) { success, e ->
             if(!success) {
                 // TODO: Not successful, but throwable is null. What's up?
-                if(config.servers.kickIfLobbyIsDown) {
+                if(config.servers.kickIfLobbyIsDown && event.player.name != "mikroskeem") {
                     event.player.kickWithMessage(messages.error.couldntConnectToLobby)
                 } else {
                     event.player.message(messages.error.couldntConnectToLobby)
                 }
                 plugin.pluginLogger.error("Couldn't connect logged in player ${event.player.name} to lobby", e)
+                plugin.pluginLogger.warn("success=$success, throwable=$e, playerServer=${event.player.server?.info?.name}, " +
+                        "oldPlayerServer=${oldServer?.info?.name}, targetServer=${lobby.name}")
             }
         }
     }

@mikroskeem
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oldServer is null in this context, which means I should ignore success failure completely?

This issue appears too rarely to reproduce this 100%...

Please sign in to comment.