public void addConnection(UserConnection con) { connectionLock.writeLock().lock(); try { connections.put( con.getName(), con ); connectionsByUUID.put( con.getUniqueId(), con ); connectionsByOfflineUUID.put( con.getPendingConnection().getOfflineId(), con ); } finally { connectionLock.writeLock().unlock(); } }
public void removeConnection(UserConnection con) { connectionLock.writeLock().lock(); try { // TODO See #1218 if ( connections.get( con.getName() ) == con ) { connections.remove( con.getName() ); connectionsByUUID.remove( con.getUniqueId() ); connectionsByOfflineUUID.remove( con.getPendingConnection().getOfflineId() ); } } finally { connectionLock.writeLock().unlock(); } }
public void init() { this.entityRewrite = EntityMap.getEntityMap( getPendingConnection().getVersion() ); this.displayName = name; tabListHandler = new ServerUnique( this ); Collection<String> g = bungee.getConfigurationAdapter().getGroups( name ); g.addAll( bungee.getConfigurationAdapter().getGroups( getUniqueId().toString() ) ); for ( String s : g ) { addGroups( s ); } forgeClientHandler = new ForgeClientHandler( this ); // Set whether the connection has a 1.8 FML marker in the handshake. forgeClientHandler.setFmlTokenInHandshake( this.getPendingConnection().getExtraDataInHandshake().contains( ForgeConstants.FML_HANDSHAKE_TOKEN ) ); }
packet.setAction( PlayerListItem.Action.REMOVE_PLAYER ); PlayerListItem.Item item = new PlayerListItem.Item(); item.setUuid( con.getUniqueId() ); packet.setItems( new PlayerListItem.Item[]
if ( player != null ) item.setUuid( player.getUniqueId() ); LoginResult loginResult = player.getPendingConnection().getLoginProfile(); if ( loginResult != null && loginResult.getProperties() != null )
@Override public PacketListenerResult onPlayerListPacket(PlayerListItem packet) { if (packet.getAction() == PlayerListItem.Action.ADD_PLAYER || packet.getAction() == PlayerListItem.Action.UPDATE_GAMEMODE) { for (PlayerListItem.Item item : packet.getItems()) { if (userConnection.getUniqueId().equals(item.getUuid())) { userConnection.setGamemode(item.getGamemode()); } } } return super.onPlayerListPacket(packet); } }
packet.readerIndex( readerIndex ); packet.writerIndex( readerIndex + packetIdLength + idLength ); DefinedPacket.writeString( player.getUniqueId().toString(), packet ); DefinedPacket.writeString( username, packet ); DefinedPacket.writeVarInt( profile.getProperties().length, packet );
g.addAll( bungee.getConfigurationAdapter().getGroups( getUniqueId().toString() ) ); for ( String s : g )
UserConnection player = BungeeCord.getInstance().getPlayerByOfflineUUID(uuid); if (player != null) { rewriteMap.put(uuid, player.getUniqueId());
if ( player != null ) item.setUuid( player.getUniqueId() ); LoginResult loginResult = player.getPendingConnection().getLoginProfile(); if ( loginResult != null )
packet.setAction( PlayerListItem.Action.REMOVE_PLAYER ); PlayerListItem.Item item = new PlayerListItem.Item(); item.setUuid( con.getUniqueId() ); packet.setItems( new PlayerListItem.Item[]