From 6ccb5835ff55d85156be91473c598eca9d6cb9a6 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Wed, 4 Nov 2020 16:57:41 +0100 Subject: Revert "Make Lint Happy" This reverts commit ad148587dcf5244c2d2011dba339786c765c54c4. --- src/script/cpp_api/s_server.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'src/script/cpp_api/s_server.cpp') diff --git a/src/script/cpp_api/s_server.cpp b/src/script/cpp_api/s_server.cpp index 1cb3f99f1..96cb28b28 100644 --- a/src/script/cpp_api/s_server.cpp +++ b/src/script/cpp_api/s_server.cpp @@ -21,8 +21,10 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "cpp_api/s_internal.h" #include "common/c_converter.h" -bool ScriptApiServer::getAuth(const std::string &playername, std::string *dst_password, - std::set *dst_privs, s64 *dst_last_login) +bool ScriptApiServer::getAuth(const std::string &playername, + std::string *dst_password, + std::set *dst_privs, + s64 *dst_last_login) { SCRIPTAPI_PRECHECKHEADER @@ -52,10 +54,10 @@ bool ScriptApiServer::getAuth(const std::string &playername, std::string *dst_pa throw LuaError("Authentication handler didn't return privilege table"); if (dst_privs) readPrivileges(-1, *dst_privs); - lua_pop(L, 1); // Remove key from privs table + lua_pop(L, 1); // Remove key from privs table s64 last_login; - if (!getintfield(L, -1, "last_login", last_login)) + if(!getintfield(L, -1, "last_login", last_login)) throw LuaError("Authentication handler didn't return last_login"); if (dst_last_login) *dst_last_login = (s64)last_login; @@ -69,7 +71,7 @@ void ScriptApiServer::getAuthHandler() lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_auth_handler"); - if (lua_isnil(L, -1)) { + if (lua_isnil(L, -1)){ lua_pop(L, 1); lua_getfield(L, -1, "builtin_auth_handler"); } @@ -100,8 +102,8 @@ void ScriptApiServer::readPrivileges(int index, std::set &result) } } -void ScriptApiServer::createAuth( - const std::string &playername, const std::string &password) +void ScriptApiServer::createAuth(const std::string &playername, + const std::string &password) { SCRIPTAPI_PRECHECKHEADER @@ -117,8 +119,8 @@ void ScriptApiServer::createAuth( lua_pop(L, 1); // Pop error handler } -bool ScriptApiServer::setPassword( - const std::string &playername, const std::string &password) +bool ScriptApiServer::setPassword(const std::string &playername, + const std::string &password) { SCRIPTAPI_PRECHECKHEADER @@ -135,7 +137,8 @@ bool ScriptApiServer::setPassword( return lua_toboolean(L, -1); } -bool ScriptApiServer::on_chat_message(const std::string &name, const std::string &message) +bool ScriptApiServer::on_chat_message(const std::string &name, + const std::string &message) { SCRIPTAPI_PRECHECKHEADER @@ -171,8 +174,8 @@ void ScriptApiServer::on_shutdown() runCallbacks(0, RUN_CALLBACKS_MODE_FIRST); } -std::string ScriptApiServer::formatChatMessage( - const std::string &name, const std::string &message) +std::string ScriptApiServer::formatChatMessage(const std::string &name, + const std::string &message) { SCRIPTAPI_PRECHECKHEADER -- cgit v1.2.3