This commit is contained in:
aozhiwei 2024-04-28 15:33:19 +08:00
commit 326402f01c
6 changed files with 85 additions and 19 deletions

View File

@ -199,6 +199,7 @@ enum GunSubEquipType_e
GUN_SUB_EQUIP_TYPE_THREE_GUN = 9, GUN_SUB_EQUIP_TYPE_THREE_GUN = 9,
GUN_SUB_EQUIP_TYPE_LASER_CANNON = 10, GUN_SUB_EQUIP_TYPE_LASER_CANNON = 10,
GUN_SUB_EQUIP_TYPE_FLY_HOOk = 14, GUN_SUB_EQUIP_TYPE_FLY_HOOk = 14,
GUN_SUB_EQUIP_TYPE_FLY_LASER = 15,
GUN_SUB_EQUIP_TYPE_End GUN_SUB_EQUIP_TYPE_End
}; };

View File

@ -33,6 +33,7 @@
#include "player.h" #include "player.h"
#include "app.h" #include "app.h"
#include "tracemgr.h" #include "tracemgr.h"
#include "gamelog.h"
#include "mt/Param.h" #include "mt/Param.h"
#include "mt/Hero.h" #include "mt/Hero.h"
@ -2573,6 +2574,9 @@ void Creature::WinExp(int win_exp)
hero_level_ = hero_grow_meta_->level(); hero_level_ = hero_grow_meta_->level();
hero_exp_ = 0; hero_exp_ = 0;
GenLevelAttr(); GenLevelAttr();
if (IsPlayer()) {
GameLog::Instance()->LevelUp(AsHuman(), old_level, GetHeroLevel());
}
} }
room->frame_event.AddPropChgEx room->frame_event.AddPropChgEx
( (

View File

@ -125,18 +125,28 @@ void FrameEvent::AddBullet(int bullet_uniid,
} }
{ {
int bullet_idx = room->frame_event_data->bullets_.size() - 1; int bullet_idx = room->frame_event_data->bullets_.size() - 1;
sender.Get()->TraverseAllLayerHumanList if (weapon_meta->equip_subtype() == GUN_SUB_EQUIP_TYPE_FLY_LASER) {
( sender.Get()->room->TraverseHumanList
[bullet_idx, &sender] (Human* hum, bool& stop) (
{ [bullet_idx] (Human* hum) -> bool
{
hum->GetFrameData().bullets_.push_back(bullet_idx);
return true;
});
} else {
sender.Get()->TraverseAllLayerHumanList
(
[bullet_idx, &sender] (Human* hum, bool& stop)
{
#ifdef MYDEBUG1 #ifdef MYDEBUG1
// 999 // 999
if (!hum->InPartObjects(sender.Get())) { if (!hum->InPartObjects(sender.Get())) {
A8_ABORT(); A8_ABORT();
} }
#endif #endif
hum->GetFrameData().bullets_.push_back(bullet_idx); hum->GetFrameData().bullets_.push_back(bullet_idx);
}); });
}
} }
} }

View File

