Decompile fn_21888 (CGameMode::ReceiveGuildPositionNames)
Batch #9200 by youko: 0 byte-identical, 1 confirmed by peer review. - fn_21888 CGameMode::ReceiveGuildPositionNames: logic confirmed by peer review Peer-reviewed-by: Montyla, pedrao, Bielhp Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
parent
23128462e3
commit
945e05ae4f
2 changed files with 65 additions and 0 deletions
|
|
@ -36,6 +36,7 @@ struct vector3d;
|
|||
struct ItemCardSlots;
|
||||
struct ItemSlotOptions;
|
||||
struct ReputePointEntry;
|
||||
struct GuildStorageLogItem;
|
||||
|
||||
struct MiniMapMember {
|
||||
/* 0000 */ int x;
|
||||
|
|
@ -777,6 +778,9 @@ public:
|
|||
void ReceiveQuestHuntUpdate2(const unsigned char* data);
|
||||
void ReceiveGuildMemberExpelled(const unsigned char* data);
|
||||
void ReceiveGuildPositionUpdate(const unsigned char* data);
|
||||
void ReceiveGuildPositionNames(const unsigned char* data);
|
||||
void ReceiveMapMove(const unsigned char* data);
|
||||
void ApplyGuildStorageLog(std::uint16_t result, const std::vector<GuildStorageLogItem>& items);
|
||||
void ReceiveGuildMemberLeft(const unsigned char* data);
|
||||
std::FILE* OpenRandomOptionSimulatorFile(const std::string& folder, const std::string& itemName);
|
||||
void ReceiveRandomOptionSimulation(const unsigned char* packet);
|
||||
|
|
|
|||
|
|
@ -9971,3 +9971,64 @@ struct EquipItemNoticePacket {
|
|||
static_assert(sizeof(EquipItemNoticePacket) == 7);
|
||||
|
||||
// OFFSET: 0x00D50AA0
|
||||
|
||||
#include "UI/Guild/UIGuild_Storage_Log.h"
|
||||
#include <algorithm>
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct MapMovePacket {
|
||||
/* 0000 */ std::uint16_t packetType;
|
||||
/* 0002 */ char mapName[16];
|
||||
/* 0012 */ std::int16_t x;
|
||||
/* 0014 */ std::int16_t y;
|
||||
};
|
||||
|
||||
struct GuildPositionNameEntry {
|
||||
/* 0000 */ int positionId;
|
||||
/* 0004 */ char name[24];
|
||||
};
|
||||
|
||||
struct GuildPositionNamePacket {
|
||||
/* 0000 */ std::uint16_t packetType;
|
||||
/* 0002 */ std::int16_t length;
|
||||
/* 0004 */ GuildPositionNameEntry entries[1];
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
static_assert(sizeof(MapMovePacket) == 0x16);
|
||||
static_assert(sizeof(GuildPositionNameEntry) == 0x1C);
|
||||
|
||||
struct GuildStorageLogItem {
|
||||
/* 0000 */ ITEM_INFO item;
|
||||
/* 00F8 */ unsigned char unknown_00F8;
|
||||
};
|
||||
|
||||
static_assert(sizeof(GuildStorageLogItem) == 0x100);
|
||||
|
||||
// OFFSET: 0x00D3A1E0
|
||||
|
||||
// OFFSET: 0x00D50E40
|
||||
// FUNCTION: fn_21888
|
||||
void CGameMode::ReceiveGuildPositionNames(const unsigned char* data) {
|
||||
const auto* packet = reinterpret_cast<const GuildPositionNamePacket*>(data);
|
||||
GuildInfo* guildInfo = reinterpret_cast<GuildInfo*>(reinterpret_cast<char*>(&g_guildId) - offsetof(GuildInfo, m_guildId));
|
||||
const int count = (packet->length - 4) / sizeof(GuildPositionNameEntry);
|
||||
for (int i = 0; i < count; ++i) {
|
||||
const GuildPositionNameEntry& position = packet->entries[i];
|
||||
char name[25];
|
||||
std::memcpy(name, position.name, sizeof(position.name));
|
||||
name[24] = '\0';
|
||||
if (g_forbiddenWords.Contains(name)) {
|
||||
std::string masked;
|
||||
g_forbiddenWords.Mask(name, &masked);
|
||||
}
|
||||
|
||||
guildInfo->m_positions[position.positionId] = name;
|
||||
}
|
||||
|
||||
g_windowMgr.RefreshGuildWindows();
|
||||
}
|
||||
|
||||
// OFFSET: 0x00D5A4C0
|
||||
|
||||
// OFFSET: 0x00D5B3C0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue