1
This commit is contained in:
parent
59921a6bb4
commit
899a79c08e
@ -83,6 +83,31 @@ void Human::FillMFObjectFull(cs::MFObjectFull* full_data)
|
|||||||
p->set_sdmg(sdmg);
|
p->set_sdmg(sdmg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Human::FillMFPlayerStats(cs::MFPlayerStats* stats_pb)
|
||||||
|
{
|
||||||
|
stats_pb->set_player_id(entity_uniid);
|
||||||
|
stats_pb->set_player_avatar_url(avatar_url);
|
||||||
|
|
||||||
|
stats_pb->set_time_alive(dead_frameno * 1000.0f / SERVER_FRAME_RATE);
|
||||||
|
stats_pb->set_kills(stats.kills);
|
||||||
|
stats_pb->set_damage_amount(stats.damage_amount);
|
||||||
|
stats_pb->set_heal_amount(stats.heal_amount);
|
||||||
|
|
||||||
|
stats_pb->set_history_time_alive(stats.history_time_alive);
|
||||||
|
stats_pb->set_history_kills(stats.history_kills);
|
||||||
|
stats_pb->set_history_damage_amount(stats.history_damage_amount);
|
||||||
|
stats_pb->set_history_heal_amount(stats.history_heal_amount);
|
||||||
|
|
||||||
|
stats_pb->set_gold(stats.gold);
|
||||||
|
stats_pb->set_score(stats.score);
|
||||||
|
|
||||||
|
stats_pb->set_dead(dead);
|
||||||
|
stats_pb->set_killer_id(stats.killer_id);
|
||||||
|
stats_pb->set_killer_name(stats.killer_name);
|
||||||
|
|
||||||
|
stats_pb->set_account_id(account_id);
|
||||||
|
}
|
||||||
|
|
||||||
void Human::Shot(Vector2D& target_dir)
|
void Human::Shot(Vector2D& target_dir)
|
||||||
{
|
{
|
||||||
if (!curr_weapon->meta) {
|
if (!curr_weapon->meta) {
|
||||||
|
@ -13,12 +13,32 @@ struct HumanFrameData
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct PlayerStats
|
||||||
|
{
|
||||||
|
int kills = 0;
|
||||||
|
int damage_amount = 0;
|
||||||
|
int heal_amount = 0;
|
||||||
|
|
||||||
|
int history_time_alive = 0;
|
||||||
|
int history_kills = 0;
|
||||||
|
int history_damage_amount = 0;
|
||||||
|
int history_heal_amount = 0;
|
||||||
|
|
||||||
|
int gold = 0;
|
||||||
|
int score = 0;
|
||||||
|
|
||||||
|
int killer_id = 0;
|
||||||
|
std::string killer_name;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
class CircleCollider;
|
class CircleCollider;
|
||||||
class Obstacle;
|
class Obstacle;
|
||||||
class Human : public Entity
|
class Human : public Entity
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int team_id = 0;
|
int team_id = 0;
|
||||||
|
std::string account_id;
|
||||||
std::string team_uniid;
|
std::string team_uniid;
|
||||||
MetaData::Player* meta = nullptr;
|
MetaData::Player* meta = nullptr;
|
||||||
MetaData::Equip* helmet_meta = nullptr;
|
MetaData::Equip* helmet_meta = nullptr;
|
||||||
@ -28,6 +48,7 @@ class Human : public Entity
|
|||||||
Vector2D attack_dir;
|
Vector2D attack_dir;
|
||||||
|
|
||||||
std::string name;
|
std::string name;
|
||||||
|
std::string avatar_url;
|
||||||
float health = 0.0;
|
float health = 0.0;
|
||||||
bool dead = false;
|
bool dead = false;
|
||||||
bool downed = false;
|
bool downed = false;
|
||||||
@ -61,6 +82,7 @@ class Human : public Entity
|
|||||||
bool need_sync_active_player = false;
|
bool need_sync_active_player = false;
|
||||||
|
|
||||||
HumanFrameData frame_data;
|
HumanFrameData frame_data;
|
||||||
|
PlayerStats stats;
|
||||||
|
|
||||||
std::set<Entity*> new_objects;
|
std::set<Entity*> new_objects;
|
||||||
std::set<Entity*> part_objects;
|
std::set<Entity*> part_objects;
|
||||||
@ -71,6 +93,7 @@ class Human : public Entity
|
|||||||
virtual float GetSpeed() override;
|
virtual float GetSpeed() override;
|
||||||
virtual void FillMFObjectPart(cs::MFObjectPart* part_data) override;
|
virtual void FillMFObjectPart(cs::MFObjectPart* part_data) override;
|
||||||
virtual void FillMFObjectFull(cs::MFObjectFull* full_data) override;
|
virtual void FillMFObjectFull(cs::MFObjectFull* full_data) override;
|
||||||
|
virtual void FillMFPlayerStats(cs::MFPlayerStats* stats);
|
||||||
void Shot(Vector2D& target_dir);
|
void Shot(Vector2D& target_dir);
|
||||||
void RecalcSelfCollider();
|
void RecalcSelfCollider();
|
||||||
bool IsCollision();
|
bool IsCollision();
|
||||||
|
@ -23,12 +23,10 @@ class Player : public Human
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
int socket_handle = 0;
|
int socket_handle = 0;
|
||||||
std::string account_id;
|
|
||||||
int team_mode = 0;
|
int team_mode = 0;
|
||||||
int player_count = 0;
|
int player_count = 0;
|
||||||
bool auto_fill = false;
|
bool auto_fill = false;
|
||||||
bool use_touch = false;
|
bool use_touch = false;
|
||||||
std::string avatar_url;
|
|
||||||
|
|
||||||
int last_seq_id = 0;
|
int last_seq_id = 0;
|
||||||
bool moving = false;
|
bool moving = false;
|
||||||
|
@ -478,12 +478,12 @@ message MFPlayerStats
|
|||||||
optional string player_avatar_url = 2; //玩家头像
|
optional string player_avatar_url = 2; //玩家头像
|
||||||
|
|
||||||
//本次成绩
|
//本次成绩
|
||||||
optional int32 time_alive = 3; //存活时间
|
optional int32 time_alive = 3; //存活时间(毫秒)
|
||||||
optional int32 kills = 4; //击杀敌人数
|
optional int32 kills = 4; //击杀敌人数
|
||||||
optional int32 damage_amount = 8; //伤害总量
|
optional int32 damage_amount = 8; //伤害总量
|
||||||
optional int32 heal_amount = 20; //治疗总量
|
optional int32 heal_amount = 20; //治疗总量
|
||||||
//历史最佳成绩
|
//历史最佳成绩
|
||||||
optional int32 history_time_alive = 30; //存活时间
|
optional int32 history_time_alive = 30; //存活时间(毫秒)
|
||||||
optional int32 history_kills = 31; //击杀敌人数
|
optional int32 history_kills = 31; //击杀敌人数
|
||||||
optional int32 history_damage_amount = 32; //伤害总量
|
optional int32 history_damage_amount = 32; //伤害总量
|
||||||
optional int32 history_heal_amount = 33; //治疗总量
|
optional int32 history_heal_amount = 33; //治疗总量
|
||||||
@ -491,8 +491,9 @@ message MFPlayerStats
|
|||||||
optional int32 gold = 10; //金币
|
optional int32 gold = 10; //金币
|
||||||
optional int32 score = 11; //积分
|
optional int32 score = 11; //积分
|
||||||
|
|
||||||
optional int32 dead = 5; //是否已死亡
|
optional bool dead = 5; //是否已死亡
|
||||||
optional int32 killer_id = 7; //杀手id(自杀时为自己)
|
optional int32 killer_id = 7; //杀手id(自杀时为自己)
|
||||||
|
optional string killer_name = 40; //杀手名称
|
||||||
|
|
||||||
optional string account_id = 21; //账号id
|
optional string account_id = 21; //账号id
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user