chatOfSkynet based on quick2dx and chatOfSkynet
How to start?
Download the quick-cocos2d-x https://github.com/chukong/quick-cocos2d-x
Download the chatOfSkynet https://github.com/coderHsc/chatOfSkynet
add submodule
git submodule update --init
chatOfSkynet based on quick2dx and chatOfSkynet
How to start?
Download the quick-cocos2d-x https://github.com/chukong/quick-cocos2d-x
Download the chatOfSkynet https://github.com/coderHsc/chatOfSkynet
add submodule
git submodule update --init
protobuf.lua这个文件加载了/protobuf/c.lua这个文件是在那下载或者生成,我找不得这个文件
我使用你的客户端没有异常
我使用你的客户端向skynet发送消息时,服务器端出现异常,发生在接受消息时--
--排除到最后问题为消息没有注册
--这个问题的解决思路是这样的
在客户端运行(你的例子里面的代码)
function messageManager:getProcessMessage(version,messageId,protobufMessage)
print("********")
print(protobufMessage)
local packA = string.pack(">hiz",version,messageId,protobufMessage)
local byteArrayA = ByteArray.new()
byteArrayA:writeBuf(packA)
local packAlen = byteArrayA:getLen() --得到长度
--多了个长度信息
local packB = string.pack(">hhiz",packAlen,version,messageId,protobufMessage)
local byteArrayB = ByteArray.new()
byteArrayB:writeBuf(packB)
return byteArrayB
end
在服务端建立连接接受到消息后不能正常解析消息(你例子的代码)
skynet.register_protocol {
name = "client",
id = skynet.PTYPE_CLIENT,
unpack = function (msg, sz)
return host:dispatch(msg, sz)
end,
..........
}
运行到这里出现警告
:0100000e] lua call [100000d to :100000e : 0 msgsz = 19] error : �[31m./lualib/skynet.lua:564: ./lualib/sproto.lua:111: bad argument #2 to 'unpack' (number expected, got no value)
stack traceback:
[C]: in function 'assert'
./lualib/skynet.lua:564: in function <./lualib/skynet.lua:544>�[0m
是否还缺少文件导致解析失败
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.