From 5bcf1b92eae3facddb70b319603581ddc525ac73 Mon Sep 17 00:00:00 2001 From: Andreas Lierschaft Date: Mon, 17 Aug 2026 23:37:09 +0200 Subject: [PATCH] Drachenseelen-Refine-Protokoll aus dem Client-Engine-Code entfernen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dritter, zuvor uebersehener Teil der Drachenseelen-Entfernung: das Visual-Studio-Projekt, das Metin2Client.exe baut und die an Python exponierten Module (player/chr/item/app/net) bereitstellt. Entfernt: NEW_AFFECT_DRAGON_SOUL_QUALIFIED/_DECK1/_DECK2 (InstanceBase.h + Python-Bindings), das komplette Refine-Netzwerkprotokoll (HEADER_CG/GC_DRAGON_SOUL_REFINE, TPacketCG/GCDragonSoulRefine, Send/RecvDragonSoulRefine(Packet) inkl. aller Aufrufstellen, playerSendDragonSoulRefine, DS_SUB_HEADER_*-Bindings in gleich zwei Modulen), playerIsDSEquipmentSlot, sowie die ungenutzten EDragonSoulStepTypes-Enum. Sicherheitsprinzip wie serverseitig beachtet: ESlotType, EWindows und CItemData::EItemType sind sequentielle Enums, in denen SLOT_TYPE_DRAGON_SOUL_INVENTORY / DRAGON_SOUL_INVENTORY / ITEM_TYPE_DS / ITEM_TYPE_SPECIAL_DS mitten drin liegen und mit dem Server sowie gespeicherten Item-Daten synchron bleiben muessen (u.a. wegen BELT_INVENTORY danach) - diese bleiben bewusst als reservierte, ungenutzte Werte stehen, ebenso EDragonSoulGradeTypes (wird noch von c_DragonSoul_Inventory_Count zur Groessenberechnung des aDSItem[]-Arrays gebraucht). WICHTIG: Dieses Projekt kann ich nicht selbst kompilieren (Windows/Visual Studio). Bitte einmal durchbauen und mir Fehler zurückmelden. --- source/UserInterface/GameType.h | 11 --- source/UserInterface/InstanceBase.h | 4 - source/UserInterface/Packet.h | 44 ----------- .../UserInterface/PythonCharacterModule.cpp | 6 -- source/UserInterface/PythonNetworkStream.cpp | 1 - source/UserInterface/PythonNetworkStream.h | 6 -- .../PythonNetworkStreamModule.cpp | 7 -- .../PythonNetworkStreamPhaseGame.cpp | 20 ----- .../PythonNetworkStreamPhaseGameItem.cpp | 30 ------- source/UserInterface/PythonPlayerModule.cpp | 78 ------------------- 10 files changed, 207 deletions(-) diff --git a/source/UserInterface/GameType.h b/source/UserInterface/GameType.h index 8d84dd9..d985e68 100644 --- a/source/UserInterface/GameType.h +++ b/source/UserInterface/GameType.h @@ -87,17 +87,6 @@ enum EDragonSoulGradeTypes DRAGON_SOUL_GRADE_MAX, }; - -enum EDragonSoulStepTypes -{ - DRAGON_SOUL_STEP_LOWEST, - DRAGON_SOUL_STEP_LOW, - DRAGON_SOUL_STEP_MID, - DRAGON_SOUL_STEP_HIGH, - DRAGON_SOUL_STEP_HIGHEST, - DRAGON_SOUL_STEP_MAX, -}; - #ifdef ENABLE_COSTUME_SYSTEM const DWORD c_Costume_Slot_Start = c_Equipment_Start + 19; // [ÁÖÀÇ] ¼ýÀÚ(19) ÇϵåÄÚµù ÁÖÀÇ. ÇöÀç ¼­¹ö¿¡¼­ ÄÚ½ºÃõ ½½·ÔÀº 19ºÎÅÍÀÓ. ¼­¹ö common/length.h ÆÄÀÏÀÇ EWearPositions ¿­°ÅÇü Âü°í. const DWORD c_Costume_Slot_Body = c_Costume_Slot_Start + 0; diff --git a/source/UserInterface/InstanceBase.h b/source/UserInterface/InstanceBase.h index 9df0c81..4941a67 100644 --- a/source/UserInterface/InstanceBase.h +++ b/source/UserInterface/InstanceBase.h @@ -173,10 +173,6 @@ class CInstanceBase NEW_AFFECT_AUTO_HP_RECOVERY = 534, // ÀÚµ¿¹°¾à HP NEW_AFFECT_AUTO_SP_RECOVERY = 535, // ÀÚµ¿¹°¾à SP - NEW_AFFECT_DRAGON_SOUL_QUALIFIED = 540, - NEW_AFFECT_DRAGON_SOUL_DECK1 = 541, - NEW_AFFECT_DRAGON_SOUL_DECK2 = 542, - NEW_AFFECT_RAMADAN_ABILITY = 300, NEW_AFFECT_RAMADAN_RING = 301, // ¶ó¸¶´Ü À̺¥Æ®¿ë Ư¼ö¾ÆÀÌÅÛ Ãʽ´ÞÀÇ ¹ÝÁö Âø¿ë À¯¹« diff --git a/source/UserInterface/Packet.h b/source/UserInterface/Packet.h index d498dd3..8768ac9 100644 --- a/source/UserInterface/Packet.h +++ b/source/UserInterface/Packet.h @@ -152,7 +152,6 @@ enum HEADER_CG_HS_ACK = 203, HEADER_CG_XTRAP_ACK = 204, - HEADER_CG_DRAGON_SOUL_REFINE = 205, HEADER_CG_STATE_CHECKER = 206, #ifdef __AUCTION__ @@ -356,7 +355,6 @@ enum #endif HEADER_GC_SPECIFIC_EFFECT = 208, - HEADER_GC_DRAGON_SOUL_REFINE = 209, HEADER_GC_RESPOND_CHANNELSTATUS = 210, HEADER_GC_KEY_AGREEMENT_COMPLETED = 0xfa, // _IMPROVED_PACKET_ENCRYPTION_ @@ -2762,48 +2760,6 @@ typedef struct SPacketGCSpecificEffect char effect_file[128]; } TPacketGCSpecificEffect; -// ¿ëÈ¥¼® -enum EDragonSoulRefineWindowRefineType -{ - DragonSoulRefineWindow_UPGRADE, - DragonSoulRefineWindow_IMPROVEMENT, - DragonSoulRefineWindow_REFINE, -}; - -enum EPacketCGDragonSoulSubHeaderType -{ - DS_SUB_HEADER_OPEN, - DS_SUB_HEADER_CLOSE, - DS_SUB_HEADER_DO_UPGRADE, - DS_SUB_HEADER_DO_IMPROVEMENT, - DS_SUB_HEADER_DO_REFINE, - DS_SUB_HEADER_REFINE_FAIL, - DS_SUB_HEADER_REFINE_FAIL_MAX_REFINE, - DS_SUB_HEADER_REFINE_FAIL_INVALID_MATERIAL, - DS_SUB_HEADER_REFINE_FAIL_NOT_ENOUGH_MONEY, - DS_SUB_HEADER_REFINE_FAIL_NOT_ENOUGH_MATERIAL, - DS_SUB_HEADER_REFINE_FAIL_TOO_MUCH_MATERIAL, - DS_SUB_HEADER_REFINE_SUCCEED, -}; - -typedef struct SPacketCGDragonSoulRefine -{ - SPacketCGDragonSoulRefine() : header (HEADER_CG_DRAGON_SOUL_REFINE) - {} - BYTE header; - BYTE bSubType; - TItemPos ItemGrid[DS_REFINE_WINDOW_MAX_NUM]; -} TPacketCGDragonSoulRefine; - -typedef struct SPacketGCDragonSoulRefine -{ - SPacketGCDragonSoulRefine() : header(HEADER_GC_DRAGON_SOUL_REFINE) - {} - BYTE header; - BYTE bSubType; - TItemPos Pos; -} TPacketGCDragonSoulRefine; - typedef struct SChannelStatus { short nPort; diff --git a/source/UserInterface/PythonCharacterModule.cpp b/source/UserInterface/PythonCharacterModule.cpp index bbd95c5..69685b2 100644 --- a/source/UserInterface/PythonCharacterModule.cpp +++ b/source/UserInterface/PythonCharacterModule.cpp @@ -1482,10 +1482,4 @@ void initchr() PyModule_AddIntConstant(poModule, "NEW_AFFECT_GOLD_BONUS", CInstanceBase::NEW_AFFECT_GOLD_BONUS); PyModule_AddIntConstant(poModule, "NEW_AFFECT_AUTO_HP_RECOVERY", CInstanceBase::NEW_AFFECT_AUTO_HP_RECOVERY); PyModule_AddIntConstant(poModule, "NEW_AFFECT_AUTO_SP_RECOVERY", CInstanceBase::NEW_AFFECT_AUTO_SP_RECOVERY); - - PyModule_AddIntConstant(poModule, "NEW_AFFECT_DRAGON_SOUL_QUALIFIED", CInstanceBase::NEW_AFFECT_DRAGON_SOUL_QUALIFIED); - - PyModule_AddIntConstant(poModule, "NEW_AFFECT_DRAGON_SOUL_DECK1", CInstanceBase::NEW_AFFECT_DRAGON_SOUL_DECK1); - PyModule_AddIntConstant(poModule, "NEW_AFFECT_DRAGON_SOUL_DECK2", CInstanceBase::NEW_AFFECT_DRAGON_SOUL_DECK2); - } diff --git a/source/UserInterface/PythonNetworkStream.cpp b/source/UserInterface/PythonNetworkStream.cpp index 4dd6b9f..5503e1a 100644 --- a/source/UserInterface/PythonNetworkStream.cpp +++ b/source/UserInterface/PythonNetworkStream.cpp @@ -183,7 +183,6 @@ class CMainPacketHeaderMap : public CNetworkPacketHeaderMap Set(HEADER_GC_HYBRIDCRYPT_KEYS, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCHybridCryptKeys), DYNAMIC_SIZE_PACKET)); Set(HEADER_GC_HYBRIDCRYPT_SDB, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCHybridSDB), DYNAMIC_SIZE_PACKET)); Set(HEADER_GC_SPECIFIC_EFFECT, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCSpecificEffect), STATIC_SIZE_PACKET)); - Set(HEADER_GC_DRAGON_SOUL_REFINE, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCDragonSoulRefine), STATIC_SIZE_PACKET)); } }; diff --git a/source/UserInterface/PythonNetworkStream.h b/source/UserInterface/PythonNetworkStream.h index e3d5481..1b9c1ba 100644 --- a/source/UserInterface/PythonNetworkStream.h +++ b/source/UserInterface/PythonNetworkStream.h @@ -262,9 +262,6 @@ class CPythonNetworkStream : public CNetworkStream, public CSingleton= c_DragonSoul_Equip_Start) - if (iSlotIndex <= c_DragonSoul_Equip_End) - return Py_BuildValue("i", 1); - - return Py_BuildValue("i", 0); - -} - PyObject * playerIsCostumeSlot(PyObject* poSelf, PyObject* poArgs) { int iSlotIndex; @@ -2120,50 +2102,6 @@ PyObject * playerIsAvailableBeltInventoryCell(PyObject* poSelf, PyObject* poArgs } #endif - -// ¿ëÈ¥¼® °­È­ -PyObject* playerSendDragonSoulRefine(PyObject* poSelf, PyObject* poArgs) -{ - BYTE bSubHeader; - PyObject* pDic; - TItemPos RefineItemPoses[DS_REFINE_WINDOW_MAX_NUM]; - if (!PyTuple_GetByte(poArgs, 0, &bSubHeader)) - return Py_BuildException(); - switch (bSubHeader) - { - case DS_SUB_HEADER_CLOSE: - break; - case DS_SUB_HEADER_DO_UPGRADE: - case DS_SUB_HEADER_DO_IMPROVEMENT: - case DS_SUB_HEADER_DO_REFINE: - { - if (!PyTuple_GetObject(poArgs, 1, &pDic)) - return Py_BuildException(); - int pos = 0; - PyObject* key, *value; - int size = PyDict_Size(pDic); - - while (PyDict_Next(pDic, &pos, &key, &value)) - { - int i = PyInt_AsLong(key); - if (i > DS_REFINE_WINDOW_MAX_NUM) - return Py_BuildException(); - - if (!PyTuple_GetByte(value, 0, &RefineItemPoses[i].window_type) - || !PyTuple_GetInteger(value, 1, &RefineItemPoses[i].cell)) - { - return Py_BuildException(); - } - } - } - break; - } - - CPythonNetworkStream& rns=CPythonNetworkStream::Instance(); - rns.SendDragonSoulRefinePacket(bSubHeader, RefineItemPoses); - - return Py_BuildNone(); -} void initPlayer() { static PyMethodDef s_methods[] = @@ -2273,7 +2211,6 @@ void initPlayer() { "isItem", playerisItem, METH_VARARGS }, { "IsEquipmentSlot", playerIsEquipmentSlot, METH_VARARGS }, - { "IsDSEquipmentSlot", playerIsDSEquipmentSlot, METH_VARARGS }, { "IsCostumeSlot", playerIsCostumeSlot, METH_VARARGS }, { "IsValuableItem", playerIsValuableItem, METH_VARARGS }, { "IsOpenPrivateShop", playerIsOpenPrivateShop, METH_VARARGS }, @@ -2333,7 +2270,6 @@ void initPlayer() { "GetItemLink", playerGetItemLink, METH_VARARGS }, { "SlotTypeToInvenType", playerSlotTypeToInvenType, METH_VARARGS }, - { "SendDragonSoulRefine", playerSendDragonSoulRefine, METH_VARARGS }, { NULL, NULL, NULL }, }; @@ -2555,18 +2491,4 @@ void initPlayer() PyModule_AddIntConstant(poModule, "AUTO_POTION_TYPE_HP", CPythonPlayer::AUTO_POTION_TYPE_HP); PyModule_AddIntConstant(poModule, "AUTO_POTION_TYPE_SP", CPythonPlayer::AUTO_POTION_TYPE_SP); - // ¿ëÈ¥¼® - PyModule_AddIntConstant(poModule, "DRAGON_SOUL_PAGE_SIZE", c_DragonSoul_Inventory_Box_Size); - PyModule_AddIntConstant(poModule, "DRAGON_SOUL_PAGE_COUNT", DRAGON_SOUL_GRADE_MAX); - PyModule_AddIntConstant(poModule, "DRAGON_SOUL_SLOT_COUNT", c_DragonSoul_Inventory_Count); - PyModule_AddIntConstant(poModule, "DRAGON_SOUL_EQUIPMENT_SLOT_START", c_DragonSoul_Equip_Start); - PyModule_AddIntConstant(poModule, "DRAGON_SOUL_EQUIPMENT_PAGE_COUNT", DS_DECK_MAX_NUM); - PyModule_AddIntConstant(poModule, "DRAGON_SOUL_EQUIPMENT_FIRST_SIZE", c_DragonSoul_Equip_Slot_Max); - - // ¿ëÈ¥¼® °³·®Ã¢ - PyModule_AddIntConstant(poModule, "DRAGON_SOUL_REFINE_CLOSE", DS_SUB_HEADER_CLOSE); - PyModule_AddIntConstant(poModule, "DS_SUB_HEADER_DO_UPGRADE", DS_SUB_HEADER_DO_UPGRADE); - PyModule_AddIntConstant(poModule, "DS_SUB_HEADER_DO_IMPROVEMENT", DS_SUB_HEADER_DO_IMPROVEMENT); - PyModule_AddIntConstant(poModule, "DS_SUB_HEADER_DO_REFINE", DS_SUB_HEADER_DO_REFINE); - }