diff options
Diffstat (limited to '')
-rw-r--r-- | LuaSL/src/LuaSL_main.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/LuaSL/src/LuaSL_main.c b/LuaSL/src/LuaSL_main.c index e56aaf3..daee816 100644 --- a/LuaSL/src/LuaSL_main.c +++ b/LuaSL/src/LuaSL_main.c | |||
@@ -6,6 +6,14 @@ static int CPUs = 4; | |||
6 | static Eina_Strbuf *clientStream; | 6 | static Eina_Strbuf *clientStream; |
7 | 7 | ||
8 | 8 | ||
9 | static void _sendBack(void * data) | ||
10 | { | ||
11 | scriptMessage *message = data; | ||
12 | |||
13 | sendBack(message->script->game, message->script->client, message->script->SID, message->message); | ||
14 | free(message); | ||
15 | } | ||
16 | |||
9 | static Eina_Bool _add(void *data, int type __UNUSED__, Ecore_Con_Event_Client_Add *ev) | 17 | static Eina_Bool _add(void *data, int type __UNUSED__, Ecore_Con_Event_Client_Add *ev) |
10 | { | 18 | { |
11 | ecore_con_client_timeout_set(ev->client, 0); | 19 | ecore_con_client_timeout_set(ev->client, 0); |
@@ -54,6 +62,8 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Client_D | |||
54 | gettimeofday(&me->startTime, NULL); | 62 | gettimeofday(&me->startTime, NULL); |
55 | strncpy(me->SID, SID, sizeof(me->SID)); | 63 | strncpy(me->SID, SID, sizeof(me->SID)); |
56 | strncpy(me->fileName, file, sizeof(me->fileName)); | 64 | strncpy(me->fileName, file, sizeof(me->fileName)); |
65 | me->game = game; | ||
66 | me->client = ev->client; | ||
57 | eina_hash_add(game->scripts, me->SID, me); | 67 | eina_hash_add(game->scripts, me->SID, me); |
58 | sendBack(game, ev->client, SID, "compiled(true)"); | 68 | sendBack(game, ev->client, SID, "compiled(true)"); |
59 | } | 69 | } |
@@ -69,7 +79,7 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Client_D | |||
69 | if (me) | 79 | if (me) |
70 | { | 80 | { |
71 | sprintf(buf, "%s.lua.out", me->fileName); | 81 | sprintf(buf, "%s.lua.out", me->fileName); |
72 | newProc(buf, TRUE); | 82 | newProc(buf, TRUE, (Ecore_Cb) _sendBack, me); |
73 | } | 83 | } |
74 | } | 84 | } |
75 | else if (0 == strcmp(command, "exit()")) | 85 | else if (0 == strcmp(command, "exit()")) |