1
This commit is contained in:
parent
21ed634aad
commit
22a8e08cd5
@ -535,3 +535,6 @@ const int ANDROID_AI_ID_START = 10001;
|
|||||||
const int MAX_SKILL_LV = 15;
|
const int MAX_SKILL_LV = 15;
|
||||||
|
|
||||||
const int CHECK_SHOT_HOLD_STATE_TIMER_EVENT = a8::TIMER_USER_EVENT + 1;
|
const int CHECK_SHOT_HOLD_STATE_TIMER_EVENT = a8::TIMER_USER_EVENT + 1;
|
||||||
|
|
||||||
|
const int kReviveTimeAdd = 12;
|
||||||
|
const int kSkinNum = 4;
|
||||||
|
@ -60,9 +60,6 @@
|
|||||||
|
|
||||||
#include "pbutils.h"
|
#include "pbutils.h"
|
||||||
|
|
||||||
const int kReviveTimeAdd = 12;
|
|
||||||
const int kSkinNum = 4;
|
|
||||||
|
|
||||||
static double TopXFunc (Human* sender, std::function<int (Human*, Human*)> cmpFunc)
|
static double TopXFunc (Human* sender, std::function<int (Human*, Human*)> cmpFunc)
|
||||||
{
|
{
|
||||||
std::vector<std::vector<Human*>> rank_list;
|
std::vector<std::vector<Human*>> rank_list;
|
||||||
@ -486,31 +483,6 @@ float Human::GetSpeed4()
|
|||||||
return meta->move_speed4();
|
return meta->move_speed4();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Human::FillMFObjectPart(Room* room, Human* hum, cs::MFObjectPart* part_data)
|
|
||||||
{
|
|
||||||
PBUtils::Human_FillMFObjectPart(this, room, hum, part_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Human::FillMFObjectLess(Room* room, Human* hum, cs::MFPlayerFull* full_data)
|
|
||||||
{
|
|
||||||
PBUtils::Human_FillMFObjectLess(this, room, hum, full_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Human::FillMFObjectFull(Room* room, Human* hum, cs::MFObjectFull* full_data)
|
|
||||||
{
|
|
||||||
PBUtils::Human_FillMFObjectFull(this, room, hum, full_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Human::FillMFObjectImage(Room* room, Human* hum, cs::MFCharacterImage* image_data)
|
|
||||||
{
|
|
||||||
PBUtils::Human_FillMFObjectImage(this, room, hum, image_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Human::FillMFPlayerStats(cs::MFPlayerStats* stats_pb)
|
|
||||||
{
|
|
||||||
PBUtils::Human_FillMFPlayerStats(this, stats_pb);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Human::GetAabbBox(AabbCollider& aabb_box)
|
void Human::GetAabbBox(AabbCollider& aabb_box)
|
||||||
{
|
{
|
||||||
if (!meta) {
|
if (!meta) {
|
||||||
@ -565,11 +537,6 @@ long long Human::GetRealDeadFrameNo(Room* room)
|
|||||||
return real_dead_frameno;
|
return real_dead_frameno;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Human::FillMFTeamData(Human* hum, cs::MFTeamData* team_data, bool is_game_over)
|
|
||||||
{
|
|
||||||
PBUtils::Human_FillMFTeamData(this, hum, team_data, is_game_over);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Human::CarShot(const glm::vec3& target_dir)
|
void Human::CarShot(const glm::vec3& target_dir)
|
||||||
{
|
{
|
||||||
if (!second_weapon.meta) {
|
if (!second_weapon.meta) {
|
||||||
@ -716,11 +683,6 @@ void Human::FindPathInMapService()
|
|||||||
SetPos(old_pos);
|
SetPos(old_pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Human::FillSMGameOver(cs::SMGameOver& msg)
|
|
||||||
{
|
|
||||||
PBUtils::Human_FillSMGameOver(this, msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Human::BeKill(int killer_id, const std::string& killer_name, int weapon_id,
|
void Human::BeKill(int killer_id, const std::string& killer_name, int weapon_id,
|
||||||
int real_killer_id, const std::string& real_killer_name)
|
int real_killer_id, const std::string& real_killer_name)
|
||||||
{
|
{
|
||||||
@ -1212,16 +1174,6 @@ void Human::SyncAroundPlayers(const char* file, int line, const char* func)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Human::FillMFActivePlayerData(cs::MFActivePlayerData* player_data)
|
|
||||||
{
|
|
||||||
PBUtils::Human_FillMFActivePlayerData(this, player_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Human::FillMFGasData(cs::MFGasData* gas_data)
|
|
||||||
{
|
|
||||||
PBUtils::Human_FillMFGasData(this, gas_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Human::RecalcVolume()
|
void Human::RecalcVolume()
|
||||||
{
|
{
|
||||||
const mt::Equip* backpack_meta = mt::Equip::GetById(backpack);
|
const mt::Equip* backpack_meta = mt::Equip::GetById(backpack);
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
#include <f8/udplog.h>
|
||||||
|
|
||||||
#include "cs_proto.pb.h"
|
#include "cs_proto.pb.h"
|
||||||
|
|
||||||
#include "pbutils.h"
|
#include "pbutils.h"
|
||||||
@ -20,6 +22,7 @@
|
|||||||
#include "skill.h"
|
#include "skill.h"
|
||||||
#include "skin.h"
|
#include "skin.h"
|
||||||
#include "typeconvert.h"
|
#include "typeconvert.h"
|
||||||
|
#include "team.h"
|
||||||
|
|
||||||
#include "mt/Param.h"
|
#include "mt/Param.h"
|
||||||
#include "mt/Buff.h"
|
#include "mt/Buff.h"
|
||||||
@ -27,6 +30,12 @@
|
|||||||
#include "mt/Hero.h"
|
#include "mt/Hero.h"
|
||||||
#include "mt/MapThing.h"
|
#include "mt/MapThing.h"
|
||||||
#include "mt/Skill.h"
|
#include "mt/Skill.h"
|
||||||
|
#include "mt/SafeArea.h"
|
||||||
|
#include "mt/Map.h"
|
||||||
|
#include "mt/PveGemini.h"
|
||||||
|
#include "mt/PveGeminiMode.h"
|
||||||
|
#include "mt/PveGeminiContent.h"
|
||||||
|
|
||||||
|
|
||||||
void PBUtils::Ability_FillMFAttrAdditionList(Ability* self, Human* hum, cs::MFActivePlayerData* player_data)
|
void PBUtils::Ability_FillMFAttrAdditionList(Ability* self, Human* hum, cs::MFActivePlayerData* player_data)
|
||||||
{
|
{
|
||||||
@ -427,21 +436,18 @@ void PBUtils::Human_SendSMPvePassWave(Human* self, int new_wave, int pve_max_wav
|
|||||||
self->SendNotifyMsg(notify_msg);
|
self->SendNotifyMsg(notify_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PBUtils::Human_FillMFObjectPart(Human* self, Room* room, Human* hum, cs::MFObjectPart* part_data)
|
void Human::FillMFObjectPart(Room* room, Human* hum, cs::MFObjectPart* part_data)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
part_data->set_object_type(ET_Player);
|
part_data->set_object_type(ET_Player);
|
||||||
cs::MFPlayerPart* p = part_data->mutable_union_obj_1();
|
cs::MFPlayerPart* p = part_data->mutable_union_obj_1();
|
||||||
p->set_obj_uniid(GetUniId());
|
p->set_obj_uniid(GetUniId());
|
||||||
p->set_speed(GetSpeed() * SERVER_FRAME_RATE);
|
p->set_speed(GetSpeed() * SERVER_FRAME_RATE);
|
||||||
TypeConvert::ToPb(GetPos(), p->mutable_pos());
|
TypeConvert::ToPb(GetPos(), p->mutable_pos());
|
||||||
TypeConvert::ToPb(GetAttackDir(), p->mutable_dir());
|
TypeConvert::ToPb(GetAttackDir(), p->mutable_dir());
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PBUtils::Human_FillMFObjectLess(Human* self, Room* room, Human* hum, cs::MFPlayerFull* full_data)
|
void Human::FillMFObjectLess(Room* room, Human* hum, cs::MFPlayerFull* full_data)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
cs::MFPlayerFull* p = full_data;
|
cs::MFPlayerFull* p = full_data;
|
||||||
p->set_obj_uniid(GetUniId());
|
p->set_obj_uniid(GetUniId());
|
||||||
TypeConvert::ToPb(GetPos(), p->mutable_pos());
|
TypeConvert::ToPb(GetPos(), p->mutable_pos());
|
||||||
@ -470,12 +476,10 @@ void PBUtils::Human_FillMFObjectLess(Human* self, Room* room, Human* hum, cs::MF
|
|||||||
p->set_car_uniid(0);
|
p->set_car_uniid(0);
|
||||||
p->set_car_seat(0);
|
p->set_car_seat(0);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PBUtils::Human_FillMFObjectFull(Human* self, Room* room, Human* hum, cs::MFObjectFull* full_data)
|
void Human::FillMFObjectFull(Room* room, Human* hum, cs::MFObjectFull* full_data)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
full_data->set_object_type(ET_Player);
|
full_data->set_object_type(ET_Player);
|
||||||
cs::MFPlayerFull* p = full_data->mutable_union_obj_1();
|
cs::MFPlayerFull* p = full_data->mutable_union_obj_1();
|
||||||
p->set_obj_uniid(GetUniId());
|
p->set_obj_uniid(GetUniId());
|
||||||
@ -583,21 +587,17 @@ void PBUtils::Human_FillMFObjectFull(Human* self, Room* room, Human* hum, cs::MF
|
|||||||
p->set_shield_hp(shield_hp_);
|
p->set_shield_hp(shield_hp_);
|
||||||
p->set_shield_max_hp(shield_max_hp_);
|
p->set_shield_max_hp(shield_max_hp_);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PBUtils::Human_FillMFObjectImage(Human* self, Room* room, Human* hum, cs::MFCharacterImage* image_data)
|
void Human::FillMFObjectImage(Room* room, Human* hum, cs::MFCharacterImage* image_data)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
image_data->set_obj_uniid(GetUniId());
|
image_data->set_obj_uniid(GetUniId());
|
||||||
image_data->set_cur_weapon_idx(GetCurrWeapon()->weapon_idx);
|
image_data->set_cur_weapon_idx(GetCurrWeapon()->weapon_idx);
|
||||||
GetCurrWeapon()->ToPB(this, image_data->mutable_weapon());
|
GetCurrWeapon()->ToPB(this, image_data->mutable_weapon());
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PBUtils::Human_FillMFPlayerStats(Human* self, cs::MFPlayerStats* stats_pb)
|
void Human::FillMFPlayerStats(cs::MFPlayerStats* stats_pb)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
stats_pb->set_player_id(GetUniId());
|
stats_pb->set_player_id(GetUniId());
|
||||||
stats_pb->set_player_avatar_url(avatar_url);
|
stats_pb->set_player_avatar_url(avatar_url);
|
||||||
stats_pb->set_charid(meta->id());
|
stats_pb->set_charid(meta->id());
|
||||||
@ -691,12 +691,10 @@ void PBUtils::Human_FillMFPlayerStats(Human* self, cs::MFPlayerStats* stats_pb)
|
|||||||
*stats_pb->mutable_hero_stats() = stats.pb_hero_stats;
|
*stats_pb->mutable_hero_stats() = stats.pb_hero_stats;
|
||||||
*stats_pb->mutable_weapons_stats() = stats.pb_weapons_stats;
|
*stats_pb->mutable_weapons_stats() = stats.pb_weapons_stats;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PBUtils::Human_FillMFTeamData(Human* self, Human* hum, cs::MFTeamData* team_data, bool is_game_over)
|
void Human::FillMFTeamData(Human* hum, cs::MFTeamData* team_data, bool is_game_over)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
{
|
{
|
||||||
last_sync_teamdata_frameno_ = room->GetFrameNo();
|
last_sync_teamdata_frameno_ = room->GetFrameNo();
|
||||||
|
|
||||||
@ -764,12 +762,10 @@ void PBUtils::Human_FillMFTeamData(Human* self, Human* hum, cs::MFTeamData* team
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PBUtils::Human_FillSMGameOver(Human* self, cs::SMGameOver& msg)
|
void Human::FillSMGameOver(cs::SMGameOver& msg)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
int alive_team_num = room->GetAliveTeamNum();
|
int alive_team_num = room->GetAliveTeamNum();
|
||||||
|
|
||||||
if (stats.victory) {
|
if (stats.victory) {
|
||||||
@ -873,13 +869,10 @@ void PBUtils::Human_FillSMGameOver(Human* self, cs::SMGameOver& msg)
|
|||||||
}
|
}
|
||||||
*msg.mutable_settlement() = *p->settlement;
|
*msg.mutable_settlement() = *p->settlement;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PBUtils::Human_FillMFActivePlayerData(Human* self, cs::MFActivePlayerData* player_data)
|
void Human::FillMFActivePlayerData(cs::MFActivePlayerData* player_data)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
#ifdef DEBUG1
|
#ifdef DEBUG1
|
||||||
a8::XPrintf("FillMFActivePlayerData isPlayer:%d id:%d name:%s need_sync_active_player:%d send_msg_times:%d\n",
|
a8::XPrintf("FillMFActivePlayerData isPlayer:%d id:%d name:%s need_sync_active_player:%d send_msg_times:%d\n",
|
||||||
{
|
{
|
||||||
@ -975,12 +968,10 @@ void PBUtils::Human_FillMFActivePlayerData(Human* self, cs::MFActivePlayerData*
|
|||||||
player_data->set_shield_hp(shield_hp_);
|
player_data->set_shield_hp(shield_hp_);
|
||||||
player_data->set_shield_max_hp(shield_max_hp_);
|
player_data->set_shield_max_hp(shield_max_hp_);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PBUtils::Human_FillMFGasData(Human* self, cs::MFGasData* gas_data)
|
void Human::FillMFGasData(cs::MFGasData* gas_data)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
gas_data->set_mode(room->GetGasData().GetGasMode());
|
gas_data->set_mode(room->GetGasData().GetGasMode());
|
||||||
if (room->GetGasData().GetGasMode() == GasInactive) {
|
if (room->GetGasData().GetGasMode() == GasInactive) {
|
||||||
long long duration = room->GetGasInactiveTime() * SERVER_FRAME_RATE -
|
long long duration = room->GetGasInactiveTime() * SERVER_FRAME_RATE -
|
||||||
@ -1020,5 +1011,4 @@ void PBUtils::Human_FillMFGasData(Human* self, cs::MFGasData* gas_data)
|
|||||||
}
|
}
|
||||||
gas_data->set_rad_old(room->GetGasData().rad_old);
|
gas_data->set_rad_old(room->GetGasData().rad_old);
|
||||||
gas_data->set_rad_new(room->GetGasData().rad_new);
|
gas_data->set_rad_new(room->GetGasData().rad_new);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user