aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'LuaSL/src/LuaSL_main.c')
-rw-r--r--LuaSL/src/LuaSL_main.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/LuaSL/src/LuaSL_main.c b/LuaSL/src/LuaSL_main.c
index 0aaf3c5..e209023 100644
--- a/LuaSL/src/LuaSL_main.c
+++ b/LuaSL/src/LuaSL_main.c
@@ -5,6 +5,14 @@
5static int CPUs = 4; 5static int CPUs = 4;
6static Eina_Strbuf *clientStream; 6static Eina_Strbuf *clientStream;
7 7
8static void sendBack(gameGlobals *game, Ecore_Con_Client *client, const char *SID, const char *message)
9{
10 char buf[PATH_MAX];
11
12 sprintf(buf, "%s.%s\n", SID, message);
13 ecore_con_client_send(client, buf, strlen(buf));
14 ecore_con_client_flush(client);
15}
8 16
9static Eina_Bool _add(void *data, int type __UNUSED__, Ecore_Con_Event_Client_Add *ev) 17static Eina_Bool _add(void *data, int type __UNUSED__, Ecore_Con_Event_Client_Add *ev)
10{ 18{
@@ -35,10 +43,11 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Client_D
35 command = ext + 1; 43 command = ext + 1;
36 if (0 == strcmp(command, "compile()")) 44 if (0 == strcmp(command, "compile()"))
37 { 45 {
46 PD("Compiling %s.", SID);
38 if (compileLSL(game, SID, FALSE)) 47 if (compileLSL(game, SID, FALSE))
39 PD("The compile of %s worked.", SID); 48 sendBack(game, ev->client, SID, "compiled(true)");
40 else 49 else
41 PE("The compile of %s failed!", SID); 50 sendBack(game, ev->client, SID, "compiled(false)");
42 } 51 }
43 else if (0 == strcmp(command, "start()")) 52 else if (0 == strcmp(command, "start()"))
44 { 53 {
@@ -57,7 +66,7 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Client_D
57 snprintf(temp, sizeof(temp), "%s.events", SID); 66 snprintf(temp, sizeof(temp), "%s.events", SID);
58 status = sendToChannel(temp, command, NULL, NULL); 67 status = sendToChannel(temp, command, NULL, NULL);
59 if (status) 68 if (status)
60 PE("Error sending command %s to script %s : %s", command, temp, status); 69 PE("Error sending command %s to script %s : %s", command, SID, status);
61 } 70 }
62 } 71 }
63 72