------------------------------------------------- -- 本文件由代码生成器自动生成, -- 千万不要修改本文件的任何代码, -- 修改的的任何代码都会被覆盖掉! ---------------------------------------------------- local Socket = require "Xmds.Pomelo.LuaGameSocket" require "base64" require "followerHandler_pb" --------------------------------Pomelo------------------------------- Pomelo = Pomelo or {} --------------------------------FollowerHandler------------------------------- Pomelo.FollowerHandler = {} local function getFollowerInfoRequestEncoder(msg) local input = followerHandler_pb.GetFollowerInfoRequest() protobuf.FromMessage(input,msg) return (input:SerializeToString()) end local function getFollowerInfoRequestDecoder(stream) local res = followerHandler_pb.GetFollowerInfoResponse() res:ParseFromString(stream) return res end function Pomelo.FollowerHandler.getFollowerInfoRequest(cb,option) local input = nil Socket.OnRequestStart("follower.followerHandler.getFollowerInfoRequest", option) Socket.Request("follower.followerHandler.getFollowerInfoRequest", input, function(res) if(res.s2c_code == 200) then Pomelo.FollowerHandler.lastGetFollowerInfoResponse = res Socket.OnRequestEnd("follower.followerHandler.getFollowerInfoRequest", 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] follower.followerHandler.getFollowerInfoRequest decode error!!" end Socket.OnRequestEnd("follower.followerHandler.getFollowerInfoRequest", false,ex.Code,ex.Message) cb(ex,nil) end end, getFollowerInfoRequestEncoder, getFollowerInfoRequestDecoder) end local function getBattleArrayRequestEncoder(msg) local input = followerHandler_pb.GetBattleArrayRequest() protobuf.FromMessage(input,msg) return (input:SerializeToString()) end local function getBattleArrayRequestDecoder(stream) local res = followerHandler_pb.GetBattleArrayResponse() res:ParseFromString(stream) return res end function Pomelo.FollowerHandler.getBattleArrayRequest(cb,option) local input = nil Socket.OnRequestStart("follower.followerHandler.getBattleArrayRequest", option) Socket.Request("follower.followerHandler.getBattleArrayRequest", input, function(res) if(res.s2c_code == 200) then Pomelo.FollowerHandler.lastGetBattleArrayResponse = res Socket.OnRequestEnd("follower.followerHandler.getBattleArrayRequest", 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] follower.followerHandler.getBattleArrayRequest decode error!!" end Socket.OnRequestEnd("follower.followerHandler.getBattleArrayRequest", false,ex.Code,ex.Message) cb(ex,nil) end end, getBattleArrayRequestEncoder, getBattleArrayRequestDecoder) end local function optionFollowerRequestEncoder(msg) local input = followerHandler_pb.OptionFollowerRequest() protobuf.FromMessage(input,msg) return (input:SerializeToString()) end local function optionFollowerRequestDecoder(stream) local res = followerHandler_pb.OptionFollowerResponse() res:ParseFromString(stream) return res end function Pomelo.FollowerHandler.optionFollowerRequest(optionType,id,itemCode,itemCount,removeIds,followerName,followerSkin,arrayId,followerSkillId,cb,option) local msg = {} msg.optionType = optionType msg.id = id msg.itemCode = itemCode msg.itemCount = itemCount msg.removeIds = removeIds msg.followerName = followerName msg.followerSkin = followerSkin msg.arrayId = arrayId msg.followerSkillId = followerSkillId Socket.OnRequestStart("follower.followerHandler.optionFollowerRequest", option) Socket.Request("follower.followerHandler.optionFollowerRequest", msg, function(res) if(res.s2c_code == 200) then Pomelo.FollowerHandler.lastOptionFollowerResponse = res Socket.OnRequestEnd("follower.followerHandler.optionFollowerRequest", 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] follower.followerHandler.optionFollowerRequest decode error!!" end Socket.OnRequestEnd("follower.followerHandler.optionFollowerRequest", false,ex.Code,ex.Message) cb(ex,nil) end end, optionFollowerRequestEncoder, optionFollowerRequestDecoder) end local function optionBattleArrayPointRequestEncoder(msg) local input = followerHandler_pb.OptionBattleArrayPointRequest() protobuf.FromMessage(input,msg) return (input:SerializeToString()) end local function optionBattleArrayPointRequestDecoder(stream) local res = followerHandler_pb.OptionBattleArrayPointResponse() res:ParseFromString(stream) return res end function Pomelo.FollowerHandler.optionBattleArrayPointRequest(optionType,pos,id,cb,option) local msg = {} msg.optionType = optionType msg.pos = pos msg.id = id Socket.OnRequestStart("follower.followerHandler.optionBattleArrayPointRequest", option) Socket.Request("follower.followerHandler.optionBattleArrayPointRequest", msg, function(res) if(res.s2c_code == 200) then Pomelo.FollowerHandler.lastOptionBattleArrayPointResponse = res Socket.OnRequestEnd("follower.followerHandler.optionBattleArrayPointRequest", 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] follower.followerHandler.optionBattleArrayPointRequest decode error!!" end Socket.OnRequestEnd("follower.followerHandler.optionBattleArrayPointRequest", false,ex.Code,ex.Message) cb(ex,nil) end end, optionBattleArrayPointRequestEncoder, optionBattleArrayPointRequestDecoder) end local function getGourdInfoRequestEncoder(msg) local input = followerHandler_pb.GetGourdInfoRequest() protobuf.FromMessage(input,msg) return (input:SerializeToString()) end local function getGourdInfoRequestDecoder(stream) local res = followerHandler_pb.GetGourdInfoResponse() res:ParseFromString(stream) return res end function Pomelo.FollowerHandler.getGourdInfoRequest(cb,option) local input = nil Socket.OnRequestStart("follower.followerHandler.getGourdInfoRequest", option) Socket.Request("follower.followerHandler.getGourdInfoRequest", input, function(res) if(res.s2c_code == 200) then Pomelo.FollowerHandler.lastGetGourdInfoResponse = res Socket.OnRequestEnd("follower.followerHandler.getGourdInfoRequest", 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] follower.followerHandler.getGourdInfoRequest decode error!!" end Socket.OnRequestEnd("follower.followerHandler.getGourdInfoRequest", false,ex.Code,ex.Message) cb(ex,nil) end end, getGourdInfoRequestEncoder, getGourdInfoRequestDecoder) end local function wateringRequestEncoder(msg) local input = followerHandler_pb.WateringRequest() protobuf.FromMessage(input,msg) return (input:SerializeToString()) end local function wateringRequestDecoder(stream) local res = followerHandler_pb.WateringResponse() res:ParseFromString(stream) return res end function Pomelo.FollowerHandler.wateringRequest(wateringType,cb,option) local msg = {} msg.wateringType = wateringType Socket.OnRequestStart("follower.followerHandler.wateringRequest", option) Socket.Request("follower.followerHandler.wateringRequest", msg, function(res) if(res.s2c_code == 200) then Pomelo.FollowerHandler.lastWateringResponse = res Socket.OnRequestEnd("follower.followerHandler.wateringRequest", 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] follower.followerHandler.wateringRequest decode error!!" end Socket.OnRequestEnd("follower.followerHandler.wateringRequest", false,ex.Code,ex.Message) cb(ex,nil) end end, wateringRequestEncoder, wateringRequestDecoder) end local function pikupGourdRequestEncoder(msg) local input = followerHandler_pb.PikupGourdRequest() protobuf.FromMessage(input,msg) return (input:SerializeToString()) end local function pikupGourdRequestDecoder(stream) local res = followerHandler_pb.PikupGourdResponse() res:ParseFromString(stream) return res end function Pomelo.FollowerHandler.pikupGourdRequest(pos,cb,option) local msg = {} msg.pos = pos Socket.OnRequestStart("follower.followerHandler.pikupGourdRequest", option) Socket.Request("follower.followerHandler.pikupGourdRequest", msg, function(res) if(res.s2c_code == 200) then Pomelo.FollowerHandler.lastPikupGourdResponse = res Socket.OnRequestEnd("follower.followerHandler.pikupGourdRequest", 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] follower.followerHandler.pikupGourdRequest decode error!!" end Socket.OnRequestEnd("follower.followerHandler.pikupGourdRequest", false,ex.Code,ex.Message) cb(ex,nil) end end, pikupGourdRequestEncoder, pikupGourdRequestDecoder) end local function sexualRequestEncoder(msg) local input = followerHandler_pb.SexualRequest() protobuf.FromMessage(input,msg) return (input:SerializeToString()) end local function sexualRequestDecoder(stream) local res = followerHandler_pb.SexualResponse() res:ParseFromString(stream) return res end function Pomelo.FollowerHandler.sexualRequest(cb,option) local input = nil Socket.OnRequestStart("follower.followerHandler.sexualRequest", option) Socket.Request("follower.followerHandler.sexualRequest", input, function(res) if(res.s2c_code == 200) then Pomelo.FollowerHandler.lastSexualResponse = res Socket.OnRequestEnd("follower.followerHandler.sexualRequest", 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] follower.followerHandler.sexualRequest decode error!!" end Socket.OnRequestEnd("follower.followerHandler.sexualRequest", false,ex.Code,ex.Message) cb(ex,nil) end end, sexualRequestEncoder, sexualRequestDecoder) end local function buyFollowerGridRequestEncoder(msg) local input = followerHandler_pb.BuyFollowerGridRequest() protobuf.FromMessage(input,msg) return (input:SerializeToString()) end local function buyFollowerGridRequestDecoder(stream) local res = followerHandler_pb.BuyFollowerGridResponse() res:ParseFromString(stream) return res end function Pomelo.FollowerHandler.buyFollowerGridRequest(cb,option) local input = nil Socket.OnRequestStart("follower.followerHandler.buyFollowerGridRequest", option) Socket.Request("follower.followerHandler.buyFollowerGridRequest", input, function(res) if(res.s2c_code == 200) then Pomelo.FollowerHandler.lastBuyFollowerGridResponse = res Socket.OnRequestEnd("follower.followerHandler.buyFollowerGridRequest", 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] follower.followerHandler.buyFollowerGridRequest decode error!!" end Socket.OnRequestEnd("follower.followerHandler.buyFollowerGridRequest", false,ex.Code,ex.Message) cb(ex,nil) end end, buyFollowerGridRequestEncoder, buyFollowerGridRequestDecoder) end local function sexualConfirmApplyRequestEncoder(msg) local input = followerHandler_pb.SexualConfirmApplyRequest() protobuf.FromMessage(input,msg) return (input:SerializeToString()) end local function sexualConfirmApplyRequestDecoder(stream) local res = followerHandler_pb.SexualConfirmApplyResponse() res:ParseFromString(stream) return res end function Pomelo.FollowerHandler.sexualConfirmApplyRequest(isAgree,cb,option) local msg = {} msg.isAgree = isAgree Socket.OnRequestStart("follower.followerHandler.sexualConfirmApplyRequest", option) Socket.Request("follower.followerHandler.sexualConfirmApplyRequest", msg, function(res) if(res.s2c_code == 200) then Pomelo.FollowerHandler.lastSexualConfirmApplyResponse = res Socket.OnRequestEnd("follower.followerHandler.sexualConfirmApplyRequest", 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] follower.followerHandler.sexualConfirmApplyRequest decode error!!" end Socket.OnRequestEnd("follower.followerHandler.sexualConfirmApplyRequest", false,ex.Code,ex.Message) cb(ex,nil) end end, sexualConfirmApplyRequestEncoder, sexualConfirmApplyRequestDecoder) end local function receiveSexualFollowerRequestEncoder(msg) local input = followerHandler_pb.ReceiveSexualFollowerRequest() protobuf.FromMessage(input,msg) return (input:SerializeToString()) end local function receiveSexualFollowerRequestDecoder(stream) local res = followerHandler_pb.ReceiveSexualFollowerResponse() res:ParseFromString(stream) return res end function Pomelo.FollowerHandler.receiveSexualFollowerRequest(cb,option) local input = nil Socket.OnRequestStart("follower.followerHandler.receiveSexualFollowerRequest", option) Socket.Request("follower.followerHandler.receiveSexualFollowerRequest", input, function(res) if(res.s2c_code == 200) then Pomelo.FollowerHandler.lastReceiveSexualFollowerResponse = res Socket.OnRequestEnd("follower.followerHandler.receiveSexualFollowerRequest", 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] follower.followerHandler.receiveSexualFollowerRequest decode error!!" end Socket.OnRequestEnd("follower.followerHandler.receiveSexualFollowerRequest", false,ex.Code,ex.Message) cb(ex,nil) end end, receiveSexualFollowerRequestEncoder, receiveSexualFollowerRequestDecoder) end local function updateBattleArrayPushDecoder(stream) local res = followerHandler_pb.UpdateBattleArrayPush() res:ParseFromString(stream) return res end function Pomelo.FollowerHandler.updateBattleArrayPush(cb) Socket.On("follower.followerPush.updateBattleArrayPush", function(res) Pomelo.FollowerHandler.lastUpdateBattleArrayPush = res cb(nil,res) end, updateBattleArrayPushDecoder) end local function confirmPushDecoder(stream) local res = followerHandler_pb.ConfirmPush() res:ParseFromString(stream) return res end function Pomelo.FollowerHandler.confirmPush(cb) Socket.On("follower.followerPush.confirmPush", function(res) Pomelo.FollowerHandler.lastConfirmPush = res cb(nil,res) end, confirmPushDecoder) end local function deletFollowerPushDecoder(stream) local res = followerHandler_pb.DeletFollowerPush() res:ParseFromString(stream) return res end function Pomelo.FollowerHandler.deletFollowerPush(cb) Socket.On("follower.followerPush.deletFollowerPush", function(res) Pomelo.FollowerHandler.lastDeletFollowerPush = res cb(nil,res) end, deletFollowerPushDecoder) end local function addFollowerPushDecoder(stream) local res = followerHandler_pb.AddFollowerPush() res:ParseFromString(stream) return res end function Pomelo.FollowerHandler.addFollowerPush(cb) Socket.On("follower.followerPush.addFollowerPush", function(res) Pomelo.FollowerHandler.lastAddFollowerPush = res cb(nil,res) end, addFollowerPushDecoder) end local function choosePushDecoder(stream) local res = followerHandler_pb.ChoosePush() res:ParseFromString(stream) return res end function Pomelo.FollowerHandler.choosePush(cb) Socket.On("follower.followerPush.choosePush", function(res) Pomelo.FollowerHandler.lastChoosePush = res cb(nil,res) end, choosePushDecoder) end --------------------------------Pomelo------------------------------- return Pomelo