Changeset View
Changeset View
Standalone View
Standalone View
network/NetServer.cpp
Show First 20 Lines • Show All 801 Lines • ▼ Show 20 Lines | void CNetServerWorker::KickPlayer(const CStrW& playerName, const bool ban) | ||||
if (ban) | if (ban) | ||||
{ | { | ||||
// Remember name | // Remember name | ||||
if (std::find(m_BannedPlayers.begin(), m_BannedPlayers.end(), playerName) == m_BannedPlayers.end()) | if (std::find(m_BannedPlayers.begin(), m_BannedPlayers.end(), playerName) == m_BannedPlayers.end()) | ||||
m_BannedPlayers.push_back(m_LobbyAuth ? CStrW(playerName.substr(0, playerName.find(L" ("))) : playerName); | m_BannedPlayers.push_back(m_LobbyAuth ? CStrW(playerName.substr(0, playerName.find(L" ("))) : playerName); | ||||
// Remember IP address | // Remember IP address | ||||
u32 ipAddress = (*it)->GetIPAddress(); | enet_host_type ipAddress = (*it)->GetIPAddress(); | ||||
if (std::find(m_BannedIPs.begin(), m_BannedIPs.end(), ipAddress) == m_BannedIPs.end()) | if (std::find(m_BannedIPs.begin(), m_BannedIPs.end(), ipAddress) == m_BannedIPs.end()) | ||||
m_BannedIPs.push_back(ipAddress); | m_BannedIPs.push_back(ipAddress); | ||||
} | } | ||||
// Disconnect that user | // Disconnect that user | ||||
(*it)->Disconnect(ban ? NDR_BANNED : NDR_KICKED); | (*it)->Disconnect(ban ? NDR_BANNED : NDR_KICKED); | ||||
// Send message notifying other clients | // Send message notifying other clients | ||||
▲ Show 20 Lines • Show All 796 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator