添加统计信息
This commit is contained in:
parent
e3f4586442
commit
dd33c2b995
@ -9,7 +9,7 @@ else()
|
||||
endif()
|
||||
|
||||
set(CMAKE_BUILD_TYPE "Debug")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-std=gnu++11 -fsanitize=address -fno-omit-frame-pointer")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -g -std=gnu++11 -DGAME_ID=${GAME_ID}")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID}")
|
||||
|
||||
include_directories(
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include "metamgr.h"
|
||||
#include "android.ai.h"
|
||||
#include "room.h"
|
||||
#include "app.h"
|
||||
|
||||
Android::Android():Human()
|
||||
{
|
||||
@ -11,12 +12,14 @@ Android::Android():Human()
|
||||
entity_subtype = EST_Android;
|
||||
ai = new AndroidAI;
|
||||
ai->owner = this;
|
||||
++App::Instance()->perf.entity_num[ET_Android];
|
||||
}
|
||||
|
||||
Android::~Android()
|
||||
{
|
||||
delete ai;
|
||||
ai = nullptr;
|
||||
--App::Instance()->perf.entity_num[ET_Android];
|
||||
}
|
||||
|
||||
void Android::Initialize()
|
||||
|
@ -75,12 +75,6 @@ static void SavePerfLog()
|
||||
|
||||
void App::Init(int argc, char* argv[])
|
||||
{
|
||||
#if 0
|
||||
{
|
||||
Vector2D dir;
|
||||
dir.Normalize();
|
||||
}
|
||||
#endif
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
this->argc = argc;
|
||||
this->argv = argv;
|
||||
|
@ -5,14 +5,17 @@
|
||||
#include "metamgr.h"
|
||||
#include "room.h"
|
||||
#include "loot.h"
|
||||
#include "app.h"
|
||||
|
||||
Building::Building():Entity()
|
||||
{
|
||||
entity_type = ET_Building;
|
||||
++App::Instance()->perf.entity_num[ET_Building];
|
||||
}
|
||||
|
||||
Building::~Building()
|
||||
{
|
||||
--App::Instance()->perf.entity_num[ET_Building];
|
||||
}
|
||||
|
||||
void Building::Initialize()
|
||||
|
@ -6,14 +6,17 @@
|
||||
#include "collider.h"
|
||||
#include "obstacle.h"
|
||||
#include "player.h"
|
||||
#include "app.h"
|
||||
|
||||
Bullet::Bullet():Entity()
|
||||
{
|
||||
entity_type = ET_Bullet;
|
||||
++App::Instance()->perf.entity_num[ET_Bullet];
|
||||
}
|
||||
|
||||
Bullet::~Bullet()
|
||||
{
|
||||
--App::Instance()->perf.entity_num[ET_Bullet];
|
||||
}
|
||||
|
||||
void Bullet::Initialize()
|
||||
|
@ -24,6 +24,7 @@ enum EntityType_e
|
||||
|
||||
ET_Bullet = 20,
|
||||
|
||||
ET_Android = 30,
|
||||
ET_MAX
|
||||
};
|
||||
|
||||
|
@ -1456,7 +1456,9 @@ void Human::SendUpdateMsg()
|
||||
msg->clear_active_player_data();
|
||||
}
|
||||
}
|
||||
#if 1
|
||||
observer->SendNotifyMsg(*msg);
|
||||
#endif
|
||||
}
|
||||
delete msg;
|
||||
|
||||
|
@ -5,14 +5,17 @@
|
||||
#include "room.h"
|
||||
#include "collider.h"
|
||||
#include "entity.h"
|
||||
#include "app.h"
|
||||
|
||||
Loot::Loot():Entity()
|
||||
{
|
||||
entity_type = ET_Loot;
|
||||
++App::Instance()->perf.entity_num[ET_Loot];
|
||||
}
|
||||
|
||||
Loot::~Loot()
|
||||
{
|
||||
--App::Instance()->perf.entity_num[ET_Loot];
|
||||
}
|
||||
|
||||
void Loot::Initialize()
|
||||
|
@ -6,14 +6,17 @@
|
||||
#include "collider.h"
|
||||
#include "building.h"
|
||||
#include "human.h"
|
||||
#include "app.h"
|
||||
|
||||
Obstacle::Obstacle():Entity()
|
||||
{
|
||||
entity_type = ET_Obstacle;
|
||||
--App::Instance()->perf.entity_num[ET_Obstacle];
|
||||
}
|
||||
|
||||
Obstacle::~Obstacle()
|
||||
{
|
||||
--App::Instance()->perf.entity_num[ET_Obstacle];
|
||||
}
|
||||
|
||||
void Obstacle::Initialize()
|
||||
|
@ -11,16 +11,18 @@
|
||||
#include "obstacle.h"
|
||||
#include "building.h"
|
||||
#include "loot.h"
|
||||
#include "app.h"
|
||||
|
||||
Player::Player():Human()
|
||||
{
|
||||
entity_type = ET_Player;
|
||||
entity_subtype = EST_Player;
|
||||
++App::Instance()->perf.entity_num[ET_Player];
|
||||
}
|
||||
|
||||
Player::~Player()
|
||||
{
|
||||
|
||||
--App::Instance()->perf.entity_num[ET_Player];
|
||||
}
|
||||
|
||||
void Player::Initialize()
|
||||
|
@ -699,6 +699,9 @@ bool Room::CanJoin(const std::string& accountid)
|
||||
if (gas_data.gas_mode != GasInactive) {
|
||||
return false;
|
||||
}
|
||||
if (accountid_hash_.find(accountid) != accountid_hash_.end()) {
|
||||
return false;
|
||||
}
|
||||
if (App::Instance()->HasFlag(5)) {
|
||||
return accountid_hash_.size() < 1;
|
||||
} else {
|
||||
|
@ -74,12 +74,12 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
|
||||
inactive_room_hash_[room->room_uuid] = room;
|
||||
room_hash_[room->room_uuid] = room;
|
||||
}
|
||||
Player* hum = PlayerMgr::Instance()->CreatePlayerByCMJoin(hdr.socket_handle + i * 10, msg);
|
||||
if (i == 0) {
|
||||
{
|
||||
Player* hum = PlayerMgr::Instance()->CreatePlayerByCMJoin(hdr.socket_handle, msg);
|
||||
hum->meta = hum_meta;
|
||||
room->AddPlayer(hum);
|
||||
|
||||
if (i == 0) {
|
||||
{
|
||||
cs::SMJoinedNotify notifymsg;
|
||||
notifymsg.set_error_code(0);
|
||||
room->FillSMJoinedNotify(hum, notifymsg);
|
||||
|
@ -8,6 +8,7 @@ struct PerfMonitor
|
||||
long long out_data_size = 0;
|
||||
long long in_data_size = 0;
|
||||
long long read_count = 0;
|
||||
std::array<int, 30> entity_num = {};
|
||||
};
|
||||
|
||||
namespace MetaData
|
||||
|
2
third_party/a8engine
vendored
2
third_party/a8engine
vendored
@ -1 +1 @@
|
||||
Subproject commit ff8c00652d5367595c4adee8f95306ae1a46236b
|
||||
Subproject commit 1cf5fb6ba3f75c2b949962f9c12b39430c7ae2dc
|
Loading…
x
Reference in New Issue
Block a user