mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-02 08:57:44 +00:00
Merge pull request #569 from NotAdam/develop
fix player levels not showing in lobby correctly
This commit is contained in:
commit
a5ed9501ad
6 changed files with 24 additions and 7 deletions
|
@ -1,11 +1,12 @@
|
||||||
#include "PlayerMinimal.h"
|
#include "PlayerMinimal.h"
|
||||||
|
|
||||||
#include <Util/Util.h>
|
|
||||||
#include <Common.h>
|
#include <Common.h>
|
||||||
#include <Exd/ExdDataGenerated.h>
|
#include <Exd/ExdDataGenerated.h>
|
||||||
|
|
||||||
#include <Database/DatabaseDef.h>
|
#include <Database/DatabaseDef.h>
|
||||||
|
|
||||||
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
extern Sapphire::Data::ExdDataGenerated g_exdDataGen;
|
extern Sapphire::Data::ExdDataGenerated g_exdDataGen;
|
||||||
|
|
||||||
namespace Sapphire::Api {
|
namespace Sapphire::Api {
|
||||||
|
@ -123,11 +124,23 @@ std::string PlayerMinimal::getModelString()
|
||||||
return modelString;
|
return modelString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string PlayerMinimal::getLevelsString()
|
||||||
|
{
|
||||||
|
auto levelsArray = nlohmann::json();
|
||||||
|
|
||||||
|
for( int i = 0; i < Common::CLASSJOB_SLOTS; ++i )
|
||||||
|
{
|
||||||
|
// these must be strings
|
||||||
|
levelsArray.push_back( std::to_string( m_classMap[ i ] ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
return levelsArray.dump();
|
||||||
|
}
|
||||||
|
|
||||||
std::string PlayerMinimal::getInfoJson()
|
std::string PlayerMinimal::getInfoJson()
|
||||||
{
|
{
|
||||||
std::string charDetails = "{\"content\":[\"" + std::string( getName() ) + "\"," +
|
std::string charDetails = "{\"content\":[\"" + std::string( getName() ) + "\"," +
|
||||||
"[\"0\",\"0\",\"0\",\"0\",\"" + std::to_string( m_classLevel ) +
|
getLevelsString() + ","
|
||||||
"\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\"],"
|
|
||||||
"\"0\",\"0\",\"0\",\"" +
|
"\"0\",\"0\",\"0\",\"" +
|
||||||
std::to_string( getBirthMonth() ) +
|
std::to_string( getBirthMonth() ) +
|
||||||
"\",\"" + std::to_string( getBirthDay() ) +
|
"\",\"" + std::to_string( getBirthDay() ) +
|
||||||
|
|
|
@ -31,6 +31,8 @@ namespace Sapphire::Api
|
||||||
|
|
||||||
std::string getClassString();
|
std::string getClassString();
|
||||||
|
|
||||||
|
std::string getLevelsString();
|
||||||
|
|
||||||
uint8_t getClassLevel();
|
uint8_t getClassLevel();
|
||||||
|
|
||||||
// return the id of the actor
|
// return the id of the actor
|
||||||
|
|
|
@ -24,6 +24,8 @@ namespace Sapphire::Common
|
||||||
const uint16_t MAX_PLAYER_LEVEL = 80;
|
const uint16_t MAX_PLAYER_LEVEL = 80;
|
||||||
const uint8_t CURRENT_EXPANSION_ID = 3;
|
const uint8_t CURRENT_EXPANSION_ID = 3;
|
||||||
|
|
||||||
|
const uint8_t CLASSJOB_SLOTS = 28;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief The maximum length (in ms) of a combo before it is canceled/voided.
|
* @brief The maximum length (in ms) of a combo before it is canceled/voided.
|
||||||
*
|
*
|
||||||
|
|
|
@ -860,13 +860,13 @@ namespace Sapphire::Network::Packets::Server
|
||||||
unsigned char unknown95[9];
|
unsigned char unknown95[9];
|
||||||
unsigned char unknown9F[2];
|
unsigned char unknown9F[2];
|
||||||
unsigned char unknownA1[3];
|
unsigned char unknownA1[3];
|
||||||
unsigned int exp[28];
|
unsigned int exp[Common::CLASSJOB_SLOTS];
|
||||||
unsigned int unknown108;
|
unsigned int unknown108;
|
||||||
unsigned int pvpTotalExp;
|
unsigned int pvpTotalExp;
|
||||||
unsigned int unknownPvp110;
|
unsigned int unknownPvp110;
|
||||||
unsigned int pvpExp;
|
unsigned int pvpExp;
|
||||||
unsigned int pvpFrontlineOverallRanks[3];
|
unsigned int pvpFrontlineOverallRanks[3];
|
||||||
unsigned short levels[28];
|
unsigned short levels[Common::CLASSJOB_SLOTS];
|
||||||
unsigned short unknown15C[9];
|
unsigned short unknown15C[9];
|
||||||
unsigned short u1;
|
unsigned short u1;
|
||||||
unsigned short u2;
|
unsigned short u2;
|
||||||
|
|
|
@ -180,7 +180,7 @@ void Lobby::GameConnection::getCharList( FFXIVARR_PACKET_RAW& packet, uint32_t t
|
||||||
// TODO: Eventually move to account info storage
|
// TODO: Eventually move to account info storage
|
||||||
if( i == 3 )
|
if( i == 3 )
|
||||||
{
|
{
|
||||||
charListPacket->data().entitledExpansion = 3;
|
charListPacket->data().entitledExpansion = Common::CURRENT_EXPANSION_ID;
|
||||||
charListPacket->data().maxCharOnWorld = 25;
|
charListPacket->data().maxCharOnWorld = 25;
|
||||||
charListPacket->data().unknown8 = 8;
|
charListPacket->data().unknown8 = 8;
|
||||||
charListPacket->data().veteranRank = 12;
|
charListPacket->data().veteranRank = 12;
|
||||||
|
|
|
@ -395,7 +395,7 @@ Sapphire::InstanceContent::onEnterTerritory( Entity::Player& player, uint32_t ev
|
||||||
HIDE_HOTBAR | SILENT_ENTER_TERRI_BGM | SILENT_ENTER_TERRI_SE |
|
HIDE_HOTBAR | SILENT_ENTER_TERRI_BGM | SILENT_ENTER_TERRI_SE |
|
||||||
DISABLE_STEALTH | 0x00100000 | LOCK_HUD | LOCK_HOTBAR |
|
DISABLE_STEALTH | 0x00100000 | LOCK_HUD | LOCK_HOTBAR |
|
||||||
// todo: wtf is 0x00100000
|
// todo: wtf is 0x00100000
|
||||||
DISABLE_CANCEL_EMOTE, 0, 0x9, getCurrentBGM() );
|
DISABLE_CANCEL_EMOTE, 0, 0x9, 0 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
player.directorPlayScene( getDirectorId(), 2, NO_DEFAULT_CAMERA | HIDE_HOTBAR, 0, 0x9, getCurrentBGM() );
|
player.directorPlayScene( getDirectorId(), 2, NO_DEFAULT_CAMERA | HIDE_HOTBAR, 0, 0x9, getCurrentBGM() );
|
||||||
|
|
Loading…
Add table
Reference in a new issue