From e78f3142e38a7277fbd1d2ffcce969ca051fcad2 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Thu, 21 Aug 2025 10:37:35 -0700 Subject: [PATCH] update comment on send_lobby_list --- src/SendCommands.cc | 9 ++++++--- .../DrawDistance/DrawDistance.59NL.patch.s | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/SendCommands.cc b/src/SendCommands.cc index 1362d799..04443ab7 100644 --- a/src/SendCommands.cc +++ b/src/SendCommands.cc @@ -1751,9 +1751,12 @@ void send_quest_categories_menu( } void send_lobby_list(shared_ptr c) { - // This command appears to be deprecated, as PSO expects it to be exactly how - // this server sends it, and does not react if it's different, except by - // changing the lobby IDs. + // DC v1 expects 10 lobbies in this list; DC v2 and later accept a variable + // number, but other parts of the code expect there to always be 15 lobbies. + // Furthermore, there are only 16 entries in the array in TProtocol and the + // writes aren't bounds-checked, so the 83 command could overwrite later + // parts of TProtocol if more than 16 entries are sent. (On Episode 3, there + // are 21 entries instead.) auto s = c->require_server_state(); vector entries; diff --git a/system/client-functions/DrawDistance/DrawDistance.59NL.patch.s b/system/client-functions/DrawDistance/DrawDistance.59NL.patch.s index 4d9efff9..c995db3c 100644 --- a/system/client-functions/DrawDistance/DrawDistance.59NL.patch.s +++ b/system/client-functions/DrawDistance/DrawDistance.59NL.patch.s @@ -82,7 +82,7 @@ patch_func_3: mov dword [0x00518803], 0x90909090 ret -# TODO: Which objects this affects? +# TOComputerMachine01 patch_func_4: pop ecx push 7 @@ -103,7 +103,7 @@ patch_code_end4: push ecx jmp write_call_func -# TODO: This one too? +# TObjCamera patch_func_5: pop ecx push 6