1
This commit is contained in:
parent
d38b855728
commit
db2a58b0b2
@ -581,3 +581,20 @@ long long App::AllocTempWeaponUniId()
|
||||
++curr_uniid_;
|
||||
return -curr_uniid_;
|
||||
}
|
||||
|
||||
int App::GetVersion()
|
||||
{
|
||||
const char* current_file_name = __FILE__;
|
||||
if (!version_) {
|
||||
std::vector<std::string> strings;
|
||||
a8::Split(current_file_name, strings, '/');
|
||||
std::string tag = strings.at(strings.size() - 6);
|
||||
std::vector<std::string> strings2;
|
||||
a8::Split(tag, strings2, '.');
|
||||
std::string version_str = strings2.at(strings2.size() - 1);
|
||||
a8::ReplaceString(version_str, "R", "0");
|
||||
version_ = std::make_shared<int>(a8::XValue(version_str).GetInt());
|
||||
//a8::XPrintf("%s %s %s\n", {current_file_name, *version_, version_str});
|
||||
}
|
||||
return *version_;
|
||||
}
|
||||
|
@ -47,6 +47,7 @@ public:
|
||||
int GetTestParam() const { return test_param_; }
|
||||
bool IsServicing() const { return servicing_; }
|
||||
void SetServicing(bool open) { servicing_ = open; }
|
||||
int GetVersion();
|
||||
|
||||
private:
|
||||
void QuickExecute(int delta_time);
|
||||
@ -102,6 +103,8 @@ private:
|
||||
|
||||
long long curr_uniid_ = 0;
|
||||
|
||||
std::shared_ptr<int> version_;
|
||||
|
||||
public:
|
||||
int msgnode_size_ = 0 ;
|
||||
int working_msgnode_size_ = 0;
|
||||
|
@ -462,6 +462,7 @@ void RoomMgr::ReportServerState(int instance_id, const std::string& host, int po
|
||||
url_params->SetVal("channel", JsonDataMgr::Instance()->channel);
|
||||
url_params->SetVal("alive_count", PerfMonitor::Instance()->real_alive_count);
|
||||
url_params->SetVal("servicing", App::Instance()->IsServicing() ? 1 : 0);
|
||||
url_params->SetVal("version", App::Instance()->GetVersion());
|
||||
f8::HttpClientPool::Instance()->HttpGet
|
||||
(
|
||||
cb,
|
||||
|
Loading…
x
Reference in New Issue
Block a user