Skip to content

Commit

Permalink
fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
elsongabriel committed May 10, 2024
1 parent 4252a5e commit cb56fa2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8537,8 +8537,8 @@ void Game::processHighscoreResults(DBResult_ptr result, uint32_t playerID, uint8
do {
const auto &voc = g_vocations().getVocation(result->getNumber<uint16_t>("vocation"));
uint8_t characterVocation = voc ? voc->getClientId() : 0;
std::string characterTitle = "";
characters.emplace_back(std::move(result->getString("name")), result->getNumber<uint64_t>("points"), result->getNumber<uint32_t>("id"), result->getNumber<uint32_t>("rank"), result->getNumber<uint16_t>("level"), characterVocation, characterTitle);
std::string loyaltyTitle = ""; // todo get loyalty title from player
characters.emplace_back(std::move(result->getString("name")), result->getNumber<uint64_t>("points"), result->getNumber<uint32_t>("id"), result->getNumber<uint32_t>("rank"), result->getNumber<uint16_t>("level"), characterVocation, loyaltyTitle);
} while (result->next());
}

Expand Down
9 changes: 5 additions & 4 deletions src/server/network/protocol/protocolgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2141,8 +2141,9 @@ void ProtocolGame::sendHighscores(const std::vector<HighscoreCharacter> &charact
msg.addByte(0x00); // All data available

msg.addByte(1); // Worlds
msg.addString(g_configManager().getString(SERVER_NAME, __FUNCTION__), "ProtocolGame::sendHighscores - g_configManager().getString(SERVER_NAME)"); // First World
msg.addString(g_configManager().getString(SERVER_NAME, __FUNCTION__), "ProtocolGame::sendHighscores - g_configManager().getString(SERVER_NAME)"); // Selected World
auto serverName = g_configManager().getString(SERVER_NAME, __FUNCTION__);
msg.addString(serverName, "ProtocolGame::sendHighscores - g_configManager().getString(SERVER_NAME)"); // First World
msg.addString(serverName, "ProtocolGame::sendHighscores - g_configManager().getString(SERVER_NAME)"); // Selected World

msg.addByte(0); // Game World Category: 0xFF(-1) - Selected World
msg.addByte(0); // BattlEye World Type
Expand Down Expand Up @@ -2190,9 +2191,9 @@ void ProtocolGame::sendHighscores(const std::vector<HighscoreCharacter> &charact
for (const HighscoreCharacter &character : characters) {
msg.add<uint32_t>(character.rank); // Rank
msg.addString(character.name, "ProtocolGame::sendHighscores - character.name"); // Character Name
msg.addString(character.title, "ProtocolGame::sendHighscores - character.title"); // Character Title
msg.addString(character.loyaltyTitle, "ProtocolGame::sendHighscores - character.loyaltyTitle"); // Character Loyalty Title
msg.addByte(character.vocation); // Vocation Id
msg.addString(g_configManager().getString(SERVER_NAME, __FUNCTION__), "ProtocolGame::sendHighscores - g_configManager().getString(SERVER_NAME)"); // World
msg.addString(serverName, "ProtocolGame::sendHighscores - g_configManager().getString(SERVER_NAME)"); // World
msg.add<uint16_t>(character.level); // Level
msg.addByte((player->getGUID() == character.id)); // Player Indicator Boolean
msg.add<uint64_t>(character.points); // Points
Expand Down
6 changes: 3 additions & 3 deletions src/server/server_definitions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,20 +113,20 @@ enum Supply_Stash_Actions_t : uint8_t {
};

struct HighscoreCharacter {
HighscoreCharacter(std::string name, uint64_t points, uint32_t id, uint32_t rank, uint16_t level, uint8_t vocation, std::string title) :
HighscoreCharacter(std::string name, uint64_t points, uint32_t id, uint32_t rank, uint16_t level, uint8_t vocation, std::string loyaltyTitle) :
name(std::move(name)),
points(points),
id(id),
rank(rank),
level(level),
vocation(vocation),
title(std::move(title)) { }
loyaltyTitle(std::move(loyaltyTitle)) { }

std::string name;
uint64_t points;
uint32_t id;
uint32_t rank;
uint16_t level;
uint8_t vocation;
std::string title;
std::string loyaltyTitle;
};

0 comments on commit cb56fa2

Please sign in to comment.