Update OP_LogServer

Fix the source group matching in common lib
Added a couple packet structure documentations I had looked at.
This commit is contained in:
KimLS 2026-04-06 20:51:52 -07:00
parent c7eea72997
commit 30c9c6317f
4 changed files with 86 additions and 51 deletions

View File

@ -93,8 +93,8 @@ set(common_sources
patches/sod_limits.cpp
patches/sof.cpp
patches/sof_limits.cpp
patches/tob.cpp
patches/tob_limits.cpp
patches/tob.cpp
patches/tob_limits.cpp
patches/titanium.cpp
patches/titanium_limits.cpp
patches/uf.cpp
@ -676,10 +676,10 @@ set(common_headers
patches/sof_limits.h
patches/sof_ops.h
patches/sof_structs.h
patches/tob.h
patches/tob_limits.h
patches/tob_ops.h
patches/tob_structs.h
patches/tob.h
patches/tob_limits.h
patches/tob_ops.h
patches/tob_structs.h
patches/ss_declare.h
patches/ss_define.h
patches/ss_register.h
@ -736,24 +736,7 @@ set(common_headers
)
# Source Groups (Regex based for automatic subdirectory handling)
source_group("CLI" REGULAR_EXPRESSION "^cli/")
source_group("Content" REGULAR_EXPRESSION "^content/")
source_group("Cron" REGULAR_EXPRESSION "^cron/")
source_group("Database" REGULAR_EXPRESSION "^database/")
source_group("Discord" REGULAR_EXPRESSION "^discord/")
source_group("Event" REGULAR_EXPRESSION "^event/")
source_group("Events" REGULAR_EXPRESSION "^events/")
source_group("Http" REGULAR_EXPRESSION "^http/")
source_group("Json" REGULAR_EXPRESSION "^json/")
source_group("Memory" REGULAR_EXPRESSION "^memory/")
source_group("Net" REGULAR_EXPRESSION "^net/")
source_group("Patches" REGULAR_EXPRESSION "^patches/")
source_group("Process" REGULAR_EXPRESSION "^process/")
source_group("Repositories" REGULAR_EXPRESSION "^repositories/")
source_group("StackWalker" REGULAR_EXPRESSION "^StackWalker/")
source_group("Stacktrace" REGULAR_EXPRESSION "^stacktrace/")
source_group("Termcolor" REGULAR_EXPRESSION "^termcolor/")
source_group("Util" REGULAR_EXPRESSION "^util/")
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${common_headers} ${common_sources} ${repositories})
option(EQEMU_ADD_PROFILER "Link with Google perftools profiler" OFF)
#PRNG options

View File

@ -854,86 +854,86 @@ namespace TOB
ENCODE(OP_LogServer) {
SETUP_VAR_ENCODE(LogServer_Struct);
ALLOC_LEN_ENCODE(1840);
ALLOC_LEN_ENCODE(1932);
//pvp
if (emu->enable_pvp) {
*(char*)&__packet->pBuffer[0x04] = 1;
*(char*)&__packet->pBuffer[0x06] = 1;
}
if (emu->enable_FV) {
//FV sets these both to 1
//one appears to enable the no drop flag the other just marks the server as special?
*(char*)&__packet->pBuffer[0x08] = 1;
*(char*)&__packet->pBuffer[0x0a] = 1;
*(char*)&__packet->pBuffer[0x0c] = 1;
}
//This has something to do with heirloom and prestige items but im not sure what it does
//Seems to sit at 0
*(char*)&__packet->pBuffer[0x71d] = 0;
*(char*)&__packet->pBuffer[0x75f] = 0;
//not sure what this does, something to do with server select
*(char*)&__packet->pBuffer[0x09] = 0;
//this appears to have some effect on the tradeskill system; disabling made by tags perhaps?
*(char*)&__packet->pBuffer[0x0b] = 0;
//this appears to have some effect on the tradeskill system; disabling made by tags perhaps?
*(char*)&__packet->pBuffer[0x0d] = 0;
//not sure, setting it to the value ive seen
*(char*)&__packet->pBuffer[0x0c] = 1;
*(char*)&__packet->pBuffer[0x0e] = 1;
//Something to do with languages
*(char*)&__packet->pBuffer[0x0d] = 1;
*(char*)&__packet->pBuffer[0x0f] = 1;
//These seem to affect if server has betabuff enabled
*(char*)&__packet->pBuffer[0x5c0] = 0;
*(char*)&__packet->pBuffer[0x5c1] = 0;
*(char*)&__packet->pBuffer[0x602] = 0;
*(char*)&__packet->pBuffer[0x603] = 0;
//This is set on test so it's probably indicating this is a test server
*(char*)&__packet->pBuffer[0x5c2] = 0;
*(char*)&__packet->pBuffer[0x604] = 0;
//not sure, but it's grouped with the beta and test stuff
*(char*)&__packet->pBuffer[0x5c3] = 0;
*(char*)&__packet->pBuffer[0x605] = 0;
//world short name
strncpy((char*)&__packet->pBuffer[0x15], emu->worldshortname, 32);
strncpy((char*)&__packet->pBuffer[0x17], emu->worldshortname, 32);
//not sure, affects some player calculation but didn't care to look more
*(char*)&__packet->pBuffer[0x5c2] = 0;
*(char*)&__packet->pBuffer[0x5ee] = 0;
//Looks right
if (emu->enablemail) {
*(char*)&__packet->pBuffer[0x5b5] = 1;
*(char*)&__packet->pBuffer[0x5f7] = 1;
}
//Looks right
if (emu->enablevoicemacros) {
*(char*)&__packet->pBuffer[0x5b4] = 1;
*(char*)&__packet->pBuffer[0x5f6] = 1;
}
//Not sure, sending what we've seen
*(char*)&__packet->pBuffer[0x5b6] = 0;
*(char*)&__packet->pBuffer[0x5f8] = 0;
//Not sure sending what we've seen
*(char*)&__packet->pBuffer[0x5b8] = 1;
*(char*)&__packet->pBuffer[0x5fa] = 1;
//Not sure sending what we've seen
*(int32_t*)&__packet->pBuffer[0x5fc] = -1;
*(int32_t*)&__packet->pBuffer[0x63e] = -1;
//Test sets this to 1, everyone else seems to set it to 0
*(int32_t*)&__packet->pBuffer[0x600] = 0;
*(int32_t*)&__packet->pBuffer[0x642] = 0;
//Disassembly puts it next to code dealing with commands, ive not seen anyone send anything but 0
*(char*)&__packet->pBuffer[0x705] = 0;
*(char*)&__packet->pBuffer[0x747] = 0;
//Something about item restrictions, seems to always be set to 1
*(char*)&__packet->pBuffer[0x710] = 1;
*(char*)&__packet->pBuffer[0x752] = 1;
//This and 0x724 are often multiplied together in guild favor calcs, live and test send 1.0f
*(float*)&__packet->pBuffer[0x720] = 1.0f;
*(float*)&__packet->pBuffer[0x724] = 1.0f;
*(float*)&__packet->pBuffer[0x762] = 1.0f;
*(float*)&__packet->pBuffer[0x766] = 1.0f;
//This and 0x72c are often multiplied together in non-guild favor calcs, live and test send 1.0f
*(float*)&__packet->pBuffer[0x728] = 1.0f;
*(float*)&__packet->pBuffer[0x72c] = 1.0f;
*(float*)&__packet->pBuffer[0x76a] = 1.0f;
*(float*)&__packet->pBuffer[0x76e] = 1.0f;
FINISH_ENCODE();
}

View File

@ -0,0 +1,26 @@
struct CharacterCreateAllocation
{
u32 index;
u32 base_stats[7];
u32 default_allocations[7];
};
struct RaceClassCombo
{
u64 expansion_req;
u32 race;
u32 class;
u32 deity;
u32 allocation_index;
u32 zone;
};
struct Packet {
u8 padding1;
u32 allocation_count;
CharacterCreateAllocation allocations[allocation_count];
u32 race_class_combo_count;
RaceClassCombo race_class_combos[race_class_combo_count];
};
Packet p @ 0x00;

View File

@ -0,0 +1,26 @@
struct MembershipEntry
{
u32 purchase_id;
u32 bitwise_entry;
};
struct MembershipSetting
{
s8 setting_index;
s32 setting_id; // 0 to 23 actually seen but the OP_Membership packet has up to 32
s32 setting_value;
};
struct Membership
{
u32 membership_setting_count;
MembershipSetting membership_settings[membership_setting_count];
u32 race_entry_count;
MembershipEntry membership_races[race_entry_count];
u32 class_entry_count;
MembershipEntry membership_classes[class_entry_count];
u32 exit_url_length;
char exit_url[exit_url_length];
};
Membership m @ 0x00;