Skip to content

Commit

Permalink
Deleted the test parse in main and added constraints for the cmd pars…
Browse files Browse the repository at this point in the history
…er functions to prevent naming clashes.
  • Loading branch information
leegao committed Apr 1, 2011
1 parent bc1dff2 commit dccbb87
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/generate.lua
Expand Up @@ -5,7 +5,7 @@ int p_%s(char* text, int* consumed){
char* check = tokenize(text, consumed, "\%s" "%s"%s);
if (!check) return 0;
// %s(%s);
// %s_cmd(%s);
return 1;
}
Expand Down
2 changes: 0 additions & 2 deletions src/main.c
Expand Up @@ -76,8 +76,6 @@ int main(int argc, char *argv[]){
int size;
fd_set descriptor; //I don't know

parse("banip 192.168.1.1;banip 123.2");

ClearAllPlayer();
WeaponInit();
ReadServerCfg(cfg_file ? cfg_file:"server.cfg"); // Reads the server.cfg file (We can also check argv for --cfg or -c flag
Expand Down
20 changes: 10 additions & 10 deletions src/parse.c
Expand Up @@ -9,14 +9,14 @@




// p_xxx functions starts here.

int p_banip(char* text, int* consumed){
char* ip; int duration = -1; // declarations
char* check = tokenize(text, consumed, "\1" "si", &ip, &duration);
if (!check) return 0;

// banip(ip, duration);
// banip_cmd(ip, duration);

return 1;
}
Expand All @@ -26,7 +26,7 @@ int p_banname(char* text, int* consumed){
char* check = tokenize(text, consumed, "\1" "si", &name, &duration);
if (!check) return 0;

// banname(name, duration);
// banname_cmd(name, duration);

return 1;
}
Expand All @@ -36,7 +36,7 @@ int p_bans(char* text, int* consumed){
char* check = tokenize(text, consumed, "\0" "");
if (!check) return 0;

// bans();
// bans_cmd();

return 1;
}
Expand All @@ -46,7 +46,7 @@ int p_banusgn(char* text, int* consumed){
char* check = tokenize(text, consumed, "\1" "ii", &usgn, &duration);
if (!check) return 0;

// banusgn(usgn, duration);
// banusgn_cmd(usgn, duration);

return 1;
}
Expand All @@ -56,7 +56,7 @@ int p_changelevel(char* text, int* consumed){
char* check = tokenize(text, consumed, "\1" "s", &map);
if (!check) return 0;

// changelevel(map);
// changelevel_cmd(map);

return 1;
}
Expand All @@ -66,7 +66,7 @@ int p_changemap(char* text, int* consumed){
char* check = tokenize(text, consumed, "\1" "s", &map);
if (!check) return 0;

// changemap(map);
// changemap_cmd(map);

return 1;
}
Expand All @@ -76,7 +76,7 @@ int p_customkill(char* text, int* consumed){
char* check = tokenize(text, consumed, "\3" "isi", &killer, &weapon, &victim);
if (!check) return 0;

// customkill(killer, weapon, victim);
// customkill_cmd(killer, weapon, victim);

return 1;
}
Expand All @@ -86,12 +86,12 @@ int p_deathslap(char* text, int* consumed){
char* check = tokenize(text, consumed, "\1" "s", &player);
if (!check) return 0;

// deathslap(player);
// deathslap_cmd(player);

return 1;
}


// p_xxx ends here



Expand Down

0 comments on commit dccbb87

Please sign in to comment.