Permalink
Browse files

Deleted the test parse in main and added constraints for the cmd pars…

…er functions to prevent naming clashes.
  • Loading branch information...
1 parent bc1dff2 commit dccbb87a280cb0ab20689d8c9184fd8081f06c50 @leegao leegao committed Apr 1, 2011
Showing with 11 additions and 13 deletions.
  1. +1 −1 src/generate.lua
  2. +0 −2 src/main.c
  3. +10 −10 src/parse.c
View
@@ -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;
}
View
@@ -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
View
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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

0 comments on commit dccbb87

Please sign in to comment.