EvoEsports / EvoSC-sharp

Next generation server controller for Trackmania written in C# using .NET 8.
https://evosc.io
GNU General Public License v3.0
21 stars 13 forks source link

[Feature] Regex on parameters in chat commands #77

Open AtomicLiquid opened 1 year ago

AtomicLiquid commented 1 year ago

Describe the solution you'd like The Chat command system should be extended with the possibility to easily enforce regex on the input the user types based on the given chat command. An idea could also be to have an enum or a set of constants which are commonly used regexes.

snixtho commented 1 year ago

Thing is, validation is already done on the built in data types so it doesnt make sense to add yet another validation step. What I'm thinking instead is implementing a general valdiation framework for developers to more easily validate user input. We can have pre-defined ways to validate like interger ranges, string lengths, allow regex validation on generic strings etc.. And in addition, allow developers to define custom error messages alongside the framework's own generated error messages.