Drachenseelen-Refine-Protokoll aus dem Client-Engine-Code entfernen

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.
This commit is contained in:
Andreas Lierschaft
2026-08-17 23:37:09 +02:00
parent 9ae37cd0ea
commit 5bcf1b92ea
10 changed files with 0 additions and 207 deletions
-11
View File
@@ -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;
-4
View File
@@ -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, // 라마단 이벤트용 특수아이템 초승달의 반지 착용 유무
-44
View File
@@ -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;
@@ -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);
}
@@ -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));
}
};
@@ -262,9 +262,6 @@ class CPythonNetworkStream : public CNetworkStream, public CSingleton<CPythonNet
// CRC Report
bool __SendCRCReportPacket();
// 용홍석 강화
bool SendDragonSoulRefinePacket(BYTE bRefineType, TItemPos* pos);
// Handshake
bool RecvHandshakePacket();
bool RecvHandshakeOKPacket();
@@ -541,9 +538,6 @@ class CPythonNetworkStream : public CNetworkStream, public CSingleton<CPythonNet
// 서버에서 지정한 이팩트 발동 패킷.
bool RecvSpecificEffect();
// 용혼석 관련
bool RecvDragonSoulRefine();
// MiniMap Info
bool RecvNPCList();
bool RecvLandPacket();
@@ -1922,11 +1922,4 @@ void initnet()
PyModule_AddIntConstant(poModule, "EMPIRE_A", 1);
PyModule_AddIntConstant(poModule, "EMPIRE_B", 2);
PyModule_AddIntConstant(poModule, "EMPIRE_C", 3);
PyModule_AddIntConstant(poModule, "DS_SUB_HEADER_REFINE_FAIL", DS_SUB_HEADER_REFINE_FAIL);
PyModule_AddIntConstant(poModule, "DS_SUB_HEADER_REFINE_FAIL_MAX_REFINE", DS_SUB_HEADER_REFINE_FAIL_MAX_REFINE);
PyModule_AddIntConstant(poModule, "DS_SUB_HEADER_REFINE_FAIL_INVALID_MATERIAL", DS_SUB_HEADER_REFINE_FAIL_INVALID_MATERIAL);
PyModule_AddIntConstant(poModule, "DS_SUB_HEADER_REFINE_FAIL_NOT_ENOUGH_MONEY", DS_SUB_HEADER_REFINE_FAIL_NOT_ENOUGH_MONEY);
PyModule_AddIntConstant(poModule, "DS_SUB_HEADER_REFINE_FAIL_NOT_ENOUGH_MATERIAL", DS_SUB_HEADER_REFINE_FAIL_NOT_ENOUGH_MATERIAL);
PyModule_AddIntConstant(poModule, "DS_SUB_HEADER_REFINE_FAIL_TOO_MUCH_MATERIAL", DS_SUB_HEADER_REFINE_FAIL_TOO_MUCH_MATERIAL);
PyModule_AddIntConstant(poModule, "DS_SUB_HEADER_REFINE_SUCCEED", DS_SUB_HEADER_REFINE_SUCCEED);
}
@@ -626,10 +626,6 @@ void CPythonNetworkStream::GamePhase()
ret = RecvSpecificEffect();
break;
case HEADER_GC_DRAGON_SOUL_REFINE:
ret = RecvDragonSoulRefine();
break;
default:
ret = RecvDefaultPacket(header);
break;
@@ -4437,22 +4433,6 @@ bool CPythonNetworkStream::RecvDigMotionPacket()
return true;
}
// 용혼석 강화
bool CPythonNetworkStream::SendDragonSoulRefinePacket(BYTE bRefineType, TItemPos* pos)
{
TPacketCGDragonSoulRefine pk;
pk.header = HEADER_CG_DRAGON_SOUL_REFINE;
pk.bSubType = bRefineType;
memcpy (pk.ItemGrid, pos, sizeof (TItemPos) * DS_REFINE_WINDOW_MAX_NUM);
if (!Send(sizeof (pk), &pk))
{
return false;
}
return true;
}
#if defined(ENABLE_DISCORD_RPC)
#include "discord_rpc.h"
#include "Discord.h"
@@ -908,33 +908,3 @@ bool CPythonNetworkStream::RecvSpecificEffect()
return true;
}
bool CPythonNetworkStream::RecvDragonSoulRefine()
{
TPacketGCDragonSoulRefine kDragonSoul;
if (!Recv(sizeof(kDragonSoul), &kDragonSoul))
return false;
switch (kDragonSoul.bSubType)
{
case DS_SUB_HEADER_OPEN:
PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_DragonSoulRefineWindow_Open", Py_BuildValue("()"));
break;
case DS_SUB_HEADER_REFINE_FAIL:
case DS_SUB_HEADER_REFINE_FAIL_MAX_REFINE:
case DS_SUB_HEADER_REFINE_FAIL_INVALID_MATERIAL:
case DS_SUB_HEADER_REFINE_FAIL_NOT_ENOUGH_MONEY:
case DS_SUB_HEADER_REFINE_FAIL_NOT_ENOUGH_MATERIAL:
case DS_SUB_HEADER_REFINE_FAIL_TOO_MUCH_MATERIAL:
PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_DragonSoulRefineWindow_RefineFail", Py_BuildValue("(iii)",
kDragonSoul.bSubType, kDragonSoul.Pos.window_type, kDragonSoul.Pos.cell));
break;
case DS_SUB_HEADER_REFINE_SUCCEED:
PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_DragonSoulRefineWindow_RefineSucceed",
Py_BuildValue("(ii)", kDragonSoul.Pos.window_type, kDragonSoul.Pos.cell));
break;
}
return true;
}
@@ -1288,24 +1288,6 @@ PyObject * playerIsEquipmentSlot(PyObject* poSelf, PyObject* poArgs)
return Py_BuildValue("i", 0);
}
PyObject * playerIsDSEquipmentSlot(PyObject* poSelf, PyObject* poArgs)
{
BYTE bWindowType;
if (!PyTuple_GetInteger(poArgs, 0, &bWindowType))
return Py_BuildException();
int iSlotIndex;
if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
return Py_BuildException();
if (INVENTORY == bWindowType)
if (iSlotIndex >= 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);
}