------------------------------------------------- -- 本文件由代码生成器自动生成, -- 千万不要修改本文件的任何代码, -- 修改的的任何代码都会被覆盖掉! ---------------------------------------------------- local Socket = require "Xmds.Pomelo.LuaGameSocket" require "base64" require "robberyHandler_pb" --------------------------------Pomelo------------------------------- Pomelo = Pomelo or {} --------------------------------RobberyHandler------------------------------- Pomelo.RobberyHandler = {} local function upgradeClassRequestEncoder(msg) local input = robberyHandler_pb.UpgradeClassRequest() protobuf.FromMessage(input,msg) return (input:SerializeToString()) end local function upgradeClassRequestDecoder(stream) local res = robberyHandler_pb.UpgradeClassResponse() res:ParseFromString(stream) return res end function Pomelo.RobberyHandler.upgradeClassRequest(opType,cb,option) local msg = {} msg.opType = opType Socket.OnRequestStart("robbery.robberyHandler.upgradeClassRequest", option) Socket.Request("robbery.robberyHandler.upgradeClassRequest", msg, function(res) if(res.s2c_code == 200) then Pomelo.RobberyHandler.lastUpgradeClassResponse = res Socket.OnRequestEnd("robbery.robberyHandler.upgradeClassRequest", 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] robbery.robberyHandler.upgradeClassRequest decode error!!" end Socket.OnRequestEnd("robbery.robberyHandler.upgradeClassRequest", false,ex.Code,ex.Message) cb(ex,nil) end end, upgradeClassRequestEncoder, upgradeClassRequestDecoder) end local function robberyStartRequestEncoder(msg) local input = robberyHandler_pb.RobberyStartRequest() protobuf.FromMessage(input,msg) return (input:SerializeToString()) end local function robberyStartRequestDecoder(stream) local res = robberyHandler_pb.RobberyStartResponse() res:ParseFromString(stream) return res end function Pomelo.RobberyHandler.robberyStartRequest(items,cb,option) local msg = {} msg.items = items Socket.OnRequestStart("robbery.robberyHandler.robberyStartRequest", option) Socket.Request("robbery.robberyHandler.robberyStartRequest", msg, function(res) if(res.s2c_code == 200) then Pomelo.RobberyHandler.lastRobberyStartResponse = res Socket.OnRequestEnd("robbery.robberyHandler.robberyStartRequest", 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] robbery.robberyHandler.robberyStartRequest decode error!!" end Socket.OnRequestEnd("robbery.robberyHandler.robberyStartRequest", false,ex.Code,ex.Message) cb(ex,nil) end end, robberyStartRequestEncoder, robberyStartRequestDecoder) end local function robberyOverFollowUpRequestEncoder(msg) local input = robberyHandler_pb.RobberyOverFollowUpRequest() protobuf.FromMessage(input,msg) return (input:SerializeToString()) end local function robberyOverFollowUpRequestDecoder(stream) local res = robberyHandler_pb.RobberyOverFollowUpResponse() res:ParseFromString(stream) return res end function Pomelo.RobberyHandler.robberyOverFollowUpRequest(isWin,cb,option) local msg = {} msg.isWin = isWin Socket.OnRequestStart("robbery.robberyHandler.robberyOverFollowUpRequest", option) Socket.Request("robbery.robberyHandler.robberyOverFollowUpRequest", msg, function(res) if(res.s2c_code == 200) then Pomelo.RobberyHandler.lastRobberyOverFollowUpResponse = res Socket.OnRequestEnd("robbery.robberyHandler.robberyOverFollowUpRequest", 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] robbery.robberyHandler.robberyOverFollowUpRequest decode error!!" end Socket.OnRequestEnd("robbery.robberyHandler.robberyOverFollowUpRequest", false,ex.Code,ex.Message) cb(ex,nil) end end, robberyOverFollowUpRequestEncoder, robberyOverFollowUpRequestDecoder) end local function getRobberyDevilInfoRequestEncoder(msg) local input = robberyHandler_pb.GetRobberyDevilInfoRequest() protobuf.FromMessage(input,msg) return (input:SerializeToString()) end local function getRobberyDevilInfoRequestDecoder(stream) local res = robberyHandler_pb.GetRobberyDevilInfoResponse() res:ParseFromString(stream) return res end function Pomelo.RobberyHandler.getRobberyDevilInfoRequest(cb,option) local input = nil Socket.OnRequestStart("robbery.robberyHandler.getRobberyDevilInfoRequest", option) Socket.Request("robbery.robberyHandler.getRobberyDevilInfoRequest", input, function(res) if(res.s2c_code == 200) then Pomelo.RobberyHandler.lastGetRobberyDevilInfoResponse = res Socket.OnRequestEnd("robbery.robberyHandler.getRobberyDevilInfoRequest", 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] robbery.robberyHandler.getRobberyDevilInfoRequest decode error!!" end Socket.OnRequestEnd("robbery.robberyHandler.getRobberyDevilInfoRequest", false,ex.Code,ex.Message) cb(ex,nil) end end, getRobberyDevilInfoRequestEncoder, getRobberyDevilInfoRequestDecoder) end local function enterDevilAreaRequestEncoder(msg) local input = robberyHandler_pb.EnterDevilAreaRequest() protobuf.FromMessage(input,msg) return (input:SerializeToString()) end local function enterDevilAreaRequestDecoder(stream) local res = robberyHandler_pb.EnterDevilAreaResponse() res:ParseFromString(stream) return res end function Pomelo.RobberyHandler.enterDevilAreaRequest(playerid,cb,option) local msg = {} msg.playerid = playerid Socket.OnRequestStart("robbery.robberyHandler.enterDevilAreaRequest", option) Socket.Request("robbery.robberyHandler.enterDevilAreaRequest", msg, function(res) if(res.s2c_code == 200) then Pomelo.RobberyHandler.lastEnterDevilAreaResponse = res Socket.OnRequestEnd("robbery.robberyHandler.enterDevilAreaRequest", 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] robbery.robberyHandler.enterDevilAreaRequest decode error!!" end Socket.OnRequestEnd("robbery.robberyHandler.enterDevilAreaRequest", false,ex.Code,ex.Message) cb(ex,nil) end end, enterDevilAreaRequestEncoder, enterDevilAreaRequestDecoder) end local function robberyPushDecoder(stream) local res = robberyHandler_pb.RobberyPush() res:ParseFromString(stream) return res end function Pomelo.RobberyHandler.robberyPush(cb) Socket.On("robbery.robberyPush.robberyPush", function(res) Pomelo.RobberyHandler.lastRobberyPush = res cb(nil,res) end, robberyPushDecoder) end local function robberyDevilOverPushDecoder(stream) local res = robberyHandler_pb.RobberyDevilOverPush() res:ParseFromString(stream) return res end function Pomelo.RobberyHandler.robberyDevilOverPush(cb) Socket.On("robbery.robberyPush.robberyDevilOverPush", function(res) Pomelo.RobberyHandler.lastRobberyDevilOverPush = res cb(nil,res) end, robberyDevilOverPushDecoder) end local function getRobberyDevilBuffPushDecoder(stream) local res = robberyHandler_pb.GetRobberyDevilBuffPush() res:ParseFromString(stream) return res end function Pomelo.RobberyHandler.getRobberyDevilBuffPush(cb) Socket.On("robbery.robberyPush.getRobberyDevilBuffPush", function(res) Pomelo.RobberyHandler.lastGetRobberyDevilBuffPush = res cb(nil,res) end, getRobberyDevilBuffPushDecoder) end local function robberyEndPushDecoder(stream) local res = robberyHandler_pb.RobberyEndPush() res:ParseFromString(stream) return res end function Pomelo.RobberyHandler.robberyEndPush(cb) Socket.On("robbery.robberyPush.robberyEndPush", function(res) Pomelo.RobberyHandler.lastRobberyEndPush = res cb(nil,res) end, robberyEndPushDecoder) end --------------------------------Pomelo------------------------------- return Pomelo