1
This commit is contained in:
parent
79c44dfdb5
commit
5986bc6250
@ -33,6 +33,7 @@
|
||||
#include "player.h"
|
||||
#include "app.h"
|
||||
#include "tracemgr.h"
|
||||
#include "gamelog.h"
|
||||
|
||||
#include "mt/Param.h"
|
||||
#include "mt/Hero.h"
|
||||
@ -2573,6 +2574,9 @@ void Creature::WinExp(int win_exp)
|
||||
hero_level_ = hero_grow_meta_->level();
|
||||
hero_exp_ = 0;
|
||||
GenLevelAttr();
|
||||
if (IsPlayer()) {
|
||||
GameLog::Instance()->LevelUp(AsHuman(), old_level, GetHeroLevel());
|
||||
}
|
||||
}
|
||||
room->frame_event.AddPropChgEx
|
||||
(
|
||||
|
@ -126,3 +126,31 @@ void GameLog::ForceOver(Room* room)
|
||||
|
||||
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());
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include <a8/singleton.h>
|
||||
|
||||
class Human;
|
||||
class Player;
|
||||
class Room;
|
||||
class GameLog : public a8::Singleton<GameLog>
|
||||
@ -12,6 +13,7 @@ class GameLog : public a8::Singleton<GameLog>
|
||||
public:
|
||||
void GameStart(Player* hum);
|
||||
void GameEnd(Player* hum);
|
||||
void LevelUp(Human* hum, int old_level, int new_level);
|
||||
void ForceOver(Room* room);
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user