private void receiveDisconnected ( ClientSocket client , byte from , StateConnection expected ) throws IOException { if ( ServerImpl . checkValidity ( client , from , expected ) ) { // Notify other clients client . setState ( StateConnection . DISCONNECTED ) ; for ( final ClientListener listener : listeners ) { listener . notifyClientDisconnected ( Byte . valueOf ( client . getId ( ) ) , client . getName ( ) ) ; } for ( final ClientSocket other : clients . values ( ) ) { if ( other . getId ( ) == from || other . getState ( ) != StateConnection . CONNECTED ) { continue ; } other . getOut ( ) . writeByte ( NetworkMessageSystemId . OTHER_CLIENT_DISCONNECTED ) ; ServerImpl . writeIdAndName ( other , client . getId ( ) , client . getName ( ) ) ; // Send other . getOut ( ) . flush ( ) ; } removeClient ( Byte . valueOf ( from ) ) ; } }
Update the receive disconnected state .