添加用户自定义数据

This commit is contained in:
aozhiwei 2020-12-23 14:04:10 +08:00
parent 583fc94230
commit 000321b26a
4 changed files with 13 additions and 0 deletions

View File

@ -234,6 +234,9 @@ void Human::FillMFObjectFull(Room* room, Human* hum, cs::MFObjectFull* full_data
if (sex != 0) {
p->set_sex(sex);
}
if (!user_data.empty()) {
p->set_user_data(user_data);
}
p->set_vip(vip);
p->set_sdmg(sdmg);
p->set_kill_count(stats.kills);
@ -416,6 +419,10 @@ void Human::FillMFTeamData(cs::MFTeamData* team_data, bool is_game_over)
if (sex != 0) {
team_data->set_sex(sex);
}
if (room->GetGasData().gas_mode == GasInactive ||
room->GetFrameNo() - room->GetBattleStartFrameNo() < 4) {
team_data->set_user_data(user_data);
}
}
}

View File

@ -66,6 +66,7 @@ class Human : public MoveableEntity
int vip_lv = 0;
int head = 0;
int sex = 0;
std::string user_data;
long long last_cmmove_frameno = 0;
bool downed = false;
bool disconnected = false;

View File

@ -76,6 +76,7 @@ Player* PlayerMgr::CreatePlayerByCMJoin(Player* hum,
hum->vip_lv = msg.vip_lv();
hum->head = msg.head();
hum->sex = msg.sex();
hum->user_data = msg.user_data();
#if 0
if (hum->atk_add > 0.9999f) {
hum->atk_add = hum->atk_add / 100.0f;

View File

@ -225,6 +225,8 @@ message MFPlayerFull
//
optional int32 charid = 44; //id
optional string user_data = 60 [default = ""]; //
}
//-
@ -525,6 +527,7 @@ message MFTeamData
optional bool downed = 7 [default = false]; //
optional string name = 8; //
optional float max_health = 9; //
optional string user_data = 60 [default = ""]; //
//
optional string account_id = 10; //id
@ -755,6 +758,7 @@ message CMJoin
repeated MFTeamMember team_members = 51; //
optional int32 room_mode = 52; //0: 1:
optional int32 mapid = 53; //id 0:
optional string user_data = 60 [default = ""]; //
}
//线