This commit is contained in:
aozhiwei 2023-07-20 14:05:56 +08:00
parent 973984bb7b
commit b3f59573ee
3 changed files with 14 additions and 2 deletions

View File

@ -285,7 +285,7 @@ namespace mt
return 0;
}
std::tuple<int, int, int, int>* Param::GetRankModeConf(int elo)
const RankMatchConf* Param::GetRankModeConf(int elo)
{
return nullptr;
}

View File

@ -5,6 +5,14 @@
namespace mt
{
struct RankMatchConf
{
RoomType_e room_type = RoomType_Rank1;
int min_elo = 0;
int max_elo = 0;
int hero_min_lv = 0;
int hero_max_lv = 0;
};
DECLARE_NAME_TABLE(Param, mtb::Parameter,
"parameter@parameter.json",
@ -134,7 +142,7 @@ namespace mt
static double GetFloatParam(const std::string& param_name, double def_val = 0.0f);
static std::string GetStringParam(const std::string& param_name, const char* def_val = "");
static int GetStarNum(int rank);
static std::tuple<int, int, int, int>* GetRankModeConf(int elo);
static const RankMatchConf* GetRankModeConf(int elo);
private:
static S s_;

View File

@ -40,6 +40,10 @@ static RoomType_e GetHumanRoomType(const std::shared_ptr<BattleDataContext> netd
{
if (netdata->join_msg->room_mode() == kPvpRankMode) {
auto rank_mode_conf = mt::Param::GetRankModeConf(netdata->GetElo());
if (!rank_mode_conf) {
abort();
}
return rank_mode_conf->room_type;
} else {
if (netdata->GetBattleTimes() < mt::Param::s().newbie_room_battle_times) {
return RoomType_OldBrid1;