-
Notifications
You must be signed in to change notification settings - Fork 18
Improved chat commands parsing. #13
Conversation
Allowing using double quotes to set commands parameters with spaces. eg: /admin move player position "John Doe" 100 100 100
|
Thanks for this. |
|
You're welcome! |
|
Automated cleanups can be found in the settings for Essentials. |
|
OK I see, it's the Timing and triggered cleanups. I will check the behavior with those. |
|
Awesome. |
Improved chat commands parsing.
|
I tested this out myself, and it seems to work well. |
|
I just had a look before seeing your message and realized that timed and triggered cleanups are using command.Split( ' ' ) and thus the parsing has to be moved to an utility class :) |
|
Oh and thanks for the code improvement! I did saw that you used a StringBuilder and just found the performance improvement it makes compared to simple string manipulation. I wasn't aware of that! |
|
I drilled into the code of the plugin and found that some utility classes like CubeGrids use a string splitter - General.SplitString() - with double-quotes management and using the new parser with some commands can lead to unexpected behaviors. The included parser handles double-quotes but it doesn't handles double double-quotes which can be a problem. For example in CubeGrid.ScanGrids() the command string is rebuilt in the first 2 lines and then analyzed. This will cause a problem with the command - /admin scan grids functional "hasdisplayname:My ""Super ship"":exact" - as it will split the displayname parameter into 3 chunks and so the command will not work as expected. Please have a look at that and if you agree I would recommend removing the use of this string splitter. I can do it if you want. |
Allowing using double quotes to set commands parameters with spaces.
eg: /admin move player position "John Doe" 100 100 100
Use double quotes twice in order to set include a double quote in the parameter.
eg: /admin move player position "John""Doe" 100 100 100 (for player John"Doe)