Changeset View
Changeset View
Standalone View
Standalone View
source/network/NetServer.cpp
/* Copyright (C) 2016 Wildfire Games. | /* Copyright (C) 2017 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 758 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
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 (PlayerAssignmentMap::iterator it = m_PlayerAssignments.begin(); it != m_PlayerAssignments.end(); ++it) | ||||
elexis: range based for? There are two or three others that could be fixed in the same go | |||||
Not Done Inline Actionsthanks elexis: thanks | |||||
if (it->second.m_Status != 2) | |||||
elexisUnsubmitted Not Done Inline ActionsWould be nice to use an enum for this. elexis: Would be nice to use an enum for this. | |||||
it->second.m_Status = 0; | it->second.m_Status = 0; | ||||
Not Done Inline Actionsp -> assignment? elexis: p -> assignment? | |||||
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(), | ||||
[&](CNetServerSession* session) { return session->GetUserName() == playerName; }); | [&](CNetServerSession* session) { return session->GetUserName() == playerName; }); | ||||
▲ Show 20 Lines • Show All 672 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