mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-01 00:27:44 +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 "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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue