aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--LuaSL/src/LuaSL_main.c60
1 files changed, 34 insertions, 26 deletions
diff --git a/LuaSL/src/LuaSL_main.c b/LuaSL/src/LuaSL_main.c
index d6ccc14..ac0b0c9 100644
--- a/LuaSL/src/LuaSL_main.c
+++ b/LuaSL/src/LuaSL_main.c
@@ -233,42 +233,50 @@ int main(int argc, char **argv)
233 game.names = eina_hash_string_superfast_new(NULL); 233 game.names = eina_hash_string_superfast_new(NULL);
234 if (ecore_con_init()) 234 if (ecore_con_init())
235 { 235 {
236 if ((game.server = ecore_con_server_add(ECORE_CON_REMOTE_TCP, game.address, game.port, &game))) 236 if (ecore_con_init())
237 { 237 {
238 ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_ADD, (Ecore_Event_Handler_Cb) _add, &game); 238 if ((game.server = ecore_con_server_add(ECORE_CON_REMOTE_TCP, game.address, game.port, &game)))
239 ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DATA, (Ecore_Event_Handler_Cb) _data, &game);
240 ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DEL, (Ecore_Event_Handler_Cb) _del, &game);
241 ecore_con_server_timeout_set(game.server, 0);
242 ecore_con_server_client_limit_set(game.server, -1, 0);
243 clientStream = eina_strbuf_new();
244
245 if (edje_init())
246 { 239 {
247 int i; 240 ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_ADD, (Ecore_Event_Handler_Cb) _add, &game);
248 241 ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DATA, (Ecore_Event_Handler_Cb) _data, &game);
249 result = 0; 242 ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DEL, (Ecore_Event_Handler_Cb) _del, &game);
250 compilerSetup(&game); 243 ecore_con_server_timeout_set(game.server, 0);
251 luaprocInit(); 244 ecore_con_server_client_limit_set(game.server, -1, 0);
252 for (i = 0; i < CPUs; i++) 245 ecore_con_server_timeout_set(game.server, 10);
246 ecore_con_server_client_limit_set(game.server, 3, 0);
247 clientStream = eina_strbuf_new();
248
249 if (edje_init())
253 { 250 {
254 if ( sched_create_worker( ) != LUAPROC_SCHED_OK ) 251 int i;
255 PEm("Error creating luaproc worker thread."); 252
253 result = 0;
254 compilerSetup(&game);
255 luaprocInit();
256 for (i = 0; i < CPUs; i++)
257 {
258 if ( sched_create_worker( ) != LUAPROC_SCHED_OK )
259 PEm("Error creating luaproc worker thread.");
260 }
261 ecore_main_loop_begin();
262
263 // TODO - this is what hangs the system, should change from raw pthreads to ecore threads.
264 sched_join_workerthreads();
265 edje_shutdown();
256 } 266 }
257 ecore_main_loop_begin(); 267 else
258 268 PCm("Failed to init edje!");
259 // TODO - this is what hangs the system, should change from raw pthreads to ecare threads.
260 sched_join_workerthreads();
261 edje_shutdown();
262 } 269 }
263 else 270 else
264 PCm("Failed to init edje!"); 271 PCm("Failed to add server!");
272 ecore_con_shutdown();
265 } 273 }
266 else 274 else
267 PCm("Failed to add server!"); 275 PCm("Failed to init ecore_con!");
268 ecore_con_shutdown(); 276 ecore_shutdown();
269 } 277 }
270 else 278 else
271 PCm("Failed to init ecore_con!"); 279 PCm("Failed to init ecore!");
272 } 280 }
273 else 281 else
274 fprintf(stderr, "Failed to init eina!"); 282 fprintf(stderr, "Failed to init eina!");