1
This commit is contained in:
parent
4a722a6dd5
commit
357d105587
@ -2052,33 +2052,14 @@ void Human::SendBattleReport()
|
||||
});
|
||||
};
|
||||
std::string url;
|
||||
JsonDataMgr::Instance()->GetApiUrl(url);
|
||||
if (!f8::IsOnlineEnv()) {
|
||||
if (JsonDataMgr::Instance()->channel != 0) {
|
||||
url = a8::Format("http://game2006api-test.kingsome.cn/%d/webapp/index.php?c=Battle&a=battleReport",
|
||||
{
|
||||
JsonDataMgr::Instance()->channel
|
||||
});
|
||||
} else {
|
||||
url = "https://game2006api-test.kingsome.cn/webapp/index.php?c=Battle&a=battleReport";
|
||||
}
|
||||
} else {
|
||||
if (JsonDataMgr::Instance()->channel != 0) {
|
||||
if (kTouTiaoChannelId == JsonDataMgr::Instance()->channel) {
|
||||
url = a8::Format("http://game2006api-al.kingsome.cn/%d/webapp/index.php?c=Battle&a=battleReport",
|
||||
{
|
||||
JsonDataMgr::Instance()->channel
|
||||
});
|
||||
} else {
|
||||
url = a8::Format("http://game2006api.kingsome.cn/%d/webapp/index.php?c=Battle&a=battleReport",
|
||||
{
|
||||
JsonDataMgr::Instance()->channel
|
||||
});
|
||||
}
|
||||
} else {
|
||||
url = "http://game2006api.kingsome.cn/webapp/index.php?c=Battle&a=battleReport";
|
||||
}
|
||||
}
|
||||
JsonDataMgr::Instance()->GetBattleReportUrl(url);
|
||||
if (url.find('?') != std::string::npos) {
|
||||
url += "c=Battle&a=battleReport";
|
||||
} else {
|
||||
url += "?c=Battle&a=battleReport";
|
||||
}
|
||||
std::string data;
|
||||
params->ToUrlEncodeStr(data);
|
||||
f8::HttpClientPool::Instance()->HttpGet(
|
||||
|
@ -105,6 +105,7 @@ class Buff;
|
||||
class Human : public Creature
|
||||
{
|
||||
public:
|
||||
int proto_version = 0;
|
||||
int socket_handle = 0;
|
||||
long ip_saddr = 0;
|
||||
std::string account_id;
|
||||
|
@ -44,8 +44,8 @@ void JsonDataMgr::Init()
|
||||
setting_json_.ReadFromFile(setting_json_file);
|
||||
httpproxy_cluster_json_.ReadFromFile(httpproxy_json_file);
|
||||
if (setting_json_.GetType() == a8::XOT_OBJECT &&
|
||||
setting_json_.HasKey("battle_report_url")) {
|
||||
battle_report_url_ = setting_json_.Get("battle_report_url").GetString();
|
||||
setting_json_.HasKey("api_url")) {
|
||||
api_url_ = setting_json_.Get("api_url").GetString();
|
||||
}
|
||||
|
||||
ip = GetConf()->At("ip")->AsXValue().GetString();
|
||||
@ -69,9 +69,9 @@ void JsonDataMgr::Init()
|
||||
server_info = a8::Format("%s:%d", {ip, listen_port});
|
||||
Reload();
|
||||
|
||||
a8::UdpLog::Instance()->Info("battle_report_url:%s",
|
||||
a8::UdpLog::Instance()->Info("api_url:%s",
|
||||
{
|
||||
battle_report_url_
|
||||
api_url_
|
||||
});
|
||||
}
|
||||
|
||||
@ -107,10 +107,10 @@ void JsonDataMgr::Reload()
|
||||
masterserver_cluster_json_.ReadFromFile(masterserver_cluster_json_file);
|
||||
}
|
||||
|
||||
void JsonDataMgr::GetBattleReportUrl(std::string& url)
|
||||
void JsonDataMgr::GetApiUrl(std::string& url)
|
||||
{
|
||||
if (!battle_report_url_.empty()) {
|
||||
url = battle_report_url_;
|
||||
if (!api_url_.empty()) {
|
||||
url = api_url_;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,11 +19,11 @@ public:
|
||||
std::string server_info;
|
||||
|
||||
void Reload();
|
||||
void GetBattleReportUrl(std::string& url);
|
||||
void GetApiUrl(std::string& url);
|
||||
void GetHttpProxyUrl(std::string& url);
|
||||
|
||||
private:
|
||||
std::string battle_report_url_;
|
||||
std::string api_url_;
|
||||
|
||||
private:
|
||||
std::string work_path_ = "../config";
|
||||
|
@ -3982,6 +3982,7 @@ void Room::AddTeam(class MatchTeam* team)
|
||||
new_team->AddMember(hum);
|
||||
} else {
|
||||
Player* hum = NewPlayer();
|
||||
hum->proto_version = msg.proto_version();
|
||||
#if 1
|
||||
a8::SetBitFlag(hum->status, CS_ForceTeam);
|
||||
#if 0
|
||||
|
@ -184,6 +184,7 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
|
||||
return;
|
||||
}
|
||||
Player* hum = room->NewPlayer();
|
||||
hum->proto_version = msg.proto_version();
|
||||
hum->ProcPreSettlementInfo(msg.pre_settlement_info());
|
||||
PlayerMgr::Instance()->
|
||||
CreatePlayerByCMJoin(hum,
|
||||
|
Loading…
x
Reference in New Issue
Block a user