diff --git a/Source/Client/Session.h b/Source/Client/Session.h index 42cb4709..997a5a7a 100644 --- a/Source/Client/Session.h +++ b/Source/Client/Session.h @@ -518,6 +518,7 @@ public: bool IsNavigationAllowed() const; void LoadRobeAlpha(); void LoadDamageSkinSettings(); + bool LoadExceptionMinimapNameTable(); bool LoadMapNameTable(); bool LoadFogParameters(); void ClearHomunStatus(); diff --git a/Source/Contents/ClientTiming.cpp b/Source/Contents/ClientTiming.cpp index bce2ac4f..c1b93897 100644 --- a/Source/Contents/ClientTiming.cpp +++ b/Source/Contents/ClientTiming.cpp @@ -3,7 +3,9 @@ #include "Contents/Configuration/ServiceConfiguration.h" #include "Contents/MapInfoMgr.h" #include "Contents/NavigationManager.h" +#include "File/CommonObject.h" #include "File/File.h" +#include "Resource/Bitmap/BitmapResource.h" #include "Script/LuaScript.h" #include "UI/Window/UIWindow.h" #include "UI/Window/UIWindowMgr.h" @@ -52,6 +54,31 @@ private: bool m_encrypted; }; +class TableBytes : public ResourceBytes { +public: + CFile file; + + // INLINED + bool Open(const char* name) override { + return this->file.Open(name, 0, true, false); + } + + // INLINED + const void* Data() const override { + return this->file.GetData(); + } + + // INLINED + int Size() const override { + return static_cast(this->file.GetSize()); + } + + // INLINED + void Close() override { + this->file.Close(); + } +}; + } struct NaviUnknownBlock { @@ -98,6 +125,8 @@ CNavi_Object::CNavi_Object(int type, int index, const char* name, const char* ti this->info = info; } +// OFFSET: 0x00B8C520 + // OFFSET: 0x00B8C2B0 // FUNCTION: fn_19422 CNavi_Link::CNavi_Link( @@ -777,6 +806,25 @@ void CSession::LoadDamageSkinSettings() { g_luaScript->Call("GetDamageMillionUnit", "d>d", this->m_damageSkinIndex, &this->m_damageMillionUnit); } +// OFFSET: 0x00DE53C0 +// FUNCTION: fn_23491 +bool CSession::LoadExceptionMinimapNameTable() { + std::vector tokens; + this->m_navigationForbiddenMaps.clear(); + this->m_navigationForbiddenMaps.reserve(512); + + CCommonObject& storage = reinterpret_cast(this->unknown_5400[0x30]); + TableBytes file; + const bool loaded = storage.LoadTokens(tokens, "ExceptionMinimapNameTable.txt", 0, file); + + for (char* token : tokens) { + this->m_navigationForbiddenMaps.push_back(std::string(token)); + } + + std::sort(this->m_navigationForbiddenMaps.begin(), this->m_navigationForbiddenMaps.end(), std::less()); + return loaded; +} + // OFFSET: 0x00DE5620 // FUNCTION: fn_23492 bool CSession::LoadFogParameters() { diff --git a/Source/Contents/NavigationManager.h b/Source/Contents/NavigationManager.h index 55235cb4..3e834c3d 100644 --- a/Source/Contents/NavigationManager.h +++ b/Source/Contents/NavigationManager.h @@ -138,6 +138,7 @@ public: void AddLinkedLink(const NaviLink& link); void ClearLinkedLinks(); int LinkedLinkCount() const; + CNavi_Link(); CNavi_Link(int type, int index, const char* name, const char* title, int cellX, int cellY, CNaviInfo* info, CNaviInfo* linkedInfo, int unknown80, int unknown84); ~CNavi_Link() override;