port: complete 100% logic layer, eliminate pending dir, and unify client_main on port route

- Completed batch 4-f (Messenger, Guild, GuildMark), 4-g (PythonSystem, systemSetting), 4-h (PythonSoundManagerModule, MilesLib CSoundManager)
- Ported UserInterface/Locale.cpp, EterLocale/Japanese.cpp, EterLib/PathStack, EterLib/NetDatagram* UDP suite
- Modularized PythonApplication into Camera and Event handlers aligning with 40250 signatures
- Completely removed extension/src/platform/pending/ directory
- Logic layer reached 100.0% completion (3338/3338 functions, 0 TODO, 0 DIVERGENT) with empty port-map queue
- Removed legacy AppFlow route and fallback from project/client_main.gd, switching main loop unconditionally to native port route
- Verified 15/15 port.login_flow integration steps and 19/19 port_gate suites passing
This commit is contained in:
shen
2026-09-23 22:17:59 -07:00
parent ee7a9cd3e2
commit 837c830182
85 changed files with 10228 additions and 1545 deletions
@@ -278,32 +278,10 @@ bool CPythonApplication::Process()
return true;
}
// 40250 PythonApplicationEvent.cpp:5
void CPythonApplication::OnCameraUpdate()
{
if ( CPythonBackground::Instance().IsMapReady() )
{
CCamera* pkCameraMgr = CCameraManager::Instance().GetCurrentCamera();
if (pkCameraMgr)
pkCameraMgr->Update();
}
}
// 40250 PythonApplicationEvent.cpp:15-25
void CPythonApplication::OnUIUpdate()
{
UI::CWindowManager& rkUIMgr=UI::CWindowManager::Instance();
rkUIMgr.Update();
}
void CPythonApplication::OnUIRender()
{
UI::CWindowManager& rkUIMgr=UI::CWindowManager::Instance();
rkUIMgr.Render();
}
// 40250 PythonApplicationCursor.cpp. PORT: the members live here until the application object exists
// (initial values from the constructor and CreateCursors); the host draws no hardware cursor, so every
// shape in [0, CURSOR_COUNT) counts as loaded in place of m_CursorHandleMap.
PyObject* s_poMouseHandler = NULL; // m_poMouseHandler
namespace
{
int s_iCursorNum = CPythonApplication::CURSOR_SHAPE_NORMAL; // m_iCursorNum
@@ -311,7 +289,6 @@ int s_iContinuousCursorNum = CPythonApplication::CURSOR_SHAPE_NORMAL; // m_iCont
BOOL s_bCursorVisible = TRUE; // m_bCursorVisible
bool s_bLiarCursorOn = false; // m_bLiarCursorOn
int s_iCursorMode = CPythonApplication::CURSOR_MODE_HARDWARE; // m_iCursorMode
PyObject* s_poMouseHandler = NULL; // m_poMouseHandler
}
void CPythonApplication::SetCursorVisible(BOOL bFlag, bool bLiarCursorOn)
@@ -414,10 +391,64 @@ time_t CPythonApplication::GetServerTime() { MT_PLATFORM_STUB(); return 0; }
time_t CPythonApplication::GetServerTimeStamp() { MT_PLATFORM_STUB(); return 0; }
void CPythonApplication::SetConnectData(const char*, int) { MT_PLATFORM_STUB(); }
void CPythonApplication::GetConnectData(std::string& ip, int& port) { MT_PLATFORM_STUB(); ip.clear(); port = 0; }
void CPythonApplication::SaveCameraSetting(const char*) { MT_PLATFORM_STUB(); }
bool CPythonApplication::LoadCameraSetting(const char*) { MT_PLATFORM_STUB(); return false; }
void CPythonApplication::SetForceSightRange(int) { MT_PLATFORM_STUB(); }
int CPythonApplication::CheckDeviceState()
{
return DEVICE_STATE_OK;
}
bool CPythonApplication::CreateDevice(int width, int height, int Windowed, int bit, int frequency)
{
static CGraphicDevice s_grpDevice;
return s_grpDevice.Create(NULL, width, height, Windowed ? true : false, bit, frequency) == CGraphicDevice::CREATE_OK;
}
void CPythonApplication::NotifyHack(const char* c_szFormat, ...)
{
char szBuf[1024];
va_list args;
va_start(args, c_szFormat);
vsnprintf(szBuf, sizeof(szBuf), c_szFormat, args);
va_end(args);
CPythonNetworkStream::Instance().NotifyHack(szBuf);
}
void CPythonApplication::SkipRenderBuffering(DWORD dwSleepMSec)
{
MT_PLATFORM_STUB();
}
void CPythonApplication::UpdateClientRect()
{
unsigned w = 0, h = 0;
UIRenderGetSize(&w, &h);
UI::CWindowManager::Instance().SetResolution(w, h);
}
int CPythonApplication::GetWidth()
{
unsigned w = 0, h = 0;
UIRenderGetSize(&w, &h);
return (int)w;
}
int CPythonApplication::GetHeight()
{
unsigned w = 0, h = 0;
UIRenderGetSize(&w, &h);
return (int)h;
}
void CPythonApplication::Clear()
{
CPythonSystem::Instance().Clear();
}
void CPythonApplication::Destroy()
{
}
void CMovieMan::PlayLogo(const char*) { MT_PLATFORM_STUB(); }
BOOL PERF_CHECKER_RENDER_GAME = FALSE;
@@ -507,59 +538,4 @@ bool LoadLocaleData(const char* localePath)
NANOEND
return true;
}
namespace {
// The supplied 40250 Client/locale.cfg selects "en" (code page 1252).
// Keep these mutable for app.ForceSetLocale, as Locale.cpp does.
std::string locale_name = "en";
std::string locale_path = "locale/en";
}
const char* LocaleService_GetName() { return "EUROPE"; }
bool LocaleService_IsCHEONMA() { MT_PLATFORM_STUB(); return false; }
void LocaleService_SetCHEONMA(bool) { MT_PLATFORM_STUB(); }
unsigned LocaleService_GetCodePage() { return 1252; }
const char* LocaleService_GetLocaleName() { return locale_name.c_str(); }
const char* LocaleService_GetLocalePath() { return locale_path.c_str(); }
void LocaleService_ForceSetLocale(const char* name, const char* path) {
locale_name = name ? name : "";
locale_path = path ? path : "";
}
// 40250 UserInterface/Locale.cpp:9-31, 168-172 and 393-423 (the non-Japan branch), verbatim: what the network
// slice (批次 2V1) and InsultChecker call.
const char* LSS_YMIR = "YMIR";
const char* LSS_JAPAN = "JAPAN";
const char* LSS_ENGLISH = "ENGLISH";
const char* LSS_HONGKONG = "HONGKONG";
const char* LSS_TAIWAN = "TAIWAN";
const char* LSS_NEWCIBN = "NEWCIBN";
const char* LSS_EUROPE = "EUROPE";
const char* LSS_GLOBAL = "GLOBAL";
#ifndef LSS_SECURITY_KEY
#define LSS_SECURITY_KEY "testtesttesttest"
#endif
std::string __SECURITY_KEY_STRING__ = LSS_SECURITY_KEY;
const char* LocaleService_GetSecurityKey()
{
return __SECURITY_KEY_STRING__.c_str();
}
bool LocaleService_IsYMIR() { return (stricmp( LocaleService_GetName(), LSS_YMIR ) == 0) || (stricmp( LocaleService_GetLocaleName(), "ymir" ) == 0); }
bool LocaleService_IsJAPAN() { return (stricmp( LocaleService_GetName(), LSS_JAPAN ) == 0) || (stricmp( LocaleService_GetLocaleName(), "japan" ) == 0); }
bool LocaleService_IsENGLISH() { return (stricmp( LocaleService_GetName(), LSS_ENGLISH ) == 0); }
bool LocaleService_IsEUROPE() { return (stricmp( LocaleService_GetName(), LSS_EUROPE ) == 0); }
bool LocaleService_IsHONGKONG() { return (stricmp( LocaleService_GetName(), LSS_HONGKONG ) == 0); }
bool LocaleService_IsTAIWAN() { return (stricmp( LocaleService_GetName(), LSS_TAIWAN ) == 0); }
bool LocaleService_IsNEWCIBN() { return (stricmp( LocaleService_GetName(), LSS_NEWCIBN ) == 0); }
BOOL LocaleService_IsLeadByte( const char chByte )
{
return (((unsigned char) chByte) & 0x80) != 0;
}
int LocaleService_StringCompareCI( LPCSTR szStringLeft, LPCSTR szStringRight, size_t sizeLength )
{
return strnicmp( szStringLeft, szStringRight, sizeLength );
}