mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 00:55:20 +02:00
Refactor around translatePassword
Change types for passed password from wstring to string, which removes converting back and forth in most cases. Move the narrow_to_wide conversion, where its neccessary, closer to irrlicht. Remove trailing spaces in guiPasswordChange.cpp. Make parameters for translatePassword passed as const reference.
This commit is contained in:
@@ -267,8 +267,8 @@ void Server::handleCommand_Auth(NetworkPacket* pkt)
|
||||
DenyAccess(pkt->getPeerId(), SERVER_ACCESSDENIED_EMPTY_PASSWORD);
|
||||
return;
|
||||
}
|
||||
std::wstring raw_default_password =
|
||||
narrow_to_wide(g_settings->get("default_password"));
|
||||
std::string raw_default_password =
|
||||
g_settings->get("default_password");
|
||||
std::string initial_password =
|
||||
translatePassword(playername, raw_default_password);
|
||||
|
||||
@@ -571,8 +571,8 @@ void Server::handleCommand_Init_Legacy(NetworkPacket* pkt)
|
||||
L"disallowed. Set a password and try again.");
|
||||
return;
|
||||
}
|
||||
std::wstring raw_default_password =
|
||||
narrow_to_wide(g_settings->get("default_password"));
|
||||
std::string raw_default_password =
|
||||
g_settings->get("default_password");
|
||||
std::string initial_password =
|
||||
translatePassword(playername, raw_default_password);
|
||||
|
||||
|
Reference in New Issue
Block a user