123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382 |
- -------------------------------------------------
- -- 本文件由代码生成器自动生成,
- -- 千万不要修改本文件的任何代码,
- -- 修改的的任何代码都会被覆盖掉!
- ----------------------------------------------------
- local Socket = require "Xmds.Pomelo.LuaGameSocket"
- require "base64"
- require "bagHandler_pb"
- --------------------------------Pomelo-------------------------------
- Pomelo = Pomelo or {}
- --------------------------------BagHandler-------------------------------
- Pomelo.BagHandler = {}
- local function packUpBagRequestEncoder(msg)
- local input = bagHandler_pb.PackUpBagRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function packUpBagRequestDecoder(stream)
- local res = bagHandler_pb.PackUpBagResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.BagHandler.packUpBagRequest(c2s_type,cb,option)
- local msg = {}
- msg.c2s_type = c2s_type
- Socket.OnRequestStart("area.bagHandler.packUpBagRequest", option)
- Socket.Request("area.bagHandler.packUpBagRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.BagHandler.lastPackUpBagResponse = res
- Socket.OnRequestEnd("area.bagHandler.packUpBagRequest", true)
- cb(nil,res)
- else
- local ex = {}
- if(res.s2c_code) then
- ex.Code = res.s2c_code
- ex.Message = res.s2c_msg
- else
- ex.Code = 501
- ex.Message = "[LuaXmdsNetClient] area.bagHandler.packUpBagRequest decode error!!"
- end
- Socket.OnRequestEnd("area.bagHandler.packUpBagRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, packUpBagRequestEncoder, packUpBagRequestDecoder)
- end
- local function openBagGridRequestEncoder(msg)
- local input = bagHandler_pb.OpenBagGridRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function openBagGridRequestDecoder(stream)
- local res = bagHandler_pb.OpenBagGridResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.BagHandler.openBagGridRequest(c2s_type,c2s_number,cb,option)
- local msg = {}
- msg.c2s_type = c2s_type
- msg.c2s_number = c2s_number
- Socket.OnRequestStart("area.bagHandler.openBagGridRequest", option)
- Socket.Request("area.bagHandler.openBagGridRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.BagHandler.lastOpenBagGridResponse = res
- Socket.OnRequestEnd("area.bagHandler.openBagGridRequest", true)
- cb(nil,res)
- else
- local ex = {}
- if(res.s2c_code) then
- ex.Code = res.s2c_code
- ex.Message = res.s2c_msg
- else
- ex.Code = 501
- ex.Message = "[LuaXmdsNetClient] area.bagHandler.openBagGridRequest decode error!!"
- end
- Socket.OnRequestEnd("area.bagHandler.openBagGridRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, openBagGridRequestEncoder, openBagGridRequestDecoder)
- end
- local function transferItemRequestEncoder(msg)
- local input = bagHandler_pb.TransferItemRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function transferItemRequestDecoder(stream)
- local res = bagHandler_pb.TransferItemResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.BagHandler.transferItemRequest(c2s_fromType,c2s_fromIndex,c2s_toType,c2s_num,cb,option)
- local msg = {}
- msg.c2s_fromType = c2s_fromType
- msg.c2s_fromIndex = c2s_fromIndex
- msg.c2s_toType = c2s_toType
- msg.c2s_num = c2s_num
- Socket.OnRequestStart("area.bagHandler.transferItemRequest", option)
- Socket.Request("area.bagHandler.transferItemRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.BagHandler.lastTransferItemResponse = res
- Socket.OnRequestEnd("area.bagHandler.transferItemRequest", true)
- cb(nil,res)
- else
- local ex = {}
- if(res.s2c_code) then
- ex.Code = res.s2c_code
- ex.Message = res.s2c_msg
- else
- ex.Code = 501
- ex.Message = "[LuaXmdsNetClient] area.bagHandler.transferItemRequest decode error!!"
- end
- Socket.OnRequestEnd("area.bagHandler.transferItemRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, transferItemRequestEncoder, transferItemRequestDecoder)
- end
- local function sellItemRequestEncoder(msg)
- local input = bagHandler_pb.SellItemRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function sellItemRequestDecoder(stream)
- local res = bagHandler_pb.SellItemResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.BagHandler.sellItemRequest(c2s_gridIndex,c2s_num,cb,option)
- local msg = {}
- msg.c2s_gridIndex = c2s_gridIndex
- msg.c2s_num = c2s_num
- Socket.OnRequestStart("area.bagHandler.sellItemRequest", option)
- Socket.Request("area.bagHandler.sellItemRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.BagHandler.lastSellItemResponse = res
- Socket.OnRequestEnd("area.bagHandler.sellItemRequest", true)
- cb(nil,res)
- else
- local ex = {}
- if(res.s2c_code) then
- ex.Code = res.s2c_code
- ex.Message = res.s2c_msg
- else
- ex.Code = 501
- ex.Message = "[LuaXmdsNetClient] area.bagHandler.sellItemRequest decode error!!"
- end
- Socket.OnRequestEnd("area.bagHandler.sellItemRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, sellItemRequestEncoder, sellItemRequestDecoder)
- end
- local function sellItemBatchRequestEncoder(msg)
- local input = bagHandler_pb.SellItemBatchRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function sellItemBatchRequestDecoder(stream)
- local res = bagHandler_pb.SellItemBatchResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.BagHandler.sellItemBatchRequest(c2s_gridList,cb,option)
- local msg = {}
- msg.c2s_gridList = c2s_gridList
- Socket.OnRequestStart("area.bagHandler.sellItemBatchRequest", option)
- Socket.Request("area.bagHandler.sellItemBatchRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.BagHandler.lastSellItemBatchResponse = res
- Socket.OnRequestEnd("area.bagHandler.sellItemBatchRequest", true)
- cb(nil,res)
- else
- local ex = {}
- if(res.s2c_code) then
- ex.Code = res.s2c_code
- ex.Message = res.s2c_msg
- else
- ex.Code = 501
- ex.Message = "[LuaXmdsNetClient] area.bagHandler.sellItemBatchRequest decode error!!"
- end
- Socket.OnRequestEnd("area.bagHandler.sellItemBatchRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, sellItemBatchRequestEncoder, sellItemBatchRequestDecoder)
- end
- local function useItemRequestEncoder(msg)
- local input = bagHandler_pb.UseItemRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function useItemRequestDecoder(stream)
- local res = bagHandler_pb.UseItemResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.BagHandler.useItemRequest(c2s_gridIndex,c2s_num,cb,option)
- local msg = {}
- msg.c2s_gridIndex = c2s_gridIndex
- msg.c2s_num = c2s_num
- Socket.OnRequestStart("area.bagHandler.useItemRequest", option)
- Socket.Request("area.bagHandler.useItemRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.BagHandler.lastUseItemResponse = res
- Socket.OnRequestEnd("area.bagHandler.useItemRequest", true)
- cb(nil,res)
- else
- local ex = {}
- if(res.s2c_code) then
- ex.Code = res.s2c_code
- ex.Message = res.s2c_msg
- else
- ex.Code = 501
- ex.Message = "[LuaXmdsNetClient] area.bagHandler.useItemRequest decode error!!"
- end
- Socket.OnRequestEnd("area.bagHandler.useItemRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, useItemRequestEncoder, useItemRequestDecoder)
- end
- local function disintegrationRequestEncoder(msg)
- local input = bagHandler_pb.DisintegrationRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function disintegrationRequestDecoder(stream)
- local res = bagHandler_pb.DisintegrationResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.BagHandler.disintegrationRequest(c2s_gridIndex,c2s_num,cb,option)
- local msg = {}
- msg.c2s_gridIndex = c2s_gridIndex
- msg.c2s_num = c2s_num
- Socket.OnRequestStart("area.bagHandler.disintegrationRequest", option)
- Socket.Request("area.bagHandler.disintegrationRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.BagHandler.lastDisintegrationResponse = res
- Socket.OnRequestEnd("area.bagHandler.disintegrationRequest", true)
- cb(nil,res)
- else
- local ex = {}
- if(res.s2c_code) then
- ex.Code = res.s2c_code
- ex.Message = res.s2c_msg
- else
- ex.Code = 501
- ex.Message = "[LuaXmdsNetClient] area.bagHandler.disintegrationRequest decode error!!"
- end
- Socket.OnRequestEnd("area.bagHandler.disintegrationRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, disintegrationRequestEncoder, disintegrationRequestDecoder)
- end
- local function addBagItemTestNotifyEncoder(msg)
- local input = bagHandler_pb.AddBagItemTestNotify()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- function Pomelo.BagHandler.addBagItemTestNotify()
- local msg = nil
- Socket.Notify("area.bagHandler.addBagItemTestNotify", msg, addBagItemTestNotifyEncoder)
- end
- local function bagItemUpdatePushDecoder(stream)
- local res = bagHandler_pb.BagItemUpdatePush()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.BagHandler.bagItemUpdatePush(cb)
- Socket.On("area.bagPush.bagItemUpdatePush", function(res)
- Pomelo.BagHandler.lastBagItemUpdatePush = res
- cb(nil,res)
- end, bagItemUpdatePushDecoder)
- end
- local function bagNewItemPushDecoder(stream)
- local res = bagHandler_pb.BagNewItemPush()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.BagHandler.bagNewItemPush(cb)
- Socket.On("area.bagPush.bagNewItemPush", function(res)
- Pomelo.BagHandler.lastBagNewItemPush = res
- cb(nil,res)
- end, bagNewItemPushDecoder)
- end
- local function bagNewEquipPushDecoder(stream)
- local res = bagHandler_pb.BagNewEquipPush()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.BagHandler.bagNewEquipPush(cb)
- Socket.On("area.bagPush.bagNewEquipPush", function(res)
- Pomelo.BagHandler.lastBagNewEquipPush = res
- cb(nil,res)
- end, bagNewEquipPushDecoder)
- end
- local function bagGridFullPushDecoder(stream)
- local res = bagHandler_pb.BagGridFullPush()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.BagHandler.bagGridFullPush(cb)
- Socket.On("area.bagPush.bagGridFullPush", function(res)
- Pomelo.BagHandler.lastBagGridFullPush = res
- cb(nil,res)
- end, bagGridFullPushDecoder)
- end
- local function bagGridNumPushDecoder(stream)
- local res = bagHandler_pb.BagGridNumPush()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.BagHandler.bagGridNumPush(cb)
- Socket.On("area.bagPush.bagGridNumPush", function(res)
- Pomelo.BagHandler.lastBagGridNumPush = res
- cb(nil,res)
- end, bagGridNumPushDecoder)
- end
- local function bagNewItemFromResFubenPushDecoder(stream)
- local res = bagHandler_pb.BagNewItemFromResFubenPush()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.BagHandler.bagNewItemFromResFubenPush(cb)
- Socket.On("area.bagPush.bagNewItemFromResFubenPush", function(res)
- Pomelo.BagHandler.lastBagNewItemFromResFubenPush = res
- cb(nil,res)
- end, bagNewItemFromResFubenPushDecoder)
- end
- --------------------------------Pomelo-------------------------------
- return Pomelo
|