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
@@ -13,6 +13,7 @@
#include "UserInterface/ServerStateChecker.h"
#include "UserInterface/PythonPlayer.h"
#include "GameLib/FlyingObjectManager.h"
#include "MilesLib/SoundManager.h"
#include "GameLib/RaceManager.h"
#include "GameLib/GameEventManager.h"
#include "EffectLib/EffectManager.h"
@@ -32,6 +33,9 @@
#include "UserInterface/PythonMessenger.h"
#include "UserInterface/PythonSafeBox.h"
#include "UserInterface/PythonGuild.h"
#include "UserInterface/MarkManager.h"
#include "UserInterface/GuildMarkDownloader.h"
#include "UserInterface/GuildMarkUploader.h"
#include "UserInterface/PythonSystem.h"
#include "UserInterface/AbstractApplication.h"
#include "UserInterface/PythonApplication.h"
@@ -62,6 +66,7 @@ std::unique_ptr<CAccountConnector> g_account_connector;
// 40250 CPythonApplication::m_pyPlayer, m_FlyingManager and m_kEftMgr: the loading phase clears them
// (CPythonNetworkStream::SetLoadingPhase).
std::unique_ptr<CPythonPlayer> g_player;
std::unique_ptr<CSoundManager> g_sound_manager;
std::unique_ptr<CFlyingManager> g_flying_manager;
// 40250 CPythonApplication::m_kServerStateChecker: intrologin.py's channel status list.
std::unique_ptr<CServerStateChecker> g_server_state_checker;
@@ -125,6 +130,9 @@ struct GameSingletons
CPythonMessenger pyManager;
CPythonSafeBox pySafeBox;
CPythonGuild pyGuild;
CGuildMarkManager kGuildMarkManager;
CGuildMarkDownloader kGuildMarkDownloader;
CGuildMarkUploader kGuildMarkUploader;
CPythonSystem pySystem; // last CPythonApplication member (m_pySystem)
};
std::unique_ptr<GameSingletons> g_game_singletons;
@@ -231,6 +239,11 @@ void SetUISize(int width, int height)
g_window_manager->SetScreenSize(width, height);
g_window_manager->SetResolution(width, height);
UIRenderSetSize(width, height);
if (g_game_singletons)
{
g_game_singletons->pySystem.GetConfig()->width = width;
g_game_singletons->pySystem.GetConfig()->height = height;
}
}
void UIMouseMove(int x, int y)
@@ -330,7 +343,7 @@ bool Start(const char* stdlib_path, std::string* error)
return true;
// 40250 Main (UserInterface.cpp:410): if (LocaleService_LoadGlobal(hInstance)) SetDefaultCodePage(...).
// PORT: the platform LocaleService is already the supplied locale.cfg (en, code page 1252).
LocaleService_LoadConfig("locale.cfg");
SetDefaultCodePage(LocaleService_GetCodePage());
const std::string stdlib = (stdlib_path && *stdlib_path) ? stdlib_path : PythonHost::DefaultStdLibPath();
@@ -361,6 +374,7 @@ bool Start(const char* stdlib_path, std::string* error)
g_network_stream = std::make_unique<CPythonNetworkStream>();
g_account_connector = std::make_unique<CAccountConnector>();
g_player = std::make_unique<CPythonPlayer>();
g_sound_manager = std::make_unique<CSoundManager>();
g_flying_manager = std::make_unique<CFlyingManager>();
g_server_state_checker = std::make_unique<CServerStateChecker>();
g_race_manager = std::make_unique<CRaceManager>();
@@ -368,6 +382,14 @@ bool Start(const char* stdlib_path, std::string* error)
g_effect_manager = std::make_unique<CEffectManager>();
g_game_application = std::make_unique<GameApplicationAdapter>();
g_game_singletons = std::make_unique<GameSingletons>();
unsigned ui_w = 0, ui_h = 0;
UIRenderGetSize(&ui_w, &ui_h);
if (ui_w && ui_h)
{
g_game_singletons->pySystem.GetConfig()->width = ui_w;
g_game_singletons->pySystem.GetConfig()->height = ui_h;
}
g_game_singletons->pySystem.GetDisplaySettings(); // 40250 CPythonApplication::Create (PythonApplication.cpp:1233)
g_flying_manager->SetMapManagerPtr(&g_game_singletons->pyBackground); // 40250 CPythonApplication ctor (PythonApplication.cpp:82)
return true;
}
@@ -390,6 +412,7 @@ bool run_main_script_body(const char* lpCmdLine, std::string* error)
initgrpText();
initwndMgr();
initapp();
initsystem();
initchr();
initchrmgr();
initPlayer();
@@ -403,11 +426,15 @@ bool run_main_script_body(const char* lpCmdLine, std::string* error)
initEvent();
initeffect();
initfly();
initsnd();
initeventmgr();
initshop();
initskill();
initquest();
initBackground();
initMessenger();
initsafebox();
initguild();
initServerStateChecker();
init_2v0_gameplay_stubs();
@@ -600,6 +627,7 @@ void Stop()
g_race_manager.reset();
g_server_state_checker.reset();
g_flying_manager.reset();
g_sound_manager.reset();
g_player.reset();
g_account_connector.reset();
g_network_stream.reset();