Added a basic (non-working) command interpreter.

Signed-off-by: Polonkai Gergely <polesz@w00d5t0ck.info>
This commit is contained in:
Polonkai Gergely
2012-03-13 02:22:22 +01:00
parent 84ba83c8ba
commit 74fe14660a
5 changed files with 88 additions and 3 deletions

View File

@@ -4,6 +4,7 @@
#include "main.h"
#include "networking.h"
#include "interpreter.h"
#define MAX_RECV_LEN 1024
@@ -74,8 +75,7 @@ client_callback(GSocket *client, GIOCondition condition, wmudClient *client_data
buf2 = n;
}
g_print("Will process input '%s'\n", client_data->buffer->str);
/* TODO: interpret command before erasing */
wmud_interpret_game_command(client_data);
g_string_erase(client_data->buffer, 0, -1);
for (; ((*buf2 == '\r') || (*buf2 == '\n')) && *buf2; buf2++);