mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 05:20:05 +00:00
Load instance data from XDT
This commit is contained in:
parent
45b8f8f581
commit
b81a3761b6
@ -2,7 +2,11 @@
|
||||
#include "CNStructs.hpp"
|
||||
#include "RacingManager.hpp"
|
||||
|
||||
std::map<int32_t, EPInfo> RacingManager::EPData;
|
||||
|
||||
void RacingManager::init() {
|
||||
|
||||
|
||||
//REGISTER_SHARD_PACKET(P_CL2FE_REQ_EP_RACE_START, racingStart);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,8 +2,13 @@
|
||||
|
||||
#include "CNShardServer.hpp"
|
||||
|
||||
struct EPInfo {
|
||||
int zoneX, zoneY, EPID, maxScore;
|
||||
};
|
||||
|
||||
namespace RacingManager {
|
||||
|
||||
extern std::map<int32_t, EPInfo> EPData;
|
||||
|
||||
void init();
|
||||
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "MobManager.hpp"
|
||||
#include "ChunkManager.hpp"
|
||||
#include "NanoManager.hpp"
|
||||
#include "RacingManager.hpp"
|
||||
|
||||
#include "contrib/JSON.hpp"
|
||||
|
||||
@ -228,6 +229,17 @@ void TableData::init() {
|
||||
|
||||
std::cout << "[INFO] Loaded " << NanoManager::SkillTable.size() << " nano skills" << std::endl;
|
||||
|
||||
// load EP data
|
||||
nlohmann::json instances = xdtData["m_pInstanceTable"]["m_pInstanceData"];
|
||||
|
||||
for (nlohmann::json::iterator _instance = instances.begin(); _instance != instances.end(); _instance++) {
|
||||
auto instance = _instance.value();
|
||||
EPInfo epInfo = {instance["m_iZoneX"], instance["m_iZoneY"], instance["m_iIsEP"], (int)instance["m_ScoreMax"]};
|
||||
RacingManager::EPData[instance["m_iInstanceNameID"]] = epInfo;
|
||||
}
|
||||
|
||||
std::cout << "[INFO] Loaded " << RacingManager::EPData.size() << " instances" << std::endl;
|
||||
|
||||
}
|
||||
catch (const std::exception& err) {
|
||||
std::cerr << "[FATAL] Malformed xdt.json file! Reason:" << err.what() << std::endl;
|
||||
|
Loading…
Reference in New Issue
Block a user