Changeset View
Changeset View
Standalone View
Standalone View
source/network/NetServer.cpp
Show First 20 Lines • Show All 1,479 Lines • ▼ Show 20 Lines | bool CNetServerWorker::CheckGameLoadStatus(CNetServerSession* changedSession) | ||||
return true; | return true; | ||||
} | } | ||||
void CNetServerWorker::StartGame() | void CNetServerWorker::StartGame() | ||||
{ | { | ||||
for (std::pair<const CStr, PlayerAssignment>& player : m_PlayerAssignments) | for (std::pair<const CStr, PlayerAssignment>& player : m_PlayerAssignments) | ||||
if (player.second.m_Enabled && player.second.m_PlayerID != -1 && player.second.m_Status == 0) | if (player.second.m_Enabled && player.second.m_PlayerID != -1 && player.second.m_Status == 0) | ||||
{ | { | ||||
LOGERROR("Tried to start the game without player \"%s\" being ready!", utf8_from_wstring(player.second.m_Name).c_str()); | CGameStartFailedMessage gameStartFailed; | ||||
gameStartFailed.m_Reason = "Player " + player.second.m_Name.ToUTF8() + " is not ready"; | |||||
Broadcast(&gameStartFailed, { NSS_PREGAME }); | |||||
return; | return; | ||||
} | } | ||||
m_ServerTurnManager = new CNetServerTurnManager(*this); | m_ServerTurnManager = new CNetServerTurnManager(*this); | ||||
for (CNetServerSession* session : m_Sessions) | for (CNetServerSession* session : m_Sessions) | ||||
{ | { | ||||
m_ServerTurnManager->InitialiseClient(session->GetHostID(), 0); // TODO: only for non-observers | m_ServerTurnManager->InitialiseClient(session->GetHostID(), 0); // TODO: only for non-observers | ||||
▲ Show 20 Lines • Show All 142 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator