GateSocket.lua 939 B

123456789101112131415161718192021222324252627282930313233
  1. -------------------------------------------------
  2. -- 本文件由代码生成器自动生成,
  3. -- 千万不要修改本文件的任何代码,
  4. -- 修改的的任何代码都会被覆盖掉!
  5. ----------------------------------------------------
  6. local Socket = require "Xmds.Pomelo.LuaGateSocket"
  7. require "base64"
  8. --------------------------------Pomelo-------------------------------
  9. Pomelo = Pomelo or {}
  10. --------------------------------GateSocket-------------------------------
  11. Pomelo.GateSocket = {}
  12. local function serverStatePushDecoder(stream)
  13. local res = loginHandler_pb.ServerStatePush()
  14. res:ParseFromString(stream)
  15. return res
  16. end
  17. function Pomelo.GateSocket.serverStatePush(cb)
  18. Socket.On("login.loginPush.serverStatePush", function(res)
  19. Pomelo.GateSocket.lastServerStatePush = res
  20. cb(nil,res)
  21. end, serverStatePushDecoder)
  22. end
  23. --------------------------------Pomelo-------------------------------
  24. return Pomelo