Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/network/NetServer.h
Show First 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | public: | ||||
u16 GetLocalPort() const; | u16 GetLocalPort() const; | ||||
/** | /** | ||||
* Check if password is valid. If is not, increase number of failed attempts of the lobby user. | * Check if password is valid. If is not, increase number of failed attempts of the lobby user. | ||||
* This is used without established direct session with the client, to prevent brute force attacks | * This is used without established direct session with the client, to prevent brute force attacks | ||||
* when guessing password trying to get connection data from the host. | * when guessing password trying to get connection data from the host. | ||||
* @return true iff password is valid | * @return true iff password is valid | ||||
*/ | */ | ||||
bool CheckPasswordAndIncrement(const CStr& password, const std::string& username); | bool CheckPasswordAndIncrement(const std::string& username, const std::string& password, const std::string& salt); | ||||
/** | /** | ||||
* Check if user reached certain number of failed attempts. | * Check if user reached certain number of failed attempts. | ||||
* @see m_BanAfterNumberOfTries | * @see m_BanAfterNumberOfTries | ||||
* @see CheckPasswordAndBan | * @see CheckPasswordAndBan | ||||
*/ | */ | ||||
bool IsBanned(const std::string& username) const; | bool IsBanned(const std::string& username) const; | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
private: | private: | ||||
friend class CNetServer; | friend class CNetServer; | ||||
friend class CNetFileReceiveTask_ServerRejoin; | friend class CNetFileReceiveTask_ServerRejoin; | ||||
CNetServerWorker(bool useLobbyAuth, int autostartPlayers); | CNetServerWorker(bool useLobbyAuth, int autostartPlayers); | ||||
~CNetServerWorker(); | ~CNetServerWorker(); | ||||
bool CheckPassword(const std::string& password, const std::string& salt) const; | |||||
void SetPassword(const CStr& hashedPassword); | void SetPassword(const CStr& hashedPassword); | ||||
void SetControllerSecret(const std::string& secret); | void SetControllerSecret(const std::string& secret); | ||||
/** | /** | ||||
* Begin listening for network connections. | * Begin listening for network connections. | ||||
* @return true on success, false on error (e.g. port already in use) | * @return true on success, false on error (e.g. port already in use) | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 191 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator