1
This commit is contained in:
parent
3e9b34cbe0
commit
073da111a4
@ -3835,3 +3835,9 @@ void Room::CreateWorldObjects()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Team* Room::GetTeam(int team_id)
|
||||||
|
{
|
||||||
|
auto itr = team_hash_.find(team_id);
|
||||||
|
return itr != team_hash_.end() ? itr->second : nullptr;
|
||||||
|
}
|
||||||
|
@ -164,6 +164,7 @@ public:
|
|||||||
Human* GetWatchWarTarget(Human* hum);
|
Human* GetWatchWarTarget(Human* hum);
|
||||||
bool BattleStarted();
|
bool BattleStarted();
|
||||||
int GetTeamNum();
|
int GetTeamNum();
|
||||||
|
Team* GetTeam(int team_id);
|
||||||
int GetAliveTeamNum();
|
int GetAliveTeamNum();
|
||||||
Team* GetAliveTeam();
|
Team* GetAliveTeam();
|
||||||
void TraverseTeams(std::function<bool (Team*)> cb);
|
void TraverseTeams(std::function<bool (Team*)> cb);
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include "stats.h"
|
#include "stats.h"
|
||||||
#include "jsondatamgr.h"
|
#include "jsondatamgr.h"
|
||||||
#include "httpproxy.h"
|
#include "httpproxy.h"
|
||||||
|
#include "roommgr.h"
|
||||||
|
|
||||||
#include "mt/Map.h"
|
#include "mt/Map.h"
|
||||||
#include "mt/Hero.h"
|
#include "mt/Hero.h"
|
||||||
@ -219,19 +220,25 @@ void Team::SendTeamBattleReport(Human* sender)
|
|||||||
[room_uuid, team_id]
|
[room_uuid, team_id]
|
||||||
(bool ok, a8::XObject* rsp_obj, f8::HttpContext* ctx)
|
(bool ok, a8::XObject* rsp_obj, f8::HttpContext* ctx)
|
||||||
{
|
{
|
||||||
},
|
Room* room = RoomMgr::Instance()->GetRoomByUuid(room_uuid);
|
||||||
url.c_str(),
|
if (room) {
|
||||||
*params.get()
|
Team* team = room->GetTeam(team_id);
|
||||||
);
|
if (team) {
|
||||||
already_report_battle = true;
|
team->already_report_battle = true;
|
||||||
sending_battlereport = false;
|
team->sending_battlereport = false;
|
||||||
TraverseMembers
|
team->TraverseMembers
|
||||||
(
|
(
|
||||||
[] (Human* hum)
|
[] (Human* hum)
|
||||||
{
|
{
|
||||||
hum->SendGameOver();
|
hum->SendGameOver();
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
url.c_str(),
|
||||||
|
*params.get()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Team::GenBattleReportData(a8::MutableXObject* params)
|
void Team::GenBattleReportData(a8::MutableXObject* params)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user