EquipRetrieveProxy.lua 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. local RemoteProxy = requireProxy( "remote/RemoteProxy" )
  2. local EquipRetrieveProxy = class( "EquipRetrieveProxy", RemoteProxy )
  3. EquipRetrieveProxy.NAME = global.ProxyTable.EquipRetrieveProxy
  4. function EquipRetrieveProxy:ctor()
  5. EquipRetrieveProxy.super.ctor( self )
  6. self._retrieve_list = {}
  7. end
  8. --获取回收的makeindex
  9. function EquipRetrieveProxy:GetRetrieveList( )
  10. return self._retrieve_list or {}
  11. end
  12. --设置回收的makeindex
  13. function EquipRetrieveProxy:SetRetrieveList(retrieve_str)
  14. self._retrieve_list = {}
  15. if retrieve_str then
  16. local parse1 = string.split(retrieve_str,",")
  17. for i,v in ipairs(parse1) do
  18. if v and v ~= "" then
  19. local makeIndex = tonumber(v)
  20. if makeIndex then
  21. self._retrieve_list[makeIndex] = makeIndex
  22. end
  23. end
  24. end
  25. return
  26. end
  27. end
  28. --回收
  29. function EquipRetrieveProxy:handle_MSG_SC_EQUIP_RETRIEVE_RESPONSE(msg)
  30. local msgLen = msg:GetDataLength()
  31. local msgHdr = msg:GetHeader()
  32. local dataString = nil
  33. if msgLen > 0 then
  34. dataString = msg:GetData():ReadString(msgLen)
  35. end
  36. self:SetRetrieveList(dataString)
  37. global.Facade:sendNotification(global.NoticeTable.Equip_Retrieve_State)
  38. end
  39. function EquipRetrieveProxy:RegisterMsgHandler( )
  40. EquipRetrieveProxy.super.RegisterMsgHandler(self)
  41. local msgType = global.MsgType
  42. LuaRegisterMsgHandler( msgType.MSG_SC_EQUIP_RETRIEVE_RESPONSE,handler( self, self.handle_MSG_SC_EQUIP_RETRIEVE_RESPONSE) )
  43. end
  44. return EquipRetrieveProxy