local redis_cfg = loadfile("../../commonlualib/common/etc/redis_cfg.lua")() local server_cfg = loadfile("../../commonlualib/common/etc/server_cfg.lua")() local gate_cfg = loadfile("../../commonlualib/common/etc/gate_cfg.lua")() local frpc_server_cfg = loadfile("../../commonlualib/common/etc/frpc_server_cfg.lua")() local mysql_cfg = loadfile("../../commonlualib/common/etc/mysql_cfg.lua")()
--请求匹配 functionM.do_match_game(player_id, pack_body) --log.info("do_match_game >>> ",player_id, pack_body) local game_id = pack_body.game_id local game_server = GAME_ID_ENUM[game_id] ifnot game_server then log.error("do_match_game not exists gameid ", game_id) returnnil, errorcode.GAME_NOT_EXISTS, "GAME_NOT_EXISTS" end
local game_room_info = game_redis.get_game_room_info(player_id) if game_room_info andnext(game_room_info) then log.error("exists game_room_info ",player_id, game_room_info) return end
--log.info("do_match_game2 >>> ",player_id, pack_body) ifnot rpc_matchserver_match.match(game_server, player_id) then returnnil end --log.info("do_match_game3 >>> ",player_id, pack_body) --回复匹配 match_msg:match_game_res(player_id, {game_id = game_id})
localfunctioncheck_join_room_game(player_id) local game_room_info = game_redis.get_game_room_info(player_id) ifnot game_room_info ornotnext(game_room_info) then return end local cli = frpc_client:instance(game_room_info.svr_name, "room_game_alloc_m") cli:set_svr_id(game_room_info.svr_id) local ret = cli:one_mod_call("exists", game_room_info.table_id) if #ret.result > 0and ret.result[1] then M.cmd_join_game(player_id, game_room_info.token, game_room_info.host, game_room_info.table_id) else --说明房间已经不存在了 --删除房间信息 game_redis.del_game_room_info(player_id) end end