cloudwu / battlearena Goto Github PK
View Code? Open in Web Editor NEWA experimental project for moba like game server
A experimental project for moba like game server
google了一晚,没搜到结果,还是来麻烦云风大侠了 @cloudwu
[:~/macdev/battlearena/client]$ which lua
/usr/local/bin/lua
[:~/macdev/battlearena/client]$ lua -v
Lua 5.3.0 Copyright (C) 1994-2015 Lua.org, PUC-Rio
-std=gnu99, 这个是我加的,加与不加,结果一样
[:~/macdev/battlearena/client]$ make (master✱)
cd lsocket && /Applications/Xcode.app/Contents/Developer/usr/bin/make
cc -bundle -undefined dynamic_lookup -all_load -o lsocket.so lsocket.o
gcc -std=gnu99 -O2 -Wall -fPIC -bundle -undefined dynamic_lookup -all_load -llua -o timesync.so timesync.c -I/usr/local/include
timesync.c:120:2: warning: implicit declaration of function 'luaL_checkversion' is invalid in C99 [-Wimplicit-function-declaration]
luaL_checkversion(L);
^
timesync.c:128:2: warning: implicit declaration of function 'luaL_newlibtable' is invalid in C99 [-Wimplicit-function-declaration]
luaL_newlibtable(L,l);
^
timesync.c:131:2: warning: implicit declaration of function 'luaL_setfuncs' is invalid in C99 [-Wimplicit-function-declaration]
luaL_setfuncs(L,l,1);
^
3 warnings generated
[:~/macdev/battlearena]$ ./client.sh (master✱)
lua: error loading module 'timesync' from file 'client/timesync.so':
dlopen(client/timesync.so, 6): Symbol not found: _luaL_checkversion
Referenced from: client/timesync.so
Expected in: flat namespace
in client/timesync.so
stack traceback:
[C]: in ?
[C]: in function 'require'
client/socket.lua:3: in main chunk
[C]: in function 'require'
client/main.lua:1: in main chunk
[C]: in ?
local function send_request(self, data)
local n = #data
local sb = self.__fd:send(data)
if not sb then
closefd(self)
return
end
local unsend = sb + 1
while sb < n do
n = n - sb
local sb = self.__fd:send(v.data:sub(unsend))
if not sb then
closefd(self)
return
end
unsend = unsend + sb
end
end
当网络情况比较差,第一次SEND失败,从第二次SEND开始就会死循环,原因是定义了两个local sb
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.