From 4fd6cd3ad7a8cfb506873856adcb8f2262b8696b Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sun, 1 Nov 2026 02:10:48 +0000 Subject: [PATCH] Maintenance: Resubmission of batch 9115 rebased onto main (it conflicted with 9108's CommonObject.cpp change, which it already contai Batch #9132 by ragnarok-clanker: forced by an admin (2 lower score(s), 13 changed function(s)); checked with 22 compiled unit(s), including every includer of Source/Contents/ForbiddenWords.h, Source/Contents/Party/PartyInvitation.h, Source/File/CommonObject.h, Source/UI/Chat/UIChatRoomTitle.h, Source/UI/Guild/UIGuildWnd.h, Source/UI/Party/UIRegisterPartyWnd.h, Source/UI/Window/UIHomunInfoWnd.h, Source/UI/Window/UIPetInfoWnd.h. --- Source/Contents/ClientTiming.cpp | 28 +-------- .../Configuration/ServiceConfiguration.cpp | 30 +--------- Source/Contents/ForbiddenWords.cpp | 21 ++++++- Source/Contents/ForbiddenWords.h | 6 +- Source/Contents/Items/ItemNaming.cpp | 58 +++++-------------- Source/Contents/MapNameTable.cpp | 28 +-------- Source/Contents/Party/PartyInvitation.h | 6 +- Source/File/CommonObject.cpp | 49 ++++++++-------- Source/File/CommonObject.h | 3 +- Source/UI/Chat/UIChatRoomTitle.cpp | 4 +- Source/UI/Chat/UIChatRoomTitle.h | 2 +- Source/UI/Guild/UIGuildWnd.cpp | 6 +- Source/UI/Guild/UIGuildWnd.h | 2 +- Source/UI/Party/UIRegisterPartyWnd.cpp | 2 +- Source/UI/Party/UIRegisterPartyWnd.h | 2 +- Source/UI/Window/UIHomunInfoWnd.h | 2 +- Source/UI/Window/UIMessageBox.cpp | 4 +- Source/UI/Window/UIPetInfoWnd.h | 2 +- 18 files changed, 82 insertions(+), 173 deletions(-) diff --git a/Source/Contents/ClientTiming.cpp b/Source/Contents/ClientTiming.cpp index 984bfcd9..67bc1a63 100644 --- a/Source/Contents/ClientTiming.cpp +++ b/Source/Contents/ClientTiming.cpp @@ -55,31 +55,6 @@ 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 { @@ -865,8 +840,7 @@ bool CSession::LoadExceptionMinimapNameTable() { 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); + const bool loaded = storage.LoadTokens(tokens, "ExceptionMinimapNameTable.txt", 0); for (char* token : tokens) { this->m_navigationForbiddenMaps.push_back(std::string(token)); diff --git a/Source/Contents/Configuration/ServiceConfiguration.cpp b/Source/Contents/Configuration/ServiceConfiguration.cpp index 2703e13b..8a6d080a 100644 --- a/Source/Contents/Configuration/ServiceConfiguration.cpp +++ b/Source/Contents/Configuration/ServiceConfiguration.cpp @@ -249,33 +249,6 @@ void InitializeServiceStrings() { } } -namespace { - class EtcInfoBytes : 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(); - } - }; -} - // OFFSET: 0x00AD0F60 // FUNCTION: fn_17809 void LoadLoadingScreens(int count) { @@ -323,8 +296,7 @@ void sub_AD1270() { g_loadingScreens.clear(); std::vector tokens; - EtcInfoBytes file; - storage.LoadTokens(tokens, "etcinfo.txt", 0, file); + storage.LoadTokens(tokens, "etcinfo.txt", 0); for (auto token = tokens.begin(); token != tokens.end(); ++token) { if (std::strcmp(*token, "loadingscreen") == 0) { diff --git a/Source/Contents/ForbiddenWords.cpp b/Source/Contents/ForbiddenWords.cpp index d24537c7..430f59e7 100644 --- a/Source/Contents/ForbiddenWords.cpp +++ b/Source/Contents/ForbiddenWords.cpp @@ -14,6 +14,14 @@ // GLOBAL: gl_24641 ForbiddenWords g_forbiddenWords; +// GLOBAL: gl_24642 +static CCommonObject g_forbiddenWordsObject; + +// OFFSET: 0x00AE5E50 +// FUNCTION: fn_18060 +ForbiddenWords::~ForbiddenWords() { +} + namespace { // OFFSET: 0x00AE7060 // FUNCTION: fn_18065 @@ -30,9 +38,9 @@ namespace { // OFFSET: 0x00AE6F30 // FUNCTION: fn_18064 -bool ForbiddenWords::Load(const char* name, CCommonObject& storage, ResourceBytes& file) { +bool ForbiddenWords::Load(const char* name) { std::vector tokens; - const bool loaded = storage.LoadTokens(tokens, name, 1, file); + const bool loaded = g_forbiddenWordsObject.LoadTokens(tokens, name, 1); for (std::vector::iterator it = tokens.begin(); it != tokens.end(); ++it) { char* token = *it; @@ -42,6 +50,15 @@ bool ForbiddenWords::Load(const char* name, CCommonObject& storage, ResourceByte ++first; } + char* last = first; + + if (*last != '\0') { + while (*++last != '\0') { + } + } + + *last = '\0'; + if (*first != '\0') { this->words.push_back(Lowercase(token, static_cast(g_textCodePage))); } diff --git a/Source/Contents/ForbiddenWords.h b/Source/Contents/ForbiddenWords.h index 386f7eb5..4d5eadad 100644 --- a/Source/Contents/ForbiddenWords.h +++ b/Source/Contents/ForbiddenWords.h @@ -4,13 +4,11 @@ #include #include -class CCommonObject; -class ResourceBytes; - struct ForbiddenWords { /* 0000 */ std::vector words; - bool Load(const char* name, CCommonObject& storage, ResourceBytes& file); + ~ForbiddenWords(); + bool Load(const char* name); bool Allows(const char* text) const; bool Contains(const char* text) const; void Mask(char* text, std::string* value = nullptr) const; diff --git a/Source/Contents/Items/ItemNaming.cpp b/Source/Contents/Items/ItemNaming.cpp index 51fa4d4d..0b9d54b1 100644 --- a/Source/Contents/Items/ItemNaming.cpp +++ b/Source/Contents/Items/ItemNaming.cpp @@ -575,33 +575,6 @@ __declspec(noinline) bool LoadItemMoveInfoTable(std::vector& values, const return true; } -namespace { - 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(); - } - }; -} - // OFFSET: 0x006D78C0 // FUNCTION: fn_06596 __declspec(noinline) void LoadItemNameTables() { @@ -616,7 +589,6 @@ __declspec(noinline) void LoadItemNameTables() { tokens.reserve(20000); } - TableBytes file; unsigned char loaded = 0; const char* itemFiles[2] = {"item.txt", "eventItem.txt"}; @@ -625,7 +597,7 @@ __declspec(noinline) void LoadItemNameTables() { continue; } - g_tableStorage.LoadTokens(tokens, itemFiles[index], 2, file); + g_tableStorage.LoadTokens(tokens, itemFiles[index], 2); char** cursor = tokens.empty() ? nullptr : &tokens[0]; char** end = cursor + tokens.size(); @@ -688,7 +660,7 @@ __declspec(noinline) void LoadItemNameTables() { if (loaded == 0) { if (ResourceExists("EventNum2ItemDisplayNameTable.txt", 0)) { - g_tableStorage.LoadTokens(tokens, "EventNum2ItemDisplayNameTable.txt", 0, file); + g_tableStorage.LoadTokens(tokens, "EventNum2ItemDisplayNameTable.txt", 0); for (size_t index = 0; index + 1 < tokens.size(); index += 2) { g_session.ConvertTooltipText(tokens[index + 1], tokens[index + 1]); g_itemDescriptions[std::atoi(tokens[index])].unidentifiedName = tokens[index + 1]; @@ -697,7 +669,7 @@ __declspec(noinline) void LoadItemNameTables() { if (ResourceExists("EventNum2itemDescTable.txt", 0)) { int id = 0; - g_tableStorage.LoadTokens(tokens, "EventNum2itemDescTable.txt", 1, file); + g_tableStorage.LoadTokens(tokens, "EventNum2itemDescTable.txt", 1); for (size_t index = 0; index < tokens.size(); ++index) { char* text = tokens[index]; if (text == nullptr || *text == '\0') { @@ -714,7 +686,7 @@ __declspec(noinline) void LoadItemNameTables() { } if (ResourceExists("EventIdNum2ItemDisplayNameTable.txt", 0)) { - g_tableStorage.LoadTokens(tokens, "EventIdNum2ItemDisplayNameTable.txt", 0, file); + g_tableStorage.LoadTokens(tokens, "EventIdNum2ItemDisplayNameTable.txt", 0); for (size_t index = 0; index + 1 < tokens.size(); index += 2) { g_session.ConvertTooltipText(tokens[index + 1], tokens[index + 1]); g_itemDescriptions[std::atoi(tokens[index])].identifiedName = tokens[index + 1]; @@ -723,7 +695,7 @@ __declspec(noinline) void LoadItemNameTables() { if (ResourceExists("EventIdNum2itemDescTable.txt", 0)) { int id = 0; - g_tableStorage.LoadTokens(tokens, "EventIdNum2itemDescTable.txt", 1, file); + g_tableStorage.LoadTokens(tokens, "EventIdNum2itemDescTable.txt", 1); for (size_t index = 0; index < tokens.size(); ++index) { char* text = tokens[index]; if (text == nullptr || *text == '\0') { @@ -743,60 +715,60 @@ __declspec(noinline) void LoadItemNameTables() { } if (ResourceExists("EventNum2ItemResNameTable.txt", 0)) { - g_tableStorage.LoadTokens(tokens, "EventNum2ItemResNameTable.txt", 0, file); + g_tableStorage.LoadTokens(tokens, "EventNum2ItemResNameTable.txt", 0); for (size_t index = 0; index + 1 < tokens.size(); index += 2) { g_itemDescriptions[std::atoi(tokens[index])].unidentifiedResource = tokens[index + 1]; } } if (ResourceExists("EventIdNum2ItemResNameTable.txt", 0)) { - g_tableStorage.LoadTokens(tokens, "EventIdNum2ItemResNameTable.txt", 0, file); + g_tableStorage.LoadTokens(tokens, "EventIdNum2ItemResNameTable.txt", 0); for (size_t index = 0; index + 1 < tokens.size(); index += 2) { g_itemDescriptions[std::atoi(tokens[index])].identifiedResource = tokens[index + 1]; } } - g_tableStorage.LoadTokens(tokens, "itemSlotTable.txt", 0, file); + g_tableStorage.LoadTokens(tokens, "itemSlotTable.txt", 0); for (size_t index = 0; index + 1 < tokens.size(); index += 2) { g_itemDescriptions[std::atoi(tokens[index])].unknown_002C = std::atoi(tokens[index + 1]); } - g_tableStorage.LoadTokens(tokens, "itemParamTable.txt", 0, file); + g_tableStorage.LoadTokens(tokens, "itemParamTable.txt", 0); for (size_t index = 0; index + 2 < tokens.size(); index += 3) { ITEM_DESC& desc = g_itemDescriptions[std::atoi(tokens[index])]; desc.unknown_0034.push_back(std::atoi(tokens[index + 1])); desc.unknown_0034.push_back(std::atoi(tokens[index + 2])); } - g_tableStorage.LoadTokens(tokens, "CardItemNameTable.txt", 0, file); + g_tableStorage.LoadTokens(tokens, "CardItemNameTable.txt", 0); for (size_t index = 0; index < tokens.size(); ++index) { EnsureItemCardName(std::atoi(tokens[index]), g_itemCardNames); } - g_tableStorage.LoadTokens(tokens, "Num2CardIllustNameTable.txt", 0, file); + g_tableStorage.LoadTokens(tokens, "Num2CardIllustNameTable.txt", 0); for (size_t index = 0; index + 1 < tokens.size(); index += 2) { EnsureItemCardName(std::atoi(tokens[index]), g_itemCardNames).name = tokens[index + 1]; } - g_tableStorage.LoadTokens(tokens, "CardPrefixNameTable.txt", 0, file); + g_tableStorage.LoadTokens(tokens, "CardPrefixNameTable.txt", 0); for (size_t index = 0; index + 1 < tokens.size(); index += 2) { EnsureItemCardName(std::atoi(tokens[index]), g_itemCardNames).prefix = tokens[index + 1]; } - g_tableStorage.LoadTokens(tokens, "CardPostfixNameTable.txt", 0, file); + g_tableStorage.LoadTokens(tokens, "CardPostfixNameTable.txt", 0); for (size_t index = 0; index < tokens.size(); ++index) { ItemCardName& card = EnsureItemCardName(std::atoi(tokens[index]), g_itemCardNames); card.suffix = card.prefix; card.prefix = ""; } - g_tableStorage.LoadTokens(tokens, "BookItemNameTable.txt", 0, file); + g_tableStorage.LoadTokens(tokens, "BookItemNameTable.txt", 0); for (size_t index = 0; index < tokens.size(); ++index) { EnsureItemDescriptionLines(std::atoi(tokens[index]), g_bookItemNames).push_back(tokens[index]); } int metalId = 0; - g_tableStorage.LoadTokens(tokens, "MetalProcessItemList.txt", 1, file); + g_tableStorage.LoadTokens(tokens, "MetalProcessItemList.txt", 1); for (size_t index = 0; index < tokens.size(); ++index) { char* text = tokens[index]; if (text == nullptr || *text == '\0') { diff --git a/Source/Contents/MapNameTable.cpp b/Source/Contents/MapNameTable.cpp index cf3ed5ba..e2737591 100644 --- a/Source/Contents/MapNameTable.cpp +++ b/Source/Contents/MapNameTable.cpp @@ -43,31 +43,6 @@ 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(); - } -}; - } // OFFSET: 0x00DE8740 @@ -78,8 +53,7 @@ bool CSession::LoadMapNameTable() { const std::uint8_t source[] = {0x52, 0x88, 0x4B, 0xB1, 0x0A, 0x62, 0x9E, 0x43, 0x5E, 0x8B, 0x57, 0x9A, 0x45, 0x7B, 0x83, 0x63, 0x3F}; thread_local EncryptedName name(source); - TableBytes file; - const bool loaded = storage.LoadTokens(tokens, name.Text(), 0, file); + const bool loaded = storage.LoadTokens(tokens, name.Text(), 0); for (auto token = tokens.begin(); token != tokens.end(); token += 2) { g_mapInfoMgr->AddMapDisplayName(token[0], token[1], false); diff --git a/Source/Contents/Party/PartyInvitation.h b/Source/Contents/Party/PartyInvitation.h index 311c0736..5f80c826 100644 --- a/Source/Contents/Party/PartyInvitation.h +++ b/Source/Contents/Party/PartyInvitation.h @@ -9,7 +9,7 @@ #include #include -struct ForbiddenWords; +class ForbiddenWords; class WindowManagerWindows; struct PartyInvitationContext { @@ -27,9 +27,9 @@ inline void ReceivePartyInvitation(const void* packet, PartyInvitationContext& c std::strncpy(name, reinterpret_cast(bytes + 6), 24); name[24] = '\0'; - if (context.words.Contains(name)) { + if (g_forbiddenWords.Contains(name)) { std::string unused; - context.words.Mask(name, &unused); + g_forbiddenWords.Mask(name, &unused); } context.pendingName.assign(name, std::strlen(name)); diff --git a/Source/File/CommonObject.cpp b/Source/File/CommonObject.cpp index 8a766e43..8eea5b87 100644 --- a/Source/File/CommonObject.cpp +++ b/Source/File/CommonObject.cpp @@ -1,5 +1,6 @@ #include "File/CommonObject.h" -#include "Resource/Bitmap/BitmapResource.h" +#include "Client/Input/InputCharset.h" +#include "File/File.h" #include #include @@ -23,52 +24,55 @@ void CCommonObject::Clear() { // OFFSET: 0x005B8810 // FUNCTION: fn_03422 -bool CCommonObject::LoadTokens(std::vector& tokens, const char* name, int mode, ResourceBytes& file) { +bool CCommonObject::LoadTokens(std::vector& tokens, const char* name, int mode) { tokens.clear(); if (tokens.capacity() < 4096) { tokens.reserve(4096); } - if (!file.Open(name)) { - file.Close(); + CFile file; + + if (g_serverLanguage) { + name = g_serverLanguage->ServiceName(name); + } + + if (!file.Open(name, 0, true, false)) { return false; } - const auto bytes = static_cast(file.Size()); - std::unique_ptr buffer(new char[static_cast(bytes) + 1]); - - std::memcpy(buffer.get(), file.Data(), bytes); - buffer.get()[bytes] = '\0'; + const int size = static_cast(file.GetSize()); + char* buffer = new char[size + 1]; + file.Read(buffer, size); + buffer[size] = '\0'; file.Close(); - char* start = buffer.get(); + char* start = buffer; - for (unsigned index = 0; index < bytes; ++index) { - char& value = buffer.get()[index]; - - switch (value) { + for (int index = 0; index < size; ++index) { + switch (buffer[index]) { case '\n': - start = buffer.get() + index + 1; + start = buffer + index + 1; break; case '\r': - value = '\0'; + buffer[index] = '\0'; - if (*start != '\0' && mode != 0 && std::strncmp(start, "//", 2) != 0) { + if (start && *start != '\0' && mode != 0 && std::strncmp(start, "//", 2) != 0) { tokens.push_back(start); } - start = buffer.get() + index + 1; + start = buffer + index + 1; break; case '#': if (std::strncmp(start, "//", 2) != 0) { - value = '\0'; + buffer[index] = '\0'; tokens.push_back(start); if (mode == 2) { - tokens.push_back(nullptr); + start = nullptr; + tokens.push_back(start); } - start = buffer.get() + index + 1; + start = buffer + index + 1; } break; @@ -77,7 +81,6 @@ bool CCommonObject::LoadTokens(std::vector& tokens, const char* name, int } } - this->m_buffers.push_back(buffer.get()); - buffer.release(); + this->m_buffers.push_back(buffer); return true; } diff --git a/Source/File/CommonObject.h b/Source/File/CommonObject.h index d3206a3d..73c8fbd4 100644 --- a/Source/File/CommonObject.h +++ b/Source/File/CommonObject.h @@ -7,7 +7,6 @@ #include class CFile; -class ResourceBytes; class CCommonObject { public: @@ -17,7 +16,7 @@ public: } virtual ~CCommonObject(); void Clear(); - bool LoadTokens(std::vector& tokens, const char* name, int mode, ResourceBytes& file); + bool LoadTokens(std::vector& tokens, const char* name, int mode); bool LoadCsv(const char* name, std::vector (*transform)(const std::vector&), void (*insert)(std::vector&)); bool LoadCsv(const char* name, std::function(std::vector&)> transform, std::function&, std::any)> insert, std::any context); diff --git a/Source/UI/Chat/UIChatRoomTitle.cpp b/Source/UI/Chat/UIChatRoomTitle.cpp index a3f72477..bd5fcf42 100644 --- a/Source/UI/Chat/UIChatRoomTitle.cpp +++ b/Source/UI/Chat/UIChatRoomTitle.cpp @@ -161,9 +161,9 @@ int UIChatRoomTitle::SendMsg(UIWindow* sender, int message, std::intptr_t a, std this->label->italic = 0; this->label->fontHeight = 12; - if (this->m_forbiddenWords->Contains(text)) { + if (g_forbiddenWords.Contains(text)) { std::string masked; - this->m_forbiddenWords->Mask(text, &masked); + g_forbiddenWords.Mask(text, &masked); } this->label->SetTextFitted(text); diff --git a/Source/UI/Chat/UIChatRoomTitle.h b/Source/UI/Chat/UIChatRoomTitle.h index 70461baf..ee61b2f0 100644 --- a/Source/UI/Chat/UIChatRoomTitle.h +++ b/Source/UI/Chat/UIChatRoomTitle.h @@ -7,7 +7,7 @@ class UIStaticText; struct UIButtonContext; -struct ForbiddenWords; +class ForbiddenWords; struct ChatRoomTitleInfo { /* 0000 */ std::string title; diff --git a/Source/UI/Guild/UIGuildWnd.cpp b/Source/UI/Guild/UIGuildWnd.cpp index 5f5f868b..a927a460 100644 --- a/Source/UI/Guild/UIGuildWnd.cpp +++ b/Source/UI/Guild/UIGuildWnd.cpp @@ -1898,9 +1898,9 @@ void UIGuildBanishedMemberWnd::Paint() { char reason[260]; memset(reason, 0, sizeof(reason)); strncpy_s(reason, sizeof(reason), member->unknown_0034.c_str(), member->unknown_0034.size()); - if (this->m_forbiddenWords->Contains(reason) == true) { + if (g_forbiddenWords.Contains(reason) == true) { std::string masked; - this->m_forbiddenWords->Mask(reason, &masked); + g_forbiddenWords.Mask(reason, &masked); } this->m_reasons[drawn]->SetTextFitted(reason); this->m_reasons[drawn]->Move(g_guildBanishedColumnWidths[0] + 9, y); @@ -2022,7 +2022,7 @@ int UIGuildNoticeWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a1, s this->m_frameContext->windows.CloseWindow(59); } else if (a1 == 277) { std::string body(this->m_bodyEdit->Text()); - if (this->m_forbiddenWords->Contains(this->m_titleEdit->Text()) == true || this->m_forbiddenWords->Contains(body.c_str()) == true) { + if (g_forbiddenWords.Contains(this->m_titleEdit->Text()) == true || g_forbiddenWords.Contains(body.c_str()) == true) { this->m_controls->services.Confirm(LookupMessage(14), 0, 1, 0, "Message", 280, 120); } else { if (GuildData().unknown_00B4) { diff --git a/Source/UI/Guild/UIGuildWnd.h b/Source/UI/Guild/UIGuildWnd.h index 7bb59dd7..d72bfe3a 100644 --- a/Source/UI/Guild/UIGuildWnd.h +++ b/Source/UI/Guild/UIGuildWnd.h @@ -40,7 +40,7 @@ class UIStaticText; struct UIButtonContext; struct UIListBoxContext; struct GuildWndInfo; -struct ForbiddenWords; +class ForbiddenWords; bool CompareWideText(const char* left, const char* right); diff --git a/Source/UI/Party/UIRegisterPartyWnd.cpp b/Source/UI/Party/UIRegisterPartyWnd.cpp index 4efe130a..366d043d 100644 --- a/Source/UI/Party/UIRegisterPartyWnd.cpp +++ b/Source/UI/Party/UIRegisterPartyWnd.cpp @@ -300,7 +300,7 @@ int UIRegisterPartyWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, }; if (owner.partyMember != 0) { - if (owner.forbidden.Contains(this->Text(*this->memo))) { + if (g_forbiddenWords.Contains(this->Text(*this->memo))) { notify(3372); return 0; } diff --git a/Source/UI/Party/UIRegisterPartyWnd.h b/Source/UI/Party/UIRegisterPartyWnd.h index 3951f372..e92d4ec9 100644 --- a/Source/UI/Party/UIRegisterPartyWnd.h +++ b/Source/UI/Party/UIRegisterPartyWnd.h @@ -9,7 +9,7 @@ class UIEditCtrl; class UIJobSlotButton; class UIStaticText; class UIBasicButton; -struct ForbiddenWords; +class ForbiddenWords; struct AgencyRequestContext; struct RegisterPartyContext; struct UIEditContext; diff --git a/Source/UI/Window/UIHomunInfoWnd.h b/Source/UI/Window/UIHomunInfoWnd.h index 1f486aed..d0254ade 100644 --- a/Source/UI/Window/UIHomunInfoWnd.h +++ b/Source/UI/Window/UIHomunInfoWnd.h @@ -11,7 +11,7 @@ class UICheckBox; class UIEditCtrl2; class UIINT64BarGraph; class UINormalMB; -struct ForbiddenWords; +class ForbiddenWords; struct WindowResponseRecorder; struct UIButtonContext; struct UIEditContext; diff --git a/Source/UI/Window/UIMessageBox.cpp b/Source/UI/Window/UIMessageBox.cpp index d302488d..bca62642 100644 --- a/Source/UI/Window/UIMessageBox.cpp +++ b/Source/UI/Window/UIMessageBox.cpp @@ -3525,7 +3525,7 @@ int UIHomunInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std: char text[512]; std::sprintf(text, LookupMessage(2977), this->nameEdit->Text()); if (reinterpret_cast(&g_windowMgr)->Confirm(text, 2, false, false, 0, "Message", 280, 120, 0) != 188) { - if (this->m_forbiddenWords->Contains(this->nameEdit->Text()) != true) { + if (g_forbiddenWords.Contains(this->nameEdit->Text()) != true) { g_modeMgr.GetGameMode()->SendMsg(185, reinterpret_cast(this->nameEdit->Text()), 0, 0, 0); std::sprintf(name, this->nameEdit->Text()); this->Invalidate(); @@ -3735,7 +3735,7 @@ int UIPetInfoWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::i char text[512]; std::sprintf(text, LookupMessage(2931), this->nameEdit->Text()); if (reinterpret_cast(&g_windowMgr)->Confirm(text, 2, false, false, 0, "Message", 280, 120, 0) != 188) { - if (this->m_forbiddenWords->Contains(this->nameEdit->Text()) != true) { + if (g_forbiddenWords.Contains(this->nameEdit->Text()) != true) { g_modeMgr.GetGameMode()->SendMsg(145, reinterpret_cast(this->nameEdit->Text()), 0, 0, 0); std::sprintf(g_session.unknown_1018, this->nameEdit->Text()); this->Invalidate(); diff --git a/Source/UI/Window/UIPetInfoWnd.h b/Source/UI/Window/UIPetInfoWnd.h index 6614cd84..a3f89020 100644 --- a/Source/UI/Window/UIPetInfoWnd.h +++ b/Source/UI/Window/UIPetInfoWnd.h @@ -10,7 +10,7 @@ class UIBitmapButton; class UICheckBox; class UIEditCtrl; class UINormalMB; -struct ForbiddenWords; +class ForbiddenWords; class UINoneVisibleButton; class UIPetInfoBarGraph; struct UIButtonContext;