diff options
| author | Alexander <alex@cogarr.net> | 2019-06-26 16:14:00 -0400 |
|---|---|---|
| committer | Alexander <alex@cogarr.net> | 2019-06-26 16:14:00 -0400 |
| commit | d5cd0c7b4425e25b11a1ceec154a5c752d508a42 (patch) | |
| tree | ef50cd7d419bba30ee08f46c97232b1c8c68d2be /src/shared/lua_api/load_net.cpp | |
| parent | 3d60e1432ec43ade4aa61b5a70dd6b8975417e9f (diff) | |
| download | brokengine-d5cd0c7b4425e25b11a1ceec154a5c752d508a42.tar.gz brokengine-d5cd0c7b4425e25b11a1ceec154a5c752d508a42.tar.bz2 brokengine-d5cd0c7b4425e25b11a1ceec154a5c752d508a42.zip | |
Major refactor of physics code
Move all the physics code into the shared directory,
and fix the ghost objects (aabb only)
Diffstat (limited to 'src/shared/lua_api/load_net.cpp')
| -rw-r--r-- | src/shared/lua_api/load_net.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
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; |
