mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-30 16:17:46 +00:00
fix player levels not showing in lobby correctly
This commit is contained in:
parent
fe41f42d3b
commit
3c028e5f00
5 changed files with 23 additions and 6 deletions
|
@ -1,11 +1,12 @@
|
|||
#include "PlayerMinimal.h"
|
||||
|
||||
#include <Util/Util.h>
|
||||
#include <Common.h>
|
||||
#include <Exd/ExdDataGenerated.h>
|
||||
|
||||
#include <Database/DatabaseDef.h>
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
extern Sapphire::Data::ExdDataGenerated g_exdDataGen;
|
||||
|
||||
namespace Sapphire::Api {
|
||||
|
@ -123,11 +124,23 @@ std::string PlayerMinimal::getModelString()
|
|||
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 charDetails = "{\"content\":[\"" + std::string( getName() ) + "\"," +
|
||||
"[\"0\",\"0\",\"0\",\"0\",\"" + std::to_string( m_classLevel ) +
|
||||
"\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\"],"
|
||||
getLevelsString() + ","
|
||||
"\"0\",\"0\",\"0\",\"" +
|
||||
std::to_string( getBirthMonth() ) +
|
||||
"\",\"" + std::to_string( getBirthDay() ) +
|
||||
|
|
|
@ -31,6 +31,8 @@ namespace Sapphire::Api
|
|||
|
||||
std::string getClassString();
|
||||
|
||||
std::string getLevelsString();
|
||||
|
||||
uint8_t getClassLevel();
|
||||
|
||||
// return the id of the actor
|
||||
|
|
|
@ -24,6 +24,8 @@ namespace Sapphire::Common
|
|||
const uint16_t MAX_PLAYER_LEVEL = 80;
|
||||
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.
|
||||
*
|
||||
|
|
|
@ -860,13 +860,13 @@ namespace Sapphire::Network::Packets::Server
|
|||
unsigned char unknown95[9];
|
||||
unsigned char unknown9F[2];
|
||||
unsigned char unknownA1[3];
|
||||
unsigned int exp[28];
|
||||
unsigned int exp[Common::CLASSJOB_SLOTS];
|
||||
unsigned int unknown108;
|
||||
unsigned int pvpTotalExp;
|
||||
unsigned int unknownPvp110;
|
||||
unsigned int pvpExp;
|
||||
unsigned int pvpFrontlineOverallRanks[3];
|
||||
unsigned short levels[28];
|
||||
unsigned short levels[Common::CLASSJOB_SLOTS];
|
||||
unsigned short unknown15C[9];
|
||||
unsigned short u1;
|
||||
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
|
||||
if( i == 3 )
|
||||
{
|
||||
charListPacket->data().entitledExpansion = 3;
|
||||
charListPacket->data().entitledExpansion = Common::CURRENT_EXPANSION_ID;
|
||||
charListPacket->data().maxCharOnWorld = 25;
|
||||
charListPacket->data().unknown8 = 8;
|
||||
charListPacket->data().veteranRank = 12;
|
||||
|
|
Loading…
Add table
Reference in a new issue