From f93cf73e01e9cf4b0a6be43d61ebc24b9fa64b0d Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Wed, 22 Feb 2012 23:46:56 +1000 Subject: Implement callAndReturn(), use it from callAndWait(). That's most of LuaSL's side of "use OpenSim to deal with in world stuff". --- LuaSL/src/LuaSL_main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'LuaSL/src/LuaSL_main.c') 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; static Eina_Strbuf *clientStream; +static void _sendBack(void * data) +{ + scriptMessage *message = data; + + sendBack(message->script->game, message->script->client, message->script->SID, message->message); + free(message); +} + static Eina_Bool _add(void *data, int type __UNUSED__, Ecore_Con_Event_Client_Add *ev) { 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 gettimeofday(&me->startTime, NULL); strncpy(me->SID, SID, sizeof(me->SID)); strncpy(me->fileName, file, sizeof(me->fileName)); + me->game = game; + me->client = ev->client; eina_hash_add(game->scripts, me->SID, me); sendBack(game, ev->client, SID, "compiled(true)"); } @@ -69,7 +79,7 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Client_D if (me) { sprintf(buf, "%s.lua.out", me->fileName); - newProc(buf, TRUE); + newProc(buf, TRUE, (Ecore_Cb) _sendBack, me); } } else if (0 == strcmp(command, "exit()")) -- cgit v1.1