mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-23 00:28:08 +02:00
Rename for clarity
This commit is contained in:
@ -146,6 +146,11 @@ CServerHandler::CServerHandler()
|
|||||||
registerTypesLobbyPacks(*applier);
|
registerTypesLobbyPacks(*applier);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CServerHandler::setHighScoreCalc(const std::shared_ptr<HighScoreCalculation> &newHighScoreCalc)
|
||||||
|
{
|
||||||
|
campaignScoreCalculator = newHighScoreCalc;
|
||||||
|
}
|
||||||
|
|
||||||
void CServerHandler::threadRunNetwork()
|
void CServerHandler::threadRunNetwork()
|
||||||
{
|
{
|
||||||
logGlobal->info("Starting network thread");
|
logGlobal->info("Starting network thread");
|
||||||
@ -627,7 +632,7 @@ void CServerHandler::startGameplay(VCMI_LIB_WRAP_NAMESPACE(CGameState) * gameSta
|
|||||||
if(CMM)
|
if(CMM)
|
||||||
CMM->disable();
|
CMM->disable();
|
||||||
|
|
||||||
highScoreCalc = nullptr;
|
campaignScoreCalculator = nullptr;
|
||||||
|
|
||||||
switch(si->mode)
|
switch(si->mode)
|
||||||
{
|
{
|
||||||
@ -735,14 +740,14 @@ void CServerHandler::startCampaignScenario(HighScoreParameter param, std::shared
|
|||||||
if (!cs)
|
if (!cs)
|
||||||
ourCampaign = si->campState;
|
ourCampaign = si->campState;
|
||||||
|
|
||||||
if(highScoreCalc == nullptr)
|
if(campaignScoreCalculator == nullptr)
|
||||||
{
|
{
|
||||||
highScoreCalc = std::make_shared<HighScoreCalculation>();
|
campaignScoreCalculator = std::make_shared<HighScoreCalculation>();
|
||||||
highScoreCalc->isCampaign = true;
|
campaignScoreCalculator->isCampaign = true;
|
||||||
highScoreCalc->parameters.clear();
|
campaignScoreCalculator->parameters.clear();
|
||||||
}
|
}
|
||||||
param.campaignName = cs->getNameTranslated();
|
param.campaignName = cs->getNameTranslated();
|
||||||
highScoreCalc->parameters.push_back(param);
|
campaignScoreCalculator->parameters.push_back(param);
|
||||||
|
|
||||||
endGameplay();
|
endGameplay();
|
||||||
|
|
||||||
@ -763,7 +768,7 @@ void CServerHandler::startCampaignScenario(HighScoreParameter param, std::shared
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
CMM->openCampaignScreen(ourCampaign->campaignSet);
|
CMM->openCampaignScreen(ourCampaign->campaignSet);
|
||||||
GH.windows().createAndPushWindow<CHighScoreInputScreen>(true, *highScoreCalc);
|
GH.windows().createAndPushWindow<CHighScoreInputScreen>(true, *campaignScoreCalculator);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ class CServerHandler final : public IServerAPI, public LobbyInfo, public INetwor
|
|||||||
std::unique_ptr<IServerRunner> serverRunner;
|
std::unique_ptr<IServerRunner> serverRunner;
|
||||||
std::shared_ptr<CMapInfo> mapToStart;
|
std::shared_ptr<CMapInfo> mapToStart;
|
||||||
std::vector<std::string> localPlayerNames;
|
std::vector<std::string> localPlayerNames;
|
||||||
std::shared_ptr<HighScoreCalculation> highScoreCalc;
|
std::shared_ptr<HighScoreCalculation> campaignScoreCalculator;
|
||||||
|
|
||||||
boost::thread threadNetwork;
|
boost::thread threadNetwork;
|
||||||
|
|
||||||
@ -219,6 +219,7 @@ public:
|
|||||||
|
|
||||||
void visitForLobby(CPackForLobby & lobbyPack);
|
void visitForLobby(CPackForLobby & lobbyPack);
|
||||||
void visitForClient(CPackForClient & clientPack);
|
void visitForClient(CPackForClient & clientPack);
|
||||||
|
void setHighScoreCalc(const std::shared_ptr<HighScoreCalculation> &newHighScoreCalc);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern CServerHandler * CSH;
|
extern CServerHandler * CSH;
|
||||||
|
Reference in New Issue
Block a user