Do not lookup player rewards on the main server tick thread
cpw opened this issue ยท 1 comments
Hello,
The PlayerLoggedInEvent, used by chanceCubes.listeners.PlayerConnectListener runs on the SERVER thread, directly. The call to https://github.com/wyldmods/ChanceCubes/blob/master/src/main/java/chanceCubes/listeners/PlayerConnectListener.java#L20 new CustomUserReward triggers one and possibly several HTTP queries directly to github. Depending on connectivity conditions, this means the server tick thread could be tied up for many milliseconds to many seconds, causing highly noticeable lag for other players on the server, when a new player logs in (especially one with a custom reward).
I advise that you should defer looking for the custom rewards to a secondary thread where it will not affect the tick of the server. I do consider this a very severe bug as it can present a very noticeable hiccup to players when others log in.