Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.94 KB | None | 0 0
  1. public void c() {
  2. List list = this.h;
  3.  
  4. synchronized (this.h) {
  5. // Spigot Start
  6. // This prevents players from 'gaming' the server, and strategically relogging to increase their position in the tick order
  7. if ( org.spigotmc.SpigotConfig.playerShuffle > 0 && MinecraftServer.currentTick % org.spigotmc.SpigotConfig.playerShuffle == 0 )
  8. {
  9. Collections.shuffle( this.h );
  10. }
  11. // Spigot End
  12. Iterator iterator = this.h.iterator();
  13.  
  14. while (iterator.hasNext()) {
  15. final NetworkManager networkmanager = (NetworkManager) iterator.next(); // LINE 136
  16.  
  17. if (!networkmanager.h()) {
  18. if (!networkmanager.g()) {
  19. // Spigot Start
  20. // Fix a race condition where a NetworkManager could be unregistered just before connection.
  21. if (networkmanager.preparing) continue;
  22. // Spigot End
  23. iterator.remove();
  24. networkmanager.l();
  25. } else {
  26. try {
  27. networkmanager.a();
  28. } catch (Exception exception) {
  29. if (networkmanager.c()) {
  30. CrashReport crashreport = CrashReport.a(exception, "Ticking memory connection");
  31. CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Ticking connection");
  32.  
  33. crashreportsystemdetails.a("Connection", new Callable() {
  34. public String a() throws Exception {
  35. return networkmanager.toString();
  36. }
  37.  
  38. public Object call() throws Exception {
  39. return this.a();
  40. }
  41. });
  42. throw new ReportedException(crashreport);
  43. }
  44.  
  45. ServerConnection.e.warn("Failed to handle packet for " + networkmanager.getSocketAddress(), exception);
  46. final ChatComponentText chatcomponenttext = new ChatComponentText("Internal server error");
  47.  
  48. networkmanager.a(new PacketPlayOutKickDisconnect(chatcomponenttext), new GenericFutureListener() {
  49. public void operationComplete(Future future) throws Exception {
  50. networkmanager.close(chatcomponenttext);
  51. }
  52. }, new GenericFutureListener[0]);
  53. networkmanager.k();
  54. }
  55. }
  56. }
  57. }
  58.  
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement