This commit is contained in:
aozhiwei 2020-07-08 15:33:35 +08:00
parent 759a5dbacd
commit f6b1961819
5 changed files with 36 additions and 6 deletions

View File

@ -145,6 +145,11 @@ class Human : public MoveableEntity
xtimer_list* ad_timer_ = nullptr;
Human* last_human_target = nullptr;
int game_times = 0;
int win_times = 0;
int kill_times = 0;
int rank = 0;
std::function<void(Human*)> on_grid_chg;
Human();

View File

@ -1343,3 +1343,13 @@ void Player::PushJoinRoomMsg()
GGListener::Instance()->SendToClient(socket_handle, 0, notifymsg);
}
}
void Player::ProcPreSettlementInfo(const std::string& pre_settlement_info)
{
std::vector<std::string> tmp_strings;
a8::Split(pre_settlement_info, tmp_strings, ',');
game_times = a8::XValue(tmp_strings[0]);
win_times = a8::XValue(tmp_strings[1]);
kill_times = a8::XValue(tmp_strings[2]);
rank = a8::XValue(tmp_strings[3]);
}

View File

@ -85,6 +85,7 @@ class Player : public Human
prepare_items);
void ProcPrepareItems2(const ::google::protobuf::RepeatedPtrField< cs::MFPair >&
prepare_items);
void ProcPreSettlementInfo(const std::string& pre_settlement_info);
void PushJoinRoomMsg();
void _CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg);

View File

@ -41,14 +41,24 @@ static RoomType_e GetHumanRoomType(const cs::CMJoin& msg)
}
#endif
#if 0
int win_times = a8::XValue(tmp_strings[1]);
int kill_times = a8::XValue(tmp_strings[2]);
#endif
if (game_times < MetaMgr::Instance()->newbie_game_times) {
if (game_times < 0) {
return RT_NewBrid;
} else if (game_times == MetaMgr::Instance()->newbie_game_times + 1) {
} else if (game_times == 1) {
return RT_MidBrid;
} else {
switch (game_times) {
case 2:
case 3:
case 4:
{
}
break;
default:
{
}
break;
}
}
return RT_OldBrid;
}
@ -95,6 +105,7 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
return;
}
Player* hum = room->NewPlayer();
hum->ProcPreSettlementInfo(msg.pre_settlement_info());
PlayerMgr::Instance()->
CreatePlayerByCMJoin(hum,
hdr.ip_saddr,

View File

@ -668,6 +668,9 @@ message MFTeamMember
optional string account_id = 1; //id
optional int32 rank = 2; //
optional bool is_leader = 3; //
optional int32 game_times = 4; //
optional int32 win_times = 5; //
optional int32 kill_times = 6; //
}
//end mfmsg