This commit is contained in:
aozhiwei 2023-12-28 17:21:37 +08:00
parent 74da321839
commit c74d4fdbe0
2 changed files with 20 additions and 2 deletions

View File

@ -46,6 +46,7 @@
#include "batchsync.h" #include "batchsync.h"
#include "mobabattle.h" #include "mobabattle.h"
#include "roommgr.h" #include "roommgr.h"
#include "bornpoint.h"
#include "mt/Param.h" #include "mt/Param.h"
#include "mt/Buff.h" #include "mt/Buff.h"
@ -2052,6 +2053,9 @@ void Human::ReJoin(long ip_saddr, int socket_handle, std::shared_ptr<cs::CMJoin>
PushJoinRoomMsg(); PushJoinRoomMsg();
RefreshView(); RefreshView();
room->NotifyUiUpdate(); room->NotifyUiUpdate();
if (room->IsMobaModeRoom()) {
SendMobaTeamNotify();
}
} }
void GGListener::SendError(int sockhandle, unsigned int seqid, void GGListener::SendError(int sockhandle, unsigned int seqid,
@ -2383,10 +2387,24 @@ int Room::InitWithMobaBattle(long ip_saddr, int socket_handle, std::shared_ptr<c
return true; return true;
}); });
}; };
int side = a8::RandEx(1, 2);
for (size_t i = 0; i < 2; ++i) { for (size_t i = 0; i < 2; ++i) {
auto team = room_teams.at(i); auto team = room_teams.at(i);
if (team->GetMemberNum() < MAX_TEAM_NUM) { if (team->GetMemberNum() < MAX_TEAM_NUM) {
CreateAndroid(MAX_TEAM_NUM - team->GetMemberNum()); CreateAndroid(MAX_TEAM_NUM - team->GetMemberNum(), team);
}
team->TraverseMembers
(
[this, side] (Human* hum) -> bool
{
hum->side = side;
hum->born_point->wo_meta = std::get<0>(GetMapMeta()->moba_born_points.at(side - 1));
hum->InitMobaRoad();
});
if (side == 1) {
side == 2;
} else {
side == 1;
} }
} }
{ {

View File

@ -352,7 +352,7 @@ void Room::AddPlayer(Player* hum, std::shared_ptr<BornPoint> init_born_point, bo
acc_inactive_time_ += GetGasInactiveReaminTime() - 2; acc_inactive_time_ += GetGasInactiveReaminTime() - 2;
} }
} }
#ifdef MYDEBUG #ifdef MYDEBUG1
if (IsMobaModeRoom()) { if (IsMobaModeRoom()) {
CreateAndroid(7); CreateAndroid(7);
std::vector<Human*> humans; std::vector<Human*> humans;