src/main/java/com/webcheckers/appl/PlayerLobby.java
/**
     * Checks if a given username follows security/input sanitation parameters.
     * @param username potential username of a user
     * @return weather the username follows security parameters
     */
Checks if a given username follows security/input sanitation parameters.
@param username potential username of a user
@return weather the username follows security parameters
Checks if a given username follows security / input sanitation parameters . @param username potential username of a user @return weather the username follows security parameters
private boolean check_name(String username){
        boolean first = false;
        for(int i = 0; i < username.length(); i++){
            if (Character.isLetterOrDigit(username.charAt(i))){
                first = true;
            } else if (username.charAt(i) == ' '){
                continue;
            } else {
                return false;
            }
        }
        return first;
    }
private boolean check_name ( String username ) { boolean first = false ; for ( int i = 0 ; i < username . length ( ) ; i ++ ) { if ( Character . isLetterOrDigit ( username . charAt ( i ) ) ) { first = true ; } else if ( username . charAt ( i ) == ' ' ) { continue ; } else { return false ; } } return first ; }
Checks if a given username follows security/input sanitation parameters.
Checks if a given username follows security / input sanitation parameters .