@ -7,9 +7,11 @@
#include "app.h" #include "app.h"
#include "room.h" #include "room.h"
#include "stats.h" #include "stats.h"
#include "team.h"
#include "mt/Hero.h" #include "mt/Hero.h"
#include "mt/Map.h" #include "mt/Map.h"
#include "mt/MapMode.h"
void GameLog::GameStart(Player* hum) void GameLog::GameStart(Player* hum)
{ {
@ -35,11 +37,14 @@ void GameLog::GameStart(Player* hum)
//prop->SetVal("localuuid", ""); //prop->SetVal("localuuid", "");
//prop->SetVal("start_param", ""); //prop->SetVal("start_param", "");
prop->SetVal("team_id", hum->team_id); prop->SetVal("team_id", hum->team_id);
prop->SetVal("server_zone_id", f8::App::Instance()->GetZoneId());
prop->SetVal("server_node_id", f8::App::Instance()->GetNodeId()); prop->SetVal("server_node_id", f8::App::Instance()->GetNodeId());
prop->SetVal("server_instance_id", f8::App::Instance()->GetInstanceId()); prop->SetVal("server_instance_id", f8::App::Instance()->GetInstanceId());
prop->SetVal("map_id", hum->room->GetMapMeta()->map_id()); prop->SetVal("map_id", hum->room->GetMapMeta()->map_id());
prop->SetVal("map_name", hum->room->GetMapMeta()->map_name()); prop->SetVal("map_name", hum->room->GetMapMeta()->map_name());
prop->SetVal("map_mode_id", hum->room->GetMapModeMeta()->id());
prop->SetVal("map_mode", hum->room->GetMapModeMeta()->mapMode());
f8::TGLog::Instance()->AddTrackLog(game_id, hum->account_id, hum->ip_saddr, logclass1, logclass2, prop.get()); f8::TGLog::Instance()->AddTrackLog(game_id, hum->account_id, hum->ip_saddr, logclass1, logclass2, prop.get());
} }
@ -74,11 +79,16 @@ void GameLog::GameEnd(Player* hum)
prop->SetVal("game_time", a8::XGetTickCount() - hum->create_tick); prop->SetVal("game_time", a8::XGetTickCount() - hum->create_tick);
//prop->SetVal("start_param", ""); //prop->SetVal("start_param", "");
prop->SetVal("team_id", hum->team_id); prop->SetVal("team_id", hum->team_id);
prop->SetVal("battle_uuid", hum->GetTeam()->GetBattleUuid());
prop->SetVal("server_zone_id", f8::App::Instance()->GetZoneId());
prop->SetVal("server_node_id", f8::App::Instance()->GetNodeId()); prop->SetVal("server_node_id", f8::App::Instance()->GetNodeId());
prop->SetVal("server_instance_id", f8::App::Instance()->GetInstanceId()); prop->SetVal("server_instance_id", f8::App::Instance()->GetInstanceId());
prop->SetVal("map_id", hum->room->GetMapMeta()->map_id()); prop->SetVal("map_id", hum->room->GetMapMeta()->map_id());
prop->SetVal("map_name", hum->room->GetMapMeta()->map_name()); prop->SetVal("map_name", hum->room->GetMapMeta()->map_name());
prop->SetVal("map_mode_id", hum->room->GetMapModeMeta()->id());
prop->SetVal("map_mode", hum->room->GetMapModeMeta()->mapMode());
if (!hum->dead) { if (!hum->dead) {
prop->SetVal("alive_time", hum->room->GetFrameNo() * 1000.0f / SERVER_FRAME_RATE); prop->SetVal("alive_time", hum->room->GetFrameNo() * 1000.0f / SERVER_FRAME_RATE);
} else { } else {
@ -101,8 +111,46 @@ void GameLog::ForceOver(Room* room)
prop->SetVal("battle_started", a8::XValue(room->BattleStarted() ? 1 : 0)); prop->SetVal("battle_started", a8::XValue(room->BattleStarted() ? 1 : 0));
prop->SetVal("game_duration", room->GetFrameNo() * SERVER_FRAME_RATE); prop->SetVal("game_duration", room->GetFrameNo() * SERVER_FRAME_RATE);
prop->SetVal("player_num", room->GetPlayerNum()); prop->SetVal("player_num", room->GetPlayerNum());
prop->SetVal("server_zone_id", f8::App::Instance()->GetZoneId());
prop->SetVal("server_node_id", f8::App::Instance()->GetNodeId()); prop->SetVal("server_node_id", f8::App::Instance()->GetNodeId());
prop->SetVal("server_instance_id", f8::App::Instance()->GetInstanceId()); prop->SetVal("server_instance_id", f8::App::Instance()->GetInstanceId());
#if 0
prop->SetVal("team_id", hum->team_id);
prop->SetVal("battle_uuid", hum->GetTeam()->GetBattleUuid());
#endif
prop->SetVal("map_id", room->GetMapMeta()->map_id());
prop->SetVal("map_name", room->GetMapMeta()->map_name());
prop->SetVal("map_mode_id", room->GetMapModeMeta()->id());
prop->SetVal("map_mode", room->GetMapModeMeta()->mapMode());
f8::TGLog::Instance()->AddTrackLog(game_id, "forceover", 0, "forceover", prop.get()); f8::TGLog::Instance()->AddTrackLog(game_id, "forceover", 0, "forceover", prop.get());
} }
void GameLog::LevelUp(Human* hum, int old_level, int new_level)
{
int game_id = GAME_ID;
auto prop = a8::MutableXObject::CreateObject();
prop->SetVal("game_uniid", a8::XValue(hum->room->GetRoomUuid()).GetString());
prop->SetVal("room_type", a8::XValue(hum->room->GetRoomType()).GetString());
prop->SetVal("room_mode", a8::XValue((int)hum->room->GetRoomMode()));
prop->SetVal("battle_started", a8::XValue(hum->room->BattleStarted() ? 1 : 0));
prop->SetVal("game_duration", hum->room->GetFrameNo() * SERVER_FRAME_RATE);
prop->SetVal("player_num", hum->room->GetPlayerNum());
prop->SetVal("server_zone_id", f8::App::Instance()->GetZoneId());
prop->SetVal("server_node_id", f8::App::Instance()->GetNodeId());
prop->SetVal("server_instance_id", f8::App::Instance()->GetInstanceId());
prop->SetVal("team_id", hum->team_id);
prop->SetVal("battle_uuid", hum->GetTeam()->GetBattleUuid());
prop->SetVal("old_level", old_level);
prop->SetVal("new_level", new_level);
prop->SetVal("map_id", hum->room->GetMapMeta()->map_id());
prop->SetVal("map_name", hum->room->GetMapMeta()->map_name());
prop->SetVal("map_mode_id", hum->room->GetMapModeMeta()->id());
prop->SetVal("map_mode", hum->room->GetMapModeMeta()->mapMode());
f8::TGLog::Instance()->AddTrackLog(game_id, "level_up", 0, "level_up", prop.get());
}

