aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorAlexander Pickering <alex@cogarr.net>2018-09-10 23:11:08 -0400
committerAlexander Pickering <alex@cogarr.net>2018-09-10 23:11:08 -0400
commitc38d5eca7091fc7f0206ed0c746622022b2ae508 (patch)
tree8c01d4a941b4152675354b8b7a46c0906e9fb40c /src/server
parentb3c0d2ead1f384b35615be562c5f06804e8990cb (diff)
downloadbrokengine-c38d5eca7091fc7f0206ed0c746622022b2ae508.tar.gz
brokengine-c38d5eca7091fc7f0206ed0c746622022b2ae508.tar.bz2
brokengine-c38d5eca7091fc7f0206ed0c746622022b2ae508.zip
Added documentation
Also added treeview guielemnt Also added ifilesystem guielement Also added io library
Diffstat (limited to 'src/server')
-rw-r--r--src/server/main.cpp12
1 files changed, 10 insertions, 2 deletions
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);