Changeset View
Changeset View
Standalone View
Standalone View
source/network/NetServerTurnManager.cpp
/* Copyright (C) 2019 Wildfire Games. | /* Copyright (C) 2020 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | for (const std::pair<u32, std::map<int, std::string>>& clientStateHash : m_ClientStateHashes) | ||||
} | } | ||||
// Tell everyone about it | // Tell everyone about it | ||||
if (m_HasSyncError) | if (m_HasSyncError) | ||||
{ | { | ||||
CSyncErrorMessage msg; | CSyncErrorMessage msg; | ||||
msg.m_Turn = clientStateHash.first; | msg.m_Turn = clientStateHash.first; | ||||
msg.m_HashExpected = expected; | msg.m_HashExpected = expected; | ||||
for (const CStrW& playername : OOSPlayerNames) | for (const CStrW& oosPlayername : OOSPlayerNames) | ||||
{ | { | ||||
CSyncErrorMessage::S_m_PlayerNames h; | CSyncErrorMessage::S_m_PlayerNames h; | ||||
h.m_Name = playername; | h.m_Name = oosPlayername; | ||||
msg.m_PlayerNames.push_back(h); | msg.m_PlayerNames.push_back(h); | ||||
} | } | ||||
m_NetServer.Broadcast(&msg, { NSS_INGAME }); | m_NetServer.Broadcast(&msg, { NSS_INGAME }); | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
// Delete the saved hashes for all turns that we've already verified | // Delete the saved hashes for all turns that we've already verified | ||||
Show All 35 Lines |
Wildfire Games · Phabricator