1
This commit is contained in:
parent
9fad4f67b3
commit
c9b30c083f
@ -222,6 +222,9 @@ void Human::FillMFObjectFull(Room* room, Human* hum, cs::MFObjectFull* full_data
|
||||
p->set_max_energy_shield(max_energy_shield);
|
||||
}
|
||||
#endif
|
||||
if (guild_id != 0) {
|
||||
p->set_guild_id(guild_id);
|
||||
}
|
||||
p->set_vip(vip);
|
||||
p->set_sdmg(sdmg);
|
||||
p->set_kill_count(stats.kills);
|
||||
@ -306,6 +309,9 @@ void Human::FillMFPlayerStats(cs::MFPlayerStats* stats_pb)
|
||||
}
|
||||
|
||||
stats_pb->set_account_id(account_id);
|
||||
if (guild_id != 0) {
|
||||
stats_pb->set_guild_id(guild_id);
|
||||
}
|
||||
|
||||
for (auto& pair : stats.items) {
|
||||
auto p = stats_pb->add_items();
|
||||
@ -378,6 +384,9 @@ void Human::FillMFTeamData(cs::MFTeamData* team_data, bool is_game_over)
|
||||
team_data->set_user_value1(user_value1);
|
||||
team_data->set_user_value2(user_value2);
|
||||
team_data->set_user_value3(user_value3);
|
||||
if (guild_id != 0) {
|
||||
team_data->set_guild_id(guild_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2526,7 +2535,14 @@ void Human::SendBattleReport()
|
||||
};
|
||||
std::string url;
|
||||
if (!f8::IsOnlineEnv()) {
|
||||
url = "http://game2005api-test.kingsome.cn/webapp/index.php?c=Role&a=battleReport";
|
||||
if (JsonDataMgr::Instance()->channel != 0) {
|
||||
url = a8::Format("http://game2005api-test.kingsome.cn/%d/webapp/index.php?c=Role&a=battleReport",
|
||||
{
|
||||
JsonDataMgr::Instance()->channel
|
||||
});
|
||||
} else {
|
||||
url = "https://game2005api-test.kingsome.cn/webapp/index.php?c=Role&a=battleReport";
|
||||
}
|
||||
} else {
|
||||
if (JsonDataMgr::Instance()->channel != 0) {
|
||||
if (kTouTiaoChannelId == JsonDataMgr::Instance()->channel) {
|
||||
@ -2544,6 +2560,7 @@ void Human::SendBattleReport()
|
||||
url = "http://game2005api.kingsome.cn/webapp/index.php?c=Role&a=battleReport";
|
||||
}
|
||||
}
|
||||
JsonDataMgr::Instance()->GetBattleReportUrl(url);
|
||||
std::string data;
|
||||
params->ToUrlEncodeStr(data);
|
||||
f8::HttpClientPool::Instance()->HttpGet(
|
||||
|
@ -62,6 +62,7 @@ class Human : public MoveableEntity
|
||||
long long user_value1 = 0;
|
||||
long long user_value2 = 0;
|
||||
long long user_value3 = 0;
|
||||
long long guild_id = 0;
|
||||
long long last_cmmove_frameno = 0;
|
||||
bool downed = false;
|
||||
bool disconnected = false;
|
||||
|
@ -24,14 +24,28 @@ void JsonDataMgr::Init()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
std::string gameserver_cluster_json_file;
|
||||
std::string setting_json_file;
|
||||
|
||||
gameserver_cluster_json_file = a8::Format("%s/node%d/game%d.gameserver.cluster.json",
|
||||
{
|
||||
work_path_,
|
||||
App::Instance()->node_id,
|
||||
GAME_ID
|
||||
});
|
||||
setting_json_file = a8::Format("%s/game%d.gameserver.setting.json",
|
||||
{
|
||||
work_path_,
|
||||
GAME_ID
|
||||
});
|
||||
gameserver_cluster_json_.ReadFromFile(gameserver_cluster_json_file);
|
||||
setting_json_.ReadFromFile(setting_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();
|
||||
}
|
||||
|
||||
ip = GetConf()->At("ip")->AsXValue().GetString();
|
||||
listen_port = GetConf()->At("listen_port")->AsXValue();
|
||||
if (GetConf()->HasKey("channel")) {
|
||||
@ -39,6 +53,11 @@ void JsonDataMgr::Init()
|
||||
}
|
||||
server_info = a8::Format("%s:%d", {ip, listen_port});
|
||||
Reload();
|
||||
|
||||
a8::UdpLog::Instance()->Info("battle_report_url:%s",
|
||||
{
|
||||
battle_report_url_
|
||||
});
|
||||
}
|
||||
|
||||
void JsonDataMgr::UnInit()
|
||||
@ -72,3 +91,10 @@ void JsonDataMgr::Reload()
|
||||
});
|
||||
masterserver_cluster_json_.ReadFromFile(masterserver_cluster_json_file);
|
||||
}
|
||||
|
||||
void JsonDataMgr::GetBattleReportUrl(std::string& url)
|
||||
{
|
||||
if (!battle_report_url_.empty()) {
|
||||
url = battle_report_url_;
|
||||
}
|
||||
}
|
||||
|
@ -19,9 +19,14 @@ public:
|
||||
std::string server_info;
|
||||
|
||||
void Reload();
|
||||
void GetBattleReportUrl(std::string& url);
|
||||
|
||||
private:
|
||||
std::string battle_report_url_;
|
||||
|
||||
private:
|
||||
std::string work_path_ = "../config";
|
||||
a8::XObject setting_json_;
|
||||
a8::XObject gameserver_cluster_json_;
|
||||
a8::XObject masterserver_cluster_json_;
|
||||
};
|
||||
|
@ -72,6 +72,7 @@ Player* PlayerMgr::CreatePlayerByCMJoin(Player* hum,
|
||||
hum->user_value1 = msg.user_value1();
|
||||
hum->user_value2 = msg.user_value2();
|
||||
hum->user_value3 = msg.user_value3();
|
||||
hum->guild_id = msg.guild_id();
|
||||
#if 0
|
||||
if (hum->atk_add > 0.9999f) {
|
||||
hum->atk_add = hum->atk_add / 100.0f;
|
||||
|
@ -187,6 +187,7 @@ message MFPlayerFull
|
||||
optional int32 obj_uniid = 1; //唯一id
|
||||
optional MFVec2 pos = 2; //位置
|
||||
optional MFVec2 dir = 3; //朝向
|
||||
optional int64 guild_id = 4; //公会id
|
||||
|
||||
optional float max_health = 5; //血量
|
||||
optional float health = 6; //血量
|
||||
@ -527,6 +528,7 @@ message MFTeamData
|
||||
optional int64 user_value1 = 31; //对应好友系统的user_value1
|
||||
optional int64 user_value2 = 32; //对应好友系统的user_value2
|
||||
optional int64 user_value3 = 33; //对应好友系统的user_value3
|
||||
optional int64 guild_id = 34; //公会id
|
||||
}
|
||||
|
||||
//子弹
|
||||
@ -612,6 +614,7 @@ message MFPlayerStats
|
||||
optional string killer_account_id = 42; //杀手accountid(机器人为空)
|
||||
|
||||
optional string account_id = 21; //账号id
|
||||
optional int64 guild_id = 22; //公会id
|
||||
}
|
||||
|
||||
//空投
|
||||
@ -732,6 +735,7 @@ message CMJoin
|
||||
optional int64 user_value1 = 31; //对应好友系统的user_value1
|
||||
optional int64 user_value2 = 32; //对应好友系统的user_value2
|
||||
optional int64 user_value3 = 33; //对应好友系统的user_value3
|
||||
optional int64 guild_id = 34; //公会id
|
||||
optional bool force_entry_newbie_room = 50; //是否强制进新手房
|
||||
repeated MFTeamMember team_members = 51; //包括自己
|
||||
optional int32 room_mode = 52; //0:吃鸡模式 1:僵尸模式
|
||||
|
Loading…
x
Reference in New Issue
Block a user