pb - kyohwang/games GitHub Wiki
一次性递归解析服务器下发的PB数据。用来方便地验证客户端端服务器之间调试中遇到数据不一致的问题。
probuf.lua 加入 这两个方法 `function decodeAll(typename, buffer) local ret = decode(typename, buffer) if ret then decodeTable(ret) end return ret end
function decodeTable(tbl) for k,v in pairs(tbl) do if type(v) == "table" then if(type(v[1]) == "string" and string.find(v[1],"sango.packet")) then local ret = decode(v[1], v[2]) if ret then tbl[k] = ret end end decodeTable(tbl[k]) end end end`