Search for a quick fix on Towny Source

Discussion in 'Plugin Development' started by OneNonlyNova, Apr 3, 2011.

Thread Status:
Not open for further replies.
  1. Hey all you devs,

    i know this is not the best way but i just want to have a kind dev review a short part of the towny
    source as shade seems to be not around for a while now. Many ppl have the same issue than me that towny is the last plugin missing for upgrading to #617.

    the issue is just a small bug in source i think but i'm no java programmer :(

    ISSUE: names with (_) underscore cause towny to erase the town/resident files

    code part where i assume the bug to be:


    TownySettings
    Code:
        public static boolean isValidName(String name) {
            try {
                if (TownySettings.namePattern == null)
                    namePattern = Pattern.compile(getString(TownySettings.Str.NAME_CHECK_REGEX));
                return TownySettings.namePattern.matcher(name).find();
            } catch (PatternSyntaxException e) {
                e.printStackTrace();
                return false;
            }
        }
    
    AND TownyUniverse

    Code:
        public String checkAndFilterName(String name) throws InvalidNameException {
            String out = TownySettings.filterName(name);
    
            if (!TownySettings.isValidName(out))
                throw new InvalidNameException(out + " is an invalid name.");
    
            return out;
        }
    

    Community Fixed Source by FuzzeWuzze: http://dl.dropbox.com/u/2798684/Towny_v61Fuzzev4.zip


    It would be nice is some of the devs could have a short look into this

    Many thanks in advance

    Kind Regards,

    Nova
     
  2. Offline

    hakre1

    Is your fix included in the compiled .jar or only the source?
     
  3. there is no fix till now... i am requesting a fix here :)
     
  4. Offline

    Chojin

  5. Offline

    hakre1

  6. adding: name_check_regex=^[a-zA-Z0-9_]+[a-zA-Z0-9._-]*$
    to the towny config file worked for me :)

    so this is fixed i think
     
Thread Status:
Not open for further replies.

Share This Page