Currently every command has to be manually parsed to check if all the parameters are correct and the extract the values from them. If we'd create some kind of parser that would allow us to do this automatically creating new commands would get allot easier. I had something like this in mind:
function HandleCommand(a_Split, a_Player)
-- //command <radius> <block> [hollow]
local parser, errorMsg = cCommandParser:new("<CommandName> <radius:number> <block:block> [hollow:bool]")
:Parse(a_Split)
if (not parser) then
a_Player:SendMessage(cChatColor.Rose .. errorMsg)
return true
end
DoSomething(parser.radius, parser.block, parser.hollow)
return true;
end
Any thoughts?
Currently every command has to be manually parsed to check if all the parameters are correct and the extract the values from them. If we'd create some kind of parser that would allow us to do this automatically creating new commands would get allot easier. I had something like this in mind:
Any thoughts?