1
This commit is contained in:
parent
b9a9306b98
commit
380d07fb5d
@ -16,8 +16,8 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_BUILD_TYPE "Debug")
|
set(CMAKE_BUILD_TYPE "Debug")
|
||||||
#set(CMAKE_BUILD_TYPE "Release")
|
set(CMAKE_BUILD_TYPE "Release")
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "-Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID} -DMASTER_MODE=${MASTER_MODE} -DA8_TCP_SESSION2=1")
|
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID} -DMASTER_MODE=${MASTER_MODE} -DA8_TCP_SESSION2=1")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID} -DMASTER_MODE=${MASTER_MODE} -DA8_TCP_SESSION2=1")
|
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID} -DMASTER_MODE=${MASTER_MODE} -DA8_TCP_SESSION2=1")
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
|
@ -161,3 +161,8 @@ long long GCListener::GetSendNodeNum()
|
|||||||
{
|
{
|
||||||
return tcp_listener_->send_node_num;
|
return tcp_listener_->send_node_num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
long long GCListener::GetSentBytesNum()
|
||||||
|
{
|
||||||
|
return tcp_listener_->sent_bytes_num;
|
||||||
|
}
|
||||||
|
@ -32,6 +32,7 @@ class GCListener : public a8::Singleton<GCListener>
|
|||||||
void ForceCloseClient(unsigned short sockhandle);
|
void ForceCloseClient(unsigned short sockhandle);
|
||||||
void MarkClient(unsigned short sockhandle, bool is_active);
|
void MarkClient(unsigned short sockhandle, bool is_active);
|
||||||
long long GetSendNodeNum();
|
long long GetSendNodeNum();
|
||||||
|
long long GetSentBytesNum();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
a8::TcpListener *tcp_listener_ = nullptr;
|
a8::TcpListener *tcp_listener_ = nullptr;
|
||||||
|
@ -64,11 +64,12 @@ static void SavePerfLog()
|
|||||||
App::Instance()->perf.read_count,
|
App::Instance()->perf.read_count,
|
||||||
});
|
});
|
||||||
if (App::Instance()->HasFlag(2)) {
|
if (App::Instance()->HasFlag(2)) {
|
||||||
a8::XPrintf("mainloop_time:%d netmsg_time:%d send_node_num:%d\n",
|
a8::XPrintf("mainloop_time:%d netmsg_time:%d send_node_num:%d sent_bytes_num:%d\n",
|
||||||
{
|
{
|
||||||
App::Instance()->perf.max_run_delay_time,
|
App::Instance()->perf.max_run_delay_time,
|
||||||
App::Instance()->perf.max_dispatchmsg_time,
|
App::Instance()->perf.max_dispatchmsg_time,
|
||||||
GCListener::Instance()->GetSendNodeNum()
|
GCListener::Instance()->GetSendNodeNum(),
|
||||||
|
GCListener::Instance()->GetSentBytesNum()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
#if 1
|
#if 1
|
||||||
@ -156,6 +157,17 @@ bool App::Init(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (HasFlag(4)) {
|
||||||
|
a8::Timer::Instance()->AddDeadLineTimer(
|
||||||
|
1000 * 30,
|
||||||
|
a8::XParams(),
|
||||||
|
[] (const a8::XParams& param)
|
||||||
|
{
|
||||||
|
App::Instance()->shutdowned = true;
|
||||||
|
a8::XPrintf("shutdowned\n", {});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,6 +57,7 @@ private:
|
|||||||
int argc = 0;
|
int argc = 0;
|
||||||
char** argv = nullptr;
|
char** argv = nullptr;
|
||||||
volatile bool terminated = false;
|
volatile bool terminated = false;
|
||||||
|
volatile bool shutdowned = false;
|
||||||
std::set<int> flags;
|
std::set<int> flags;
|
||||||
PerfMonitor perf;
|
PerfMonitor perf;
|
||||||
a8::uuid::SnowFlake uuid;
|
a8::uuid::SnowFlake uuid;
|
||||||
|
2
third_party/a8engine
vendored
2
third_party/a8engine
vendored
@ -1 +1 @@
|
|||||||
Subproject commit f9222e376f8a678a252932c4a3fb93860d7625f2
|
Subproject commit ca4bcdb5e2f8b32a637629f83ef152b321d97bf6
|
Loading…
x
Reference in New Issue
Block a user