2.0 (obsolete) Name Validator 1.2.3

Validates player names on join based on a config file.

  1. Enerdy

    Enerdy Satellite Admin
    TShock Mod Plugin Developer Zero Day Plugin Author

    Joined:
    Nov 14, 2012
    Messages:
    507
    Enerdy submitted a new resource:

    Name Validator - Validates player names on join based on a config file.

    Read more about this resource...
     
    • Useful Useful x 2
  2. pink_panther

    pink_panther Level 9

    Joined:
    Oct 14, 2013
    Messages:
    370
    nice job

    kind of an expansion to "EnglishPlox" by Wolfje, which just straight up only lets you use characters found on a US keyboard.

    The regex matches and stuff are nice, stop people joining with swear words for names
     
  3. Enerdy

    Enerdy Satellite Admin
    TShock Mod Plugin Developer Zero Day Plugin Author

    Joined:
    Nov 14, 2012
    Messages:
    507
    Enerdy updated Name Validator with a new update entry:

    Update for TShock 4.3.3

    Read the rest of this update entry...
     
    • Useful Useful x 1
  4. IdeaEmpty

    IdeaEmpty Level 2

    Joined:
    Mar 28, 2012
    Messages:
    26
    would be cool if there was a bypass permission to allow the plugin not affect server staff, so people can't impersonate or bash them via username.. for example: "Admin Sucks"
     
    • Agree Agree x 1
  5. Enerdy

    Enerdy Satellite Admin
    TShock Mod Plugin Developer Zero Day Plugin Author

    Joined:
    Nov 14, 2012
    Messages:
    507
    Interesting suggestion, although if checks on join, so unless there was a way of logging in before the check, permissions would be useless. Might add that in, but it will require either UUID Login or password login before join (With DisableLoginBeforeJoin set to false).
     
  6. shaitan1977

    shaitan1977 Level 4

    Joined:
    Jul 6, 2014
    Messages:
    61
    In the json file, are we able to separate words with the standard comma(in the brackets), or would it have to be a new script? Also, are spaces possible("john sucks") to get rid of?
     
  7. Enerdy

    Enerdy Satellite Admin
    TShock Mod Plugin Developer Zero Day Plugin Author

    Joined:
    Nov 14, 2012
    Messages:
    507
    In regex, you can have multiple matches by using |. Example: "john sucks|neo sucks" would match both "john sucks" and "neo sucks" (so yeah, use | instead of comma).
     
  8. shaitan1977

    shaitan1977 Level 4

    Joined:
    Jul 6, 2014
    Messages:
    61
    Ok, thanks Enerdy.
     
  9. Enerdy

    Enerdy Satellite Admin
    TShock Mod Plugin Developer Zero Day Plugin Author

    Joined:
    Nov 14, 2012
    Messages:
    507
  10. Enerdy

    Enerdy Satellite Admin
    TShock Mod Plugin Developer Zero Day Plugin Author

    Joined:
    Nov 14, 2012
    Messages:
    507
  11. Enerdy

    Enerdy Satellite Admin
    TShock Mod Plugin Developer Zero Day Plugin Author

    Joined:
    Nov 14, 2012
    Messages:
    507
  12. Enerdy

    Enerdy Satellite Admin
    TShock Mod Plugin Developer Zero Day Plugin Author

    Joined:
    Nov 14, 2012
    Messages:
    507
  13. Kojiro_S

    Kojiro_S Level 11

    Joined:
    Feb 16, 2014
    Messages:
    626
    A question:
    Is there a way to forbid spaces on usernames with this plugin by any chance? I've got several custom-made commands on AliasCmd and can't seem to find a way to target users with more than one word on their usernames.

    Thanks in advance.
     
  14. Zaicon

    Zaicon Spam Cleaner 9000
    TShock Mod Plugin Developer

    Joined:
    Feb 15, 2014
    Messages:
    799
    The Regex for spaces (specifically whitespace in general) is \s, so you can just put that in the InvalidRegex field.
     
    • Useful Useful x 1
  15. Kojiro_S

    Kojiro_S Level 11

    Joined:
    Feb 16, 2014
    Messages:
    626
    Thanks. What would I need for this config to forbid spaces and lots of the annoying symbols some modded users intentionally use to make themselves a bit more of a pain to target? (I know that they can be targeted by ID, just asking). I tried the following just in case, but of course it won't pass the JSONLint test haha.
    {
    "Action": "kick",
    "Reason": "Nombre con espacios o letras invalidas.",
    "InvalidChars": "[]!"·$%&/()=?¿|@#~€¬'¡ºª\`^+*´¨{}çñÑ,;.:-_<>",
    "InvalidNameRegexes": [\s],
    "TerrariaFontOnly": true
    }
     
  16. Zaicon

    Zaicon Spam Cleaner 9000
    TShock Mod Plugin Developer

    Joined:
    Feb 15, 2014
    Messages:
    799
    Code:
    {
      "Action": "kick",
      "Reason": "Invalid character name.",
      "InvalidChars": "",
      "InvalidNameRegexes": [
        "[^A-Za-z_0-9-]"
      ],
      "TerrariaFontOnly": false
    }
    This bans all characters EXCEPT what's in the regex (the ^ at the start means Not). So right now this only allows "A-Z", "a-z", "_", "0-9", and "-".
     
    • Useful Useful x 2
    • Agree Agree x 1
  17. Enerdy

    Enerdy Satellite Admin
    TShock Mod Plugin Developer Zero Day Plugin Author

    Joined:
    Nov 14, 2012
    Messages:
    507
  18. Enerdy

    Enerdy Satellite Admin
    TShock Mod Plugin Developer Zero Day Plugin Author

    Joined:
    Nov 14, 2012
    Messages:
    507
  19. Enerdy

    Enerdy Satellite Admin
    TShock Mod Plugin Developer Zero Day Plugin Author

    Joined:
    Nov 14, 2012
    Messages:
    507
  20. bippity

    Plugin Developer

    Joined:
    Jan 14, 2012
    Messages:
    294
    Would this plugin work on Linux? Had this error when I installed it
    Code:
    [01/14/19 15:34:43] [Server API] Error: Startup aborted due to an exception in the Server API initialization:
    System.InvalidOperationException: Failed to load assembly "NameValidator.dll". ---> System.InvalidOperationException: Could not create an instance of plugin class "NameValidator.NameValidator". ---> System.TypeLoadException: Could not load type of field 'NameValidator.NameValidator:font' (0) due to: Could not load file or assembly 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
      at (wrapper managed-to-native) System.RuntimeType.GetConstructors_native(System.RuntimeType,System.Reflection.BindingFlags)
      at System.RuntimeType.GetConstructors_internal (System.Reflection.BindingFlags bindingAttr, System.RuntimeType reflectedType) <0x7fda3fd653f0 + 0x0004e> in <0f8aeac9d63d4b8aa575761bb4e65b79>:0
      at System.RuntimeType.GetConstructorCandidates (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.CallingConventions callConv, System.Type[] types, System.Boolean allowPrefixLookup) <0x7fda3fd5ffe0 + 0x00124> in <0f8aeac9d63d4b8aa575761bb4e65b79>:0
      at System.RuntimeType.GetConstructors (System.Reflection.BindingFlags bindingAttr) <0x7fda3fd60a30 + 0x00038> in <0f8aeac9d63d4b8aa575761bb4e65b79>:0
      at System.RuntimeType.CreateInstanceImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes, System.Threading.StackCrawlMark& stackMark) [0x0022b] in <0f8aeac9d63d4b8aa575761bb4e65b79>:0
      at System.Activator.CreateInstance (System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) <0x7fda3fd24db0 + 0x00128> in <0f8aeac9d63d4b8aa575761bb4e65b79>:0
      at System.Activator.CreateInstance (System.Type type, System.Object[] args) <0x7fda3fd24f60 + 0x00018> in <0f8aeac9d63d4b8aa575761bb4e65b79>:0
      at TerrariaApi.Server.ServerApi.LoadPlugins () [0x001ce] in <1498ccee3bc746fbbb4c96e1caa989d3>:0
       --- End of inner exception stack trace ---
      at TerrariaApi.Server.ServerApi.LoadPlugins () [0x00217] in <1498ccee3bc746fbbb4c96e1caa989d3>:0
       --- End of inner exception stack trace ---
      at TerrariaApi.Server.ServerApi.LoadPlugins () [0x00256] in <1498ccee3bc746fbbb4c96e1caa989d3>:0
      at TerrariaApi.Server.ServerApi.Initialize (System.String[] commandLineArgs, Terraria.Main game) [0x00110] in <1498ccee3bc746fbbb4c96e1caa989d3>:0
      at TerrariaApi.Server.HookManager.InitialiseAPI () [0x0004e] in <1498ccee3bc746fbbb4c96e1caa989d3>:0
    
    It couldn't load an assembly called PresentationCore which I'm assuming is part of .NET/Windows only. Do you know a way I could get this to work?