Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/network/NetServerTurnManager.cpp
/* Copyright (C) 2018 Wildfire Games. | /* Copyright (C) 2019 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 43 Lines • ▼ Show 20 Lines | void CNetServerTurnManager::NotifyFinishedClientCommands(CNetServerSession& session, u32 turn) | ||||
if (turn != m_ClientsReady[client] + 1) | if (turn != m_ClientsReady[client] + 1) | ||||
{ | { | ||||
LOGERROR("NotifyFinishedClientCommands: Client %d (%s) is ready for turn %d, but expected %d", | LOGERROR("NotifyFinishedClientCommands: Client %d (%s) is ready for turn %d, but expected %d", | ||||
client, | client, | ||||
utf8_from_wstring(session.GetUserName()).c_str(), | utf8_from_wstring(session.GetUserName()).c_str(), | ||||
turn, | turn, | ||||
m_ClientsReady[client] + 1); | m_ClientsReady[client] + 1); | ||||
session.Disconnect(NDR_UNKNOWN); | session.Disconnect(NDR_INCORRECT_READY_TURN_COMMANDS); | ||||
} | } | ||||
m_ClientsReady[client] = turn; | m_ClientsReady[client] = turn; | ||||
// Check whether this was the final client to become ready | // Check whether this was the final client to become ready | ||||
CheckClientsReady(); | CheckClientsReady(); | ||||
} | } | ||||
Show All 31 Lines | void CNetServerTurnManager::NotifyFinishedClientUpdate(CNetServerSession& session, u32 turn, const CStr& hash) | ||||
if (turn != m_ClientsSimulated[client] + 1) | if (turn != m_ClientsSimulated[client] + 1) | ||||
{ | { | ||||
LOGERROR("NotifyFinishedClientUpdate: Client %d (%s) is ready for turn %d, but expected %d", | LOGERROR("NotifyFinishedClientUpdate: Client %d (%s) is ready for turn %d, but expected %d", | ||||
client, | client, | ||||
utf8_from_wstring(playername).c_str(), | utf8_from_wstring(playername).c_str(), | ||||
turn, | turn, | ||||
m_ClientsReady[client] + 1); | m_ClientsReady[client] + 1); | ||||
session.Disconnect(NDR_UNKNOWN); | session.Disconnect(NDR_INCORRECT_READY_TURN_SIMULATED); | ||||
} | } | ||||
m_ClientsSimulated[client] = turn; | m_ClientsSimulated[client] = turn; | ||||
// Check for OOS only if in sync | // Check for OOS only if in sync | ||||
if (m_HasSyncError) | if (m_HasSyncError) | ||||
return; | return; | ||||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator