public void waitForPlayer()
   {
       //DEBUG
       System.out.println( "Entered waitForPlayer." );
       
       Integer outputObj = new Integer( ROGER );
       
       // We'll loop until we get good input
       do {
            // Receive something from the remote player
            try {
                   inputObj = in.readObject();
                   System.out.println(
			       "in waitForPlayer:  Read incoming object." );
            } catch ( Exception e ) {
                   // add better error detect later
                   System.err.println( "Error reading command from network"
                                       + " stream:\n" + e);
            }
            if ( inputObj instanceof Integer ) {
                // If it's an Integer, it's a command, so process it.
                outputObj = processCommand( ( (Integer) inputObj ).intValue());
                try {
                        out.writeObject( outputObj );
                } catch ( IOException e ) {
                       System.err.println( "IOException while sending confirm"
					   + " over network stream:\n" + e);
                }
		
                // this may conflict with Driver class
                if ( outputObj.intValue() == ACCEPTDRAW ) {
                    cleanup();
                }
            } else if ( inputObj instanceof NetworkMove ) {
		
		NetworkMove remoteMove = ( NetworkMove ) inputObj;
		
                // If it's a move, send it off to be validated
                theRules.validateMove( new Move( this, 
		      remoteMove.startLocation(), remoteMove.endLocation() ) );

		// DEBUG:
                System.out.println( "Move received." );
                outputObj = new Integer( ROGER );
                try {
                        out.writeObject( outputObj );
                } catch ( IOException e ) {
                       System.err.println( "IOException while sending confirm"
					   + " over network stream:\n" + e);
                }
            } else {
                // The command recieved was bad; ask them to resend it
                outputObj = new Integer( RESEND );
                //DEBUG
		System.err.println( "Bad input received over network." );
                try {
                        out.writeObject( outputObj );
                } catch ( IOException e ) {
                       System.err.println( "IOException while sending confirm"
					   + " over network stream:\n" + e);
                }
            }
       } while ( outputObj.intValue() == RESEND );
   }