Skip to content

Commit

Permalink
fix: sonarcloud check (opentibiabr#2954)
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas authored Oct 9, 2024
1 parent 01e9a81 commit 1fcb348
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 118 deletions.
106 changes: 0 additions & 106 deletions .github/workflows/analysis-sonarcloud.yml

This file was deleted.

7 changes: 0 additions & 7 deletions sonar-project.properties

This file was deleted.

5 changes: 3 additions & 2 deletions src/lua/callbacks/events_callbacks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ class EventsCallbacks {
template <typename CallbackFunc, typename... Args>
void executeCallback(EventCallback_t eventType, CallbackFunc callbackFunc, Args &&... args) {
for (const auto &[name, callback] : getCallbacksByType(eventType)) {
auto argsCopy = std::make_tuple(args...);
if (callback && callback->isLoadedCallback()) {
auto argsCopy = std::make_tuple(args...);
std::apply(
[&callback, &callbackFunc](auto &&... args) {
[callback, &callbackFunc](auto &&... args) {
((*callback).*callbackFunc)(std::forward<decltype(args)>(args)...);
},
argsCopy
Expand All @@ -101,6 +101,7 @@ class EventsCallbacks {
}
}
}

/**
* @brief Checks if all registered callbacks of the specified event type succeed.
* @param eventType The type of event to check.
Expand Down
2 changes: 1 addition & 1 deletion src/server/network/protocol/protocolgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1883,7 +1883,7 @@ void ProtocolGame::parseQuickLootBlackWhitelist(NetworkMessage &msg) {

void ProtocolGame::parseSay(NetworkMessage &msg) {
std::string receiver;
uint16_t channelId;
uint16_t channelId {};

SpeakClasses type = static_cast<SpeakClasses>(msg.getByte());
switch (type) {
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 @@ -46,10 +46,10 @@ struct TextMessage {
MessageClasses type = MESSAGE_STATUS;
std::string text;
Position position;
uint16_t channelId;
uint16_t channelId {};
struct
{
int32_t value = 0;
int32_t value {};
TextColor_t color = TEXTCOLOR_NONE;
} primary, secondary;
};
Expand Down

0 comments on commit 1fcb348

Please sign in to comment.