1
This commit is contained in:
commit
c7840d9071
@ -76,6 +76,22 @@ namespace mt
|
||||
s_.crit_effect_range.push_back(a8::XValue(str).GetDouble());
|
||||
}
|
||||
}
|
||||
{
|
||||
std::string tmp_str = GetStringParam("performance_score_weight_4V4", "");
|
||||
std::vector<std::string> strings;
|
||||
a8::Split(tmp_str, strings, '|');
|
||||
for (auto& str : strings) {
|
||||
s_.performance_score_weight_4V4.push_back(a8::XValue(str).GetDouble());
|
||||
}
|
||||
}
|
||||
{
|
||||
std::string tmp_str = GetStringParam("performance_score_weight_BR", "");
|
||||
std::vector<std::string> strings;
|
||||
a8::Split(tmp_str, strings, '|');
|
||||
for (auto& str : strings) {
|
||||
s_.performance_score_weight_BR.push_back(a8::XValue(str).GetDouble());
|
||||
}
|
||||
}
|
||||
{
|
||||
std::string tmp_str = GetStringParam("block_effect_range", "");
|
||||
std::vector<std::string> strings;
|
||||
|
@ -32,6 +32,8 @@ namespace mt
|
||||
float max_mount_horse_distance = 100.0f;
|
||||
int early_parachute_jump = 0;
|
||||
int pickup_weapon_replace_type = 0;
|
||||
std::vector<float> performance_score_weight_4V4;
|
||||
std::vector<float> performance_score_weight_BR;
|
||||
|
||||
int downed_relive_recover_hp = 0;
|
||||
|
||||
|
@ -1133,7 +1133,7 @@ void Human::FillSMGameOver(cs::SMGameOver& msg)
|
||||
room->GetMobaTeamB()->FillMFSettlementNew(p.get());
|
||||
*msg.mutable_common_settlement()->add_team_list() = *p;
|
||||
} else {
|
||||
room->GetMobaTeamB()->FillMFSettlementNew(p.get());
|
||||
room->GetMobaTeamA()->FillMFSettlementNew(p.get());
|
||||
*msg.mutable_common_settlement()->add_team_list() = *p;
|
||||
}
|
||||
}
|
||||
@ -1557,7 +1557,7 @@ void Human::SendGameOver()
|
||||
} else {
|
||||
SendNotifyMsg(msg);
|
||||
}
|
||||
#ifdef MYDEBUG1
|
||||
#ifdef MYDEBUG
|
||||
if (IsPlayer()) {
|
||||
a8::XPrintf("SMGameOver:%s\n", {f8::PbToJson(&msg)});
|
||||
}
|
||||
@ -1584,7 +1584,7 @@ void Human::SendGameOver()
|
||||
} else {
|
||||
SendNotifyMsg(msg);
|
||||
}
|
||||
#ifdef MYDEBUG1
|
||||
#ifdef MYDEBUG
|
||||
if (IsPlayer()) {
|
||||
a8::XPrintf("SMGameOver:%s\n", {f8::PbToJson(&msg)});
|
||||
}
|
||||
|
@ -4172,12 +4172,21 @@ void Room::CalcMvp()
|
||||
[this, &max_kill, &max_assist, &max_damage, &max_recover, &max_level, &max_alive]
|
||||
(Human* hum) mutable -> bool
|
||||
{
|
||||
#if 1
|
||||
max_kill = std::max(max_kill, (float)hum->stats->kills);
|
||||
max_assist = std::max(max_assist, (float)hum->stats->assist);
|
||||
max_damage = std::max(max_damage, (float)hum->stats->damage_amount_out);
|
||||
max_recover = std::max(max_recover, (float)hum->stats->heal_amount);
|
||||
max_level = std::max(max_level, (float)hum->GetHeroLevel());
|
||||
max_alive = std::max(max_alive, (float)hum->stats->alive_time / 1000);
|
||||
#else
|
||||
max_kill += hum->stats->kills;
|
||||
max_assist += hum->stats->assist;
|
||||
max_damage += hum->stats->damage_amount_out;
|
||||
max_recover += hum->stats->heal_amount;
|
||||
max_level += hum->GetHeroLevel();
|
||||
max_alive += hum->stats->alive_time / 1000;
|
||||
#endif
|
||||
return true;
|
||||
});
|
||||
|
||||
@ -4193,48 +4202,91 @@ void Room::CalcMvp()
|
||||
kill_sco = (param1 - param0) / (max_kill - 0) * (kill - 0) + param0;
|
||||
}
|
||||
}
|
||||
float assist_sco = 0.0f;
|
||||
float assist_sco = param0;
|
||||
{
|
||||
if (max_assist > 0) {
|
||||
float assist = hum->stats->assist;
|
||||
assist_sco = (param1 - param0) / (max_assist - 0) * (assist - 0) + param0;
|
||||
}
|
||||
}
|
||||
float damage_sco = 0.0f;
|
||||
float damage_sco = param0;
|
||||
{
|
||||
if (max_damage > 0) {
|
||||
float damage = hum->stats->damage_amount_out;
|
||||
damage_sco = (param1 - param0) / (max_damage - 0) * (damage - 0) + param0;
|
||||
}
|
||||
}
|
||||
float recover_sco = 0.0f;
|
||||
float recover_sco = param0;
|
||||
{
|
||||
if (max_recover > 0) {
|
||||
float recover = hum->stats->heal_amount;
|
||||
recover_sco = (param1 - param0) / (max_recover - 0) * (recover - 0) + param0;
|
||||
}
|
||||
}
|
||||
float level_sco = 0.0f;
|
||||
float level_sco = param0;
|
||||
{
|
||||
if (max_level > 1.00000) {
|
||||
float level = hum->GetHeroLevel();
|
||||
level_sco = (param1 - param0) / (max_level - 0) * (level - 0) + param0;
|
||||
}
|
||||
}
|
||||
float alive_sco = 0.0f;
|
||||
float alive_sco = param0;
|
||||
{
|
||||
if (max_alive > 0) {
|
||||
float alive = hum->stats->alive_time / 1000;
|
||||
alive_sco = (param1 - param0) / (max_alive - 0) * (alive - 0) + param0;
|
||||
}
|
||||
}
|
||||
#ifdef MYDEBUG
|
||||
if (hum->IsPlayer()) {
|
||||
a8::XPrintf("kill_sco:%f assist_sco:%f damage_sco:%f recover_sco:%f alive_sco:%f "
|
||||
"assist:%f max_assist:%f damage:%f max_damage:%f recover:%f max_recover:%f "
|
||||
"level:%d max_level:%d""\n",
|
||||
{
|
||||
kill_sco,
|
||||
assist_sco,
|
||||
damage_sco,
|
||||
recover_sco,
|
||||
alive_sco,
|
||||
hum->stats->assist,
|
||||
max_assist,
|
||||
hum->stats->damage_amount_out,
|
||||
max_damage,
|
||||
hum->stats->heal_amount,
|
||||
max_recover,
|
||||
hum->GetHeroLevel(),
|
||||
max_level
|
||||
});
|
||||
}
|
||||
#endif
|
||||
float battle_score = 0.0f;
|
||||
if (IsMobaModeRoom()) {
|
||||
if (mt::Param::s().performance_score_weight_4V4.size() >= 5) {
|
||||
kill_sco *= mt::Param::s().performance_score_weight_4V4.at(0);
|
||||
assist_sco *= mt::Param::s().performance_score_weight_4V4.at(1);
|
||||
damage_sco *= mt::Param::s().performance_score_weight_4V4.at(2);
|
||||
recover_sco *= mt::Param::s().performance_score_weight_4V4.at(3);
|
||||
level_sco *= mt::Param::s().performance_score_weight_4V4.at(4);
|
||||
}
|
||||
battle_score = std::round((kill_sco + assist_sco + damage_sco + recover_sco + level_sco) * 100.0f) / 100.0f;
|
||||
|
||||
} else {
|
||||
if (mt::Param::s().performance_score_weight_BR.size() >= 5) {
|
||||
kill_sco *= mt::Param::s().performance_score_weight_BR.at(0);
|
||||
assist_sco *= mt::Param::s().performance_score_weight_BR.at(1);
|
||||
damage_sco *= mt::Param::s().performance_score_weight_BR.at(2);
|
||||
recover_sco *= mt::Param::s().performance_score_weight_BR.at(3);
|
||||
alive_sco *= mt::Param::s().performance_score_weight_BR.at(4);
|
||||
}
|
||||
battle_score = std::round((kill_sco + assist_sco + damage_sco + recover_sco + alive_sco) * 100.0f) / 100.0f;
|
||||
}
|
||||
#ifdef MYDEBUG
|
||||
if (hum->IsPlayer()) {
|
||||
a8::XPrintf("battle_score:%f\n",
|
||||
{
|
||||
battle_score
|
||||
});
|
||||
}
|
||||
#endif
|
||||
hum->stats->battle_score = battle_score;
|
||||
return true;
|
||||
});
|
||||
|
@ -72,9 +72,6 @@ behaviac::EBTStatus AndroidAgent::CoLogin()
|
||||
auto url_params = a8::MutableXObject::CreateObject();
|
||||
url_params->SetVal("c", "Login");
|
||||
url_params->SetVal("a", "auth2");
|
||||
//url_params->SetVal("gameid", 2006);
|
||||
//url_params->SetVal("channel", 6513);
|
||||
//url_params->SetVal("openid", owner_->GetIdx());
|
||||
auto post_body = a8::MutableXObject::CreateObject();
|
||||
post_body->SetVal("channel", 2);
|
||||
post_body->SetVal("data", owner_->GetIdx());
|
||||
@ -100,12 +97,31 @@ behaviac::EBTStatus AndroidAgent::CoLogin()
|
||||
}
|
||||
HttpProxy::Instance()->HttpGet
|
||||
(
|
||||
[context] (bool ok, a8::XObject* rsp_obj, f8::HttpContext* ctx)
|
||||
[context, hum, account_id, session_id]
|
||||
(bool ok, a8::XObject* rsp_obj, f8::HttpContext* ctx)
|
||||
{
|
||||
#if 0
|
||||
a8::XPrintf("data:%s\n", {rsp_obj->ToJsonStr()});
|
||||
#endif
|
||||
if (ok) {
|
||||
auto info = rsp_obj->At("info");
|
||||
long long hero_uniid = info->Get("hero_uniid", "");
|
||||
hum->SetHeroUniId(hero_uniid);
|
||||
if (hum->GetHeroUniId() <= 0) {
|
||||
auto url_params = a8::MutableXObject::CreateObject();
|
||||
url_params->SetVal("c", "User");
|
||||
url_params->SetVal("a", "selectFreeItemS");
|
||||
url_params->SetVal("account_id", account_id);
|
||||
url_params->SetVal("session_id", session_id);
|
||||
url_params->SetVal("itemId", 30100);
|
||||
HttpProxy::Instance()->HttpGet
|
||||
(
|
||||
[context, hum] (bool ok, a8::XObject* rsp_obj, f8::HttpContext* ctx)
|
||||
{
|
||||
if (ok) {
|
||||
auto info = rsp_obj->At("property_chg")->At("user_info");
|
||||
long long hero_uniid = info->Get("hero_uniid", "");
|
||||
hum->SetHeroUniId(hero_uniid);
|
||||
++Perf::Instance()->enter_ok_times;
|
||||
context->login_ok = true;
|
||||
} else {
|
||||
@ -113,6 +129,18 @@ behaviac::EBTStatus AndroidAgent::CoLogin()
|
||||
++Perf::Instance()->enter_fail_times;
|
||||
}
|
||||
},
|
||||
"https://game2006sapi-test.kingsome.cn/sapi/webapp/index.php",
|
||||
url_params
|
||||
);
|
||||
} else {
|
||||
++Perf::Instance()->enter_ok_times;
|
||||
context->login_ok = true;
|
||||
}
|
||||
} else {
|
||||
context->login_ok = false;
|
||||
++Perf::Instance()->enter_fail_times;
|
||||
}
|
||||
},
|
||||
"https://game2006api-test.kingsome.cn/webapp/index.php",
|
||||
url_params
|
||||
);
|
||||
@ -205,7 +233,7 @@ behaviac::EBTStatus AndroidAgent::CoJoin()
|
||||
msg.set_account_id(owner_->GetAccountId());
|
||||
msg.set_session_id(owner_->GetSessionId());
|
||||
msg.set_proto_version(cs::ProtoVersion);
|
||||
std::string payload_data = "ihCQQdNzoYFC^6q4ohsao39br%Ui!C9u2d^qvzek5hOB$3q1:|";
|
||||
std::string payload_data = "ihCQQdNzoYFC^6q4ohsao39br%Ui!C9u2d^qvzek5hOB$3q1:normal_room|";
|
||||
{
|
||||
auto xobj = a8::MutableXObject::CreateObject();
|
||||
auto team_list = a8::MutableXObject::CreateArray();
|
||||
@ -215,6 +243,10 @@ behaviac::EBTStatus AndroidAgent::CoJoin()
|
||||
auto member = a8::MutableXObject::CreateObject();
|
||||
member->SetVal("account_id", owner_->GetAccountId());
|
||||
member->SetVal("session_id", owner_->GetSessionId());
|
||||
member->SetVal("hero_uniid", owner_->GetHeroUniId());
|
||||
if (owner_->GetHeroUniId() <= 0) {
|
||||
A8_ABORT();
|
||||
}
|
||||
member_list->Push(*member.get());
|
||||
|
||||
team->SetVal("team_uuid", f8::App::Instance()->NewGlobalUuid());
|
||||
@ -222,6 +254,8 @@ behaviac::EBTStatus AndroidAgent::CoJoin()
|
||||
|
||||
team_list->Push(*team.get());
|
||||
}
|
||||
xobj->SetVal("room_uuid", f8::App::Instance()->NewGlobalUuid());
|
||||
xobj->SetVal("start_time", f8::App::Instance()->GetNowTime());
|
||||
xobj->SetVal("team_list", *team_list.get());
|
||||
payload_data += xobj->ToJsonStr();
|
||||
}
|
||||
|
@ -32,6 +32,8 @@ public:
|
||||
const std::string& GetAccountId() { return account_id_; }
|
||||
const std::string& GetSessionId() { return session_id_; }
|
||||
void SetSessionId(const std::string& session_id) { session_id_ = session_id; }
|
||||
void SetHeroUniId(long long hero_uniid) { hero_uniid_ = hero_uniid; }
|
||||
long long GetHeroUniId() { return hero_uniid_; }
|
||||
auto GetWebSocket() { return web_socket_; }
|
||||
int GetIdx() { return idx_; }
|
||||
void SetLoginSucess();
|
||||
@ -76,6 +78,7 @@ private:
|
||||
std::string session_id_;
|
||||
std::string remote_ip_;
|
||||
int remote_port_ = 0;
|
||||
long long hero_uniid_ = 0;
|
||||
|
||||
bool is_login_success_ = false;
|
||||
bool net_connected_ = false;
|
||||
|
@ -26,13 +26,13 @@ void PlayerMgr::Init()
|
||||
{
|
||||
if (et == a8::TIMER_EXEC_EVENT) {
|
||||
int idx = account_id_hash_.size() + 1;
|
||||
std::string account_id = a8::Format("6513_2006_%d", {idx});
|
||||
std::string account_id = a8::Format("2_2006_%d", {idx});
|
||||
auto hum = std::make_shared<Player>();
|
||||
hum->Init(idx, account_id);
|
||||
account_id_hash_[hum->GetAccountId()] = hum;
|
||||
socket_id_hash_[hum->GetSocketId()] = hum;
|
||||
++count;
|
||||
if (count >= 1) {
|
||||
if (count >= 3) {
|
||||
f8::Timer::Instance()->DeleteCurrentTimer();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user