123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- -------------------------------------------------
- -- 本文件由代码生成器自动生成,
- -- 千万不要修改本文件的任何代码,
- -- 修改的的任何代码都会被覆盖掉!
- ----------------------------------------------------
- local Socket = require "Xmds.Pomelo.LuaGameSocket"
- require "base64"
- require "battleHandler_pb"
- --------------------------------Pomelo-------------------------------
- Pomelo = Pomelo or {}
- --------------------------------BattleHandler-------------------------------
- Pomelo.BattleHandler = {}
- local function throwPointRequestEncoder(msg)
- local input = battleHandler_pb.ThrowPointRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function throwPointRequestDecoder(stream)
- local res = battleHandler_pb.ThrowPointResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.BattleHandler.throwPointRequest(id,server_id,isQuit,type,count,cb,option)
- local msg = {}
- msg.id = id
- msg.server_id = server_id
- msg.isQuit = isQuit
- msg.type = type
- msg.count = count
- Socket.OnRequestStart("area.battleHandler.throwPointRequest", option)
- Socket.Request("area.battleHandler.throwPointRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.BattleHandler.lastThrowPointResponse = res
- Socket.OnRequestEnd("area.battleHandler.throwPointRequest", 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.battleHandler.throwPointRequest decode error!!"
- end
- Socket.OnRequestEnd("area.battleHandler.throwPointRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, throwPointRequestEncoder, throwPointRequestDecoder)
- end
- local function throwPointItemListPushDecoder(stream)
- local res = battleHandler_pb.ThrowPointItemListPush()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.BattleHandler.throwPointItemListPush(cb)
- Socket.On("area.battlePush.throwPointItemListPush", function(res)
- Pomelo.BattleHandler.lastThrowPointItemListPush = res
- cb(nil,res)
- end, throwPointItemListPushDecoder)
- end
- local function throwPointResultPushDecoder(stream)
- local res = battleHandler_pb.ThrowPointResultPush()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.BattleHandler.throwPointResultPush(cb)
- Socket.On("area.battlePush.throwPointResultPush", function(res)
- Pomelo.BattleHandler.lastThrowPointResultPush = res
- cb(nil,res)
- end, throwPointResultPushDecoder)
- end
- local function biddingInfoPushDecoder(stream)
- local res = battleHandler_pb.BiddingInfoPush()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.BattleHandler.biddingInfoPush(cb)
- Socket.On("area.battlePush.biddingInfoPush", function(res)
- Pomelo.BattleHandler.lastBiddingInfoPush = res
- cb(nil,res)
- end, biddingInfoPushDecoder)
- end
- local function fightLevelResultPushDecoder(stream)
- local res = battleHandler_pb.FightLevelResultPush()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.BattleHandler.fightLevelResultPush(cb)
- Socket.On("area.battlePush.fightLevelResultPush", function(res)
- Pomelo.BattleHandler.lastFightLevelResultPush = res
- cb(nil,res)
- end, fightLevelResultPushDecoder)
- end
- local function itemDropPushDecoder(stream)
- local res = battleHandler_pb.ItemDropPush()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.BattleHandler.itemDropPush(cb)
- Socket.On("area.battlePush.itemDropPush", function(res)
- Pomelo.BattleHandler.lastItemDropPush = res
- cb(nil,res)
- end, itemDropPushDecoder)
- end
- local function sceneNamePushDecoder(stream)
- local res = battleHandler_pb.SceneNamePush()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.BattleHandler.sceneNamePush(cb)
- Socket.On("area.battlePush.sceneNamePush", function(res)
- Pomelo.BattleHandler.lastSceneNamePush = res
- cb(nil,res)
- end, sceneNamePushDecoder)
- end
- local function resourceDungeonResultPushDecoder(stream)
- local res = battleHandler_pb.ResourceDungeonResultPush()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.BattleHandler.resourceDungeonResultPush(cb)
- Socket.On("area.battlePush.resourceDungeonResultPush", function(res)
- Pomelo.BattleHandler.lastResourceDungeonResultPush = res
- cb(nil,res)
- end, resourceDungeonResultPushDecoder)
- end
- --------------------------------Pomelo-------------------------------
- return Pomelo
|