1
This commit is contained in:
parent
acc1a6b46f
commit
77765b0af8
@ -11,6 +11,7 @@
|
|||||||
#include "playermgr.h"
|
#include "playermgr.h"
|
||||||
#include "httpproxy.h"
|
#include "httpproxy.h"
|
||||||
#include "glmhelper.h"
|
#include "glmhelper.h"
|
||||||
|
#include "perf.h"
|
||||||
|
|
||||||
AndroidAgent::AndroidAgent()
|
AndroidAgent::AndroidAgent()
|
||||||
{
|
{
|
||||||
@ -77,6 +78,7 @@ behaviac::EBTStatus AndroidAgent::CoLogin()
|
|||||||
a8::XPrintf("data:%s\n", {rsp_obj->ToJsonStr()});
|
a8::XPrintf("data:%s\n", {rsp_obj->ToJsonStr()});
|
||||||
#endif
|
#endif
|
||||||
if (ok) {
|
if (ok) {
|
||||||
|
++Perf::Instance()->login_ok_times;
|
||||||
std::string account_id = rsp_obj->At("account_id")->AsXValue().GetString();
|
std::string account_id = rsp_obj->At("account_id")->AsXValue().GetString();
|
||||||
std::string session_id = rsp_obj->At("session_id")->AsXValue().GetString();
|
std::string session_id = rsp_obj->At("session_id")->AsXValue().GetString();
|
||||||
auto url_params = a8::MutableXObject::CreateObject();
|
auto url_params = a8::MutableXObject::CreateObject();
|
||||||
@ -96,9 +98,11 @@ behaviac::EBTStatus AndroidAgent::CoLogin()
|
|||||||
a8::XPrintf("data:%s\n", {rsp_obj->ToJsonStr()});
|
a8::XPrintf("data:%s\n", {rsp_obj->ToJsonStr()});
|
||||||
#endif
|
#endif
|
||||||
if (ok) {
|
if (ok) {
|
||||||
|
++Perf::Instance()->enter_ok_times;
|
||||||
context->login_ok = true;
|
context->login_ok = true;
|
||||||
} else {
|
} else {
|
||||||
context->login_ok = false;
|
context->login_ok = false;
|
||||||
|
++Perf::Instance()->enter_fail_times;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"https://game2006api-test.kingsome.cn/webapp/index.php",
|
"https://game2006api-test.kingsome.cn/webapp/index.php",
|
||||||
@ -106,6 +110,7 @@ behaviac::EBTStatus AndroidAgent::CoLogin()
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
context->login_ok = false;
|
context->login_ok = false;
|
||||||
|
++Perf::Instance()->login_fail_times;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"https://login-test.kingsome.cn/webapp/index.php",
|
"https://login-test.kingsome.cn/webapp/index.php",
|
||||||
@ -172,6 +177,11 @@ behaviac::EBTStatus AndroidAgent::CoConnectBattleServer()
|
|||||||
if (context->pending) {
|
if (context->pending) {
|
||||||
return behaviac::BT_RUNNING;
|
return behaviac::BT_RUNNING;
|
||||||
}
|
}
|
||||||
|
if (context->connect_ok) {
|
||||||
|
++Perf::Instance()->connect_ok_times;
|
||||||
|
} else {
|
||||||
|
++Perf::Instance()->connect_fail_times;
|
||||||
|
}
|
||||||
return context->connect_ok ? behaviac::BT_SUCCESS : behaviac::BT_FAILURE;
|
return context->connect_ok ? behaviac::BT_SUCCESS : behaviac::BT_FAILURE;
|
||||||
};
|
};
|
||||||
return StartCoroutine(co);
|
return StartCoroutine(co);
|
||||||
@ -226,9 +236,11 @@ behaviac::EBTStatus AndroidAgent::CoUpdateGame()
|
|||||||
curr_dir_ = glm::vec3(0.0f, 0.0f, 1.0f);
|
curr_dir_ = glm::vec3(0.0f, 0.0f, 1.0f);
|
||||||
GlmHelper::RotateY(curr_dir_, a8::RandAngle());
|
GlmHelper::RotateY(curr_dir_, a8::RandAngle());
|
||||||
last_dir_tick_ = a8::XGetTickCount();
|
last_dir_tick_ = a8::XGetTickCount();
|
||||||
|
++Perf::Instance()->chg_dir_times;
|
||||||
}
|
}
|
||||||
if (a8::XGetTickCount() - last_send_tick_ > 80) {
|
if (a8::XGetTickCount() - last_send_tick_ > 80) {
|
||||||
last_send_tick_ = a8::XGetTickCount();
|
last_send_tick_ = a8::XGetTickCount();
|
||||||
|
++Perf::Instance()->send_move_times;
|
||||||
{
|
{
|
||||||
cs::CMMove msg;
|
cs::CMMove msg;
|
||||||
ToPb(curr_dir_, msg.mutable_move_dir());
|
ToPb(curr_dir_, msg.mutable_move_dir());
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include "tracemgr.h"
|
#include "tracemgr.h"
|
||||||
#include "iomgr.h"
|
#include "iomgr.h"
|
||||||
#include "GGListener.h"
|
#include "GGListener.h"
|
||||||
|
#include "perf.h"
|
||||||
|
|
||||||
#include "mt/MetaMgr.h"
|
#include "mt/MetaMgr.h"
|
||||||
|
|
||||||
@ -23,6 +24,7 @@ void App::Init()
|
|||||||
TraceMgr::Instance()->Init("robotserver2006");
|
TraceMgr::Instance()->Init("robotserver2006");
|
||||||
#endif
|
#endif
|
||||||
HandlerMgr::Instance()->Init();
|
HandlerMgr::Instance()->Init();
|
||||||
|
Perf::Instance()->Init();
|
||||||
f8::BtMgr::Instance()->Init("exported");
|
f8::BtMgr::Instance()->Init("exported");
|
||||||
#ifdef MYDEBUG1
|
#ifdef MYDEBUG1
|
||||||
f8::BtMgr::Instance()->SetLogging(true);
|
f8::BtMgr::Instance()->SetLogging(true);
|
||||||
@ -41,6 +43,7 @@ void App::UnInit()
|
|||||||
HttpProxy::Instance()->UnInit();
|
HttpProxy::Instance()->UnInit();
|
||||||
f8::BtMgr::Instance()->UnInit();
|
f8::BtMgr::Instance()->UnInit();
|
||||||
IoMgr::Instance()->UnInit();
|
IoMgr::Instance()->UnInit();
|
||||||
|
Perf::Instance()->UnInit();
|
||||||
HandlerMgr::Instance()->UnInit();
|
HandlerMgr::Instance()->UnInit();
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
TraceMgr::Instance()->UnInit();
|
TraceMgr::Instance()->UnInit();
|
||||||
|
@ -25,18 +25,15 @@ void Perf::UnInit()
|
|||||||
void Perf::Output()
|
void Perf::Output()
|
||||||
{
|
{
|
||||||
f8::UdpLog::Instance()->Info
|
f8::UdpLog::Instance()->Info
|
||||||
("perf entity:%d buff:%d bt_co:%d agent:%d c_w_c:%d c_w:%d o_w_c:%d o_w:%d e_w_c:%d e_c:%d e_h:%d",
|
("perf login_ok:%d login_fail:%d enter_ok:%d enter_fail:%d connect_ok:%d connect_fail:%d send_move:%d",
|
||||||
{
|
{
|
||||||
entity_num,
|
login_ok_times,
|
||||||
buff_num,
|
login_fail_times,
|
||||||
bt_co_num,
|
enter_ok_times,
|
||||||
agent_num,
|
enter_fail_times,
|
||||||
c_wptr_chunk_num,
|
connect_ok_times,
|
||||||
c_wptr_num,
|
connect_fail_times,
|
||||||
o_wptr_chunk_num,
|
chg_dir_times,
|
||||||
o_wptr_num,
|
send_move_times
|
||||||
e_wptr_chunk_num,
|
|
||||||
e_wptr_num,
|
|
||||||
event_handler_num
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -13,18 +13,14 @@ private:
|
|||||||
void Init();
|
void Init();
|
||||||
void UnInit();
|
void UnInit();
|
||||||
|
|
||||||
long long entity_num = 0;
|
long long login_ok_times = 0;
|
||||||
long long buff_num = 0;
|
long long login_fail_times = 0;
|
||||||
long long bt_co_num = 0;
|
long long enter_ok_times = 0;
|
||||||
long long agent_num = 0;
|
long long enter_fail_times = 0;
|
||||||
long long c_wptr_chunk_num = 0;
|
long long connect_ok_times = 0;
|
||||||
long long c_wptr_num = 0;
|
long long connect_fail_times = 0;
|
||||||
long long o_wptr_chunk_num = 0;
|
long long chg_dir_times = 0;
|
||||||
long long o_wptr_num = 0;
|
long long send_move_times = 0;
|
||||||
long long e_wptr_chunk_num = 0;
|
|
||||||
long long e_wptr_num = 0;
|
|
||||||
long long event_handler_num = 0;
|
|
||||||
int traversing_cell_creature_count = 0;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Output();
|
void Output();
|
||||||
|
@ -18,16 +18,6 @@
|
|||||||
|
|
||||||
void PlayerMgr::Init()
|
void PlayerMgr::Init()
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
for (int i = 1; i <= 300; ++i) {
|
|
||||||
int idx = i;
|
|
||||||
std::string account_id = a8::Format("6513_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;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
f8::Timer::Instance()->SetInterval
|
f8::Timer::Instance()->SetInterval
|
||||||
(
|
(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user