Decompile 5 functions in Source/Script/LuaScript.cpp, Source/Client/Session.h, ...
Batch #4949 by youko: 0 byte-identical, 5 confirmed by peer review. - fn_12792 AddItmeToExceptionMiniMapPosList: logic confirmed by peer review - fn_12793 AddItmeTokafraServiceMapList: logic confirmed by peer review - fn_18352 SetSubChatWndList: logic confirmed by peer review - fn_18353 SetSubChatWndOption: logic confirmed by peer review - fn_19675 AddEntryQueue: logic confirmed by peer review Peer-reviewed-by: eAthena, alisonrag, KWDev 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
93c6053801
commit
fc286c5881
3 changed files with 151 additions and 37 deletions
|
|
@ -65,6 +65,15 @@ struct SessionShop {
|
|||
/* 0004 */ std::vector<std::map<int, std::pair<int, int>>> unknown_0004;
|
||||
};
|
||||
|
||||
struct SubChatWndInfo {
|
||||
/* 0000 */ std::string name;
|
||||
/* 0018 */ bool options[25];
|
||||
/* 0034 */ int x;
|
||||
/* 0038 */ int y;
|
||||
/* 003C */ int width;
|
||||
/* 0040 */ int height;
|
||||
};
|
||||
|
||||
class CSession {
|
||||
public:
|
||||
/* 0000 */ std::uint32_t unknown_0000;
|
||||
|
|
@ -90,7 +99,9 @@ public:
|
|||
/* 071C */ std::vector<int> m_homunSkillLevels;
|
||||
/* 0728 */ std::vector<int> m_mercSkillLevels;
|
||||
/* 0734 */ std::list<SessionRecord0734> unknown_0734;
|
||||
/* 073C */ unsigned char unknown_073C[0x14];
|
||||
/* 073C */ std::map<int, SubChatWndInfo> m_noSubChatWnds;
|
||||
/* 0744 */ std::map<int, SubChatWndInfo> m_subChatWnds;
|
||||
/* 074C */ unsigned char unknown_074C[0x04];
|
||||
/* 0750 */ std::uint32_t m_prohibitionTarget;
|
||||
/* 0754 */ std::vector<ProhibitionLogEntry> m_prohibitionLog;
|
||||
/* 0760 */ std::string m_accountName;
|
||||
|
|
@ -645,6 +656,10 @@ void SetMemberFlags(std::uint32_t* flags);
|
|||
static_assert(sizeof(SessionRecord6144) == 0x38);
|
||||
static_assert(sizeof(SessionRecord6178) == 0x2C);
|
||||
static_assert(sizeof(ProhibitionLogEntry) == 0x54);
|
||||
static_assert(sizeof(SubChatWndInfo) == 0x44);
|
||||
static_assert(offsetof(SubChatWndInfo, x) == 0x34);
|
||||
static_assert(offsetof(CSession, m_noSubChatWnds) == 0x73C);
|
||||
static_assert(offsetof(CSession, m_subChatWnds) == 0x744);
|
||||
static_assert(offsetof(CSession, m_prohibitionLog) == 0x754);
|
||||
static_assert(offsetof(SessionRecord6144, unknown_002C) == 0x2C);
|
||||
static_assert(offsetof(SessionRecord6144, unknown_0030) == 0x30);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <map>
|
||||
|
||||
struct EntryQueueName {
|
||||
|
|
@ -10,10 +11,27 @@ struct EntryQueueName {
|
|||
};
|
||||
|
||||
struct EntryQueueInfo {
|
||||
EntryQueueInfo() {
|
||||
std::memset(this, 0, sizeof(EntryQueueInfo));
|
||||
}
|
||||
|
||||
/* 0000 */ int id;
|
||||
/* 0004 */ char name[24];
|
||||
/* 001C */ unsigned char unknown_001C[0xEC];
|
||||
/* 0108 */ char unknown_0108[0x630];
|
||||
/* 0004 */ char name[0x104];
|
||||
/* 0108 */ char displayName[0x104];
|
||||
/* 020C */ int unknown_020C;
|
||||
/* 0210 */ int unknown_0210;
|
||||
/* 0214 */ unsigned char unknown_0214;
|
||||
/* 0215 */ unsigned char unknown_0215;
|
||||
/* 0216 */ unsigned char unknown_0216;
|
||||
/* 0217 */ unsigned char unknown_0217;
|
||||
/* 0218 */ unsigned char unknown_0218;
|
||||
/* 021C */ int unknown_021C;
|
||||
/* 0220 */ int unknown_0220;
|
||||
/* 0224 */ char unknown_0224[0x104];
|
||||
/* 0328 */ char unknown_0328[0x104];
|
||||
/* 042C */ char unknown_042C[0x104];
|
||||
/* 0530 */ char unknown_0530[0x104];
|
||||
/* 0634 */ char unknown_0634[0x104];
|
||||
};
|
||||
|
||||
struct EntryQueueNotice {
|
||||
|
|
@ -48,6 +66,9 @@ void DestroyEntryQueueMgr();
|
|||
|
||||
#if defined(_WIN32) && !defined(_WIN64)
|
||||
static_assert(sizeof(EntryQueueInfo) == 0x738);
|
||||
static_assert(offsetof(EntryQueueInfo, unknown_020C) == 0x20C);
|
||||
static_assert(offsetof(EntryQueueInfo, unknown_021C) == 0x21C);
|
||||
static_assert(offsetof(EntryQueueInfo, unknown_0634) == 0x634);
|
||||
static_assert(offsetof(CEntryQueueMgr, characterName) == 0x1C);
|
||||
static_assert(offsetof(CEntryQueueMgr, current) == 0x34);
|
||||
static_assert(sizeof(CEntryQueueMgr) == 0x3C);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
#include "Script/LuaScript.h"
|
||||
#include "Archive/PakRegistry.h"
|
||||
#include "Client/Session.h"
|
||||
#include "Contents/EntryQueueMgr.h"
|
||||
#include "Contents/Effects/EffectLists.h"
|
||||
#include "Contents/Effects/EffectTypes.h"
|
||||
#include "Contents/Effects/EmitterEffect.h"
|
||||
|
|
@ -20,13 +22,29 @@ extern "C" {
|
|||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <windows.h>
|
||||
|
||||
struct MiniMapPosition {
|
||||
MiniMapPosition() {
|
||||
}
|
||||
|
||||
/* 0000 */ float x;
|
||||
/* 0004 */ float y;
|
||||
};
|
||||
|
||||
// GLOBAL: gl_24791
|
||||
LuaScript* g_luaScript;
|
||||
|
||||
// GLOBAL: gl_24913
|
||||
std::map<std::string, MiniMapPosition> g_exceptionMiniMapPosList;
|
||||
|
||||
// GLOBAL: gl_24914
|
||||
std::map<std::string, std::vector<std::string>> g_kafraServiceMapList;
|
||||
|
||||
struct LuaScriptPair {
|
||||
std::string left;
|
||||
std::string right;
|
||||
|
|
@ -81,23 +99,58 @@ int TraceValue(lua_State* state) {
|
|||
// OFFSET: 0x00AFF140
|
||||
// FUNCTION: fn_18352
|
||||
int SetSubChatWndList(lua_State* state) {
|
||||
luaL_checkstring(state, 1);
|
||||
luaL_checkstring(state, 2);
|
||||
luaL_checknumber(state, 3);
|
||||
luaL_checknumber(state, 4);
|
||||
luaL_checknumber(state, 5);
|
||||
luaL_checknumber(state, 6);
|
||||
lua_pushnumber(state, 0.0);
|
||||
if (g_session.m_noSubChatWnds.size() + g_session.m_subChatWnds.size() >= 10) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::string type = luaL_checkstring(state, 1);
|
||||
std::string name = luaL_checkstring(state, 2);
|
||||
const int x = static_cast<int>(luaL_checknumber(state, 3));
|
||||
const int y = static_cast<int>(luaL_checknumber(state, 4));
|
||||
const int width = static_cast<int>(luaL_checknumber(state, 5));
|
||||
const int height = static_cast<int>(luaL_checknumber(state, 6));
|
||||
|
||||
SubChatWndInfo info;
|
||||
std::memset(info.options, 0, sizeof(info.options));
|
||||
info.name = name;
|
||||
info.x = x;
|
||||
info.y = y;
|
||||
info.width = width;
|
||||
info.height = height;
|
||||
|
||||
int index;
|
||||
if (type == "No") {
|
||||
index = static_cast<int>(g_session.m_noSubChatWnds.size());
|
||||
g_session.m_noSubChatWnds[index] = info;
|
||||
} else {
|
||||
index = static_cast<int>(g_session.m_subChatWnds.size());
|
||||
g_session.m_subChatWnds[index] = info;
|
||||
}
|
||||
|
||||
lua_pushnumber(state, index);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// OFFSET: 0x00AFF630
|
||||
// FUNCTION: fn_18353
|
||||
int SetSubChatWndOption(lua_State* state) {
|
||||
luaL_checkstring(state, 1);
|
||||
luaL_checknumber(state, 2);
|
||||
luaL_checknumber(state, 3);
|
||||
luaL_checknumber(state, 4);
|
||||
std::string type = luaL_checkstring(state, 1);
|
||||
const int index = static_cast<int>(luaL_checknumber(state, 2));
|
||||
const int option = static_cast<int>(luaL_checknumber(state, 3));
|
||||
const int value = static_cast<int>(luaL_checknumber(state, 4));
|
||||
|
||||
if (type == "No") {
|
||||
const auto window = g_session.m_noSubChatWnds.find(index);
|
||||
if (window != g_session.m_noSubChatWnds.end()) {
|
||||
window->second.options[option - 1] = value != 0;
|
||||
}
|
||||
} else {
|
||||
const auto window = g_session.m_subChatWnds.find(index);
|
||||
if (window != g_session.m_subChatWnds.end()) {
|
||||
window->second.options[option - 1] = value != 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -582,23 +635,44 @@ int SetWindEffectInfo(lua_State* state) {
|
|||
// OFFSET: 0x00BA2F00
|
||||
// FUNCTION: fn_19675
|
||||
int AddEntryQueue(lua_State* state) {
|
||||
luaL_checknumber(state, 1);
|
||||
luaL_checkstring(state, 2);
|
||||
luaL_checkstring(state, 3);
|
||||
luaL_checknumber(state, 4);
|
||||
luaL_checknumber(state, 5);
|
||||
luaL_checknumber(state, 6);
|
||||
luaL_checknumber(state, 7);
|
||||
luaL_checknumber(state, 8);
|
||||
luaL_checknumber(state, 9);
|
||||
luaL_checknumber(state, 10);
|
||||
luaL_checknumber(state, 11);
|
||||
luaL_checknumber(state, 12);
|
||||
luaL_checkstring(state, 13);
|
||||
luaL_checkstring(state, 14);
|
||||
luaL_checkstring(state, 15);
|
||||
luaL_checkstring(state, 16);
|
||||
luaL_checkstring(state, 17);
|
||||
const int id = static_cast<int>(luaL_checknumber(state, 1));
|
||||
std::string name = luaL_checkstring(state, 2);
|
||||
std::string displayName = luaL_checkstring(state, 3);
|
||||
const int value020C = static_cast<int>(luaL_checknumber(state, 4));
|
||||
const int value0210 = static_cast<int>(luaL_checknumber(state, 5));
|
||||
const int value0214 = static_cast<int>(luaL_checknumber(state, 6));
|
||||
const int value0215 = static_cast<int>(luaL_checknumber(state, 7));
|
||||
const int value0216 = static_cast<int>(luaL_checknumber(state, 8));
|
||||
const int value0217 = static_cast<int>(luaL_checknumber(state, 9));
|
||||
const int value0218 = static_cast<int>(luaL_checknumber(state, 10));
|
||||
const int value021C = static_cast<int>(luaL_checknumber(state, 11));
|
||||
const int value0220 = static_cast<int>(luaL_checknumber(state, 12));
|
||||
std::string text0224 = luaL_checkstring(state, 13);
|
||||
std::string text0328 = luaL_checkstring(state, 14);
|
||||
std::string text042C = luaL_checkstring(state, 15);
|
||||
std::string text0530 = luaL_checkstring(state, 16);
|
||||
std::string text0634 = luaL_checkstring(state, 17);
|
||||
|
||||
EntryQueueInfo* info = new EntryQueueInfo;
|
||||
info->id = id;
|
||||
strcpy_s(info->name, sizeof(info->name), name.c_str());
|
||||
strcpy_s(info->displayName, sizeof(info->displayName), displayName.c_str());
|
||||
info->unknown_020C = value020C;
|
||||
info->unknown_0210 = value0210;
|
||||
info->unknown_0214 = static_cast<unsigned char>(value0214);
|
||||
info->unknown_0215 = static_cast<unsigned char>(value0215);
|
||||
info->unknown_0216 = static_cast<unsigned char>(value0216);
|
||||
info->unknown_0217 = static_cast<unsigned char>(value0217);
|
||||
info->unknown_0218 = static_cast<unsigned char>(value0218);
|
||||
info->unknown_021C = value021C;
|
||||
info->unknown_0220 = value0220;
|
||||
strcpy_s(info->unknown_0224, sizeof(info->unknown_0224), text0224.c_str());
|
||||
strcpy_s(info->unknown_0328, sizeof(info->unknown_0328), text0328.c_str());
|
||||
strcpy_s(info->unknown_042C, sizeof(info->unknown_042C), text042C.c_str());
|
||||
strcpy_s(info->unknown_0530, sizeof(info->unknown_0530), text0530.c_str());
|
||||
strcpy_s(info->unknown_0634, sizeof(info->unknown_0634), text0634.c_str());
|
||||
|
||||
g_entryQueueList.insert(std::make_pair(id, info));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -662,17 +736,21 @@ int AddCheckAttendanceBanner(lua_State* state) {
|
|||
// OFFSET: 0x009419B0
|
||||
// FUNCTION: fn_12793
|
||||
int AddItmeTokafraServiceMapList(lua_State* state) {
|
||||
luaL_checkstring(state, 1);
|
||||
luaL_checkstring(state, 2);
|
||||
std::string mapName = luaL_checkstring(state, 1);
|
||||
std::string serviceMapName = luaL_checkstring(state, 2);
|
||||
g_kafraServiceMapList[mapName].push_back(serviceMapName);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// OFFSET: 0x00941870
|
||||
// FUNCTION: fn_12792
|
||||
int AddItmeToExceptionMiniMapPosList(lua_State* state) {
|
||||
luaL_checkstring(state, 1);
|
||||
luaL_checknumber(state, 2);
|
||||
luaL_checknumber(state, 3);
|
||||
std::string mapName = luaL_checkstring(state, 1);
|
||||
const int x = static_cast<int>(luaL_checknumber(state, 2));
|
||||
const int y = static_cast<int>(luaL_checknumber(state, 3));
|
||||
MiniMapPosition& position = g_exceptionMiniMapPosList[mapName];
|
||||
position.x = static_cast<float>(x);
|
||||
position.y = static_cast<float>(y);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue