123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288 |
- -------------------------------------------------
- -- 本文件由代码生成器自动生成,
- -- 千万不要修改本文件的任何代码,
- -- 修改的的任何代码都会被覆盖掉!
- ----------------------------------------------------
- local Socket = require "Xmds.Pomelo.LuaGameSocket"
- require "base64"
- require "mapHandler_pb"
- --------------------------------Pomelo-------------------------------
- Pomelo = Pomelo or {}
- --------------------------------MapHandler-------------------------------
- Pomelo.MapHandler = {}
- local function genterSceneByAreaIdRequestEncoder(msg)
- local input = mapHandler_pb.GnterSceneByAreaIdRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function genterSceneByAreaIdRequestDecoder(stream)
- local res = mapHandler_pb.GnterSceneByAreaIdResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.MapHandler.genterSceneByAreaIdRequest(c2s_areaId,cb,option)
- local msg = {}
- msg.c2s_areaId = c2s_areaId
- Socket.OnRequestStart("area.mapHandler.genterSceneByAreaIdRequest", option)
- Socket.Request("area.mapHandler.genterSceneByAreaIdRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.MapHandler.lastGnterSceneByAreaIdResponse = res
- Socket.OnRequestEnd("area.mapHandler.genterSceneByAreaIdRequest", 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.mapHandler.genterSceneByAreaIdRequest decode error!!"
- end
- Socket.OnRequestEnd("area.mapHandler.genterSceneByAreaIdRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, genterSceneByAreaIdRequestEncoder, genterSceneByAreaIdRequestDecoder)
- end
- local function getWorldMapListRequestEncoder(msg)
- local input = mapHandler_pb.GetWorldMapListRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function getWorldMapListRequestDecoder(stream)
- local res = mapHandler_pb.GetWorldMapListResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.MapHandler.getWorldMapListRequest(cb,option)
- local input = nil
- Socket.OnRequestStart("area.mapHandler.getWorldMapListRequest", option)
- Socket.Request("area.mapHandler.getWorldMapListRequest", input, function(res)
- if(res.s2c_code == 200) then
- Pomelo.MapHandler.lastGetWorldMapListResponse = res
- Socket.OnRequestEnd("area.mapHandler.getWorldMapListRequest", 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.mapHandler.getWorldMapListRequest decode error!!"
- end
- Socket.OnRequestEnd("area.mapHandler.getWorldMapListRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, getWorldMapListRequestEncoder, getWorldMapListRequestDecoder)
- end
- local function getPlayerListRequestEncoder(msg)
- local input = mapHandler_pb.GetPlayerListRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function getPlayerListRequestDecoder(stream)
- local res = mapHandler_pb.GetPlayerListResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.MapHandler.getPlayerListRequest(cb,option)
- local input = nil
- Socket.OnRequestStart("area.mapHandler.getPlayerListRequest", option)
- Socket.Request("area.mapHandler.getPlayerListRequest", input, function(res)
- if(res.s2c_code == 200) then
- Pomelo.MapHandler.lastGetPlayerListResponse = res
- Socket.OnRequestEnd("area.mapHandler.getPlayerListRequest", 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.mapHandler.getPlayerListRequest decode error!!"
- end
- Socket.OnRequestEnd("area.mapHandler.getPlayerListRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, getPlayerListRequestEncoder, getPlayerListRequestDecoder)
- end
- local function getMonsterListRequestEncoder(msg)
- local input = mapHandler_pb.GetMonsterListRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function getMonsterListRequestDecoder(stream)
- local res = mapHandler_pb.GetMonsterListResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.MapHandler.getMonsterListRequest(cb,option)
- local input = nil
- Socket.OnRequestStart("area.mapHandler.getMonsterListRequest", option)
- Socket.Request("area.mapHandler.getMonsterListRequest", input, function(res)
- if(res.s2c_code == 200) then
- Pomelo.MapHandler.lastGetMonsterListResponse = res
- Socket.OnRequestEnd("area.mapHandler.getMonsterListRequest", 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.mapHandler.getMonsterListRequest decode error!!"
- end
- Socket.OnRequestEnd("area.mapHandler.getMonsterListRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, getMonsterListRequestEncoder, getMonsterListRequestDecoder)
- end
- local function getNpcListRequestEncoder(msg)
- local input = mapHandler_pb.GetNpcListRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function getNpcListRequestDecoder(stream)
- local res = mapHandler_pb.GetNpcListResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.MapHandler.getNpcListRequest(cb,option)
- local input = nil
- Socket.OnRequestStart("area.mapHandler.getNpcListRequest", option)
- Socket.Request("area.mapHandler.getNpcListRequest", input, function(res)
- if(res.s2c_code == 200) then
- Pomelo.MapHandler.lastGetNpcListResponse = res
- Socket.OnRequestEnd("area.mapHandler.getNpcListRequest", 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.mapHandler.getNpcListRequest decode error!!"
- end
- Socket.OnRequestEnd("area.mapHandler.getNpcListRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, getNpcListRequestEncoder, getNpcListRequestDecoder)
- end
- local function getMapListRequestEncoder(msg)
- local input = mapHandler_pb.GetMapListRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function getMapListRequestDecoder(stream)
- local res = mapHandler_pb.GetMapListResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.MapHandler.getMapListRequest(c2s_mapId,cb,option)
- local msg = {}
- msg.c2s_mapId = c2s_mapId
- Socket.OnRequestStart("area.mapHandler.getMapListRequest", option)
- Socket.Request("area.mapHandler.getMapListRequest", msg, function(res)
- if(res.s2c_code == 200) then
- Pomelo.MapHandler.lastGetMapListResponse = res
- Socket.OnRequestEnd("area.mapHandler.getMapListRequest", 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.mapHandler.getMapListRequest decode error!!"
- end
- Socket.OnRequestEnd("area.mapHandler.getMapListRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, getMapListRequestEncoder, getMapListRequestDecoder)
- end
- local function getAliveMonsterLineInfoRequestEncoder(msg)
- local input = mapHandler_pb.GetAliveMonsterLineInfoRequest()
- protobuf.FromMessage(input,msg)
- return (input:SerializeToString())
- end
- local function getAliveMonsterLineInfoRequestDecoder(stream)
- local res = mapHandler_pb.GetAliveMonsterLineInfoResponse()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.MapHandler.getAliveMonsterLineInfoRequest(cb,option)
- local input = nil
- Socket.OnRequestStart("area.mapHandler.getAliveMonsterLineInfoRequest", option)
- Socket.Request("area.mapHandler.getAliveMonsterLineInfoRequest", input, function(res)
- if(res.s2c_code == 200) then
- Pomelo.MapHandler.lastGetAliveMonsterLineInfoResponse = res
- Socket.OnRequestEnd("area.mapHandler.getAliveMonsterLineInfoRequest", 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.mapHandler.getAliveMonsterLineInfoRequest decode error!!"
- end
- Socket.OnRequestEnd("area.mapHandler.getAliveMonsterLineInfoRequest", false,ex.Code,ex.Message)
- cb(ex,nil)
- end
- end, getAliveMonsterLineInfoRequestEncoder, getAliveMonsterLineInfoRequestDecoder)
- end
- local function mapOpenInfoPushDecoder(stream)
- local res = mapHandler_pb.MapOpenInfoPush()
- res:ParseFromString(stream)
- return res
- end
- function Pomelo.MapHandler.mapOpenInfoPush(cb)
- Socket.On("area.mapPush.mapOpenInfoPush", function(res)
- Pomelo.MapHandler.lastMapOpenInfoPush = res
- cb(nil,res)
- end, mapOpenInfoPushDecoder)
- end
- --------------------------------Pomelo-------------------------------
- return Pomelo
|