AVA2 client Windows parity passes (gr2 BitKnit2/64-bit, GamePhase handlers, python modules)
- gr2: BitKnit2 decompression, 64-bit LE files, compressed curves - net: remaining GamePhase handlers, generated GC packet table - python: event/chat/chr/minimap/guild/quest/messenger/shop-search and other native modules ported against the AVA2 Windows client - render: D3D8 fixed-function lighting in Gr2ModelRenderer, terrain without baked shade; cape/NPC equipment attachment - tests + audits updated; docs/PORT-PLAN.md and WINDOWS-PARITY.md Batch 4 (render pipeline: background.*, app.RenderGame/UpdateGame, camera bindings, main.cpp fake-content removal) is still in progress. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9f748eb05a
commit
9077aa389a
@@ -1,8 +1,18 @@
|
||||
#include "pet_skill_state.h"
|
||||
#include "eter_ui/PythonWindowManager.h"
|
||||
#include "src/eter_image/GrpImageInstance.h"
|
||||
#include "src/eter_image/GrpExpandedImageInstance.h"
|
||||
#include "src/eter_image/GrpMarkInstance.h"
|
||||
#include "python_runtime.h"
|
||||
#include "quest_state.h"
|
||||
#include "guild_state.h"
|
||||
#include "battlepass_state.h"
|
||||
#include "drop_item_state.h"
|
||||
#include "dungeon_info_state.h"
|
||||
#include "switchbot_state.h"
|
||||
#include "messenger_state.h"
|
||||
#include "cube_renewal_state.h"
|
||||
#include "shop_search_state.h"
|
||||
#include "python_net.h"
|
||||
#include "python_app.h"
|
||||
#include "python_dbg.h"
|
||||
@@ -12,6 +22,8 @@
|
||||
#include "python_ime.h"
|
||||
#include "python_grp.h"
|
||||
#include "python_native_modules.h"
|
||||
#include "python_event_manager.h"
|
||||
#include "python_chat.h"
|
||||
#include "../upstream/ava2-client/UserInterface/Locale_inc.h"
|
||||
#include <Python.h>
|
||||
#include <algorithm>
|
||||
@@ -72,8 +84,18 @@ std::string ReadPackedText(const std::string& name) {
|
||||
PythonRuntime::PythonRuntime(const std::filesystem::path& stdlib,const std::filesystem::path& root) {
|
||||
if(Py_IsInitialized()) throw std::logic_error("one embedded Python runtime allowed");
|
||||
ResetPythonAppState();
|
||||
GetPetSkillState()=PetSkillState{};
|
||||
ResetSkillDescriptions();
|
||||
ResetShopState();
|
||||
GetQuestState().records.clear();
|
||||
GetGuildState()=GuildState{};
|
||||
GetShopSearchItems().clear();
|
||||
GetMessengerState().Reset();
|
||||
GetCubeRenewalState().Reset();
|
||||
GetBattlePassState().Reset();
|
||||
GetDropItemState().Reset();
|
||||
GetDungeonInfoState()=DungeonInfoState{};
|
||||
GetSwitchbotState()=SwitchbotState{};
|
||||
if(!std::filesystem::is_regular_file(stdlib)) throw std::runtime_error("python27.zip missing");
|
||||
pack_root=std::filesystem::canonical(root);
|
||||
static bool registered=false;
|
||||
@@ -132,6 +154,7 @@ PythonRuntime::PythonRuntime(const std::filesystem::path& stdlib,const std::file
|
||||
registered=true;
|
||||
}
|
||||
Py_FrozenFlag=1;Py_IgnoreEnvironmentFlag=1;Py_NoSiteFlag=1;Py_DontWriteBytecodeFlag=1;
|
||||
CResourceManager::SetResourceRoot(std::filesystem::absolute(root));
|
||||
m_resourceManager = std::make_unique<CResourceManager>();
|
||||
Py_Initialize();
|
||||
m_windowManager = std::make_unique<UI::CWindowManager>();
|
||||
@@ -214,6 +237,15 @@ sys.meta_path.insert(0, _AVA2PackImporter())
|
||||
)PY"); } catch(...) {
|
||||
reset_python_net();
|
||||
ClearPlayerPythonWindow();
|
||||
GetMessengerState().Reset();
|
||||
GetCubeRenewalState().Reset();
|
||||
GetBattlePassState().Reset();
|
||||
GetDropItemState().Reset();
|
||||
GetDungeonInfoState()=DungeonInfoState{};
|
||||
GetSwitchbotState()=SwitchbotState{};
|
||||
// The event sets hold weak references to Python objects.
|
||||
CPythonEventManager::Instance().Destroy();CPythonChat::Instance().Destroy();CPythonSystem::Instance().Clear();
|
||||
CPythonEventManager::Instance().SetInterfaceWindow(nullptr);
|
||||
Py_Finalize();
|
||||
if (m_windowManager)
|
||||
{
|
||||
@@ -236,6 +268,15 @@ sys.meta_path.insert(0, _AVA2PackImporter())
|
||||
PythonRuntime::~PythonRuntime() {
|
||||
reset_python_net();
|
||||
ClearPlayerPythonWindow();
|
||||
GetMessengerState().Reset();
|
||||
GetCubeRenewalState().Reset();
|
||||
GetBattlePassState().Reset();
|
||||
GetDropItemState().Reset();
|
||||
GetDungeonInfoState()=DungeonInfoState{};
|
||||
GetSwitchbotState()=SwitchbotState{};
|
||||
// The event sets hold weak references to Python objects.
|
||||
CPythonEventManager::Instance().Destroy();CPythonChat::Instance().Destroy();CPythonSystem::Instance().Clear();
|
||||
CPythonEventManager::Instance().SetInterfaceWindow(nullptr);
|
||||
Py_Finalize();
|
||||
if (m_windowManager)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user