123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342 |
- -------------------------------------------------
- -- 本文件由代码生成器自动生成,
- -- 千万不要修改本文件的任何代码,
- -- 修改的的任何代码都会被覆盖掉!
- ----------------------------------------------------
- local Socket = require "Xmds.Pomelo.LuaGameSocket"
- require "base64"
- require "resourceDungeonHandler_pb"
- --------------------------------Pomelo-------------------------------
- Pomelo = Pomelo or {}
- --------------------------------ResourceDungeonHandler-------------------------------
- Pomelo.ResourceDungeonHandler = {}
- local function queryResourceDugeonInfoRequestEncoder(msg)
- local input = resourceDungeonHandler_pb.QueryResourceDugeonInfoRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function queryResourceDugeonInfoRequestDecoder(stream)
- local res = resourceDungeonHandler_pb.QueryResourceDugeonInfoResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.ResourceDungeonHandler.queryResourceDugeonInfoRequest(cb,option)
- local input = nil
- Socket.OnRequestStart("area.resourceDungeonHandler.queryResourceDugeonInfoRequest", option)
- Socket.Request("area.resourceDungeonHandler.queryResourceDugeonInfoRequest", input, function(res)
- if(res.s2c_code == 200) then
- Pomelo.ResourceDungeonHandler.lastQueryResourceDugeonInfoResponse = res
- Socket.OnRequestEnd("area.resourceDungeonHandler.queryResourceDugeonInfoRequest", 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.resourceDungeonHandler.queryResourceDugeonInfoRequest decode error!!"
- end
- Socket.OnRequestEnd("area.resourceDungeonHandler.queryResourceDugeonInfoRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, queryResourceDugeonInfoRequestEncoder, queryResourceDugeonInfoRequestDecoder)
- end
- local function buyTimesRequestEncoder(msg)
- local input = resourceDungeonHandler_pb.BuyTimesRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function buyTimesRequestDecoder(stream)
- local res = resourceDungeonHandler_pb.BuyTimesResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.ResourceDungeonHandler.buyTimesRequest(dungeonId,cb,option)
- local msg = {}
- msg.dungeonId = dungeonId
- Socket.OnRequestStart("area.resourceDungeonHandler.buyTimesRequest", option)
- Socket.Request("area.resourceDungeonHandler.buyTimesRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.ResourceDungeonHandler.lastBuyTimesResponse = res
- Socket.OnRequestEnd("area.resourceDungeonHandler.buyTimesRequest", 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.resourceDungeonHandler.buyTimesRequest decode error!!"
- end
- Socket.OnRequestEnd("area.resourceDungeonHandler.buyTimesRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, buyTimesRequestEncoder, buyTimesRequestDecoder)
- end
- local function enterResourceDugeonInfoRequestEncoder(msg)
- local input = resourceDungeonHandler_pb.EnterResourceDugeonInfoRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function enterResourceDugeonInfoRequestDecoder(stream)
- local res = resourceDungeonHandler_pb.EnterResourceDugeonInfoResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.ResourceDungeonHandler.enterResourceDugeonInfoRequest(dungeonId,cb,option)
- local msg = {}
- msg.dungeonId = dungeonId
- Socket.OnRequestStart("area.resourceDungeonHandler.enterResourceDugeonInfoRequest", option)
- Socket.Request("area.resourceDungeonHandler.enterResourceDugeonInfoRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.ResourceDungeonHandler.lastEnterResourceDugeonInfoResponse = res
- Socket.OnRequestEnd("area.resourceDungeonHandler.enterResourceDugeonInfoRequest", 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.resourceDungeonHandler.enterResourceDugeonInfoRequest decode error!!"
- end
- Socket.OnRequestEnd("area.resourceDungeonHandler.enterResourceDugeonInfoRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, enterResourceDugeonInfoRequestEncoder, enterResourceDugeonInfoRequestDecoder)
- end
- local function receiveDoubleRewardRequestEncoder(msg)
- local input = resourceDungeonHandler_pb.ReceiveDoubleRewardRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function receiveDoubleRewardRequestDecoder(stream)
- local res = resourceDungeonHandler_pb.ReceiveDoubleRewardResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.ResourceDungeonHandler.receiveDoubleRewardRequest(dungeonId,cb,option)
- local msg = {}
- msg.dungeonId = dungeonId
- Socket.OnRequestStart("area.resourceDungeonHandler.receiveDoubleRewardRequest", option)
- Socket.Request("area.resourceDungeonHandler.receiveDoubleRewardRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.ResourceDungeonHandler.lastReceiveDoubleRewardResponse = res
- Socket.OnRequestEnd("area.resourceDungeonHandler.receiveDoubleRewardRequest", 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.resourceDungeonHandler.receiveDoubleRewardRequest decode error!!"
- end
- Socket.OnRequestEnd("area.resourceDungeonHandler.receiveDoubleRewardRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, receiveDoubleRewardRequestEncoder, receiveDoubleRewardRequestDecoder)
- end
- local function resourceCountDownRequestEncoder(msg)
- local input = resourceDungeonHandler_pb.ResourceCountDownRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function resourceCountDownRequestDecoder(stream)
- local res = resourceDungeonHandler_pb.ResourceCountDownResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.ResourceDungeonHandler.resourceCountDownRequest(dungeonId,cb,option)
- local msg = {}
- msg.dungeonId = dungeonId
- Socket.OnRequestStart("area.resourceDungeonHandler.resourceCountDownRequest", option)
- Socket.Request("area.resourceDungeonHandler.resourceCountDownRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.ResourceDungeonHandler.lastResourceCountDownResponse = res
- Socket.OnRequestEnd("area.resourceDungeonHandler.resourceCountDownRequest", 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.resourceDungeonHandler.resourceCountDownRequest decode error!!"
- end
- Socket.OnRequestEnd("area.resourceDungeonHandler.resourceCountDownRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, resourceCountDownRequestEncoder, resourceCountDownRequestDecoder)
- end
- local function resourceSweepRequestEncoder(msg)
- local input = resourceDungeonHandler_pb.ResourceSweepRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function resourceSweepRequestDecoder(stream)
- local res = resourceDungeonHandler_pb.ResourceSweepResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.ResourceDungeonHandler.resourceSweepRequest(dungeonId,cb,option)
- local msg = {}
- msg.dungeonId = dungeonId
- Socket.OnRequestStart("area.resourceDungeonHandler.resourceSweepRequest", option)
- Socket.Request("area.resourceDungeonHandler.resourceSweepRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.ResourceDungeonHandler.lastResourceSweepResponse = res
- Socket.OnRequestEnd("area.resourceDungeonHandler.resourceSweepRequest", 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.resourceDungeonHandler.resourceSweepRequest decode error!!"
- end
- Socket.OnRequestEnd("area.resourceDungeonHandler.resourceSweepRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, resourceSweepRequestEncoder, resourceSweepRequestDecoder)
- end
- local function resourceSitUnsafeRequestEncoder(msg)
- local input = resourceDungeonHandler_pb.ResourceSitUnsafeRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function resourceSitUnsafeRequestDecoder(stream)
- local res = resourceDungeonHandler_pb.ResourceSitUnsafeResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.ResourceDungeonHandler.resourceSitUnsafeRequest(sit_unsafe,cb,option)
- local msg = {}
- msg.sit_unsafe = sit_unsafe
- Socket.OnRequestStart("area.resourceDungeonHandler.resourceSitUnsafeRequest", option)
- Socket.Request("area.resourceDungeonHandler.resourceSitUnsafeRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.ResourceDungeonHandler.lastResourceSitUnsafeResponse = res
- Socket.OnRequestEnd("area.resourceDungeonHandler.resourceSitUnsafeRequest", 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.resourceDungeonHandler.resourceSitUnsafeRequest decode error!!"
- end
- Socket.OnRequestEnd("area.resourceDungeonHandler.resourceSitUnsafeRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, resourceSitUnsafeRequestEncoder, resourceSitUnsafeRequestDecoder)
- end
- local function resourceSitUnsafeObtainQiRequestEncoder(msg)
- local input = resourceDungeonHandler_pb.ResourceSitUnsafeObtainQiRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function resourceSitUnsafeObtainQiRequestDecoder(stream)
- local res = resourceDungeonHandler_pb.ResourceSitUnsafeObtainQiResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.ResourceDungeonHandler.resourceSitUnsafeObtainQiRequest(cb,option)
- local input = nil
- Socket.OnRequestStart("area.resourceDungeonHandler.resourceSitUnsafeObtainQiRequest", option)
- Socket.Request("area.resourceDungeonHandler.resourceSitUnsafeObtainQiRequest", input, function(res)
- if(res.s2c_code == 200) then
- Pomelo.ResourceDungeonHandler.lastResourceSitUnsafeObtainQiResponse = res
- Socket.OnRequestEnd("area.resourceDungeonHandler.resourceSitUnsafeObtainQiRequest", 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.resourceDungeonHandler.resourceSitUnsafeObtainQiRequest decode error!!"
- end
- Socket.OnRequestEnd("area.resourceDungeonHandler.resourceSitUnsafeObtainQiRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, resourceSitUnsafeObtainQiRequestEncoder, resourceSitUnsafeObtainQiRequestDecoder)
- end
- local function onResourceInfoPushDecoder(stream)
- local res = resourceDungeonHandler_pb.OnResourceInfoPush()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.ResourceDungeonHandler.onResourceInfoPush(cb)
- Socket.On("area.resourceDungeonPush.onResourceInfoPush", function(res)
- Pomelo.ResourceDungeonHandler.lastOnResourceInfoPush = res
- cb(nil,res)
- end, onResourceInfoPushDecoder)
- end
- local function onFishPushDecoder(stream)
- local res = resourceDungeonHandler_pb.OnFishPush()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.ResourceDungeonHandler.onFishPush(cb)
- Socket.On("area.resourceDungeonPush.onFishPush", function(res)
- Pomelo.ResourceDungeonHandler.lastOnFishPush = res
- cb(nil,res)
- end, onFishPushDecoder)
- end
- --------------------------------Pomelo-------------------------------
- return Pomelo
|