1
This commit is contained in:
parent
759a5dbacd
commit
f6b1961819
@ -145,6 +145,11 @@ class Human : public MoveableEntity
|
|||||||
xtimer_list* ad_timer_ = nullptr;
|
xtimer_list* ad_timer_ = nullptr;
|
||||||
Human* last_human_target = 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;
|
std::function<void(Human*)> on_grid_chg;
|
||||||
|
|
||||||
Human();
|
Human();
|
||||||
|
@ -1343,3 +1343,13 @@ void Player::PushJoinRoomMsg()
|
|||||||
GGListener::Instance()->SendToClient(socket_handle, 0, notifymsg);
|
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]);
|
||||||
|
}
|
||||||
|
@ -85,6 +85,7 @@ class Player : public Human
|
|||||||
prepare_items);
|
prepare_items);
|
||||||
void ProcPrepareItems2(const ::google::protobuf::RepeatedPtrField< cs::MFPair >&
|
void ProcPrepareItems2(const ::google::protobuf::RepeatedPtrField< cs::MFPair >&
|
||||||
prepare_items);
|
prepare_items);
|
||||||
|
void ProcPreSettlementInfo(const std::string& pre_settlement_info);
|
||||||
void PushJoinRoomMsg();
|
void PushJoinRoomMsg();
|
||||||
|
|
||||||
void _CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg);
|
void _CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg);
|
||||||
|
@ -41,14 +41,24 @@ static RoomType_e GetHumanRoomType(const cs::CMJoin& msg)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
if (game_times < 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) {
|
|
||||||
return RT_NewBrid;
|
return RT_NewBrid;
|
||||||
} else if (game_times == MetaMgr::Instance()->newbie_game_times + 1) {
|
} else if (game_times == 1) {
|
||||||
return RT_MidBrid;
|
return RT_MidBrid;
|
||||||
|
} else {
|
||||||
|
switch (game_times) {
|
||||||
|
case 2:
|
||||||
|
case 3:
|
||||||
|
case 4:
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return RT_OldBrid;
|
return RT_OldBrid;
|
||||||
}
|
}
|
||||||
@ -95,6 +105,7 @@ void RoomMgr::_CMJoin(f8::MsgHdr& hdr, const cs::CMJoin& msg)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Player* hum = room->NewPlayer();
|
Player* hum = room->NewPlayer();
|
||||||
|
hum->ProcPreSettlementInfo(msg.pre_settlement_info());
|
||||||
PlayerMgr::Instance()->
|
PlayerMgr::Instance()->
|
||||||
CreatePlayerByCMJoin(hum,
|
CreatePlayerByCMJoin(hum,
|
||||||
hdr.ip_saddr,
|
hdr.ip_saddr,
|
||||||
|
@ -668,6 +668,9 @@ message MFTeamMember
|
|||||||
optional string account_id = 1; //账号id
|
optional string account_id = 1; //账号id
|
||||||
optional int32 rank = 2; //段位
|
optional int32 rank = 2; //段位
|
||||||
optional bool is_leader = 3; //是否队长
|
optional bool is_leader = 3; //是否队长
|
||||||
|
optional int32 game_times = 4; //游戏次数
|
||||||
|
optional int32 win_times = 5; //吃鸡次数
|
||||||
|
optional int32 kill_times = 6; //击杀数
|
||||||
}
|
}
|
||||||
|
|
||||||
//end mfmsg
|
//end mfmsg
|
||||||
|
Loading…
x
Reference in New Issue
Block a user