1
This commit is contained in:
parent
785c62e3af
commit
5be77cc9ae
@ -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
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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()
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
@ -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());
|
||||||
|
@ -101,11 +101,15 @@ Player* PlayerMgr::CreatePlayerByCMJoin(Player* hum,
|
|||||||
hum->grow_weapon.ammo = weapon.ammo();
|
hum->grow_weapon.ammo = weapon.ammo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if 1
|
||||||
|
{
|
||||||
for (auto& skin : msg.skins()) {
|
for (auto& skin : msg.skins()) {
|
||||||
if (skin.skin_id() != 0 && skin.skin_lv() > 0) {
|
if (skin.skin_id() != 0 && skin.skin_lv() > 0) {
|
||||||
hum->skin_configs[skin.skin_id()] = skin.skin_lv();
|
hum->skin_configs[skin.skin_id()] = skin.skin_lv();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#if 1
|
#if 1
|
||||||
{
|
{
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
|
@ -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,
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
//组队匹配-出击
|
//组队匹配-出击
|
||||||
|
Loading…
x
Reference in New Issue
Block a user