Fix cross-platform rendering and optimize frame performance

Correct selection orientation, game-entry lifecycle, mounted NPCs, labels and skill panels. Add the native GPU scene path, resident geometry, bounded texture and Python caches, and collision broad phase.

Pin the independently maintained Metin2 SDK through a submodule and document reproducible setup. Include rendering regressions and macOS packaging improvements.

Validation: client Debug build and 12 targeted client tests passed; SDK build and all 14 SDK tests passed.
This commit is contained in:
shen
2026-10-11 17:55:53 -07:00
parent 08cc8865be
commit 281418f351
101 changed files with 6244 additions and 1877 deletions
@@ -544,12 +544,7 @@ bool PythonNetworkStream::RecvMessenger() {
bool PythonNetworkStream::RecvQuestInfoPacket() {
uint8_t header,flags;uint16_t size,id;
if(!Read(1,&header)||!Read(2,&size)||!Read(2,&id)||!Read(1,&flags))return false;
// Reject a declared payload shorter than its flag-selected fields before a
// read can consume the next packet. Windows assumes trusted server lengths.
const size_t required=6+bool(flags&QUEST_SEND_IS_BEGIN)+31*bool(flags&QUEST_SEND_TITLE)+
17*bool(flags&QUEST_SEND_CLOCK_NAME)+4*bool(flags&QUEST_SEND_CLOCK_VALUE)+
17*bool(flags&QUEST_SEND_COUNTER_NAME)+4*bool(flags&QUEST_SEND_COUNTER_VALUE)+25*bool(flags&QUEST_SEND_ICON_FILE);
if(size<required)return false;
unsigned type=2;
if(flags&QUEST_SEND_IS_BEGIN) {
uint8_t begin;if(!Read(1,&begin))return false;type=begin?1:3;
@@ -646,11 +641,12 @@ bool PythonNetworkStream::RecvChestDrop() {
uint32_t chestVnum,chestCount;
if(!Read(4,&chestVnum) || !Read(4,&chestCount)) return false;
if(chestCount>0) {
ClearChestDropInfo(chestVnum);
for(uint32_t j=0;j<chestCount;++j) {
uint32_t vnum,count;
if(!Read(4,&vnum) || !Read(4,&count)) return false;
AddChestDropItem(chestVnum, vnum, count);
}
// CItemManager::LoadChestDropFromServer: the chest-drop item store is not ported.
PyCallClassMemberFunc(m_phaseWindows[5],"OpenChestDrop",Py_BuildValue("(i)",int(chestVnum)));
}
return true;
@@ -1321,8 +1317,12 @@ bool PythonNetworkStream::RecvHandshakePacket() {
bool PythonNetworkStream::RecvHandshakeOKPacket() {
TPacketGCBlank p;
if(!Read(sizeof(p),&p)) return false;
const uint32_t delta=GetLocalMSec()-m_changeClientTime;
SetServerMSec(m_changeServerTime+delta);
// Bootstrap may already have completed the initial handshake. An OK without
// a native handshake must retain its synchronized clock, not use host uptime.
if(m_changeClientTime!=0) {
const uint32_t delta=GetLocalMSec()-m_changeClientTime;
SetServerMSec(m_changeServerTime+delta);
}
return true;
}