Batch #17237 by ragnarok-clanker: no function's compiled code changes; checked with 105 compiled unit(s), including every includer of Source/Linkage/Source/Client/Mode/LoginMode.cpp.h, Source/Linkage/Source/Client/Session/SessionAchievements.cpp.h, Source/Linkage/Source/Client/Session/SessionPredicates.cpp.h, Source/Linkage/Source/Client/Session/SessionState.cpp.h, Source/Linkage/Source/Contents/Achievement/AchievementMgr.cpp.h, Source/Linkage/Source/Contents/Actors/ActorPickNode.cpp.h, Source/Linkage/Source/Contents/Actors/MercenaryAI.cpp.h, Source/Linkage/Source/Contents/Actors/Resources/RobeResources.cpp.h, Source/Linkage/Source/Contents/CashEmotion/CashEmotionMgr.cpp.h, Source/Linkage/Source/Contents/Effects/EffectResourceSwitcher.cpp.h, Source/Linkage/Source/Contents/Effects/Particles/AnimatedEmitterEffect.cpp.h, Source/Linkage/Source/Contents/Effects/Particles/Particle.cpp.h, Source/Linkage/Source/Contents/Effects/Skills/MonsterSkillEffects.cpp.h, Source/Linkage/Source/Contents/Emblems/EmblemCache.cpp.h, Source/Linkage/Source/Contents/Emblems/EmblemDataDownloadAsyncWork.cpp.h, Source/Linkage/Source/Contents/Emblems/EmblemDataMgr.cpp.h, Source/Linkage/Source/Contents/Emblems/EmblemDataUploadAsyncWork.cpp.h, Source/Linkage/Source/Contents/Emblems/GuildEmblemLookup.cpp.h, Source/Linkage/Source/Contents/Hotkeys/EmotionHotkeys.cpp.h, Source/Linkage/Source/Contents/Items/ItemInfo.cpp.h, Source/Linkage/Source/Contents/Items/ItemNaming.cpp.h, Source/Linkage/Source/Contents/Map/PrivateAirplaneMgr.cpp.h, Source/Linkage/Source/Contents/Map/TownInfoMgr.cpp.h, Source/Linkage/Source/Contents/Messenger/MessengerMember.cpp.h, Source/Linkage/Source/Contents/Messenger/WhisperBlockMgr.cpp.h, Source/Linkage/Source/Contents/Models/ModelLighting.cpp.h, Source/Linkage/Source/Contents/Movies/BinkMovies.cpp.h, Source/Linkage/Source/Contents/Navigation/NavigationDestinations.cpp.h, Source/Linkage/Source/Contents/Navigation/NavigationRequest.cpp.h, Source/Linkage/Source/Contents/Navigation/NavigationRoute.cpp.h, Source/Linkage/Source/Contents/Party/AgencyRequests.cpp.h, Source/Linkage/Source/Contents/Party/LoadPartyInfoAsyncWork.cpp.h, Source/Linkage/Source/Contents/Party/LoadPartyListAsyncWork.cpp.h, Source/Linkage/Source/Contents/Party/RegisterPartyAsyncWork.cpp.h, Source/Linkage/Source/Contents/Repute/ReputeMgr.cpp.h, Source/Linkage/Source/Contents/Sound/SoundMgr.cpp.h, Source/Linkage/Source/Contents/Store/MCStoreInfoBackup.cpp.h, Source/Linkage/Source/Contents/Store/MCStoreInfoBackupAsyncWork.cpp.h, Source/Linkage/Source/Contents/Time/ClientTiming.cpp.h, Source/Linkage/Source/Contents/UserData/AccountLinkedUserDataLoadAsyncWork.cpp.h, Source/Linkage/Source/Contents/UserData/AccountLinkedUserDataMgr.cpp.h, Source/Linkage/Source/Contents/UserData/AccountLinkedUserDataSaveAsyncWork.cpp.h, Source/Linkage/Source/Contents/UserData/CharacterConfigSave.cpp.h, Source/Linkage/Source/Contents/UserData/CharacterLinkedUserDataLoadAsyncWork.cpp.h, Source/Linkage/Source/Contents/UserData/CharacterLinkedUserDataSaveAsyncWork.cpp.h, Source/Linkage/Source/File/DirectoryRemoval.cpp.h, Source/Linkage/Source/Network/NIPAddr.cpp.h, Source/Linkage/Source/Network/Packets/ActorNamePacket.cpp.h, Source/Linkage/Source/Render/Device/RenderBackends.cpp.h, Source/Linkage/Source/Render/Primitives/ScreenLine.cpp.h, Source/Linkage/Source/Render/Text/EmbedFont.cpp.h, Source/Linkage/Source/Resource/Models/RmaResource.cpp.h, Source/Linkage/Source/Resource/ResourceFailures.cpp.h, Source/Linkage/Source/Script/LuaScript.cpp.h, Source/Linkage/Source/Security/NProtectGameGuardMgr.cpp.h, Source/Linkage/Source/UI/Acceptance/UIExchangeAcceptWnd.cpp.h, Source/Linkage/Source/UI/Achievement/UIAchWnd.cpp.h, Source/Linkage/Source/UI/Buttons/UINaviLinkButton.cpp.h, Source/Linkage/Source/UI/CashShop/UICashShopWnd.cpp.h, Source/Linkage/Source/UI/Chat/UIChatRoomTitle.cpp.h, Source/Linkage/Source/UI/Dialogs/UIMessageBox.cpp.h, Source/Linkage/Source/UI/Dialogs/UINoteWnd.cpp.h, Source/Linkage/Source/UI/Edit/UIEditCtrl3.cpp.h, Source/Linkage/Source/UI/Enchant/UIEnchantUI.cpp.h, Source/Linkage/Source/UI/EntryQueue/UIEntryQueueWnd.cpp.h, Source/Linkage/Source/UI/Events/UICheckAttendanceWnd.cpp.h, Source/Linkage/Source/UI/GameSettings/GameSettingsUI.cpp.h, Source/Linkage/Source/UI/GameSettings/UIHotkeyGuideWnd.cpp.h, Source/Linkage/Source/UI/Gauges/UIBarGraph.cpp.h, Source/Linkage/Source/UI/Guild/UIGuildHelperWnd.cpp.h, Source/Linkage/Source/UI/Items/UIEquipmentPropertiesWnd.cpp.h, Source/Linkage/Source/UI/Items/UIItemReformWnd.cpp.h, Source/Linkage/Source/UI/Items/UIItemStoreComboBox.cpp.h, Source/Linkage/Source/UI/Items/UILapineBoxWnd.cpp.h, Source/Linkage/Source/UI/Items/UIMakeTargetProcessWnd.cpp.h, Source/Linkage/Source/UI/Items/UIMerchantItemLogWnd.cpp.h, Source/Linkage/Source/UI/Items/UISwapEquipmentWnd.cpp.h, Source/Linkage/Source/UI/Lists/UIChatHisBox.cpp.h, Source/Linkage/Source/UI/Lists/UIComboBoxDefWnd.cpp.h, Source/Linkage/Source/UI/Login/UIPasswordWnd.cpp.h, Source/Linkage/Source/UI/Macro/UIMacroDetectorWnd.cpp.h, Source/Linkage/Source/UI/Navigation/NavigationLink.cpp.h, Source/Linkage/Source/UI/Party/UIApplyForPartyWnd.cpp.h, Source/Linkage/Source/UI/Party/UIRegisterPartyWnd.cpp.h, Source/Linkage/Source/UI/Party/UISeekPartyMBWnd.cpp.h, Source/Linkage/Source/UI/Quest/UIRecommendedQuestInfo.cpp.h, Source/Linkage/Source/UI/Repute/UIReputeWnd.cpp.h, Source/Linkage/Source/UI/Rodex/UIRodexComposeWnd.cpp.h, Source/Linkage/Source/UI/RuneSystem/UIRuneSystemWnd.cpp.h, Source/Linkage/Source/UI/Shop/UIMerchantShopTitle.cpp.h, Source/Linkage/Source/UI/Shortcuts/UIShortCutWnd.cpp.h, Source/Linkage/Source/UI/Skill/UIGraffiStrboxWnd.cpp.h, Source/Linkage/Source/UI/SkillDelayInfo/UISkillDelayInfo.cpp.h, Source/Linkage/Source/UI/Status/UIBasicInfoWnd.cpp.h, Source/Linkage/Source/UI/Text/ColoredText.cpp.h, Source/Linkage/Source/UI/Text/ItemLinkDisplay.cpp.h, Source/Linkage/Source/UI/Text/TextMarkup.cpp.h, Source/Linkage/Source/UI/Text/UITagTextViewer.cpp.h, Source/Linkage/Source/UI/Text/UITextViewer.cpp.h, Source/Linkage/Source/UI/Window/UIFrameWnd.cpp.h, Source/Linkage/Source/UI/Window/UIWindow.cpp.h, Source/Linkage/Source/UI/Window/UIWindowFactory.cpp.h, Source/Linkage/Source/UI/Window/WindowRegistration.cpp.h, Source/Linkage/Source/UI/Window/WindowRetirement.cpp.h, Source/Linkage/Source/Utility/Threading/NThread.cpp.h.
131 lines
3.7 KiB
C++
131 lines
3.7 KiB
C++
#include "UI/Window/UIEnums.h"
|
|
#include "UI/Window/WindowId.h"
|
|
#include "Client/Input/InputCharset.h"
|
|
#include "UI/Macro/UIMacroDetectorWnd.h"
|
|
#include "Client/Input/Language.h"
|
|
#include "Contents/Tables/MessageTable.h"
|
|
#include "Network/Connection/Connection.h"
|
|
#include "Network/Packets/PacketLengths.h"
|
|
#include "UI/Edit/UIEditCtrl.h"
|
|
#include "UI/Macro/UICaptchaPreviewWnd.h"
|
|
#include "UI/Window/WindowManagerWindows.h"
|
|
#include "Utility/Text/FormatString.h"
|
|
|
|
#include "Resource/MSGSTRINGID.h"
|
|
#include "Network/Packets/PacketId.h"
|
|
#include <cstdlib>
|
|
#include <cstring>
|
|
#include <windows.h>
|
|
#include <timeapi.h>
|
|
|
|
namespace {
|
|
struct CaptchaAnswerPacket {
|
|
/* 0000 */ std::int16_t id;
|
|
/* 0002 */ char text[16];
|
|
};
|
|
static_assert(sizeof(CaptchaAnswerPacket) == 18);
|
|
}
|
|
|
|
// OFFSET: 0x007EDC00
|
|
// FUNCTION: fn_09814
|
|
void UIMacroDetectorWnd::OnLBtnDown(int, int) {
|
|
}
|
|
|
|
// OFFSET: 0x007EDC10
|
|
// FUNCTION: fn_09815
|
|
void UIMacroDetectorWnd::OnLBtnUp(int, int) {
|
|
}
|
|
|
|
// OFFSET: 0x007EDC20
|
|
// FUNCTION: fn_09816
|
|
void UIMacroDetectorWnd::OnMouseMove(int, int) {
|
|
}
|
|
|
|
// OFFSET: 0x007EDC30
|
|
// FUNCTION: fn_09817
|
|
void UIMacroDetectorWnd::OnProcess() {
|
|
if (this->messageTick + this->messageDuration < timeGetTime()) {
|
|
this->message = "";
|
|
}
|
|
this->Invalidate();
|
|
}
|
|
|
|
// OFFSET: 0x007EDCB0
|
|
// FUNCTION: fn_09819
|
|
void UIMacroDetectorWnd::ClearImageData() {
|
|
if (this->m_imageData) {
|
|
delete[] this->m_imageData;
|
|
this->m_imageData = nullptr;
|
|
}
|
|
this->m_imageSize = 0;
|
|
this->m_imageReceived = 0;
|
|
std::memset(this->m_captchaKey, 0, sizeof(this->m_captchaKey));
|
|
}
|
|
|
|
// OFFSET: 0x007EDED0
|
|
// FUNCTION: fn_09822
|
|
void UIMacroDetectorWnd::SetCountdown(unsigned char count, std::uint32_t duration) {
|
|
DWORD now = timeGetTime();
|
|
if (this->lastCountdownTick > 0) {
|
|
this->message = static_cast<const std::string&>(FormatOwnedString(LookupMessage(MSI_MACRO_REGISTER_DATA), count));
|
|
}
|
|
|
|
this->remainingAttempts = count;
|
|
this->messageDuration = now;
|
|
this->lastCountdownTick = now;
|
|
if (this->totalDuration == 0) {
|
|
this->totalDuration = duration;
|
|
}
|
|
this->startTick = duration;
|
|
this->Invalidate();
|
|
}
|
|
|
|
// OFFSET: 0x007EE010
|
|
// FUNCTION: fn_09824
|
|
void UIMacroDetectorWnd::InitImageData(unsigned short size) {
|
|
if (this->m_imageData) {
|
|
delete[] this->m_imageData;
|
|
this->m_imageData = nullptr;
|
|
}
|
|
this->m_imageSize = size;
|
|
this->m_imageReceived = 0;
|
|
this->m_imageData = new unsigned char[size];
|
|
std::memset(this->m_imageData, 0, size);
|
|
}
|
|
|
|
// OFFSET: 0x007EDCF0
|
|
// FUNCTION: fn_09820
|
|
int UICaptchaPreviewWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) {
|
|
if (message == UM_COMMAND && a == ID_CLOSE) {
|
|
g_windowMgr.CloseWindow(WID_CAPTCHAPREVIEWWND);
|
|
}
|
|
return UIWindow::SendMsg(sender, message, a, b, c, d);
|
|
}
|
|
|
|
// OFFSET: 0x007EDD40
|
|
// FUNCTION: fn_09821
|
|
int UIMacroDetectorWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) {
|
|
switch (message) {
|
|
case UM_DEFPUSH:
|
|
this->SendMsg(this, UM_COMMAND, ID_SEND, 0, 0, 0);
|
|
break;
|
|
case UM_COMMAND:
|
|
switch (a) {
|
|
case 201:
|
|
g_windowMgr.CloseWindow(WID_CAPTCHAREGISTERWND);
|
|
break;
|
|
case 345:
|
|
if (this->m_editCtrl->Length() != 0 && this->m_lastAnswer.compare(this->m_editCtrl->Text()) != 0) {
|
|
CaptchaAnswerPacket packet;
|
|
packet.id = ID_CZ_ACK_ANSWER_MACRO_DETECTOR;
|
|
memcpy_s(packet.text, sizeof(packet.text), this->m_editCtrl->Text(), sizeof(packet.text));
|
|
GetRagConnection().Send(reinterpret_cast<PacketLengths&>(GetRagConnection()).FixedLength(packet.id), &packet);
|
|
this->m_lastAnswer = this->m_editCtrl->Text();
|
|
g_serverLanguage->ResetInput();
|
|
}
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
return UIWindow::SendMsg(sender, message, a, b, c, d);
|
|
}
|