1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- -------------------------------------------------
- -- 本文件由代码生成器自动生成,
- -- 千万不要修改本文件的任何代码,
- -- 修改的的任何代码都会被覆盖掉!
- ----------------------------------------------------
- local Socket = require "Xmds.Pomelo.LuaGameSocket"
- require "base64"
- require "upLevelHandler_pb"
- --------------------------------Pomelo-------------------------------
- Pomelo = Pomelo or {}
- --------------------------------UpLevelHandler-------------------------------
- Pomelo.UpLevelHandler = {}
- local function upInfoRequestEncoder(msg)
- local input = upLevelHandler_pb.UpInfoRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function upInfoRequestDecoder(stream)
- local res = upLevelHandler_pb.UpInfoResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.UpLevelHandler.upInfoRequest(cb,option)
- local input = nil
- Socket.OnRequestStart("area.upLevelHandler.upInfoRequest", option)
- Socket.Request("area.upLevelHandler.upInfoRequest", input, function(res)
- if(res.s2c_code == 200) then
- Pomelo.UpLevelHandler.lastUpInfoResponse = res
- Socket.OnRequestEnd("area.upLevelHandler.upInfoRequest", 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.upLevelHandler.upInfoRequest decode error!!"
- end
- Socket.OnRequestEnd("area.upLevelHandler.upInfoRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, upInfoRequestEncoder, upInfoRequestDecoder)
- end
- local function upLevelRequestEncoder(msg)
- local input = upLevelHandler_pb.UpLevelRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function upLevelRequestDecoder(stream)
- local res = upLevelHandler_pb.UpLevelResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.UpLevelHandler.upLevelRequest(cb,option)
- local input = nil
- Socket.OnRequestStart("area.upLevelHandler.upLevelRequest", option)
- Socket.Request("area.upLevelHandler.upLevelRequest", input, function(res)
- if(res.s2c_code == 200) then
- Pomelo.UpLevelHandler.lastUpLevelResponse = res
- Socket.OnRequestEnd("area.upLevelHandler.upLevelRequest", 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.upLevelHandler.upLevelRequest decode error!!"
- end
- Socket.OnRequestEnd("area.upLevelHandler.upLevelRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, upLevelRequestEncoder, upLevelRequestDecoder)
- end
- --------------------------------Pomelo-------------------------------
- return Pomelo
|