Changeset View
Changeset View
Standalone View
Standalone View
source/network/NetServer.cpp
Show First 20 Lines • Show All 767 Lines • ▼ Show 20 Lines | |||||
void CNetServerWorker::SetPlayerReady(const CStr& guid, const int ready) | void CNetServerWorker::SetPlayerReady(const CStr& guid, const int ready) | ||||
{ | { | ||||
m_PlayerAssignments[guid].m_Status = ready; | m_PlayerAssignments[guid].m_Status = ready; | ||||
SendPlayerAssignments(); | SendPlayerAssignments(); | ||||
} | } | ||||
void CNetServerWorker::ClearAllPlayerReady() | void CNetServerWorker::ClearAllPlayerReady() | ||||
{ | { | ||||
for (PlayerAssignmentMap::iterator it = m_PlayerAssignments.begin(); it != m_PlayerAssignments.end(); ++it) | for (std::pair<const CStr, PlayerAssignment>& p : m_PlayerAssignments) | ||||
elexis: range based for? There are two or three others that could be fixed in the same go | |||||
Not Done Inline Actionsthanks elexis: thanks | |||||
it->second.m_Status = 0; | if (p.second.m_Status != 2) | ||||
p.second.m_Status = 0; | |||||
Not Done Inline ActionsWould be nice to use an enum for this. elexis: Would be nice to use an enum for this. | |||||
elexisUnsubmitted Not Done Inline Actionsp -> assignment? elexis: p -> assignment? | |||||
ImarokAuthorUnsubmitted Not Done Inline ActionsAt first I used assignment too, but to be consistent with the rest of the file I changed it to p Imarok: At first I used `assignment` too, but to be consistent with the rest of the file I changed it… | |||||
SendPlayerAssignments(); | SendPlayerAssignments(); | ||||
} | } | ||||
void CNetServerWorker::KickPlayer(const CStrW& playerName, const bool ban) | void CNetServerWorker::KickPlayer(const CStrW& playerName, const bool ban) | ||||
{ | { | ||||
// Find the user with that name | // Find the user with that name | ||||
std::vector<CNetServerSession*>::iterator it = std::find_if(m_Sessions.begin(), m_Sessions.end(), | std::vector<CNetServerSession*>::iterator it = std::find_if(m_Sessions.begin(), m_Sessions.end(), | ||||
▲ Show 20 Lines • Show All 674 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
range based for? There are two or three others that could be fixed in the same go