aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_main.c
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-02-22 23:46:56 +1000
committerDavid Walter Seikel2012-02-22 23:46:56 +1000
commitf93cf73e01e9cf4b0a6be43d61ebc24b9fa64b0d (patch)
treea291eb5bf596aad17791b37a2a2826d9271742f3 /LuaSL/src/LuaSL_main.c
parentImplement llGetScriptName(). (diff)
downloadSledjHamr-f93cf73e01e9cf4b0a6be43d61ebc24b9fa64b0d.zip
SledjHamr-f93cf73e01e9cf4b0a6be43d61ebc24b9fa64b0d.tar.gz
SledjHamr-f93cf73e01e9cf4b0a6be43d61ebc24b9fa64b0d.tar.bz2
SledjHamr-f93cf73e01e9cf4b0a6be43d61ebc24b9fa64b0d.tar.xz
Implement callAndReturn(), use it from callAndWait(). That's most of LuaSL's side of "use OpenSim to deal with in world stuff".
Diffstat (limited to '')
-rw-r--r--LuaSL/src/LuaSL_main.c12
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;
6static Eina_Strbuf *clientStream; 6static Eina_Strbuf *clientStream;
7 7
8 8
9static 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
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{
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()"))