Archiviert
13
0

Ignore logged out players.

Dieser Commit ist enthalten in:
Kristian S. Stangeland 2013-06-14 03:52:31 +02:00
Ursprung 627c500de1
Commit 169842f265
2 geänderte Dateien mit 888 neuen und 877 gelöschten Zeilen

Datei anzeigen

@ -124,6 +124,7 @@ class CleanupStaticMembers {
reporter.reportWarning(this, reporter.reportWarning(this,
Report.newBuilder(REPORT_CANNOT_RESET_FIELD).error(e).messageParam(field.getName(), e.getMessage()) Report.newBuilder(REPORT_CANNOT_RESET_FIELD).error(e).messageParam(field.getName(), e.getMessage())
); );
e.printStackTrace();
} }
} }
} }

Datei anzeigen

@ -343,6 +343,11 @@ class ProxyPlayerInjectionHandler implements PlayerInjectionHandler {
// Get socket and socket injector // Get socket and socket injector
SocketAddress address = injector.getAddress(); SocketAddress address = injector.getAddress();
// Ignore logged out players
if (address == null)
return null;
SocketInjector previous = inputStreamLookup.peekSocketInjector(address); SocketInjector previous = inputStreamLookup.peekSocketInjector(address);
// Close any previously associated hooks before we proceed // Close any previously associated hooks before we proceed
@ -432,13 +437,18 @@ class ProxyPlayerInjectionHandler implements PlayerInjectionHandler {
@Override @Override
public void updatePlayer(Player player) { public void updatePlayer(Player player) {
SocketInjector injector = inputStreamLookup.peekSocketInjector(player.getAddress()); SocketAddress address = player.getAddress();
if (injector != null) { // Ignore logged out players
injector.setUpdatedPlayer(player); if (address != null) {
} else { SocketInjector injector = inputStreamLookup.peekSocketInjector(address);
inputStreamLookup.setSocketInjector(player.getAddress(),
new BukkitSocketInjector(player)); if (injector != null) {
injector.setUpdatedPlayer(player);
} else {
inputStreamLookup.setSocketInjector(player.getAddress(),
new BukkitSocketInjector(player));
}
} }
} }