monkey-island/src/fr/eseo/game/network/MonkeyIsland.java
@Override
        public void run() {

            this.onConnection();

            try {
                // Accept and treat command from this client.
                while (true) {

                    String cmd = this.com.receiveMessage();

                    if (cmd == null) {
                        break;
                    }

                    try {
                        Command command = new Command(cmd);

                        this.switchCommand(command);

                    } catch (Exception e) {
                        System.err.println(this + e.getMessage());
                    }
                }

            } finally {

                this.onDisconnection();
            }
        }
/**
         * Run the client thread on connection to the server.
         */
Run the client thread on connection to the server.
Run the client thread on connection to the server .
@Override
        public void run() {
            this.onConnection();
            try {
                while (true) {
                    String cmd = this.com.receiveMessage();
                    if (cmd == null) {
                        break;
                    }
                    try {
                        Command command = new Command(cmd);
                        this.switchCommand(command);
                    } catch (Exception e) {
                        System.err.println(this + e.getMessage());
                    }
                }
            } finally {
                this.onDisconnection();
            }
        }
@ Override public void run ( ) { this . onConnection ( ) ; try { while ( true ) { String cmd = this . com . receiveMessage ( ) ; if ( cmd == null ) { break ; } try { Command command = new Command ( cmd ) ; this . switchCommand ( command ) ; } catch ( Exception e ) { System . err . println ( this + e . getMessage ( ) ) ; } } } finally { this . onDisconnection ( ) ; } }
Run the client thread on connection to the server.
Run the client thread on connection to the server .
// Accept and treat command from this client.