mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 00:25:19 +02:00
Replace instances of std::map<std::string, std::string> with StringMap
Also, clean up surrounding code style Replace by-value parameter passing with const refs when possible Fix post-increment of iterators
This commit is contained in:
@@ -192,7 +192,7 @@ void Server::handleCommand_Init(NetworkPacket* pkt)
|
||||
|
||||
{
|
||||
std::string reason;
|
||||
if(m_script->on_prejoinplayer(playername, addr_s, reason)) {
|
||||
if (m_script->on_prejoinplayer(playername, addr_s, &reason)) {
|
||||
actionstream << "Server: Player with the name \"" << playerName << "\" "
|
||||
<< "tried to connect from " << addr_s << " "
|
||||
<< "but it was disallowed for the following reason: "
|
||||
@@ -480,7 +480,7 @@ void Server::handleCommand_Init_Legacy(NetworkPacket* pkt)
|
||||
|
||||
{
|
||||
std::string reason;
|
||||
if (m_script->on_prejoinplayer(playername, addr_s, reason)) {
|
||||
if (m_script->on_prejoinplayer(playername, addr_s, &reason)) {
|
||||
actionstream << "Server: Player with the name \"" << playername << "\" "
|
||||
<< "tried to connect from " << addr_s << " "
|
||||
<< "but it was disallowed for the following reason: "
|
||||
@@ -1742,7 +1742,7 @@ void Server::handleCommand_NodeMetaFields(NetworkPacket* pkt)
|
||||
|
||||
*pkt >> p >> formname >> num;
|
||||
|
||||
std::map<std::string, std::string> fields;
|
||||
StringMap fields;
|
||||
for (u16 k = 0; k < num; k++) {
|
||||
std::string fieldname;
|
||||
*pkt >> fieldname;
|
||||
@@ -1792,7 +1792,7 @@ void Server::handleCommand_InventoryFields(NetworkPacket* pkt)
|
||||
|
||||
*pkt >> formname >> num;
|
||||
|
||||
std::map<std::string, std::string> fields;
|
||||
StringMap fields;
|
||||
for (u16 k = 0; k < num; k++) {
|
||||
std::string fieldname;
|
||||
*pkt >> fieldname;
|
||||
|
Reference in New Issue
Block a user