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/script/cpp_api/s_player.h | |
parent | 603297cc352cab685dd01dcd645999624ad17c0b (diff) | |
download | hax-minetest-server-da34a2b33e1f600ec11172f599384b9a92835403.tar.gz hax-minetest-server-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 '')
-rw-r--r-- | src/script/cpp_api/s_player.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/script/cpp_api/s_player.h b/src/script/cpp_api/s_player.h index a0f764cd5..9c8d1d1ad 100644 --- a/src/script/cpp_api/s_player.h +++ b/src/script/cpp_api/s_player.h @@ -20,10 +20,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifndef S_PLAYER_H_ #define S_PLAYER_H_ -#include <map> - #include "cpp_api/s_base.h" #include "irr_v3d.h" +#include "util/string.h" struct ToolCapabilities; @@ -36,17 +35,16 @@ public: void on_newplayer(ServerActiveObject *player); void on_dieplayer(ServerActiveObject *player); bool on_respawnplayer(ServerActiveObject *player); - bool on_prejoinplayer(std::string name, std::string ip, std::string &reason); + bool on_prejoinplayer(const std::string &name, const std::string &ip, + std::string *reason); void on_joinplayer(ServerActiveObject *player); void on_leaveplayer(ServerActiveObject *player); void on_cheat(ServerActiveObject *player, const std::string &cheat_type); bool on_punchplayer(ServerActiveObject *player, ServerActiveObject *hitter, float time_from_last_punch, const ToolCapabilities *toolcap, v3f dir, s16 damage); - void on_playerReceiveFields(ServerActiveObject *player, - const std::string &formname, - const std::map<std::string, std::string> &fields); + const std::string &formname, const StringMap &fields); }; |