com.velocitypowered.api.event.connection.DisconnectEvent Java Examples
The following examples show how to use
com.velocitypowered.api.event.connection.DisconnectEvent.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Main.java From TAB with Apache License 2.0 | 5 votes |
@Subscribe public void a(DisconnectEvent e){ if (Shared.disabled) return; ITabPlayer disconnectedPlayer = Shared.getPlayer(e.getPlayer().getUniqueId()); if (disconnectedPlayer == null) return; //player connected to bungeecord successfully, but not to the bukkit server anymore ? idk the check is needed Shared.data.remove(e.getPlayer().getUniqueId()); Shared.quitListeners.forEach(f -> f.onQuit(disconnectedPlayer)); }
Example #2
Source File: ConnectedPlayer.java From Velocity with MIT License | 5 votes |
void teardown() { if (connectionInFlight != null) { connectionInFlight.disconnect(); } if (connectedServer != null) { connectedServer.disconnect(); } server.unregisterConnection(this); server.getEventManager().fire(new DisconnectEvent(this)) .thenRun(() -> this.teardownFuture.complete(null)); }
Example #3
Source File: PlayerOnlineListener.java From Plan with GNU Lesser General Public License v3.0 | 5 votes |
@Subscribe(order = PostOrder.NORMAL) public void beforeLogout(DisconnectEvent event) { Player player = event.getPlayer(); UUID playerUUID = player.getUniqueId(); String playerName = player.getUsername(); processing.submitNonCritical(() -> extensionService.updatePlayerValues(playerUUID, playerName, CallEvents.PLAYER_LEAVE)); }
Example #4
Source File: PlayerOnlineListener.java From Plan with GNU Lesser General Public License v3.0 | 5 votes |
@Subscribe(order = PostOrder.LAST) public void onLogout(DisconnectEvent event) { try { actOnLogout(event); } catch (Exception e) { errorLogger.log(L.ERROR, e, ErrorContext.builder().related(event).build()); } }
Example #5
Source File: PlayerOnlineListener.java From Plan with GNU Lesser General Public License v3.0 | 5 votes |
public void actOnLogout(DisconnectEvent event) { Player player = event.getPlayer(); String playerName = player.getUsername(); UUID playerUUID = player.getUniqueId(); sessionCache.endSession(playerUUID, System.currentTimeMillis()); if (config.isTrue(ExportSettings.EXPORT_ON_ONLINE_STATUS_CHANGE)) { processing.submitNonCritical(() -> exporter.exportPlayerPage(playerUUID, playerName)); } processing.submit(() -> { JSONCache.invalidateMatching( DataID.SERVER_OVERVIEW, DataID.SESSIONS, DataID.GRAPH_WORLD_PIE, DataID.GRAPH_PUNCHCARD, DataID.KILLS, DataID.ONLINE_OVERVIEW, DataID.SESSIONS_OVERVIEW, DataID.PVP_PVE, DataID.GRAPH_UNIQUE_NEW, DataID.GRAPH_CALENDAR ); UUID serverUUID = serverInfo.getServerUUID(); JSONCache.invalidate(DataID.GRAPH_ONLINE, serverUUID); JSONCache.invalidate(DataID.SERVERS); }); }
Example #6
Source File: VelocityPingCounter.java From Plan with GNU Lesser General Public License v3.0 | 4 votes |
@Subscribe public void onPlayerQuit(DisconnectEvent quitEvent) { removePlayer(quitEvent.getPlayer()); }
Example #7
Source File: VelocityConnectionListener.java From LuckPerms with MIT License | 4 votes |
@Subscribe(order = PostOrder.LAST) public void onPlayerQuit(DisconnectEvent e) { handleDisconnect(e.getPlayer().getUniqueId()); }
Example #8
Source File: VelocityPlugin.java From ServerListPlus with GNU General Public License v3.0 | 4 votes |
@Subscribe public void onPlayerLogout(DisconnectEvent event) { handleConnection(event.getPlayer()); }