rodecomp/Source/Contents/Emblems/EmblemUpload.cpp
ragnarok-clanker 14a432d922 Maintenance: [forced, user-approved] Family F3: remove WindowDialogs, WindowResponseRecorder, UIMessageBoxContext, UIEntryQueueContex
Batch #10232 by ragnarok-clanker: forced by an admin (22 lower score(s), 263 changed function(s)); checked with 562 compiled unit(s), including every includer of Source/Client/Mode/CLoginMode.h, Source/Client/ReplayPacketRecorder.h, Source/Client/Session.h, Source/Contents/NavigationManager.h, Source/UI/Acceptance/UIJoinPartyAcceptWnd.h, Source/UI/EntryQueue/UIEntryQueueWnd.h, Source/UI/Guild/UIAgitWnd.h, Source/UI/Item/UIParaItemShopWnd.h, Source/UI/Items/UIItemRepairWnd.h, Source/UI/Items/UIMakeTargetListWnd.h, Source/UI/Items/UIMakeTargetProcessWnd.h, Source/UI/Items/UIWeaponRefineWnd.h, Source/UI/Window/UIHomunInfoWnd.h, Source/UI/Window/UIMerInfoWnd.h, Source/UI/Window/UIMessageBox.h, Source/UI/Window/UINavigationWnd.h, Source/UI/Window/UIPayConfirmWnd.h, Source/UI/Window/UIPetInfoWnd.h, Source/UI/Window/UIShowWarpWnd.h, Source/UI/Window/UIWindow.h, Source/UI/Window/UIWindowMgr.h, Source/UI/Window/WindowDialogs.h.
2026-11-03 10:23:36 +00:00

56 lines
1.3 KiB
C++

#include "Contents/Emblems/EmblemDataMgr.h"
#include "Contents/MessageTable.h"
#include "Network/Connection/Connection.h"
#include "Network/Packets/PacketLengths.h"
#include "UI/Window/WindowDialogs.h"
#include "UI/Window/UIWindowMgr.h"
#include "Utility/Async/AsyncDiagnostic.h"
#include <json/reader.h>
#include <json/value.h>
namespace {
#pragma pack(push, 1)
struct EmblemVersionPacket {
std::uint16_t id;
std::uint32_t guildId;
std::int32_t version;
};
#pragma pack(pop)
static_assert(sizeof(EmblemVersionPacket) == 10);
}
// OFFSET: 0x005EBAD0
// FUNCTION: fn_03976
void CEmblemDataMgr::CompleteUpload(AsyncDiagnostic diagnostic, std::string response, std::uint32_t guildId) {
if (!diagnostic.success) {
return;
}
Json::Value root;
Json::Reader reader;
const std::string document(response.c_str());
if (!reader.parse(document, root, true)) {
return;
}
switch (root["Type"].asInt()) {
case 1: {
EmblemVersionPacket packet{0x0B46, guildId, root["version"].asInt()};
GetRagConnection().Send(g_packetLengths.FixedLength(packet.id), &packet);
break;
}
case 2:
case 3:
case 4: {
const char* message = LookupMessage(3586);
g_windowMgr.Confirm(message, 0, true, false, 0, "Message", 280, 120, 0);
break;
}
default:
break;
}
this->m_uploading = false;
}