diff options
author | kwolekr <kwolekr@minetest.net> | 2015-05-19 02:24:14 -0400 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2015-05-19 16:10:49 -0400 |
commit | da34a2b33e1f600ec11172f599384b9a92835403 (patch) | |
tree | f09a158be783f0486447d0c61750a7509760d83b /src/network | |
parent | 603297cc352cab685dd01dcd645999624ad17c0b (diff) | |
download | minetest-da34a2b33e1f600ec11172f599384b9a92835403.tar.gz minetest-da34a2b33e1f600ec11172f599384b9a92835403.tar.bz2 minetest-da34a2b33e1f600ec11172f599384b9a92835403.zip |
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
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/serverpackethandler.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp index ea1528c64..f658e106f 100644 --- a/src/network/serverpackethandler.cpp +++ b/src/network/serverpackethandler.cpp @@ -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; |