FunctionHandler.lua 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. -------------------------------------------------
  2. -- 本文件由代码生成器自动生成,
  3. -- 千万不要修改本文件的任何代码,
  4. -- 修改的的任何代码都会被覆盖掉!
  5. ----------------------------------------------------
  6. local Socket = require "Xmds.Pomelo.LuaGameSocket"
  7. require "base64"
  8. require "functionHandler_pb"
  9. --------------------------------Pomelo-------------------------------
  10. Pomelo = Pomelo or {}
  11. --------------------------------FunctionHandler-------------------------------
  12. Pomelo.FunctionHandler = {}
  13. local function functionGoToPushDecoder(stream)
  14. local res = functionHandler_pb.FunctionGoToPush()
  15. res:ParseFromString(stream)
  16. return res
  17. end
  18. function Pomelo.FunctionHandler.functionGoToPush(cb)
  19. Socket.On("area.functionPush.functionGoToPush", function(res)
  20. Pomelo.FunctionHandler.lastFunctionGoToPush = res
  21. cb(nil,res)
  22. end, functionGoToPushDecoder)
  23. end
  24. local function taskGuideFuncPushDecoder(stream)
  25. local res = functionHandler_pb.TaskGuideFuncPush()
  26. res:ParseFromString(stream)
  27. return res
  28. end
  29. function Pomelo.FunctionHandler.taskGuideFuncPush(cb)
  30. Socket.On("area.functionPush.taskGuideFuncPush", function(res)
  31. Pomelo.FunctionHandler.lastTaskGuideFuncPush = res
  32. cb(nil,res)
  33. end, taskGuideFuncPushDecoder)
  34. end
  35. --------------------------------Pomelo-------------------------------
  36. return Pomelo