aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/LuaSL
diff options
context:
space:
mode:
Diffstat (limited to 'src/LuaSL')
-rw-r--r--src/LuaSL/LuaSL_main.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/LuaSL/LuaSL_main.c b/src/LuaSL/LuaSL_main.c
index b72a155..d7223f9 100644
--- a/src/LuaSL/LuaSL_main.c
+++ b/src/LuaSL/LuaSL_main.c
@@ -69,7 +69,7 @@ static script *findThem(gameGlobals *ourGlobals, const char *base, const char *t
69 return eina_hash_find(ourGlobals->names, name); 69 return eina_hash_find(ourGlobals->names, name);
70} 70}
71 71
72void send2server(script *me, const char *message) 72static void send2server(script *me, const char *message)
73{ 73{
74 gameGlobals *ourGlobals = me->data; 74 gameGlobals *ourGlobals = me->data;
75 75
@@ -224,13 +224,13 @@ static Eina_Bool parser(void *data, Connection *connection, char *SID, char *com
224 char buf[PATH_MAX]; 224 char buf[PATH_MAX];
225 225
226//PD("PARSE COMMAND - %s", command); 226//PD("PARSE COMMAND - %s", command);
227 if (0 == strncmp(command, "compile(", 8)) 227 if (0 == strcmp(command, "compile"))
228 { 228 {
229 char *temp; 229 char *temp;
230 char *file; 230 char *file;
231 LuaCompiler *compiler; 231 LuaCompiler *compiler;
232 232
233 strcpy(buf, &command[8]); 233 strcpy(buf, arguments);
234 temp = buf; 234 temp = buf;
235 file = temp; 235 file = temp;
236 while (')' != temp[0]) 236 while (')' != temp[0])
@@ -242,13 +242,13 @@ static Eina_Bool parser(void *data, Connection *connection, char *SID, char *com
242 PI("Compiling script %s", file); 242 PI("Compiling script %s", file);
243 compileScript(compiler, TRUE); 243 compileScript(compiler, TRUE);
244 } 244 }
245 else if (0 == strncmp(command, "run(", 4)) 245 else if (0 == strcmp(command, "run"))
246 { 246 {
247 char *temp; 247 char *temp;
248 char *file; 248 char *file;
249 script *me; 249 script *me;
250 250
251 strcpy(buf, &command[4]); 251 strcpy(buf, arguments);
252 temp = buf; 252 temp = buf;
253 file = temp; 253 file = temp;
254 while (')' != temp[0]) 254 while (')' != temp[0])
@@ -268,15 +268,19 @@ static Eina_Bool parser(void *data, Connection *connection, char *SID, char *com
268 else 268 else
269 PE("Failed to run script %s", me->fileName); 269 PE("Failed to run script %s", me->fileName);
270 } 270 }
271 else if (0 == strcmp(command, "exit()")) 271 else if (0 == strcmp(command, "exit"))
272 { 272 {
273 PI("Told to exit."); 273 PI("Told to exit.");
274 ecore_main_loop_quit(); 274 ecore_main_loop_quit();
275 } 275 }
276 else 276 else
277 { 277 {
278//PD("Sending -> script %s : %s", SID, command); 278 if (0 == strcmp("return", command))
279 send2script(SID, command); 279 snprintf(buf, sizeof(buf), "%s %s", command, arguments);
280 else
281 snprintf(buf, sizeof(buf), "%s(%s", command, arguments);
282//PD("Sending -> script %s : %s", SID, buf);
283 send2script(SID, buf);
280 } 284 }
281 285
282 return ECORE_CALLBACK_RENEW; 286 return ECORE_CALLBACK_RENEW;