diff options
Diffstat (limited to '')
-rw-r--r-- | LuaSL/src/LuaSL_test.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/LuaSL/src/LuaSL_test.c b/LuaSL/src/LuaSL_test.c index 90dc5ac..2ca9792 100644 --- a/LuaSL/src/LuaSL_test.c +++ b/LuaSL/src/LuaSL_test.c | |||
@@ -89,7 +89,6 @@ static void dirList_compile(const char *name, const char *path, void *data) | |||
89 | { | 89 | { |
90 | gameGlobals *game = data; | 90 | gameGlobals *game = data; |
91 | 91 | ||
92 | char buf[PATH_MAX]; | ||
93 | char *ext = rindex(name, '.'); | 92 | char *ext = rindex(name, '.'); |
94 | 93 | ||
95 | if (ext) | 94 | if (ext) |
@@ -103,9 +102,7 @@ static void dirList_compile(const char *name, const char *path, void *data) | |||
103 | snprintf(me->SID, sizeof(me->SID), "%s/%s", path, name); | 102 | snprintf(me->SID, sizeof(me->SID), "%s/%s", path, name); |
104 | snprintf(me->fileName, sizeof(me->fileName), "%s/%s", path, name); | 103 | snprintf(me->fileName, sizeof(me->fileName), "%s/%s", path, name); |
105 | eina_hash_add(game->scripts, me->SID, me); | 104 | eina_hash_add(game->scripts, me->SID, me); |
106 | snprintf(buf, sizeof(buf), "%s/%s.compile()\n", path, name); | 105 | sendForth(game, me->SID, "compile()"); |
107 | ecore_con_server_send(game->server, buf, strlen(buf)); | ||
108 | ecore_con_server_flush(game->server); | ||
109 | } | 106 | } |
110 | } | 107 | } |
111 | } | 108 | } |
@@ -119,11 +116,7 @@ static Eina_Bool _quit_timer_cb(void *data) | |||
119 | scripts = eina_hash_iterator_data_new(game->scripts); | 116 | scripts = eina_hash_iterator_data_new(game->scripts); |
120 | while(eina_iterator_next(scripts, (void **) &me)) | 117 | while(eina_iterator_next(scripts, (void **) &me)) |
121 | { | 118 | { |
122 | char buf[PATH_MAX]; | 119 | sendForth(game, me->SID, "quit()"); |
123 | |||
124 | snprintf(buf, sizeof(buf), "%s.lua.out.quit()\n", me->SID); | ||
125 | ecore_con_server_send(game->server, buf, strlen(buf)); | ||
126 | ecore_con_server_flush(game->server); | ||
127 | } | 120 | } |
128 | 121 | ||
129 | ecore_con_server_send(game->server, ".exit()\n", 8); | 122 | ecore_con_server_send(game->server, ".exit()\n", 8); |
@@ -151,7 +144,6 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Server_D | |||
151 | { | 144 | { |
152 | gameGlobals *game = data; | 145 | gameGlobals *game = data; |
153 | 146 | ||
154 | char buf[PATH_MAX]; | ||
155 | char SID[PATH_MAX]; | 147 | char SID[PATH_MAX]; |
156 | const char *command; | 148 | const char *command; |
157 | char *ext; | 149 | char *ext; |
@@ -191,9 +183,7 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Server_D | |||
191 | } | 183 | } |
192 | } | 184 | } |
193 | PD("The compile of %s worked, running it now.", SID); | 185 | PD("The compile of %s worked, running it now.", SID); |
194 | snprintf(buf, sizeof(buf), "%s.lua.out.start()\n", SID); | 186 | sendForth(game, SID, "start()"); |
195 | ecore_con_server_send(game->server, buf, strlen(buf)); | ||
196 | ecore_con_server_flush(game->server); | ||
197 | } | 187 | } |
198 | else | 188 | else |
199 | { | 189 | { |