Skip to content

Commit

Permalink
updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
elsongabriel committed Apr 26, 2024
1 parent 438a86a commit da2883c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/lua/functions/creatures/player/player_functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,7 @@ class PlayerFunctions final : LuaScriptInterface {
registerMethod(L, "Player", "addAchievementPoints", PlayerFunctions::luaPlayerAddAchievementPoints);
registerMethod(L, "Player", "removeAchievementPoints", PlayerFunctions::luaPlayerRemoveAchievementPoints);

// Cyclopedia Functions
registerMethod(L, "Player", "load", PlayerFunctions::luaPlayerAddBadge);
// Badge Functions
registerMethod(L, "Player", "addBadge", PlayerFunctions::luaPlayerAddBadge);

GroupFunctions::init(L);
Expand Down
11 changes: 5 additions & 6 deletions src/server/network/protocol/protocolgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3380,9 +3380,9 @@ void ProtocolGame::sendCyclopediaCharacterBaseInformation() {
msg.add<uint16_t>(player->getLevel());
AddOutfit(msg, player->getDefaultOutfit(), false);

msg.addByte(g_configManager().getBoolean(STAMINA_SYSTEM, __FUNCTION__) ? 0x00 : 0x01); // hide stamina
msg.addByte(0x00); // Store summary & Character titles (will be 0x01)
msg.addString("", "ProtocolGame::sendCyclopediaCharacterBaseInformation - player->title()->getCurrentTitleName()"); // character title
msg.addByte(g_configManager().getBoolean(STAMINA_SYSTEM, __FUNCTION__) ? 0x01 : 0x00); // hide stamina
// msg.addByte(0x00); // Store summary & Character titles (will be 0x01)
msg.addString("", "ProtocolGame::sendCyclopediaCharacterBaseInformation - empty"); // character title
// msg.addString(player->title()->getCurrentTitleName(), "ProtocolGame::sendCyclopediaCharacterBaseInformation - player->title()->getCurrentTitleName()"); // character title
writeToOutputBuffer(msg);
}
Expand Down Expand Up @@ -3946,15 +3946,14 @@ void ProtocolGame::sendCyclopediaCharacterBadges() {
msg.addByte(0xDA);
msg.addByte(CYCLOPEDIA_CHARACTERINFO_BADGES);
msg.addByte(0x00);

msg.addByte(0x01); // ShowAccountInformation
// if ShowAccountInformation show IsOnline, IsPremium, character title, badges
msg.addByte(0x01); // ShowAccountInformation, if 0x01 will show IsOnline, IsPremium, character title, badges

const auto loggedPlayer = g_game().getPlayerUniqueLogin(player->getName());
msg.addByte(loggedPlayer ? 0x01 : 0x00); // IsOnline
msg.addByte(player->isPremium() ? 0x01 : 0x00); // IsPremium (GOD has always 'Premium')
// Character loyalty title
msg.addString(player->getLoyaltyTitle(), "ProtocolGame::sendCyclopediaCharacterBadges - player->getLoyaltyTitle()");
// msg.addByte(0x01); // Enable badges

uint8_t badgesSize = 0;
auto badgesSizePosition = msg.getBufferPosition();
Expand Down
1 change: 0 additions & 1 deletion src/server/server_definitions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,4 @@ struct HighscoreCharacter {
uint32_t rank;
uint16_t level;
uint8_t vocation;
uint8_t title;
};

0 comments on commit da2883c

Please sign in to comment.