From c38d5eca7091fc7f0206ed0c746622022b2ae508 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 10 Sep 2018 23:11:08 -0400 Subject: Added documentation Also added treeview guielemnt Also added ifilesystem guielement Also added io library --- src/server/main.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/server') diff --git a/src/server/main.cpp b/src/server/main.cpp index bd731c2..9fb28c8 100644 --- a/src/server/main.cpp +++ b/src/server/main.cpp @@ -29,7 +29,9 @@ using namespace chrono; lua_State* L; void gameloop(){ gameloop_phys(NULL); + //printf("done physics\n"); gameloop_net(L); + //printf("done net\n"); } int main (){ @@ -38,10 +40,11 @@ int main (){ putenv("LUA_PATH=../data/?.lua"); L = luaL_newstate(); - lua_newtable(L); - lua_setglobal(L,"GAME"); + lua_newtable(L);//{} + lua_setglobal(L,"GAME");// phys_genesis(); + luaL_openlibs(L); loadLLibs(L); loadNetLibs(L); loadPhysLibs(L); @@ -51,16 +54,21 @@ int main (){ lua_error(L); } do{ + printf("Start of server gameloop\n"); gameloop(); + printf("Gameloop\n"); std::this_thread::yield(); + printf("Thread yeild\n"); lua_getglobal(L,"GAME");//{} lua_getfield(L,-1,"tick");//{},function_tick() + printf("Found game tick\n"); if(!lua_isnil(L,-1)){ lua_call(L,0,0); lua_pop(L,1); }else{ lua_pop(L,2); } + printf("End of server gameloop\n"); }while(true); phys_shutdown(NULL); -- cgit v1.2.3-70-g09d2