Closed leegao closed 13 years ago
PS it's in the lee_experimental branch
uh... lol k ill do that tomorrow after midterm
nvm, I wrote a python script to generate the missing stubs in generate.lua so it can generate the C file... there's irony in here somewhere I'm sure.
lol python > lua > c ??????????????????????????????????????
in parse.c, https://github.com/FloooD/custom_cs2dsrv/blob/master/src/parse.c#L1762
if(!buf){
buf = (char*)malloc(j);
memcpy(buf, text, j);
buf[j] = '\0';
text+=j;
}
totally forgot the '\0' first time around <_<
rofl @ unix shell
The stub generator is scripted in src/generator.lua
format:
generate(cmd_name, fmt, minimum_args, identifiers_and_default_value...)
where cmd_name is found in http://cs2d.com/help.php?cat=server
fmt describes the types of each variable (s for char*/string, i for int, and f for float)
minimum_args is the number of required arguments (IE, certain arguments are optional, like duration of a ban, while others are not, like the ip of the banip command)
identifiers_and_default_values are either strings or tables. If it's a string, it contains the NAME of the identifier in c. If it's a table, it contains the NAME of the variable and the DEFAULT VALUE associated with that variable. If this is left empty, names like _1, _2, _3, ... will be used.
For example, given the following specification for banip banip Categories: server
We can write a parser for this via
I'm too lazy to finish this (and have a physics lab soon), so do a few for me plz? :D