From d5cd0c7b4425e25b11a1ceec154a5c752d508a42 Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 26 Jun 2019 16:14:00 -0400 Subject: Major refactor of physics code Move all the physics code into the shared directory, and fix the ghost objects (aabb only) --- src/shared/lua_api/load_net.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/shared/lua_api/load_net.cpp') diff --git a/src/shared/lua_api/load_net.cpp b/src/shared/lua_api/load_net.cpp index 04a9239..d8d321a 100644 --- a/src/shared/lua_api/load_net.cpp +++ b/src/shared/lua_api/load_net.cpp @@ -10,20 +10,20 @@ ect. --Server local s = net.newsocket(net.REP) s:bind("tcp://127.0.0.1:8765") - s:receive(function(stream) + function s:receive(stream) local message = stream:readstring() s:send("pong",function(stream) stream:writestring(message .. " world!") end) - end) + end @usage --Client local c = net.newsocket(net.REQ) c:connect("tcp://127.0.0.1:8765") - c:receive(function(stream) + c:receive(stream) print(stream:readstring()) - end) + end c:send(function(stream) stream:writestring("Hello,") end) @@ -378,8 +378,8 @@ void gameloop_net(lua_State* L){ if(err){ switch(err){ case NNG_EAGAIN: break; - case NNG_ESTATE: - if(stype == REQ) break; + //case NNG_ESTATE: + //if(stype == REQ) break; default: printf("Net error: %s\n\tSocket type:%d\n",nng_strerror(err),stype); lua_pushstring(L,"Error while receving message:"); @@ -535,7 +535,6 @@ int send(lua_State* L){ //lua_getfield(L,-1,"n");//{socket},type //int sockettype = lua_tonumber(L,-1); //lua_pop(L,2);// - //switch(sockettype //netfuncs[fd] = func;// //nettypes[fd] = sockettype; //return 0; -- cgit v1.2.3-70-g09d2