This commit is contained in:
aozhiwei 2021-09-28 11:11:44 +00:00
parent 785c62e3af
commit 5be77cc9ae
7 changed files with 23 additions and 8 deletions

View File

@ -14,6 +14,7 @@ enum CreatureStatus
CS_Disable = 2, CS_Disable = 2,
CS_Collisioning = 3, CS_Collisioning = 3,
CS_DisableAttack = 8, CS_DisableAttack = 8,
CS_ForceTeam = 9,
CS_End CS_End
}; };

View File

@ -157,6 +157,9 @@ void MatchTeam::Update()
UpdateSlave(); UpdateSlave();
} }
master_team_->SyncMatchInfo(); master_team_->SyncMatchInfo();
if (phase_ == kMatchStartGame) {
StartGame();
}
} }
void MatchTeam::SyncMatchInfo() void MatchTeam::SyncMatchInfo()
@ -247,7 +250,6 @@ void MatchTeam::UpdateMaster()
if (phase_left_time_ <= 0) { if (phase_left_time_ <= 0) {
phase_ = kMatchStartGame; phase_ = kMatchStartGame;
phase_start_tick_ = a8::XGetTickCount(); phase_start_tick_ = a8::XGetTickCount();
StartGame();
} }
} }
break; break;
@ -404,7 +406,6 @@ void MatchTeam::ShuaRobot()
void MatchTeam::StartGame() void MatchTeam::StartGame()
{ {
#if 0
RoomMgr::Instance()->JoinTeam(this); RoomMgr::Instance()->JoinTeam(this);
for (auto& member : curr_member_hash_) { for (auto& member : curr_member_hash_) {
if (member->socket_handle != 0) { if (member->socket_handle != 0) {
@ -415,7 +416,6 @@ void MatchTeam::StartGame()
MatchMgr::Instance()->RemoveTeam(pair.first); MatchMgr::Instance()->RemoveTeam(pair.first);
} }
MatchMgr::Instance()->RemoveTeam(GetTeamUUid()); MatchMgr::Instance()->RemoveTeam(GetTeamUUid());
#endif
} }
void MatchTeam::ChooseLeader() void MatchTeam::ChooseLeader()

View File

@ -348,7 +348,7 @@ public:
#ifdef DEBUG #ifdef DEBUG
MetaMgr::Instance()->match_team_time = 10; MetaMgr::Instance()->match_team_time = 10;
MetaMgr::Instance()->match_robot_time = 5; MetaMgr::Instance()->match_robot_time = 5;
MetaMgr::Instance()->match_choose_time = 30; MetaMgr::Instance()->match_choose_time = 15;
MetaMgr::Instance()->match_lock_time = 10; MetaMgr::Instance()->match_lock_time = 10;
#endif #endif
{ {

View File

@ -1178,7 +1178,7 @@ void Player::InternalAdOk()
void Player::PushJoinRoomMsg() void Player::PushJoinRoomMsg()
{ {
{ if (!a8::HasBitFlag(status, CS_ForceTeam)) {
cs::SMJoinedNotify notifymsg; cs::SMJoinedNotify notifymsg;
notifymsg.set_error_code(0); notifymsg.set_error_code(0);
notifymsg.set_room_mode((int)room->GetRoomMode()); notifymsg.set_room_mode((int)room->GetRoomMode());

View File

@ -101,11 +101,15 @@ Player* PlayerMgr::CreatePlayerByCMJoin(Player* hum,
hum->grow_weapon.ammo = weapon.ammo(); hum->grow_weapon.ammo = weapon.ammo();
} }
} }
for (auto& skin : msg.skins()) { #if 1
if (skin.skin_id() != 0 && skin.skin_lv() > 0) { {
hum->skin_configs[skin.skin_id()] = skin.skin_lv(); for (auto& skin : msg.skins()) {
if (skin.skin_id() != 0 && skin.skin_lv() > 0) {
hum->skin_configs[skin.skin_id()] = skin.skin_lv();
}
} }
} }
#endif
#if 1 #if 1
{ {
int idx = 0; int idx = 0;

View File

@ -3916,6 +3916,9 @@ void Room::AddTeam(class MatchTeam* team)
if (member->is_robot) { if (member->is_robot) {
MetaData::Robot* robot_meta = member->robot_meta; MetaData::Robot* robot_meta = member->robot_meta;
Android* hum = EntityFactory::Instance()->MakeAndroid(AllocUniid()); Android* hum = EntityFactory::Instance()->MakeAndroid(AllocUniid());
#if 1
a8::SetBitFlag(hum->status, CS_ForceTeam);
#endif
hum->name = robot_meta->i->name(); hum->name = robot_meta->i->name();
hum->meta = MetaMgr::Instance()->GetPlayer(robot_meta->i->hero_id()); hum->meta = MetaMgr::Instance()->GetPlayer(robot_meta->i->hero_id());
hum->robot_meta = robot_meta; hum->robot_meta = robot_meta;
@ -3954,6 +3957,11 @@ void Room::AddTeam(class MatchTeam* team)
new_team->AddMember(hum); new_team->AddMember(hum);
} else { } else {
Player* hum = NewPlayer(); Player* hum = NewPlayer();
#if 1
a8::SetBitFlag(hum->status, CS_ForceTeam);
member->msg.mutable_baseskin()->Clear();
member->msg.add_baseskin(1);
#endif
hum->ProcPreSettlementInfo(member->msg.pre_settlement_info()); hum->ProcPreSettlementInfo(member->msg.pre_settlement_info());
PlayerMgr::Instance()-> PlayerMgr::Instance()->
CreatePlayerByCMJoin(hum, CreatePlayerByCMJoin(hum,

View File

@ -880,6 +880,7 @@ message MFMatchTeamMember
optional bool is_leader = 8; // optional bool is_leader = 8; //
optional int32 state = 9; //0: 1: optional int32 state = 9; //0: 1:
optional int32 head = 10; // optional int32 head = 10; //
repeated int32 baseskin = 11; //id
} }
// //
@ -1108,6 +1109,7 @@ message CMMatchChoose
repeated MFWeapon weapons = 2; // repeated MFWeapon weapons = 2; //
repeated MFSkin skins = 3; // key: id value: repeated MFSkin skins = 3; // key: id value:
repeated MFPair skill_list = 4; // key:id value:,0 repeated MFPair skill_list = 4; // key:id value:,0
repeated int32 baseskin = 5; //id
} }
//- //-