1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Merge pull request #2530 from Nordsoft91/tutorial

Support tutorial
This commit is contained in:
Nordsoft91
2023-08-19 18:06:15 +04:00
committed by GitHub
12 changed files with 55 additions and 14 deletions

View File

@@ -143,6 +143,7 @@ void CServerHandler::resetStateForLobby(const StartInfo::EMode mode, const std::
{
hostClientId = -1;
state = EClientState::NONE;
mapToStart = nullptr;
th = std::make_unique<CStopWatch>();
packsForLobbyScreen.clear();
c.reset();
@@ -399,6 +400,7 @@ void CServerHandler::sendClientDisconnecting()
return;
state = EClientState::DISCONNECTING;
mapToStart = nullptr;
LobbyClientDisconnected lcd;
lcd.clientId = c->connectionID;
logNetwork->info("Connection has been requested to be closed.");
@@ -565,6 +567,11 @@ void CServerHandler::sendStartGame(bool allowOnlyAI) const
c->disableStackSendingByID();
}
void CServerHandler::startMapAfterConnection(std::shared_ptr<CMapInfo> to)
{
mapToStart = to;
}
void CServerHandler::startGameplay(VCMI_LIB_WRAP_NAMESPACE(CGameState) * gameState)
{
if(CMM)
@@ -694,7 +701,7 @@ int CServerHandler::howManyPlayerInterfaces()
ui8 CServerHandler::getLoadMode()
{
if(state == EClientState::GAMEPLAY)
if(loadMode != ELoadMode::TUTORIAL && state == EClientState::GAMEPLAY)
{
if(si->campState)
return ELoadMode::CAMPAIGN;