View File

@ -2,6 +2,7 @@
#include <a8/singleton.h> #include <a8/singleton.h>
class Human;
class Player; class Player;
class Room; class Room;
class GameLog : public a8::Singleton<GameLog> class GameLog : public a8::Singleton<GameLog>
@ -12,6 +13,7 @@ class GameLog : public a8::Singleton<GameLog>
public: public:
void GameStart(Player* hum); void GameStart(Player* hum);
void GameEnd(Player* hum); void GameEnd(Player* hum);
void LevelUp(Human* hum, int old_level, int new_level);
void ForceOver(Room* room); void ForceOver(Room* room);
private: private:

View File

@ -194,20 +194,21 @@ static void InternalCreateBullet(BulletInfo& bullet_info)
if (c->downed) { if (c->downed) {
return; return;
} }
#ifdef MYDEBUG
if (bullet_info.weapon_meta->id() == 60111) {
a8::XPrintf("create bullet %d %d\n",
{
bullet_info.bullet_idx,
bullet_info.delay_time
});
}
#endif
if (bullet_info.shot_animi && bullet_info.shot_animi->is_other) { if (bullet_info.shot_animi && bullet_info.shot_animi->is_other) {
bullet_info.shot_animi_time += bullet_info.delay_time; bullet_info.shot_animi_time += bullet_info.delay_time;
bullet_info.delay_time = 0; bullet_info.delay_time = 0;
} }
if (bullet_info.delay_time <= 0) { if (bullet_info.delay_time <= 0) {
#ifdef MYDEBUG
if (c->IsPlayer()) {
a8::XPrintf("create bullet %d %d frameno:%d\n",
{
bullet_info.bullet_idx,
bullet_info.delay_time,
c->room->GetFrameNo()
});
}
#endif
if (c->GetCurrWeapon()->meta->bullet_consume_type() == kBulletConsumeMulti) { if (c->GetCurrWeapon()->meta->bullet_consume_type() == kBulletConsumeMulti) {
if (c->GetCurrWeapon()->ammo <= 0) { if (c->GetCurrWeapon()->ammo <= 0) {
return; return;