123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- -------------------------------------------------
- -- 本文件由代码生成器自动生成,
- -- 千万不要修改本文件的任何代码,
- -- 修改的的任何代码都会被覆盖掉!
- ----------------------------------------------------
- local Socket = require "Xmds.Pomelo.LuaGameSocket"
- require "base64"
- require "demonTowerHandler_pb"
- --------------------------------Pomelo-------------------------------
- Pomelo = Pomelo or {}
- --------------------------------DemonTowerHandler-------------------------------
- Pomelo.DemonTowerHandler = {}
- local function getDemonTowerInfoRequestEncoder(msg)
- local input = demonTowerHandler_pb.GetDemonTowerInfoRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function getDemonTowerInfoRequestDecoder(stream)
- local res = demonTowerHandler_pb.GetDemonTowerInfoResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.DemonTowerHandler.getDemonTowerInfoRequest(floorId,cb,option)
- local msg = {}
- msg.floorId = floorId
- Socket.OnRequestStart("area.demonTowerHandler.getDemonTowerInfoRequest", option)
- Socket.Request("area.demonTowerHandler.getDemonTowerInfoRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.DemonTowerHandler.lastGetDemonTowerInfoResponse = res
- Socket.OnRequestEnd("area.demonTowerHandler.getDemonTowerInfoRequest", 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.demonTowerHandler.getDemonTowerInfoRequest decode error!!"
- end
- Socket.OnRequestEnd("area.demonTowerHandler.getDemonTowerInfoRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, getDemonTowerInfoRequestEncoder, getDemonTowerInfoRequestDecoder)
- end
- local function getDemonTowerSweepInfoRequestEncoder(msg)
- local input = demonTowerHandler_pb.GetDemonTowerSweepInfoRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function getDemonTowerSweepInfoRequestDecoder(stream)
- local res = demonTowerHandler_pb.GetDemonTowerSweepInfoResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.DemonTowerHandler.getDemonTowerSweepInfoRequest(cb,option)
- local input = nil
- Socket.OnRequestStart("area.demonTowerHandler.getDemonTowerSweepInfoRequest", option)
- Socket.Request("area.demonTowerHandler.getDemonTowerSweepInfoRequest", input, function(res)
- if(res.s2c_code == 200) then
- Pomelo.DemonTowerHandler.lastGetDemonTowerSweepInfoResponse = res
- Socket.OnRequestEnd("area.demonTowerHandler.getDemonTowerSweepInfoRequest", 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.demonTowerHandler.getDemonTowerSweepInfoRequest decode error!!"
- end
- Socket.OnRequestEnd("area.demonTowerHandler.getDemonTowerSweepInfoRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, getDemonTowerSweepInfoRequestEncoder, getDemonTowerSweepInfoRequestDecoder)
- end
- local function startToSweepDemonTowerRequestEncoder(msg)
- local input = demonTowerHandler_pb.StartToSweepDemonTowerRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function startToSweepDemonTowerRequestDecoder(stream)
- local res = demonTowerHandler_pb.StartToSweepDemonTowerResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.DemonTowerHandler.startToSweepDemonTowerRequest(cb,option)
- local input = nil
- Socket.OnRequestStart("area.demonTowerHandler.startToSweepDemonTowerRequest", option)
- Socket.Request("area.demonTowerHandler.startToSweepDemonTowerRequest", input, function(res)
- if(res.s2c_code == 200) then
- Pomelo.DemonTowerHandler.lastStartToSweepDemonTowerResponse = res
- Socket.OnRequestEnd("area.demonTowerHandler.startToSweepDemonTowerRequest", 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.demonTowerHandler.startToSweepDemonTowerRequest decode error!!"
- end
- Socket.OnRequestEnd("area.demonTowerHandler.startToSweepDemonTowerRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, startToSweepDemonTowerRequestEncoder, startToSweepDemonTowerRequestDecoder)
- end
- local function startDemonTowerRequestEncoder(msg)
- local input = demonTowerHandler_pb.StartDemonTowerRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function startDemonTowerRequestDecoder(stream)
- local res = demonTowerHandler_pb.StartDemonTowerResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.DemonTowerHandler.startDemonTowerRequest(floorId,cb,option)
- local msg = {}
- msg.floorId = floorId
- Socket.OnRequestStart("area.demonTowerHandler.startDemonTowerRequest", option)
- Socket.Request("area.demonTowerHandler.startDemonTowerRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.DemonTowerHandler.lastStartDemonTowerResponse = res
- Socket.OnRequestEnd("area.demonTowerHandler.startDemonTowerRequest", 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.demonTowerHandler.startDemonTowerRequest decode error!!"
- end
- Socket.OnRequestEnd("area.demonTowerHandler.startDemonTowerRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, startDemonTowerRequestEncoder, startDemonTowerRequestDecoder)
- end
- local function finishSweepDemonTowerRequestEncoder(msg)
- local input = demonTowerHandler_pb.FinishSweepDemonTowerRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function finishSweepDemonTowerRequestDecoder(stream)
- local res = demonTowerHandler_pb.FinishSweepDemonTowerResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.DemonTowerHandler.finishSweepDemonTowerRequest(cb,option)
- local input = nil
- Socket.OnRequestStart("area.demonTowerHandler.finishSweepDemonTowerRequest", option)
- Socket.Request("area.demonTowerHandler.finishSweepDemonTowerRequest", input, function(res)
- if(res.s2c_code == 200) then
- Pomelo.DemonTowerHandler.lastFinishSweepDemonTowerResponse = res
- Socket.OnRequestEnd("area.demonTowerHandler.finishSweepDemonTowerRequest", 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.demonTowerHandler.finishSweepDemonTowerRequest decode error!!"
- end
- Socket.OnRequestEnd("area.demonTowerHandler.finishSweepDemonTowerRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, finishSweepDemonTowerRequestEncoder, finishSweepDemonTowerRequestDecoder)
- end
- local function sweepDemonTowerEndPushDecoder(stream)
- local res = demonTowerHandler_pb.SweepDemonTowerEndPush()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.DemonTowerHandler.sweepDemonTowerEndPush(cb)
- Socket.On("area.demonTowerPush.sweepDemonTowerEndPush", function(res)
- Pomelo.DemonTowerHandler.lastSweepDemonTowerEndPush = res
- cb(nil,res)
- end, sweepDemonTowerEndPushDecoder)
- end
- --------------------------------Pomelo-------------------------------
- return Pomelo
|