CrossServerHandler.lua 1020 B

12345678910111213141516171819202122232425262728293031323334
  1. -------------------------------------------------
  2. -- 本文件由代码生成器自动生成,
  3. -- 千万不要修改本文件的任何代码,
  4. -- 修改的的任何代码都会被覆盖掉!
  5. ----------------------------------------------------
  6. local Socket = require "Xmds.Pomelo.LuaGameSocket"
  7. require "base64"
  8. require "crossServerHandler_pb"
  9. --------------------------------Pomelo-------------------------------
  10. Pomelo = Pomelo or {}
  11. --------------------------------CrossServerHandler-------------------------------
  12. Pomelo.CrossServerHandler = {}
  13. local function treasureOpenPushDecoder(stream)
  14. local res = crossServerHandler_pb.TreasureOpenPush()
  15. res:ParseFromString(stream)
  16. return res
  17. end
  18. function Pomelo.CrossServerHandler.treasureOpenPush(cb)
  19. Socket.On("area.crossServerPush.treasureOpenPush", function(res)
  20. Pomelo.CrossServerHandler.lastTreasureOpenPush = res
  21. cb(nil,res)
  22. end, treasureOpenPushDecoder)
  23. end
  24. --------------------------------Pomelo-------------------------------
  25. return Pomelo