Skip to content

Commit

Permalink
fix: revert some things and other fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas committed Jan 22, 2024
1 parent c28fa22 commit 09105bd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/creatures/players/wheel/player_wheel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2137,7 +2137,7 @@ bool PlayerWheel::checkDivineEmpowerment() {
return updateClient;
}

int32_t magicBonus = 0;
int32_t damageBonus = 0;
bool isOwner = false;
for (const auto &item : *items) {
if (item->getID() == ITEM_DIVINE_EMPOWERMENT && item->isOwner(m_player.getGUID())) {
Expand Down
6 changes: 3 additions & 3 deletions src/io/io_wheel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ class IOWheelBonusData {

struct Revelation {
std::array<Stats, static_cast<size_t>(WheelStageEnum_t::TOTAL_COUNT)> stats = {
Stats { 16, 16 },
Stats { 36, 36 },
Stats { 80, 80 }
Stats { 4, 4 },
Stats { 9, 9 },
Stats { 20, 20 }
};
};

Expand Down
1 change: 0 additions & 1 deletion src/io/iomapserialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ bool IOMapSerialize::loadItem(PropStream &propStream, std::shared_ptr<Cylinder>
}
std::shared_ptr<Container> container = item->getContainer();
if (container && !loadContainer(propStream, container)) {

return false;
}

Expand Down
8 changes: 4 additions & 4 deletions src/server/network/webhook/webhook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ void Webhook::run() {
);
}

void Webhook::sendPayload(const std::string payload, std::string url) {
void Webhook::sendPayload(const std::string &payload, std::string url) {
std::scoped_lock lock { taskLock };
webhooks.push_back(std::make_shared<WebhookTask>(payload, url));
}

void Webhook::sendMessage(const std::string title, const std::string message, int color, std::string url, bool embed) {
void Webhook::sendMessage(const std::string &title, const std::string &message, int color, std::string url, bool embed) {
if (url.empty()) {
url = g_configManager().getString(DISCORD_WEBHOOK_URL, __FUNCTION__);
}
Expand All @@ -60,7 +60,7 @@ void Webhook::sendMessage(const std::string title, const std::string message, in
sendPayload(getPayload(title, message, color, embed), url);
}

void Webhook::sendMessage(const std::string message, std::string url) {
void Webhook::sendMessage(const std::string &message, std::string url) {
if (url.empty()) {
url = g_configManager().getString(DISCORD_WEBHOOK_URL, __FUNCTION__);
}
Expand Down Expand Up @@ -112,7 +112,7 @@ size_t Webhook::writeCallback(void* contents, size_t size, size_t nmemb, void* u
return real_size;
}

std::string Webhook::getPayload(const std::string title, const std::string message, int color, bool embed) const {
std::string Webhook::getPayload(const std::string &title, const std::string &message, int color, bool embed) const {
std::time_t now = getTimeNow();
std::string time_buf = formatDate(now);

Expand Down
8 changes: 4 additions & 4 deletions src/server/network/webhook/webhook.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class Webhook {

void run();

void sendPayload(const std::string payload, std::string url);
void sendMessage(const std::string title, const std::string message, int color, std::string url = "", bool embed = true);
void sendMessage(const std::string message, std::string url = "");
void sendPayload(const std::string &payload, std::string url);
void sendMessage(const std::string &title, const std::string &message, int color, std::string url = "", bool embed = true);
void sendMessage(const std::string &message, std::string url = "");

private:
std::mutex taskLock;
Expand All @@ -44,7 +44,7 @@ class Webhook {

int sendRequest(const char* url, const char* payload, std::string* response_body) const;
static size_t writeCallback(void* contents, size_t size, size_t nmemb, void* userp);
std::string getPayload(const std::string title, const std::string message, int color, bool embed = true) const;
std::string getPayload(const std::string &title, const std::string &message, int color, bool embed = true) const;
};

constexpr auto g_webhook = Webhook::getInstance;

0 comments on commit 09105bd

Please sign in to comment.