123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310 |
- -------------------------------------------------
- -- 本文件由代码生成器自动生成,
- -- 千万不要修改本文件的任何代码,
- -- 修改的的任何代码都会被覆盖掉!
- ----------------------------------------------------
- local Socket = require "Xmds.Pomelo.LuaGameSocket"
- require "base64"
- require "consignmentLineHandler_pb"
- --------------------------------Pomelo-------------------------------
- Pomelo = Pomelo or {}
- --------------------------------ConsignmentLineHandler-------------------------------
- Pomelo.ConsignmentLineHandler = {}
- local function addConsignmentRequestEncoder(msg)
- local input = consignmentLineHandler_pb.AddConsignmentRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function addConsignmentRequestDecoder(stream)
- local res = consignmentLineHandler_pb.AddConsignmentResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.ConsignmentLineHandler.addConsignmentRequest(c2s_index,c2s_number,c2s_price,c2s_global,c2s_isAnonymous,c2s_id,cb,option)
- local msg = {}
- msg.c2s_index = c2s_index
- msg.c2s_number = c2s_number
- msg.c2s_price = c2s_price
- msg.c2s_global = c2s_global
- msg.c2s_isAnonymous = c2s_isAnonymous
- msg.c2s_id = c2s_id
- Socket.OnRequestStart("area.consignmentLineHandler.addConsignmentRequest", option)
- Socket.Request("area.consignmentLineHandler.addConsignmentRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.ConsignmentLineHandler.lastAddConsignmentResponse = res
- Socket.OnRequestEnd("area.consignmentLineHandler.addConsignmentRequest", 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.consignmentLineHandler.addConsignmentRequest decode error!!"
- end
- Socket.OnRequestEnd("area.consignmentLineHandler.addConsignmentRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, addConsignmentRequestEncoder, addConsignmentRequestDecoder)
- end
- local function removeConsignmentRequestEncoder(msg)
- local input = consignmentLineHandler_pb.RemoveConsignmentRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function removeConsignmentRequestDecoder(stream)
- local res = consignmentLineHandler_pb.RemoveConsignmentResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.ConsignmentLineHandler.removeConsignmentRequest(c2s_id,c2s_global,cb,option)
- local msg = {}
- msg.c2s_id = c2s_id
- msg.c2s_global = c2s_global
- Socket.OnRequestStart("area.consignmentLineHandler.removeConsignmentRequest", option)
- Socket.Request("area.consignmentLineHandler.removeConsignmentRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.ConsignmentLineHandler.lastRemoveConsignmentResponse = res
- Socket.OnRequestEnd("area.consignmentLineHandler.removeConsignmentRequest", 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.consignmentLineHandler.removeConsignmentRequest decode error!!"
- end
- Socket.OnRequestEnd("area.consignmentLineHandler.removeConsignmentRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, removeConsignmentRequestEncoder, removeConsignmentRequestDecoder)
- end
- local function buyConsignmentRequestEncoder(msg)
- local input = consignmentLineHandler_pb.BuyConsignmentRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function buyConsignmentRequestDecoder(stream)
- local res = consignmentLineHandler_pb.BuyConsignmentResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.ConsignmentLineHandler.buyConsignmentRequest(c2s_id,c2s_global,c2s_num,cb,option)
- local msg = {}
- msg.c2s_id = c2s_id
- msg.c2s_global = c2s_global
- msg.c2s_num = c2s_num
- Socket.OnRequestStart("area.consignmentLineHandler.buyConsignmentRequest", option)
- Socket.Request("area.consignmentLineHandler.buyConsignmentRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.ConsignmentLineHandler.lastBuyConsignmentResponse = res
- Socket.OnRequestEnd("area.consignmentLineHandler.buyConsignmentRequest", 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.consignmentLineHandler.buyConsignmentRequest decode error!!"
- end
- Socket.OnRequestEnd("area.consignmentLineHandler.buyConsignmentRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, buyConsignmentRequestEncoder, buyConsignmentRequestDecoder)
- end
- local function consignmentListRequestEncoder(msg)
- local input = consignmentLineHandler_pb.ConsignmentListRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function consignmentListRequestDecoder(stream)
- local res = consignmentLineHandler_pb.ConsignmentListResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.ConsignmentLineHandler.consignmentListRequest(c2s_pro,c2s_qcolor,c2s_order,c2s_itemSecondType,c2s_page,c2s_global,c2s_itemType,c2s_level,c2s_condition,cb,option)
- local msg = {}
- msg.c2s_pro = c2s_pro
- msg.c2s_qcolor = c2s_qcolor
- msg.c2s_order = c2s_order
- msg.c2s_itemSecondType = c2s_itemSecondType
- msg.c2s_page = c2s_page
- msg.c2s_global = c2s_global
- msg.c2s_itemType = c2s_itemType
- msg.c2s_level = c2s_level
- msg.c2s_condition = c2s_condition
- Socket.OnRequestStart("area.consignmentLineHandler.consignmentListRequest", option)
- Socket.Request("area.consignmentLineHandler.consignmentListRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.ConsignmentLineHandler.lastConsignmentListResponse = res
- Socket.OnRequestEnd("area.consignmentLineHandler.consignmentListRequest", 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.consignmentLineHandler.consignmentListRequest decode error!!"
- end
- Socket.OnRequestEnd("area.consignmentLineHandler.consignmentListRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, consignmentListRequestEncoder, consignmentListRequestDecoder)
- end
- local function myConsignmentRequestEncoder(msg)
- local input = consignmentLineHandler_pb.MyConsignmentRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function myConsignmentRequestDecoder(stream)
- local res = consignmentLineHandler_pb.MyConsignmentResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.ConsignmentLineHandler.myConsignmentRequest(c2s_global,cb,option)
- local msg = {}
- msg.c2s_global = c2s_global
- Socket.OnRequestStart("area.consignmentLineHandler.myConsignmentRequest", option)
- Socket.Request("area.consignmentLineHandler.myConsignmentRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.ConsignmentLineHandler.lastMyConsignmentResponse = res
- Socket.OnRequestEnd("area.consignmentLineHandler.myConsignmentRequest", 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.consignmentLineHandler.myConsignmentRequest decode error!!"
- end
- Socket.OnRequestEnd("area.consignmentLineHandler.myConsignmentRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, myConsignmentRequestEncoder, myConsignmentRequestDecoder)
- end
- local function searchConsignmentRequestEncoder(msg)
- local input = consignmentLineHandler_pb.SearchConsignmentRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function searchConsignmentRequestDecoder(stream)
- local res = consignmentLineHandler_pb.SearchConsignmentResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.ConsignmentLineHandler.searchConsignmentRequest(c2s_condition,c2s_global,cb,option)
- local msg = {}
- msg.c2s_condition = c2s_condition
- msg.c2s_global = c2s_global
- Socket.OnRequestStart("area.consignmentLineHandler.searchConsignmentRequest", option)
- Socket.Request("area.consignmentLineHandler.searchConsignmentRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.ConsignmentLineHandler.lastSearchConsignmentResponse = res
- Socket.OnRequestEnd("area.consignmentLineHandler.searchConsignmentRequest", 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.consignmentLineHandler.searchConsignmentRequest decode error!!"
- end
- Socket.OnRequestEnd("area.consignmentLineHandler.searchConsignmentRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, searchConsignmentRequestEncoder, searchConsignmentRequestDecoder)
- end
- local function publicItemRequestEncoder(msg)
- local input = consignmentLineHandler_pb.PublicItemRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function publicItemRequestDecoder(stream)
- local res = consignmentLineHandler_pb.PublicItemResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.ConsignmentLineHandler.publicItemRequest(id,cb,option)
- local msg = {}
- msg.id = id
- Socket.OnRequestStart("area.consignmentLineHandler.publicItemRequest", option)
- Socket.Request("area.consignmentLineHandler.publicItemRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.ConsignmentLineHandler.lastPublicItemResponse = res
- Socket.OnRequestEnd("area.consignmentLineHandler.publicItemRequest", 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.consignmentLineHandler.publicItemRequest decode error!!"
- end
- Socket.OnRequestEnd("area.consignmentLineHandler.publicItemRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, publicItemRequestEncoder, publicItemRequestDecoder)
- end
- local function consignmentRemovePushDecoder(stream)
- local res = consignmentLineHandler_pb.ConsignmentRemovePush()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.ConsignmentLineHandler.consignmentRemovePush(cb)
- Socket.On("area.consignmentLinePush.consignmentRemovePush", function(res)
- Pomelo.ConsignmentLineHandler.lastConsignmentRemovePush = res
- cb(nil,res)
- end, consignmentRemovePushDecoder)
- end
- --------------------------------Pomelo-------------------------------
- return Pomelo
|