Skip to content

Commit

Permalink
Code format - (Clang-format)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 11, 2023
1 parent 337e91e commit b7ac15d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,9 @@ void Game::setGameState(GameState_t newState) {

g_dispatcher().addTask(std::bind(&Game::shutdown, this), "Game::shutdown");

#ifdef STATS_ENABLED
#ifdef STATS_ENABLED
g_stats.stop();
#endif
#endif

break;
}
Expand Down
6 changes: 2 additions & 4 deletions src/lua/scripts/luascript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,15 @@ const std::string &LuaScriptInterface::getFileById(int32_t scriptId) {
return it->second;
}

const std::string &LuaScriptInterface::getFileByIdForStats(int32_t scriptId)
{
const std::string &LuaScriptInterface::getFileByIdForStats(int32_t scriptId) {
auto it = cacheFiles.find(scriptId);
if (it == cacheFiles.end()) {
static const std::string& unk = "(Unknown scriptfile)";
static const std::string &unk = "(Unknown scriptfile)";
return unk;
}
return it->second;
}


std::string LuaScriptInterface::getStackTrace(const std::string &error_desc) {
lua_getglobal(luaState, "debug");
if (!isTable(luaState, -1)) {
Expand Down
4 changes: 2 additions & 2 deletions src/server/network/protocol/protocolgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,12 @@ ProtocolGame::ProtocolGame(Connection_ptr initConnection) :
}

template <typename Callable, typename... Args>
void ProtocolGame::addGameTaskWithStats(Callable function, const std::string& function_str, const std::string& extra_info, Args &&... args) {
void ProtocolGame::addGameTaskWithStats(Callable function, const std::string &function_str, const std::string &extra_info, Args &&... args) {
g_dispatcher().addTaskWithStats(std::bind(function, &g_game(), std::forward<Args>(args)...), "ProtocolGame::addGameTaskWithStats", function_str, extra_info);
}

template <typename Callable, typename... Args>
void ProtocolGame::addGameTaskTimedWithStats(uint32_t delay, std::string context, Callable function, const std::string& function_str, const std::string& extra_info, Args &&... args) {
void ProtocolGame::addGameTaskTimedWithStats(uint32_t delay, std::string context, Callable function, const std::string &function_str, const std::string &extra_info, Args &&... args) {
g_dispatcher().addTaskWithStats(std::bind(function, &g_game(), std::forward<Args>(args)...), context, delay, function_str, extra_info);
}

Expand Down
4 changes: 2 additions & 2 deletions src/server/network/protocol/protocolgame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ class ProtocolGame final : public Protocol {
private:
// Helpers so we don't need to bind every time
template <typename Callable, typename... Args>
void addGameTaskWithStats(Callable function, const std::string& function_str, const std::string& extra_info, Args &&... args);
void addGameTaskWithStats(Callable function, const std::string &function_str, const std::string &extra_info, Args &&... args);
template <typename Callable, typename... Args>
void addGameTaskTimedWithStats(uint32_t delay, std::string context, Callable function, const std::string& function_str, const std::string& extra_info, Args &&... args);
void addGameTaskTimedWithStats(uint32_t delay, std::string context, Callable function, const std::string &function_str, const std::string &extra_info, Args &&... args);

ProtocolGame_ptr getThis() {
return std::static_pointer_cast<ProtocolGame>(shared_from_this());
Expand Down

0 comments on commit b7ac15d

Please sign in to comment.