From da34a2b33e1f600ec11172f599384b9a92835403 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Tue, 19 May 2015 02:24:14 -0400 Subject: Replace instances of std::map with StringMap Also, clean up surrounding code style Replace by-value parameter passing with const refs when possible Fix post-increment of iterators --- src/script/cpp_api/s_player.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/script/cpp_api/s_player.h') 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 - #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 &fields); + const std::string &formname, const StringMap &fields); }; -- cgit v1.2.3