port: FlyingData/Instance/ObjectManager/FlyTrace + effect/fly modules (batch 2 P1)

Verbatim copies of the 40250 flying-object units and the effect/fly
Python modules replace the pending CFlyingManager stand-in and the two
module stubs; initeffect/initfly run after initnet as in 40250 and the
flying manager gets the background as its map manager.
CMapManager::GetTerrainHeight is added over the native height tiles.
login_flow checks playersettingmodule registered the indexed fly data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-09-24 00:12:19 +09:00
co-authored by Claude Opus 5.5
parent 05de621199
commit 9dcf34dffc
25 changed files with 2312 additions and 182 deletions
@@ -73,54 +73,6 @@ void AddStubConstants_background(PyObject* poModule)
PyModule_AddIntConstant(poModule, "TEXTURE_SORT", CMapOutdoor::TEXTURE_SORT);
}
// 40250 UserInterface/PythonEffectModule.cpp
enum
{
FLY_NONE,
FLY_EXP,
FLY_HP_MEDIUM,
FLY_HP_BIG,
FLY_SP_SMALL,
FLY_SP_MEDIUM,
FLY_SP_BIG,
FLY_FIREWORK1,
FLY_FIREWORK2,
FLY_FIREWORK3,
FLY_FIREWORK4,
FLY_FIREWORK5,
FLY_FIREWORK6,
FLY_FIREWORK_XMAS,
FLY_CHAIN_LIGHTNING,
FLY_HP_SMALL,
FLY_SKILL_MUYEONG,
};
// 40250 UserInterface/PythonEffectModule.cpp
void AddStubConstants_effect(PyObject* poModule)
{
(void) poModule;
PyModule_AddIntConstant(poModule, "INDEX_FLY_TYPE_NORMAL", CFlyingManager::INDEX_FLY_TYPE_NORMAL);
PyModule_AddIntConstant(poModule, "INDEX_FLY_TYPE_FIRE_CRACKER", CFlyingManager::INDEX_FLY_TYPE_FIRE_CRACKER);
PyModule_AddIntConstant(poModule, "INDEX_FLY_TYPE_AUTO_FIRE", CFlyingManager::INDEX_FLY_TYPE_AUTO_FIRE);
PyModule_AddIntConstant(poModule, "FLY_NONE", FLY_NONE);
PyModule_AddIntConstant(poModule, "FLY_EXP", FLY_EXP);
PyModule_AddIntConstant(poModule, "FLY_HP_MEDIUM", FLY_HP_MEDIUM);
PyModule_AddIntConstant(poModule, "FLY_HP_BIG", FLY_HP_BIG);
PyModule_AddIntConstant(poModule, "FLY_SP_SMALL", FLY_SP_SMALL);
PyModule_AddIntConstant(poModule, "FLY_SP_MEDIUM", FLY_SP_MEDIUM);
PyModule_AddIntConstant(poModule, "FLY_SP_BIG", FLY_SP_BIG);
PyModule_AddIntConstant(poModule, "FLY_FIREWORK1", FLY_FIREWORK1);
PyModule_AddIntConstant(poModule, "FLY_FIREWORK2", FLY_FIREWORK2);
PyModule_AddIntConstant(poModule, "FLY_FIREWORK3", FLY_FIREWORK3);
PyModule_AddIntConstant(poModule, "FLY_FIREWORK4", FLY_FIREWORK4);
PyModule_AddIntConstant(poModule, "FLY_FIREWORK5", FLY_FIREWORK5);
PyModule_AddIntConstant(poModule, "FLY_FIREWORK6", FLY_FIREWORK6);
PyModule_AddIntConstant(poModule, "FLY_FIREWORK_XMAS", FLY_FIREWORK_XMAS);
PyModule_AddIntConstant(poModule, "FLY_CHAIN_LIGHTNING", FLY_CHAIN_LIGHTNING);
PyModule_AddIntConstant(poModule, "FLY_HP_SMALL", FLY_HP_SMALL);
PyModule_AddIntConstant(poModule, "FLY_SKILL_MUYEONG", FLY_SKILL_MUYEONG);
}
// 40250 UserInterface/PythonEventManagerMoudle.cpp
void AddStubConstants_event(PyObject* poModule)
{
@@ -144,12 +96,6 @@ void AddStubConstants_exchange(PyObject* poModule)
PyModule_AddIntConstant(poModule, "EXCHANGE_ITEM_MAX_NUM", CPythonExchange::EXCHANGE_ITEM_MAX_NUM);
}
// 40250 UserInterface/PythonFlyModule.cpp
void AddStubConstants_fly(PyObject* poModule)
{
(void) poModule;
}
// 40250 UserInterface/PythonGuild.cpp
void AddStubConstants_guild(PyObject* poModule)
{
@@ -7,11 +7,9 @@
// GameplayModuleConstants.cpp: each module's 40250 constants.
void AddStubConstants_ServerStateChecker(PyObject* poModule);
void AddStubConstants_background(PyObject* poModule);
void AddStubConstants_effect(PyObject* poModule);
void AddStubConstants_event(PyObject* poModule);
void AddStubConstants_eventMgr(PyObject* poModule);
void AddStubConstants_exchange(PyObject* poModule);
void AddStubConstants_fly(PyObject* poModule);
void AddStubConstants_guild(PyObject* poModule);
void AddStubConstants_ime(PyObject* poModule);
void AddStubConstants_item(PyObject* poModule);
@@ -150,24 +148,6 @@ PyMethodDef methods_background[] = {
{ "WarpTest", stub_background_WarpTest, METH_VARARGS },
{ NULL, NULL }
};
// 40250 UserInterface/PythonEffectModule.cpp: effect export names.
PyObject* stub_effect_RegisterEffect(PyObject*, PyObject*) { return stub_call_named("effect.RegisterEffect", Py_BuildNone()); }
PyObject* stub_effect_CreateEffect(PyObject*, PyObject*) { return stub_call_named("effect.CreateEffect", Py_BuildValue("i", 0)); }
PyObject* stub_effect_DeleteEffect(PyObject*, PyObject*) { return stub_call_named("effect.DeleteEffect", Py_BuildNone()); }
PyObject* stub_effect_SetPosition(PyObject*, PyObject*) { return stub_call_named("effect.SetPosition", Py_BuildNone()); }
PyObject* stub_effect_RegisterIndexedFlyData(PyObject*, PyObject*) { return stub_call_named("effect.RegisterIndexedFlyData", Py_BuildNone()); }
PyObject* stub_effect_Update(PyObject*, PyObject*) { return stub_call_named("effect.Update", Py_BuildNone()); }
PyObject* stub_effect_Render(PyObject*, PyObject*) { return stub_call_named("effect.Render", Py_BuildNone()); }
PyMethodDef methods_effect[] = {
{ "RegisterEffect", stub_effect_RegisterEffect, METH_VARARGS },
{ "CreateEffect", stub_effect_CreateEffect, METH_VARARGS },
{ "DeleteEffect", stub_effect_DeleteEffect, METH_VARARGS },
{ "SetPosition", stub_effect_SetPosition, METH_VARARGS },
{ "RegisterIndexedFlyData", stub_effect_RegisterIndexedFlyData, METH_VARARGS },
{ "Update", stub_effect_Update, METH_VARARGS },
{ "Render", stub_effect_Render, METH_VARARGS },
{ NULL, NULL }
};
// 40250 UserInterface/PythonEventManagerMoudle.cpp: event export names.
PyObject* stub_event_RegisterEventSet(PyObject*, PyObject*) { return stub_call_named("event.RegisterEventSet", Py_BuildValue("i", 0)); }
PyObject* stub_event_RegisterEventSetFromString(PyObject*, PyObject*) { return stub_call_named("event.RegisterEventSetFromString", Py_BuildValue("i", 0)); }
@@ -264,14 +244,6 @@ PyMethodDef methods_exchange[] = {
{ "SetElkMode", stub_exchange_SetElkMode, METH_VARARGS },
{ NULL, NULL }
};
// 40250 UserInterface/PythonFlyModule.cpp: fly export names.
PyObject* stub_fly_Update(PyObject*, PyObject*) { return stub_call_named("fly.Update", Py_BuildNone()); }
PyObject* stub_fly_Render(PyObject*, PyObject*) { return stub_call_named("fly.Render", Py_BuildNone()); }
PyMethodDef methods_fly[] = {
{ "Update", stub_fly_Update, METH_VARARGS },
{ "Render", stub_fly_Render, METH_VARARGS },
{ NULL, NULL }
};
// 40250 UserInterface/PythonGuild.cpp: guild export names.
PyObject* stub_guild_IsGuildEnable(PyObject*, PyObject*) { return stub_call_named("guild.IsGuildEnable", Py_BuildValue("i", 0)); }
PyObject* stub_guild_GuildIDToMarkID(PyObject*, PyObject*) { return stub_call_named("guild.GuildIDToMarkID", Py_BuildValue("i", 0)); }
@@ -930,11 +902,6 @@ void init_2v0_gameplay_stubs() {
PyModule_AddIntConstant(module, "__port_stub__", 1);
AddStubConstants_background(module);
}
{
PyObject* module = Py_InitModule("effect", methods_effect);
PyModule_AddIntConstant(module, "__port_stub__", 1);
AddStubConstants_effect(module);
}
{
PyObject* module = Py_InitModule("event", methods_event);
PyModule_AddIntConstant(module, "__port_stub__", 1);
@@ -950,11 +917,6 @@ void init_2v0_gameplay_stubs() {
PyModule_AddIntConstant(module, "__port_stub__", 1);
AddStubConstants_exchange(module);
}
{
PyObject* module = Py_InitModule("fly", methods_fly);
PyModule_AddIntConstant(module, "__port_stub__", 1);
AddStubConstants_fly(module);
}
{
PyObject* module = Py_InitModule("guild", methods_guild);
PyModule_AddIntConstant(module, "__port_stub__", 1);
@@ -319,6 +319,7 @@ 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>();
g_flying_manager->SetMapManagerPtr(&g_game_singletons->pyBackground); // 40250 CPythonApplication ctor (PythonApplication.cpp:82)
return true;
}
@@ -344,6 +345,8 @@ bool run_main_script_body(const char* lpCmdLine, std::string* error)
initPlayer();
initChat();
initnet();
initeffect();
initfly();
init_2v0_gameplay_stubs();
ClearLogBoxMessage();