rodecomp/Source/Contents/ReputeMgr.h
ragnarok-clanker 3f81146835 Decompile 7 functions in Source/Contents/ReputeMgr.cpp, Source/Contents/ReputeMgr.h, ...
Batch #4498 by youko: 1 byte-identical, 6 confirmed by peer review.

- fn_04290 CReputeMgr::GetGroupNames: logic confirmed by peer review
- fn_04291 CReputeMgr::GetGroupReputes: logic confirmed by peer review
- fn_04292 CReputeMgr::GetAllReputes: logic confirmed by peer review
- fn_04297 CReputeMgr::SetPoint: logic confirmed by peer review
- fn_04298 CReputeMgr::FindReputes: logic confirmed by peer review
- fn_04299 CReputeMgr::SetPointsReceived: logic confirmed by peer review
- fn_04312 UIReputeWnd::Slot02: byte-identical

Peer-reviewed-by: eAthena, willerthal, KWDev
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
Adds to the build: Source/Contents/ReputeMgr.cpp, Source/UI/UIReputeWnd.cpp
2026-10-30 03:37:37 +00:00

58 lines
1.7 KiB
C++

#ifndef RAGNAROK_SOURCE_CONTENTS_REPUTEMGR_H
#define RAGNAROK_SOURCE_CONTENTS_REPUTEMGR_H
#include "Script/LuaInstance.h"
#include "Utility/Singleton.h"
#include <cstddef>
#include <cstdint>
#include <map>
#include <string>
#include <vector>
enum ReputeVisibility : std::int64_t {
REPUTE_VISIBLE = 0,
REPUTE_HIDDEN = 1,
REPUTE_VISIBLE_WITH_POINT = 2,
};
struct ReputeInfo {
/* 0000 */ std::string name;
/* 0018 */ std::int64_t unknown_0018;
/* 0020 */ std::int64_t unknown_0020;
/* 0028 */ ReputeVisibility visibility;
/* 0030 */ std::int64_t point;
/* 0038 */ bool updated;
};
struct ReputeGroup {
/* 0000 */ std::string name;
/* 0018 */ std::vector<std::uint64_t> reputes;
};
class CReputeMgr : public Singleton<CReputeMgr> {
public:
std::vector<std::string> GetGroupNames() const;
std::vector<const ReputeInfo*> GetGroupReputes(const std::string& groupName) const;
std::vector<const ReputeInfo*> GetAllReputes() const;
void SetPoint(std::uint64_t id, std::int64_t point);
std::vector<const ReputeInfo*> FindReputes(const std::string& keyword) const;
void SetPointsReceived(bool received);
protected:
/* 0004 */ std::map<std::uint64_t, ReputeInfo> m_infos;
/* 000C */ std::map<std::uint64_t, ReputeGroup> m_groups;
/* 0014 */ bool m_waitingForPoints = true;
/* 0018 */ CLuaInstance m_lua;
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(ReputeInfo) == 0x40);
static_assert(offsetof(ReputeInfo, visibility) == 0x28);
static_assert(offsetof(ReputeInfo, point) == 0x30);
static_assert(offsetof(ReputeInfo, updated) == 0x38);
static_assert(sizeof(ReputeGroup) == 0x24);
static_assert(sizeof(CReputeMgr) == 0x20);
#endif
#endif